From bd64732b376aa3ca1fea7ca99a18d8786bfeddc9 Mon Sep 17 00:00:00 2001 From: Nick Downing Date: Sun, 1 Jan 2017 14:19:07 +1100 Subject: [PATCH 1/1] Initial commit of an unmodified 2.11BSD source tree taken from a boot tape. Unpacked from http://www.tuhs.org/Archive/PDP-11/Distributions/ucb/2.11BSD: 7263558ebfb676b4b9ddacc77da464c5 file7.tar.gz 77397e6d554361c127592b1fea2d776f file8.tar.gz The root of this repository is /usr/src on a running 2.11BSD system. The boot tape file7.tar.gz provides /usr/src/include and /usr/src/sys. The boot tape file8.tar.gz provides everything else in /usr/src. --- Makefile | 118 + asm.sed | 1 + asm.sed.pdp | 1 + asm.sed.vax | 93 + bin/MANIFEST | 68 + bin/Makefile | 109 + bin/PORT/ar.c.Z | Bin 0 -> 6328 bytes bin/PORT/ld.c.Z | Bin 0 -> 25485 bytes bin/PORT/nm.c.Z | Bin 0 -> 3469 bytes bin/PORT/ps.c.Z | Bin 0 -> 19389 bytes bin/adb/Makefile | 41 + bin/adb/READ_ME | 73 + bin/adb/access.c | 161 + bin/adb/command.c | 219 + bin/adb/defs.h | 198 + bin/adb/expr.c | 322 + bin/adb/findfn.c | 64 + bin/adb/format.c | 265 + bin/adb/input.c | 73 + bin/adb/main.c | 158 + bin/adb/message.c | 30 + bin/adb/opset.c | 456 + bin/adb/output.c | 323 + bin/adb/pcs.c | 124 + bin/adb/print.c | 420 + bin/adb/runpcs.c | 298 + bin/adb/setup.c | 218 + bin/adb/sym.c | 351 + bin/ar/Makefile | 36 + bin/ar/append.c | 90 + bin/ar/ar.1 | 255 + bin/ar/ar.5.5 | 143 + bin/ar/ar.c | 238 + bin/ar/archive.c | 323 + bin/ar/archive.h | 101 + bin/ar/contents.c | 113 + bin/ar/delete.c | 97 + bin/ar/extern.h | 46 + bin/ar/extract.c | 127 + bin/ar/misc.c | 142 + bin/ar/move.c | 142 + bin/ar/pathnames.h | 40 + bin/ar/print.c | 89 + bin/ar/replace.c | 186 + bin/ar/strmode.c | 146 + bin/as/Makefile | 17 + bin/as/as0.s | 1982 + bin/as/as2.s | 1799 + bin/awk/EXPLAIN | 87 + bin/awk/Makefile | 55 + bin/awk/README | 99 + bin/awk/awk.def | 135 + bin/awk/awk.g.y | 274 + bin/awk/awk.lx.l | 211 + bin/awk/b.c | 539 + bin/awk/freeze.c | 36 + bin/awk/lib.c | 288 + bin/awk/main.c | 100 + bin/awk/parse.c | 150 + bin/awk/proc.c | 89 + bin/awk/run.c | 884 + bin/awk/test.a | 700 + bin/awk/token.c | 94 + bin/awk/tokenscript | 11 + bin/awk/tran.c | 254 + bin/cat.c | 222 + bin/cc.c | 437 + bin/chflags/Makefile | 38 + bin/chflags/chflags.1 | 102 + bin/chflags/chflags.c | 207 + bin/chgrp.c | 211 + bin/chmod.c | 318 + bin/chpass/Makefile | 57 + bin/chpass/chpass.1 | 161 + bin/chpass/chpass.c | 472 + bin/chpass/chpass.h | 26 + bin/chpass/field.c | 244 + bin/chpass/pathnames.h | 20 + bin/chpass/util.c | 160 + bin/cmp.c | 251 + bin/cp.c | 242 + bin/csh/Makefile | 125 + bin/csh/alloc.c | 383 + bin/csh/alloc11.c | 220 + bin/csh/doprnt.c | 481 + bin/csh/doprnt11.s | 303 + bin/csh/printf.c | 44 + bin/csh/sh.c | 939 + bin/csh/sh.char.c | 109 + bin/csh/sh.char.h | 36 + bin/csh/sh.dir.c | 473 + bin/csh/sh.dir.h | 18 + bin/csh/sh.dol.c | 704 + bin/csh/sh.err.c | 151 + bin/csh/sh.exec.c | 324 + bin/csh/sh.exec.h | 23 + bin/csh/sh.exec2.c | 248 + bin/csh/sh.exp.c | 596 + bin/csh/sh.file.c | 596 + bin/csh/sh.func.c | 1154 + bin/csh/sh.glob.c | 750 + bin/csh/sh.h | 475 + bin/csh/sh.hist.c | 142 + bin/csh/sh.init.c | 249 + bin/csh/sh.lex.c | 1337 + bin/csh/sh.local.h | 51 + bin/csh/sh.misc.c | 383 + bin/csh/sh.parse.c | 633 + bin/csh/sh.print.c | 92 + bin/csh/sh.proc.c | 1101 + bin/csh/sh.proc.h | 84 + bin/csh/sh.sem.c | 412 + bin/csh/sh.set.c | 701 + bin/csh/sh.time.c | 196 + bin/csh/tags | 349 + bin/date.c | 366 + bin/dd.c | 610 + bin/df.c | 293 + bin/diff/Makefile | 27 + bin/diff/diff.c | 212 + bin/diff/diff.h | 85 + bin/diff/diffdir.c | 423 + bin/diff/diffh.c | 270 + bin/diff/diffreg.c | 1052 + bin/disklabel/Makefile | 28 + bin/disklabel/disklabel.5.5 | 358 + bin/disklabel/disklabel.8 | 340 + bin/disklabel/disklabel.c | 1143 + bin/disklabel/pathnames.h | 40 + bin/du.c | 162 + bin/echo.c | 24 + bin/ed.c | 1585 + bin/expr.y | 670 + bin/false.sh | 1 + bin/grep.c | 524 + bin/hostid.c | 59 + bin/hostname/Makefile | 33 + bin/hostname/hostname.1 | 69 + bin/hostname/hostname.c | 86 + bin/kill.c | 74 + bin/ld/Makefile | 25 + bin/ld/ld.1 | 334 + bin/ld/ld.c | 2135 + bin/ln.c | 89 + bin/login/Makefile | 46 + bin/login/login.c | 602 + bin/login/pathnames.h | 27 + bin/ls/Makefile | 29 + bin/ls/ls.c | 698 + bin/ls/stat_flags.c | 154 + bin/mail.c | 729 + bin/make/Makefile | 44 + bin/make/defs | 144 + bin/make/doname.c | 361 + bin/make/dosys.c | 187 + bin/make/files.c | 630 + bin/make/gcos.c | 334 + bin/make/gram.y | 307 + bin/make/ident.c | 101 + bin/make/main.c | 429 + bin/make/misc.c | 342 + bin/mkdir.c | 116 + bin/mt.c | 207 + bin/mv.c | 303 + bin/nice.c | 44 + bin/nm.c.use.disk | 434 + bin/nm/Makefile | 17 + bin/nm/nm.c | 364 + bin/od.c | 883 + bin/pagesize.c | 21 + bin/passwd/Makefile | 51 + bin/passwd/passwd.1 | 48 + bin/passwd/passwd.c | 265 + bin/pathnames.h | 22 + bin/ping/Makefile | 37 + bin/ping/ping.8 | 330 + bin/ping/ping.c | 984 + bin/pr.c | 459 + bin/ps.c | 995 + bin/pwd.c | 35 + bin/rcp.c | 874 + bin/rm.c | 262 + bin/rmail.c | 124 + bin/rmdir.c | 39 + bin/sed/Makefile | 15 + bin/sed/sed.h | 163 + bin/sed/sed0.c | 976 + bin/sed/sed1.c | 720 + bin/sh/Makefile | 34 + bin/sh/args.c | 139 + bin/sh/blok.c | 115 + bin/sh/brkincr.h | 4 + bin/sh/builtin.c | 6 + bin/sh/cmd.c | 410 + bin/sh/ctype.c | 112 + bin/sh/ctype.h | 92 + bin/sh/defs.h | 292 + bin/sh/dup.h | 12 + bin/sh/error.c | 87 + bin/sh/expand.c | 194 + bin/sh/fault.c | 118 + bin/sh/io.c | 136 + bin/sh/mac.h | 61 + bin/sh/macro.c | 237 + bin/sh/main.c | 189 + bin/sh/mode.h | 209 + bin/sh/msg.c | 156 + bin/sh/name.c | 336 + bin/sh/name.h | 27 + bin/sh/print.c | 101 + bin/sh/service.c | 402 + bin/sh/setbrk.c | 21 + bin/sh/stak.c | 85 + bin/sh/stak.h | 78 + bin/sh/string.c | 59 + bin/sh/sym.h | 48 + bin/sh/timeout.h | 12 + bin/sh/word.c | 137 + bin/sh/xec.c | 425 + bin/size.c | 81 + bin/strip.c | 71 + bin/stty/Makefile | 37 + bin/stty/stty.1 | 409 + bin/stty/stty.c | 529 + bin/su.c | 183 + bin/sync.c | 6 + bin/sysctl/Makefile | 37 + bin/sysctl/sysctl.8 | 238 + bin/sysctl/sysctl.c | 621 + bin/tar.c | 1424 + bin/tcsh/FAQ | 87 + bin/tcsh/Fixes | 320 + bin/tcsh/MAKEDIFFS | 41 + bin/tcsh/Makefile | 457 + bin/tcsh/NewThings | 53 + bin/tcsh/README | 143 + bin/tcsh/WishList | 42 + bin/tcsh/alloc11.c | 246 + bin/tcsh/config.h | 110 + bin/tcsh/config_f.h | 132 + bin/tcsh/ed.chared.c | 2020 + bin/tcsh/ed.decls.h | 124 + bin/tcsh/ed.defns.c | 1567 + bin/tcsh/ed.h | 226 + bin/tcsh/ed.init.c | 1094 + bin/tcsh/ed.inputl.c | 580 + bin/tcsh/ed.refresh.c | 1045 + bin/tcsh/ed.screen.c | 1420 + bin/tcsh/ed.xmap.c | 638 + bin/tcsh/eight-bit.me | 141 + bin/tcsh/glob.3 | 319 + bin/tcsh/glob.c | 764 + bin/tcsh/glob.h | 67 + bin/tcsh/jpnerror.c | 42 + bin/tcsh/mkprstr.c | 296 + bin/tcsh/patchlevel.h | 14 + bin/tcsh/pathnames.h | 81 + bin/tcsh/sh.c | 1729 + bin/tcsh/sh.char.c | 316 + bin/tcsh/sh.char.h | 102 + bin/tcsh/sh.decls.h | 361 + bin/tcsh/sh.dir.c | 1126 + bin/tcsh/sh.dir.h | 50 + bin/tcsh/sh.dol.c | 837 + bin/tcsh/sh.err.c | 472 + bin/tcsh/sh.exec.c | 694 + bin/tcsh/sh.exp.c | 706 + bin/tcsh/sh.file.c | 726 + bin/tcsh/sh.func.c | 1733 + bin/tcsh/sh.glob.c | 897 + bin/tcsh/sh.h | 799 + bin/tcsh/sh.hist.c | 226 + bin/tcsh/sh.init.c | 632 + bin/tcsh/sh.lex.c | 1605 + bin/tcsh/sh.misc.c | 460 + bin/tcsh/sh.parse.c | 689 + bin/tcsh/sh.print.c | 226 + bin/tcsh/sh.proc.c | 1863 + bin/tcsh/sh.proc.h | 136 + bin/tcsh/sh.sem.c | 774 + bin/tcsh/sh.set.c | 866 + bin/tcsh/sh.time.c | 623 + bin/tcsh/sh.types.h | 351 + bin/tcsh/tc.alloc.c | 587 + bin/tcsh/tc.bind.c | 950 + bin/tcsh/tc.const.c | 257 + bin/tcsh/tc.decls.h | 250 + bin/tcsh/tc.disc.c | 197 + bin/tcsh/tc.func.c | 1222 + bin/tcsh/tc.h | 45 + bin/tcsh/tc.os.c | 1008 + bin/tcsh/tc.os.h | 406 + bin/tcsh/tc.printf.c | 318 + bin/tcsh/tc.prompt.c | 401 + bin/tcsh/tc.sched.c | 270 + bin/tcsh/tc.sig.c | 400 + bin/tcsh/tc.sig.h | 178 + bin/tcsh/tc.str.c | 409 + bin/tcsh/tc.vers.c | 397 + bin/tcsh/tc.wait.h | 112 + bin/tcsh/tc.who.c | 580 + bin/tcsh/tcsh.man | 2667 ++ bin/tcsh/tw.decls.h | 82 + bin/tcsh/tw.h | 132 + bin/tcsh/tw.help.c | 193 + bin/tcsh/tw.init.c | 290 + bin/tcsh/tw.parse.c | 1500 + bin/tcsh/tw.spell.c | 166 + bin/tee.c | 100 + bin/test/Makefile | 29 + bin/test/TEST.csh | 153 + bin/test/operators.c | 158 + bin/test/operators.h | 73 + bin/test/test.1 | 284 + bin/test/test.c | 573 + bin/time.c | 60 + bin/tp/Makefile | 17 + bin/tp/tp.h | 83 + bin/tp/tp0.c | 6 + bin/tp/tp1.c | 196 + bin/tp/tp2.c | 352 + bin/tp/tp3.c | 252 + bin/tp/tp_defs.h | 7 + bin/true.sh | 1 + bin/wall.c | 153 + bin/who.c | 86 + bin/write.c | 245 + etc/MAKEDEV | 377 + etc/MAKEDEV.local | 26 + etc/Makefile | 80 + etc/aliases | 21 + etc/crontab | 4 + etc/disktab | 616 + etc/dtab | 46 + etc/fstab | 6 + etc/ftpusers | 3 + etc/gettytab | 129 + etc/group | 10 + etc/hosts | 1 + etc/hosts.allow | 4 + etc/hosts.deny | 1 + etc/hosts.equiv | 1 + etc/inetd.conf | 28 + etc/inetd.conf.nowrappers | 28 + etc/master.passwd | 8 + etc/motd | 1 + etc/netstart | 46 + etc/networks | 1 + etc/ntp.conf | 17 + etc/passwd | 8 + etc/phones | 2 + etc/printcap | 30 + etc/protocols | 13 + etc/rc | 165 + etc/rc.local | 23 + etc/remote | 39 + etc/root/Makefile | 19 + etc/root/dot.cshrc | 14 + etc/root/dot.login | 14 + etc/root/dot.profile | 8 + etc/services | 68 + etc/shells | 6 + etc/syslog.conf | 14 + etc/ttys | 29 + etc/uucp/L-devices | 1 + etc/uucp/L-dialcodes | 2 + etc/uucp/L.cmds | 4 + etc/uucp/L.sys | 2 + etc/uucp/L_stat | 0 etc/uucp/L_sub | 0 etc/uucp/Makefile | 29 + etc/uucp/SEQF | 2 + etc/uucp/USERFILE | 1 + etc/uucp/clean.daily | 46 + etc/uucp/clean.weekly | 11 + etc/uucp/uucp-map | 0 games/Makefile | 94 + games/PORT/aard.tar.Z | Bin 0 -> 34069 bytes games/PORT/doctor.tar.Z | Bin 0 -> 11258 bytes games/PORT/larn.tar.Z | Bin 0 -> 536555 bytes games/adventure/FILES | 12 + games/adventure/Makefile | 53 + games/adventure/done.c | 101 + games/adventure/glorkz | 1813 + games/adventure/hdr.h | 119 + games/adventure/init.c | 181 + games/adventure/io.c | 501 + games/adventure/main.c | 532 + games/adventure/okplay.c | 64 + games/adventure/save.c | 137 + games/adventure/subr.c | 789 + games/adventure/vocab.c | 185 + games/adventure/wizard.c | 98 + games/arithmetic.c | 218 + games/atc/BUGS | 4 + games/atc/Makefile | 108 + games/atc/def.h | 42 + games/atc/extern.c | 36 + games/atc/extern.h | 24 + games/atc/games/ATC_scores | 5 + games/atc/games/Game_List | 5 + games/atc/games/Killer | 21 + games/atc/games/crossover | 14 + games/atc/games/default | 21 + games/atc/games/easy | 15 + games/atc/games/game_2 | 22 + games/atc/grammar.y | 349 + games/atc/graphics.c | 378 + games/atc/include.h | 50 + games/atc/input.c | 626 + games/atc/lex.l | 28 + games/atc/list.c | 75 + games/atc/log.c | 213 + games/atc/main.c | 279 + games/atc/struct.h | 73 + games/atc/tunable.c | 24 + games/atc/tunable.h | 12 + games/atc/update.c | 365 + games/backgammon/Makefile | 51 + games/backgammon/Mesgfix | 36 + games/backgammon/allow.c | 82 + games/backgammon/back.h | 101 + games/backgammon/backgammon.src | 195 + games/backgammon/board.c | 149 + games/backgammon/check.c | 131 + games/backgammon/data.c | 288 + games/backgammon/extra.c | 226 + games/backgammon/fancy.c | 723 + games/backgammon/init.c | 38 + games/backgammon/main.c | 564 + games/backgammon/message.c | 15 + games/backgammon/move.c | 524 + games/backgammon/odds.c | 86 + games/backgammon/one.c | 142 + games/backgammon/save.c | 153 + games/backgammon/subs.c | 448 + games/backgammon/table.c | 281 + games/backgammon/teach.c | 134 + games/backgammon/text.c | 105 + games/backgammon/ttext1.c | 157 + games/backgammon/ttext2.c | 166 + games/backgammon/tutor.c | 128 + games/backgammon/tutor.h | 18 + games/banner.c | 1132 + games/battlestar/Makefile | 76 + games/battlestar/battlestar.6 | 140 + games/battlestar/battlestar.c | 63 + games/battlestar/com1.c | 235 + games/battlestar/com2.c | 269 + games/battlestar/com3.c | 285 + games/battlestar/com4.c | 349 + games/battlestar/com5.c | 297 + games/battlestar/com6.c | 182 + games/battlestar/com7.c | 241 + games/battlestar/cypher.c | 403 + games/battlestar/dayfile.c | 1180 + games/battlestar/dayobjs.c | 111 + games/battlestar/externs.h | 286 + games/battlestar/fly.c | 258 + games/battlestar/getcom.c | 72 + games/battlestar/globals.c | 198 + games/battlestar/init.c | 103 + games/battlestar/misc.c | 35 + games/battlestar/mkstr.c | 291 + games/battlestar/nightfile.c | 1152 + games/battlestar/nightobjs.c | 73 + games/battlestar/parse.c | 74 + games/battlestar/room.c | 260 + games/battlestar/save.c | 122 + games/battlestar/words.c | 179 + games/bcd.c | 136 + games/boggle/Makefile | 32 + games/boggle/boggle.c | 652 + games/boggle/comp.c | 37 + games/boggle/inst | 42 + games/boggle/sfile | 10 + games/btlgammon/Makefile | 36 + games/btlgammon/backrules | 19 + games/btlgammon/btlgammon.c | 717 + games/canfield.c | 1634 + games/cfscores.c | 120 + games/cribbage/:ctfix | 3 + games/cribbage/Makefile | 51 + games/cribbage/cards.c | 134 + games/cribbage/crib.c | 587 + games/cribbage/cribbage.h | 34 + games/cribbage/cribbage.n | 318 + games/cribbage/cribcur.h | 30 + games/cribbage/deck.h | 58 + games/cribbage/extern.c | 40 + games/cribbage/io.c | 575 + games/cribbage/macro | 126 + games/cribbage/score.c | 337 + games/cribbage/support.c | 330 + games/cribbage/test.c | 131 + games/factor.c | 100 + games/fish.c | 509 + games/fortune/Do_troff | 4 + games/fortune/Makefile | 72 + games/fortune/Troff.mac | 26 + games/fortune/Troff.sed | 13 + games/fortune/fortune.c | 237 + games/fortune/notes | 140 + games/fortune/obscene | 10500 +++++ games/fortune/obscene.4.3 | 1499 + games/fortune/obscene.sp.ok | 238 + games/fortune/rnd.c | 365 + games/fortune/scene | 35245 ++++++++++++++++ games/fortune/scene.4.3 | 9761 +++++ games/fortune/scene.sp.ok | 1175 + games/fortune/strfile.c | 394 + games/fortune/strfile.h | 20 + games/fortune/unstr.c | 127 + games/hack/Makefile | 307 + games/hack/Makefile.orig | 196 + games/hack/Original_READ_ | 61 + games/hack/READ_ME | 92 + games/hack/alloc.c | 47 + games/hack/config.h | 192 + games/hack/crypt.c | 797 + games/hack/data | 232 + games/hack/date.h | 2 + games/hack/def.edog.h | 12 + games/hack/def.eshk.h | 24 + games/hack/def.flag.h | 42 + games/hack/def.func_tab.h | 16 + games/hack/def.gen.h | 15 + games/hack/def.gold.h | 12 + games/hack/def.mkroom.h | 26 + games/hack/def.monst.h | 60 + games/hack/def.obj.h | 48 + games/hack/def.objclass.h | 60 + games/hack/def.objects.h | 289 + games/hack/def.permonst.h | 25 + games/hack/def.rm.h | 56 + games/hack/def.trap.h | 27 + games/hack/def.wseg.h | 13 + games/hack/hack.6 | 155 + games/hack/hack.Decl.c | 43 + games/hack/hack.apply.c | 446 + games/hack/hack.bones.c | 95 + games/hack/hack.c | 798 + games/hack/hack.cmd.c | 301 + games/hack/hack.do.c | 490 + games/hack/hack.do_name.c | 289 + games/hack/hack.do_wear.c | 336 + games/hack/hack.dog.c | 413 + games/hack/hack.eat.c | 459 + games/hack/hack.end.c | 641 + games/hack/hack.engrave.c | 306 + games/hack/hack.fight.c | 358 + games/hack/hack.h | 163 + games/hack/hack.invent.c | 860 + games/hack/hack.ioctl.c | 55 + games/hack/hack.lev.c | 285 + games/hack/hack.main.c | 499 + games/hack/hack.makemon.c | 200 + games/hack/hack.mfndpos.h | 12 + games/hack/hack.mhitu.c | 363 + games/hack/hack.mklev.c | 738 + games/hack/hack.mkmaze.c | 136 + games/hack/hack.mkobj.c | 149 + games/hack/hack.mkshop.c | 274 + games/hack/hack.mon.c | 846 + games/hack/hack.monst.c | 79 + games/hack/hack.o_init.c | 160 + games/hack/hack.objnam.c | 547 + games/hack/hack.onames.h | 227 + games/hack/hack.options.c | 203 + games/hack/hack.pager.c | 401 + games/hack/hack.potion.c | 386 + games/hack/hack.pri.c | 660 + games/hack/hack.read.c | 539 + games/hack/hack.rip.c | 81 + games/hack/hack.rumors.c | 63 + games/hack/hack.save.c | 238 + games/hack/hack.search.c | 133 + games/hack/hack.sh | 14 + games/hack/hack.shk.c | 978 + games/hack/hack.shknam.c | 188 + games/hack/hack.steal.c | 203 + games/hack/hack.termcap.c | 276 + games/hack/hack.timeout.c | 62 + games/hack/hack.topl.c | 192 + games/hack/hack.track.c | 38 + games/hack/hack.trap.c | 447 + games/hack/hack.tty.c | 261 + games/hack/hack.u_init.c | 357 + games/hack/hack.unix.c | 430 + games/hack/hack.vault.c | 259 + games/hack/hack.version.c | 16 + games/hack/hack.wield.c | 99 + games/hack/hack.wizard.c | 189 + games/hack/hack.worm.c | 183 + games/hack/hack.worn.c | 65 + games/hack/hack.zap.c | 642 + games/hack/help | 132 + games/hack/hh | 55 + games/hack/makedefs.c | 217 + games/hack/play.c | 28 + games/hack/rnd.c | 30 + games/hack/rumors | 505 + games/hack/strcmpfix.l | 60 + games/hangman/Makefile | 22 + games/hangman/endgame.c | 36 + games/hangman/extern.c | 37 + games/hangman/getguess.c | 70 + games/hangman/getword.c | 55 + games/hangman/hangman.h | 46 + games/hangman/main.c | 29 + games/hangman/playgame.c | 23 + games/hangman/prdata.c | 21 + games/hangman/prman.c | 18 + games/hangman/prword.c | 12 + games/hangman/setup.c | 35 + games/hunt/Makefile | 127 + games/hunt/README | 9 + games/hunt/answer.c | 359 + games/hunt/connect.c | 28 + games/hunt/draw.c | 388 + games/hunt/driver.c | 671 + games/hunt/execute.c | 497 + games/hunt/expl.c | 198 + games/hunt/extern.c | 45 + games/hunt/hunt.c | 717 + games/hunt/hunt.h | 307 + games/hunt/makemaze.c | 145 + games/hunt/pathname.c | 37 + games/hunt/playit.c | 386 + games/hunt/shots.c | 823 + games/hunt/terminal.c | 114 + games/mille/Makefile | 75 + games/mille/comp.c | 431 + games/mille/end.c | 111 + games/mille/extern.c | 135 + games/mille/init.c | 214 + games/mille/mille.c | 135 + games/mille/mille.h | 195 + games/mille/misc.c | 224 + games/mille/move.c | 517 + games/mille/print.c | 132 + games/mille/roll.c | 20 + games/mille/save.c | 132 + games/mille/table.c | 21 + games/mille/types.c | 38 + games/mille/unctrl.h | 9 + games/mille/varpush.c | 53 + games/monop/:rofix | 3 + games/monop/Makefile | 87 + games/monop/brd.dat | 43 + games/monop/cards.c | 170 + games/monop/cards.inp | 122 + games/monop/deck.h | 13 + games/monop/execute.c | 224 + games/monop/getinp.c | 83 + games/monop/houses.c | 230 + games/monop/initdeck.c | 140 + games/monop/jail.c | 90 + games/monop/misc.c | 326 + games/monop/mon.dat | 9 + games/monop/monop.c | 121 + games/monop/monop.def | 89 + games/monop/monop.ext | 22 + games/monop/monop.h | 98 + games/monop/morg.c | 173 + games/monop/print.c | 154 + games/monop/prop.c | 172 + games/monop/prop.dat | 23 + games/monop/rent.c | 55 + games/monop/roll.c | 37 + games/monop/spec.c | 49 + games/monop/strcmp.c | 21 + games/monop/strings | 0 games/monop/trade.c | 271 + games/morse.c | 78 + games/number.c | 204 + games/pdp/Makefile | 66 + games/pdp/bj.s | 347 + games/pdp/chess/Makefile | 22 + games/pdp/chess/README | 2 + games/pdp/chess/agen.c | 94 + games/pdp/chess/att.s | 293 + games/pdp/chess/bgen.s | 190 + games/pdp/chess/bheur.c | 146 + games/pdp/chess/bmove.s | 180 + games/pdp/chess/book.c | 68 + games/pdp/chess/bplay.c | 136 + games/pdp/chess/ctrl.s | 140 + games/pdp/chess/data.c | 76 + games/pdp/chess/init.c | 148 + games/pdp/chess/io.c | 230 + games/pdp/chess/mater.c | 106 + games/pdp/chess/old.h | 60 + games/pdp/chess/pio.c | 377 + games/pdp/chess/play.c | 247 + games/pdp/chess/qsort.s | 161 + games/pdp/chess/savres.c | 59 + games/pdp/chess/setup.c | 134 + games/pdp/chess/stat.c | 106 + games/pdp/chess/stdin.c | 202 + games/pdp/chess/wgen.s | 189 + games/pdp/chess/wheur.c | 197 + games/pdp/chess/wmove.s | 180 + games/pdp/chess/wplay.c | 136 + games/pdp/etc.s | 146 + games/pdp/factor.nofp.s | 396 + games/pdp/factor.s | 389 + games/pdp/moo.s | 106 + games/pdp/primes.nofp.s | 374 + games/pdp/primes.s | 367 + games/pdp/ttt.s | 340 + games/pdp/us.s | 17 + games/pdp/zork/1.s | 3 + games/pdp/zork/Makefile | 38 + games/pdp/zork/READ_ME | 41 + games/pdp/zork/d | Bin 0 -> 52224 bytes games/pdp/zork/dindex.dat | Bin 0 -> 12288 bytes games/pdp/zork/doverlay | Bin 0 -> 109056 bytes games/pdp/zork/dtext.dat | Bin 0 -> 228864 bytes games/pdp/zork/notes | 14 + games/pdp/zork/o.s | 485 + games/pdp/zork/p1 | 42 + games/pdp/zork/z.c | 165 + games/pdp/zork/zork.c | 103 + games/phantasia/Makefile | 115 + games/phantasia/fight.c | 607 + games/phantasia/func0.c | 1003 + games/phantasia/func1.c | 917 + games/phantasia/func2.c | 832 + games/phantasia/main.c | 586 + games/phantasia/monsters | 99 + games/phantasia/phant.h | 174 + games/phantasia/phant.nr | 1184 + games/phantasia/phant_run.c | 16 + games/phantasia/setfiles.c | 138 + games/phantasia/test.c | 7 + games/ppt.c | 28 + games/primes.c | 151 + games/quiz/Makefile | 42 + games/quiz/quiz.c | 477 + games/quiz/quiz.k/africa | 44 + games/quiz/quiz.k/america | 27 + games/quiz/quiz.k/areas | 124 + games/quiz/quiz.k/arith | 45 + games/quiz/quiz.k/asia | 41 + games/quiz/quiz.k/babies | 21 + games/quiz/quiz.k/bard | 228 + games/quiz/quiz.k/chinese | 12 + games/quiz/quiz.k/collectives | 88 + games/quiz/quiz.k/ed | 84 + games/quiz/quiz.k/elements | 103 + games/quiz/quiz.k/europe | 33 + games/quiz/quiz.k/greek | 7 + games/quiz/quiz.k/inca | 12 + games/quiz/quiz.k/index | 30 + games/quiz/quiz.k/latin | 157 + games/quiz/quiz.k/locomotive | 11 + games/quiz/quiz.k/midearth | 10 + games/quiz/quiz.k/morse | 26 + games/quiz/quiz.k/murders | 25 + games/quiz/quiz.k/poetry | 184 + games/quiz/quiz.k/posneg | 50 + games/quiz/quiz.k/pres | 38 + games/quiz/quiz.k/province | 13 + games/quiz/quiz.k/seq-easy | 14 + games/quiz/quiz.k/seq-hard | 15 + games/quiz/quiz.k/sexes | 26 + games/quiz/quiz.k/sov | 42 + games/quiz/quiz.k/spell | 2 + games/quiz/quiz.k/state | 50 + games/quiz/quiz.k/trek | 19 + games/quiz/quiz.k/ucc | 127 + games/rain.c | 188 + games/robots/Makefile | 31 + games/robots/extern.c | 48 + games/robots/flush_in.c | 24 + games/robots/init_field.c | 90 + games/robots/main.c | 167 + games/robots/make_level.c | 62 + games/robots/move.c | 272 + games/robots/move_robs.c | 124 + games/robots/play_level.c | 88 + games/robots/query.c | 33 + games/robots/rnd_pos.c | 41 + games/robots/robots.h | 83 + games/robots/score.c | 155 + games/rogue/CHANGES | 53 + games/rogue/Makefile | 158 + games/rogue/curses.c | 658 + games/rogue/hit.c | 420 + games/rogue/init.c | 299 + games/rogue/inventory.c | 738 + games/rogue/level.c | 845 + games/rogue/machdep.c | 658 + games/rogue/main.c | 43 + games/rogue/message.c | 343 + games/rogue/monster.c | 831 + games/rogue/move.c | 611 + games/rogue/object.c | 747 + games/rogue/pack.c | 534 + games/rogue/play.c | 262 + games/rogue/random.c | 92 + games/rogue/ring.c | 300 + games/rogue/rogue.h | 457 + games/rogue/room.c | 613 + games/rogue/save.c | 390 + games/rogue/score.c | 544 + games/rogue/spec_hit.c | 498 + games/rogue/throw.c | 286 + games/rogue/trap.c | 247 + games/rogue/use.c | 582 + games/rogue/zap.c | 369 + games/sail/:file | 10 + games/sail/:scene | 3 + games/sail/:ship | 4 + games/sail/:specs | 3 + games/sail/Makefile | 78 + games/sail/assorted.c | 247 + games/sail/dr_1.c | 434 + games/sail/dr_2.c | 248 + games/sail/dr_3.c | 319 + games/sail/dr_4.c | 38 + games/sail/dr_5.c | 66 + games/sail/dr_main.c | 81 + games/sail/driver.h | 11 + games/sail/externs.h | 283 + games/sail/game.c | 60 + games/sail/globals.c | 480 + games/sail/lo_main.c | 62 + games/sail/machdep.h | 11 + games/sail/main.c | 109 + games/sail/misc.c | 205 + games/sail/parties.c | 49 + games/sail/pl_1.c | 106 + games/sail/pl_2.c | 127 + games/sail/pl_3.c | 245 + games/sail/pl_4.c | 102 + games/sail/pl_5.c | 227 + games/sail/pl_6.c | 169 + games/sail/pl_7.c | 450 + games/sail/pl_main.c | 217 + games/sail/player.h | 95 + games/sail/sail.6 | 872 + games/sail/sync.c | 394 + games/sail/version.c | 11 + games/snake/Makefile | 41 + games/snake/busy.c | 36 + games/snake/move.c | 634 + games/snake/snake.c | 914 + games/snake/snake.h | 49 + games/snake/snscore.c | 83 + games/trek/DOC/read_me.nr | 251 + games/trek/DOC/things | 10 + games/trek/DOC/trekmanual.nr | 895 + games/trek/Makefile | 182 + games/trek/README | 4 + games/trek/abandon.c | 130 + games/trek/attack.c | 161 + games/trek/autover.c | 50 + games/trek/board.x | 59 + games/trek/capture.c | 101 + games/trek/cgetc.c | 17 + games/trek/check_out.c | 43 + games/trek/checkcond.c | 77 + games/trek/compkl.c | 85 + games/trek/computer.c | 316 + games/trek/damage.c | 64 + games/trek/damaged.c | 40 + games/trek/dcrept.c | 72 + games/trek/destruct.c | 83 + games/trek/dock.c | 117 + games/trek/dumpgame.c | 134 + games/trek/dumpme.c | 61 + games/trek/dumpssradio.c | 58 + games/trek/events.c | 436 + games/trek/externs.c | 71 + games/trek/getcodi.c | 41 + games/trek/getpar.c | 270 + games/trek/getpar.h | 18 + games/trek/help.c | 130 + games/trek/impulse.c | 53 + games/trek/initquad.c | 125 + games/trek/kill.c | 200 + games/trek/klmove.c | 155 + games/trek/lose.c | 58 + games/trek/lrscan.c | 80 + games/trek/main.c | 206 + games/trek/move.c | 203 + games/trek/nova.c | 114 + games/trek/out.c | 29 + games/trek/phaser.c | 342 + games/trek/play.c | 84 + games/trek/ram.c | 74 + games/trek/ranf.c | 30 + games/trek/rest.c | 53 + games/trek/schedule.c | 146 + games/trek/score.c | 77 + games/trek/setup.c | 276 + games/trek/setwarp.c | 37 + games/trek/shell.c | 33 + games/trek/shield.c | 116 + games/trek/snova.c | 131 + games/trek/srscan.c | 163 + games/trek/systemname.c | 40 + games/trek/torped.c | 220 + games/trek/trek.h | 354 + games/trek/utility.c | 123 + games/trek/visual.c | 74 + games/trek/warp.c | 155 + games/trek/win.c | 62 + games/wargames.sh | 83 + games/warp/Configure | 2115 + games/warp/EXTERN.h | 24 + games/warp/INTERN.h | 22 + games/warp/MAKELOG | 28 + games/warp/MANIFEST | 58 + games/warp/Makefile | 537 + games/warp/Makefile.SH | 190 + games/warp/README | 95 + games/warp/UU/filexp | 32 + games/warp/UU/grimble | 41 + games/warp/UU/myread | 21 + games/warp/bang.c | 153 + games/warp/bang.h | 30 + games/warp/config.H | 92 + games/warp/config.h | 254 + games/warp/config.h.SH | 269 + games/warp/config.sh | 128 + games/warp/filexp | 32 + games/warp/init.c | 552 + games/warp/init.h | 9 + games/warp/intrp.c | 678 + games/warp/intrp.h | 23 + games/warp/makedepend | 129 + games/warp/makedepend.SH | 157 + games/warp/makedir | 58 + games/warp/makedir.SH | 66 + games/warp/move.c | 680 + games/warp/move.h | 14 + games/warp/ndir.c | 121 + games/warp/ndir.h | 65 + games/warp/object.c | 82 + games/warp/object.h | 71 + games/warp/patchlevel.h | 1 + games/warp/play.c | 180 + games/warp/play.h | 13 + games/warp/score.c | 709 + games/warp/score.h | 49 + games/warp/sig.c | 228 + games/warp/sig.h | 16 + games/warp/sm.c | 81 + games/warp/smp.0 | 23 + games/warp/smp.1 | 23 + games/warp/smp.2 | 23 + games/warp/smp.3 | 23 + games/warp/smp.4 | 23 + games/warp/smp.5 | 23 + games/warp/smp.6 | 23 + games/warp/smp.7 | 23 + games/warp/term.c | 818 + games/warp/term.h | 309 + games/warp/them.c | 406 + games/warp/them.h | 11 + games/warp/us.c | 510 + games/warp/us.h | 61 + games/warp/util.c | 326 + games/warp/util.h | 88 + games/warp/version.c | 21 + games/warp/version.h | 9 + games/warp/warp.c | 406 + games/warp/warp.doc | 193 + games/warp/warp.h | 469 + games/warp/warp.man | 133 + games/warp/warp.news | 4 + games/warp/weapon.c | 688 + games/warp/weapon.h | 22 + games/words/Makefile | 13 + games/words/words.sh | 1 + games/words/words1.c | 53 + games/worm.c | 278 + games/worms.c | 364 + games/wump.c | 398 + include/Makefile | 99 + include/Makefile.install | 63 + include/OLD/dk.h | 56 + include/OLD/psout.h | 42 + include/a.out.h | 72 + include/ar.h | 62 + include/arpa/ftp.h | 91 + include/arpa/inet.h | 29 + include/arpa/nameser.h | 247 + include/arpa/telnet.h | 103 + include/arpa/tftp.h | 59 + include/assert.h | 9 + include/ctype.h | 28 + include/curses.h | 170 + include/dbm.h | 28 + include/errno.h | 98 + include/fcntl.h | 40 + include/frame.h | 19 + include/fstab.h | 42 + include/grp.h | 10 + include/lastlog.h | 13 + include/math.h | 18 + include/memory.h | 17 + include/mp.h | 26 + include/mtab.h | 16 + include/ndbm.h | 66 + include/netdb.h | 71 + include/nlist.h | 81 + include/pascal/unixio.h | 26 + include/pascal/unixio.i | 76 + include/paths.h | 36 + include/pcc.h | 229 + include/protocols/dumprestor.h | 46 + include/protocols/routed.h | 64 + include/protocols/rwhod.h | 34 + include/protocols/talkd.h | 84 + include/protocols/timed.h | 67 + include/pwd.h | 43 + include/ranlib.h | 50 + include/regexp.h | 21 + include/resolv.h | 50 + include/setjmp.h | 3 + include/sgtty.h | 5 + include/signal.h | 126 + include/stab.h | 42 + include/stdio.h | 65 + include/string.h | 29 + include/strings.h | 30 + include/struct.h | 9 + include/syscall.h | 168 + include/sysexits.h | 97 + include/syslog.h | 64 + include/time.h | 27 + include/ttyent.h | 22 + include/tzfile.h | 101 + include/utmp.h | 31 + include/varargs.h | 7 + include/vfont.h | 27 + include/vmf.h | 64 + lib/Makefile | 34 + lib/PORT/mip.tar.Z | Bin 0 -> 123087 bytes lib/PORT/pcc.tar.Z | Bin 0 -> 74539 bytes lib/c2/Makefile | 20 + lib/c2/c2.h | 147 + lib/c2/c20.c | 731 + lib/c2/c21.c | 1049 + lib/ccom/Makefile | 44 + lib/ccom/TEST/Makefile | 53 + lib/ccom/TEST/README | 197 + lib/ccom/TEST/ctest | 21 + lib/ccom/TEST/old-assn.l | 172 + lib/ccom/TEST/tpr.c | 265 + lib/ccom/TEST/tprint.c | 296 + lib/ccom/TEST/tst_adec.c | 10 + lib/ccom/TEST/tst_asm.c | 10 + lib/ccom/TEST/tst_assign.c | 10 + lib/ccom/TEST/tst_lgm-g.c | 48 + lib/ccom/TEST/tst_lgm.c | 47 + lib/ccom/TEST/tst_longsym.c | 9 + lib/ccom/TEST/tst_pntint.c | 46 + lib/ccom/TEST/tst_rhh-g.c | 7 + lib/ccom/TEST/tst_rhh.c | 7 + lib/ccom/TEST/tst_sgncmp.c | 39 + lib/ccom/c0.h | 489 + lib/ccom/c00.c | 899 + lib/ccom/c01.c | 953 + lib/ccom/c02.c | 822 + lib/ccom/c03.c | 740 + lib/ccom/c04.c | 435 + lib/ccom/c05.c | 203 + lib/ccom/c1.h | 387 + lib/ccom/c10.c | 1372 + lib/ccom/c11.c | 1217 + lib/ccom/c12.c | 1219 + lib/ccom/c13.c | 442 + lib/ccom/cvopt.c | 435 + lib/ccom/optable | 2255 + lib/cpp/Makefile | 39 + lib/cpp/README | 163 + lib/cpp/cpp.c | 1247 + lib/cpp/cpy.y | 83 + lib/cpp/yylex.c | 92 + lib/libc/Makefile | 106 + lib/libc/compat-4.1/Makefile | 72 + lib/libc/compat-4.1/ftime.c | 38 + lib/libc/compat-4.1/gtty.c | 22 + lib/libc/compat-4.1/nice.c | 28 + lib/libc/compat-4.1/pause.c | 22 + lib/libc/compat-4.1/rand.c | 26 + lib/libc/compat-4.1/stty.c | 22 + lib/libc/compat-4.1/times.c | 39 + lib/libc/compat-4.1/utime.c | 26 + lib/libc/compat-43/Makefile | 40 + lib/libc/compat-43/creat.c | 45 + lib/libc/compat-43/gethostid.c | 54 + lib/libc/compat-43/sethostid.c | 52 + lib/libc/compat-43/setregid.c | 62 + lib/libc/compat-43/setreuid.c | 62 + lib/libc/compat-43/setrgid.c | 46 + lib/libc/compat-43/setruid.c | 46 + lib/libc/compat-43/sigcompat.c | 85 + lib/libc/compat-sys5/Makefile | 34 + lib/libc/compat-sys5/memccpy.c | 24 + lib/libc/compat-sys5/memchr.c | 24 + lib/libc/compat-sys5/memcmp.c | 23 + lib/libc/compat-sys5/memcpy.c | 26 + lib/libc/compat-sys5/memset.c | 26 + lib/libc/compat-sys5/strchr.c | 23 + lib/libc/compat-sys5/strrchr.c | 26 + lib/libc/compat-sys5/tmpnam.c | 77 + lib/libc/gen/Makefile | 318 + lib/libc/gen/abort.c | 64 + lib/libc/gen/abs.c | 15 + lib/libc/gen/alarm.c | 30 + lib/libc/gen/atoi.c | 28 + lib/libc/gen/atol.c | 29 + lib/libc/gen/bcmp.c | 24 + lib/libc/gen/bcopy.c | 31 + lib/libc/gen/bzero.c | 23 + lib/libc/gen/calloc.c | 27 + lib/libc/gen/closedir.c | 25 + lib/libc/gen/crypt.c | 382 + lib/libc/gen/ctime.c | 389 + lib/libc/gen/ctype_.c | 25 + lib/libc/gen/daemon.c | 73 + lib/libc/gen/devname.c | 78 + lib/libc/gen/disklabel.c | 476 + lib/libc/gen/err.c | 209 + lib/libc/gen/execvp.c | 87 + lib/libc/gen/fabs.c | 16 + lib/libc/gen/fakcu.c | 11 + lib/libc/gen/ffs.c | 24 + lib/libc/gen/frexp.c | 41 + lib/libc/gen/fstab.c | 208 + lib/libc/gen/gcvt.c | 66 + lib/libc/gen/getenv.c | 54 + lib/libc/gen/getgrent.c | 65 + lib/libc/gen/getgrgid.c | 18 + lib/libc/gen/getgrnam.c | 18 + lib/libc/gen/getgrouplist.c | 87 + lib/libc/gen/gethostname.c | 54 + lib/libc/gen/getloadavg.c | 68 + lib/libc/gen/getlogin.c | 58 + lib/libc/gen/getmntinfo.c | 69 + lib/libc/gen/getpagesize.c | 53 + lib/libc/gen/getpass.c | 44 + lib/libc/gen/getpwent.c | 289 + lib/libc/gen/getttyent.c | 137 + lib/libc/gen/getttynam.c | 26 + lib/libc/gen/getusershell.c | 120 + lib/libc/gen/getwd.c | 114 + lib/libc/gen/index.c | 21 + lib/libc/gen/initgroups.c | 50 + lib/libc/gen/insque.c | 29 + lib/libc/gen/isatty.c | 18 + lib/libc/gen/malloc.c | 230 + lib/libc/gen/mktemp.c | 96 + lib/libc/gen/ndbm.c | 528 + lib/libc/gen/nlist.c | 103 + lib/libc/gen/opendir.c | 34 + lib/libc/gen/perror.c | 67 + lib/libc/gen/popen.c | 133 + lib/libc/gen/psignal.c | 36 + lib/libc/gen/qsort.c | 207 + lib/libc/gen/random.c | 354 + lib/libc/gen/readdir.c | 43 + lib/libc/gen/regex.c | 401 + lib/libc/gen/remque.c | 27 + lib/libc/gen/rindex.c | 24 + lib/libc/gen/scandir.c | 91 + lib/libc/gen/seekdir.c | 39 + lib/libc/gen/setenv.c | 90 + lib/libc/gen/sethostname.c | 52 + lib/libc/gen/setmode.c | 459 + lib/libc/gen/siginterrupt.c | 61 + lib/libc/gen/siglist.c | 46 + lib/libc/gen/signal.c | 60 + lib/libc/gen/sigsetops.c | 81 + lib/libc/gen/sleep.c | 48 + lib/libc/gen/strcasecmp.c | 72 + lib/libc/gen/strcat.c | 23 + lib/libc/gen/strcmp.c | 17 + lib/libc/gen/strcpy.c | 20 + lib/libc/gen/strdup.c | 37 + lib/libc/gen/strftime.c | 271 + lib/libc/gen/strlen.c | 19 + lib/libc/gen/strncat.c | 28 + lib/libc/gen/strncmp.c | 18 + lib/libc/gen/strncpy.c | 25 + lib/libc/gen/swab.c | 30 + lib/libc/gen/sysctl.c | 135 + lib/libc/gen/syserrlst.c | 91 + lib/libc/gen/syslog.c | 266 + lib/libc/gen/system.c | 75 + lib/libc/gen/telldir.c | 24 + lib/libc/gen/time.c | 28 + lib/libc/gen/timezone.c | 106 + lib/libc/gen/ttyname.c | 51 + lib/libc/gen/ttyslot.c | 48 + lib/libc/gen/ualarm.c | 37 + lib/libc/gen/uname.c | 90 + lib/libc/gen/usleep.c | 34 + lib/libc/gen/valloc.c | 31 + lib/libc/gen/wait.c | 48 + lib/libc/gen/wait3.c | 50 + lib/libc/gen/waitpid.c | 50 + lib/libc/inet/Makefile | 70 + lib/libc/inet/inet_addr.c | 103 + lib/libc/inet/inet_lnaof.c | 31 + lib/libc/inet/inet_maddr.c | 32 + lib/libc/inet/inet_netof.c | 58 + lib/libc/inet/inet_network.c | 65 + lib/libc/inet/inet_ntoa.c | 29 + lib/libc/net/Makefile | 111 + lib/libc/net/getnbyaddr.c | 29 + lib/libc/net/getnbyname.c | 34 + lib/libc/net/getnent.c | 109 + lib/libc/net/getpent.c | 107 + lib/libc/net/getpname.c | 34 + lib/libc/net/getproto.c | 28 + lib/libc/net/getsbyname.c | 37 + lib/libc/net/getsbyport.c | 32 + lib/libc/net/getsent.c | 110 + lib/libc/net/herror.c | 49 + lib/libc/net/hosttable/Makefile | 56 + lib/libc/net/hosttable/gethnamadr.c | 156 + lib/libc/net/hosttable/gethostent.c | 133 + lib/libc/net/named/Makefile | 57 + lib/libc/net/named/gethnamadr.c | 401 + lib/libc/net/named/sethostent.c | 34 + lib/libc/net/rcmd.c | 339 + lib/libc/net/res_comp.c | 310 + lib/libc/net/res_debug.c | 439 + lib/libc/net/res_init.c | 138 + lib/libc/net/res_mkquery.c | 200 + lib/libc/net/res_query.c | 248 + lib/libc/net/res_send.c | 364 + lib/libc/net/rexec.c | 116 + lib/libc/net/ruserpass.c | 811 + lib/libc/ns/Makefile | 61 + lib/libc/ns/ns_addr.c | 196 + lib/libc/ns/ns_ntoa.c | 73 + lib/libc/pdp/Makefile | 40 + lib/libc/pdp/compat-2.9/Makefile | 68 + lib/libc/pdp/compat-2.9/SYS.h | 1 + lib/libc/pdp/compat-2.9/fetchi.s | 14 + lib/libc/pdp/compat-2.9/fperr.s | 28 + lib/libc/pdp/compat-2.9/l3.c | 65 + lib/libc/pdp/compat-2.9/lock.s | 14 + lib/libc/pdp/compat-2.9/phys.s | 14 + lib/libc/pdp/compat-2.9/ucall.s | 14 + lib/libc/pdp/crt/DEFS.h | 1 + lib/libc/pdp/crt/Makefile | 78 + lib/libc/pdp/crt/aldiv.s | 64 + lib/libc/pdp/crt/almul.s | 44 + lib/libc/pdp/crt/alrem.s | 70 + lib/libc/pdp/crt/csv.s | 302 + lib/libc/pdp/crt/ldiv.s | 217 + lib/libc/pdp/crt/lmul.s | 39 + lib/libc/pdp/crt/lrem.s | 202 + lib/libc/pdp/crt/udiv.s | 63 + lib/libc/pdp/crt/uldiv.s | 190 + lib/libc/pdp/crt/ulrem.s | 158 + lib/libc/pdp/crt/ulsh.s | 76 + lib/libc/pdp/crt/ultof.s | 69 + lib/libc/pdp/csu/Makefile | 93 + lib/libc/pdp/csu/PORT/gmon.c | 297 + lib/libc/pdp/csu/PORT/gmon.ex | 18 + lib/libc/pdp/csu/PORT/gmon.h | 78 + lib/libc/pdp/csu/crt0.s | 151 + lib/libc/pdp/csu/mcount.s | 90 + lib/libc/pdp/csu/mon.c | 124 + lib/libc/pdp/csu/mon.ex | 5 + lib/libc/pdp/gen/DEFS.h | 26 + lib/libc/pdp/gen/Makefile | 101 + lib/libc/pdp/gen/_setjmp.s | 83 + lib/libc/pdp/gen/abs.s | 21 + lib/libc/pdp/gen/alloca.s | 31 + lib/libc/pdp/gen/atof.c | 108 + lib/libc/pdp/gen/bcmp.s | 84 + lib/libc/pdp/gen/bcopy.s | 152 + lib/libc/pdp/gen/bzero.s | 78 + lib/libc/pdp/gen/ecvt.c | 108 + lib/libc/pdp/gen/fabs.s | 23 + lib/libc/pdp/gen/ffs.s | 34 + lib/libc/pdp/gen/frexp.s | 28 + lib/libc/pdp/gen/index.s | 42 + lib/libc/pdp/gen/insque.s | 35 + lib/libc/pdp/gen/ldexp.s | 53 + lib/libc/pdp/gen/ldfps.s | 25 + lib/libc/pdp/gen/modf.s | 28 + lib/libc/pdp/gen/nsym.c | 97 + lib/libc/pdp/gen/remque.s | 35 + lib/libc/pdp/gen/rindex.s | 47 + lib/libc/pdp/gen/rollback.s | 52 + lib/libc/pdp/gen/setjmp.s | 83 + lib/libc/pdp/gen/setjmperr.c | 25 + lib/libc/pdp/gen/strcat.s | 33 + lib/libc/pdp/gen/strcmp.s | 38 + lib/libc/pdp/gen/strcpy.s | 29 + lib/libc/pdp/gen/strlen.s | 27 + lib/libc/pdp/gen/strncat.s | 44 + lib/libc/pdp/gen/strncmp.s | 48 + lib/libc/pdp/gen/strncpy.s | 43 + lib/libc/pdp/net/DEFS.h | 1 + lib/libc/pdp/net/Makefile | 64 + lib/libc/pdp/net/htonl.s | 36 + lib/libc/pdp/net/htons.s | 33 + lib/libc/pdp/stdio/DEFS.h | 1 + lib/libc/pdp/stdio/Makefile | 71 + lib/libc/pdp/stdio/STDIO.h | 24 + lib/libc/pdp/stdio/doprnt.s | 320 + lib/libc/pdp/stdio/ffltpr.s | 23 + lib/libc/pdp/stdio/fgetc.s | 33 + lib/libc/pdp/stdio/fgets.s | 128 + lib/libc/pdp/stdio/fltpr.s | 158 + lib/libc/pdp/stdio/fputc.s | 47 + lib/libc/pdp/stdio/gets.s | 106 + lib/libc/pdp/stdio/puts.s | 192 + lib/libc/pdp/sys/Makefile | 129 + lib/libc/pdp/sys/SYS.h | 50 + lib/libc/pdp/sys/_exit.s | 25 + lib/libc/pdp/sys/brk.s | 29 + lib/libc/pdp/sys/execl.s | 28 + lib/libc/pdp/sys/execle.s | 30 + lib/libc/pdp/sys/execv.s | 26 + lib/libc/pdp/sys/fork.s | 26 + lib/libc/pdp/sys/pipe.s | 28 + lib/libc/pdp/sys/ptrace.s | 20 + lib/libc/pdp/sys/sbrk.s | 40 + lib/libc/pdp/sys/setlogin.s | 53 + lib/libc/pdp/sys/sigaction.s | 91 + lib/libc/pdp/sys/sigreturn.s | 50 + lib/libc/pdp/sys/vfork.s | 44 + lib/libc/stdio/Makefile | 112 + lib/libc/stdio/clrerr.c | 12 + lib/libc/stdio/doscan.c | 293 + lib/libc/stdio/exit.c | 11 + lib/libc/stdio/fdopen.c | 62 + lib/libc/stdio/fgetc.c | 11 + lib/libc/stdio/fgets.c | 25 + lib/libc/stdio/filbuf.c | 70 + lib/libc/stdio/findiop.c | 129 + lib/libc/stdio/flsbuf.c | 121 + lib/libc/stdio/fopen.c | 62 + lib/libc/stdio/fprintf.c | 32 + lib/libc/stdio/fputc.c | 12 + lib/libc/stdio/fputs.c | 41 + lib/libc/stdio/fread.c | 46 + lib/libc/stdio/freopen.c | 59 + lib/libc/stdio/fseek.c | 64 + lib/libc/stdio/ftell.c | 35 + lib/libc/stdio/fwrite.c | 49 + lib/libc/stdio/getchar.c | 16 + lib/libc/stdio/gets.c | 21 + lib/libc/stdio/getw.c | 38 + lib/libc/stdio/printf.c | 12 + lib/libc/stdio/putchar.c | 17 + lib/libc/stdio/puts.c | 15 + lib/libc/stdio/putw.c | 32 + lib/libc/stdio/rew.c | 17 + lib/libc/stdio/scanf.c | 33 + lib/libc/stdio/setbuf.c | 49 + lib/libc/stdio/setbuffer.c | 63 + lib/libc/stdio/setvbuf.c | 129 + lib/libc/stdio/sprintf.c | 36 + lib/libc/stdio/strout.c | 27 + lib/libc/stdio/ungetc.c | 24 + lib/libc/stdio/vfprintf.c | 47 + lib/libc/stdio/vprintf.c | 34 + lib/libc/stdio/vsprintf.c | 38 + lib/libc/stdlib/Makefile | 45 + lib/libc/stdlib/getopt.c | 117 + lib/libc/stdlib/getsubopt.c | 97 + lib/libc/stdlib/strtol.c | 129 + lib/libc/stdlib/strtoul.c | 107 + lib/libc/string/Makefile | 45 + lib/libc/string/strcspn.c | 68 + lib/libc/string/strerror.c | 65 + lib/libc/string/strpbrk.c | 60 + lib/libc/string/strsep.c | 80 + lib/libc/string/strspn.c | 61 + lib/libc/string/strstr.c | 65 + lib/libc/string/strtok.c | 90 + lib/libc/tags | 500 + lib/libkern/Makefile | 70 + lib/mip/CONVERT | 83 + lib/mip/FCONVERT | 27 + lib/mip/INDEX | 12 + lib/mip/allo.c | 588 + lib/mip/cgram.y | 933 + lib/mip/common.c | 420 + lib/mip/config.h | 41 + lib/mip/fort.c | 323 + lib/mip/manifest.h | 121 + lib/mip/match.c | 644 + lib/mip/ndu.h | 79 + lib/mip/onepass.h | 26 + lib/mip/optim.c | 276 + lib/mip/pass1.h | 235 + lib/mip/pass2.h | 226 + lib/mip/pftn.c | 1981 + lib/mip/reader.c | 1333 + lib/mip/scan.c | 1156 + lib/mip/trees.c | 1700 + lib/mip/xdefs.c | 115 + lib/pcc/:yyfix | 14 + lib/pcc/DEBUGS | 56 + lib/pcc/INFO | 188 + lib/pcc/Makefile | 104 + lib/pcc/Makefile.twopass | 109 + lib/pcc/code.c | 457 + lib/pcc/fort.h | 11 + lib/pcc/local.c | 443 + lib/pcc/local2.c | 982 + lib/pcc/localdefs.h | 55 + lib/pcc/mac2defs.h | 62 + lib/pcc/macdefs.h | 68 + lib/pcc/order.c | 776 + lib/pcc/stab.c | 59 + lib/pcc/table.c | 854 + libexec/Makefile | 31 + libexec/acctd/Makefile | 37 + libexec/acctd/acctd.8 | 37 + libexec/acctd/acctd.c | 488 + libexec/comsat/Makefile | 37 + libexec/comsat/comsat.8 | 51 + libexec/comsat/comsat.c | 234 + libexec/ctimed/Makefile | 29 + libexec/ctimed/ctimed.c | 265 + libexec/fingerd/Makefile | 37 + libexec/fingerd/fingerd.8 | 133 + libexec/fingerd/fingerd.c | 189 + libexec/fingerd/pathnames.h | 37 + libexec/ftpd/Makefile | 37 + libexec/ftpd/ftpcmd.y | 1194 + libexec/ftpd/ftpd.8 | 209 + libexec/ftpd/ftpd.c | 1439 + libexec/ftpd/glob.c | 1 + libexec/ftpd/logwtmp.c | 59 + libexec/ftpd/newvers.sh | 25 + libexec/ftpd/pathnames.h | 22 + libexec/ftpd/popen.c | 156 + libexec/ftpd/vers.c | 1 + libexec/ftpd/version | 1 + libexec/getNAME/Makefile | 29 + libexec/getNAME/getNAME.c | 181 + libexec/getty/Makefile | 27 + libexec/getty/get_date.c | 58 + libexec/getty/gettytab.c | 308 + libexec/getty/gettytab.h | 113 + libexec/getty/init.c | 86 + libexec/getty/main.c | 451 + libexec/getty/subr.c | 394 + libexec/identd/CREDITS | 92 + libexec/identd/ChangeLog | 280 + libexec/identd/FAQ | 39 + libexec/identd/INSTALL | 91 + libexec/identd/Makefile | 74 + libexec/identd/README | 89 + libexec/identd/READMEs/README.DES | 209 + libexec/identd/READMEs/README.aix | 22 + libexec/identd/READMEs/README.dynix3 | 22 + libexec/identd/READMEs/README.irix4 | 20 + libexec/identd/READMEs/README.irix5 | 11 + libexec/identd/READMEs/README.next | 32 + .../identd/READMEs/README.next31-m68k-i486 | 49 + libexec/identd/READMEs/README.ptx | 25 + libexec/identd/READMEs/README.riscos4 | 16 + libexec/identd/READMEs/README.sunos3 | 34 + libexec/identd/READMEs/README.sunos4 | 17 + libexec/identd/READMEs/README.sunos5 | 32 + libexec/identd/READMEs/README.ultrix | 75 + libexec/identd/READMEs/README.unicos6 | 20 + libexec/identd/TODO | 25 + libexec/identd/doc/RFC1413 | 451 + libexec/identd/doc/TAP.doc | 334 + libexec/identd/doc/TAPvsIDENT | 8 + libexec/identd/doc/TESTRESULTS | 73 + libexec/identd/doc/why-encrypt.txt | 170 + libexec/identd/doc/why-ident.txt | 11 + libexec/identd/doc/why-tap.txt | 127 + libexec/identd/idecrypt.man | 94 + libexec/identd/identconn.sh | 6 + libexec/identd/identd.8 | 395 + libexec/identd/identd.man | 395 + libexec/identd/install-sh | 238 + libexec/identd/src/Makefile | 45 + libexec/identd/src/config.c | 46 + libexec/identd/src/crypto.c | 240 + libexec/identd/src/crypto.h | 10 + libexec/identd/src/error.h | 42 + libexec/identd/src/idecrypt.c | 142 + libexec/identd/src/identd.c | 800 + libexec/identd/src/identd.h | 48 + libexec/identd/src/itest.c | 181 + libexec/identd/src/kernel/2.11bsd.c | 338 + libexec/identd/src/kernel/386bsd.c | 259 + libexec/identd/src/kernel/4.3bsd.c | 275 + libexec/identd/src/kernel/aix.c | 240 + libexec/identd/src/kernel/alpha3.c | 445 + libexec/identd/src/kernel/apollo.c | 773 + libexec/identd/src/kernel/aux.c | 228 + libexec/identd/src/kernel/aux301.c | 419 + libexec/identd/src/kernel/bsdi.c | 271 + libexec/identd/src/kernel/freebsd.c | 312 + libexec/identd/src/kernel/hpux.c | 260 + libexec/identd/src/kernel/irix4.c | 287 + libexec/identd/src/kernel/irix5.c | 296 + libexec/identd/src/kernel/kvm.h | 45 + libexec/identd/src/kernel/linux.c | 66 + libexec/identd/src/kernel/machten.c | 234 + libexec/identd/src/kernel/netbsd.c | 244 + libexec/identd/src/kernel/next_mach.c | 218 + libexec/identd/src/kernel/other.c | 335 + libexec/identd/src/kernel/ptx2.c | 272 + libexec/identd/src/kernel/ptx4.c | 272 + libexec/identd/src/kernel/sco324.c | 484 + libexec/identd/src/kernel/sco32_42+5.c | 435 + libexec/identd/src/kernel/sunos4.c | 234 + libexec/identd/src/kernel/sunos5.c | 414 + libexec/identd/src/kernel/svr4.c | 343 + libexec/identd/src/kernel/unicos6.c | 196 + libexec/identd/src/kernel/uw2.c | 203 + libexec/identd/src/kvm.c | 397 + libexec/identd/src/parse.c | 690 + libexec/identd/src/paths.h | 76 + libexec/identd/src/proxy.c | 113 + libexec/identd/src/version.c | 1 + libexec/identd/testdir/Makefile | 18 + libexec/identd/testdir/test1.c | 146 + libexec/makekey/Makefile | 29 + libexec/makekey/makekey.c | 35 + libexec/popper/Makefile | 85 + libexec/popper/README | 381 + libexec/popper/pop3.rfc1081 | 898 + libexec/popper/pop3e.rfc1082 | 619 + libexec/popper/pop_dele.c | 59 + libexec/popper/pop_dropcopy.c | 157 + libexec/popper/pop_dropinfo.c | 111 + libexec/popper/pop_get_command.c | 96 + libexec/popper/pop_get_subcommand.c | 56 + libexec/popper/pop_init.c | 188 + libexec/popper/pop_last.c | 24 + libexec/popper/pop_list.c | 64 + libexec/popper/pop_log.c | 53 + libexec/popper/pop_lower.c | 27 + libexec/popper/pop_msg.c | 77 + libexec/popper/pop_parse.c | 64 + libexec/popper/pop_pass.c | 60 + libexec/popper/pop_quit.c | 27 + libexec/popper/pop_rset.c | 39 + libexec/popper/pop_send.c | 113 + libexec/popper/pop_stat.c | 28 + libexec/popper/pop_updt.c | 201 + libexec/popper/pop_user.c | 29 + libexec/popper/pop_xmit.c | 93 + libexec/popper/pop_xtnd.c | 38 + libexec/popper/popper.8 | 157 + libexec/popper/popper.c | 102 + libexec/popper/popper.h | 171 + libexec/popper/version.h | 15 + libexec/rexecd/Makefile | 37 + libexec/rexecd/rexecd.8 | 121 + libexec/rexecd/rexecd.c | 229 + libexec/rlogind/Makefile | 37 + libexec/rlogind/rlogind.8 | 129 + libexec/rlogind/rlogind.c | 645 + libexec/rshd/Makefile | 37 + libexec/rshd/pathnames.h | 22 + libexec/rshd/rshd.8 | 180 + libexec/rshd/rshd.c | 467 + libexec/talkd/Makefile | 37 + libexec/talkd/announce.c | 166 + libexec/talkd/print.c | 60 + libexec/talkd/process.c | 187 + libexec/talkd/table.c | 205 + libexec/talkd/talkd.8 | 34 + libexec/talkd/talkd.c | 91 + libexec/tcpd/BLURB | 29 + libexec/tcpd/Banners.Makefile | 66 + libexec/tcpd/CHANGES | 361 + libexec/tcpd/DISCLAIMER | 18 + libexec/tcpd/Makefile | 248 + libexec/tcpd/Makefile.orig | 803 + libexec/tcpd/README | 1021 + libexec/tcpd/README.IRIX | 54 + libexec/tcpd/README.NIS | 202 + libexec/tcpd/clean_exit.c | 42 + libexec/tcpd/diag.c | 69 + libexec/tcpd/environ.c | 224 + libexec/tcpd/eval.c | 136 + libexec/tcpd/fakelog.c | 62 + libexec/tcpd/fix_options.c | 52 + libexec/tcpd/fromhost.c | 52 + libexec/tcpd/hosts_access.3 | 91 + libexec/tcpd/hosts_access.5 | 378 + libexec/tcpd/hosts_access.c | 322 + libexec/tcpd/hosts_ctl.c | 38 + libexec/tcpd/hosts_options.5 | 172 + libexec/tcpd/inetcf.c | 312 + libexec/tcpd/inetcf.h | 14 + libexec/tcpd/misc.c | 87 + libexec/tcpd/miscd.c | 119 + libexec/tcpd/mystdarg.h | 19 + libexec/tcpd/myvsyslog.c | 33 + libexec/tcpd/ncr.c | 81 + libexec/tcpd/options.c | 615 + libexec/tcpd/patchlevel.h | 3 + libexec/tcpd/percent_m.c | 33 + libexec/tcpd/percent_x.c | 86 + libexec/tcpd/printf.ck | 3 + libexec/tcpd/ptx.c | 103 + libexec/tcpd/refuse.c | 32 + libexec/tcpd/rfc931.c | 165 + libexec/tcpd/safe_finger.c | 196 + libexec/tcpd/scaffold.c | 213 + libexec/tcpd/scaffold.h | 9 + libexec/tcpd/setenv.c | 34 + libexec/tcpd/shell_cmd.c | 92 + libexec/tcpd/socket.c | 235 + libexec/tcpd/strcasecmp.c | 94 + libexec/tcpd/tcpd.8 | 177 + libexec/tcpd/tcpd.c | 128 + libexec/tcpd/tcpd.h | 208 + libexec/tcpd/tcpdchk.8 | 66 + libexec/tcpd/tcpdchk.c | 447 + libexec/tcpd/tcpdmatch.8 | 98 + libexec/tcpd/tcpdmatch.c | 315 + libexec/tcpd/tli-sequent.c | 187 + libexec/tcpd/tli-sequent.h | 13 + libexec/tcpd/tli.c | 333 + libexec/tcpd/try-from.c | 85 + libexec/tcpd/update.c | 119 + libexec/tcpd/vfprintf.c | 125 + libexec/tcpd/workarounds.c | 247 + libexec/telnetd/Makefile | 37 + libexec/telnetd/telnetd.8 | 126 + libexec/telnetd/telnetd.c | 1285 + libexec/tftpd/Makefile | 37 + libexec/tftpd/tftpd.8 | 60 + libexec/tftpd/tftpd.c | 487 + libexec/tftpd/tftpsubs.c | 1 + local/Makefile | 82 + local/afio/Makefile | 41 + local/afio/README | 17 + local/afio/afio.1 | 287 + local/afio/afio.c | 2781 ++ local/cxref/README | 61 + local/cxref/SORT1 | 12 + local/cxref/SORT2 | 12 + local/cxref/SORT3 | 12 + local/cxref/basename.c | 24 + local/cxref/constdefs.h | 21 + local/cxref/cscan.l | 186 + local/cxref/cxref.1 | 149 + local/cxref/cxref.c | 622 + local/cxref/cxrfilt.c | 298 + local/cxref/docxref.c | 102 + local/cxref/fmtxref.c | 228 + local/cxref/makefile | 88 + local/ddd/Makefile | 43 + local/ddd/README | 14 + local/ddd/ddd.1 | 57 + local/ddd/ddd.c | 388 + local/decompr16.c | 273 + local/less/README | 39 + local/less/ch.c | 418 + local/less/command.c | 643 + local/less/funcs.h | 77 + local/less/help.c | 22 + local/less/input.c | 191 + local/less/install | 563 + local/less/less.h | 55 + local/less/less.help | 37 + local/less/less.nro | 415 + local/less/line.c | 488 + local/less/main.c | 369 + local/less/makefile | 165 + local/less/mkfuncs.awk | 9 + local/less/option.c | 398 + local/less/output.c | 235 + local/less/position.c | 107 + local/less/position.h | 7 + local/less/prim.c | 735 + local/less/prompt.c | 220 + local/less/screen.c | 538 + local/less/signal.c | 249 + local/less/ttyin.c | 45 + local/less/version.c | 108 + local/mkovmake/Makefile | 27 + local/mkovmake/README | 19 + local/mkovmake/mkovmake.1 | 273 + local/mkovmake/mkovmake.c | 607 + local/mp/CHANGES | 919 + local/mp/Data/Mail | 24 + local/mp/Data/MailFolder | 18 + local/mp/Data/NewsArticle1 | 57 + local/mp/Data/NewsArticle2 | 30 + local/mp/Data/NewsDigest | 224 + local/mp/FILES | 48 + local/mp/MANIFEST | 45 + local/mp/Makefile | 197 + local/mp/Makefile.dist | 210 + local/mp/README | 348 + local/mp/TODO | 270 + local/mp/extern.h | 83 + local/mp/header.c | 266 + local/mp/io.c | 109 + local/mp/mailp | 109 + local/mp/mailp.man | 112 + local/mp/mailp.man.text | 132 + local/mp/main.c | 289 + local/mp/misc.c | 275 + local/mp/mp.common.ps | 73 + local/mp/mp.el | 64 + local/mp/mp.h | 138 + local/mp/mp.man | 296 + local/mp/mp.man.text | 330 + local/mp/mp.pro.alt.ps | 112 + local/mp/mp.pro.altl.ps | 146 + local/mp/mp.pro.ff.ps | 159 + local/mp/mp.pro.fp.ps | 167 + local/mp/mp.pro.l.ps | 185 + local/mp/mp.pro.ps | 168 + local/mp/mp.pro.tm.ps | 163 + local/mp/mp.pro.ts.ps | 166 + local/mp/patchlevel.h | 17 + local/mp/print.c | 289 + local/mtools/Configure | 130 + local/mtools/Makefile | 209 + local/mtools/Mattrib.1 | 56 + local/mtools/Mcd.1 | 28 + local/mtools/Mcopy.1 | 71 + local/mtools/Mdel.1 | 33 + local/mtools/Mdir.1 | 40 + local/mtools/Mformat.1 | 42 + local/mtools/Mkmanifest.1 | 74 + local/mtools/Mlabel.1 | 28 + local/mtools/Mmd.1 | 39 + local/mtools/Mrd.1 | 24 + local/mtools/Mread.1 | 55 + local/mtools/Mren.1 | 45 + local/mtools/Mtools.1 | 50 + local/mtools/Mtype.1 | 37 + local/mtools/Mwrite.1 | 65 + local/mtools/Readme | 68 + local/mtools/Release.notes | 29 + local/mtools/buf_read.c | 74 + local/mtools/buf_write.c | 140 + local/mtools/devices.c | 92 + local/mtools/dir_make.c | 89 + local/mtools/dir_read.c | 154 + local/mtools/dir_write.c | 178 + local/mtools/expand.c | 114 + local/mtools/fat_free.c | 37 + local/mtools/fat_read.c | 102 + local/mtools/fat_write.c | 95 + local/mtools/file_read.c | 83 + local/mtools/file_write.c | 120 + local/mtools/init.c | 325 + local/mtools/is_dir.c | 47 + local/mtools/match.c | 91 + local/mtools/mattrib.c | 151 + local/mtools/mcd.c | 115 + local/mtools/mcopy.c | 200 + local/mtools/mdel.c | 148 + local/mtools/mdir.c | 304 + local/mtools/mformat.c | 248 + local/mtools/mkmanifest.c | 121 + local/mtools/mlabel.c | 129 + local/mtools/mmd.c | 209 + local/mtools/mrd.c | 185 + local/mtools/mread.c | 345 + local/mtools/mren.c | 118 + local/mtools/msdos.h | 61 + local/mtools/mtype.c | 131 + local/mtools/mwrite.c | 353 + local/mtools/parse.c | 115 + local/mtools/patchlevel.h | 18 + local/mtools/subdir.c | 109 + local/qterm/Makefile | 94 + local/qterm/README | 48 + local/qterm/options.3 | 367 + local/qterm/options.c | 463 + local/qterm/options.h | 96 + local/qterm/qterm.1 | 227 + local/qterm/qterm.c | 1062 + local/qterm/qterm.h | 113 + local/qterm/qtermtab | 73 + local/trace.c | 75 + local/welcome/Makefile | 33 + local/welcome/README | 31 + local/welcome/cpu.h | 13 + local/welcome/welcome.1 | 18 + local/welcome/welcome.c | 139 + local/zmodem/Makefile | 51 + local/zmodem/crc.1 | 32 + local/zmodem/crc.c | 160 + local/zmodem/crctab.c | 140 + local/zmodem/genie.c | 111 + local/zmodem/makefile.generic | 126 + local/zmodem/minirb.1 | 53 + local/zmodem/minirb.c | 175 + local/zmodem/ptest.sh | 4 + local/zmodem/rbsb.c | 332 + local/zmodem/rz.1 | 360 + local/zmodem/rz.c | 1552 + local/zmodem/sz.1 | 487 + local/zmodem/sz.c | 2101 + local/zmodem/vmodem.h | 43 + local/zmodem/vrzsz.c | 254 + local/zmodem/vupl.t | 18 + local/zmodem/vuplfile.t | 13 + local/zmodem/vvmodem.c | 273 + local/zmodem/zm.c | 917 + local/zmodem/zmodem.h | 135 + local/zmodem/zmr.c | 185 + local/zmodem/zupl.t | 26 + man/Makefile | 59 + man/makewhatis.sed | 45 + man/man.template | 8 + man/man0/Makefile | 47 + man/man0/break | 5 + man/man0/cshcmd | 54 + man/man0/ignore | 99 + man/man0/intro.ms | 688 + man/man0/preface.ms | 337 + man/man0/ptx.in | 63 + man/man0/ptxx | 3807 ++ man/man0/title.prm | 122 + man/man0/title.urm | 61 + man/man0/toc.in | 73 + man/man0/toc1 | 242 + man/man0/toc2 | 87 + man/man0/toc3 | 108 + man/man0/toc3f | 50 + man/man0/toc4 | 69 + man/man0/toc5 | 41 + man/man0/toc6 | 31 + man/man0/toc7 | 10 + man/man0/toc8 | 98 + man/man0/tocrc | 109 + man/man0/tocx1 | 242 + man/man0/tocx2 | 87 + man/man0/tocx3 | 108 + man/man0/tocx3f | 50 + man/man0/tocx4 | 70 + man/man0/tocx5 | 41 + man/man0/tocx6 | 31 + man/man0/tocx7 | 10 + man/man0/tocx8 | 98 + man/man1/Makefile | 141 + man/man1/adb.1 | 931 + man/man1/addbib.1 | 99 + man/man1/apply.1 | 86 + man/man1/apropos.1 | 43 + man/man1/as.1 | 114 + man/man1/at.1 | 130 + man/man1/atq.1 | 41 + man/man1/atrm.1 | 48 + man/man1/awk.1 | 240 + man/man1/basename.1 | 32 + man/man1/bc.1 | 196 + man/man1/biff.1 | 49 + man/man1/binmail.1 | 134 + man/man1/cal.1 | 30 + man/man1/calendar.1 | 53 + man/man1/cat.1 | 84 + man/man1/cb.1 | 13 + man/man1/cc.1 | 216 + man/man1/cd.1 | 37 + man/man1/checknr.1 | 110 + man/man1/chgrp.1 | 46 + man/man1/chmod.1 | 112 + man/man1/clear.1 | 20 + man/man1/cmp.1 | 45 + man/man1/col.1 | 73 + man/man1/colcrt.1 | 74 + man/man1/colrm.1 | 31 + man/man1/comm.1 | 43 + man/man1/compress.1 | 233 + man/man1/cp.1 | 65 + man/man1/csh.1 | 2302 + man/man1/ctags.1 | 153 + man/man1/date.1 | 75 + man/man1/dc.1 | 201 + man/man1/dd.1 | 227 + man/man1/deroff.1 | 43 + man/man1/df.1 | 39 + man/man1/diction.1 | 61 + man/man1/diff.1 | 290 + man/man1/diff3.1 | 140 + man/man1/du.1 | 48 + man/man1/echo.1 | 23 + man/man1/ed.1 | 715 + man/man1/efl.1 | 74 + man/man1/eqn.1 | 306 + man/man1/error.1 | 297 + man/man1/ex.1 | 146 + man/man1/expand.1 | 53 + man/man1/expr.1 | 105 + man/man1/f77.1 | 313 + man/man1/false.1 | 35 + man/man1/file.1 | 23 + man/man1/find.1 | 266 + man/man1/fmt.1 | 45 + man/man1/fold.1 | 36 + man/man1/fpr.1 | 184 + man/man1/from.1 | 33 + man/man1/fsplit.1 | 64 + man/man1/gcore.1 | 41 + man/man1/graph.1 | 115 + man/man1/grep.1 | 159 + man/man1/head.1 | 27 + man/man1/hostid.1 | 24 + man/man1/indent.1 | 419 + man/man1/intro.1 | 41 + man/man1/iostat.1 | 66 + man/man1/join.1 | 107 + man/man1/kill.1 | 70 + man/man1/last.1 | 84 + man/man1/lastcomm.1 | 75 + man/man1/learn.1 | 128 + man/man1/leave.1 | 49 + man/man1/lex.1 | 76 + man/man1/lint.1 | 187 + man/man1/lisp.1 | 119 + man/man1/ln.1 | 80 + man/man1/logger.1 | 74 + man/man1/login.1 | 110 + man/man1/look.1 | 47 + man/man1/lookbib.1 | 100 + man/man1/lorder.1 | 49 + man/man1/lpq.1 | 91 + man/man1/lpr.1 | 207 + man/man1/lprm.1 | 100 + man/man1/lptest.1 | 45 + man/man1/ls.1 | 211 + man/man1/lxref.1 | 77 + man/man1/m4.1 | 210 + man/man1/mail.1 | 840 + man/man1/make.1 | 283 + man/man1/man.1 | 69 + man/man1/mesg.1 | 37 + man/man1/mkdep.1 | 44 + man/man1/mkdir.1 | 62 + man/man1/mkstr.1 | 90 + man/man1/more.1 | 329 + man/man1/mset.1 | 79 + man/man1/msgs.1 | 190 + man/man1/mt.1 | 108 + man/man1/mv.1 | 89 + man/man1/netstat.1 | 206 + man/man1/newaliases.1 | 22 + man/man1/nice.1 | 77 + man/man1/nm.1 | 77 + man/man1/nroff.1 | 136 + man/man1/nslookup.1 | 228 + man/man1/od.1 | 139 + man/man1/pagesize.1 | 21 + man/man1/pdx.1 | 274 + man/man1/pi.1 | 157 + man/man1/pix.1 | 57 + man/man1/plot.1 | 119 + man/man1/pmerge.1 | 38 + man/man1/pr.1 | 87 + man/man1/printenv.1 | 26 + man/man1/prof.1 | 117 + man/man1/ps.1 | 216 + man/man1/ptx.1 | 110 + man/man1/pwd.1 | 25 + man/man1/px.1 | 100 + man/man1/pxp.1 | 169 + man/man1/pxref.1 | 30 + man/man1/quota.1 | 47 + man/man1/ratfor.1 | 67 + man/man1/rcp.1 | 89 + man/man1/rdist.1 | 352 + man/man1/refer.1 | 265 + man/man1/rev.1 | 14 + man/man1/rlogin.1 | 92 + man/man1/rm.1 | 65 + man/man1/rmail.1 | 36 + man/man1/rmdir.1 | 66 + man/man1/roffbib.1 | 116 + man/man1/rsh.1 | 115 + man/man1/ruptime.1 | 56 + man/man1/rwho.1 | 44 + man/man1/sccs.1 | 319 + man/man1/script.1 | 42 + man/man1/sed.1 | 299 + man/man1/sendbug.1 | 38 + man/man1/sh.1 | 866 + man/man1/size.1 | 18 + man/man1/sleep.1 | 34 + man/man1/soelim.1 | 51 + man/man1/sort.1 | 156 + man/man1/sortbib.1 | 76 + man/man1/spell.1 | 150 + man/man1/spline.1 | 193 + man/man1/split.1 | 38 + man/man1/strcompact.1 | 39 + man/man1/strings.1 | 44 + man/man1/strip.1 | 28 + man/man1/struct.1 | 113 + man/man1/style.1 | 75 + man/man1/su.1 | 55 + man/man1/sum.1 | 22 + man/man1/symcompact.1 | 53 + man/man1/symorder.1 | 66 + man/man1/tabs.1 | 30 + man/man1/tail.1 | 56 + man/man1/talk.1 | 98 + man/man1/tar.1 | 193 + man/man1/tbl.1 | 217 + man/man1/tc.1 | 89 + man/man1/tcopy.1 | 29 + man/man1/tee.1 | 27 + man/man1/telnet.1 | 583 + man/man1/time.1 | 46 + man/man1/tip.1 | 408 + man/man1/tk.1 | 63 + man/man1/tn3270.1 | 128 + man/man1/touch.1 | 37 + man/man1/tp.1 | 178 + man/man1/tr.1 | 70 + man/man1/troff.1 | 160 + man/man1/true.1 | 31 + man/man1/tsort.1 | 31 + man/man1/tty.1 | 16 + man/man1/ul.1 | 60 + man/man1/unifdef.1 | 114 + man/man1/uniq.1 | 62 + man/man1/units.1 | 75 + man/man1/uptime.1 | 23 + man/man1/users.1 | 20 + man/man1/uucp.1 | 189 + man/man1/uuencode.1 | 74 + man/man1/uulog.1 | 57 + man/man1/uuname.1 | 27 + man/man1/uuq.1 | 84 + man/man1/uusend.1 | 58 + man/man1/uux.1 | 216 + man/man1/vacation.1 | 91 + man/man1/vgrind.1 | 188 + man/man1/vi.1 | 84 + man/man1/vmstat.1 | 144 + man/man1/vwidth.1 | 61 + man/man1/w.1 | 95 + man/man1/wait.1 | 27 + man/man1/wall.1 | 31 + man/man1/wc.1 | 33 + man/man1/what.1 | 24 + man/man1/whatis.1 | 34 + man/man1/which.1 | 29 + man/man1/who.1 | 47 + man/man1/whois.1 | 39 + man/man1/window.1 | 552 + man/man1/write.1 | 64 + man/man1/xstr.1 | 123 + man/man1/yacc.1 | 89 + man/man1/yes.1 | 20 + man/man2/Makefile | 122 + man/man2/accept.2 | 102 + man/man2/access.2 | 113 + man/man2/acct.2 | 84 + man/man2/adjtime.2 | 71 + man/man2/bind.2 | 100 + man/man2/brk.2 | 100 + man/man2/chdir.2 | 92 + man/man2/chflags.2 | 170 + man/man2/chmod.2 | 128 + man/man2/chown.2 | 117 + man/man2/chroot.2 | 64 + man/man2/close.2 | 70 + man/man2/connect.2 | 125 + man/man2/creat.2 | 136 + man/man2/dup.2 | 82 + man/man2/execve.2 | 213 + man/man2/exit.2 | 49 + man/man2/fcntl.2 | 150 + man/man2/fetchi.2 | 56 + man/man2/flock.2 | 97 + man/man2/fork.2 | 69 + man/man2/fperr.2 | 59 + man/man2/fsync.2 | 43 + man/man2/getdtablesize.2 | 25 + man/man2/getfsstat.2 | 144 + man/man2/getgid.2 | 77 + man/man2/getgroups.2 | 58 + man/man2/gethostid.2 | 34 + man/man2/gethostname.2 | 60 + man/man2/getitimer.2 | 127 + man/man2/getlogin.2 | 128 + man/man2/getpagesize.2 | 29 + man/man2/getpeername.2 | 57 + man/man2/getpgrp.2 | 42 + man/man2/getpid.2 | 33 + man/man2/getpriority.2 | 95 + man/man2/getrlimit.2 | 143 + man/man2/getrusage.2 | 161 + man/man2/getsockname.2 | 56 + man/man2/getsockopt.2 | 197 + man/man2/gettimeofday.2 | 87 + man/man2/getuid.2 | 78 + man/man2/intro.2 | 543 + man/man2/ioctl.2 | 65 + man/man2/kill.2 | 87 + man/man2/killpg.2 | 55 + man/man2/link.2 | 111 + man/man2/listen.2 | 61 + man/man2/lock.2 | 41 + man/man2/lseek.2 | 91 + man/man2/mkdir.2 | 113 + man/man2/mknod.2 | 113 + man/man2/mount.2 | 211 + man/man2/nostk.2 | 36 + man/man2/open.2 | 202 + man/man2/phys.2 | 74 + man/man2/pipe.2 | 80 + man/man2/profil.2 | 59 + man/man2/ptrace.2 | 230 + man/man2/quota.2 | 159 + man/man2/read.2 | 147 + man/man2/readlink.2 | 66 + man/man2/reboot.2 | 71 + man/man2/recv.2 | 167 + man/man2/rename.2 | 151 + man/man2/rmdir.2 | 78 + man/man2/select.2 | 191 + man/man2/send.2 | 129 + man/man2/setgroups.2 | 51 + man/man2/setpgrp.2 | 50 + man/man2/setquota.2 | 108 + man/man2/setregid.2 | 88 + man/man2/setreuid.2 | 88 + man/man2/setuid.2 | 126 + man/man2/shutdown.2 | 43 + man/man2/sigaction.2 | 412 + man/man2/sigaltstack.2 | 172 + man/man2/sigblock.2 | 47 + man/man2/sigpause.2 | 38 + man/man2/sigpending.2 | 78 + man/man2/sigprocmask.2 | 135 + man/man2/sigreturn.2 | 89 + man/man2/sigsetmask.2 | 46 + man/man2/sigstack.2 | 72 + man/man2/sigsuspend.2 | 81 + man/man2/sigvec.2 | 342 + man/man2/sigwait.2 | 62 + man/man2/socket.2 | 194 + man/man2/socketpair.2 | 61 + man/man2/stat.2 | 213 + man/man2/statfs.2 | 171 + man/man2/swapon.2 | 87 + man/man2/symlink.2 | 105 + man/man2/sync.2 | 32 + man/man2/syscall.2 | 45 + man/man2/truncate.2 | 104 + man/man2/ucall.2 | 52 + man/man2/umask.2 | 33 + man/man2/unlink.2 | 84 + man/man2/utimes.2 | 76 + man/man2/vfork.2 | 84 + man/man2/vhangup.2 | 39 + man/man2/wait.2 | 303 + man/man2/write.2 | 164 + man/man3/Makefile | 395 + man/man3/abort.3 | 18 + man/man3/abs.3 | 23 + man/man3/alarm.3 | 37 + man/man3/asinh.3 | 41 + man/man3/assert.3 | 40 + man/man3/atof.3 | 38 + man/man3/bstring.3 | 73 + man/man3/byteorder.3 | 44 + man/man3/compat-sys5.3 | 79 + man/man3/crypt.3 | 67 + man/man3/ctime.3 | 131 + man/man3/ctype.3 | 93 + man/man3/curses.3 | 114 + man/man3/daemon.3 | 76 + man/man3/dbm.3 | 127 + man/man3/devname.3 | 70 + man/man3/directory.3 | 142 + man/man3/ecvt.3 | 56 + man/man3/end.3 | 39 + man/man3/erf.3 | 37 + man/man3/err.3 | 161 + man/man3/execl.3 | 195 + man/man3/exit.3 | 26 + man/man3/exp.3 | 128 + man/man3/fclose.3 | 50 + man/man3/ferror.3 | 73 + man/man3/floor.3 | 61 + man/man3/fopen.3 | 121 + man/man3/fread.3 | 72 + man/man3/frexp.3 | 43 + man/man3/fseek.3 | 62 + man/man3/getc.3 | 90 + man/man3/getdisk.3 | 41 + man/man3/getenv.3 | 47 + man/man3/getfsent.3 | 83 + man/man3/getgrent.3 | 100 + man/man3/getgrouplist.3 | 94 + man/man3/gethostbyname.3 | 190 + man/man3/getloadavg.3 | 65 + man/man3/getmntinfo.3 | 113 + man/man3/getnetent.3 | 113 + man/man3/getopt.3 | 264 + man/man3/getpass.3 | 28 + man/man3/getprotoent.3 | 103 + man/man3/getpwent.3 | 185 + man/man3/gets.3 | 67 + man/man3/getservent.3 | 111 + man/man3/getsubopt.3 | 157 + man/man3/getttyent.3 | 109 + man/man3/getusershell.3 | 64 + man/man3/getwd.3 | 29 + man/man3/hypot.3 | 76 + man/man3/ieee.3 | 127 + man/man3/inet.3 | 122 + man/man3/infnan.3 | 103 + man/man3/initgroups.3 | 44 + man/man3/insque.3 | 45 + man/man3/intro.3 | 386 + man/man3/j0.3 | 42 + man/man3/l3tol.3 | 45 + man/man3/ldfps.3 | 27 + man/man3/lgamma.3 | 87 + man/man3/lib2648.3 | 475 + man/man3/malloc.3 | 133 + man/man3/math.3 | 608 + man/man3/mktemp.3 | 31 + man/man3/monitor.3 | 142 + man/man3/mp.3 | 159 + man/man3/ndbm.3 | 173 + man/man3/nice.3 | 44 + man/man3/nlist.3 | 43 + man/man3/ns.3 | 74 + man/man3/pause.3 | 35 + man/man3/perror.3 | 80 + man/man3/plot.3 | 151 + man/man3/popen.3 | 69 + man/man3/printf.3 | 249 + man/man3/psignal.3 | 49 + man/man3/putc.3 | 85 + man/man3/puts.3 | 50 + man/man3/qsort.3 | 30 + man/man3/rand.3 | 41 + man/man3/random.3 | 128 + man/man3/rcmd.3 | 139 + man/man3/regex.3 | 70 + man/man3/resolver.3 | 203 + man/man3/rexec.3 | 78 + man/man3/scandir.3 | 71 + man/man3/scanf.3 | 257 + man/man3/setbuf.3 | 223 + man/man3/setjmp.3 | 96 + man/man3/setmode.3 | 112 + man/man3/setruid.3 | 75 + man/man3/siginterrupt.3 | 56 + man/man3/signal.3 | 269 + man/man3/sigsetops.3 | 127 + man/man3/sin.3 | 197 + man/man3/sinh.3 | 35 + man/man3/sleep.3 | 99 + man/man3/sqrt.3 | 41 + man/man3/stdio.3 | 179 + man/man3/strcspn.3 | 85 + man/man3/strftime.3 | 188 + man/man3/string.3 | 81 + man/man3/strpbrk.3 | 83 + man/man3/strsep.3 | 115 + man/man3/strspn.3 | 83 + man/man3/strstr.3 | 91 + man/man3/strtok.3 | 112 + man/man3/strtol.3 | 159 + man/man3/strtoul.3 | 155 + man/man3/stty.3 | 56 + man/man3/swab.3 | 25 + man/man3/sysctl.3 | 961 + man/man3/syserrlst.3 | 69 + man/man3/syslog.3 | 269 + man/man3/system.3 | 27 + man/man3/termcap.3 | 153 + man/man3/time.3 | 57 + man/man3/times.3 | 42 + man/man3/ttyname.3 | 47 + man/man3/ualarm.3 | 55 + man/man3/uname.3 | 98 + man/man3/ungetc.3 | 41 + man/man3/utime.3 | 38 + man/man3/valloc.3 | 37 + man/man3/varargs.3 | 132 + man/man3f/Makefile | 192 + man/man3f/abort.3 | 59 + man/man3f/access.3 | 43 + man/man3f/alarm.3 | 46 + man/man3f/bessel.3 | 57 + man/man3f/bit.3 | 64 + man/man3f/chdir.3 | 31 + man/man3f/chmod.3 | 37 + man/man3f/etime.3 | 35 + man/man3f/exit.3 | 37 + man/man3f/fdate.3 | 40 + man/man3f/flmin.3 | 53 + man/man3f/flush.3 | 24 + man/man3f/fork.3 | 54 + man/man3f/fseek.3 | 49 + man/man3f/getarg.3 | 30 + man/man3f/getc.3 | 33 + man/man3f/getcwd.3 | 27 + man/man3f/getenv.3 | 34 + man/man3f/getlog.3 | 25 + man/man3f/getpid.3 | 20 + man/man3f/getuid.3 | 22 + man/man3f/hostnm.3 | 24 + man/man3f/idate.3 | 34 + man/man3f/index.3 | 49 + man/man3f/intro.3 | 163 + man/man3f/ioinit.3 | 144 + man/man3f/kill.3 | 25 + man/man3f/link.3 | 39 + man/man3f/loc.3 | 18 + man/man3f/long.3 | 29 + man/man3f/malloc.3 | 124 + man/man3f/perror.3 | 112 + man/man3f/plot.3 | 101 + man/man3f/putc.3 | 31 + man/man3f/qsort.3 | 67 + man/man3f/rand.3 | 51 + man/man3f/random.3 | 41 + man/man3f/rename.3 | 39 + man/man3f/signal.3 | 73 + man/man3f/sleep.3 | 25 + man/man3f/stat.3 | 54 + man/man3f/system.3 | 41 + man/man3f/time.3 | 49 + man/man3f/topen.3 | 188 + man/man3f/traper.3 | 43 + man/man3f/trapov.3 | 53 + man/man3f/trpfpe.3 | 66 + man/man3f/ttynam.3 | 38 + man/man3f/unlink.3 | 29 + man/man3f/wait.3 | 33 + man/man4/Makefile | 61 + man/man4/acc.4 | 61 + man/man4/arp.4 | 123 + man/man4/bk.4 | 87 + man/man4/br.4 | 170 + man/man4/cons.4 | 33 + man/man4/css.4 | 60 + man/man4/de.4 | 84 + man/man4/dh.4 | 92 + man/man4/dhu.4 | 78 + man/man4/dhv.4 | 76 + man/man4/dmc.4 | 86 + man/man4/dr.4 | 118 + man/man4/dz.4 | 75 + man/man4/ec.4 | 94 + man/man4/en.4 | 91 + man/man4/fd.4 | 92 + man/man4/hk.4 | 137 + man/man4/ht.4 | 77 + man/man4/hy.4 | 95 + man/man4/icmp.4 | 70 + man/man4/idp.4 | 128 + man/man4/il.4 | 72 + man/man4/imp.4 | 74 + man/man4/impconf.4 | 114 + man/man4/inet.4 | 117 + man/man4/intro.4 | 139 + man/man4/ip.4 | 107 + man/man4/lo.4 | 42 + man/man4/lp.4 | 99 + man/man4/mem.4 | 64 + man/man4/mtio.4 | 167 + man/man4/networking.4 | 320 + man/man4/ns.4 | 97 + man/man4/nsip.4 | 64 + man/man4/null.4 | 33 + man/man4/pty.4 | 155 + man/man4/qe.4 | 41 + man/man4/ra.4 | 151 + man/man4/ram.4 | 99 + man/man4/rk.4 | 110 + man/man4/rl.4 | 114 + man/man4/rx.4 | 185 + man/man4/si.4 | 138 + man/man4/spp.4 | 136 + man/man4/sri.4 | 49 + man/man4/swap.4 | 33 + man/man4/tb.4 | 71 + man/man4/tcp.4 | 114 + man/man4/tm.4 | 90 + man/man4/tmscp.4 | 150 + man/man4/ts.4 | 74 + man/man4/tty.4 | 890 + man/man4/udp.4 | 76 + man/man4/vv.4 | 75 + man/man4/xp.4 | 162 + man/man5/L-devices.5 | 198 + man/man5/L-dialcodes.5 | 105 + man/man5/L.aliases.5 | 59 + man/man5/L.cmds.5 | 82 + man/man5/L.sys.5 | 481 + man/man5/Makefile | 59 + man/man5/USERFILE.5 | 213 + man/man5/a.out.5 | 324 + man/man5/acct.5 | 30 + man/man5/aliases.5 | 57 + man/man5/core.5 | 64 + man/man5/dbx.5 | 271 + man/man5/dir.5 | 99 + man/man5/disktab.5 | 73 + man/man5/dtab.5 | 65 + man/man5/dump.5 | 214 + man/man5/fs.5 | 398 + man/man5/fstab.5 | 218 + man/man5/gettytab.5 | 231 + man/man5/group.5 | 44 + man/man5/hosts.5 | 64 + man/man5/map3270.5 | 304 + man/man5/networks.5 | 47 + man/man5/passwd.5 | 119 + man/man5/phones.5 | 35 + man/man5/plot.5 | 132 + man/man5/printcap.5 | 231 + man/man5/protocols.5 | 41 + man/man5/remote.5 | 165 + man/man5/resolver.5 | 54 + man/man5/services.5 | 51 + man/man5/shells.5 | 36 + man/man5/stack.5 | 92 + man/man5/syserrlst.5 | 65 + man/man5/tar.5 | 124 + man/man5/termcap.5 | 1683 + man/man5/tp.5 | 73 + man/man5/ttys.5 | 86 + man/man5/types.5 | 38 + man/man5/tzfile.5 | 99 + man/man5/utmp.5 | 55 + man/man5/uuencode.5 | 51 + man/man5/vfont.5 | 89 + man/man5/vgrindefs.5 | 124 + man/man6/Makefile | 50 + man/man6/aardvark.6 | 25 + man/man6/adventure.6 | 21 + man/man6/arithmetic.6 | 56 + man/man6/backgammon.6 | 11 + man/man6/banner.6 | 45 + man/man6/bcd.6 | 18 + man/man6/bj.6 | 77 + man/man6/boggle.6 | 49 + man/man6/canfield.6 | 91 + man/man6/chess.6 | 28 + man/man6/ching.6 | 81 + man/man6/cribbage.6 | 102 + man/man6/doctor.6 | 24 + man/man6/fish.6 | 35 + man/man6/fortune.6 | 54 + man/man6/hangman.6 | 23 + man/man6/hunt.6 | 266 + man/man6/mille.6 | 351 + man/man6/monop.6 | 164 + man/man6/moo.6 | 16 + man/man6/number.6 | 12 + man/man6/quiz.6 | 67 + man/man6/rain.6 | 27 + man/man6/robots.6 | 130 + man/man6/rogue.6 | 93 + man/man6/snake.6 | 93 + man/man6/trek.6 | 63 + man/man6/ttt.6 | 17 + man/man6/warp.6 | 133 + man/man6/words.6 | 16 + man/man6/worm.6 | 39 + man/man6/worms.6 | 48 + man/man6/wump.6 | 26 + man/man6/zork.6 | 34 + man/man7/Makefile | 42 + man/man7/ascii.7 | 52 + man/man7/environ.7 | 92 + man/man7/eqnchar.7 | 178 + man/man7/hier.7 | 669 + man/man7/hostname.7 | 50 + man/man7/intro.7 | 27 + man/man7/mailaddr.7 | 124 + man/man7/man.7 | 167 + man/man7/me.7 | 290 + man/man7/ms.7 | 199 + man/man7/term.7 | 67 + man/man8/Makefile | 68 + man/man8/XNSrouted.8 | 149 + man/man8/adduser.8 | 71 + man/man8/autoconfig.8 | 117 + man/man8/boot.8 | 278 + man/man8/bugfiler.8 | 104 + man/man8/crash.8 | 262 + man/man8/drtest.8 | 74 + man/man8/dump.8 | 242 + man/man8/dumpdir.8 | 49 + man/man8/format.8 | 266 + man/man8/fsck.8 | 350 + man/man8/getty.8 | 98 + man/man8/htable.8 | 107 + man/man8/intro.8 | 31 + man/man8/lpc.8 | 143 + man/man8/lpd.8 | 206 + man/man8/makedev.8 | 57 + man/man8/makekey.8 | 47 + man/man8/named.8 | 314 + man/man8/pac.8 | 84 + man/man8/rc.8 | 64 + man/man8/rdump.8 | 41 + man/man8/routed.8 | 307 + man/man8/rrestore.8 | 39 + man/man8/sendmail.8 | 426 + man/man8/sticky.8 | 62 + man/man8/sync.8 | 38 + man/man8/timed.8 | 107 + man/man8/timedc.8 | 84 + man/man8/uucico.8 | 224 + man/man8/uuclean.8 | 57 + man/man8/uupoll.8 | 75 + man/man8/uusnap.8 | 32 + man/man8/uuxqt.8 | 51 + man/manroff | 21 + new/Makefile | 46 + new/OLD/Makefile | 23 + new/OLD/README | 62 + new/OLD/apl.tar.Z | Bin 0 -> 300505 bytes new/OLD/buildcore.c | 164 + new/OLD/cpm.tar.Z | Bin 0 -> 28515 bytes new/OLD/efs.tar.Z | Bin 0 -> 7928 bytes new/OLD/getsyspr.tar.Z | Bin 0 -> 8018 bytes new/OLD/grab.tar.Z | Bin 0 -> 31407 bytes new/OLD/lisp11.tar.Z | Bin 0 -> 140399 bytes new/OLD/mh.tar.Z | Bin 0 -> 218879 bytes new/OLD/rand.tar.Z | Bin 0 -> 532695 bytes new/OLD/rinstall.tar.Z | Bin 0 -> 7904 bytes new/OLD/sched.tar.Z | Bin 0 -> 88718 bytes new/OLD/seqn.tar.Z | Bin 0 -> 49747 bytes new/OLD/sroff.tar.Z | Bin 0 -> 104376 bytes new/OLD/subnet.tar.Z | Bin 0 -> 39436 bytes new/PORT/B.tar.Z | Bin 0 -> 685184 bytes new/PORT/Makefile | 41 + new/PORT/README | 91 + new/PORT/apl.tar.Z | Bin 0 -> 317083 bytes new/PORT/bib.tar.Z | Bin 0 -> 71235 bytes new/PORT/cpm.tar.Z | Bin 0 -> 33848 bytes new/PORT/help.tar.Z | Bin 0 -> 30627 bytes new/PORT/mkmf.tar.Z | Bin 0 -> 74043 bytes new/PORT/spms.tar.Z | Bin 0 -> 380892 bytes new/PORT/tac.tar.Z | Bin 0 -> 10126 bytes new/PORT/tools.tar.Z | Bin 0 -> 23256 bytes new/ansi/Makefile | 34 + new/ansi/ansitape.1 | 141 + new/ansi/ansitape.c | 717 + new/ansi/vmsprep.1 | 81 + new/ansi/vmsprep.c | 164 + new/bm/Execute.c | 145 + new/bm/Extern.h | 13 + new/bm/GetPatFile.c | 42 + new/bm/Global.c | 13 + new/bm/MakeDesc.c | 24 + new/bm/MakeSkip.c | 45 + new/bm/Makefile | 45 + new/bm/MatchFound.c | 32 + new/bm/MkDescVec.c | 25 + new/bm/MoveResidue.c | 47 + new/bm/PrintLine.c | 33 + new/bm/PutUsage.c | 26 + new/bm/README | 43 + new/bm/Search.c | 40 + new/bm/bm.1 | 109 + new/bm/bm.c | 95 + new/bm/bm.h | 15 + new/crash/Makefile | 35 + new/crash/crash.1 | 77 + new/crash/crash.c | 1357 + new/crash/crash.h | 75 + new/crash/crashsubs.c | 712 + new/crash/dispnet.c | 917 + new/crash/if.c | 294 + new/crash/inet.c | 408 + new/crash/net.h | 39 + new/crash/route.c | 400 + new/crash/symbol.c | 323 + new/jove/Makefile | 298 + new/jove/Makefile.dos | 60 + new/jove/Ovmakefile | 224 + new/jove/README | 172 + new/jove/Readme.dos | 225 + new/jove/Readme.mac | 387 + new/jove/abbrev.c | 331 + new/jove/argcount.c | 243 + new/jove/ask.c | 569 + new/jove/buf.c | 726 + new/jove/c.c | 653 + new/jove/case.c | 228 + new/jove/ctype.c | 256 + new/jove/ctype.h | 51 + new/jove/delete.c | 312 + new/jove/disp.c | 1433 + new/jove/doc/README | 6 + new/jove/doc/cmds.doc | 1782 + new/jove/doc/cmds.doc.nr | 32 + new/jove/doc/example.rc | 24 + new/jove/doc/jove.1 | 1163 + new/jove/doc/jove.2 | 1122 + new/jove/doc/jove.3 | 406 + new/jove/doc/jove.4 | 879 + new/jove/doc/jove.5 | 780 + new/jove/doc/jove.nr | 283 + new/jove/doc/jove.qref | 132 + new/jove/doc/system.rc | 9 + new/jove/doc/teach-jove | 899 + new/jove/doc/teachjove.nr | 22 + new/jove/extend.c | 1058 + new/jove/externs.h | 1167 + new/jove/fmt.c | 439 + new/jove/fp.c | 438 + new/jove/funcdefs.c | 681 + new/jove/getch.c | 134 + new/jove/insert.c | 763 + new/jove/io.c | 1504 + new/jove/io.h | 48 + new/jove/iproc-pipes.c | 307 + new/jove/iproc-ptys.c | 427 + new/jove/iproc.c | 423 + new/jove/jove.c | 1317 + new/jove/jove.h | 631 + new/jove/keymaps.txt | 1067 + new/jove/mac.c | 2390 ++ new/jove/mac.h | 154 + new/jove/macros.c | 434 + new/jove/macvert.c | 167 + new/jove/malloc.c | 165 + new/jove/marks.c | 239 + new/jove/menumaps.txt | 131 + new/jove/misc.c | 525 + new/jove/mjovers.Hqx | 19 + new/jove/move.c | 311 + new/jove/paragraph.c | 552 + new/jove/portsrv.c | 167 + new/jove/proc.c | 864 + new/jove/re.c | 958 + new/jove/re.h | 21 + new/jove/re1.c | 585 + new/jove/rec.c | 169 + new/jove/rec.h | 22 + new/jove/recover.c | 730 + new/jove/scandir.c | 214 + new/jove/screen.c | 1542 + new/jove/setmaps.c | 209 + new/jove/table.c | 51 + new/jove/table.h | 28 + new/jove/teachjove.c | 40 + new/jove/temp.h | 84 + new/jove/term.c | 265 + new/jove/termcap.h | 79 + new/jove/tune.dos | 22 + new/jove/tune.h | 208 + new/jove/tune.template | 29 + new/jove/util.c | 946 + new/jove/vars.c | 130 + new/jove/version.c | 8 + new/jove/wind.c | 529 + new/kermit5.188/ckcasc.h | 59 + new/kermit5.188/ckcdeb.h | 1313 + new/kermit5.188/ckcfil.h | 7 + new/kermit5.188/ckcfn2.c | 1575 + new/kermit5.188/ckcfn3.c | 1436 + new/kermit5.188/ckcfns.c | 2104 + new/kermit5.188/ckcker.h | 460 + new/kermit5.188/ckcmai.c | 993 + new/kermit5.188/ckcmdb.c | 340 + new/kermit5.188/ckcnet.c | 1704 + new/kermit5.188/ckcnet.h | 390 + new/kermit5.188/ckcpro.w | 856 + new/kermit5.188/ckcsym.h | 5 + new/kermit5.188/ckcxla.h | 227 + new/kermit5.188/cku2tm.c | 265 + new/kermit5.188/ckucmd.c | 2222 + new/kermit5.188/ckucmd.h | 126 + new/kermit5.188/ckucon.c | 1333 + new/kermit5.188/ckudia.c | 2981 ++ new/kermit5.188/ckufio.c | 3016 ++ new/kermit5.188/ckuscr.c | 404 + new/kermit5.188/ckustr.c | 419 + new/kermit5.188/ckustr.sed | 62 + new/kermit5.188/ckutio.c | 6446 +++ new/kermit5.188/ckuus2.c | 1962 + new/kermit5.188/ckuus3.c | 1281 + new/kermit5.188/ckuus4.c | 2747 ++ new/kermit5.188/ckuus5.c | 3753 ++ new/kermit5.188/ckuus6.c | 1877 + new/kermit5.188/ckuus7.c | 2114 + new/kermit5.188/ckuusr.c | 2032 + new/kermit5.188/ckuusr.h | 582 + new/kermit5.188/ckuusx.c | 2218 + new/kermit5.188/ckuusy.c | 451 + new/kermit5.188/ckuver.h | 568 + new/kermit5.188/ckuxla.c | 3980 ++ new/kermit5.188/ckuxla.h | 69 + new/kermit5.188/ckwart.c | 673 + new/kermit5.188/makefile | 199 + new/l11/Makefile | 35 + new/l11/ReadMe | 17 + new/l11/in.c | 192 + new/l11/link.c | 849 + new/l11/link.h | 117 + new/l11/obint.c | 454 + new/l11/pass2.c | 945 + new/l11/sup.c | 150 + new/la/Makefile | 27 + new/la/la.1 | 19 + new/la/la.c | 14 + new/m11/Document | 287 + new/m11/Makefile | 49 + new/m11/READme | 38 + new/m11/at.sml | 425 + new/m11/code.m11 | 473 + new/m11/debug.m11 | 53 + new/m11/errs.m11 | 83 + new/m11/exec.m11 | 1473 + new/m11/expr.m11 | 567 + new/m11/fltg.m11 | 250 + new/m11/getl.m11 | 453 + new/m11/l11.x | Bin 0 -> 20126 bytes new/m11/lout.m11 | 958 + new/m11/m11.1 | 292 + new/m11/m11.x | Bin 0 -> 21630 bytes new/m11/mac.m11 | 886 + new/m11/macro.m11 | 221 + new/m11/macxrf.c | 352 + new/m11/misc.m11 | 305 + new/m11/often.m11 | 77 + new/m11/pst.m11 | 286 + new/m11/srch.m11 | 323 + new/m11/syscalls.m11 | 17 + new/m11/xlat.m11 | 1059 + new/m11/xpcor.m11 | 16 + new/nntp/CHANGES | 268 + new/nntp/Makefile | 73 + new/nntp/README | 173 + new/nntp/common/Makefile | 22 + new/nntp/common/README | 304 + new/nntp/common/README.HPUX | 6 + new/nntp/common/README.LIB | 34 + new/nntp/common/README.SYSV | 30 + new/nntp/common/clientlib.c | 503 + new/nntp/common/clientlib.h | 11 + new/nntp/common/conf.h | 195 + new/nntp/common/nntp.h | 73 + new/nntp/common/response_codes.h | 1 + new/nntp/common/version.c | 5 + new/nntp/doc/Makefile | 48 + new/nntp/doc/README | 12 + new/nntp/doc/config.sh | 60 + new/nntp/doc/getactive.dst | 39 + new/nntp/doc/mkgrdates.dst | 73 + new/nntp/doc/nntpd.dst | 193 + new/nntp/doc/rfc977 | 1539 + new/nntp/inews/Makefile | 45 + new/nntp/inews/README | 51 + new/nntp/inews/inews.c | 305 + new/nntp/inews/test | 11 + new/nntp/inews/test1 | 11 + new/nntp/inews/test2 | 11 + new/nntp/inews/uname.c | 93 + new/nntp/server/Makefile | 61 + new/nntp/server/README | 86 + new/nntp/server/SYSLOG | 50 + new/nntp/server/access.c | 207 + new/nntp/server/access_dnet.c | 64 + new/nntp/server/access_inet.c | 127 + new/nntp/server/active.c | 172 + new/nntp/server/ahbs.c | 128 + new/nntp/server/common.h | 139 + new/nntp/server/fakesyslog.c | 76 + new/nntp/server/fakesyslog.h | 65 + new/nntp/server/globals.c | 42 + new/nntp/server/group.c | 104 + new/nntp/server/help.c | 30 + new/nntp/server/ihave.c | 66 + new/nntp/server/list.c | 54 + new/nntp/server/main.c | 131 + new/nntp/server/misc.c | 612 + new/nntp/server/netaux.c | 271 + new/nntp/server/newgroups.c | 114 + new/nntp/server/newnews.c | 520 + new/nntp/server/nextlast.c | 87 + new/nntp/server/ngmatch.c | 114 + new/nntp/server/parsit.c | 103 + new/nntp/server/post.c | 53 + new/nntp/server/profile.c | 25 + new/nntp/server/scandir.c | 69 + new/nntp/server/serve.c | 314 + new/nntp/server/slave.c | 20 + new/nntp/server/spawn.c | 257 + new/nntp/server/strcasecmp.c | 84 + new/nntp/server/subnet.c | 249 + new/nntp/server/time.c | 219 + new/nntp/server/time.h | 10 + new/nntp/server/xhdr.c | 169 + new/nntp/support/Makefile | 42 + new/nntp/support/README | 42 + new/nntp/support/access_file | 22 + new/nntp/support/mkgrdates.c | 177 + new/nntp/support/nntp_awk | 458 + new/nntp/support/nntp_awk.ucbva | 458 + new/nntp/xfer/Makefile | 8 + new/nntp/xfer/README | 9 + new/nntp/xfer/nntpxfer.c | 507 + new/nntp/xmit/Makefile | 71 + new/nntp/xmit/README | 34 + new/nntp/xmit/get_tcp_conn.c | 321 + new/nntp/xmit/get_tcp_conn.h | 26 + new/nntp/xmit/llist.c | 61 + new/nntp/xmit/llist.h | 22 + new/nntp/xmit/nntp.h | 69 + new/nntp/xmit/nntp_awk | 458 + new/nntp/xmit/nntpsend.csh | 53 + new/nntp/xmit/nntpsend.sh | 55 + new/nntp/xmit/nntpxmit.1 | 187 + new/nntp/xmit/nntpxmit.c | 1137 + new/nntp/xmit/nntpxmit.h | 69 + new/nntp/xmit/remote.c | 423 + new/nntp/xmit/shlock.c | 283 + new/nntp/xmit/sysexits.h | 96 + new/notes/Answer.this | 37 + new/notes/HINTS | 22 + new/notes/MANIFEST | 194 + new/notes/Makefile | 94 + new/notes/Mod.diffs/diffs.doc | 160 + new/notes/Mod.diffs/diffs.man | 47 + new/notes/Mod.diffs/diffs.src | 865 + new/notes/README | 58 + new/notes/README2 | 69 + new/notes/Samples/Archive-into | 13 + new/notes/Samples/Makefile | 21 + new/notes/Samples/Read_me | 110 + new/notes/Samples/access-templat | 2 + new/notes/Samples/archlist | 8 + new/notes/Samples/avail.notes | 1373 + new/notes/Samples/cron.convex.sh | 5 + new/notes/Samples/cron.csh | 54 + new/notes/Samples/cron.sh | 39 + new/notes/Samples/cronXarch.sh | 21 + new/notes/Samples/cronarch-3.sh | 21 + new/notes/Samples/cronarch.sh | 29 + new/notes/Samples/cronarch2.sh | 19 + new/notes/Samples/cronlocal.sh | 17 + new/notes/Samples/cronnet.sh | 12 + new/notes/Samples/crontab | 7 + new/notes/Samples/hourly.csh | 6 + new/notes/Samples/make.moderated | 13 + new/notes/Samples/moderators | 105 + new/notes/Samples/net.how | 57 + new/notes/Samples/newsgroups | 88 + new/notes/Samples/short.names | 36 + new/notes/Samples/shorten | 5 + new/notes/Samples/syncnews | 18 + new/notes/Samples/sys | 3 + new/notes/Samples/sysA | 4 + new/notes/Samples/sysB | 3 + new/notes/Samples/uiucdcs.list | 27 + new/notes/Samples/uiucdcsb.list | 0 new/notes/Samples/uiucdcsi.list | 3 + new/notes/doc/0.long | 34 + new/notes/doc/0.short | 35 + new/notes/doc/1 | 65 + new/notes/doc/2.1 | 638 + new/notes/doc/2.2 | 349 + new/notes/doc/3.1 | 635 + new/notes/doc/3.2 | 325 + new/notes/doc/4.0 | 10 + new/notes/doc/4.1 | 20 + new/notes/doc/4.2 | 12 + new/notes/doc/4.3 | 95 + new/notes/doc/4.4 | 44 + new/notes/doc/4.5 | 26 + new/notes/doc/4.6 | 28 + new/notes/doc/4.7 | 47 + new/notes/doc/5 | 120 + new/notes/doc/Makefile | 94 + new/notes/doc/RCS/2.1,v | 683 + new/notes/doc/RCS/2.2,v | 387 + new/notes/doc/RCS/3.1,v | 677 + new/notes/doc/a.checklist | 471 + new/notes/doc/acks | 30 + new/notes/doc/b.interface | 429 + new/notes/doc/c.changes | 379 + new/notes/doc/macros | 287 + new/notes/doc/vtoc | 43 + new/notes/man/Makefile | 60 + new/notes/man/autoseq.1 | 1 + new/notes/man/checknotes.1 | 98 + new/notes/man/doit | 24 + new/notes/man/getdate.3 | 169 + new/notes/man/mknf.8 | 109 + new/notes/man/newsinput.8 | 1 + new/notes/man/newsoutput.8 | 216 + new/notes/man/nfabort.3 | 95 + new/notes/man/nfaccess.8 | 107 + new/notes/man/nfadmin.8 | 200 + new/notes/man/nfarchive.8 | 139 + new/notes/man/nfcomment.3 | 74 + new/notes/man/nfdump.8 | 86 + new/notes/man/nfload.8 | 1 + new/notes/man/nfmail.8 | 110 + new/notes/man/nfpipe.1 | 66 + new/notes/man/nfprint.1 | 92 + new/notes/man/nfrcv.8 | 1 + new/notes/man/nfstats.1 | 57 + new/notes/man/nftimestamp.8 | 80 + new/notes/man/nfxmit.8 | 144 + new/notes/man/notes.1 | 378 + new/notes/man/readnotes.1 | 1 + new/notes/man/rmnf.8 | 1 + new/notes/man/rscript | 13 + new/notes/src/Makefile | 1 + new/notes/src/Makefile.net | 49 + new/notes/src/Makefile.pdp | 307 + new/notes/src/Makefile.user | 57 + new/notes/src/Makefile.util | 76 + new/notes/src/Makefile.vax | 605 + new/notes/src/Revisions | 98 + new/notes/src/access.c | 380 + new/notes/src/access.help | 32 + new/notes/src/acssort.c | 254 + new/notes/src/adnote.c | 110 + new/notes/src/adresp.c | 81 + new/notes/src/archiver.c | 526 + new/notes/src/asearch.c | 141 + new/notes/src/bnewshead.c | 628 + new/notes/src/buildnf.c | 321 + new/notes/src/canon.h | 73 + new/notes/src/check.c | 51 + new/notes/src/checknotes.c | 186 + new/notes/src/compress.c | 260 + new/notes/src/control.c | 180 + new/notes/src/cursor.c | 220 + new/notes/src/datein.c | 97 + new/notes/src/delete.c | 50 + new/notes/src/dir.help | 34 + new/notes/src/dmpnote.c | 106 + new/notes/src/dmpresp.c | 123 + new/notes/src/doc.h | 59 + new/notes/src/dropt.c | 649 + new/notes/src/dsply.c | 362 + new/notes/src/dump.c | 224 + new/notes/src/dump.h | 97 + new/notes/src/expand.c | 216 + new/notes/src/find.c | 171 + new/notes/src/ftime.c | 45 + new/notes/src/gdate.c | 71 + new/notes/src/getdate.y | 523 + new/notes/src/getnet.c | 251 + new/notes/src/gname.c | 47 + new/notes/src/gtext.c | 110 + new/notes/src/gtime.c | 48 + new/notes/src/help.c | 44 + new/notes/src/index.c | 270 + new/notes/src/index.help | 51 + new/notes/src/ldmisc.c | 62 + new/notes/src/lim.help | 26 + new/notes/src/limindx.c | 170 + new/notes/src/loadem.c | 402 + new/notes/src/loadnf.c | 340 + new/notes/src/loadproto1.c | 76 + new/notes/src/loadvars.c | 132 + new/notes/src/lprnote.c | 165 + new/notes/src/lrsp.c | 82 + new/notes/src/mailit.c | 246 + new/notes/src/main.c | 273 + new/notes/src/misc.c | 647 + new/notes/src/miscio.c | 527 + new/notes/src/mknf.c | 114 + new/notes/src/moderators | 101 + new/notes/src/net.h | 62 + new/notes/src/newsdump.c | 565 + new/notes/src/newsgate.h | 157 + new/notes/src/newsgroup.c | 126 + new/notes/src/newsinput.c | 820 + new/notes/src/newsout.c | 229 + new/notes/src/newsoutput.c | 263 + new/notes/src/newspath.c | 99 + new/notes/src/next.c | 112 + new/notes/src/nfabort.c | 68 + new/notes/src/nfaccess.c | 78 + new/notes/src/nfadmin.c | 288 + new/notes/src/nfalias.c | 76 + new/notes/src/nfarchive.c | 117 + new/notes/src/nfcomment.c | 63 + new/notes/src/nfdump.c | 32 + new/notes/src/nfload.c | 43 + new/notes/src/nfmail.c | 517 + new/notes/src/nfpipe.c | 124 + new/notes/src/nfprint.c | 197 + new/notes/src/nfrcv.c | 137 + new/notes/src/nfsend.c | 262 + new/notes/src/nfstats.c | 171 + new/notes/src/nftimestamp.c | 133 + new/notes/src/nfxmit.c | 211 + new/notes/src/note.c | 124 + new/notes/src/notes.lock | 92 + new/notes/src/notes.lock.ori | 113 + new/notes/src/pagein.c | 91 + new/notes/src/pagemove.c | 84 + new/notes/src/pageout.c | 48 + new/notes/src/parms.h | 245 + new/notes/src/parse.c | 34 + new/notes/src/parsepath.c | 254 + new/notes/src/pattern.c | 45 + new/notes/src/permit.c | 44 + new/notes/src/perms.c | 206 + new/notes/src/placedoc | 0 new/notes/src/placelib | 0 new/notes/src/preptxt.c | 73 + new/notes/src/prtind.c | 120 + new/notes/src/read.help | 76 + new/notes/src/readem.c | 930 + new/notes/src/recsio.c | 352 + new/notes/src/resp.c | 231 + new/notes/src/rinstall | 77 + new/notes/src/rmnf.c | 114 + new/notes/src/savtxt.c | 104 + new/notes/src/startup.c | 217 + new/notes/src/strcasecmp.c | 72 + new/notes/src/structs.h | 421 + new/notes/src/tags | 206 + new/notes/src/talkto.c | 45 + new/notes/src/times.c | 187 + new/notes/src/tsearch.c | 123 + new/pathalias/CHANGES | 34 + new/pathalias/Makefile | 76 + new/pathalias/README | 28 + new/pathalias/addlink.c | 261 + new/pathalias/addnode.c | 402 + new/pathalias/arpa-privates | 289 + new/pathalias/arpatxt.c | 655 + new/pathalias/config.h | 81 + new/pathalias/def.h | 183 + new/pathalias/getstruct.c | 307 + new/pathalias/local.c | 82 + new/pathalias/main.c | 192 + new/pathalias/make.honey | 115 + new/pathalias/makedb.c | 129 + new/pathalias/mapaux.c | 387 + new/pathalias/mapit.c | 650 + new/pathalias/mem.c | 307 + new/pathalias/parse.y | 421 + new/pathalias/pathalias.1 | 533 + new/pathalias/printit.c | 339 + new/pathalias/venix.patch | 225 + new/rcs/BUGS | 2 + new/rcs/Makefile | 39 + new/rcs/README | 31 + new/rcs/README-2.10 | 6 + new/rcs/doc/rcs.ms | 1504 + new/rcs/doc/rcs_functs.ms | 95 + new/rcs/man/Makefile | 45 + new/rcs/man/ci.1 | 197 + new/rcs/man/co.1 | 267 + new/rcs/man/ident.1 | 68 + new/rcs/man/merge.1 | 45 + new/rcs/man/rcs.1 | 165 + new/rcs/man/rcsdiff.1 | 61 + new/rcs/man/rcsfile.5 | 156 + new/rcs/man/rcsfreeze.1 | 50 + new/rcs/man/rcsintro.1 | 240 + new/rcs/man/rcsmerge.1 | 75 + new/rcs/man/rlog.1 | 133 + new/rcs/man/sccstorcs.1 | 51 + new/rcs/src/Makefile | 288 + new/rcs/src/READ_ME | 61 + new/rcs/src/ci.c | 953 + new/rcs/src/co.c | 611 + new/rcs/src/curdir.c | 114 + new/rcs/src/ident.c | 150 + new/rcs/src/maketime.c | 238 + new/rcs/src/merge.sh | 44 + new/rcs/src/partime.c | 492 + new/rcs/src/rcs.c | 1534 + new/rcs/src/rcsbase.h | 345 + new/rcs/src/rcsclean.c | 184 + new/rcs/src/rcsclean.sh | 40 + new/rcs/src/rcsdiff.c | 261 + new/rcs/src/rcsedit.c | 483 + new/rcs/src/rcsfcmp.c | 200 + new/rcs/src/rcsfnms.c | 762 + new/rcs/src/rcsfreeze.sh | 94 + new/rcs/src/rcsgen.c | 309 + new/rcs/src/rcskeep.c | 283 + new/rcs/src/rcskeys.c | 81 + new/rcs/src/rcslex.c | 725 + new/rcs/src/rcsmerge.c | 165 + new/rcs/src/rcsrev.c | 697 + new/rcs/src/rcssyn.c | 546 + new/rcs/src/rcsutil.c | 372 + new/rcs/src/rlog.c | 1183 + new/rcs/src/sccstorcs.c | 444 + new/rcs/src/snoop.c | 107 + new/rcs/src/time.h | 52 + new/rn/.falseactive | 1 + new/rn/Configure | 2092 + new/rn/EXTERN.h | 15 + new/rn/HACKERSGUIDE | 78 + new/rn/INIT | 1 + new/rn/INTERN.h | 15 + new/rn/MANIFEST | 103 + new/rn/Makefile | 869 + new/rn/Makefile.SH | 141 + new/rn/NEW | 77 + new/rn/Pnews | 458 + new/rn/Pnews.1 | 128 + new/rn/Pnews.SH | 656 + new/rn/Pnews.header | 185 + new/rn/README | 113 + new/rn/Rnmail | 309 + new/rn/Rnmail.1 | 124 + new/rn/Rnmail.SH | 319 + new/rn/Wishlist | 21 + new/rn/addng.c | 158 + new/rn/addng.h | 14 + new/rn/all | 0 new/rn/art.c | 914 + new/rn/art.h | 19 + new/rn/art.help | 65 + new/rn/art.help.SH | 73 + new/rn/artio.c | 124 + new/rn/artio.h | 19 + new/rn/artsrch.c | 290 + new/rn/artsrch.h | 40 + new/rn/artstate.h | 33 + new/rn/backpage.c | 108 + new/rn/backpage.h | 19 + new/rn/bits.c | 643 + new/rn/bits.h | 68 + new/rn/bsd | 1 + new/rn/cheat.c | 137 + new/rn/cheat.h | 22 + new/rn/common.h | 803 + new/rn/config.h | 83 + new/rn/config.sh | 96 + new/rn/eunice | 1 + new/rn/filexp | 32 + new/rn/final.c | 228 + new/rn/final.h | 29 + new/rn/getactive.c | 67 + new/rn/head.c | 356 + new/rn/head.c.bak | 323 + new/rn/head.h | 117 + new/rn/header.c.1.pat | 85 + new/rn/header.c.2.pat | 82 + new/rn/header.h.1.pat | 22 + new/rn/header.h.2.pat | 19 + new/rn/help.c | 315 + new/rn/help.h | 15 + new/rn/inews.c.1.pat | 303 + new/rn/inews.c.2.pat | 460 + new/rn/init.c | 341 + new/rn/init.h | 14 + new/rn/intrp.c | 1011 + new/rn/intrp.h | 27 + new/rn/kfile.c | 281 + new/rn/kfile.h | 25 + new/rn/kitleader | 19 + new/rn/kitlists.c | 49 + new/rn/kittrailer | 31 + new/rn/last.c | 53 + new/rn/last.h | 14 + new/rn/loc | 23 + new/rn/makedepend | 60 + new/rn/makedepend.SH | 68 + new/rn/makedir | 52 + new/rn/makedir.SH | 60 + new/rn/makedist | 13 + new/rn/makekit | 28 + new/rn/manifake | 18 + new/rn/manimake | 26 + new/rn/mbox.saver | 33 + new/rn/mbox.saver.SH | 41 + new/rn/myread | 17 + new/rn/ndir.c | 116 + new/rn/ndir.h | 59 + new/rn/newsetup | 165 + new/rn/newsetup.1 | 76 + new/rn/newsetup.SH | 173 + new/rn/newsgroups | 54 + new/rn/newsgroups.1 | 75 + new/rn/newsgroups.SH | 62 + new/rn/newsnews | 21 + new/rn/newsnews.SH | 28 + new/rn/ng.c | 1039 + new/rn/ng.h | 36 + new/rn/ng.help | 45 + new/rn/ng.help.SH | 53 + new/rn/ngdata.c | 266 + new/rn/ngdata.h | 31 + new/rn/ngsrch.c | 144 + new/rn/ngsrch.h | 25 + new/rn/ngstuff.c | 334 + new/rn/ngstuff.h | 18 + new/rn/norm.saver | 31 + new/rn/norm.saver.SH | 39 + new/rn/only.c | 126 + new/rn/only.h | 29 + new/rn/pager.help | 41 + new/rn/pager.help.SH | 49 + new/rn/patchlevel | 1 + new/rn/pdp11 | 1 + new/rn/rcln.c | 451 + new/rn/rcln.h | 23 + new/rn/rcstuff.c | 987 + new/rn/rcstuff.h | 39 + new/rn/respond.c | 433 + new/rn/respond.h | 21 + new/rn/rn.1 | 1701 + new/rn/rn.c | 544 + new/rn/rn.h | 22 + new/rn/search.c | 602 + new/rn/search.h | 37 + new/rn/server.h | 10 + new/rn/subs.help | 50 + new/rn/subs.help.SH | 60 + new/rn/sw.c | 503 + new/rn/sw.h | 18 + new/rn/term.c | 1037 + new/rn/term.h | 219 + new/rn/usg | 1 + new/rn/util.c | 544 + new/rn/util.h | 41 + new/rn/v7 | 1 + new/vmsbackup/Makefile | 29 + new/vmsbackup/README | 19 + new/vmsbackup/match.c | 312 + new/vmsbackup/vmsbackup.1 | 129 + new/vmsbackup/vmsbackup.c | 888 + old/512dumpdir.c | 564 + old/512restor.c | 1288 + old/Makefile | 68 + old/arcv/Makefile | 19 + old/arcv/arcv.8 | 29 + old/arcv/arcv.c | 121 + old/astags/astags.1 | 32 + old/astags/astags.sh | 11 + old/checkobj/Makefile | 27 + old/checkobj/checkobj.1 | 56 + old/checkobj/checkobj.c | 253 + old/compact/Makefile | 22 + old/compact/ccat.sh | 8 + old/compact/compact.c | 339 + old/compact/compact.h | 69 + old/compact/tree.c | 157 + old/compact/uncompact.c | 228 + old/cu/cu.1c | 220 + old/cu/cu.c | 958 + old/dump/Makefile | 41 + old/dump/dump.h | 132 + old/dump/dumpdir.c | 476 + old/dump/dumpitime.c | 245 + old/dump/dumpmain.c | 258 + old/dump/dumpoptr.c | 343 + old/dump/dumptape.c | 263 + old/dump/dumptraverse.c | 280 + old/dump/unctime.c | 109 + old/nmcoll/Makefile | 25 + old/nmcoll/nmcoll.1 | 28 + old/nmcoll/nmcoll.sh | 14 + old/num.c | 62 + old/oldassn/Makefile | 29 + old/oldassn/oldassn.1 | 20 + old/oldassn/oldassn.l | 176 + old/prep/Makefile | 21 + old/prep/prep.1 | 59 + old/prep/prep.h | 71 + old/prep/prep0.c | 253 + old/prep/prep1.c | 283 + old/prep/prep2.c | 47 + old/prmail/prmail.1 | 18 + old/prmail/prmail.c | 75 + old/regexp.c | 543 + old/shortc/Makefile | 27 + old/shortc/shortc.1 | 59 + old/shortc/shortc.c | 346 + old/uudiff/Makefile | 22 + old/uudiff/lenrem.c | 13 + old/uudiff/locpart.c | 12 + old/uudiff/printable.c | 16 + old/uudiff/remdiff | 116 + old/uudiff/run1.c | 80 + old/uudiff/trim.c | 19 + old/v6/Makefile | 25 + old/v6/filsys.h | 13 + old/v6/inode.h | 27 + old/v6/v6.c | 426 + old/vpr.tar.Z | Bin 0 -> 72039 bytes sbin/Makefile | 27 + sbin/XNSrouted/Makefile | 24 + sbin/XNSrouted/XNSrouted.c | 5 + sbin/badsect/Makefile | 37 + sbin/badsect/badsect.8 | 79 + sbin/badsect/badsect.c | 40 + sbin/clri/Makefile | 37 + sbin/clri/clri.8 | 44 + sbin/clri/clri.c | 88 + sbin/dcheck/Makefile | 37 + sbin/dcheck/dcheck.8 | 58 + sbin/dcheck/dcheck.c | 303 + sbin/dmesg/Makefile | 37 + sbin/dmesg/dmesg.8 | 36 + sbin/dmesg/dmesg.c | 144 + sbin/dump/Makefile | 58 + sbin/dump/dump.h | 127 + sbin/dump/dumpdir.c | 504 + sbin/dump/dumpitime.c | 208 + sbin/dump/dumpmain.c | 414 + sbin/dump/dumpoptr.c | 322 + sbin/dump/dumprmt.c | 208 + sbin/dump/dumptape.c | 477 + sbin/dump/dumptraverse.c | 280 + sbin/dump/unctime.c | 111 + sbin/dumpfs/Makefile | 37 + sbin/dumpfs/dumpfs.8 | 27 + sbin/dumpfs/dumpfs.c | 5 + sbin/fsck/Makefile | 74 + sbin/fsck/dir.c | 569 + sbin/fsck/fsck.h | 221 + sbin/fsck/inode.c | 305 + sbin/fsck/main.c | 354 + sbin/fsck/pass1.c | 189 + sbin/fsck/pass1b.c | 60 + sbin/fsck/pass2.c | 266 + sbin/fsck/pass3.c | 52 + sbin/fsck/pass4.c | 86 + sbin/fsck/pass5.c | 217 + sbin/fsck/setup.c | 163 + sbin/fsck/utilities.c | 577 + sbin/gt307/Makefile | 37 + sbin/gt307/gt307.8 | 78 + sbin/gt307/gt307.c | 251 + sbin/icheck/Makefile | 37 + sbin/icheck/icheck.8 | 99 + sbin/icheck/icheck.c | 482 + sbin/ifconfig/Makefile | 37 + sbin/ifconfig/ifconfig.8 | 178 + sbin/ifconfig/ifconfig.c | 496 + sbin/init/Makefile | 38 + sbin/init/init.8 | 144 + sbin/init/init.c | 782 + sbin/mkfs/Makefile | 37 + sbin/mkfs/mkfs.8 | 87 + sbin/mkfs/mkfs.c | 470 + sbin/mknod/Makefile | 37 + sbin/mknod/mknod.8 | 45 + sbin/mknod/mknod.c | 50 + sbin/mkpasswd/Makefile | 49 + sbin/mkpasswd/mkpasswd.8 | 59 + sbin/mkpasswd/mkpasswd.c | 231 + sbin/mount/Makefile | 40 + sbin/mount/getmntopts.3 | 178 + sbin/mount/getmntopts.c | 87 + sbin/mount/mntopts.h | 81 + sbin/mount/mount.8 | 276 + sbin/mount/mount.c | 498 + sbin/mount/mount_ufs.c | 117 + sbin/mount/pathnames.h | 37 + sbin/ncheck/Makefile | 37 + sbin/ncheck/ncheck.8 | 49 + sbin/ncheck/ncheck.c | 377 + sbin/newfs/Makefile | 37 + sbin/newfs/newfs.8 | 108 + sbin/newfs/newfs.c | 263 + sbin/quotacheck/Makefile | 37 + sbin/quotacheck/preen.c | 346 + sbin/quotacheck/quotacheck.8 | 143 + sbin/quotacheck/quotacheck.c | 532 + sbin/reboot/Makefile | 43 + sbin/reboot/reboot.8 | 133 + sbin/reboot/reboot.c | 180 + sbin/restor/Makefile | 37 + sbin/restor/restor.8 | 141 + sbin/restor/restor.c | 1269 + sbin/route/Makefile | 37 + sbin/route/route.8 | 156 + sbin/route/route.c | 581 + sbin/routed/Makefile | 37 + sbin/routed/af.c | 144 + sbin/routed/af.h | 38 + sbin/routed/defs.h | 67 + sbin/routed/if.c | 121 + sbin/routed/inet.c | 189 + sbin/routed/input.c | 200 + sbin/routed/interface.h | 63 + sbin/routed/main.c | 195 + sbin/routed/make.out | 36 + sbin/routed/output.c | 119 + sbin/routed/startup.c | 356 + sbin/routed/table.h | 74 + sbin/routed/tables.c | 248 + sbin/routed/timer.c | 104 + sbin/routed/tools/Makefile | 26 + sbin/routed/tools/query.c | 247 + sbin/routed/tools/trace.c | 96 + sbin/routed/trace.c | 266 + sbin/routed/trace.h | 63 + sbin/savecore/Makefile | 37 + sbin/savecore/savecore.8 | 63 + sbin/savecore/savecore.c | 433 + sbin/shutdown/Makefile | 37 + sbin/shutdown/shutdown.8 | 112 + sbin/shutdown/shutdown.c | 402 + sbin/slattach/Makefile | 37 + sbin/slattach/slattach.8 | 42 + sbin/slattach/slattach.c | 132 + sbin/swapon/Makefile | 37 + sbin/swapon/swapon.8 | 51 + sbin/swapon/swapon.c | 5 + sbin/testnet/Makefile | 31 + sbin/testnet/testnet.c | 20 + sbin/tunefs/Makefile | 37 + sbin/tunefs/tunefs.8 | 95 + sbin/tunefs/tunefs.c | 5 + sbin/umount/Makefile | 37 + sbin/umount/umount.8 | 115 + sbin/umount/umount.c | 308 + share/Makefile | 24 + share/adb/Makefile | 19 + share/adb/N/buf | 2 + share/adb/N/idp | 1 + share/adb/N/ifaddr | 1 + share/adb/N/nspcb | 5 + share/adb/N/nsrtentry | 1 + share/adb/N/route | 1 + share/adb/N/spp | 1 + share/adb/N/sppcb | 6 + share/adb/N/tty | 13 + share/adb/N/xx | 2 + share/adb/PORT/clist | 11 + share/adb/PORT/clist.nxt | 8 + share/adb/PORT/dino | 6 + share/adb/PORT/dir | 2 + share/adb/PORT/dir.nxt | 2 + share/adb/PORT/dirblk | 3 + share/adb/PORT/dmap | 2 + share/adb/PORT/dmcstats | 8 + share/adb/PORT/file | 2 + share/adb/PORT/filsys | 5 + share/adb/PORT/findinode | 10 + share/adb/PORT/findinode.nxt | 7 + share/adb/PORT/findproc | 10 + share/adb/PORT/findproc.nxt | 6 + share/adb/PORT/frame | 7 + share/adb/PORT/host.nxt | 3 + share/adb/PORT/hosts | 2 + share/adb/PORT/hosts.nxt | 2 + share/adb/PORT/hosttable | 4 + share/adb/PORT/ifnet | 1 + share/adb/PORT/ifrw | 2 + share/adb/PORT/ifuba | 3 + share/adb/PORT/ifubinfo | 1 + share/adb/PORT/ifxmt | 2 + share/adb/PORT/imp | 4 + share/adb/PORT/in_ifaddr | 1 + share/adb/PORT/inode | 6 + share/adb/PORT/inpcb | 4 + share/adb/PORT/iovec | 2 + share/adb/PORT/ipreass | 3 + share/adb/PORT/ipreass.nxt | 2 + share/adb/PORT/mact | 3 + share/adb/PORT/mact.nxt | 3 + share/adb/PORT/mba_device | 3 + share/adb/PORT/mba_hd | 1 + share/adb/PORT/mbstat | 1 + share/adb/PORT/mbufchain | 6 + share/adb/PORT/mount | 1 + share/adb/PORT/nameidata | 4 + share/adb/PORT/nl | 7 + share/adb/PORT/nu | 12 + share/adb/PORT/oimp | 4 + share/adb/PORT/packetchain | 6 + share/adb/PORT/pcb | 1 + share/adb/PORT/proc | 14 + share/adb/PORT/protosw | 1 + share/adb/PORT/quota | 3 + share/adb/PORT/rawcb | 2 + share/adb/PORT/rtentry | 1 + share/adb/PORT/rusage | 5 + share/adb/PORT/setproc | 4 + share/adb/PORT/setproc.done | 1 + share/adb/PORT/setproc.nxt | 6 + share/adb/PORT/socket | 1 + share/adb/PORT/stacktrace | 2 + share/adb/PORT/stat | 7 + share/adb/PORT/tcpcb | 1 + share/adb/PORT/tcpip | 3 + share/adb/PORT/tcpreass | 3 + share/adb/PORT/tcpreass.nxt | 2 + share/adb/PORT/text | 1 + share/adb/PORT/traceall | 2 + share/adb/PORT/traceall.nxt | 5 + share/adb/PORT/trapframe | 3 + share/adb/PORT/tty | 13 + share/adb/PORT/u.all | 12 + share/adb/PORT/ubadev | 1 + share/adb/PORT/ubahd | 1 + share/adb/PORT/uio | 3 + share/adb/PORT/un | 4 + share/adb/PORT/unpcb | 1 + share/adb/PORT/vtimes | 3 + share/adb/buf | 2 + share/adb/callout | 2 + share/adb/callout.next | 4 + share/adb/file | 1 + share/adb/ifaddr | 1 + share/adb/ifnet | 2 + share/adb/inode | 1 + share/adb/ip | 1 + share/adb/label | 1 + share/adb/mbstat | 1 + share/adb/mbuf | 1 + share/adb/mbuf.nxt | 4 + share/adb/mbufs | 4 + share/adb/mbufs.nxt | 2 + share/adb/proc | 10 + share/adb/protosw | 1 + share/adb/rusage | 1 + share/adb/socket | 1 + share/adb/tcpcb | 1 + share/adb/u | 36 + share/adb/xip | 1 + share/font/Makefile | 24 + share/font/fontlist | 48 + share/font/ftB | Bin 0 -> 272 bytes share/font/ftBC | Bin 0 -> 256 bytes share/font/ftC | Bin 0 -> 256 bytes share/font/ftCE | Bin 0 -> 256 bytes share/font/ftCI | Bin 0 -> 256 bytes share/font/ftCK | Bin 0 -> 256 bytes share/font/ftCW | Bin 0 -> 256 bytes share/font/ftFD | Bin 0 -> 256 bytes share/font/ftG | Bin 0 -> 256 bytes share/font/ftGI | Bin 0 -> 256 bytes share/font/ftGM | Bin 0 -> 256 bytes share/font/ftGR | Bin 0 -> 256 bytes share/font/ftH | Bin 0 -> 256 bytes share/font/ftHI | Bin 0 -> 256 bytes share/font/ftHM | Bin 0 -> 256 bytes share/font/ftI | Bin 0 -> 272 bytes share/font/ftL | Bin 0 -> 256 bytes share/font/ftLI | Bin 0 -> 256 bytes share/font/ftPA | Bin 0 -> 256 bytes share/font/ftPB | Bin 0 -> 256 bytes share/font/ftPI | Bin 0 -> 256 bytes share/font/ftR | Bin 0 -> 272 bytes share/font/ftS | Bin 0 -> 256 bytes share/font/ftSB | Bin 0 -> 256 bytes share/font/ftSI | Bin 0 -> 256 bytes share/font/ftSM | Bin 0 -> 256 bytes share/font/ftTB | Bin 0 -> 256 bytes share/font/ftTI | Bin 0 -> 256 bytes share/font/ftTR | Bin 0 -> 256 bytes share/font/ftTS | Bin 0 -> 256 bytes share/font/ftUD | Bin 0 -> 256 bytes share/font/ftap | Bin 0 -> 288 bytes share/font/ftbb | Bin 0 -> 288 bytes share/font/ftbi | Bin 0 -> 288 bytes share/font/ftbk | Bin 0 -> 288 bytes share/font/ftbr | Bin 0 -> 288 bytes share/font/ftcb | Bin 0 -> 272 bytes share/font/ftch | Bin 0 -> 272 bytes share/font/ftci | Bin 0 -> 272 bytes share/font/ftcl | Bin 0 -> 272 bytes share/font/ftco | Bin 0 -> 272 bytes share/font/ftcr | Bin 0 -> 272 bytes share/font/ftct | Bin 0 -> 272 bytes share/font/ftcy | Bin 0 -> 277 bytes share/font/ftdb | Bin 0 -> 272 bytes share/font/ftdi | Bin 0 -> 288 bytes share/font/ftdr | Bin 0 -> 288 bytes share/font/ftfx | Bin 0 -> 288 bytes share/font/ftgb | Bin 0 -> 288 bytes share/font/ftgf | Bin 0 -> 272 bytes share/font/ftgi | Bin 0 -> 288 bytes share/font/ftgk | Bin 0 -> 272 bytes share/font/ftgr | Bin 0 -> 288 bytes share/font/fthb | Bin 0 -> 272 bytes share/font/fthn | Bin 0 -> 277 bytes share/font/ftm | Bin 0 -> 288 bytes share/font/ftmb | Bin 0 -> 288 bytes share/font/ftmi | Bin 0 -> 288 bytes share/font/ftmn | Bin 0 -> 277 bytes share/font/ftmr | Bin 0 -> 288 bytes share/font/ftnb | Bin 0 -> 288 bytes share/font/ftni | Bin 0 -> 288 bytes share/font/ftnr | Bin 0 -> 288 bytes share/font/ftob | Bin 0 -> 288 bytes share/font/ftoe | Bin 0 -> 288 bytes share/font/ftoi | Bin 0 -> 288 bytes share/font/ftor | Bin 0 -> 288 bytes share/font/ftpb | Bin 0 -> 288 bytes share/font/ftpp | Bin 0 -> 288 bytes share/font/ftsb | Bin 0 -> 256 bytes share/font/ftsc | Bin 0 -> 288 bytes share/font/ftsg | Bin 0 -> 288 bytes share/font/ftsh | Bin 0 -> 288 bytes share/font/ftsi | Bin 0 -> 256 bytes share/font/ftsl | Bin 0 -> 277 bytes share/font/ftsr | Bin 0 -> 256 bytes share/font/fttB | Bin 0 -> 272 bytes share/font/fttI | Bin 0 -> 272 bytes share/font/fttR | Bin 0 -> 272 bytes share/font/fttS | Bin 0 -> 272 bytes share/font/fttb | Bin 0 -> 277 bytes share/font/ftti | Bin 0 -> 277 bytes share/font/fttr | Bin 0 -> 277 bytes share/font/ftts | Bin 0 -> 277 bytes share/font/ftwp | Bin 0 -> 288 bytes share/font/ftxx | Bin 0 -> 272 bytes share/fontinfo/Makefile | 23 + share/fontinfo/apl | 2 + share/fontinfo/basker.b | 2 + share/fontinfo/basker.i | 2 + share/fontinfo/basker.r | 2 + share/fontinfo/bocklin | 2 + share/fontinfo/bodoni.b | 2 + share/fontinfo/bodoni.i | 2 + share/fontinfo/bodoni.r | 2 + share/fontinfo/chess | 2 + share/fontinfo/clarendon | 2 + share/fontinfo/cm.b | 2 + share/fontinfo/cm.i | 2 + share/fontinfo/cm.r | 2 + share/fontinfo/countdown | 2 + share/fontinfo/cyrillic | 2 + share/fontinfo/delegate.b | 2 + share/fontinfo/delegate.i | 2 + share/fontinfo/delegate.r | 2 + share/fontinfo/fix | 3 + share/fontinfo/gacham.b | 3 + share/fontinfo/gacham.i | 3 + share/fontinfo/gacham.r | 3 + share/fontinfo/graphics | 2 + share/fontinfo/greek | 2 + share/fontinfo/h19 | 3 + share/fontinfo/hebrew | 2 + share/fontinfo/meteor.b | 3 + share/fontinfo/meteor.i | 3 + share/fontinfo/meteor.r | 3 + share/fontinfo/mona | 2 + share/fontinfo/nonie.b | 3 + share/fontinfo/nonie.i | 3 + share/fontinfo/nonie.r | 3 + share/fontinfo/oldenglish | 2 + share/fontinfo/otimes.b | 2 + share/fontinfo/otimes.i | 2 + share/fontinfo/otimes.r | 2 + share/fontinfo/otimes.s | 2 + share/fontinfo/pip | 2 + share/fontinfo/playbill | 2 + share/fontinfo/script | 2 + share/fontinfo/seal | 2 + share/fontinfo/shadow | 2 + share/fontinfo/sign | 2 + share/fontinfo/stare.b | 0 share/fontinfo/stare.i | 0 share/fontinfo/stare.r | 0 share/fontinfo/times.b | 2 + share/fontinfo/times.i | 2 + share/fontinfo/times.r | 2 + share/fontinfo/times.s | 2 + share/fontinfo/ugramma | 2 + share/fontinfo/wumpus | 2 + share/learn/C/L0 | 2 + share/learn/C/L0.1a | 19 + share/learn/C/L1.1a | 23 + share/learn/C/L1.1b | 31 + share/learn/C/L1.1c | 18 + share/learn/C/L1.1d | 33 + share/learn/C/L1.1e | 14 + share/learn/C/L1.1f | 19 + share/learn/C/L10 | 15 + share/learn/C/L11.1a | 35 + share/learn/C/L11.2a | 29 + share/learn/C/L12.1a | 35 + share/learn/C/L12.1b | 60 + share/learn/C/L13.1a | 39 + share/learn/C/L14.1a | 38 + share/learn/C/L14.2a | 26 + share/learn/C/L14.2b | 41 + share/learn/C/L15.1a | 33 + share/learn/C/L15.1b | 40 + share/learn/C/L16.2a | 54 + share/learn/C/L16.2b | 40 + share/learn/C/L16.2c | 67 + share/learn/C/L17.1a | 71 + share/learn/C/L17.1c | 50 + share/learn/C/L18.1a | 49 + share/learn/C/L19.1a | 29 + share/learn/C/L2.1a | 55 + share/learn/C/L2.1b | 21 + share/learn/C/L2.1c | 16 + share/learn/C/L2.1d | 15 + share/learn/C/L2.1e | 19 + share/learn/C/L20.1a | 105 + share/learn/C/L3.1a | 56 + share/learn/C/L3.1b | 14 + share/learn/C/L30.1a | 45 + share/learn/C/L31.1a | 48 + share/learn/C/L32.1a | 50 + share/learn/C/L33.1a | 23 + share/learn/C/L35.1a | 35 + share/learn/C/L37.1a | 57 + share/learn/C/L4.1a | 10 + share/learn/C/L40.1a | 56 + share/learn/C/L41.1a | 67 + share/learn/C/L42.1a | 57 + share/learn/C/L43.1a | 70 + share/learn/C/L43.1b | 67 + share/learn/C/L5.1a | 26 + share/learn/C/L5.1b | 25 + share/learn/C/L5.1c | 31 + share/learn/C/L5.1d | 48 + share/learn/C/L5.1e | 31 + share/learn/C/L5.1f | 17 + share/learn/C/L5.1g | 38 + share/learn/C/L5.2a | 27 + share/learn/C/L5.2b | 28 + share/learn/C/L5.2e | 58 + share/learn/C/L5.3e | 29 + share/learn/C/L50.1a | 145 + share/learn/C/L9.1a | 33 + share/learn/C/getline.c | 16 + share/learn/C/getnum.c | 13 + share/learn/Linfo | 7 + share/learn/Makefile | 36 + share/learn/Xinfo | 21 + share/learn/editor/L0 | 2 + share/learn/editor/L1.1a | 20 + share/learn/editor/L10.1a | 32 + share/learn/editor/L10.1b | 38 + share/learn/editor/L10.2a | 39 + share/learn/editor/L10.2b | 30 + share/learn/editor/L10.2c | 18 + share/learn/editor/L10.3a | 27 + share/learn/editor/L10.3b | 36 + share/learn/editor/L10.3c | 19 + share/learn/editor/L10.3d | 13 + share/learn/editor/L10.3e | 14 + share/learn/editor/L10.3f | 32 + share/learn/editor/L11.1a | 44 + share/learn/editor/L11.2a | 38 + share/learn/editor/L11.2b | 26 + share/learn/editor/L11.2c | 28 + share/learn/editor/L12.1a | 33 + share/learn/editor/L12.1b | 27 + share/learn/editor/L12.2a | 39 + share/learn/editor/L12.2b | 17 + share/learn/editor/L12.2c | 22 + share/learn/editor/L12.3a | 26 + share/learn/editor/L13.1a | 33 + share/learn/editor/L13.2a | 33 + share/learn/editor/L13.2b | 20 + share/learn/editor/L13.3a | 32 + share/learn/editor/L14.1a | 30 + share/learn/editor/L14.2a | 26 + share/learn/editor/L14.2b | 23 + share/learn/editor/L15.1a | 29 + share/learn/editor/L15.1b | 18 + share/learn/editor/L15.2a | 26 + share/learn/editor/L15.2b | 14 + share/learn/editor/L15.2c | 19 + share/learn/editor/L15.2d | 19 + share/learn/editor/L15.3b | 24 + share/learn/editor/L15.3d | 14 + share/learn/editor/L15.3e | 16 + share/learn/editor/L15.3f | 20 + share/learn/editor/L16.1a | 31 + share/learn/editor/L16.1b | 19 + share/learn/editor/L16.1c | 37 + share/learn/editor/L16.2a | 40 + share/learn/editor/L16.2c | 14 + share/learn/editor/L17.2a | 14 + share/learn/editor/L17.2b | 12 + share/learn/editor/L17.2c | 11 + share/learn/editor/L17.2d | 12 + share/learn/editor/L18.1a | 40 + share/learn/editor/L18.2a | 41 + share/learn/editor/L18.2c | 15 + share/learn/editor/L18.2d | 11 + share/learn/editor/L18.2e | 33 + share/learn/editor/L18.3a | 13 + share/learn/editor/L18.3b | 18 + share/learn/editor/L19.1a | 40 + share/learn/editor/L19.1b | 38 + share/learn/editor/L19.2a | 41 + share/learn/editor/L19.2c | 34 + share/learn/editor/L19.2d | 36 + share/learn/editor/L19.2e | 30 + share/learn/editor/L19.2f | 26 + share/learn/editor/L19.3b | 32 + share/learn/editor/L2.1a | 14 + share/learn/editor/L2.2a | 12 + share/learn/editor/L20.01a | 42 + share/learn/editor/L20.01b | 47 + share/learn/editor/L20.01c | 525 + share/learn/editor/L20.1a | 41 + share/learn/editor/L20.2a | 30 + share/learn/editor/L20.2b | 39 + share/learn/editor/L20.2c | 58 + share/learn/editor/L21.1a | 17 + share/learn/editor/L21.1b | 27 + share/learn/editor/L21.1c | 87 + share/learn/editor/L21.1d | 446 + share/learn/editor/L21.1e | 33 + share/learn/editor/L3.1a | 25 + share/learn/editor/L3.1b | 36 + share/learn/editor/L3.1c | 28 + share/learn/editor/L30.1a | 27 + share/learn/editor/L30.1b | 27 + share/learn/editor/L30.2a | 29 + share/learn/editor/L30.2b | 17 + share/learn/editor/L30.2c | 33 + share/learn/editor/L30.2d | 18 + share/learn/editor/L30.2e | 24 + share/learn/editor/L30.2f | 22 + share/learn/editor/L30.2g | 24 + share/learn/editor/L30.2h | 27 + share/learn/editor/L31.1a | 37 + share/learn/editor/L31.2b | 25 + share/learn/editor/L31.2c | 32 + share/learn/editor/L32.1a | 29 + share/learn/editor/L32.1b | 18 + share/learn/editor/L32.1c | 16 + share/learn/editor/L32.2a | 31 + share/learn/editor/L32.2b | 14 + share/learn/editor/L32.2c | 14 + share/learn/editor/L32.2d | 11 + share/learn/editor/L32.2e | 12 + share/learn/editor/L32.2f | 11 + share/learn/editor/L32.2g | 26 + share/learn/editor/L33.1a | 20 + share/learn/editor/L33.1b | 24 + share/learn/editor/L33.2a | 28 + share/learn/editor/L33.2b | 26 + share/learn/editor/L33.2c | 19 + share/learn/editor/L34.1a | 17 + share/learn/editor/L34.1b | 19 + share/learn/editor/L34.2a | 15 + share/learn/editor/L34.2b | 11 + share/learn/editor/L34.2c | 9 + share/learn/editor/L34.2d | 10 + share/learn/editor/L34.2e | 21 + share/learn/editor/L34.2f | 14 + share/learn/editor/L35.1a | 38 + share/learn/editor/L35.2a | 30 + share/learn/editor/L35.2b | 22 + share/learn/editor/L35.2c | 22 + share/learn/editor/L35.2d | 25 + share/learn/editor/L35.2e | 33 + share/learn/editor/L36.1a | 33 + share/learn/editor/L36.2a | 21 + share/learn/editor/L36.2b | 18 + share/learn/editor/L36.2c | 47 + share/learn/editor/L36.2d | 21 + share/learn/editor/L37.1a | 27 + share/learn/editor/L37.2a | 30 + share/learn/editor/L37.2b | 20 + share/learn/editor/L37.2c | 27 + share/learn/editor/L37.2d | 22 + share/learn/editor/L37.2e | 39 + share/learn/editor/L37.2f | 23 + share/learn/editor/L38.1a | 29 + share/learn/editor/L38.2a | 25 + share/learn/editor/L38.2b | 20 + share/learn/editor/L39.1a | 28 + share/learn/editor/L4.1a | 23 + share/learn/editor/L4.1b | 12 + share/learn/editor/L4.2a | 17 + share/learn/editor/L4.2b | 11 + share/learn/editor/L40.1a | 29 + share/learn/editor/L40.1b | 29 + share/learn/editor/L40.2b | 27 + share/learn/editor/L40.2c | 22 + share/learn/editor/L40.2d | 23 + share/learn/editor/L41.1a | 41 + share/learn/editor/L41.1b | 19 + share/learn/editor/L42.1a | 28 + share/learn/editor/L42.2a | 23 + share/learn/editor/L42.2b | 18 + share/learn/editor/L42.2c | 31 + share/learn/editor/L43.1a | 29 + share/learn/editor/L43.2a | 31 + share/learn/editor/L43.2b | 15 + share/learn/editor/L43.2c | 23 + share/learn/editor/L43.2d | 19 + share/learn/editor/L44.1a | 43 + share/learn/editor/L44.1b | 35 + share/learn/editor/L44.1c | 49 + share/learn/editor/L44.1d | 54 + share/learn/editor/L44.1e | 26 + share/learn/editor/L44.1f | 32 + share/learn/editor/L44.1g | 121 + share/learn/editor/L44.1h | 29 + share/learn/editor/L44.1i | 19 + share/learn/editor/L45.1a | 33 + share/learn/editor/L45.1b | 33 + share/learn/editor/L5.1a | 29 + share/learn/editor/L50.1a | 36 + share/learn/editor/L50.1b | 32 + share/learn/editor/L50.1c | 54 + share/learn/editor/L50.2c | 24 + share/learn/editor/L50.2d | 33 + share/learn/editor/L50.2e | 28 + share/learn/editor/L50.2f | 343 + share/learn/editor/L50.2g | 52 + share/learn/editor/L51.1a | 25 + share/learn/editor/L51.2a | 84 + share/learn/editor/L51.2b | 21 + share/learn/editor/L51.2c | 93 + share/learn/editor/L52.1a | 71 + share/learn/editor/L52.1b | 60 + share/learn/editor/L52.2a | 61 + share/learn/editor/L52.2b | 65 + share/learn/editor/L52.2c | 56 + share/learn/editor/L53.1a | 21 + share/learn/editor/L53.2b | 416 + share/learn/editor/L54.1a | 40 + share/learn/editor/L54.1b | 43 + share/learn/editor/L55.1a | 34 + share/learn/editor/L56.1a | 37 + share/learn/editor/L57.1a | 45 + share/learn/editor/L6.1a | 36 + share/learn/editor/L6.2a | 37 + share/learn/editor/L6.2b | 25 + share/learn/editor/L60.1a | 56 + share/learn/editor/L60.1b | 78 + share/learn/editor/L60.2a | 60 + share/learn/editor/L60.2b | 109 + share/learn/editor/L60.2c | 57 + share/learn/editor/L60.2d | 52 + share/learn/editor/L61.1a | 26 + share/learn/editor/L62.1a | 67 + share/learn/editor/L62.2a | 59 + share/learn/editor/L62.2b | 32 + share/learn/editor/L62.2c | 49 + share/learn/editor/L63.1a | 43 + share/learn/editor/L63.1b | 13 + share/learn/editor/L63.1c | 13 + share/learn/editor/L63.1d | 12 + share/learn/editor/L63.1e | 13 + share/learn/editor/L64.1a | 34 + share/learn/editor/L64.1b | 14 + share/learn/editor/L65.1a | 34 + share/learn/editor/L66.1a | 102 + share/learn/editor/L7.1a | 36 + share/learn/editor/L7.1b | 42 + share/learn/editor/L7.2c | 29 + share/learn/editor/L70.1a | 49 + share/learn/editor/L70.2a | 30 + share/learn/editor/L70.2b | 84 + share/learn/editor/L70.2c | 84 + share/learn/editor/L70.2d | 92 + share/learn/editor/L70.2e | 95 + share/learn/editor/L70.2f | 90 + share/learn/editor/L70.2g | 36 + share/learn/editor/L71.1a | 108 + share/learn/editor/L72.1a | 48 + share/learn/editor/L72.2a | 33 + share/learn/editor/L72.2b | 54 + share/learn/editor/L72.2c | 42 + share/learn/editor/L72.2d | 27 + share/learn/editor/L73.1a | 31 + share/learn/editor/L74.1a | 80 + share/learn/editor/L8.1a | 38 + share/learn/editor/L8.1b | 18 + share/learn/editor/L8.2a | 44 + share/learn/editor/L8.2b | 26 + share/learn/editor/L8.2c | 36 + share/learn/editor/L9.1a | 34 + share/learn/editor/L9.2a | 36 + share/learn/editor/L9.2b | 34 + share/learn/editor/L9.2d | 36 + share/learn/editor/L9.2e | 21 + share/learn/editor/L9.3c | 44 + share/learn/eqn/Init | 21 + share/learn/eqn/L0 | 2 + share/learn/eqn/L0.1a | 49 + share/learn/eqn/L1.1a | 35 + share/learn/eqn/L1.1b | 51 + share/learn/eqn/L1.1c | 39 + share/learn/eqn/L1.1d | 34 + share/learn/eqn/L1.1e | 30 + share/learn/eqn/L1.1f | 87 + share/learn/eqn/L10.1a | 77 + share/learn/eqn/L10.1b | 42 + share/learn/eqn/L10.1c | 25 + share/learn/eqn/L10.2c | 17 + share/learn/eqn/L11.1a | 46 + share/learn/eqn/L11.1b | 34 + share/learn/eqn/L11.1c | 31 + share/learn/eqn/L11.1d | 18 + share/learn/eqn/L11.1e | 26 + share/learn/eqn/L11.1f | 48 + share/learn/eqn/L11.1g | 32 + share/learn/eqn/L12.1a | 53 + share/learn/eqn/L12.1b | 29 + share/learn/eqn/L12.1c | 44 + share/learn/eqn/L12.1d | 21 + share/learn/eqn/L12.1e | 43 + share/learn/eqn/L2.1a | 38 + share/learn/eqn/L2.1b | 50 + share/learn/eqn/L2.1c | 57 + share/learn/eqn/L2.1d | 57 + share/learn/eqn/L2.1e | 34 + share/learn/eqn/L2.1f | 46 + share/learn/eqn/L2.2a | 25 + share/learn/eqn/L2.2b | 38 + share/learn/eqn/L2.2e | 37 + share/learn/eqn/L3.1a | 53 + share/learn/eqn/L3.1b | 41 + share/learn/eqn/L3.1c | 40 + share/learn/eqn/L3.1d | 49 + share/learn/eqn/L3.1e | 41 + share/learn/eqn/L3.2a | 14 + share/learn/eqn/L3.2c | 25 + share/learn/eqn/L3.2d | 17 + share/learn/eqn/L4.1a | 42 + share/learn/eqn/L4.1b | 33 + share/learn/eqn/L4.1c | 20 + share/learn/eqn/L4.1d | 41 + share/learn/eqn/L4.2a | 28 + share/learn/eqn/L4.2c | 19 + share/learn/eqn/L5.1a | 45 + share/learn/eqn/L5.1b | 47 + share/learn/eqn/L5.1c | 40 + share/learn/eqn/L5.1d | 57 + share/learn/eqn/L5.1e | 40 + share/learn/eqn/L5.1f | 11 + share/learn/eqn/L5.1g | 17 + share/learn/eqn/L5.1h | 48 + share/learn/eqn/L5.2b | 32 + share/learn/eqn/L5.2d | 31 + share/learn/eqn/L5.2g | 13 + share/learn/eqn/L6.1a | 60 + share/learn/eqn/L6.1b | 37 + share/learn/eqn/L6.1c | 27 + share/learn/eqn/L6.1d | 18 + share/learn/eqn/L7.1a | 49 + share/learn/eqn/L7.1b | 50 + share/learn/eqn/L7.1c | 35 + share/learn/eqn/L7.1d | 38 + share/learn/eqn/L7.2b | 17 + share/learn/eqn/L7.2c | 30 + share/learn/eqn/L8.1a | 49 + share/learn/eqn/L8.1b | 34 + share/learn/eqn/L8.2b | 17 + share/learn/eqn/L9.1a | 66 + share/learn/eqn/L9.1b | 48 + share/learn/eqn/L9.2a | 31 + share/learn/eqn/L9.2b | 20 + share/learn/eqn/L9.3b | 13 + share/learn/eqn/tinyms | 24 + share/learn/files/L0 | 2 + share/learn/files/L0.01a | 29 + share/learn/files/L0.1a | 37 + share/learn/files/L0.1b | 28 + share/learn/files/L0.1c | 27 + share/learn/files/L0.1d | 30 + share/learn/files/L1.1a | 12 + share/learn/files/L1.2a | 15 + share/learn/files/L1.2b | 25 + share/learn/files/L10.1a | 21 + share/learn/files/L10.2a | 15 + share/learn/files/L10.2b | 18 + share/learn/files/L10.3a | 15 + share/learn/files/L10.3b | 12 + share/learn/files/L10.3c | 15 + share/learn/files/L10.3d | 23 + share/learn/files/L11.1a | 42 + share/learn/files/L11.2a | 16 + share/learn/files/L11.2b | 26 + share/learn/files/L11.3a | 17 + share/learn/files/L11.3b | 13 + share/learn/files/L11.3c | 22 + share/learn/files/L12.1a | 42 + share/learn/files/L12.2a | 25 + share/learn/files/L12.2b | 27 + share/learn/files/L12.2c | 29 + share/learn/files/L12.3a | 21 + share/learn/files/L12.3b | 18 + share/learn/files/L12.3c | 22 + share/learn/files/L13.01a | 123 + share/learn/files/L13.1a | 14 + share/learn/files/L13.1b | 19 + share/learn/files/L13.1c | 24 + share/learn/files/L13.1d | 17 + share/learn/files/L13.1e | 16 + share/learn/files/L13.1f | 23 + share/learn/files/L13.1g | 20 + share/learn/files/L2.1a | 21 + share/learn/files/L2.2a | 17 + share/learn/files/L2.2b | 25 + share/learn/files/L3.1a | 34 + share/learn/files/L3.2a | 23 + share/learn/files/L3.2b | 32 + share/learn/files/L3.3a | 18 + share/learn/files/L3.3b | 23 + share/learn/files/L4.1a | 17 + share/learn/files/L4.2a | 19 + share/learn/files/L4.2b | 21 + share/learn/files/L4.3a | 20 + share/learn/files/L4.3b | 20 + share/learn/files/L4.3c | 16 + share/learn/files/L5.1a | 34 + share/learn/files/L5.1b | 20 + share/learn/files/L5.1c | 26 + share/learn/files/L5.1d | 14 + share/learn/files/L5.1e | 29 + share/learn/files/L6.1a | 33 + share/learn/files/L6.1b | 14 + share/learn/files/L6.1c | 13 + share/learn/files/L6.1d | 16 + share/learn/files/L6.1e | 19 + share/learn/files/L6.2a | 34 + share/learn/files/L6.2b | 22 + share/learn/files/L7.1a | 38 + share/learn/files/L7.2a | 30 + share/learn/files/L7.2b | 32 + share/learn/files/L7.3a | 28 + share/learn/files/L7.3b | 17 + share/learn/files/L7.3c | 23 + share/learn/files/L8.1a | 25 + share/learn/files/L8.2a | 16 + share/learn/files/L8.2b | 23 + share/learn/files/L8.2c | 27 + share/learn/files/L9.1a | 36 + share/learn/files/L9.2a | 30 + share/learn/files/L9.2b | 22 + share/learn/files/L9.2c | 26 + share/learn/macros/L0 | 2 + share/learn/macros/L1.1a | 23 + share/learn/macros/L10.1a | 54 + share/learn/macros/L11.1a | 96 + share/learn/macros/L12.1a | 98 + share/learn/macros/L13.1a | 103 + share/learn/macros/L14.1a | 104 + share/learn/macros/L15.1a | 306 + share/learn/macros/L2.1a | 25 + share/learn/macros/L3.1a | 70 + share/learn/macros/L4.1a | 65 + share/learn/macros/L5.1a | 69 + share/learn/macros/L6.1a | 74 + share/learn/macros/L7.1a | 80 + share/learn/macros/L8.1a | 82 + share/learn/macros/L9.1a | 83 + share/learn/morefiles/L0 | 2 + share/learn/morefiles/L0.1a | 22 + share/learn/morefiles/L0.1b | 43 + share/learn/morefiles/L0.1c | 17 + share/learn/morefiles/L0.1d | 14 + share/learn/morefiles/L0.1e | 23 + share/learn/morefiles/L0.1f | 13 + share/learn/morefiles/L0.1g | 10 + share/learn/morefiles/L1.1a | 243 + share/learn/morefiles/L1.1b | 242 + share/learn/morefiles/L1.1c | 18 + share/learn/morefiles/L1.1d | 80 + share/learn/morefiles/L2.1a | 32 + share/learn/morefiles/L2.1b | 18 + share/learn/morefiles/L2.1c | 17 + share/learn/morefiles/L2.1d | 10 + share/learn/morefiles/L2.1e | 25 + share/learn/morefiles/L2.1f | 17 + share/learn/morefiles/L3.1a | 36 + share/learn/morefiles/L3.1b | 37 + share/learn/morefiles/L3.1c | 42 + share/learn/morefiles/L3.1d | 134 + share/learn/morefiles/L3.1e | 116 + share/learn/morefiles/L3.1f | 16 + share/learn/morefiles/L3.1g | 167 + share/learn/morefiles/L4.1a | 25 + share/learn/morefiles/L4.1b | 38 + share/learn/morefiles/L4.1c | 42 + share/learn/morefiles/L4.1d | 130 + share/learn/morefiles/L4.1e | 34 + share/learn/morefiles/L4.1f | 48 + share/learn/morefiles/L4.1g | 49 + share/learn/morefiles/L4.2a | 13 + share/learn/morefiles/L5.1a | 23 + share/learn/morefiles/L5.1b | 22 + share/learn/morefiles/L5.1c | 40 + share/learn/morefiles/L5.1d | 32 + share/learn/morefiles/L5.1e | 19 + share/learn/morefiles/L6.1a | 35 + share/learn/morefiles/L6.1b | 128 + share/learn/morefiles/L6.1c | 23 + share/learn/morefiles/L6.1d | 56 + share/learn/morefiles/L6.1e | 38 + share/learn/morefiles/L6.2e | 106 + share/learn/morefiles/L7.1a | 9 + share/learn/vi/Init | 26 + share/learn/vi/L0 | 2 + share/learn/vi/L1.1a | 23 + share/learn/vi/L1.1b | 50 + share/learn/vi/L1.2 | 48 + share/learn/vi/L2.1 | 42 + share/learn/vi/L2.2 | 48 + share/learn/vi/L2.3 | 43 + share/learn/vi/L2.4 | 42 + share/learn/vi/L3.1 | 71 + share/learn/vi/L3.2 | 63 + share/learn/vi/L3.3 | 38 + share/learn/vi/L3.4 | 222 + share/learn/vi/L4.0 | 18 + share/learn/vi/L4.1 | 44 + share/learn/vi/L4.2 | 39 + share/learn/vi/L4.3 | 42 + share/learn/vi/L5.1 | 58 + share/learn/vi/L5.2 | 35 + share/learn/vi/L5.3 | 38 + share/learn/vi/L5.4 | 244 + share/learn/vi/L6.1 | 46 + share/learn/vi/L6.2 | 106 + share/learn/vi/L6.3 | 38 + share/learn/vi/L6.4 | 15 + share/learn/vi/longtext | 120 + share/lint/Makefile | 36 + share/lint/llib-lc | 465 + share/lint/llib-lcurses | 146 + share/lint/llib-ldbm | 12 + share/lint/llib-lm | 42 + share/lint/llib-lmp | 39 + share/lint/llib-lplot | 16 + share/lint/llib-ltermcap | 16 + share/lint/llib-port | 47 + share/me/Makefile | 45 + share/me/acm.me | 55 + share/me/chars.me | 61 + share/me/deltext.me | 20 + share/me/eqn.me | 78 + share/me/float.me | 67 + share/me/footnote.me | 85 + share/me/index.me | 76 + share/me/letterhead.me | 53 + share/me/local.me | 10 + share/me/null.me | 6 + share/me/refer.me | 96 + share/me/revisions | 230 + share/me/sh.me | 109 + share/me/summary.extern | 238 + share/me/tbl.me | 110 + share/me/test.accent | 7 + share/me/test.umlaut | 39 + share/me/thesis.me | 19 + share/me/tmac.e | 1155 + share/misc/Mail.help | 23 + share/misc/Mail.tildehelp | 19 + share/misc/Makefile | 19 + share/misc/eign | 150 + share/misc/gprof.callg | 108 + share/misc/gprof.flat | 32 + share/misc/lib.b | 194 + share/misc/mkproto.data | 42 + share/misc/units | 514 + share/misc/vlpmacs | 81 + share/ms/Makefile | 19 + share/ms/README | 56 + share/ms/end.awk | 21 + share/ms/endnote | 18 + share/ms/s.acc | 79 + share/ms/s.cov | 256 + share/ms/s.eqn | 57 + share/ms/s.ref | 155 + share/ms/s.tbl | 82 + share/ms/s.ths | 23 + share/ms/s.toc | 104 + share/termcap/Makefile | 32 + share/termcap/README | 42 + share/termcap/map3270 | 539 + share/termcap/reorder | 40 + share/termcap/tabset/3101 | 1 + share/termcap/tabset/aa | 1 + share/termcap/tabset/aed512 | 1 + share/termcap/tabset/beehive | 2 + share/termcap/tabset/diablo | 3 + share/termcap/tabset/dtc382 | 1 + share/termcap/tabset/ibm3101 | 1 + share/termcap/tabset/std | 1 + share/termcap/tabset/stdcrt | 1 + share/termcap/tabset/tandem653 | 1 + share/termcap/tabset/teleray | 1 + share/termcap/tabset/vt100 | 3 + share/termcap/tabset/wyse-adds | 3 + share/termcap/tabset/xerox1720 | 1 + share/termcap/tabset/xerox1730 | Bin 0 -> 222 bytes share/termcap/tabset/xerox1730-lm | Bin 0 -> 224 bytes share/termcap/tabset/zenith29 | 1 + share/termcap/termcap.local | 3 + share/termcap/termcap.src | 2971 ++ share/tmac/Makefile | 23 + share/tmac/tmac.a | 291 + share/tmac/tmac.an | 17 + share/tmac/tmac.an.new | 341 + share/tmac/tmac.an6n | 85 + share/tmac/tmac.an6t | 112 + share/tmac/tmac.ayday | 93 + share/tmac/tmac.cp | 134 + share/tmac/tmac.imagen | 1 + share/tmac/tmac.os | 1566 + share/tmac/tmac.r | 112 + share/tmac/tmac.s | 941 + share/tmac/tmac.scover | 323 + share/tmac/tmac.sdisp | 60 + share/tmac/tmac.skeep | 80 + share/tmac/tmac.srefs | 137 + share/tmac/tmac.vcat | 5 + share/zoneinfo/Makefile | 68 + share/zoneinfo/README | 41 + share/zoneinfo/Theory | 130 + share/zoneinfo/asia | 5 + share/zoneinfo/australasia | 59 + share/zoneinfo/etcetera | 40 + share/zoneinfo/europe | 125 + share/zoneinfo/ialloc.c | 88 + share/zoneinfo/northamerica | 96 + share/zoneinfo/pacificnew | 13 + share/zoneinfo/scheck.c | 59 + share/zoneinfo/solar87 | 386 + share/zoneinfo/systemv | 35 + share/zoneinfo/zdump.8 | 42 + share/zoneinfo/zdump.c | 209 + share/zoneinfo/zic.8 | 294 + share/zoneinfo/zic.c | 1543 + sys/CURLY/Make.net | 69 + sys/CURLY/Make.pdp | 63 + sys/CURLY/Make.pdpmba | 31 + sys/CURLY/Make.pdpnet | 48 + sys/CURLY/Make.pdpuba | 35 + sys/CURLY/Make.sys | 66 + sys/CURLY/Makefile | 200 + sys/CURLY/NETSPLFIX | 53 + sys/CURLY/SPLFIX | 59 + sys/CURLY/acc.h | 1 + sys/CURLY/boot.s | 171 + sys/CURLY/br.h | 1 + sys/CURLY/cn.h | 1 + sys/CURLY/css.h | 1 + sys/CURLY/de.h | 1 + sys/CURLY/dh.h | 2 + sys/CURLY/dhu.h | 1 + sys/CURLY/dhv.h | 1 + sys/CURLY/dmc.h | 1 + sys/CURLY/dn.h | 1 + sys/CURLY/dr.h | 1 + sys/CURLY/dz.h | 1 + sys/CURLY/ec.h | 1 + sys/CURLY/en.h | 1 + sys/CURLY/ether.h | 1 + sys/CURLY/hk.h | 1 + sys/CURLY/ht.h | 1 + sys/CURLY/hy.h | 1 + sys/CURLY/il.h | 1 + sys/CURLY/imp.h | 1 + sys/CURLY/ingres.h | 1 + sys/CURLY/ioconf.c | 19 + sys/CURLY/localopts.h | 9 + sys/CURLY/loop.h | 1 + sys/CURLY/lp.h | 2 + sys/CURLY/param.c | 147 + sys/CURLY/pty.h | 1 + sys/CURLY/qe.h | 1 + sys/CURLY/qt.h | 1 + sys/CURLY/ra.h | 3 + sys/CURLY/ram.h | 1 + sys/CURLY/rk.h | 1 + sys/CURLY/rl.h | 1 + sys/CURLY/rx.h | 1 + sys/CURLY/si.h | 1 + sys/CURLY/sl.h | 1 + sys/CURLY/sri.h | 1 + sys/CURLY/tb.h | 1 + sys/CURLY/tm.h | 2 + sys/CURLY/tms.h | 2 + sys/CURLY/ts.h | 1 + sys/CURLY/vers.c | 1 + sys/CURLY/version | 1 + sys/CURLY/vv.h | 1 + sys/CURLY/xp.h | 2 + sys/GENERIC/Make.pdp | 63 + sys/GENERIC/Make.pdpmba | 31 + sys/GENERIC/Make.pdpuba | 35 + sys/GENERIC/Make.sys | 66 + sys/GENERIC/Makefile | 144 + sys/GENERIC/SPLFIX | 53 + sys/GENERIC/acc.h | 1 + sys/GENERIC/boot.s | 13 + sys/GENERIC/br.h | 1 + sys/GENERIC/cn.h | 1 + sys/GENERIC/css.h | 1 + sys/GENERIC/de.h | 1 + sys/GENERIC/dh.h | 2 + sys/GENERIC/dhu.h | 1 + sys/GENERIC/dhv.h | 1 + sys/GENERIC/dmc.h | 1 + sys/GENERIC/dn.h | 1 + sys/GENERIC/dr.h | 1 + sys/GENERIC/dz.h | 1 + sys/GENERIC/ec.h | 1 + sys/GENERIC/en.h | 1 + sys/GENERIC/ether.h | 1 + sys/GENERIC/hk.h | 1 + sys/GENERIC/ht.h | 1 + sys/GENERIC/hy.h | 1 + sys/GENERIC/il.h | 1 + sys/GENERIC/imp.h | 1 + sys/GENERIC/ingres.h | 1 + sys/GENERIC/ioconf.c | 19 + sys/GENERIC/localopts.h | 9 + sys/GENERIC/loop.h | 1 + sys/GENERIC/lp.h | 2 + sys/GENERIC/param.c | 147 + sys/GENERIC/pty.h | 1 + sys/GENERIC/qe.h | 1 + sys/GENERIC/qt.h | 1 + sys/GENERIC/ra.h | 2 + sys/GENERIC/ram.h | 1 + sys/GENERIC/rk.h | 1 + sys/GENERIC/rl.h | 1 + sys/GENERIC/rx.h | 1 + sys/GENERIC/si.h | 1 + sys/GENERIC/sl.h | 1 + sys/GENERIC/sri.h | 1 + sys/GENERIC/tb.h | 1 + sys/GENERIC/tm.h | 2 + sys/GENERIC/tms.h | 2 + sys/GENERIC/ts.h | 1 + sys/GENERIC/vers.c | 1 + sys/GENERIC/version | 1 + sys/GENERIC/vv.h | 1 + sys/GENERIC/xp.h | 2 + sys/OTHERS/EXOS.204/if_ex.c.diffs | 645 + sys/OTHERS/GLUE/c.c | 90 + sys/OTHERS/GLUE/l.s | 54 + sys/OTHERS/GLUE/uprobe.c | 7 + sys/OTHERS/PRO/PRO | 120 + sys/OTHERS/PRO/PRO.diff | 672 + sys/OTHERS/README | 394 + sys/OTHERS/acucntrl | 36 + sys/OTHERS/bad144/bad144.c | 610 + sys/OTHERS/bad144/conf.c.diff | 46 + sys/OTHERS/bad144/dkio.h | 18 + sys/OTHERS/bad144/xp.c | 1081 + sys/OTHERS/berknet/README | 14 + sys/OTHERS/berknet/berknet_driver | 800 + sys/OTHERS/berknet/bk.c | 189 + sys/OTHERS/berknet/bkmac.h | 24 + sys/OTHERS/berknet/bkmac.h.43 | 28 + sys/OTHERS/berknet/for_tty_conf.c | 15 + sys/OTHERS/berknet/tty_bk.c | 171 + sys/OTHERS/cat/cat.c | 76 + sys/OTHERS/cr11/cr.c | 204 + sys/OTHERS/cr11/crreg.h | 25 + sys/OTHERS/dc11/dc.c | 235 + sys/OTHERS/dc11/dcreg.h | 49 + sys/OTHERS/de11/de.c | 298 + sys/OTHERS/de11/de_locore | 28 + sys/OTHERS/de11/dereg.h | 56 + sys/OTHERS/dig_anal/ds.4l | 277 + sys/OTHERS/dig_anal/ds.c | 1530 + sys/OTHERS/dig_anal/dsc.h | 206 + sys/OTHERS/dig_anal/dsreg.h | 78 + sys/OTHERS/dj11/dj.c | 172 + sys/OTHERS/dj11/djreg.h | 40 + sys/OTHERS/dm11/dhdm.c | 133 + sys/OTHERS/dm11/dhfdm.c | 25 + sys/OTHERS/dmc11/dmc.c | 476 + sys/OTHERS/dsd480/rx3.c | 672 + sys/OTHERS/du11/du.c | 531 + sys/OTHERS/du11/dureg.h | 113 + sys/OTHERS/dv/dv.c | 384 + sys/OTHERS/dvhp/dvhp.c | 481 + sys/OTHERS/dvhp/dvhp_stand.c | 145 + sys/OTHERS/emulex-cs02/cs02-q22-fixes | 166 + sys/OTHERS/fast_timer/ft.c | 201 + sys/OTHERS/fuji_160/README | 16 + sys/OTHERS/fuji_160/dev/xp.c | 758 + sys/OTHERS/fuji_160/include/hpreg.h | 329 + sys/OTHERS/fuji_160/ioconf.c | 195 + sys/OTHERS/fuji_160/libsa/xp.c | 207 + sys/OTHERS/fuji_160/xp.h | 5 + sys/OTHERS/ht/ht.c | 503 + sys/OTHERS/ht/ht_fix | 56 + sys/OTHERS/interleave/dkleave.c | 37 + sys/OTHERS/interleave/param.h | 4 + sys/OTHERS/kl/README | 17 + sys/OTHERS/kl/kl.c | 545 + sys/OTHERS/kl/kl.h | 12 + sys/OTHERS/kl/klreg.h | 52 + sys/OTHERS/ml11/ml.c | 209 + sys/OTHERS/ml11/mlreg.h | 58 + sys/OTHERS/multiplexor/mx1.c | 230 + sys/OTHERS/multiplexor/mx2.c | 930 + sys/OTHERS/nap/nap.c | 46 + sys/OTHERS/packet_driver/pack.h | Bin 0 -> 2228 bytes sys/OTHERS/packet_driver/pack.h_#2 | 129 + sys/OTHERS/packet_driver/pk.h | 154 + sys/OTHERS/packet_driver/pk0.c | 688 + sys/OTHERS/packet_driver/pk1.c | 270 + sys/OTHERS/packet_driver/pk2.c | 270 + sys/OTHERS/packet_driver/pk3.c | 171 + sys/OTHERS/pdpstand/tm-ts-pred | 82 + sys/OTHERS/ra/mdec.rauboot.s | 366 + sys/OTHERS/ra/stand.ra.c | 170 + sys/OTHERS/rc/rc.c | 86 + sys/OTHERS/rc/rcreg.h | 6 + sys/OTHERS/rf11/rf.c | 127 + sys/OTHERS/rf11/rfreg.h | 64 + sys/OTHERS/rm02.03.05/rm.c | 733 + sys/OTHERS/rm02.03.05/rm_GENERIC | 4 + sys/OTHERS/rm02.03.05/rm_autoconfig | 1 + sys/OTHERS/rm02.03.05/rm_conf.c | 24 + sys/OTHERS/rm02.03.05/rm_config | 9 + sys/OTHERS/rm02.03.05/rm_scb.s | 10 + sys/OTHERS/rm02.03.05/rm_stand.c | 132 + sys/OTHERS/rp03/rp.c | 205 + sys/OTHERS/rp03/rp.pdpstand.c | 51 + sys/OTHERS/rp03/rp03.b | 20 + sys/OTHERS/rp03/rpreg.h | 102 + sys/OTHERS/rp03/rpuboot.s | 305 + sys/OTHERS/rp04.06/hp.c | 711 + sys/OTHERS/rp04.06/hp_GENERIC | 4 + sys/OTHERS/rp04.06/hp_autoconfig | 1 + sys/OTHERS/rp04.06/hp_conf.c | 21 + sys/OTHERS/rp04.06/hp_config | 6 + sys/OTHERS/rp04.06/hp_scb.s | 8 + sys/OTHERS/rp04.06/hpauto.c | 2 + sys/OTHERS/rp04.06/hpreg.h | 329 + sys/OTHERS/rs03.04/hs.c | 159 + sys/OTHERS/rs03.04/hsreg.h | 94 + sys/OTHERS/rx01/README | 13 + sys/OTHERS/rx01/rx.c | 351 + sys/OTHERS/rx01/rx.h | 1 + sys/OTHERS/rx01/rxreg.h | 34 + sys/OTHERS/rx02/#1/rx2.c | 334 + sys/OTHERS/rx02/#1/rx2reg.h | 91 + sys/OTHERS/rx11/rx.c | 639 + sys/OTHERS/scsi/scsi.c | 334 + sys/OTHERS/scsi/scsi_locore | 47 + sys/OTHERS/scsi/scsireg.h | 92 + sys/OTHERS/scsi2/README | 21 + sys/OTHERS/scsi2/xe.c | 477 + sys/OTHERS/scsi2/xereg.h | 131 + sys/OTHERS/scsi2/xestand.c | 175 + sys/OTHERS/scsi2/xeuboot.s | 363 + sys/OTHERS/tags | 1 + sys/OTHERS/tektronix/tektronix | 205 + sys/OTHERS/tk/4.3BSD/tmscp.h | 322 + sys/OTHERS/tk/bin/tk.c | 256 + sys/OTHERS/tk/pdpstand/tk.c | 366 + sys/OTHERS/tk/pdpstand/tk_saio.h | 27 + sys/OTHERS/tk/pdpstand/tkboot.s | 207 + sys/OTHERS/tk/pdpuba/tk.c | 1287 + sys/OTHERS/ts/ts.c | 287 + sys/OTHERS/ts/ts.c_Q22 | 655 + sys/OTHERS/ung_bass_dr11w/if_un.c | 509 + sys/OTHERS/versatec/h.vcmd.h | 22 + sys/OTHERS/versatec/pdpuba.vcmd.h | 15 + sys/OTHERS/versatec/vp.c | 337 + sys/OTHERS/versatec/vp_GENERIC | 4 + sys/OTHERS/versatec/vp_autoconfig | 2 + sys/OTHERS/versatec/vp_conf.c | 14 + sys/OTHERS/versatec/vp_config | 5 + sys/OTHERS/versatec/vp_scb.s | 15 + sys/OTHERS/versatec/vpauto.c | 38 + sys/OTHERS/versatec/vpreg.h | 32 + sys/QT/Make.net | 69 + sys/QT/Make.pdp | 63 + sys/QT/Make.pdpmba | 31 + sys/QT/Make.pdpnet | 48 + sys/QT/Make.pdpuba | 35 + sys/QT/Make.sys | 66 + sys/QT/Makefile | 200 + sys/QT/NETSPLFIX | 53 + sys/QT/SPLFIX | 59 + sys/QT/acc.h | 1 + sys/QT/boot.s | 171 + sys/QT/br.h | 1 + sys/QT/cn.h | 1 + sys/QT/css.h | 1 + sys/QT/de.h | 1 + sys/QT/dh.h | 2 + sys/QT/dhu.h | 1 + sys/QT/dhv.h | 1 + sys/QT/dmc.h | 1 + sys/QT/dn.h | 1 + sys/QT/dr.h | 1 + sys/QT/dz.h | 1 + sys/QT/ec.h | 1 + sys/QT/en.h | 1 + sys/QT/ether.h | 1 + sys/QT/hk.h | 1 + sys/QT/ht.h | 1 + sys/QT/hy.h | 1 + sys/QT/il.h | 1 + sys/QT/imp.h | 1 + sys/QT/ingres.h | 1 + sys/QT/ioconf.c | 19 + sys/QT/localopts.h | 9 + sys/QT/loop.h | 1 + sys/QT/lp.h | 2 + sys/QT/param.c | 147 + sys/QT/pty.h | 1 + sys/QT/qe.h | 1 + sys/QT/qt.h | 1 + sys/QT/ra.h | 3 + sys/QT/ram.h | 1 + sys/QT/rk.h | 1 + sys/QT/rl.h | 1 + sys/QT/rx.h | 1 + sys/QT/si.h | 1 + sys/QT/sl.h | 1 + sys/QT/sri.h | 1 + sys/QT/tb.h | 1 + sys/QT/tm.h | 1 + sys/QT/tms.h | 2 + sys/QT/ts.h | 1 + sys/QT/vers.c | 1 + sys/QT/version | 1 + sys/QT/vv.h | 1 + sys/QT/xp.h | 2 + sys/autoconfig/Makefile | 51 + sys/autoconfig/attach.c | 169 + sys/autoconfig/brauto.c | 20 + sys/autoconfig/cnauto.c | 25 + sys/autoconfig/dhauto.c | 41 + sys/autoconfig/dhuauto.c | 22 + sys/autoconfig/dhvauto.c | 26 + sys/autoconfig/dnauto.c | 14 + sys/autoconfig/do_config.c | 350 + sys/autoconfig/drauto.c | 22 + sys/autoconfig/dtab.h | 39 + sys/autoconfig/dzauto.c | 25 + sys/autoconfig/hkauto.c | 23 + sys/autoconfig/htauto.c | 35 + sys/autoconfig/ivec.h | 20 + sys/autoconfig/lpauto.c | 31 + sys/autoconfig/main.c | 84 + sys/autoconfig/raauto.c | 27 + sys/autoconfig/read_dtab.c | 123 + sys/autoconfig/read_nlist.c | 142 + sys/autoconfig/rkauto.c | 23 + sys/autoconfig/rlauto.c | 24 + sys/autoconfig/rxauto.c | 28 + sys/autoconfig/siauto.c | 24 + sys/autoconfig/tags | 42 + sys/autoconfig/tmauto.c | 24 + sys/autoconfig/tmsauto.c | 29 + sys/autoconfig/tsauto.c | 36 + sys/autoconfig/uprobe.c | 53 + sys/autoconfig/uprobe.h | 12 + sys/autoconfig/xpauto.c | 29 + sys/bootrom/siboot.s | 60 + sys/bootrom/tags | 1 + sys/conf/:comm-to-bss | 5 + sys/conf/CURLY | 260 + sys/conf/GENERIC | 262 + sys/conf/Make.net | 69 + sys/conf/Make.nsunix | 198 + sys/conf/Make.pdp | 63 + sys/conf/Make.pdpmba | 31 + sys/conf/Make.pdpnet | 48 + sys/conf/Make.pdpuba | 35 + sys/conf/Make.sunix | 143 + sys/conf/Make.sys | 66 + sys/conf/Make.unix | 146 + sys/conf/NONET | 260 + sys/conf/QT | 260 + sys/conf/README | 60 + sys/conf/boot/Makefile | 14 + sys/conf/boot/NONEboot.s | 13 + sys/conf/boot/brboot.s | 72 + sys/conf/boot/dvhpboot.s | 80 + sys/conf/boot/hk6boot.s | 86 + sys/conf/boot/hk7boot.s | 86 + sys/conf/boot/raboot.s | 171 + sys/conf/boot/rlboot.s | 95 + sys/conf/boot/rmboot.s | 84 + sys/conf/boot/sc11boot.s | 65 + sys/conf/boot/sc21boot.s | 68 + sys/conf/boot/siboot.s | 92 + sys/conf/checksys.c | 278 + sys/conf/config | 278 + sys/conf/ioconf.c | 19 + sys/conf/netbind.c | 313 + sys/conf/newvers.sh | 21 + sys/conf/param.c | 147 + sys/conf/spl/splfix.mfps.sed | 59 + sys/conf/spl/splfix.movb+mfps.sed | 53 + sys/conf/spl/splfix.movb.sed | 53 + sys/conf/spl/splfix.profil.sed | 49 + sys/conf/spl/splfix.spl.sed | 49 + sys/conf/spl_3com/splfix.mfps.sed | 59 + sys/conf/spl_3com/splfix.movb+mfps.sed | 53 + sys/conf/spl_3com/splfix.movb.sed | 53 + sys/conf/spl_3com/splfix.profil.sed | 49 + sys/conf/spl_3com/splfix.spl.sed | 49 + sys/h/acct.h | 52 + sys/h/buf.h | 162 + sys/h/callout.h | 34 + sys/h/clist.h | 28 + sys/h/conf.h | 69 + sys/h/dir.h | 107 + sys/h/disk.h | 118 + sys/h/disklabel.h | 294 + sys/h/dk.h | 36 + sys/h/dkbad.h | 57 + sys/h/domain.h | 30 + sys/h/errno.h | 121 + sys/h/exec.h | 46 + sys/h/file.h | 76 + sys/h/fs.h | 135 + sys/h/gprof.h | 87 + sys/h/ingreslock.h | 101 + sys/h/inode.h | 317 + sys/h/ioctl.h | 267 + sys/h/ioctl_compat.h | 45 + sys/h/kernel.h | 36 + sys/h/localopts.h | 9 + sys/h/map.h | 42 + sys/h/mbuf.h | 194 + sys/h/mount.h | 105 + sys/h/msgbuf.h | 22 + sys/h/mtio.h | 80 + sys/h/namei.h | 90 + sys/h/param.h | 132 + sys/h/proc.h | 134 + sys/h/protosw.h | 187 + sys/h/ptrace.h | 23 + sys/h/quota.h | 173 + sys/h/reboot.h | 29 + sys/h/resource.h | 91 + sys/h/select.h | 68 + sys/h/signal.h | 148 + sys/h/signalvar.h | 123 + sys/h/socket.h | 187 + sys/h/socketvar.h | 156 + sys/h/stat.h | 102 + sys/h/stddef.h | 43 + sys/h/sysctl.h | 355 + sys/h/syslog.h | 167 + sys/h/systm.h | 102 + sys/h/tablet.h | 67 + sys/h/tags | 1 + sys/h/text.h | 64 + sys/h/time.h | 87 + sys/h/timeb.h | 18 + sys/h/times.h | 17 + sys/h/trace.h | 87 + sys/h/tty.h | 134 + sys/h/ttychars.h | 52 + sys/h/ttydefaults.h | 58 + sys/h/ttydev.h | 51 + sys/h/types.h | 64 + sys/h/uba.h | 77 + sys/h/uio.h | 69 + sys/h/un.h | 25 + sys/h/unpcb.h | 52 + sys/h/user.h | 154 + sys/h/utsname.h | 50 + sys/h/vcmd.h | 22 + sys/h/vm.h | 24 + sys/h/vmmac.h | 11 + sys/h/vmmeter.h | 72 + sys/h/vmparam.h | 35 + sys/h/vmsystm.h | 35 + sys/h/wait.h | 73 + sys/machine | 1 + sys/mdec/Makefile | 41 + sys/mdec/boilerplate | 59 + sys/mdec/bruboot.s | 271 + sys/mdec/dvhpuboot.s | 257 + sys/mdec/hkuboot.s | 270 + sys/mdec/hpuboot.s | 259 + sys/mdec/rauboot.s | 317 + sys/mdec/rkuboot.s | 248 + sys/mdec/rluboot.s | 303 + sys/mdec/rm03uboot.s | 265 + sys/mdec/rm05uboot.s | 265 + sys/mdec/rx01uboot.s | 299 + sys/mdec/rx02uboot.s | 299 + sys/mdec/si51uboot.s | 259 + sys/mdec/si94uboot.s | 259 + sys/mdec/si95uboot.s | 277 + sys/net/af.c | 78 + sys/net/af.h | 41 + sys/net/if.c | 363 + sys/net/if.h | 224 + sys/net/if_arp.h | 57 + sys/net/if_loop.c | 155 + sys/net/if_sl.c | 561 + sys/net/netisr.h | 46 + sys/net/raw_cb.c | 150 + sys/net/raw_cb.h | 61 + sys/net/raw_usrreq.c | 315 + sys/net/route.c | 342 + sys/net/route.h | 87 + sys/net/tags | 1 + sys/netimp/if_imp.c | 769 + sys/netimp/if_imp.h | 160 + sys/netimp/if_imphost.c | 227 + sys/netimp/if_imphost.h | 89 + sys/netimp/raw_imp.c | 98 + sys/netimp/tags | 1 + sys/netinet/icmp_var.h | 50 + sys/netinet/if_ether.c | 576 + sys/netinet/if_ether.h | 86 + sys/netinet/in.c | 455 + sys/netinet/in.h | 180 + sys/netinet/in_pcb.c | 411 + sys/netinet/in_pcb.h | 44 + sys/netinet/in_proto.c | 161 + sys/netinet/in_systm.h | 39 + sys/netinet/in_var.h | 49 + sys/netinet/ip.h | 154 + sys/netinet/ip_icmp.c | 478 + sys/netinet/ip_icmp.h | 112 + sys/netinet/ip_input.c | 1034 + sys/netinet/ip_output.c | 489 + sys/netinet/ip_var.h | 121 + sys/netinet/raw_ip.c | 176 + sys/netinet/tags | 1 + sys/netinet/tcp.h | 90 + sys/netinet/tcp_debug.c | 138 + sys/netinet/tcp_debug.h | 38 + sys/netinet/tcp_fsm.h | 64 + sys/netinet/tcp_input.c | 1323 + sys/netinet/tcp_output.c | 438 + sys/netinet/tcp_seq.h | 41 + sys/netinet/tcp_subr.c | 321 + sys/netinet/tcp_timer.c | 284 + sys/netinet/tcp_timer.h | 108 + sys/netinet/tcp_usrreq.c | 478 + sys/netinet/tcp_var.h | 244 + sys/netinet/tcpip.h | 39 + sys/netinet/udp.h | 24 + sys/netinet/udp_usrreq.c | 446 + sys/netinet/udp_var.h | 65 + sys/netns/idp.h | 25 + sys/netns/idp_usrreq.c | 552 + sys/netns/idp_var.h | 28 + sys/netns/ns.c | 295 + sys/netns/ns.h | 126 + sys/netns/ns_error.c | 303 + sys/netns/ns_error.h | 69 + sys/netns/ns_if.h | 59 + sys/netns/ns_input.c | 477 + sys/netns/ns_ip.c | 421 + sys/netns/ns_output.c | 136 + sys/netns/ns_pcb.c | 322 + sys/netns/ns_pcb.h | 59 + sys/netns/ns_proto.c | 74 + sys/netns/sp.h | 31 + sys/netns/spidp.h | 41 + sys/netns/spp_debug.c | 149 + sys/netns/spp_debug.h | 38 + sys/netns/spp_timer.h | 101 + sys/netns/spp_usrreq.c | 1713 + sys/netns/spp_var.h | 191 + sys/netns/tags | 1 + sys/pdp/DEFS.h | 86 + sys/pdp/autoconfig.h | 29 + sys/pdp/cksum-fix | 51 + sys/pdp/clock.c | 43 + sys/pdp/clock.h | 21 + sys/pdp/conf.c | 596 + sys/pdp/cons.c | 196 + sys/pdp/cons.h | 56 + sys/pdp/cpu.h | 52 + sys/pdp/enable34.c | 160 + sys/pdp/enable34.h | 28 + sys/pdp/fperr.h | 33 + sys/pdp/frame.h | 19 + sys/pdp/genassym.c | 108 + sys/pdp/in_cksum.c | 84 + sys/pdp/iopage.h | 30 + sys/pdp/kern_pdp.c | 263 + sys/pdp/koverlay.h | 81 + sys/pdp/limits.h | 72 + sys/pdp/machdep.c | 494 + sys/pdp/machdep2.c | 520 + sys/pdp/machparam.h | 150 + sys/pdp/mch_KScall.s | 164 + sys/pdp/mch_backup.s | 340 + sys/pdp/mch_click.s | 271 + sys/pdp/mch_copy.s | 566 + sys/pdp/mch_cpu.h | 9 + sys/pdp/mch_csv.s | 302 + sys/pdp/mch_dump.s | 379 + sys/pdp/mch_dzpdma.s | 91 + sys/pdp/mch_fpsim.s | 1527 + sys/pdp/mch_iopage.h | 201 + sys/pdp/mch_profile.s | 74 + sys/pdp/mch_start.s | 222 + sys/pdp/mch_trap.s | 307 + sys/pdp/mch_vars.s | 43 + sys/pdp/mch_xxx.s | 656 + sys/pdp/mem.c | 122 + sys/pdp/mscp.h | 187 + sys/pdp/mscp_common.h | 361 + sys/pdp/net_SKcall.s | 214 + sys/pdp/net_copy.s | 297 + sys/pdp/net_csv.s | 302 + sys/pdp/net_mac.h | 219 + sys/pdp/net_mbuf.s | 111 + sys/pdp/net_scb.s | 67 + sys/pdp/net_trap.s | 102 + sys/pdp/net_xxx.s | 99 + sys/pdp/psl.h | 33 + sys/pdp/ram.c | 153 + sys/pdp/reg.h | 23 + sys/pdp/scb.s | 408 + sys/pdp/seg.h | 176 + sys/pdp/symbols.raw | 187 + sys/pdp/symbols.sort | 104 + sys/pdp/tags | 1 + sys/pdp/tmscp.h | 265 + sys/pdp/toy.s | 261 + sys/pdp/trap.c | 400 + sys/pdp/trap.h | 38 + sys/pdp/vmparam.h | 18 + sys/pdpif/if_acc.c | 390 + sys/pdpif/if_acc.h | 65 + sys/pdpif/if_css.c | 402 + sys/pdpif/if_css.h | 68 + sys/pdpif/if_de.c | 1404 + sys/pdpif/if_de.h | 156 + sys/pdpif/if_dereg.h | 280 + sys/pdpif/if_dmc.c | 389 + sys/pdpif/if_dmc.h | 72 + sys/pdpif/if_ec.c | 859 + sys/pdpif/if_ecreg.h | 65 + sys/pdpif/if_en.c | 516 + sys/pdpif/if_en.h | 27 + sys/pdpif/if_enreg.h | 38 + sys/pdpif/if_il.c | 778 + sys/pdpif/if_il.h | 52 + sys/pdpif/if_ilreg.h | 124 + sys/pdpif/if_qe.c | 952 + sys/pdpif/if_qereg.h | 155 + sys/pdpif/if_qt.c | 891 + sys/pdpif/if_qtreg.h | 181 + sys/pdpif/if_sri.c | 463 + sys/pdpif/if_sri.h | 49 + sys/pdpif/if_uba.c | 224 + sys/pdpif/if_uba.h | 53 + sys/pdpif/if_un.h | 35 + sys/pdpif/if_vv.c | 934 + sys/pdpif/if_vv.h | 113 + sys/pdpif/tags | 1 + sys/pdpmba/tags | 1 + sys/pdpstand/M.o | Bin 0 -> 2700 bytes sys/pdpstand/M.s | 380 + sys/pdpstand/Makefile | 187 + sys/pdpstand/NEW/bads.c | 416 + sys/pdpstand/NEW/dkbad.c | 180 + sys/pdpstand/NEW/dskinit.c | 1062 + sys/pdpstand/NEW/rabads.c | 2183 + sys/pdpstand/OLD/bcopy.c | 32 + sys/pdpstand/OLD/cat.c | 25 + sys/pdpstand/OLD/copy.c | 32 + sys/pdpstand/boot | Bin 0 -> 35236 bytes sys/pdpstand/boot.c | 753 + sys/pdpstand/boot.o | Bin 0 -> 11980 bytes sys/pdpstand/br.c | 99 + sys/pdpstand/br.o | Bin 0 -> 1872 bytes sys/pdpstand/conf.c | 249 + sys/pdpstand/conf.o | Bin 0 -> 3984 bytes sys/pdpstand/disklabel | Bin 0 -> 37881 bytes sys/pdpstand/disklabel.c | 783 + sys/pdpstand/disklabel.o | Bin 0 -> 16804 bytes sys/pdpstand/displaylab.c | 91 + sys/pdpstand/displaylab.o | Bin 0 -> 3668 bytes sys/pdpstand/hk.c | 152 + sys/pdpstand/hk.o | Bin 0 -> 2430 bytes sys/pdpstand/ht.c | 159 + sys/pdpstand/ht.o | Bin 0 -> 2168 bytes sys/pdpstand/icheck | Bin 0 -> 33032 bytes sys/pdpstand/icheck.o | Bin 0 -> 9884 bytes sys/pdpstand/label.c | 169 + sys/pdpstand/label.o | Bin 0 -> 2732 bytes sys/pdpstand/libsa.a | Bin 0 -> 52340 bytes sys/pdpstand/makesimtape | Bin 0 -> 15601 bytes sys/pdpstand/makesimtape.c | 179 + sys/pdpstand/maketape | Bin 0 -> 12958 bytes sys/pdpstand/maketape.c | 103 + sys/pdpstand/maketape.data | 11 + sys/pdpstand/mkfs | Bin 0 -> 33158 bytes sys/pdpstand/mkfs.o | Bin 0 -> 9276 bytes sys/pdpstand/mtboot | Bin 0 -> 490 bytes sys/pdpstand/mtboot.s | 355 + sys/pdpstand/prf.c | 183 + sys/pdpstand/prf.o | Bin 0 -> 2360 bytes sys/pdpstand/ra.c | 306 + sys/pdpstand/ra.o | Bin 0 -> 4832 bytes sys/pdpstand/restor | Bin 0 -> 35742 bytes sys/pdpstand/restor.o | Bin 0 -> 14486 bytes sys/pdpstand/rk.c | 63 + sys/pdpstand/rk.o | Bin 0 -> 1084 bytes sys/pdpstand/rl.c | 225 + sys/pdpstand/rl.o | Bin 0 -> 3146 bytes sys/pdpstand/rx.c | 143 + sys/pdpstand/rx.o | Bin 0 -> 2210 bytes sys/pdpstand/saio.h | 73 + sys/pdpstand/si.c | 91 + sys/pdpstand/si.o | Bin 0 -> 1432 bytes sys/pdpstand/srt0-i.o | Bin 0 -> 1044 bytes sys/pdpstand/srt0.o | Bin 0 -> 1044 bytes sys/pdpstand/srt0.s | 122 + sys/pdpstand/sys.c | 765 + sys/pdpstand/sys.o | Bin 0 -> 12120 bytes sys/pdpstand/tm.c | 133 + sys/pdpstand/tm.o | Bin 0 -> 1874 bytes sys/pdpstand/tmscp.c | 318 + sys/pdpstand/tmscp.o | Bin 0 -> 3790 bytes sys/pdpstand/toyset | Bin 0 -> 29623 bytes sys/pdpstand/toyset.o | Bin 0 -> 2306 bytes sys/pdpstand/toyset.s | 411 + sys/pdpstand/ts.c | 169 + sys/pdpstand/ts.o | Bin 0 -> 2860 bytes sys/pdpstand/ubmapset.c | 24 + sys/pdpstand/ubmapset.o | Bin 0 -> 240 bytes sys/pdpstand/xp.c | 284 + sys/pdpstand/xp.o | Bin 0 -> 4522 bytes sys/pdpuba/br.c | 442 + sys/pdpuba/brreg.h | 81 + sys/pdpuba/dh.c | 748 + sys/pdpuba/dhreg.h | 53 + sys/pdpuba/dhu.c | 675 + sys/pdpuba/dhureg.h | 130 + sys/pdpuba/dhv.c | 723 + sys/pdpuba/dhvreg.h | 129 + sys/pdpuba/dkbad.c | 36 + sys/pdpuba/dmreg.h | 49 + sys/pdpuba/dn.c | 98 + sys/pdpuba/dnreg.h | 21 + sys/pdpuba/dr.c | 341 + sys/pdpuba/drreg.h | 84 + sys/pdpuba/dz.c | 579 + sys/pdpuba/dzreg.h | 89 + sys/pdpuba/hk.c | 938 + sys/pdpuba/hkreg.h | 134 + sys/pdpuba/hpreg.h | 245 + sys/pdpuba/ht.c | 458 + sys/pdpuba/htreg.h | 189 + sys/pdpuba/lp.c | 298 + sys/pdpuba/pdma.h | 20 + sys/pdpuba/ra.c | 1426 + sys/pdpuba/rareg.h | 27 + sys/pdpuba/rk.c | 204 + sys/pdpuba/rkreg.h | 84 + sys/pdpuba/rl.c | 769 + sys/pdpuba/rlreg.h | 84 + sys/pdpuba/rx.c | 428 + sys/pdpuba/rxreg.h | 109 + sys/pdpuba/si.c | 493 + sys/pdpuba/sireg.h | 62 + sys/pdpuba/tags | 1 + sys/pdpuba/tm.c | 674 + sys/pdpuba/tmreg.h | 69 + sys/pdpuba/tmscp.c | 2012 + sys/pdpuba/tmscpdump.c | 160 + sys/pdpuba/tmscpreg.h | 90 + sys/pdpuba/ts.c | 708 + sys/pdpuba/tsreg.h | 171 + sys/pdpuba/ubavar.h | 56 + sys/pdpuba/xp.c | 1067 + sys/sys/ingreslock.c | 325 + sys/sys/init_main.c | 436 + sys/sys/init_sysent.c | 277 + sys/sys/kern_acct.c | 90 + sys/sys/kern_clock.c | 367 + sys/sys/kern_descrip.c | 509 + sys/sys/kern_exec.c | 621 + sys/sys/kern_exit.c | 297 + sys/sys/kern_fork.c | 316 + sys/sys/kern_mman.c | 299 + sys/sys/kern_proc.c | 64 + sys/sys/kern_prot.c | 213 + sys/sys/kern_prot2.c | 163 + sys/sys/kern_resource.c | 273 + sys/sys/kern_sig.c | 680 + sys/sys/kern_sig2.c | 379 + sys/sys/kern_subr.c | 225 + sys/sys/kern_synch.c | 539 + sys/sys/kern_sysctl.c | 1031 + sys/sys/kern_time.c | 341 + sys/sys/kern_xxx.c | 25 + sys/sys/quota_kern.c | 810 + sys/sys/quota_subr.c | 123 + sys/sys/quota_sys.c | 440 + sys/sys/quota_ufs.c | 259 + sys/sys/subr_log.c | 366 + sys/sys/subr_prf.c | 336 + sys/sys/subr_rmap.c | 270 + sys/sys/subr_xxx.c | 40 + sys/sys/sys_generic.c | 578 + sys/sys/sys_inode.c | 738 + sys/sys/sys_kern.c | 173 + sys/sys/sys_net.c | 511 + sys/sys/sys_pipe.c | 304 + sys/sys/sys_process.c | 199 + sys/sys/sys_socket.c | 132 + sys/sys/syscalls.c | 171 + sys/sys/tags | 1816 + sys/sys/tty.c | 1695 + sys/sys/tty_conf.c | 149 + sys/sys/tty_pty.c | 570 + sys/sys/tty_subr.c | 639 + sys/sys/tty_tb.c | 334 + sys/sys/tty_tty.c | 80 + sys/sys/ufs_alloc.c | 315 + sys/sys/ufs_bio.c | 487 + sys/sys/ufs_bmap.c | 161 + sys/sys/ufs_disksubr.c | 415 + sys/sys/ufs_dsort.c | 86 + sys/sys/ufs_fio.c | 201 + sys/sys/ufs_inode.c | 794 + sys/sys/ufs_mount.c | 350 + sys/sys/ufs_namei.c | 1296 + sys/sys/ufs_subr.c | 174 + sys/sys/ufs_syscalls.c | 1360 + sys/sys/ufs_syscalls2.c | 286 + sys/sys/uipc_domain.c | 179 + sys/sys/uipc_mbuf.c | 411 + sys/sys/uipc_proto.c | 51 + sys/sys/uipc_socket.c | 909 + sys/sys/uipc_socket2.c | 633 + sys/sys/uipc_syscalls.c | 779 + sys/sys/uipc_usrreq.c | 653 + sys/sys/vfs_vnops.c | 221 + sys/sys/vm_proc.c | 109 + sys/sys/vm_sched.c | 354 + sys/sys/vm_swap.c | 159 + sys/sys/vm_swp.c | 222 + sys/sys/vm_text.c | 390 + sys/vaxif/if_acc.c | 374 + sys/vaxif/if_accreg.h | 65 + sys/vaxif/if_css.c | 408 + sys/vaxif/if_cssreg.h | 67 + sys/vaxif/if_ddn.c | 1685 + sys/vaxif/if_ddnreg.h | 128 + sys/vaxif/if_ddnvar.h | 120 + sys/vaxif/if_de.c | 838 + sys/vaxif/if_dereg.h | 191 + sys/vaxif/if_dmc.c | 939 + sys/vaxif/if_dmc.h | 100 + sys/vaxif/if_ec.c | 956 + sys/vaxif/if_ecreg.h | 65 + sys/vaxif/if_en.c | 735 + sys/vaxif/if_en.h | 30 + sys/vaxif/if_enreg.h | 38 + sys/vaxif/if_ex.c | 934 + sys/vaxif/if_exreg.h | 250 + sys/vaxif/if_hdh.c | 669 + sys/vaxif/if_hdhreg.h | 101 + sys/vaxif/if_hy.c | 1485 + sys/vaxif/if_hy.h | 306 + sys/vaxif/if_hyreg.h | 185 + sys/vaxif/if_il.c | 767 + sys/vaxif/if_il.h | 52 + sys/vaxif/if_ilreg.h | 122 + sys/vaxif/if_ix.h | 56 + sys/vaxif/if_pcl.c | 487 + sys/vaxif/if_pclreg.h | 59 + sys/vaxif/if_qe.c | 1073 + sys/vaxif/if_qereg.h | 135 + sys/vaxif/if_uba.c | 376 + sys/vaxif/if_uba.h | 105 + sys/vaxif/if_vv.c | 1001 + sys/vaxif/if_vv.h | 112 + sys/vaxif/raw_hy.c | 72 + sys/vaxif/tags | 1 + sys/vaxuba/rxreg.h | 105 + sys/vaxuba/tags | 1 + ucb/MANIFEST | 83 + ucb/Mail/Mail.rc | 2 + ucb/Mail/Makefile | 71 + ucb/Mail/aux.c | 651 + ucb/Mail/cmd1.c | 440 + ucb/Mail/cmd2.c | 516 + ucb/Mail/cmd3.c | 713 + ucb/Mail/cmdtab.c | 127 + ucb/Mail/collect.c | 621 + ucb/Mail/def.h | 322 + ucb/Mail/edit.c | 218 + ucb/Mail/fio.c | 418 + ucb/Mail/fmt.c | 458 + ucb/Mail/getname.c | 75 + ucb/Mail/glob.h | 100 + ucb/Mail/head.c | 246 + ucb/Mail/lex.c | 650 + ucb/Mail/list.c | 774 + ucb/Mail/main.c | 290 + ucb/Mail/names.c | 684 + ucb/Mail/pathnames.h | 45 + ucb/Mail/popen.c | 342 + ucb/Mail/quit.c | 487 + ucb/Mail/rcv.h | 44 + ucb/Mail/send.c | 553 + ucb/Mail/strings.c | 125 + ucb/Mail/temp.c | 92 + ucb/Mail/tty.c | 268 + ucb/Mail/v7.local.c | 79 + ucb/Mail/vars.c | 189 + ucb/Mail/version.c | 42 + ucb/Makefile | 105 + ucb/PORT/gprof.tar.Z | Bin 0 -> 43212 bytes ucb/PORT/pascal.tar.Z | Bin 0 -> 700669 bytes ucb/PORT/pc.1 | 255 + ucb/PORT/symorder.c.Z | Bin 0 -> 2953 bytes ucb/PORT/sysline.1 | 154 + ucb/PORT/sysline.tar.Z | Bin 0 -> 23142 bytes ucb/PORT/systat.tar.Z | Bin 0 -> 48921 bytes ucb/PORT/vlp.tar.Z | Bin 0 -> 10598 bytes ucb/apply.c | 140 + ucb/biff.c | 59 + ucb/checknr.c | 559 + ucb/clear.c | 58 + ucb/colcrt.c | 225 + ucb/colrm.c | 98 + ucb/compress/Makefile | 27 + ucb/compress/README | 283 + ucb/compress/USERMEM | 1 + ucb/compress/compress.c | 1507 + ucb/compress/usermem.sh | 75 + ucb/ctags.c | 968 + ucb/dbx/Makefile | 17 + ucb/dbx/dbx.c | 5 + ucb/error/Makefile | 48 + ucb/error/error.h | 201 + ucb/error/errorfilter.c | 163 + ucb/error/errorinput.c | 519 + ucb/error/errormain.c | 253 + ucb/error/errorpi.c | 376 + ucb/error/errorsubr.c | 394 + ucb/error/errortouch.c | 736 + ucb/ex/Makefile | 175 + ucb/ex/READ_ME | 19 + ucb/ex/TODO | 2036 + ucb/ex/ex.c | 431 + ucb/ex/ex.h | 396 + ucb/ex/ex.news | 1284 + ucb/ex/ex_addr.c | 313 + ucb/ex/ex_argv.h | 34 + ucb/ex/ex_cmds.c | 889 + ucb/ex/ex_cmds2.c | 557 + ucb/ex/ex_cmdsub.c | 1292 + ucb/ex/ex_data.c | 91 + ucb/ex/ex_extern.c | 27 + ucb/ex/ex_get.c | 277 + ucb/ex/ex_io.c | 884 + ucb/ex/ex_put.c | 1150 + ucb/ex/ex_re.c | 947 + ucb/ex/ex_re.h | 73 + ucb/ex/ex_set.c | 235 + ucb/ex/ex_subr.c | 938 + ucb/ex/ex_tagio.c | 105 + ucb/ex/ex_temp.c | 659 + ucb/ex/ex_temp.h | 122 + ucb/ex/ex_tty.c | 260 + ucb/ex/ex_tty.h | 190 + ucb/ex/ex_tune.h | 124 + ucb/ex/ex_unix.c | 355 + ucb/ex/ex_v.c | 430 + ucb/ex/ex_vadj.c | 1089 + ucb/ex/ex_vars.h | 52 + ucb/ex/ex_vget.c | 646 + ucb/ex/ex_vis.h | 274 + ucb/ex/ex_vmain.c | 1300 + ucb/ex/ex_voper.c | 863 + ucb/ex/ex_vops.c | 937 + ucb/ex/ex_vops2.c | 904 + ucb/ex/ex_vops3.c | 556 + ucb/ex/ex_vput.c | 1368 + ucb/ex/ex_vwind.c | 469 + ucb/ex/expreserve.c | 398 + ucb/ex/exrecover.c | 781 + ucb/ex/makeoptions | 54 + ucb/ex/printf.c | 352 + ucb/ex/uparm.h | 2 + ucb/expand.c | 125 + ucb/finger/Makefile | 52 + ucb/finger/finger.1 | 126 + ucb/finger/finger.c | 229 + ucb/finger/finger.h | 69 + ucb/finger/lprint.c | 254 + ucb/finger/net.c | 124 + ucb/finger/pathnames.h | 22 + ucb/finger/sprint.c | 143 + ucb/finger/util.c | 319 + ucb/fold.c | 108 + ucb/fp/Makefile | 17 + ucb/fp/fp.c | 5 + ucb/from.c | 93 + ucb/ftp/Makefile | 51 + ucb/ftp/cmds.c | 2182 + ucb/ftp/cmdtab.c | 183 + ucb/ftp/domacro.c | 144 + ucb/ftp/ftp.1 | 924 + ucb/ftp/ftp.c | 1703 + ucb/ftp/ftp_var.h | 114 + ucb/ftp/glob.c | 663 + ucb/ftp/main.c | 491 + ucb/ftp/pathnames.h | 21 + ucb/ftp/ruserpass.c | 268 + ucb/gcore.c | 228 + ucb/gprof.c | 5 + ucb/grep.c | 460 + ucb/head.c | 90 + ucb/indent/Makefile | 55 + ucb/indent/README | 8 + ucb/indent/args.c | 257 + ucb/indent/indent.c | 1104 + ucb/indent/indent_codes.h | 65 + ucb/indent/indent_globs.h | 228 + ucb/indent/io.c | 516 + ucb/indent/lexi.c | 544 + ucb/indent/parse.c | 335 + ucb/indent/pr_comment.c | 385 + ucb/last.c | 243 + ucb/lastcomm.c | 200 + ucb/leave.c | 184 + ucb/lisp/Makefile | 17 + ucb/lisp/lisp.c | 5 + ucb/lock/Makefile | 52 + ucb/lock/lock.1 | 47 + ucb/lock/lock.c | 197 + ucb/logger.c | 218 + ucb/man/Makefile | 71 + ucb/man/apropos.c | 217 + ucb/man/man.c | 456 + ucb/mkstr.c | 280 + ucb/more/Makefile | 22 + ucb/more/more.c | 1773 + ucb/more/more.help | 24 + ucb/msgs/Makefile | 20 + ucb/msgs/msgs.c | 833 + ucb/msgs/msgs.h | 15 + ucb/netstat/Makefile | 41 + ucb/netstat/host.c | 1 + ucb/netstat/host.c.newimp | 121 + ucb/netstat/host.c.oldimp | 83 + ucb/netstat/if.c | 326 + ucb/netstat/inet.c | 422 + ucb/netstat/main.c | 1 + ucb/netstat/main.c.newimp | 449 + ucb/netstat/main.c.oldimp | 529 + ucb/netstat/mbuf.c | 108 + ucb/netstat/ns.c | 328 + ucb/netstat/route.c | 366 + ucb/netstat/unix.c | 132 + ucb/pascal/Makefile | 35 + ucb/pascal/eyacc/Makefile | 44 + ucb/pascal/eyacc/READ_ME | 25 + ucb/pascal/eyacc/ey.h | 125 + ucb/pascal/eyacc/ey0.c | 119 + ucb/pascal/eyacc/ey1.c | 321 + ucb/pascal/eyacc/ey2.c | 537 + ucb/pascal/eyacc/ey3.c | 379 + ucb/pascal/eyacc/ey4.c | 423 + ucb/pascal/eyacc/ey5.c | 47 + ucb/pascal/pi/0.h | 683 + ucb/pascal/pi/Makefile | 162 + ucb/pascal/pi/OPnames.h | 257 + ucb/pascal/pi/READ_ME | 28 + ucb/pascal/pi/TESTS/t.p | 2 + ucb/pascal/pi/TESTS/test.p | 18 + ucb/pascal/pi/TESTS/test2.p | 5 + ucb/pascal/pi/TODO | 3 + ucb/pascal/pi/TRdata.c | 202 + ucb/pascal/pi/ato.c | 46 + ucb/pascal/pi/call.c | 103 + ucb/pascal/pi/case.c | 191 + ucb/pascal/pi/clas.c | 212 + ucb/pascal/pi/const.c | 217 + ucb/pascal/pi/conv.c | 248 + ucb/pascal/pi/cset.c | 143 + ucb/pascal/pi/error.c | 136 + ucb/pascal/pi/fdec.c | 534 + ucb/pascal/pi/func.c | 249 + ucb/pascal/pi/gen.c | 215 + ucb/pascal/pi/gram.ex | 45 + ucb/pascal/pi/hash.c | 191 + ucb/pascal/pi/how_pi | 13 + ucb/pascal/pi/how_pix | 19 + ucb/pascal/pi/lab.c | 126 + ucb/pascal/pi/lookup.c | 119 + ucb/pascal/pi/lval.c | 290 + ucb/pascal/pi/main.c | 254 + ucb/pascal/pi/nl.c | 710 + ucb/pascal/pi/opcode.h | 183 + ucb/pascal/pi/pas.y | 908 + ucb/pascal/pi/pix.c | 98 + ucb/pascal/pi/proc.c | 797 + ucb/pascal/pi/put.c | 379 + ucb/pascal/pi/putn.c | 40 + ucb/pascal/pi/px_header.c | 84 + ucb/pascal/pi/rec.c | 249 + ucb/pascal/pi/rval.c | 560 + ucb/pascal/pi/send.h | 31 + ucb/pascal/pi/stat.c | 551 + ucb/pascal/pi/string.c | 161 + ucb/pascal/pi/subr.c | 219 + ucb/pascal/pi/tree.c | 191 + ucb/pascal/pi/tree.h | 82 + ucb/pascal/pi/treen.c | 36 + ucb/pascal/pi/type.c | 327 + ucb/pascal/pi/var.c | 236 + ucb/pascal/pi/version.c | 25 + ucb/pascal/pi/whoami | 3 + ucb/pascal/pi/yy.h | 297 + ucb/pascal/pi/yycopy.c | 20 + ucb/pascal/pi/yycosts.c | 244 + ucb/pascal/pi/yyerror.c | 111 + ucb/pascal/pi/yyget.c | 343 + ucb/pascal/pi/yyid.c | 259 + ucb/pascal/pi/yylex.c | 350 + ucb/pascal/pi/yymain.c | 180 + ucb/pascal/pi/yyoptions.c | 67 + ucb/pascal/pi/yypanic.c | 161 + ucb/pascal/pi/yyparse.c | 214 + ucb/pascal/pi/yyprint.c | 109 + ucb/pascal/pi/yyput.c | 285 + ucb/pascal/pi/yyrecover.c | 872 + ucb/pascal/pi/yyseman.c | 48 + ucb/pascal/pi/yytree.c | 115 + ucb/pascal/px/00int.s | 339 + ucb/pascal/px/02rel.s | 151 + ucb/pascal/px/02relset.s | 74 + ucb/pascal/px/03bool.s | 16 + ucb/pascal/px/04as.s | 56 + ucb/pascal/px/05lv.s | 47 + ucb/pascal/px/06add.s | 66 + ucb/pascal/px/07sub.s | 66 + ucb/pascal/px/0x.h | 132 + ucb/pascal/px/10mul.s | 79 + ucb/pascal/px/12div.s | 47 + ucb/pascal/px/13mod.s | 56 + ucb/pascal/px/14neg.s | 29 + ucb/pascal/px/16dvd.s | 61 + ucb/pascal/px/17ind.s | 39 + ucb/pascal/px/17rv.s | 38 + ucb/pascal/px/20con.s | 33 + ucb/pascal/px/21rang.s | 78 + ucb/pascal/px/24case.s | 60 + ucb/pascal/px/24pxp.s | 39 + ucb/pascal/px/25set.s | 147 + ucb/pascal/px/26for.s | 71 + ucb/pascal/px/27conv.s | 17 + ucb/pascal/px/30atof.s | 130 + ucb/pascal/px/30getname.s | 222 + ucb/pascal/px/30io.s | 350 + ucb/pascal/px/30iosubs.s | 220 + ucb/pascal/px/30read.s | 189 + ucb/pascal/px/30write.s | 109 + ucb/pascal/px/34fun.s | 305 + ucb/pascal/px/Edata | 39 + ucb/pascal/px/Emake.ed | 7 + ucb/pascal/px/Makefile | 66 + ucb/pascal/px/README | 132 + ucb/pascal/px/README2 | 16 + ucb/pascal/px/doub.p | 4 + ucb/pascal/px/exit.c | 19 + ucb/pascal/px/gather.c | 158 + ucb/pascal/px/getc.s | 84 + ucb/pascal/px/int.c | 174 + ucb/pascal/px/opcode.h | 181 + ucb/pascal/px/opcode.s | 260 + ucb/pascal/px/palloc.c | 43 + ucb/pascal/px/pcttot.c | 26 + ucb/pascal/px/pdattim.c | 21 + ucb/pascal/px/perror.c | 220 + ucb/pascal/px/putc.s | 95 + ucb/pascal/px/pwrite.c | 243 + ucb/pascal/pxp/0.h | 298 + ucb/pascal/pxp/Makefile | 71 + ucb/pascal/pxp/TRdata.c | 201 + ucb/pascal/pxp/Version.c | 9 + ucb/pascal/pxp/call.c | 47 + ucb/pascal/pxp/case.c | 84 + ucb/pascal/pxp/const.c | 106 + ucb/pascal/pxp/cset.c | 39 + ucb/pascal/pxp/error.c | 125 + ucb/pascal/pxp/fdec.c | 235 + ucb/pascal/pxp/func.c | 20 + ucb/pascal/pxp/gram.ex | 44 + ucb/pascal/pxp/hash.c | 188 + ucb/pascal/pxp/how_pxp | 11 + ucb/pascal/pxp/lab.c | 70 + ucb/pascal/pxp/lval.c | 64 + ucb/pascal/pxp/main.c | 259 + ucb/pascal/pxp/nl.c | 696 + ucb/pascal/pxp/opcode.h | 1 + ucb/pascal/pxp/pas.y | 901 + ucb/pascal/pxp/pmon.c | 348 + ucb/pascal/pxp/pp.c | 391 + ucb/pascal/pxp/printf.s | 289 + ucb/pascal/pxp/proc.c | 17 + ucb/pascal/pxp/rec.c | 136 + ucb/pascal/pxp/rval.c | 139 + ucb/pascal/pxp/stat.c | 314 + ucb/pascal/pxp/string.c | 59 + ucb/pascal/pxp/subr.c | 184 + ucb/pascal/pxp/tree.c | 188 + ucb/pascal/pxp/tree.h | 81 + ucb/pascal/pxp/treen.s | 33 + ucb/pascal/pxp/type.c | 202 + ucb/pascal/pxp/var.c | 70 + ucb/pascal/pxp/y.tab.h | 60 + ucb/pascal/pxp/yy.h | 296 + ucb/pascal/pxp/yycomm.c | 466 + ucb/pascal/pxp/yycopy.s | 20 + ucb/pascal/pxp/yycosts.c | 242 + ucb/pascal/pxp/yyerror.c | 106 + ucb/pascal/pxp/yyget.c | 324 + ucb/pascal/pxp/yyid.c | 252 + ucb/pascal/pxp/yylex.c | 347 + ucb/pascal/pxp/yymain.c | 160 + ucb/pascal/pxp/yypanic.c | 158 + ucb/pascal/pxp/yyparse.c | 211 + ucb/pascal/pxp/yyprint.c | 96 + ucb/pascal/pxp/yyput.c | 281 + ucb/pascal/pxp/yyrecover.c | 837 + ucb/pascal/pxp/yyseman.c | 45 + ucb/pascal/pxp/yytree.c | 112 + ucb/printenv.c | 60 + ucb/quota.c | 347 + ucb/rdist/Makefile | 48 + ucb/rdist/cron.entry | 1 + ucb/rdist/defs.h | 127 + ucb/rdist/docmd.c | 564 + ucb/rdist/expand.c | 622 + ucb/rdist/gram.y | 475 + ucb/rdist/lookup.c | 137 + ucb/rdist/main.c | 267 + ucb/rdist/pathnames.h | 38 + ucb/rdist/server.c | 1519 + ucb/rlogin.c | 602 + ucb/rsh.c | 246 + ucb/ruptime.c | 235 + ucb/rwho.c | 157 + ucb/sccs.c | 1557 + ucb/script.c | 257 + ucb/sendbug/Makefile | 32 + ucb/sendbug/bugfiler.c | 874 + ucb/sendbug/bugformat | 14 + ucb/sendbug/sendbug.sh | 36 + ucb/sendbug/unixtomh.c | 612 + ucb/soelim.c | 133 + ucb/strcompact.c | 196 + ucb/strings.c | 134 + ucb/symcompact.c | 304 + ucb/symdump.c | 116 + ucb/symorder.c | 298 + ucb/tail.c | 239 + ucb/talk/Makefile | 115 + ucb/talk/ctl.c | 79 + ucb/talk/ctl_transact.c | 81 + ucb/talk/display.c | 162 + ucb/talk/get_addrs.c | 53 + ucb/talk/get_names.c | 98 + ucb/talk/init_disp.c | 117 + ucb/talk/invite.c | 148 + ucb/talk/io.c | 114 + ucb/talk/look_up.c | 76 + ucb/talk/msgs.c | 54 + ucb/talk/talk.c | 48 + ucb/talk/talk.h | 40 + ucb/talk/talk_ctl.h | 24 + ucb/tcopy.c | 142 + ucb/telnet.c | 2364 ++ ucb/tftp/Makefile | 26 + ucb/tftp/main.c | 661 + ucb/tftp/tftp.1 | 155 + ucb/tftp/tftp.c | 405 + ucb/tftp/tftpsubs.c | 251 + ucb/tn3270/3270.h | 69 + ucb/tn3270/DEFS.h | 32 + ucb/tn3270/Makefile | 113 + ucb/tn3270/README | 51 + ucb/tn3270/ascebc.h | 37 + ucb/tn3270/asctab.c | 122 + ucb/tn3270/datastream.c | 817 + ucb/tn3270/default.map3270 | 9 + ucb/tn3270/ebctab.c | 66 + ucb/tn3270/ectype.c | 278 + ucb/tn3270/ectype.h | 19 + ucb/tn3270/genbsubs.c | 40 + ucb/tn3270/keyboard.c | 878 + ucb/tn3270/map3270.c | 827 + ucb/tn3270/mset.c | 125 + ucb/tn3270/options.c | 160 + ucb/tn3270/options.h | 50 + ucb/tn3270/pdpbsubs.s | 73 + ucb/tn3270/screen.c | 88 + ucb/tn3270/screen.h | 151 + ucb/tn3270/state.h | 31 + ucb/tn3270/termcodes.m4 | 207 + ucb/tn3270/termin.c | 176 + ucb/tn3270/tn3270.c | 1459 + ucb/tn3270/vaxbsubs.s | 87 + ucb/tset/Makefile | 40 + ucb/tset/tset.1 | 420 + ucb/tset/tset.c | 1274 + ucb/ul.c | 541 + ucb/unexpand.c | 104 + ucb/unifdef.c | 553 + ucb/users.c | 76 + ucb/vacation.c | 496 + ucb/vgrind/Makefile | 32 + ucb/vgrind/regexp.c | 555 + ucb/vgrind/retest.c | 72 + ucb/vgrind/tmac.vgrind | 67 + ucb/vgrind/vfontedpr.c | 667 + ucb/vgrind/vgrind.sh | 119 + ucb/vgrind/vgrindefs.c | 299 + ucb/vgrind/vgrindefs.src | 101 + ucb/vlp/Makefile | 17 + ucb/vlp/vlp.c | 5 + ucb/vmstat.c | 719 + ucb/w.c | 600 + ucb/wc.c | 119 + ucb/what.c | 66 + ucb/whereis.c | 309 + ucb/which.csh | 48 + ucb/whois.c | 87 + ucb/window/:tt | 8 + ucb/window/:tty | 6 + ucb/window/:var | 2 + ucb/window/:ww | 19 + ucb/window/Makefile | 449 + ucb/window/README | 126 + ucb/window/TODO | 19 + ucb/window/alias.h | 24 + ucb/window/char.c | 120 + ucb/window/char.h | 33 + ucb/window/cmd.c | 262 + ucb/window/cmd1.c | 143 + ucb/window/cmd2.c | 119 + ucb/window/cmd3.c | 66 + ucb/window/cmd4.c | 26 + ucb/window/cmd5.c | 99 + ucb/window/cmd6.c | 80 + ucb/window/cmd7.c | 54 + ucb/window/context.c | 99 + ucb/window/context.h | 55 + ucb/window/defs.h | 42 + ucb/window/error.c | 65 + ucb/window/lcmd.c | 116 + ucb/window/lcmd.h | 33 + ucb/window/lcmd1.c | 359 + ucb/window/lcmd2.c | 345 + ucb/window/local.h | 22 + ucb/window/main.c | 172 + ucb/window/mloop.c | 47 + ucb/window/parser.h | 20 + ucb/window/parser1.c | 192 + ucb/window/parser2.c | 201 + ucb/window/parser3.c | 161 + ucb/window/parser4.c | 266 + ucb/window/parser5.c | 171 + ucb/window/scanner.c | 535 + ucb/window/startup.c | 59 + ucb/window/string.c | 124 + ucb/window/string.h | 37 + ucb/window/token.h | 52 + ucb/window/tt.h | 100 + ucb/window/ttf100.c | 39 + ucb/window/ttgeneric.c | 381 + ucb/window/tth19.c | 259 + ucb/window/tth29.c | 67 + ucb/window/ttinit.c | 76 + ucb/window/ttoutput.c | 108 + ucb/window/tttermcap.c | 69 + ucb/window/tttvi925.c | 36 + ucb/window/value.h | 25 + ucb/window/var.c | 127 + ucb/window/var.h | 30 + ucb/window/win.c | 298 + ucb/window/windowrc | 57 + ucb/window/ww.h | 258 + ucb/window/wwadd.c | 60 + ucb/window/wwalloc.c | 41 + ucb/window/wwbox.c | 36 + ucb/window/wwchild.c | 33 + ucb/window/wwclose.c | 30 + ucb/window/wwclreol.c | 115 + ucb/window/wwclreos.c | 21 + ucb/window/wwcursor.c | 62 + ucb/window/wwdata.c | 30 + ucb/window/wwdelchar.c | 95 + ucb/window/wwdelete.c | 113 + ucb/window/wwdelline.c | 56 + ucb/window/wwdump.c | 84 + ucb/window/wwend.c | 25 + ucb/window/wwenviron.c | 49 + ucb/window/wwerror.c | 38 + ucb/window/wwflush.c | 22 + ucb/window/wwframe.c | 219 + ucb/window/wwgets.c | 61 + ucb/window/wwinit.c | 191 + ucb/window/wwinschar.c | 99 + ucb/window/wwinsline.c | 56 + ucb/window/wwiomux.c | 129 + ucb/window/wwlabel.c | 66 + ucb/window/wwmisc.c | 37 + ucb/window/wwmove.c | 68 + ucb/window/wwopen.c | 163 + ucb/window/wwprintf.c | 33 + ucb/window/wwpty.c | 63 + ucb/window/wwputc.c | 18 + ucb/window/wwputs.c | 22 + ucb/window/wwredraw.c | 26 + ucb/window/wwredrawwin.c | 43 + ucb/window/wwrint.c | 48 + ucb/window/wwscroll.c | 208 + ucb/window/wwsize.c | 167 + ucb/window/wwspawn.c | 55 + ucb/window/wwsuspend.c | 28 + ucb/window/wwtty.c | 60 + ucb/window/wwunframe.c | 48 + ucb/window/wwupdate.c | 143 + ucb/window/wwwrite.c | 263 + ucb/xstr.c | 453 + ucb/yes.c | 22 + usr.bin/MANIFEST | 71 + usr.bin/Makefile | 81 + usr.bin/PORT/ar11.c.Z | Bin 0 -> 5129 bytes usr.bin/PORT/efl.tar.Z | Bin 0 -> 105632 bytes usr.bin/PORT/file.c.Z | Bin 0 -> 5020 bytes usr.bin/PORT/lint.tar.Z | Bin 0 -> 43376 bytes usr.bin/PORT/ranlib.c.Z | Bin 0 -> 4243 bytes usr.bin/at/Makefile | 55 + usr.bin/at/at.c | 932 + usr.bin/at/atq.c | 555 + usr.bin/at/atrm.c | 430 + usr.bin/at/atrun.c | 544 + usr.bin/basename.c | 31 + usr.bin/bc.y | 610 + usr.bin/cal.c | 208 + usr.bin/calendar/Makefile | 15 + usr.bin/calendar/calendar.c | 59 + usr.bin/calendar/calendar.sh | 33 + usr.bin/cb.c | 363 + usr.bin/checkeq.c | 86 + usr.bin/col.c | 308 + usr.bin/comm.c | 167 + usr.bin/crypt.c | 135 + usr.bin/dc/Makefile | 18 + usr.bin/dc/dc.c | 1942 + usr.bin/dc/dc.h | 118 + usr.bin/deroff.c | 1432 + usr.bin/diction/Makefile | 80 + usr.bin/diction/abbrev.c | 70 + usr.bin/diction/conp.h | 16 + usr.bin/diction/dict.c | 463 + usr.bin/diction/dict.d | 519 + usr.bin/diction/diction.c | 535 + usr.bin/diction/diction.sh | 28 + usr.bin/diction/edict.c | 1409 + usr.bin/diction/ehash.c | 561 + usr.bin/diction/end.l | 239 + usr.bin/diction/explain.d | 550 + usr.bin/diction/explain.sh | 12 + usr.bin/diction/names.h | 47 + usr.bin/diction/nhash.c | 248 + usr.bin/diction/nwords.l | 503 + usr.bin/diction/outp.c | 325 + usr.bin/diction/part.l | 378 + usr.bin/diction/pscan.c | 964 + usr.bin/diction/style.h | 45 + usr.bin/diction/style.sh | 41 + usr.bin/diction/suggest.sh | 17 + usr.bin/diction/ydict.c | 770 + usr.bin/diff3/Makefile | 15 + usr.bin/diff3/diff3.c | 459 + usr.bin/diff3/diff3.sh | 21 + usr.bin/egrep.y | 616 + usr.bin/eqn/Makefile | 37 + usr.bin/eqn/diacrit.c | 105 + usr.bin/eqn/e.h | 53 + usr.bin/eqn/e.y | 167 + usr.bin/eqn/eqnbox.c | 29 + usr.bin/eqn/font.c | 67 + usr.bin/eqn/fromto.c | 53 + usr.bin/eqn/funny.c | 36 + usr.bin/eqn/glob.c | 31 + usr.bin/eqn/integral.c | 42 + usr.bin/eqn/io.c | 209 + usr.bin/eqn/lex.c | 228 + usr.bin/eqn/lookup.c | 228 + usr.bin/eqn/mark.c | 21 + usr.bin/eqn/matrix.c | 66 + usr.bin/eqn/move.c | 26 + usr.bin/eqn/over.c | 46 + usr.bin/eqn/paren.c | 121 + usr.bin/eqn/pile.c | 74 + usr.bin/eqn/shift.c | 169 + usr.bin/eqn/size.c | 50 + usr.bin/eqn/sqrt.c | 35 + usr.bin/eqn/text.c | 178 + usr.bin/f77/:gram.fix | 21 + usr.bin/f77/:rofix | 3 + usr.bin/f77/BUG? | 45 + usr.bin/f77/Makefile | 127 + usr.bin/f77/README | 28 + usr.bin/f77/data.c | 317 + usr.bin/f77/defines | 242 + usr.bin/f77/defs | 445 + usr.bin/f77/defs.orig | 462 + usr.bin/f77/dmrdefs | 85 + usr.bin/f77/drivedefs | 31 + usr.bin/f77/driver.c | 1170 + usr.bin/f77/equiv.c | 266 + usr.bin/f77/error.c | 134 + usr.bin/f77/exec.c | 558 + usr.bin/f77/expr.c | 2212 + usr.bin/f77/ftypes | 21 + usr.bin/f77/gram.dcl | 318 + usr.bin/f77/gram.exec | 127 + usr.bin/f77/gram.expr | 125 + usr.bin/f77/gram.head | 165 + usr.bin/f77/gram.io | 179 + usr.bin/f77/includes | 46 + usr.bin/f77/init.c | 257 + usr.bin/f77/intr.c | 632 + usr.bin/f77/io.c | 827 + usr.bin/f77/lex.c | 905 + usr.bin/f77/locdefs | 53 + usr.bin/f77/main.c | 181 + usr.bin/f77/malloc.c | 131 + usr.bin/f77/misc.c | 661 + usr.bin/f77/pdp11.c | 511 + usr.bin/f77/pdp11defs | 53 + usr.bin/f77/pdp11x.c | 51 + usr.bin/f77/proc.c | 885 + usr.bin/f77/put.c | 297 + usr.bin/f77/putdmr.c | 1303 + usr.bin/f77/scjdefs | 68 + usr.bin/f77/string_defs | 16 + usr.bin/f77/tags | 358 + usr.bin/f77/tokdefs | 97 + usr.bin/f77/tokens | 97 + usr.bin/fgrep.c | 388 + usr.bin/file.c | 494 + usr.bin/find/Makefile | 40 + usr.bin/find/bigram.c | 49 + usr.bin/find/code.c | 120 + usr.bin/find/find.c | 1212 + usr.bin/find/updatedb.csh | 38 + usr.bin/fstat/Makefile | 37 + usr.bin/fstat/fstat.8 | 112 + usr.bin/fstat/fstat.c | 720 + usr.bin/graph/Makefile | 14 + usr.bin/graph/graph.c | 697 + usr.bin/id/Makefile | 40 + usr.bin/id/groups.1 | 60 + usr.bin/id/groups.sh | 37 + usr.bin/id/id.1 | 135 + usr.bin/id/id.c | 322 + usr.bin/id/whoami.1 | 59 + usr.bin/id/whoami.sh | 37 + usr.bin/iostat.c | 294 + usr.bin/join.c | 215 + usr.bin/learn/Makefile | 84 + usr.bin/learn/README | 66 + usr.bin/learn/copy.c | 366 + usr.bin/learn/dounit.c | 75 + usr.bin/learn/getlesson.c | 73 + usr.bin/learn/lcount.c | 16 + usr.bin/learn/learn.c | 76 + usr.bin/learn/list.c | 34 + usr.bin/learn/lrnref.h | 53 + usr.bin/learn/lrntee.c | 37 + usr.bin/learn/makpipe.c | 29 + usr.bin/learn/maktee.c | 53 + usr.bin/learn/mem.c | 115 + usr.bin/learn/mysys.c | 186 + usr.bin/learn/selsub.c | 167 + usr.bin/learn/selunit.c | 116 + usr.bin/learn/start.c | 72 + usr.bin/learn/tags | 42 + usr.bin/learn/tee.c | 37 + usr.bin/learn/whatnow.c | 50 + usr.bin/learn/wrapup.c | 47 + usr.bin/lex/Makefile | 33 + usr.bin/lex/header.c | 112 + usr.bin/lex/ldefs.c | 164 + usr.bin/lex/lmain.c | 231 + usr.bin/lex/ncform | 181 + usr.bin/lex/nrform | 155 + usr.bin/lex/once.c | 131 + usr.bin/lex/parser.y | 714 + usr.bin/lex/sub1.c | 695 + usr.bin/lex/sub2.c | 955 + usr.bin/lint/Makefile | 127 + usr.bin/lint/READ_ME | 8 + usr.bin/lint/SHELL | 39 + usr.bin/lint/hash.c | 34 + usr.bin/lint/libs | 11 + usr.bin/lint/lint.c | 1025 + usr.bin/lint/lmanifest.h | 58 + usr.bin/lint/lpass2.c | 743 + usr.bin/lint/macdefs.h | 82 + usr.bin/look.c | 166 + usr.bin/lorder.sh | 34 + usr.bin/m4/Makefile | 28 + usr.bin/m4/NOTES | 64 + usr.bin/m4/TEST/ack.m4 | 40 + usr.bin/m4/TEST/hanoi.m4 | 45 + usr.bin/m4/TEST/hash.m4 | 55 + usr.bin/m4/TEST/sqroot.m4 | 45 + usr.bin/m4/TEST/string.m4 | 45 + usr.bin/m4/TEST/test.m4 | 243 + usr.bin/m4/eval.c | 787 + usr.bin/m4/expr.c | 626 + usr.bin/m4/extern.h | 98 + usr.bin/m4/look.c | 144 + usr.bin/m4/main.c | 422 + usr.bin/m4/mdef.h | 176 + usr.bin/m4/misc.c | 244 + usr.bin/m4/pathnames.h | 57 + usr.bin/m4/stdd.h | 60 + usr.bin/m4/tags | 70 + usr.bin/mesg.c | 58 + usr.bin/mkdep.sh | 102 + usr.bin/mkerrlst/Makefile | 37 + usr.bin/mkerrlst/mkerrlst.1 | 87 + usr.bin/mkerrlst/mkerrlst.c | 163 + usr.bin/neqn/Makefile | 90 + usr.bin/nohup.sh | 7 + usr.bin/patch/EXTERN.h | 15 + usr.bin/patch/INTERN.h | 15 + usr.bin/patch/MANIFEST | 24 + usr.bin/patch/Makefile | 46 + usr.bin/patch/README | 72 + usr.bin/patch/common.h | 158 + usr.bin/patch/config.h | 121 + usr.bin/patch/dist/Configure | 1419 + usr.bin/patch/dist/Makefile | 90 + usr.bin/patch/dist/Makefile.SH | 99 + usr.bin/patch/dist/config.H | 33 + usr.bin/patch/dist/config.h.SH | 136 + usr.bin/patch/dist/config.sh | 93 + usr.bin/patch/dist/filexp | 32 + usr.bin/patch/dist/myread | 18 + usr.bin/patch/dist/util.c | 356 + usr.bin/patch/inp.c | 332 + usr.bin/patch/inp.h | 18 + usr.bin/patch/malloc.c | 467 + usr.bin/patch/patch.c | 824 + usr.bin/patch/patch.man | 465 + usr.bin/patch/patchlevel.h | 1 + usr.bin/patch/pch.c | 1123 + usr.bin/patch/pch.h | 36 + usr.bin/patch/util.c | 369 + usr.bin/patch/util.h | 74 + usr.bin/patch/version.c | 28 + usr.bin/patch/version.h | 9 + usr.bin/plot/Makefile | 64 + usr.bin/plot/atoplot.c | 168 + usr.bin/plot/chrtab.c | 102 + usr.bin/plot/crtdriver.c | 137 + usr.bin/plot/crtplot.c | 292 + usr.bin/plot/debug.c | 125 + usr.bin/plot/driver.c | 153 + usr.bin/plot/plot.sh | 28 + usr.bin/plot/plottoa.c | 225 + usr.bin/printf/Makefile | 37 + usr.bin/printf/printf.1 | 294 + usr.bin/printf/printf.c | 411 + usr.bin/prof/Makefile | 17 + usr.bin/prof/prof.c | 634 + usr.bin/ptx.c | 555 + usr.bin/ranlib/Makefile | 28 + usr.bin/ranlib/build.c | 290 + usr.bin/ranlib/misc.c | 103 + usr.bin/ranlib/pathnames.h | 36 + usr.bin/ranlib/ranlib.1 | 84 + usr.bin/ranlib/ranlib.5.5 | 73 + usr.bin/ranlib/ranlib.c | 86 + usr.bin/ranlib/touch.c | 87 + usr.bin/ratfor/Makefile | 24 + usr.bin/ratfor/r.g | 67 + usr.bin/ratfor/r.h | 66 + usr.bin/ratfor/r0.c | 87 + usr.bin/ratfor/r1.c | 377 + usr.bin/ratfor/r2.c | 214 + usr.bin/ratfor/rio.c | 215 + usr.bin/ratfor/rlex.c | 248 + usr.bin/ratfor/rlook.c | 71 + usr.bin/refer/Makefile | 64 + usr.bin/refer/TEST | 47 + usr.bin/refer/TOFIX | 3 + usr.bin/refer/addbib.c | 283 + usr.bin/refer/annobib.c | 95 + usr.bin/refer/deliv1.c | 49 + usr.bin/refer/deliv2.c | 58 + usr.bin/refer/flagger.c | 184 + usr.bin/refer/glue1.c | 294 + usr.bin/refer/glue2.c | 17 + usr.bin/refer/glue3.c | 84 + usr.bin/refer/glue4.c | 106 + usr.bin/refer/glue5.c | 371 + usr.bin/refer/hunt1.c | 277 + usr.bin/refer/hunt2.c | 284 + usr.bin/refer/hunt3.c | 50 + usr.bin/refer/hunt5.c | 59 + usr.bin/refer/hunt6.c | 132 + usr.bin/refer/hunt7.c | 111 + usr.bin/refer/hunt8.c | 82 + usr.bin/refer/hunt9.c | 10 + usr.bin/refer/indxbib.sh | 16 + usr.bin/refer/inv1.c | 167 + usr.bin/refer/inv2.c | 97 + usr.bin/refer/inv3.c | 24 + usr.bin/refer/inv5.c | 54 + usr.bin/refer/inv6.c | 84 + usr.bin/refer/kaiser.c | 288 + usr.bin/refer/lookbib.c | 95 + usr.bin/refer/mkey1.c | 97 + usr.bin/refer/mkey2.c | 148 + usr.bin/refer/mkey3.c | 56 + usr.bin/refer/refer..c | 48 + usr.bin/refer/refer0.c | 35 + usr.bin/refer/refer1.c | 165 + usr.bin/refer/refer2.c | 206 + usr.bin/refer/refer3.c | 38 + usr.bin/refer/refer4.c | 86 + usr.bin/refer/refer5.c | 329 + usr.bin/refer/refer6.c | 233 + usr.bin/refer/refer7.c | 163 + usr.bin/refer/refer8.c | 42 + usr.bin/refer/roffbib.sh | 45 + usr.bin/refer/shell.c | 31 + usr.bin/refer/sortbib.c | 290 + usr.bin/refer/thash.c | 150 + usr.bin/refer/tick.c | 39 + usr.bin/refer/tmac.bib | 215 + usr.bin/refer/types.c | 18 + usr.bin/refer/what..c | 19 + usr.bin/refer/what1.c | 161 + usr.bin/refer/what2.c | 241 + usr.bin/refer/what3.c | 86 + usr.bin/refer/what4.c | 178 + usr.bin/renice/Makefile | 37 + usr.bin/renice/renice.8 | 75 + usr.bin/renice/renice.c | 97 + usr.bin/rev.c | 45 + usr.bin/roff/Makefile | 31 + usr.bin/roff/common_source/README | 18 + usr.bin/roff/common_source/d.h | 4 + usr.bin/roff/common_source/hytab.c | 126 + usr.bin/roff/common_source/n1.c | 974 + usr.bin/roff/common_source/n2.c | 335 + usr.bin/roff/common_source/n3.c | 751 + usr.bin/roff/common_source/n4.c | 531 + usr.bin/roff/common_source/n5.c | 824 + usr.bin/roff/common_source/n7.c | 759 + usr.bin/roff/common_source/n8.c | 280 + usr.bin/roff/common_source/n9.c | 333 + usr.bin/roff/common_source/ni.c | 259 + usr.bin/roff/common_source/nii.c | 140 + usr.bin/roff/common_source/sdef.h | 14 + usr.bin/roff/common_source/suftab.c | 610 + usr.bin/roff/common_source/tdef.h | 149 + usr.bin/roff/common_source/textscript | 5 + usr.bin/roff/common_source/tw.h | 30 + usr.bin/roff/common_source/v.h | 4 + usr.bin/roff/nroff/Makefile | 62 + usr.bin/roff/nroff/n10.c | 262 + usr.bin/roff/nroff/n6.c | 279 + usr.bin/roff/nroff/ntab.c | 139 + usr.bin/roff/nroff_term/Makefile | 89 + usr.bin/roff/nroff_term/README | 34 + usr.bin/roff/nroff_term/chartst | 135 + usr.bin/roff/nroff_term/code.300 | 212 + usr.bin/roff/nroff_term/code.aj833 | 213 + usr.bin/roff/nroff_term/code.itoh | 225 + usr.bin/roff/nroff_term/code.nec | 213 + usr.bin/roff/nroff_term/code.x-ecs | 213 + usr.bin/roff/nroff_term/code.xerox | 213 + usr.bin/roff/nroff_term/tab300-12.c | 60 + usr.bin/roff/nroff_term/tab300.c | 60 + usr.bin/roff/nroff_term/tab302-12.c | 60 + usr.bin/roff/nroff_term/tab302.c | 60 + usr.bin/roff/nroff_term/tab37.c | 270 + usr.bin/roff/nroff_term/tab382-12.c | 60 + usr.bin/roff/nroff_term/tab382.c | 60 + usr.bin/roff/nroff_term/tab450-12.c | 60 + usr.bin/roff/nroff_term/tab450.c | 60 + usr.bin/roff/nroff_term/tab833-12.c | 60 + usr.bin/roff/nroff_term/tab833.c | 60 + usr.bin/roff/nroff_term/tabepson.c | 284 + usr.bin/roff/nroff_term/tabitoh.c | 86 + usr.bin/roff/nroff_term/tabitoh12.c | 87 + usr.bin/roff/nroff_term/tablpr.c | 271 + usr.bin/roff/nroff_term/tabnec-t.c | 277 + usr.bin/roff/nroff_term/tabnec.c | 60 + usr.bin/roff/nroff_term/tabnec12.c | 60 + usr.bin/roff/nroff_term/tabnec25-t.c | 272 + usr.bin/roff/nroff_term/tabqume.c | 283 + usr.bin/roff/nroff_term/tabqume12.c | 283 + usr.bin/roff/nroff_term/tabx-ecs.c | 60 + usr.bin/roff/nroff_term/tabx-ecs12.c | 60 + usr.bin/roff/nroff_term/tabxerox.c | 60 + usr.bin/roff/nroff_term/tabxerox12.c | 59 + usr.bin/roff/troff/Makefile | 59 + usr.bin/roff/troff/svt6.c | 608 + usr.bin/roff/troff/t10.c | 319 + usr.bin/roff/troff/t6.c | 619 + usr.bin/roff/troff/tab3.c | 896 + usr.bin/roff/troff_font/Makefile | 35 + usr.bin/roff/troff_font/ftBC.n | 102 + usr.bin/roff/troff_font/ftC.n | 102 + usr.bin/roff/troff_font/ftCW.n | 102 + usr.bin/roff/troff_font/ftGR.n | 102 + usr.bin/roff/troff_font/ftR.n | 102 + usr.bin/roff/troff_font/linkrc | 7 + usr.bin/roff/troff_font/mkfont.c | 107 + usr.bin/roff/troff_font/mkfont1.c | 375 + usr.bin/roff/troff_font/onefont | 5 + usr.bin/shar/Makefile | 41 + usr.bin/shar/shar.1 | 112 + usr.bin/shar/shar.c | 428 + usr.bin/shar/traverse.3 | 51 + usr.bin/shar/traverse.c | 103 + usr.bin/sleep.c | 22 + usr.bin/sort.c | 913 + usr.bin/spell/Makefile | 34 + usr.bin/spell/american | 327 + usr.bin/spell/british | 331 + usr.bin/spell/local | 448 + usr.bin/spell/spell.c | 541 + usr.bin/spell/spell.h | 100 + usr.bin/spell/spell.sh | 41 + usr.bin/spell/spellin.c | 44 + usr.bin/spell/spellout.c | 47 + usr.bin/spell/stop | 919 + usr.bin/spline.c | 338 + usr.bin/split.c | 82 + usr.bin/struct/0.alloc.c | 157 + usr.bin/struct/0.args.c | 102 + usr.bin/struct/0.def.c | 15 + usr.bin/struct/0.extr.c | 30 + usr.bin/struct/0.graph.c | 63 + usr.bin/struct/0.list.c | 70 + usr.bin/struct/0.parts.c | 124 + usr.bin/struct/0.string.c | 110 + usr.bin/struct/1.defs.h | 154 + usr.bin/struct/1.finish.c | 42 + usr.bin/struct/1.form.c | 222 + usr.bin/struct/1.fort.c | 266 + usr.bin/struct/1.hash.c | 242 + usr.bin/struct/1.incl.h | 41 + usr.bin/struct/1.init.c | 52 + usr.bin/struct/1.line.c | 120 + usr.bin/struct/1.main.c | 17 + usr.bin/struct/1.node.c | 52 + usr.bin/struct/1.recog.c | 379 + usr.bin/struct/1.tables.c | 224 + usr.bin/struct/2.def.h | 6 + usr.bin/struct/2.dfs.c | 177 + usr.bin/struct/2.dom.c | 54 + usr.bin/struct/2.head.c | 111 + usr.bin/struct/2.inarc.c | 73 + usr.bin/struct/2.main.c | 53 + usr.bin/struct/2.tree.c | 135 + usr.bin/struct/3.branch.c | 92 + usr.bin/struct/3.def.h | 8 + usr.bin/struct/3.flow.c | 93 + usr.bin/struct/3.loop.c | 156 + usr.bin/struct/3.main.c | 37 + usr.bin/struct/3.reach.c | 147 + usr.bin/struct/3.then.c | 79 + usr.bin/struct/4.brace.c | 60 + usr.bin/struct/4.def.h | 13 + usr.bin/struct/4.form.c | 117 + usr.bin/struct/4.main.c | 26 + usr.bin/struct/4.out.c | 296 + usr.bin/struct/Makefile | 61 + usr.bin/struct/b.h | 12 + usr.bin/struct/bdef.c | 8 + usr.bin/struct/beauty.y | 414 + usr.bin/struct/def.h | 120 + usr.bin/struct/lextab.l | 221 + usr.bin/struct/main.c | 73 + usr.bin/struct/struct | 23 + usr.bin/struct/tree.c | 243 + usr.bin/sum.c | 49 + usr.bin/tabs.c | 192 + usr.bin/tbl/Makefile | 72 + usr.bin/tbl/t..c | 78 + usr.bin/tbl/t0.c | 52 + usr.bin/tbl/t1.c | 110 + usr.bin/tbl/t2.c | 25 + usr.bin/tbl/t3.c | 97 + usr.bin/tbl/t4.c | 237 + usr.bin/tbl/t5.c | 172 + usr.bin/tbl/t6.c | 206 + usr.bin/tbl/t7.c | 136 + usr.bin/tbl/t8.c | 331 + usr.bin/tbl/t9.c | 67 + usr.bin/tbl/tb.c | 90 + usr.bin/tbl/tc.c | 64 + usr.bin/tbl/te.c | 71 + usr.bin/tbl/tf.c | 55 + usr.bin/tbl/tg.c | 73 + usr.bin/tbl/ti.c | 60 + usr.bin/tbl/tm.c | 67 + usr.bin/tbl/ts.c | 53 + usr.bin/tbl/tt.c | 89 + usr.bin/tbl/tu.c | 206 + usr.bin/tbl/tv.c | 152 + usr.bin/tc.c | 637 + usr.bin/tip/Makefile | 176 + usr.bin/tip/README | 61 + usr.bin/tip/TODO | 18 + usr.bin/tip/acu.c | 165 + usr.bin/tip/aculib/Makefile | 107 + usr.bin/tip/aculib/biz22.c | 159 + usr.bin/tip/aculib/biz31.c | 221 + usr.bin/tip/aculib/courier.c | 355 + usr.bin/tip/aculib/df.c | 105 + usr.bin/tip/aculib/dn11.c | 114 + usr.bin/tip/aculib/hayes.c | 284 + usr.bin/tip/aculib/penril.c | 225 + usr.bin/tip/aculib/v3451.c | 182 + usr.bin/tip/aculib/v831.c | 233 + usr.bin/tip/aculib/ventel.c | 223 + usr.bin/tip/acutab.c | 70 + usr.bin/tip/cmds.c | 858 + usr.bin/tip/cmdtab.c | 37 + usr.bin/tip/cu.c | 106 + usr.bin/tip/hunt.c | 68 + usr.bin/tip/log.c | 59 + usr.bin/tip/partab.c | 31 + usr.bin/tip/phones-file | 17 + usr.bin/tip/remcap.c | 398 + usr.bin/tip/remote-file | 107 + usr.bin/tip/remote.c | 167 + usr.bin/tip/tip.c | 571 + usr.bin/tip/tip.h | 244 + usr.bin/tip/tipout.c | 127 + usr.bin/tip/uucplock.c | 218 + usr.bin/tip/value.c | 321 + usr.bin/tip/vars.c | 84 + usr.bin/tk.c | 247 + usr.bin/touch.c | 125 + usr.bin/tr.c | 137 + usr.bin/tsort.c | 206 + usr.bin/tty.c | 19 + usr.bin/uname/Makefile | 37 + usr.bin/uname/uname.1 | 90 + usr.bin/uname/uname.c | 161 + usr.bin/uniq.c | 143 + usr.bin/units.c | 469 + usr.bin/uucp/CHANGES | 166 + usr.bin/uucp/Makefile | 173 + usr.bin/uucp/README | 216 + usr.bin/uucp/README.TCP | 56 + usr.bin/uucp/README.dialino | 28 + usr.bin/uucp/UUAIDS/L-devices | 63 + usr.bin/uucp/UUAIDS/L-dialcodes | 15 + usr.bin/uucp/UUAIDS/L.aliases | 19 + usr.bin/uucp/UUAIDS/L.cmds | 25 + usr.bin/uucp/UUAIDS/L.sys | 121 + usr.bin/uucp/UUAIDS/Notes.L.sys | 84 + usr.bin/uucp/UUAIDS/USERFILE | 12 + usr.bin/uucp/UUAIDS/setup.tblms | 269 + usr.bin/uucp/UUAIDS/uu.daily | 33 + usr.bin/uucp/UUAIDS/uu.daily.seism | 36 + usr.bin/uucp/UUAIDS/uu.hourly | 10 + usr.bin/uucp/UUAIDS/uu.weekly | 4 + usr.bin/uucp/UUAIDS/uucp.daily | 89 + usr.bin/uucp/UUAIDS/uucpsrv.c | 41 + usr.bin/uucp/UUAIDS/uucpsummary | 240 + usr.bin/uucp/UUAIDS/uucpsummary.mo | 130 + usr.bin/uucp/UUAIDS/uurate | 37 + usr.bin/uucp/UUAIDS/uutbl | 42 + usr.bin/uucp/UUAIDS/uuusage | 272 + usr.bin/uucp/acucntrl.8 | 132 + usr.bin/uucp/acucntrl.c | 774 + usr.bin/uucp/aculib/Makefile | 19 + usr.bin/uucp/aculib/att2224.c | 156 + usr.bin/uucp/aculib/bsdtcp.c | 96 + usr.bin/uucp/aculib/cds224.c | 110 + usr.bin/uucp/aculib/df12.c | 156 + usr.bin/uucp/aculib/df2.c | 146 + usr.bin/uucp/aculib/dk.c | 42 + usr.bin/uucp/aculib/dn.c | 144 + usr.bin/uucp/aculib/hys.c | 191 + usr.bin/uucp/aculib/hys24.c | 126 + usr.bin/uucp/aculib/hysq.c | 159 + usr.bin/uucp/aculib/mic.c | 110 + usr.bin/uucp/aculib/nov.c | 122 + usr.bin/uucp/aculib/pen.c | 103 + usr.bin/uucp/aculib/pnet.c | 47 + usr.bin/uucp/aculib/rvmacs.c | 183 + usr.bin/uucp/aculib/sy.c | 163 + usr.bin/uucp/aculib/unet.c | 66 + usr.bin/uucp/aculib/va212.c | 126 + usr.bin/uucp/aculib/va811.c | 123 + usr.bin/uucp/aculib/va820.c | 167 + usr.bin/uucp/aculib/vad.c | 132 + usr.bin/uucp/aculib/vent.c | 100 + usr.bin/uucp/aculib/vmacs.c | 168 + usr.bin/uucp/anlwrk.c | 361 + usr.bin/uucp/anyread.c | 25 + usr.bin/uucp/assert.c | 51 + usr.bin/uucp/cfgets.c | 60 + usr.bin/uucp/chkpth.c | 249 + usr.bin/uucp/chksum.c | 56 + usr.bin/uucp/cico.c | 896 + usr.bin/uucp/cntrl.c | 941 + usr.bin/uucp/condevs.c | 564 + usr.bin/uucp/condevs.h | 114 + usr.bin/uucp/conn.c | 1142 + usr.bin/uucp/cpmv.c | 72 + usr.bin/uucp/expfile.c | 127 + usr.bin/uucp/fio.c | 549 + usr.bin/uucp/gename.c | 85 + usr.bin/uucp/getargs.c | 98 + usr.bin/uucp/getprm.c | 67 + usr.bin/uucp/getpwinfo.c | 67 + usr.bin/uucp/gio.c | 236 + usr.bin/uucp/gnamef.c | 41 + usr.bin/uucp/gnsys.c | 136 + usr.bin/uucp/gnxseq.c | 122 + usr.bin/uucp/imsg.c | 101 + usr.bin/uucp/lastpart.c | 26 + usr.bin/uucp/logent.c | 235 + usr.bin/uucp/mailst.c | 104 + usr.bin/uucp/pk.h | 128 + usr.bin/uucp/pk0.c | 573 + usr.bin/uucp/pk1.c | 430 + usr.bin/uucp/prefix.c | 41 + usr.bin/uucp/setline.c | 50 + usr.bin/uucp/subdir.c | 108 + usr.bin/uucp/sysacct.c | 19 + usr.bin/uucp/systat.c | 149 + usr.bin/uucp/tio.c | 264 + usr.bin/uucp/ulockf.c | 197 + usr.bin/uucp/uuclean.c | 231 + usr.bin/uucp/uucp.c | 467 + usr.bin/uucp/uucp.h | 416 + usr.bin/uucp/uucpd.c | 305 + usr.bin/uucp/uucpdefs.c | 31 + usr.bin/uucp/uucpname.c | 226 + usr.bin/uucp/uudecode.c | 183 + usr.bin/uucp/uuencode.c | 109 + usr.bin/uucp/uulog.c | 94 + usr.bin/uucp/uuname.c | 78 + usr.bin/uucp/uupoll.c | 79 + usr.bin/uucp/uuq.c | 378 + usr.bin/uucp/uusend.c | 364 + usr.bin/uucp/uusnap.c | 318 + usr.bin/uucp/uust.h | 8 + usr.bin/uucp/uusub.h | 4 + usr.bin/uucp/uux.c | 548 + usr.bin/uucp/uuxqt.c | 717 + usr.bin/uucp/versys.c | 114 + usr.bin/uucp/vms.tar.Z | Bin 0 -> 36070 bytes usr.bin/uucp/xqt.c | 112 + usr.bin/whereis/Makefile | 37 + usr.bin/whereis/whereis.1 | 61 + usr.bin/whereis/whereis.c | 117 + usr.bin/xargs/Makefile | 33 + usr.bin/xargs/pathnames.h | 36 + usr.bin/xargs/xargs.1 | 169 + usr.bin/xargs/xargs.c | 337 + usr.bin/xinstall/Makefile | 38 + usr.bin/xinstall/install.1 | 124 + usr.bin/xinstall/pathnames.h | 36 + usr.bin/xinstall/xinstall.c | 342 + usr.bin/yacc/Makefile | 24 + usr.bin/yacc/dextern | 262 + usr.bin/yacc/files | 20 + usr.bin/yacc/y1.c | 658 + usr.bin/yacc/y2.c | 866 + usr.bin/yacc/y3.c | 413 + usr.bin/yacc/y4.c | 329 + usr.bin/yacc/yaccdiffs | 198 + usr.bin/yacc/yaccnews | 149 + usr.bin/yacc/yaccpar | 153 + usr.lib/MANIFEST | 30 + usr.lib/Makefile | 54 + usr.lib/PORT/libg.tar.Z | Bin 0 -> 818 bytes usr.lib/PORT/libm.tar.Z | Bin 0 -> 119522 bytes usr.lib/PORT/libpc.tar.Z | Bin 0 -> 52137 bytes usr.lib/lib2648/2648.h | 60 + usr.lib/lib2648/Makefile | 44 + usr.lib/lib2648/agoto.c | 31 + usr.lib/lib2648/aminmax.c | 44 + usr.lib/lib2648/aon.c | 25 + usr.lib/lib2648/areaclear.c | 38 + usr.lib/lib2648/beep.c | 17 + usr.lib/lib2648/bit.h | 25 + usr.lib/lib2648/bitcopy.c | 28 + usr.lib/lib2648/cleara.c | 18 + usr.lib/lib2648/clearg.c | 18 + usr.lib/lib2648/curon.c | 31 + usr.lib/lib2648/dispmsg.c | 44 + usr.lib/lib2648/draw.c | 30 + usr.lib/lib2648/drawbox.c | 31 + usr.lib/lib2648/dumpmat.c | 39 + usr.lib/lib2648/emptyrow.c | 32 + usr.lib/lib2648/error.c | 20 + usr.lib/lib2648/escseq.c | 58 + usr.lib/lib2648/gdefault.c | 21 + usr.lib/lib2648/gon.c | 25 + usr.lib/lib2648/kon.c | 27 + usr.lib/lib2648/line.c | 34 + usr.lib/lib2648/mat.c | 29 + usr.lib/lib2648/message.c | 21 + usr.lib/lib2648/minmax.c | 46 + usr.lib/lib2648/motion.c | 45 + usr.lib/lib2648/move.c | 26 + usr.lib/lib2648/movecurs.c | 25 + usr.lib/lib2648/newmat.c | 40 + usr.lib/lib2648/outchar.c | 53 + usr.lib/lib2648/outstr.c | 22 + usr.lib/lib2648/printg.c | 41 + usr.lib/lib2648/rawchar.c | 46 + usr.lib/lib2648/rbon.c | 26 + usr.lib/lib2648/rdchar.c | 35 + usr.lib/lib2648/readline.c | 72 + usr.lib/lib2648/set.c | 30 + usr.lib/lib2648/setmat.c | 37 + usr.lib/lib2648/sync.c | 43 + usr.lib/lib2648/texton.c | 32 + usr.lib/lib2648/ttyinit.c | 66 + usr.lib/lib2648/update.c | 81 + usr.lib/lib2648/video.c | 28 + usr.lib/lib2648/zermat.c | 26 + usr.lib/lib2648/zoomn.c | 20 + usr.lib/lib2648/zoomon.c | 23 + usr.lib/lib2648/zoomout.c | 18 + usr.lib/libF77/Makefile | 391 + usr.lib/libF77/NEWS | 31 + usr.lib/libF77/READ_ME | 22 + usr.lib/libF77/Revision | 8 + usr.lib/libF77/Test_float | 52 + usr.lib/libF77/Usef.c | 38 + usr.lib/libF77/Version.c | 131 + usr.lib/libF77/abort_.c | 27 + usr.lib/libF77/besj0_.c | 15 + usr.lib/libF77/besj1_.c | 15 + usr.lib/libF77/besjn_.c | 15 + usr.lib/libF77/besy0_.c | 15 + usr.lib/libF77/besy1_.c | 15 + usr.lib/libF77/besyn_.c | 15 + usr.lib/libF77/c_abs.c | 17 + usr.lib/libF77/c_cos.c | 18 + usr.lib/libF77/c_div.c | 43 + usr.lib/libF77/c_exp.c | 20 + usr.lib/libF77/c_log.c | 18 + usr.lib/libF77/c_sin.c | 18 + usr.lib/libF77/c_sqrt.c | 30 + usr.lib/libF77/complex | 2 + usr.lib/libF77/d_abs.c | 15 + usr.lib/libF77/d_acos.c | 14 + usr.lib/libF77/d_asin.c | 14 + usr.lib/libF77/d_atan.c | 14 + usr.lib/libF77/d_atn2.c | 14 + usr.lib/libF77/d_cnjg.c | 16 + usr.lib/libF77/d_cos.c | 14 + usr.lib/libF77/d_cosh.c | 14 + usr.lib/libF77/d_dim.c | 13 + usr.lib/libF77/d_dprod.c | 14 + usr.lib/libF77/d_exp.c | 14 + usr.lib/libF77/d_imag.c | 15 + usr.lib/libF77/d_int.c | 15 + usr.lib/libF77/d_lg10.c | 15 + usr.lib/libF77/d_log.c | 14 + usr.lib/libF77/d_mod.c | 18 + usr.lib/libF77/d_nint.c | 16 + usr.lib/libF77/d_prod.c | 13 + usr.lib/libF77/d_sign.c | 15 + usr.lib/libF77/d_sin.c | 14 + usr.lib/libF77/d_sinh.c | 14 + usr.lib/libF77/d_tan.c | 14 + usr.lib/libF77/d_tanh.c | 14 + usr.lib/libF77/dbesj0_.c | 15 + usr.lib/libF77/dbesj1_.c | 15 + usr.lib/libF77/dbesjn_.c | 15 + usr.lib/libF77/dbesy0_.c | 15 + usr.lib/libF77/dbesy1_.c | 15 + usr.lib/libF77/dbesyn_.c | 15 + usr.lib/libF77/derf_.c | 15 + usr.lib/libF77/derfc_.c | 15 + usr.lib/libF77/ef1asc_.c | 19 + usr.lib/libF77/ef1cmc_.c | 16 + usr.lib/libF77/erf_.c | 15 + usr.lib/libF77/erfc_.c | 15 + usr.lib/libF77/exit_.c | 24 + usr.lib/libF77/h_abs.c | 15 + usr.lib/libF77/h_dim.c | 13 + usr.lib/libF77/h_dnnt.c | 16 + usr.lib/libF77/h_indx.c | 30 + usr.lib/libF77/h_len.c | 14 + usr.lib/libF77/h_mod.c | 13 + usr.lib/libF77/h_nint.c | 16 + usr.lib/libF77/h_sign.c | 15 + usr.lib/libF77/hl_ge.c | 14 + usr.lib/libF77/hl_gt.c | 14 + usr.lib/libF77/hl_le.c | 14 + usr.lib/libF77/hl_lt.c | 14 + usr.lib/libF77/i_abs.c | 15 + usr.lib/libF77/i_dim.c | 13 + usr.lib/libF77/i_dnnt.c | 16 + usr.lib/libF77/i_indx.c | 30 + usr.lib/libF77/i_len.c | 14 + usr.lib/libF77/i_mod.c | 13 + usr.lib/libF77/i_nint.c | 16 + usr.lib/libF77/i_sign.c | 15 + usr.lib/libF77/l_ge.c | 14 + usr.lib/libF77/l_gt.c | 14 + usr.lib/libF77/l_le.c | 14 + usr.lib/libF77/l_lt.c | 14 + usr.lib/libF77/lnblnk_.c | 25 + usr.lib/libF77/long_.c | 20 + usr.lib/libF77/main.c | 116 + usr.lib/libF77/mkindx | Bin 0 -> 21504 bytes usr.lib/libF77/mkindx.c | 58 + usr.lib/libF77/mkvers | Bin 0 -> 13316 bytes usr.lib/libF77/mkvers.c | 79 + usr.lib/libF77/opcodes.h | 53 + usr.lib/libF77/operand.h | 63 + usr.lib/libF77/pow_ci.c | 24 + usr.lib/libF77/pow_dd.c | 15 + usr.lib/libF77/pow_di.c | 42 + usr.lib/libF77/pow_hh.c | 60 + usr.lib/libF77/pow_ii.c | 64 + usr.lib/libF77/pow_ri.c | 46 + usr.lib/libF77/pow_zi.c | 53 + usr.lib/libF77/pow_zz.c | 25 + usr.lib/libF77/profiled/Version | Bin 0 -> 8252 bytes usr.lib/libF77/r_abs.c | 15 + usr.lib/libF77/r_acos.c | 14 + usr.lib/libF77/r_asin.c | 14 + usr.lib/libF77/r_atan.c | 14 + usr.lib/libF77/r_atn2.c | 14 + usr.lib/libF77/r_cnjg.c | 16 + usr.lib/libF77/r_cos.c | 14 + usr.lib/libF77/r_cosh.c | 14 + usr.lib/libF77/r_dim.c | 16 + usr.lib/libF77/r_exp.c | 14 + usr.lib/libF77/r_imag.c | 15 + usr.lib/libF77/r_int.c | 15 + usr.lib/libF77/r_lg10.c | 15 + usr.lib/libF77/r_log.c | 14 + usr.lib/libF77/r_mod.c | 21 + usr.lib/libF77/r_nint.c | 18 + usr.lib/libF77/r_sign.c | 15 + usr.lib/libF77/r_sin.c | 14 + usr.lib/libF77/r_sinh.c | 14 + usr.lib/libF77/r_sqrt.c | 14 + usr.lib/libF77/r_tan.c | 14 + usr.lib/libF77/r_tanh.c | 14 + usr.lib/libF77/rand_.c | 56 + usr.lib/libF77/rand_.c.other | 22 + usr.lib/libF77/rand_.s.vax | 104 + usr.lib/libF77/random_.c | 51 + usr.lib/libF77/range.c | 129 + usr.lib/libF77/rindex_.c | 37 + usr.lib/libF77/s_cat.c | 29 + usr.lib/libF77/s_cmp.c | 44 + usr.lib/libF77/s_copy.c | 29 + usr.lib/libF77/s_paus.c | 55 + usr.lib/libF77/s_rnge.c | 28 + usr.lib/libF77/s_stop.c | 27 + usr.lib/libF77/short_.c | 22 + usr.lib/libF77/signal_.c | 65 + usr.lib/libF77/subout.c | 26 + usr.lib/libF77/test/fpetst.f | 42 + usr.lib/libF77/traper_.c | 37 + usr.lib/libF77/trapov_.c | 671 + usr.lib/libF77/trpfpe_.c | 532 + usr.lib/libF77/z_cos.c | 18 + usr.lib/libF77/z_div.c | 43 + usr.lib/libF77/z_exp.c | 20 + usr.lib/libF77/z_log.c | 18 + usr.lib/libF77/z_sin.c | 18 + usr.lib/libF77/z_sqrt.c | 30 + usr.lib/libI77/Makefile | 206 + usr.lib/libI77/NEWS | 182 + usr.lib/libI77/READ_ME | 22 + usr.lib/libI77/Version | Bin 0 -> 2306 bytes usr.lib/libI77/Version.c | 37 + usr.lib/libI77/backspace.c | 64 + usr.lib/libI77/c_dfe.c | 69 + usr.lib/libI77/c_iio.c | 167 + usr.lib/libI77/c_sfe.c | 71 + usr.lib/libI77/close.c | 88 + usr.lib/libI77/dofio.c | 161 + usr.lib/libI77/dolio.c | 42 + usr.lib/libI77/douio.c | 73 + usr.lib/libI77/due.c | 76 + usr.lib/libI77/endfile.c | 37 + usr.lib/libI77/err.c | 175 + usr.lib/libI77/f77_abort.c | 67 + usr.lib/libI77/f_errlist.c | 43 + usr.lib/libI77/f_errno.h | 47 + usr.lib/libI77/fio.h | 43 + usr.lib/libI77/fiodefs.h | 150 + usr.lib/libI77/fmt.c | 377 + usr.lib/libI77/fmtlib.c | 97 + usr.lib/libI77/format.h | 87 + usr.lib/libI77/inquire.c | 127 + usr.lib/libI77/libI66.c | 21 + usr.lib/libI77/lio.h | 68 + usr.lib/libI77/lread.c | 432 + usr.lib/libI77/lwrite.c | 220 + usr.lib/libI77/mkindx | Bin 0 -> 21504 bytes usr.lib/libI77/mkindx.c | 58 + usr.lib/libI77/mkvers | Bin 0 -> 13316 bytes usr.lib/libI77/mkvers.c | 79 + usr.lib/libI77/nmlio.h | 49 + usr.lib/libI77/open.c | 244 + usr.lib/libI77/profiled/Version | Bin 0 -> 2306 bytes usr.lib/libI77/rdfe.c | 85 + usr.lib/libI77/rdfmt.c | 338 + usr.lib/libI77/rewind.c | 36 + usr.lib/libI77/rfi.c | 62 + usr.lib/libI77/rsfe.c | 72 + usr.lib/libI77/rsli.c | 33 + usr.lib/libI77/rsnmle.c | 613 + usr.lib/libI77/sue.c | 86 + usr.lib/libI77/test/f2.f | 33 + usr.lib/libI77/test/fmtst.f | 6 + usr.lib/libI77/test/ioitst.f | 37 + usr.lib/libI77/test/nmlist.data | 36 + usr.lib/libI77/test/nmlist.f | 62 + usr.lib/libI77/test/nmlist.log | 161 + usr.lib/libI77/test/pe.f | 4 + usr.lib/libI77/test/trunctst.f | 19 + usr.lib/libI77/test/try_env.f | 18 + usr.lib/libI77/util.c | 75 + usr.lib/libI77/wdfe.c | 63 + usr.lib/libI77/wfi.c | 64 + usr.lib/libI77/wrtfmt.c | 305 + usr.lib/libI77/wsfe.c | 88 + usr.lib/libI77/wsli.c | 31 + usr.lib/libI77/wsnmle.c | 92 + usr.lib/libU77/Makefile | 200 + usr.lib/libU77/NEWS | 5 + usr.lib/libU77/READ_ME | 29 + usr.lib/libU77/Version | Bin 0 -> 3454 bytes usr.lib/libU77/Version.c | 54 + usr.lib/libU77/access_.c | 59 + usr.lib/libU77/alarm_.c | 38 + usr.lib/libU77/chdir_.c | 38 + usr.lib/libU77/chmod_.c | 47 + usr.lib/libU77/ctime_.c | 28 + usr.lib/libU77/dtime_.c | 43 + usr.lib/libU77/etime_.c | 38 + usr.lib/libU77/f77lid_.c | 17 + usr.lib/libU77/fdate_.c | 31 + usr.lib/libU77/fgetc_.c | 48 + usr.lib/libU77/fork_.c | 35 + usr.lib/libU77/fputc_.c | 46 + usr.lib/libU77/fseek_.c | 41 + usr.lib/libU77/fstat_.c | 52 + usr.lib/libU77/ftell_.c | 35 + usr.lib/libU77/gerror_.c | 38 + usr.lib/libU77/getarg_.c | 37 + usr.lib/libU77/getc_.c | 46 + usr.lib/libU77/getcwd_.c | 42 + usr.lib/libU77/getenv_.c | 46 + usr.lib/libU77/getgid_.c | 22 + usr.lib/libU77/getlog_.c | 30 + usr.lib/libU77/getpid_.c | 22 + usr.lib/libU77/getuid_.c | 22 + usr.lib/libU77/gmtime_.c | 32 + usr.lib/libU77/hostnm_.c | 39 + usr.lib/libU77/iargc_.c | 23 + usr.lib/libU77/idate_.c | 33 + usr.lib/libU77/ierrno_.c | 23 + usr.lib/libU77/ioinit.f | 109 + usr.lib/libU77/isatty_.c | 35 + usr.lib/libU77/itime_.c | 33 + usr.lib/libU77/kill_.c | 30 + usr.lib/libU77/link_.c | 42 + usr.lib/libU77/loc_.c | 22 + usr.lib/libU77/lstat_.c | 53 + usr.lib/libU77/ltime_.c | 32 + usr.lib/libU77/malloc_.c | 60 + usr.lib/libU77/mkindx | Bin 0 -> 21504 bytes usr.lib/libU77/mkindx.c | 58 + usr.lib/libU77/mkvers | Bin 0 -> 13316 bytes usr.lib/libU77/mkvers.c | 79 + usr.lib/libU77/perror_.c | 45 + usr.lib/libU77/profiled/Version | Bin 0 -> 3454 bytes usr.lib/libU77/putc_.c | 44 + usr.lib/libU77/qsort_.c | 36 + usr.lib/libU77/rename_.c | 43 + usr.lib/libU77/sleep_.c | 22 + usr.lib/libU77/stat_.c | 52 + usr.lib/libU77/symlnk_.c | 43 + usr.lib/libU77/system_.c | 79 + usr.lib/libU77/tapeio.c | 425 + usr.lib/libU77/test/actst.f | 11 + usr.lib/libU77/test/argtst.f | 11 + usr.lib/libU77/test/bitst.f | 9 + usr.lib/libU77/test/chdtst.f | 19 + usr.lib/libU77/test/datst.f | 7 + usr.lib/libU77/test/def | 0 usr.lib/libU77/test/ertst.f | 20 + usr.lib/libU77/test/fktst.f | 41 + usr.lib/libU77/test/flid.f | 3 + usr.lib/libU77/test/gpctst.f | 24 + usr.lib/libU77/test/gwdtst.f | 9 + usr.lib/libU77/test/idtst.f | 5 + usr.lib/libU77/test/loctst.f | 5 + usr.lib/libU77/test/makefile | 9 + usr.lib/libU77/test/rngtst.f | 3 + usr.lib/libU77/test/rnmtst.f | 10 + usr.lib/libU77/test/seektst.f | 16 + usr.lib/libU77/test/serrno_.c | 4 + usr.lib/libU77/test/sigfpe.f | 4 + usr.lib/libU77/test/sigfpe.s | 32 + usr.lib/libU77/test/sigtrtst.f | 13 + usr.lib/libU77/test/sigtst.f | 26 + usr.lib/libU77/test/sortst.f | 19 + usr.lib/libU77/test/statst.f | 9 + usr.lib/libU77/test/syml.f | 6 + usr.lib/libU77/test/systst.f | 5 + usr.lib/libU77/test/taptst.f | 178 + usr.lib/libU77/test/timtst.f | 7 + usr.lib/libU77/test/ttnam.f | 4 + usr.lib/libU77/time_.c | 24 + usr.lib/libU77/ttynam_.c | 35 + usr.lib/libU77/unlink_.c | 39 + usr.lib/libU77/wait_.c | 33 + usr.lib/libcurses/Makefile | 72 + usr.lib/libcurses/addch.c | 105 + usr.lib/libcurses/addstr.c | 28 + usr.lib/libcurses/box.c | 38 + usr.lib/libcurses/clear.c | 23 + usr.lib/libcurses/clrtobot.c | 39 + usr.lib/libcurses/clrtoeol.c | 44 + usr.lib/libcurses/cr_put.c | 390 + usr.lib/libcurses/cr_tty.c | 203 + usr.lib/libcurses/curses.c | 53 + usr.lib/libcurses/curses.ext | 31 + usr.lib/libcurses/curses.h | 170 + usr.lib/libcurses/delch.c | 33 + usr.lib/libcurses/deleteln.c | 47 + usr.lib/libcurses/delwin.c | 52 + usr.lib/libcurses/endwin.c | 30 + usr.lib/libcurses/erase.c | 42 + usr.lib/libcurses/fullname.c | 38 + usr.lib/libcurses/getch.c | 45 + usr.lib/libcurses/getstr.c | 29 + usr.lib/libcurses/id_subwins.c | 38 + usr.lib/libcurses/idlok.c | 27 + usr.lib/libcurses/initscr.c | 70 + usr.lib/libcurses/insch.c | 41 + usr.lib/libcurses/insertln.c | 47 + usr.lib/libcurses/longname.c | 33 + usr.lib/libcurses/move.c | 31 + usr.lib/libcurses/mvprintw.c | 34 + usr.lib/libcurses/mvscanw.c | 34 + usr.lib/libcurses/mvwin.c | 51 + usr.lib/libcurses/newwin.c | 208 + usr.lib/libcurses/overlay.c | 57 + usr.lib/libcurses/overwrite.c | 45 + usr.lib/libcurses/printw.c | 61 + usr.lib/libcurses/putchar.c | 21 + usr.lib/libcurses/refresh.c | 308 + usr.lib/libcurses/scanw.c | 60 + usr.lib/libcurses/scroll.c | 42 + usr.lib/libcurses/standout.c | 44 + usr.lib/libcurses/test.c | 26 + usr.lib/libcurses/toucholap.c | 46 + usr.lib/libcurses/touchwin.c | 56 + usr.lib/libcurses/tstp.c | 60 + usr.lib/libcurses/unctrl.c | 28 + usr.lib/libdbm/Makefile | 34 + usr.lib/libdbm/dbm.c | 109 + usr.lib/libdbm/dbm.h | 28 + usr.lib/liberrlst/Makefile | 30 + usr.lib/liberrlst/errlst.c | 139 + usr.lib/libident/INSTALL | 14 + usr.lib/libident/Makefile | 58 + usr.lib/libident/README | 62 + usr.lib/libident/id_close.c | 29 + usr.lib/libident/id_open.c | 160 + usr.lib/libident/id_parse.c | 219 + usr.lib/libident/id_query.c | 81 + usr.lib/libident/ident-tester.c | 245 + usr.lib/libident/ident.3 | 276 + usr.lib/libident/ident.c | 152 + usr.lib/libident/ident.h | 194 + usr.lib/libident/lookup-tester.c | 73 + usr.lib/libident/support.c | 86 + usr.lib/libident/version.c | 1 + usr.lib/libln/Makefile | 26 + usr.lib/libln/allprint.c | 39 + usr.lib/libln/main.c | 7 + usr.lib/libln/reject.c | 52 + usr.lib/libln/yyless.c | 20 + usr.lib/libln/yywrap.c | 6 + usr.lib/libmp/Makefile | 23 + usr.lib/libmp/gcd.c | 56 + usr.lib/libmp/madd.c | 156 + usr.lib/libmp/mdiv.c | 117 + usr.lib/libmp/mout.c | 151 + usr.lib/libmp/msqrt.c | 47 + usr.lib/libmp/mult.c | 97 + usr.lib/libmp/pow.c | 50 + usr.lib/libmp/util.c | 98 + usr.lib/libom/Makefile | 44 + usr.lib/libom/asin.c | 50 + usr.lib/libom/atan.c | 113 + usr.lib/libom/erf.c | 118 + usr.lib/libom/exp.c | 47 + usr.lib/libom/floor.c | 32 + usr.lib/libom/gamma.c | 118 + usr.lib/libom/hypot.c | 43 + usr.lib/libom/j0.c | 189 + usr.lib/libom/j1.c | 195 + usr.lib/libom/jn.c | 109 + usr.lib/libom/log.c | 64 + usr.lib/libom/pow.c | 41 + usr.lib/libom/sin.c | 76 + usr.lib/libom/sinh.c | 69 + usr.lib/libom/sqrt.c | 58 + usr.lib/libom/tan.c | 75 + usr.lib/libom/tanh.c | 29 + usr.lib/libplot/Makefile | 68 + usr.lib/libplot/aed/Makefile | 19 + usr.lib/libplot/aed/aed.h | 27 + usr.lib/libplot/aed/arc.c | 13 + usr.lib/libplot/aed/box.c | 20 + usr.lib/libplot/aed/circle.c | 34 + usr.lib/libplot/aed/close.c | 29 + usr.lib/libplot/aed/cont.c | 25 + usr.lib/libplot/aed/dot.c | 13 + usr.lib/libplot/aed/erase.c | 29 + usr.lib/libplot/aed/label.c | 36 + usr.lib/libplot/aed/line.c | 27 + usr.lib/libplot/aed/linemod.c | 38 + usr.lib/libplot/aed/move.c | 26 + usr.lib/libplot/aed/open.c | 81 + usr.lib/libplot/aed/point.c | 34 + usr.lib/libplot/aed/space.c | 39 + usr.lib/libplot/aed/subr.c | 98 + usr.lib/libplot/bitgraph/Makefile | 20 + usr.lib/libplot/bitgraph/arc.c | 96 + usr.lib/libplot/bitgraph/bg.h | 29 + usr.lib/libplot/bitgraph/box.c | 20 + usr.lib/libplot/bitgraph/circle.c | 17 + usr.lib/libplot/bitgraph/close.c | 24 + usr.lib/libplot/bitgraph/cont.c | 21 + usr.lib/libplot/bitgraph/dot.c | 13 + usr.lib/libplot/bitgraph/erase.c | 20 + usr.lib/libplot/bitgraph/label.c | 16 + usr.lib/libplot/bitgraph/line.c | 25 + usr.lib/libplot/bitgraph/linemod.c | 13 + usr.lib/libplot/bitgraph/move.c | 21 + usr.lib/libplot/bitgraph/open.c | 35 + usr.lib/libplot/bitgraph/point.c | 17 + usr.lib/libplot/bitgraph/space.c | 23 + usr.lib/libplot/dumb/Makefile | 20 + usr.lib/libplot/dumb/arc.c | 16 + usr.lib/libplot/dumb/box.c | 19 + usr.lib/libplot/dumb/circle.c | 12 + usr.lib/libplot/dumb/close.c | 26 + usr.lib/libplot/dumb/cont.c | 21 + usr.lib/libplot/dumb/dot.c | 12 + usr.lib/libplot/dumb/dumb.h | 30 + usr.lib/libplot/dumb/erase.c | 20 + usr.lib/libplot/dumb/label.c | 23 + usr.lib/libplot/dumb/line.c | 26 + usr.lib/libplot/dumb/linemod.c | 14 + usr.lib/libplot/dumb/move.c | 19 + usr.lib/libplot/dumb/open.c | 59 + usr.lib/libplot/dumb/point.c | 20 + usr.lib/libplot/dumb/space.c | 20 + usr.lib/libplot/dumb/subr.c | 49 + usr.lib/libplot/gigi/Makefile | 20 + usr.lib/libplot/gigi/arc.c | 49 + usr.lib/libplot/gigi/box.c | 19 + usr.lib/libplot/gigi/circle.c | 22 + usr.lib/libplot/gigi/close.c | 24 + usr.lib/libplot/gigi/cont.c | 19 + usr.lib/libplot/gigi/dot.c | 12 + usr.lib/libplot/gigi/erase.c | 16 + usr.lib/libplot/gigi/gigi.h | 33 + usr.lib/libplot/gigi/label.c | 22 + usr.lib/libplot/gigi/line.c | 24 + usr.lib/libplot/gigi/linemod.c | 71 + usr.lib/libplot/gigi/move.c | 19 + usr.lib/libplot/gigi/open.c | 40 + usr.lib/libplot/gigi/point.c | 19 + usr.lib/libplot/gigi/space.c | 20 + usr.lib/libplot/hp2648/Makefile | 20 + usr.lib/libplot/hp2648/arc.c | 55 + usr.lib/libplot/hp2648/box.c | 19 + usr.lib/libplot/hp2648/circle.c | 33 + usr.lib/libplot/hp2648/close.c | 21 + usr.lib/libplot/hp2648/cont.c | 26 + usr.lib/libplot/hp2648/dot.c | 12 + usr.lib/libplot/hp2648/erase.c | 24 + usr.lib/libplot/hp2648/hp2648.h | 50 + usr.lib/libplot/hp2648/label.c | 32 + usr.lib/libplot/hp2648/line.c | 24 + usr.lib/libplot/hp2648/linemod.c | 78 + usr.lib/libplot/hp2648/move.c | 27 + usr.lib/libplot/hp2648/open.c | 51 + usr.lib/libplot/hp2648/point.c | 20 + usr.lib/libplot/hp2648/space.c | 20 + usr.lib/libplot/hp2648/subr.c | 57 + usr.lib/libplot/hp7221/Makefile | 20 + usr.lib/libplot/hp7221/arc.c | 51 + usr.lib/libplot/hp7221/box.c | 19 + usr.lib/libplot/hp7221/circle.c | 23 + usr.lib/libplot/hp7221/close.c | 20 + usr.lib/libplot/hp7221/cont.c | 20 + usr.lib/libplot/hp7221/dot.c | 12 + usr.lib/libplot/hp7221/erase.c | 12 + usr.lib/libplot/hp7221/hp7221.h | 34 + usr.lib/libplot/hp7221/label.c | 18 + usr.lib/libplot/hp7221/line.c | 24 + usr.lib/libplot/hp7221/linemod.c | 70 + usr.lib/libplot/hp7221/move.c | 20 + usr.lib/libplot/hp7221/open.c | 44 + usr.lib/libplot/hp7221/point.c | 19 + usr.lib/libplot/hp7221/space.c | 22 + usr.lib/libplot/hp7221/subr.c | 75 + usr.lib/libplot/imagen/Makefile | 28 + usr.lib/libplot/imagen/arc.c | 119 + usr.lib/libplot/imagen/box.c | 19 + usr.lib/libplot/imagen/charset.c | 13 + usr.lib/libplot/imagen/circle.c | 13 + usr.lib/libplot/imagen/close.c | 17 + usr.lib/libplot/imagen/cont.c | 17 + usr.lib/libplot/imagen/dot.c | 12 + usr.lib/libplot/imagen/erase.c | 18 + usr.lib/libplot/imagen/imPcodes.h | 58 + usr.lib/libplot/imagen/imp.h | 18 + usr.lib/libplot/imagen/label.c | 27 + usr.lib/libplot/imagen/line.c | 40 + usr.lib/libplot/imagen/linemod.c | 42 + usr.lib/libplot/imagen/move.c | 15 + usr.lib/libplot/imagen/open.c | 41 + usr.lib/libplot/imagen/point.c | 13 + usr.lib/libplot/imagen/scale.c | 32 + usr.lib/libplot/imagen/space.c | 30 + usr.lib/libplot/plot/Makefile | 13 + usr.lib/libplot/plot/arc.c | 14 + usr.lib/libplot/plot/box.c | 13 + usr.lib/libplot/plot/circle.c | 11 + usr.lib/libplot/plot/close.c | 11 + usr.lib/libplot/plot/cont.c | 10 + usr.lib/libplot/plot/dot.c | 16 + usr.lib/libplot/plot/erase.c | 8 + usr.lib/libplot/plot/label.c | 13 + usr.lib/libplot/plot/line.c | 12 + usr.lib/libplot/plot/linmod.c | 13 + usr.lib/libplot/plot/move.c | 10 + usr.lib/libplot/plot/open.c | 8 + usr.lib/libplot/plot/point.c | 10 + usr.lib/libplot/plot/putsi.c | 9 + usr.lib/libplot/plot/space.c | 12 + usr.lib/libplot/t300/Makefile | 13 + usr.lib/libplot/t300/arc.c | 6 + usr.lib/libplot/t300/box.c | 13 + usr.lib/libplot/t300/circle.c | 6 + usr.lib/libplot/t300/close.c | 12 + usr.lib/libplot/t300/con.h | 29 + usr.lib/libplot/t300/dot.c | 6 + usr.lib/libplot/t300/erase.c | 11 + usr.lib/libplot/t300/label.c | 15 + usr.lib/libplot/t300/line.c | 49 + usr.lib/libplot/t300/linmod.c | 6 + usr.lib/libplot/t300/move.c | 8 + usr.lib/libplot/t300/open.c | 51 + usr.lib/libplot/t300/point.c | 9 + usr.lib/libplot/t300/space.c | 15 + usr.lib/libplot/t300/subr.c | 116 + usr.lib/libplot/t300s/Makefile | 13 + usr.lib/libplot/t300s/arc.c | 6 + usr.lib/libplot/t300s/box.c | 13 + usr.lib/libplot/t300s/circle.c | 6 + usr.lib/libplot/t300s/close.c | 12 + usr.lib/libplot/t300s/con.h | 37 + usr.lib/libplot/t300s/dot.c | 6 + usr.lib/libplot/t300s/erase.c | 11 + usr.lib/libplot/t300s/label.c | 15 + usr.lib/libplot/t300s/line.c | 45 + usr.lib/libplot/t300s/linmod.c | 6 + usr.lib/libplot/t300s/move.c | 8 + usr.lib/libplot/t300s/open.c | 51 + usr.lib/libplot/t300s/point.c | 10 + usr.lib/libplot/t300s/space.c | 15 + usr.lib/libplot/t300s/subr.c | 160 + usr.lib/libplot/t4013/Makefile | 17 + usr.lib/libplot/t4013/arc.c | 115 + usr.lib/libplot/t4013/box.c | 19 + usr.lib/libplot/t4013/circle.c | 13 + usr.lib/libplot/t4013/close.c | 19 + usr.lib/libplot/t4013/dot.c | 12 + usr.lib/libplot/t4013/erase.c | 22 + usr.lib/libplot/t4013/label.c | 18 + usr.lib/libplot/t4013/line.c | 14 + usr.lib/libplot/t4013/linemod.c | 15 + usr.lib/libplot/t4013/move.c | 14 + usr.lib/libplot/t4013/open.c | 15 + usr.lib/libplot/t4013/point.c | 14 + usr.lib/libplot/t4013/scale.c | 32 + usr.lib/libplot/t4013/space.c | 27 + usr.lib/libplot/t4013/subr.c | 54 + usr.lib/libplot/t4014/Makefile | 13 + usr.lib/libplot/t4014/arc.c | 109 + usr.lib/libplot/t4014/box.c | 13 + usr.lib/libplot/t4014/circle.c | 7 + usr.lib/libplot/t4014/close.c | 13 + usr.lib/libplot/t4014/dot.c | 6 + usr.lib/libplot/t4014/erase.c | 18 + usr.lib/libplot/t4014/label.c | 32 + usr.lib/libplot/t4014/line.c | 8 + usr.lib/libplot/t4014/linemod.c | 23 + usr.lib/libplot/t4014/move.c | 8 + usr.lib/libplot/t4014/open.c | 9 + usr.lib/libplot/t4014/point.c | 8 + usr.lib/libplot/t4014/scale.c | 26 + usr.lib/libplot/t4014/space.c | 21 + usr.lib/libplot/t4014/subr.c | 62 + usr.lib/libplot/t450/Makefile | 13 + usr.lib/libplot/t450/arc.c | 6 + usr.lib/libplot/t450/box.c | 13 + usr.lib/libplot/t450/circle.c | 6 + usr.lib/libplot/t450/close.c | 12 + usr.lib/libplot/t450/con.h | 31 + usr.lib/libplot/t450/dot.c | 6 + usr.lib/libplot/t450/erase.c | 11 + usr.lib/libplot/t450/label.c | 15 + usr.lib/libplot/t450/line.c | 49 + usr.lib/libplot/t450/linmod.c | 6 + usr.lib/libplot/t450/move.c | 8 + usr.lib/libplot/t450/open.c | 54 + usr.lib/libplot/t450/point.c | 9 + usr.lib/libplot/t450/space.c | 13 + usr.lib/libplot/t450/subr.c | 120 + usr.lib/libplot/tf77/Makefile | 18 + usr.lib/libplot/tf77/arc.c | 15 + usr.lib/libplot/tf77/box.c | 20 + usr.lib/libplot/tf77/circle.c | 15 + usr.lib/libplot/tf77/clospl.c | 13 + usr.lib/libplot/tf77/cont.c | 15 + usr.lib/libplot/tf77/dot.c | 15 + usr.lib/libplot/tf77/erase.c | 14 + usr.lib/libplot/tf77/label.c | 24 + usr.lib/libplot/tf77/line.c | 15 + usr.lib/libplot/tf77/linemd.c | 24 + usr.lib/libplot/tf77/move.c | 15 + usr.lib/libplot/tf77/open.c | 14 + usr.lib/libplot/tf77/point.c | 15 + usr.lib/libplot/tf77/space.c | 15 + usr.lib/libplot/vt0/Makefile | 13 + usr.lib/libplot/vt0/arc.c | 11 + usr.lib/libplot/vt0/box.c | 13 + usr.lib/libplot/vt0/circle.c | 11 + usr.lib/libplot/vt0/close.c | 11 + usr.lib/libplot/vt0/dot.c | 16 + usr.lib/libplot/vt0/erase.c | 10 + usr.lib/libplot/vt0/frame.c | 10 + usr.lib/libplot/vt0/label.c | 17 + usr.lib/libplot/vt0/line.c | 19 + usr.lib/libplot/vt0/linmod.c | 8 + usr.lib/libplot/vt0/move.c | 13 + usr.lib/libplot/vt0/open.c | 24 + usr.lib/libplot/vt0/point.c | 13 + usr.lib/libplot/vt0/space.c | 20 + usr.lib/libplot/vt0/subr.c | 20 + usr.lib/libstubs/Makefile | 30 + usr.lib/libstubs/stubs.c | 267 + usr.lib/libstubs/stubtest.c | 84 + usr.lib/libtermlib/Makefile | 50 + usr.lib/libtermlib/tc1.c | 30 + usr.lib/libtermlib/tc2.c | 57 + usr.lib/libtermlib/tc3.c | 82 + usr.lib/libtermlib/termcap.c | 349 + usr.lib/libtermlib/tgoto.c | 180 + usr.lib/libtermlib/tputs.c | 96 + usr.lib/libutil/Makefile | 57 + usr.lib/libutil/dkcksum.c | 53 + usr.lib/libutil/login.c | 46 + usr.lib/libutil/logout.c | 53 + usr.lib/libutil/logwtmp.c | 50 + usr.lib/libutil/pathnames.h | 24 + usr.lib/libvmf/makefile | 34 + usr.lib/libvmf/vmf.3 | 142 + usr.lib/libvmf/vmf.c | 372 + usr.lib/libvmf/vmlib.ms | 406 + usr.lib/liby/Makefile | 22 + usr.lib/liby/libmai.c | 15 + usr.lib/liby/libzer.c | 18 + usr.sbin/Makefile | 31 + usr.sbin/PORT/XNSrouted.tar.Z | Bin 0 -> 33017 bytes usr.sbin/PORT/bad144.c.Z | Bin 0 -> 6608 bytes usr.sbin/PORT/badsect.c.Z | Bin 0 -> 2191 bytes usr.sbin/PORT/diskpart.c.Z | Bin 0 -> 4937 bytes usr.sbin/PORT/dump.tar.Z | Bin 0 -> 33872 bytes usr.sbin/PORT/implog.tar.Z | Bin 0 -> 11899 bytes usr.sbin/PORT/kgmon.c.Z | Bin 0 -> 3692 bytes usr.sbin/PORT/restore.tar.Z | Bin 0 -> 60138 bytes usr.sbin/ac/Makefile | 37 + usr.sbin/ac/ac.8 | 65 + usr.sbin/ac/ac.c | 277 + usr.sbin/accton/Makefile | 37 + usr.sbin/accton/accton.8 | 65 + usr.sbin/accton/accton.c | 212 + usr.sbin/arff/Makefile | 39 + usr.sbin/arff/arff.8 | 141 + usr.sbin/arff/arff.c | 5 + usr.sbin/arp/Makefile | 37 + usr.sbin/arp/arp.8 | 101 + usr.sbin/arp/arp.c | 381 + usr.sbin/bad144/Makefile | 37 + usr.sbin/bad144/bad144.8 | 90 + usr.sbin/bad144/bad144.c | 182 + usr.sbin/catman/Makefile | 37 + usr.sbin/catman/catman.8 | 119 + usr.sbin/catman/catman.c | 256 + usr.sbin/chown/Makefile | 37 + usr.sbin/chown/chown.8 | 49 + usr.sbin/chown/chown.c | 198 + usr.sbin/chroot/Makefile | 52 + usr.sbin/chroot/chroot.8 | 44 + usr.sbin/chroot/chroot.c | 64 + usr.sbin/chroot/pathnames.h | 20 + usr.sbin/config/Makefile | 31 + usr.sbin/config/config.c | 5 + usr.sbin/cron/Makefile | 98 + usr.sbin/cron/README | 72 + usr.sbin/cron/README.2BSD | 58 + usr.sbin/cron/bitstring.3 | 168 + usr.sbin/cron/bitstring.h | 122 + usr.sbin/cron/compat.c | 57 + usr.sbin/cron/compat.h | 31 + usr.sbin/cron/config.h | 86 + usr.sbin/cron/cron.8 | 61 + usr.sbin/cron/cron.c | 277 + usr.sbin/cron/cron.h | 275 + usr.sbin/cron/crontab.1 | 100 + usr.sbin/cron/crontab.5 | 188 + usr.sbin/cron/crontab.c | 586 + usr.sbin/cron/database.c | 261 + usr.sbin/cron/do_command.c | 433 + usr.sbin/cron/entry.c | 504 + usr.sbin/cron/env.c | 178 + usr.sbin/cron/externs.h | 28 + usr.sbin/cron/grot/CHANGES | 155 + usr.sbin/cron/grot/CONVERSION | 85 + usr.sbin/cron/grot/FEATURES | 84 + usr.sbin/cron/grot/INSTALL | 87 + usr.sbin/cron/grot/MAIL | 475 + usr.sbin/cron/grot/MANIFEST | 33 + usr.sbin/cron/grot/THANKS | 29 + usr.sbin/cron/grot/diffs | 1933 + usr.sbin/cron/job.c | 74 + usr.sbin/cron/misc.c | 649 + usr.sbin/cron/pathnames.h | 79 + usr.sbin/cron/popen.c | 170 + usr.sbin/cron/putman.sh | 26 + usr.sbin/cron/user.c | 102 + usr.sbin/dev_mkdb/Makefile | 37 + usr.sbin/dev_mkdb/dev_mkdb.8 | 74 + usr.sbin/dev_mkdb/dev_mkdb.c | 153 + usr.sbin/diskpart/Makefile | 37 + usr.sbin/diskpart/diskpart.8 | 81 + usr.sbin/diskpart/diskpart.c | 5 + usr.sbin/edquota/Makefile | 37 + usr.sbin/edquota/edquota.8 | 56 + usr.sbin/edquota/edquota.c | 535 + usr.sbin/flcopy/Makefile | 31 + usr.sbin/flcopy/flcopy.c | 5 + usr.sbin/gettable/Makefile | 37 + usr.sbin/gettable/gettable.8 | 56 + usr.sbin/gettable/gettable.c | 147 + usr.sbin/htable/Makefile | 37 + usr.sbin/htable/hosts | 545 + usr.sbin/htable/htable.c | 601 + usr.sbin/htable/htable.h | 45 + usr.sbin/htable/localgateways | 11 + usr.sbin/htable/localhosts | 150 + usr.sbin/htable/localnetworks | 17 + usr.sbin/htable/parse.y | 137 + usr.sbin/htable/scan.l | 75 + usr.sbin/implog/Makefile | 37 + usr.sbin/implog/implog.8 | 83 + usr.sbin/implog/implog.c | 5 + usr.sbin/implogd/Makefile | 37 + usr.sbin/implogd/implogd.8 | 50 + usr.sbin/implogd/implogd.c | 5 + usr.sbin/inetd/Makefile | 37 + usr.sbin/inetd/inetd.8 | 377 + usr.sbin/inetd/inetd.c | 1268 + usr.sbin/inetd/pathnames.h | 38 + usr.sbin/kgmon/Makefile | 37 + usr.sbin/kgmon/kgmon.8 | 85 + usr.sbin/kgmon/kgmon.c | 5 + usr.sbin/lpr/Makefile | 86 + usr.sbin/lpr/cmds.c | 955 + usr.sbin/lpr/cmdtab.c | 53 + usr.sbin/lpr/common.c | 237 + usr.sbin/lpr/displayq.c | 435 + usr.sbin/lpr/etc.printcap | 27 + usr.sbin/lpr/filters/Makefile | 116 + usr.sbin/lpr/filters/README | 3 + usr.sbin/lpr/filters/chrtab.c | 108 + usr.sbin/lpr/filters/fcvt.c | 242 + usr.sbin/lpr/filters/lpf.c | 181 + usr.sbin/lpr/filters/necf.c | 49 + usr.sbin/lpr/filters/railmag.c | 130 + usr.sbin/lpr/filters/rotate.c | 115 + usr.sbin/lpr/filters/rotprt.c | 92 + usr.sbin/lpr/filters/rvcat.c | 885 + usr.sbin/lpr/filters/rvsort.c | 483 + usr.sbin/lpr/filters/vcat.c | 837 + usr.sbin/lpr/filters/vdmp.c | 144 + usr.sbin/lpr/filters/vfontinfo.c | 342 + usr.sbin/lpr/filters/vfw.c | 39 + usr.sbin/lpr/filters/vpf.c | 238 + usr.sbin/lpr/filters/vplotf.c | 488 + usr.sbin/lpr/filters/vpltdmp.c | 127 + usr.sbin/lpr/filters/vpsf.c | 274 + usr.sbin/lpr/filters/vsort.c | 668 + usr.sbin/lpr/filters/vwidth.c | 287 + usr.sbin/lpr/lp.h | 92 + usr.sbin/lpr/lp.local.h | 86 + usr.sbin/lpr/lpc.c | 234 + usr.sbin/lpr/lpc.h | 17 + usr.sbin/lpr/lpd.c | 449 + usr.sbin/lpr/lpdchar.c | 1039 + usr.sbin/lpr/lpq.c | 209 + usr.sbin/lpr/lpr.c | 677 + usr.sbin/lpr/lprm.c | 104 + usr.sbin/lpr/lptest.c | 53 + usr.sbin/lpr/pac.c | 408 + usr.sbin/lpr/printcap.c | 415 + usr.sbin/lpr/printjob.c | 1287 + usr.sbin/lpr/recvjob.c | 318 + usr.sbin/lpr/rmjob.c | 290 + usr.sbin/lpr/startdaemon.c | 90 + usr.sbin/makewhatis/Makefile | 22 + usr.sbin/makewhatis/makewhatis.sh | 32 + usr.sbin/mkhosts/Makefile | 44 + usr.sbin/mkhosts/mkhosts.8 | 53 + usr.sbin/mkhosts/mkhosts.c | 261 + usr.sbin/mklost+found/Makefile | 28 + usr.sbin/mklost+found/mklost+found.8 | 28 + usr.sbin/mklost+found/mklost+found.sh | 26 + usr.sbin/mkproto/Makefile | 37 + usr.sbin/mkproto/mkproto.8 | 118 + usr.sbin/mkproto/mkproto.c | 442 + usr.sbin/named/CHANGES | 55 + usr.sbin/named/Makefile | 33 + usr.sbin/named/README | 122 + usr.sbin/named/doc/rfc1032.lpr | 781 + usr.sbin/named/doc/rfc1033.lpr | 1229 + usr.sbin/named/doc/rfc1034.lpr | 3077 ++ usr.sbin/named/doc/rfc1035.lpr | 3077 ++ usr.sbin/named/doc/rfc920.lpr | 798 + usr.sbin/named/doc/rfc974.lpr | 399 + usr.sbin/named/master/:pwedit | 4 + usr.sbin/named/master/Index | 14 + usr.sbin/named/master/README | 47 + usr.sbin/named/master/atod.y | 118 + usr.sbin/named/master/named.boot | 18 + usr.sbin/named/master/named.boot.mas | 16 + usr.sbin/named/master/named.hosts | 26 + usr.sbin/named/master/named.local | 12 + usr.sbin/named/master/named.rev | 25 + usr.sbin/named/master/root.cache | 29 + usr.sbin/named/named/Makefile | 146 + usr.sbin/named/named/Version.c | 93 + usr.sbin/named/named/databuf | 1 + usr.sbin/named/named/databufs | 2 + usr.sbin/named/named/db.h | 109 + usr.sbin/named/named/db_dump.c | 777 + usr.sbin/named/named/db_load.c | 1022 + usr.sbin/named/named/db_lookup.c | 165 + usr.sbin/named/named/db_reload.c | 104 + usr.sbin/named/named/db_save.c | 191 + usr.sbin/named/named/db_update.c | 366 + usr.sbin/named/named/namebuf | 2 + usr.sbin/named/named/named.reload | 5 + usr.sbin/named/named/named.restart | 2 + usr.sbin/named/named/newvers.sh | 24 + usr.sbin/named/named/ns.h | 211 + usr.sbin/named/named/ns_forw.c | 555 + usr.sbin/named/named/ns_init.c | 472 + usr.sbin/named/named/ns_main.c | 1174 + usr.sbin/named/named/ns_maint.c | 626 + usr.sbin/named/named/ns_req.c | 1291 + usr.sbin/named/named/ns_resp.c | 1636 + usr.sbin/named/named/ns_sort.c | 282 + usr.sbin/named/named/ns_stats.c | 131 + usr.sbin/named/named/storage.c | 166 + usr.sbin/named/named/version | 1 + usr.sbin/named/tools/Makefile | 59 + usr.sbin/named/tools/nslookup/Makefile | 53 + usr.sbin/named/tools/nslookup/commands.l | 182 + usr.sbin/named/tools/nslookup/debug.c | 446 + usr.sbin/named/tools/nslookup/getinfo.c | 778 + usr.sbin/named/tools/nslookup/list.c | 927 + usr.sbin/named/tools/nslookup/main.c | 1111 + usr.sbin/named/tools/nslookup/nslookup.8 | 349 + usr.sbin/named/tools/nslookup/nslookup.help | 31 + usr.sbin/named/tools/nslookup/pathnames.h | 22 + usr.sbin/named/tools/nslookup/res.h | 140 + usr.sbin/named/tools/nslookup/res_debug.c | 498 + usr.sbin/named/tools/nslookup/send.c | 538 + usr.sbin/named/tools/nslookup/skip.c | 173 + usr.sbin/named/tools/nslookup/subr.c | 497 + usr.sbin/named/tools/nsquery.c | 93 + usr.sbin/named/tools/nstest.c | 368 + usr.sbin/ntp/Makefile | 252 + usr.sbin/ntp/README | 412 + usr.sbin/ntp/extract.pl | 19 + usr.sbin/ntp/man/Makefile | 19 + usr.sbin/ntp/man/clock.txt | 216 + usr.sbin/ntp/man/loop.c | 71 + usr.sbin/ntp/man/ntp.8 | 123 + usr.sbin/ntp/man/ntpd.8 | 221 + usr.sbin/ntp/man/ntpdc.8 | 162 + usr.sbin/ntp/ntp.c | 351 + usr.sbin/ntp/ntp.conf | 17 + usr.sbin/ntp/ntp.h | 418 + usr.sbin/ntp/ntp_adjust.c | 302 + usr.sbin/ntp/ntp_proto.c | 1269 + usr.sbin/ntp/ntp_sock.c | 350 + usr.sbin/ntp/ntpd.c | 1352 + usr.sbin/ntp/ntpdc.c | 429 + usr.sbin/ntp/ntpsubs.c | 253 + usr.sbin/ntp/patchl | 191 + usr.sbin/ntp/patchlevel.h | 1 + usr.sbin/ntp/read_local.c | 30 + usr.sbin/ntp/read_psti.c | 369 + usr.sbin/ntp/stat.pl | 276 + usr.sbin/ntp/test.c | 185 + usr.sbin/pstat/Makefile | 37 + usr.sbin/pstat/pstat.8 | 358 + usr.sbin/pstat/pstat.c | 773 + usr.sbin/quot/Makefile | 37 + usr.sbin/quot/quot.8 | 36 + usr.sbin/quot/quot.c | 238 + usr.sbin/quotaon/Makefile | 41 + usr.sbin/quotaon/quotaon.8 | 103 + usr.sbin/quotaon/quotaon.c | 230 + usr.sbin/repquota/Makefile | 37 + usr.sbin/repquota/repquota.8 | 31 + usr.sbin/repquota/repquota.c | 320 + usr.sbin/rmt/Makefile | 37 + usr.sbin/rmt/rmt.8 | 151 + usr.sbin/rmt/rmt.c | 204 + usr.sbin/rwhod/Makefile | 37 + usr.sbin/rwhod/rwhod.8 | 110 + usr.sbin/rwhod/rwhod.c | 486 + usr.sbin/rxformat/Makefile | 37 + usr.sbin/rxformat/rxformat.8 | 52 + usr.sbin/rxformat/rxformat.c | 64 + usr.sbin/sa/Makefile | 37 + usr.sbin/sa/sa.8 | 141 + usr.sbin/sa/sa.c | 1090 + usr.sbin/sendmail.MX/Makefile | 33 + usr.sbin/sendmail.MX/READ_ME | 64 + usr.sbin/sendmail.MX/adb/event | 2 + usr.sbin/sendmail.MX/adb/event2 | 4 + usr.sbin/sendmail.MX/adm/SU.LOG | 6 + usr.sbin/sendmail.MX/adm/TODO | 104 + usr.sbin/sendmail.MX/adm/TraceFlags | 50 + usr.sbin/sendmail.MX/adm/cbosgd.sl | 54 + usr.sbin/sendmail.MX/adm/csvax.m4 | 1 + usr.sbin/sendmail.MX/adm/ingvax.m4 | 1 + usr.sbin/sendmail.MX/adm/jek.sl | 54 + usr.sbin/sendmail.MX/adm/kim.m4 | 1 + usr.sbin/sendmail.MX/adm/mh.cf.m4 | 127 + usr.sbin/sendmail.MX/adm/mh.whoami.m4 | 44 + usr.sbin/sendmail.MX/adm/sl.sed | 5 + usr.sbin/sendmail.MX/aux/Makefile | 81 + usr.sbin/sendmail.MX/aux/addr.c | 132 + usr.sbin/sendmail.MX/aux/arpa.c | 680 + usr.sbin/sendmail.MX/aux/bbn_daemon.c | 300 + usr.sbin/sendmail.MX/aux/delivermail.sh | 6 + usr.sbin/sendmail.MX/aux/mail-dm.c | 428 + usr.sbin/sendmail.MX/aux/mailstats.c | 73 + usr.sbin/sendmail.MX/aux/matchhdr.c | 95 + usr.sbin/sendmail.MX/aux/mconnect.c | 140 + usr.sbin/sendmail.MX/aux/newaliases.c | 211 + usr.sbin/sendmail.MX/aux/praliases.c | 68 + usr.sbin/sendmail.MX/cf | 1 + usr.sbin/sendmail.MX/cf.hosttable/KEY | 39 + usr.sbin/sendmail.MX/cf.hosttable/Makefile | 121 + usr.sbin/sendmail.MX/cf.hosttable/NEW/base.m4 | 183 + .../sendmail.MX/cf.hosttable/NEW/ucbvax.mc | 104 + .../sendmail.MX/cf.hosttable/NEW/uucpm.m4 | 22 + usr.sbin/sendmail.MX/cf.hosttable/TestMatrix | 57 + usr.sbin/sendmail.MX/cf.hosttable/arpa.mc | 123 + .../sendmail.MX/cf.hosttable/arpaproto.mc | 52 + usr.sbin/sendmail.MX/cf.hosttable/base.m4 | 208 + .../sendmail.MX/cf.hosttable/berkhosts.m4 | 27 + usr.sbin/sendmail.MX/cf.hosttable/berkm.m4 | 36 + usr.sbin/sendmail.MX/cf.hosttable/calder.mc | 30 + usr.sbin/sendmail.MX/cf.hosttable/ccbase.m4 | 59 + usr.sbin/sendmail.MX/cf.hosttable/cchosts.m4 | 53 + usr.sbin/sendmail.MX/cf.hosttable/cogsci.mc | 21 + usr.sbin/sendmail.MX/cf.hosttable/compat.m4 | 37 + usr.sbin/sendmail.MX/cf.hosttable/csbase.m4 | 149 + usr.sbin/sendmail.MX/cf.hosttable/csether.mc | 12 + usr.sbin/sendmail.MX/cf.hosttable/dali.mc | 30 + usr.sbin/sendmail.MX/cf.hosttable/degas.mc | 56 + usr.sbin/sendmail.MX/cf.hosttable/ernie.mc | 30 + usr.sbin/sendmail.MX/cf.hosttable/ether.m4 | 37 + usr.sbin/sendmail.MX/cf.hosttable/etherm.m4 | 32 + usr.sbin/sendmail.MX/cf.hosttable/fncpm.m4 | 31 + usr.sbin/sendmail.MX/cf.hosttable/fudge.m4 | 27 + usr.sbin/sendmail.MX/cf.hosttable/guessing | 150 + usr.sbin/sendmail.MX/cf.hosttable/ibmm.m4 | 26 + usr.sbin/sendmail.MX/cf.hosttable/ji.mc | 30 + usr.sbin/sendmail.MX/cf.hosttable/kim.mc | 61 + usr.sbin/sendmail.MX/cf.hosttable/lanleaf.mc | 56 + usr.sbin/sendmail.MX/cf.hosttable/lanroot.mc | 63 + usr.sbin/sendmail.MX/cf.hosttable/localm.m4 | 26 + usr.sbin/sendmail.MX/cf.hosttable/matisse.mc | 30 + usr.sbin/sendmail.MX/cf.hosttable/miro.mc | 30 + usr.sbin/sendmail.MX/cf.hosttable/mmdfm.m4 | 27 + usr.sbin/sendmail.MX/cf.hosttable/monet.mc | 30 + usr.sbin/sendmail.MX/cf.hosttable/ncpm.m4 | 28 + usr.sbin/sendmail.MX/cf.hosttable/okeeffe.mc | 30 + usr.sbin/sendmail.MX/cf.hosttable/renoir.mc | 30 + usr.sbin/sendmail.MX/cf.hosttable/suucpm.m4 | 31 + usr.sbin/sendmail.MX/cf.hosttable/tcphosts.m4 | 28 + usr.sbin/sendmail.MX/cf.hosttable/tcpm.m4 | 60 + usr.sbin/sendmail.MX/cf.hosttable/ucbvax.mc | 154 + usr.sbin/sendmail.MX/cf.hosttable/uucpm.m4 | 43 + .../sendmail.MX/cf.hosttable/uucpproto.mc | 55 + usr.sbin/sendmail.MX/cf.hosttable/version.m4 | 17 + usr.sbin/sendmail.MX/cf.hosttable/zerobase.m4 | 52 + usr.sbin/sendmail.MX/doc/Makefile | 46 + usr.sbin/sendmail.MX/doc/abstract | 30 + usr.sbin/sendmail.MX/doc/diagram | 17 + usr.sbin/sendmail.MX/doc/refs | 26 + usr.sbin/sendmail.MX/doc/rfc819.lpr | 1044 + usr.sbin/sendmail.MX/doc/rfc821.lpr | 4050 ++ usr.sbin/sendmail.MX/doc/rfc822.lpr | 2901 ++ usr.sbin/sendmail.MX/doc/spell.good | 219 + usr.sbin/sendmail.MX/doc/usenix | 26 + usr.sbin/sendmail.MX/doc/usenix.me | 1076 + usr.sbin/sendmail.MX/include/asm.sed | 1 + usr.sbin/sendmail.MX/include/asm.sed.pdp | 1 + usr.sbin/sendmail.MX/include/asm.sed.vax | 35 + usr.sbin/sendmail.MX/include/useful.h | 53 + usr.sbin/sendmail.MX/include/userdbm.h | 20 + usr.sbin/sendmail.MX/lib/Makefile | 24 + usr.sbin/sendmail.MX/lib/aliases | 15 + usr.sbin/sendmail.MX/lib/sendmail.hf | 56 + usr.sbin/sendmail.MX/md/c.nvmunix.m4 | 3 + usr.sbin/sendmail.MX/md/c.v6.m4 | 3 + usr.sbin/sendmail.MX/md/c.v7.m4 | 3 + usr.sbin/sendmail.MX/md/c.vmunix.m4 | 4 + usr.sbin/sendmail.MX/md/config.dst | 3 + usr.sbin/sendmail.MX/md/config.m4 | 4 + usr.sbin/sendmail.MX/md/config.m4.mone | 4 + usr.sbin/sendmail.MX/src/Makefile | 336 + usr.sbin/sendmail.MX/src/READ_ME | 79 + usr.sbin/sendmail.MX/src/TODO | 45 + usr.sbin/sendmail.MX/src/Version.c | 55 + usr.sbin/sendmail.MX/src/alias.c | 591 + usr.sbin/sendmail.MX/src/arpadate.c | 173 + usr.sbin/sendmail.MX/src/clock.c | 235 + usr.sbin/sendmail.MX/src/collect.c | 337 + usr.sbin/sendmail.MX/src/conf.c | 453 + usr.sbin/sendmail.MX/src/conf.h | 71 + usr.sbin/sendmail.MX/src/convtime.c | 174 + usr.sbin/sendmail.MX/src/daemon.c | 591 + usr.sbin/sendmail.MX/src/deliver.c | 1504 + usr.sbin/sendmail.MX/src/domain.c | 229 + usr.sbin/sendmail.MX/src/envelope.c | 594 + usr.sbin/sendmail.MX/src/err.c | 366 + usr.sbin/sendmail.MX/src/extract.c | 142 + usr.sbin/sendmail.MX/src/headers.c | 849 + usr.sbin/sendmail.MX/src/macro.c | 247 + usr.sbin/sendmail.MX/src/mailstats.h | 32 + usr.sbin/sendmail.MX/src/main.c | 1056 + usr.sbin/sendmail.MX/src/mkstrcc | 53 + usr.sbin/sendmail.MX/src/parseaddr.c | 1202 + usr.sbin/sendmail.MX/src/queue.c | 1043 + usr.sbin/sendmail.MX/src/readcf.c | 943 + usr.sbin/sendmail.MX/src/recipient.c | 578 + usr.sbin/sendmail.MX/src/savemail.c | 528 + usr.sbin/sendmail.MX/src/sendmail.h | 588 + usr.sbin/sendmail.MX/src/srvrsmtp.c | 690 + usr.sbin/sendmail.MX/src/stab.c | 125 + usr.sbin/sendmail.MX/src/stats.c | 104 + usr.sbin/sendmail.MX/src/sysexits.c | 70 + usr.sbin/sendmail.MX/src/trace.c | 113 + usr.sbin/sendmail.MX/src/trace.h | 34 + usr.sbin/sendmail.MX/src/usersmtp.c | 498 + usr.sbin/sendmail.MX/src/util.c | 948 + usr.sbin/sendmail.MX/src/version.c | 21 + usr.sbin/sendmail/FILES | 206 + usr.sbin/sendmail/Makefile | 55 + usr.sbin/sendmail/README_FOR_NAM | 25 + usr.sbin/sendmail/READ_ME | 64 + usr.sbin/sendmail/adb/event | 2 + usr.sbin/sendmail/adb/event2 | 4 + usr.sbin/sendmail/adm/SU.LOG | 6 + usr.sbin/sendmail/adm/TODO | 104 + usr.sbin/sendmail/adm/TraceFlags | 50 + usr.sbin/sendmail/adm/cbosgd.sl | 54 + usr.sbin/sendmail/adm/csvax.m4 | 1 + usr.sbin/sendmail/adm/ingvax.m4 | 1 + usr.sbin/sendmail/adm/jek.sl | 54 + usr.sbin/sendmail/adm/kim.m4 | 1 + usr.sbin/sendmail/adm/mh.cf.m4 | 127 + usr.sbin/sendmail/adm/mh.whoami.m4 | 44 + usr.sbin/sendmail/adm/sl.sed | 5 + usr.sbin/sendmail/aux/4.1a_daemon.c | 430 + usr.sbin/sendmail/aux/Makefile | 78 + usr.sbin/sendmail/aux/Makefile.m4 | 79 + usr.sbin/sendmail/aux/addr.c | 132 + usr.sbin/sendmail/aux/arpa.c | 680 + usr.sbin/sendmail/aux/asm.sed | 35 + usr.sbin/sendmail/aux/bbn_daemon.c | 300 + usr.sbin/sendmail/aux/c.ingvax.h | 5 + usr.sbin/sendmail/aux/conf.h | 42 + usr.sbin/sendmail/aux/mail-dm.c | 428 + usr.sbin/sendmail/aux/mailstats.c | 64 + usr.sbin/sendmail/aux/matchhdr.c | 95 + usr.sbin/sendmail/aux/mconnect.c | 155 + usr.sbin/sendmail/aux/newaliases.c | 211 + usr.sbin/sendmail/aux/newsyslog | 13 + usr.sbin/sendmail/aux/praliases.c | 42 + usr.sbin/sendmail/aux/rmail.c | 139 + usr.sbin/sendmail/aux/showdbm.c | 42 + usr.sbin/sendmail/aux/uname.c | 19 + usr.sbin/sendmail/cf | 1 + usr.sbin/sendmail/cf.hosttable/KEY | 39 + usr.sbin/sendmail/cf.hosttable/Makefile | 121 + usr.sbin/sendmail/cf.hosttable/TestMatrix | 57 + usr.sbin/sendmail/cf.hosttable/arpa.mc | 123 + usr.sbin/sendmail/cf.hosttable/arpaproto.mc | 52 + usr.sbin/sendmail/cf.hosttable/base.m4 | 208 + usr.sbin/sendmail/cf.hosttable/berkhosts.m4 | 27 + usr.sbin/sendmail/cf.hosttable/berkm.m4 | 36 + usr.sbin/sendmail/cf.hosttable/calder.mc | 30 + usr.sbin/sendmail/cf.hosttable/ccbase.m4 | 59 + usr.sbin/sendmail/cf.hosttable/cchosts.m4 | 53 + usr.sbin/sendmail/cf.hosttable/cogsci.mc | 21 + usr.sbin/sendmail/cf.hosttable/compat.m4 | 37 + usr.sbin/sendmail/cf.hosttable/csbase.m4 | 149 + usr.sbin/sendmail/cf.hosttable/csether.mc | 12 + usr.sbin/sendmail/cf.hosttable/dali.mc | 30 + usr.sbin/sendmail/cf.hosttable/degas.mc | 56 + usr.sbin/sendmail/cf.hosttable/ernie.mc | 30 + usr.sbin/sendmail/cf.hosttable/ether.m4 | 37 + usr.sbin/sendmail/cf.hosttable/etherm.m4 | 32 + usr.sbin/sendmail/cf.hosttable/fncpm.m4 | 31 + usr.sbin/sendmail/cf.hosttable/fudge.m4 | 27 + usr.sbin/sendmail/cf.hosttable/ibmm.m4 | 26 + usr.sbin/sendmail/cf.hosttable/ji.mc | 30 + usr.sbin/sendmail/cf.hosttable/kim.mc | 61 + usr.sbin/sendmail/cf.hosttable/lanleaf.mc | 56 + usr.sbin/sendmail/cf.hosttable/lanroot.mc | 63 + usr.sbin/sendmail/cf.hosttable/localm.m4 | 26 + usr.sbin/sendmail/cf.hosttable/matisse.mc | 30 + usr.sbin/sendmail/cf.hosttable/miro.mc | 30 + usr.sbin/sendmail/cf.hosttable/mmdfm.m4 | 27 + usr.sbin/sendmail/cf.hosttable/monet.mc | 30 + usr.sbin/sendmail/cf.hosttable/ncpm.m4 | 28 + usr.sbin/sendmail/cf.hosttable/okeeffe.mc | 30 + usr.sbin/sendmail/cf.hosttable/renoir.mc | 30 + usr.sbin/sendmail/cf.hosttable/suucpm.m4 | 31 + usr.sbin/sendmail/cf.hosttable/tcphosts.m4 | 28 + usr.sbin/sendmail/cf.hosttable/tcpm.m4 | 60 + usr.sbin/sendmail/cf.hosttable/ucbvax.mc | 154 + usr.sbin/sendmail/cf.hosttable/uucpm.m4 | 43 + usr.sbin/sendmail/cf.hosttable/uucpproto.mc | 55 + usr.sbin/sendmail/cf.hosttable/version.m4 | 17 + usr.sbin/sendmail/cf.hosttable/zerobase.m4 | 52 + usr.sbin/sendmail/cf.named/Makefile | 66 + usr.sbin/sendmail/cf.named/arpa.ed | 10 + usr.sbin/sendmail/cf.named/arpa.mc | 119 + usr.sbin/sendmail/cf.named/berkhosts.m4 | 24 + usr.sbin/sendmail/cf.named/berkm.m4 | 35 + usr.sbin/sendmail/cf.named/boilerplate.m4 | 115 + usr.sbin/sendmail/cf.named/cchosts.m4 | 38 + usr.sbin/sendmail/cf.named/euucpm.m4 | 31 + usr.sbin/sendmail/cf.named/kim.mc | 119 + usr.sbin/sendmail/cf.named/localm.m4 | 26 + usr.sbin/sendmail/cf.named/mmdfm.m4 | 27 + usr.sbin/sendmail/cf.named/monet.mc | 91 + usr.sbin/sendmail/cf.named/nicregistered.m4 | 45 + usr.sbin/sendmail/cf.named/nsclasses.m4 | 38 + usr.sbin/sendmail/cf.named/nsmacros.m4 | 35 + usr.sbin/sendmail/cf.named/nstcpldm.m4 | 126 + usr.sbin/sendmail/cf.named/nstcpm.m4 | 125 + usr.sbin/sendmail/cf.named/postwriterule.m4 | 41 + usr.sbin/sendmail/cf.named/prewriterule.m4 | 25 + usr.sbin/sendmail/cf.named/rule0.m4 | 57 + usr.sbin/sendmail/cf.named/rule3.m4 | 81 + usr.sbin/sendmail/cf.named/rule5.m4 | 35 + usr.sbin/sendmail/cf.named/suucpm.m4 | 46 + usr.sbin/sendmail/cf.named/ucbtcp.mc | 91 + usr.sbin/sendmail/cf.named/ucbvax.mc | 192 + usr.sbin/sendmail/cf.named/uucphosts.m4 | 122 + usr.sbin/sendmail/cf.named/uucpm.m4 | 44 + usr.sbin/sendmail/cf.named/version.m4 | 17 + usr.sbin/sendmail/doc/Makefile | 46 + usr.sbin/sendmail/doc/abstract | 30 + usr.sbin/sendmail/doc/diagram | 17 + usr.sbin/sendmail/doc/refs | 26 + usr.sbin/sendmail/doc/rfc819.lpr | 1044 + usr.sbin/sendmail/doc/rfc821.lpr | 4050 ++ usr.sbin/sendmail/doc/rfc822.lpr | 2901 ++ usr.sbin/sendmail/doc/spell.good | 219 + usr.sbin/sendmail/doc/usenix | 26 + usr.sbin/sendmail/doc/usenix.me | 1076 + usr.sbin/sendmail/include/asm.sed | 1 + usr.sbin/sendmail/include/asm.sed.pdp | 1 + usr.sbin/sendmail/include/asm.sed.vax | 35 + usr.sbin/sendmail/include/useful.h | 53 + usr.sbin/sendmail/include/userdbm.h | 14 + usr.sbin/sendmail/lib/Makefile | 29 + usr.sbin/sendmail/lib/Makefile.m4 | 27 + usr.sbin/sendmail/lib/aliases | 23 + usr.sbin/sendmail/lib/sendmail.hf | 56 + usr.sbin/sendmail/md/c.nvmunix.m4 | 3 + usr.sbin/sendmail/md/c.v6.m4 | 3 + usr.sbin/sendmail/md/c.v7.m4 | 3 + usr.sbin/sendmail/md/c.vmunix.m4 | 4 + usr.sbin/sendmail/md/config.m4 | 3 + usr.sbin/sendmail/src/FILES | 57 + usr.sbin/sendmail/src/Makefile | 113 + usr.sbin/sendmail/src/Makefile.m4 | 114 + usr.sbin/sendmail/src/READ_ME | 77 + usr.sbin/sendmail/src/TODO | 34 + usr.sbin/sendmail/src/Version.c | 2097 + usr.sbin/sendmail/src/alias.c | 599 + usr.sbin/sendmail/src/arpadate.c | 173 + usr.sbin/sendmail/src/bcopy.c | 64 + usr.sbin/sendmail/src/bmove.11.s | 101 + usr.sbin/sendmail/src/bmove.vax.s | 19 + usr.sbin/sendmail/src/clock.c | 235 + usr.sbin/sendmail/src/collect.c | 331 + usr.sbin/sendmail/src/conf.c | 453 + usr.sbin/sendmail/src/conf.h | 69 + usr.sbin/sendmail/src/convtime.c | 168 + usr.sbin/sendmail/src/daemon.c | 591 + usr.sbin/sendmail/src/deliver.c | 1455 + usr.sbin/sendmail/src/envelope.c | 590 + usr.sbin/sendmail/src/err.c | 357 + usr.sbin/sendmail/src/extract.c | 153 + usr.sbin/sendmail/src/headers.c | 844 + usr.sbin/sendmail/src/macro.c | 241 + usr.sbin/sendmail/src/mailstats.h | 26 + usr.sbin/sendmail/src/main.c | 1060 + usr.sbin/sendmail/src/mkstrcc | 55 + usr.sbin/sendmail/src/parseaddr.c | 1198 + usr.sbin/sendmail/src/queue.c | 1032 + usr.sbin/sendmail/src/readcf.c | 941 + usr.sbin/sendmail/src/recipient.c | 587 + usr.sbin/sendmail/src/savemail.c | 522 + usr.sbin/sendmail/src/sendmail.h | 586 + usr.sbin/sendmail/src/sendmail.hf | 37 + usr.sbin/sendmail/src/srvrsmtp.c | 681 + usr.sbin/sendmail/src/stab.c | 120 + usr.sbin/sendmail/src/stats.c | 98 + usr.sbin/sendmail/src/sysexits.c | 68 + usr.sbin/sendmail/src/tags | 244 + usr.sbin/sendmail/src/trace.c | 108 + usr.sbin/sendmail/src/trace.h | 26 + usr.sbin/sendmail/src/usersmtp.c | 494 + usr.sbin/sendmail/src/util.c | 948 + usr.sbin/sendmail/test/fail1 | 3 + usr.sbin/sendmail/test/fail2 | 3 + usr.sbin/sendmail/test/tempfail | 3 + usr.sbin/sysgen/Makefile | 40 + usr.sbin/sysgen/devices.h | 337 + usr.sbin/sysgen/sysgen.1 | 28 + usr.sbin/sysgen/sysgen.c | 130 + usr.sbin/syslogd/Makefile | 37 + usr.sbin/syslogd/syslogd.8 | 184 + usr.sbin/syslogd/syslogd.c | 1102 + usr.sbin/timed/Makefile | 62 + usr.sbin/timed/acksend.c | 82 + usr.sbin/timed/byteorder.c | 55 + usr.sbin/timed/candidate.c | 120 + usr.sbin/timed/cmds.c | 366 + usr.sbin/timed/cmdtab.c | 32 + usr.sbin/timed/correct.c | 139 + usr.sbin/timed/globals.h | 93 + usr.sbin/timed/m68000/cksum.c | 48 + usr.sbin/timed/m68000/ocsum.s | 42 + usr.sbin/timed/master.c | 553 + usr.sbin/timed/measure.c | 179 + usr.sbin/timed/networkdelta.c | 76 + usr.sbin/timed/pdp/cksum-fix | 51 + usr.sbin/timed/pdp/cksum.c | 36 + usr.sbin/timed/readmsg.c | 441 + usr.sbin/timed/slave.c | 550 + usr.sbin/timed/tags | 52 + usr.sbin/timed/timed.c | 608 + usr.sbin/timed/timedc.c | 237 + usr.sbin/timed/timedc.h | 40 + usr.sbin/timed/vax/cksum.c | 56 + usr.sbin/traceroute/Makefile | 25 + usr.sbin/traceroute/README | 126 + usr.sbin/traceroute/mean.awk | 12 + usr.sbin/traceroute/median.awk | 29 + usr.sbin/traceroute/traceroute.8 | 274 + usr.sbin/traceroute/traceroute.c | 784 + usr.sbin/trpt/Makefile | 37 + usr.sbin/trpt/trpt.8 | 112 + usr.sbin/trpt/trpt.c | 334 + usr.sbin/trsp/Makefile | 37 + usr.sbin/trsp/trsp.8 | 101 + usr.sbin/trsp/trsp.c | 357 + usr.sbin/update/Makefile | 37 + usr.sbin/update/update.8 | 39 + usr.sbin/update/update.c | 74 + usr.sbin/vipw/Makefile | 52 + usr.sbin/vipw/vipw.8 | 53 + usr.sbin/vipw/vipw.c | 276 + 7749 files changed, 1379418 insertions(+) create mode 100644 Makefile create mode 100644 asm.sed create mode 100644 asm.sed.pdp create mode 100644 asm.sed.vax create mode 100644 bin/MANIFEST create mode 100644 bin/Makefile create mode 100644 bin/PORT/ar.c.Z create mode 100644 bin/PORT/ld.c.Z create mode 100644 bin/PORT/nm.c.Z create mode 100644 bin/PORT/ps.c.Z create mode 100644 bin/adb/Makefile create mode 100644 bin/adb/READ_ME create mode 100644 bin/adb/access.c create mode 100644 bin/adb/command.c create mode 100644 bin/adb/defs.h create mode 100644 bin/adb/expr.c create mode 100644 bin/adb/findfn.c create mode 100644 bin/adb/format.c create mode 100644 bin/adb/input.c create mode 100644 bin/adb/main.c create mode 100644 bin/adb/message.c create mode 100644 bin/adb/opset.c create mode 100644 bin/adb/output.c create mode 100644 bin/adb/pcs.c create mode 100644 bin/adb/print.c create mode 100644 bin/adb/runpcs.c create mode 100644 bin/adb/setup.c create mode 100644 bin/adb/sym.c create mode 100644 bin/ar/Makefile create mode 100644 bin/ar/append.c create mode 100644 bin/ar/ar.1 create mode 100644 bin/ar/ar.5.5 create mode 100644 bin/ar/ar.c create mode 100644 bin/ar/archive.c create mode 100644 bin/ar/archive.h create mode 100644 bin/ar/contents.c create mode 100644 bin/ar/delete.c create mode 100644 bin/ar/extern.h create mode 100644 bin/ar/extract.c create mode 100644 bin/ar/misc.c create mode 100644 bin/ar/move.c create mode 100644 bin/ar/pathnames.h create mode 100644 bin/ar/print.c create mode 100644 bin/ar/replace.c create mode 100644 bin/ar/strmode.c create mode 100644 bin/as/Makefile create mode 100644 bin/as/as0.s create mode 100644 bin/as/as2.s create mode 100644 bin/awk/EXPLAIN create mode 100644 bin/awk/Makefile create mode 100644 bin/awk/README create mode 100644 bin/awk/awk.def create mode 100644 bin/awk/awk.g.y create mode 100644 bin/awk/awk.lx.l create mode 100644 bin/awk/b.c create mode 100644 bin/awk/freeze.c create mode 100644 bin/awk/lib.c create mode 100644 bin/awk/main.c create mode 100644 bin/awk/parse.c create mode 100644 bin/awk/proc.c create mode 100644 bin/awk/run.c create mode 100644 bin/awk/test.a create mode 100644 bin/awk/token.c create mode 100644 bin/awk/tokenscript create mode 100644 bin/awk/tran.c create mode 100644 bin/cat.c create mode 100644 bin/cc.c create mode 100644 bin/chflags/Makefile create mode 100644 bin/chflags/chflags.1 create mode 100644 bin/chflags/chflags.c create mode 100644 bin/chgrp.c create mode 100644 bin/chmod.c create mode 100644 bin/chpass/Makefile create mode 100644 bin/chpass/chpass.1 create mode 100644 bin/chpass/chpass.c create mode 100644 bin/chpass/chpass.h create mode 100644 bin/chpass/field.c create mode 100644 bin/chpass/pathnames.h create mode 100644 bin/chpass/util.c create mode 100644 bin/cmp.c create mode 100644 bin/cp.c create mode 100644 bin/csh/Makefile create mode 100644 bin/csh/alloc.c create mode 100644 bin/csh/alloc11.c create mode 100644 bin/csh/doprnt.c create mode 100644 bin/csh/doprnt11.s create mode 100644 bin/csh/printf.c create mode 100644 bin/csh/sh.c create mode 100644 bin/csh/sh.char.c create mode 100644 bin/csh/sh.char.h create mode 100644 bin/csh/sh.dir.c create mode 100644 bin/csh/sh.dir.h create mode 100644 bin/csh/sh.dol.c create mode 100644 bin/csh/sh.err.c create mode 100644 bin/csh/sh.exec.c create mode 100644 bin/csh/sh.exec.h create mode 100644 bin/csh/sh.exec2.c create mode 100644 bin/csh/sh.exp.c create mode 100644 bin/csh/sh.file.c create mode 100644 bin/csh/sh.func.c create mode 100644 bin/csh/sh.glob.c create mode 100644 bin/csh/sh.h create mode 100644 bin/csh/sh.hist.c create mode 100644 bin/csh/sh.init.c create mode 100644 bin/csh/sh.lex.c create mode 100644 bin/csh/sh.local.h create mode 100644 bin/csh/sh.misc.c create mode 100644 bin/csh/sh.parse.c create mode 100644 bin/csh/sh.print.c create mode 100644 bin/csh/sh.proc.c create mode 100644 bin/csh/sh.proc.h create mode 100644 bin/csh/sh.sem.c create mode 100644 bin/csh/sh.set.c create mode 100644 bin/csh/sh.time.c create mode 100644 bin/csh/tags create mode 100644 bin/date.c create mode 100644 bin/dd.c create mode 100644 bin/df.c create mode 100644 bin/diff/Makefile create mode 100644 bin/diff/diff.c create mode 100644 bin/diff/diff.h create mode 100644 bin/diff/diffdir.c create mode 100644 bin/diff/diffh.c create mode 100644 bin/diff/diffreg.c create mode 100644 bin/disklabel/Makefile create mode 100644 bin/disklabel/disklabel.5.5 create mode 100644 bin/disklabel/disklabel.8 create mode 100644 bin/disklabel/disklabel.c create mode 100644 bin/disklabel/pathnames.h create mode 100644 bin/du.c create mode 100644 bin/echo.c create mode 100644 bin/ed.c create mode 100644 bin/expr.y create mode 100644 bin/false.sh create mode 100644 bin/grep.c create mode 100644 bin/hostid.c create mode 100644 bin/hostname/Makefile create mode 100644 bin/hostname/hostname.1 create mode 100644 bin/hostname/hostname.c create mode 100644 bin/kill.c create mode 100644 bin/ld/Makefile create mode 100644 bin/ld/ld.1 create mode 100644 bin/ld/ld.c create mode 100644 bin/ln.c create mode 100644 bin/login/Makefile create mode 100644 bin/login/login.c create mode 100644 bin/login/pathnames.h create mode 100644 bin/ls/Makefile create mode 100644 bin/ls/ls.c create mode 100644 bin/ls/stat_flags.c create mode 100644 bin/mail.c create mode 100644 bin/make/Makefile create mode 100644 bin/make/defs create mode 100644 bin/make/doname.c create mode 100644 bin/make/dosys.c create mode 100644 bin/make/files.c create mode 100644 bin/make/gcos.c create mode 100644 bin/make/gram.y create mode 100644 bin/make/ident.c create mode 100644 bin/make/main.c create mode 100644 bin/make/misc.c create mode 100644 bin/mkdir.c create mode 100644 bin/mt.c create mode 100644 bin/mv.c create mode 100644 bin/nice.c create mode 100644 bin/nm.c.use.disk create mode 100644 bin/nm/Makefile create mode 100644 bin/nm/nm.c create mode 100644 bin/od.c create mode 100644 bin/pagesize.c create mode 100644 bin/passwd/Makefile create mode 100644 bin/passwd/passwd.1 create mode 100644 bin/passwd/passwd.c create mode 100644 bin/pathnames.h create mode 100644 bin/ping/Makefile create mode 100644 bin/ping/ping.8 create mode 100644 bin/ping/ping.c create mode 100644 bin/pr.c create mode 100644 bin/ps.c create mode 100644 bin/pwd.c create mode 100644 bin/rcp.c create mode 100644 bin/rm.c create mode 100644 bin/rmail.c create mode 100644 bin/rmdir.c create mode 100644 bin/sed/Makefile create mode 100644 bin/sed/sed.h create mode 100644 bin/sed/sed0.c create mode 100644 bin/sed/sed1.c create mode 100644 bin/sh/Makefile create mode 100644 bin/sh/args.c create mode 100644 bin/sh/blok.c create mode 100644 bin/sh/brkincr.h create mode 100644 bin/sh/builtin.c create mode 100644 bin/sh/cmd.c create mode 100644 bin/sh/ctype.c create mode 100644 bin/sh/ctype.h create mode 100644 bin/sh/defs.h create mode 100644 bin/sh/dup.h create mode 100644 bin/sh/error.c create mode 100644 bin/sh/expand.c create mode 100644 bin/sh/fault.c create mode 100644 bin/sh/io.c create mode 100644 bin/sh/mac.h create mode 100644 bin/sh/macro.c create mode 100644 bin/sh/main.c create mode 100644 bin/sh/mode.h create mode 100644 bin/sh/msg.c create mode 100644 bin/sh/name.c create mode 100644 bin/sh/name.h create mode 100644 bin/sh/print.c create mode 100644 bin/sh/service.c create mode 100644 bin/sh/setbrk.c create mode 100644 bin/sh/stak.c create mode 100644 bin/sh/stak.h create mode 100644 bin/sh/string.c create mode 100644 bin/sh/sym.h create mode 100644 bin/sh/timeout.h create mode 100644 bin/sh/word.c create mode 100644 bin/sh/xec.c create mode 100644 bin/size.c create mode 100644 bin/strip.c create mode 100644 bin/stty/Makefile create mode 100644 bin/stty/stty.1 create mode 100644 bin/stty/stty.c create mode 100644 bin/su.c create mode 100644 bin/sync.c create mode 100644 bin/sysctl/Makefile create mode 100644 bin/sysctl/sysctl.8 create mode 100644 bin/sysctl/sysctl.c create mode 100644 bin/tar.c create mode 100644 bin/tcsh/FAQ create mode 100644 bin/tcsh/Fixes create mode 100755 bin/tcsh/MAKEDIFFS create mode 100644 bin/tcsh/Makefile create mode 100644 bin/tcsh/NewThings create mode 100644 bin/tcsh/README create mode 100644 bin/tcsh/WishList create mode 100644 bin/tcsh/alloc11.c create mode 100644 bin/tcsh/config.h create mode 100644 bin/tcsh/config_f.h create mode 100644 bin/tcsh/ed.chared.c create mode 100644 bin/tcsh/ed.decls.h create mode 100644 bin/tcsh/ed.defns.c create mode 100644 bin/tcsh/ed.h create mode 100644 bin/tcsh/ed.init.c create mode 100644 bin/tcsh/ed.inputl.c create mode 100644 bin/tcsh/ed.refresh.c create mode 100644 bin/tcsh/ed.screen.c create mode 100644 bin/tcsh/ed.xmap.c create mode 100644 bin/tcsh/eight-bit.me create mode 100644 bin/tcsh/glob.3 create mode 100644 bin/tcsh/glob.c create mode 100644 bin/tcsh/glob.h create mode 100644 bin/tcsh/jpnerror.c create mode 100644 bin/tcsh/mkprstr.c create mode 100644 bin/tcsh/patchlevel.h create mode 100644 bin/tcsh/pathnames.h create mode 100644 bin/tcsh/sh.c create mode 100644 bin/tcsh/sh.char.c create mode 100644 bin/tcsh/sh.char.h create mode 100644 bin/tcsh/sh.decls.h create mode 100644 bin/tcsh/sh.dir.c create mode 100644 bin/tcsh/sh.dir.h create mode 100644 bin/tcsh/sh.dol.c create mode 100644 bin/tcsh/sh.err.c create mode 100644 bin/tcsh/sh.exec.c create mode 100644 bin/tcsh/sh.exp.c create mode 100644 bin/tcsh/sh.file.c create mode 100644 bin/tcsh/sh.func.c create mode 100644 bin/tcsh/sh.glob.c create mode 100644 bin/tcsh/sh.h create mode 100644 bin/tcsh/sh.hist.c create mode 100644 bin/tcsh/sh.init.c create mode 100644 bin/tcsh/sh.lex.c create mode 100644 bin/tcsh/sh.misc.c create mode 100644 bin/tcsh/sh.parse.c create mode 100644 bin/tcsh/sh.print.c create mode 100644 bin/tcsh/sh.proc.c create mode 100644 bin/tcsh/sh.proc.h create mode 100644 bin/tcsh/sh.sem.c create mode 100644 bin/tcsh/sh.set.c create mode 100644 bin/tcsh/sh.time.c create mode 100644 bin/tcsh/sh.types.h create mode 100644 bin/tcsh/tc.alloc.c create mode 100644 bin/tcsh/tc.bind.c create mode 100644 bin/tcsh/tc.const.c create mode 100644 bin/tcsh/tc.decls.h create mode 100644 bin/tcsh/tc.disc.c create mode 100644 bin/tcsh/tc.func.c create mode 100644 bin/tcsh/tc.h create mode 100644 bin/tcsh/tc.os.c create mode 100644 bin/tcsh/tc.os.h create mode 100644 bin/tcsh/tc.printf.c create mode 100644 bin/tcsh/tc.prompt.c create mode 100644 bin/tcsh/tc.sched.c create mode 100644 bin/tcsh/tc.sig.c create mode 100644 bin/tcsh/tc.sig.h create mode 100644 bin/tcsh/tc.str.c create mode 100644 bin/tcsh/tc.vers.c create mode 100644 bin/tcsh/tc.wait.h create mode 100644 bin/tcsh/tc.who.c create mode 100644 bin/tcsh/tcsh.man create mode 100644 bin/tcsh/tw.decls.h create mode 100644 bin/tcsh/tw.h create mode 100644 bin/tcsh/tw.help.c create mode 100644 bin/tcsh/tw.init.c create mode 100644 bin/tcsh/tw.parse.c create mode 100644 bin/tcsh/tw.spell.c create mode 100644 bin/tee.c create mode 100644 bin/test/Makefile create mode 100755 bin/test/TEST.csh create mode 100644 bin/test/operators.c create mode 100644 bin/test/operators.h create mode 100644 bin/test/test.1 create mode 100644 bin/test/test.c create mode 100644 bin/time.c create mode 100644 bin/tp/Makefile create mode 100644 bin/tp/tp.h create mode 100644 bin/tp/tp0.c create mode 100644 bin/tp/tp1.c create mode 100644 bin/tp/tp2.c create mode 100644 bin/tp/tp3.c create mode 100644 bin/tp/tp_defs.h create mode 100644 bin/true.sh create mode 100644 bin/wall.c create mode 100644 bin/who.c create mode 100644 bin/write.c create mode 100755 etc/MAKEDEV create mode 100755 etc/MAKEDEV.local create mode 100644 etc/Makefile create mode 100644 etc/aliases create mode 100644 etc/crontab create mode 100644 etc/disktab create mode 100644 etc/dtab create mode 100644 etc/fstab create mode 100644 etc/ftpusers create mode 100644 etc/gettytab create mode 100644 etc/group create mode 100644 etc/hosts create mode 100644 etc/hosts.allow create mode 100644 etc/hosts.deny create mode 100644 etc/hosts.equiv create mode 100644 etc/inetd.conf create mode 100644 etc/inetd.conf.nowrappers create mode 100644 etc/master.passwd create mode 100644 etc/motd create mode 100755 etc/netstart create mode 100644 etc/networks create mode 100644 etc/ntp.conf create mode 100644 etc/passwd create mode 100644 etc/phones create mode 100644 etc/printcap create mode 100644 etc/protocols create mode 100755 etc/rc create mode 100755 etc/rc.local create mode 100644 etc/remote create mode 100644 etc/root/Makefile create mode 100644 etc/root/dot.cshrc create mode 100644 etc/root/dot.login create mode 100644 etc/root/dot.profile create mode 100644 etc/services create mode 100644 etc/shells create mode 100644 etc/syslog.conf create mode 100644 etc/ttys create mode 100644 etc/uucp/L-devices create mode 100644 etc/uucp/L-dialcodes create mode 100644 etc/uucp/L.cmds create mode 100644 etc/uucp/L.sys create mode 100644 etc/uucp/L_stat create mode 100644 etc/uucp/L_sub create mode 100644 etc/uucp/Makefile create mode 100644 etc/uucp/SEQF create mode 100644 etc/uucp/USERFILE create mode 100755 etc/uucp/clean.daily create mode 100755 etc/uucp/clean.weekly create mode 100644 etc/uucp/uucp-map create mode 100644 games/Makefile create mode 100644 games/PORT/aard.tar.Z create mode 100644 games/PORT/doctor.tar.Z create mode 100644 games/PORT/larn.tar.Z create mode 100644 games/adventure/FILES create mode 100644 games/adventure/Makefile create mode 100644 games/adventure/done.c create mode 100644 games/adventure/glorkz create mode 100644 games/adventure/hdr.h create mode 100644 games/adventure/init.c create mode 100644 games/adventure/io.c create mode 100644 games/adventure/main.c create mode 100644 games/adventure/okplay.c create mode 100644 games/adventure/save.c create mode 100644 games/adventure/subr.c create mode 100644 games/adventure/vocab.c create mode 100644 games/adventure/wizard.c create mode 100644 games/arithmetic.c create mode 100644 games/atc/BUGS create mode 100644 games/atc/Makefile create mode 100644 games/atc/def.h create mode 100644 games/atc/extern.c create mode 100644 games/atc/extern.h create mode 100644 games/atc/games/ATC_scores create mode 100644 games/atc/games/Game_List create mode 100644 games/atc/games/Killer create mode 100644 games/atc/games/crossover create mode 100644 games/atc/games/default create mode 100644 games/atc/games/easy create mode 100644 games/atc/games/game_2 create mode 100644 games/atc/grammar.y create mode 100644 games/atc/graphics.c create mode 100644 games/atc/include.h create mode 100644 games/atc/input.c create mode 100644 games/atc/lex.l create mode 100644 games/atc/list.c create mode 100644 games/atc/log.c create mode 100644 games/atc/main.c create mode 100644 games/atc/struct.h create mode 100644 games/atc/tunable.c create mode 100644 games/atc/tunable.h create mode 100644 games/atc/update.c create mode 100644 games/backgammon/Makefile create mode 100644 games/backgammon/Mesgfix create mode 100644 games/backgammon/allow.c create mode 100644 games/backgammon/back.h create mode 100644 games/backgammon/backgammon.src create mode 100644 games/backgammon/board.c create mode 100644 games/backgammon/check.c create mode 100644 games/backgammon/data.c create mode 100644 games/backgammon/extra.c create mode 100644 games/backgammon/fancy.c create mode 100644 games/backgammon/init.c create mode 100644 games/backgammon/main.c create mode 100644 games/backgammon/message.c create mode 100644 games/backgammon/move.c create mode 100644 games/backgammon/odds.c create mode 100644 games/backgammon/one.c create mode 100644 games/backgammon/save.c create mode 100644 games/backgammon/subs.c create mode 100644 games/backgammon/table.c create mode 100644 games/backgammon/teach.c create mode 100644 games/backgammon/text.c create mode 100644 games/backgammon/ttext1.c create mode 100644 games/backgammon/ttext2.c create mode 100644 games/backgammon/tutor.c create mode 100644 games/backgammon/tutor.h create mode 100644 games/banner.c create mode 100644 games/battlestar/Makefile create mode 100644 games/battlestar/battlestar.6 create mode 100644 games/battlestar/battlestar.c create mode 100644 games/battlestar/com1.c create mode 100644 games/battlestar/com2.c create mode 100644 games/battlestar/com3.c create mode 100644 games/battlestar/com4.c create mode 100644 games/battlestar/com5.c create mode 100644 games/battlestar/com6.c create mode 100644 games/battlestar/com7.c create mode 100644 games/battlestar/cypher.c create mode 100644 games/battlestar/dayfile.c create mode 100644 games/battlestar/dayobjs.c create mode 100644 games/battlestar/externs.h create mode 100644 games/battlestar/fly.c create mode 100644 games/battlestar/getcom.c create mode 100644 games/battlestar/globals.c create mode 100644 games/battlestar/init.c create mode 100644 games/battlestar/misc.c create mode 100644 games/battlestar/mkstr.c create mode 100644 games/battlestar/nightfile.c create mode 100644 games/battlestar/nightobjs.c create mode 100644 games/battlestar/parse.c create mode 100644 games/battlestar/room.c create mode 100644 games/battlestar/save.c create mode 100644 games/battlestar/words.c create mode 100644 games/bcd.c create mode 100644 games/boggle/Makefile create mode 100644 games/boggle/boggle.c create mode 100644 games/boggle/comp.c create mode 100644 games/boggle/inst create mode 100644 games/boggle/sfile create mode 100644 games/btlgammon/Makefile create mode 100644 games/btlgammon/backrules create mode 100644 games/btlgammon/btlgammon.c create mode 100644 games/canfield.c create mode 100644 games/cfscores.c create mode 100644 games/cribbage/:ctfix create mode 100644 games/cribbage/Makefile create mode 100644 games/cribbage/cards.c create mode 100644 games/cribbage/crib.c create mode 100644 games/cribbage/cribbage.h create mode 100644 games/cribbage/cribbage.n create mode 100644 games/cribbage/cribcur.h create mode 100644 games/cribbage/deck.h create mode 100644 games/cribbage/extern.c create mode 100644 games/cribbage/io.c create mode 100644 games/cribbage/macro create mode 100644 games/cribbage/score.c create mode 100644 games/cribbage/support.c create mode 100644 games/cribbage/test.c create mode 100644 games/factor.c create mode 100644 games/fish.c create mode 100644 games/fortune/Do_troff create mode 100644 games/fortune/Makefile create mode 100644 games/fortune/Troff.mac create mode 100644 games/fortune/Troff.sed create mode 100644 games/fortune/fortune.c create mode 100644 games/fortune/notes create mode 100644 games/fortune/obscene create mode 100644 games/fortune/obscene.4.3 create mode 100644 games/fortune/obscene.sp.ok create mode 100644 games/fortune/rnd.c create mode 100644 games/fortune/scene create mode 100644 games/fortune/scene.4.3 create mode 100644 games/fortune/scene.sp.ok create mode 100644 games/fortune/strfile.c create mode 100644 games/fortune/strfile.h create mode 100644 games/fortune/unstr.c create mode 100644 games/hack/Makefile create mode 100644 games/hack/Makefile.orig create mode 100644 games/hack/Original_READ_ create mode 100644 games/hack/READ_ME create mode 100644 games/hack/alloc.c create mode 100644 games/hack/config.h create mode 100644 games/hack/crypt.c create mode 100644 games/hack/data create mode 100644 games/hack/date.h create mode 100644 games/hack/def.edog.h create mode 100644 games/hack/def.eshk.h create mode 100644 games/hack/def.flag.h create mode 100644 games/hack/def.func_tab.h create mode 100644 games/hack/def.gen.h create mode 100644 games/hack/def.gold.h create mode 100644 games/hack/def.mkroom.h create mode 100644 games/hack/def.monst.h create mode 100644 games/hack/def.obj.h create mode 100644 games/hack/def.objclass.h create mode 100644 games/hack/def.objects.h create mode 100644 games/hack/def.permonst.h create mode 100644 games/hack/def.rm.h create mode 100644 games/hack/def.trap.h create mode 100644 games/hack/def.wseg.h create mode 100644 games/hack/hack.6 create mode 100644 games/hack/hack.Decl.c create mode 100644 games/hack/hack.apply.c create mode 100644 games/hack/hack.bones.c create mode 100644 games/hack/hack.c create mode 100644 games/hack/hack.cmd.c create mode 100644 games/hack/hack.do.c create mode 100644 games/hack/hack.do_name.c create mode 100644 games/hack/hack.do_wear.c create mode 100644 games/hack/hack.dog.c create mode 100644 games/hack/hack.eat.c create mode 100644 games/hack/hack.end.c create mode 100644 games/hack/hack.engrave.c create mode 100644 games/hack/hack.fight.c create mode 100644 games/hack/hack.h create mode 100644 games/hack/hack.invent.c create mode 100644 games/hack/hack.ioctl.c create mode 100644 games/hack/hack.lev.c create mode 100644 games/hack/hack.main.c create mode 100644 games/hack/hack.makemon.c create mode 100644 games/hack/hack.mfndpos.h create mode 100644 games/hack/hack.mhitu.c create mode 100644 games/hack/hack.mklev.c create mode 100644 games/hack/hack.mkmaze.c create mode 100644 games/hack/hack.mkobj.c create mode 100644 games/hack/hack.mkshop.c create mode 100644 games/hack/hack.mon.c create mode 100644 games/hack/hack.monst.c create mode 100644 games/hack/hack.o_init.c create mode 100644 games/hack/hack.objnam.c create mode 100644 games/hack/hack.onames.h create mode 100644 games/hack/hack.options.c create mode 100644 games/hack/hack.pager.c create mode 100644 games/hack/hack.potion.c create mode 100644 games/hack/hack.pri.c create mode 100644 games/hack/hack.read.c create mode 100644 games/hack/hack.rip.c create mode 100644 games/hack/hack.rumors.c create mode 100644 games/hack/hack.save.c create mode 100644 games/hack/hack.search.c create mode 100644 games/hack/hack.sh create mode 100644 games/hack/hack.shk.c create mode 100644 games/hack/hack.shknam.c create mode 100644 games/hack/hack.steal.c create mode 100644 games/hack/hack.termcap.c create mode 100644 games/hack/hack.timeout.c create mode 100644 games/hack/hack.topl.c create mode 100644 games/hack/hack.track.c create mode 100644 games/hack/hack.trap.c create mode 100644 games/hack/hack.tty.c create mode 100644 games/hack/hack.u_init.c create mode 100644 games/hack/hack.unix.c create mode 100644 games/hack/hack.vault.c create mode 100644 games/hack/hack.version.c create mode 100644 games/hack/hack.wield.c create mode 100644 games/hack/hack.wizard.c create mode 100644 games/hack/hack.worm.c create mode 100644 games/hack/hack.worn.c create mode 100644 games/hack/hack.zap.c create mode 100644 games/hack/help create mode 100644 games/hack/hh create mode 100644 games/hack/makedefs.c create mode 100644 games/hack/play.c create mode 100644 games/hack/rnd.c create mode 100644 games/hack/rumors create mode 100644 games/hack/strcmpfix.l create mode 100644 games/hangman/Makefile create mode 100644 games/hangman/endgame.c create mode 100644 games/hangman/extern.c create mode 100644 games/hangman/getguess.c create mode 100644 games/hangman/getword.c create mode 100644 games/hangman/hangman.h create mode 100644 games/hangman/main.c create mode 100644 games/hangman/playgame.c create mode 100644 games/hangman/prdata.c create mode 100644 games/hangman/prman.c create mode 100644 games/hangman/prword.c create mode 100644 games/hangman/setup.c create mode 100644 games/hunt/Makefile create mode 100644 games/hunt/README create mode 100644 games/hunt/answer.c create mode 100644 games/hunt/connect.c create mode 100644 games/hunt/draw.c create mode 100644 games/hunt/driver.c create mode 100644 games/hunt/execute.c create mode 100644 games/hunt/expl.c create mode 100644 games/hunt/extern.c create mode 100644 games/hunt/hunt.c create mode 100644 games/hunt/hunt.h create mode 100644 games/hunt/makemaze.c create mode 100644 games/hunt/pathname.c create mode 100644 games/hunt/playit.c create mode 100644 games/hunt/shots.c create mode 100644 games/hunt/terminal.c create mode 100644 games/mille/Makefile create mode 100644 games/mille/comp.c create mode 100644 games/mille/end.c create mode 100644 games/mille/extern.c create mode 100644 games/mille/init.c create mode 100644 games/mille/mille.c create mode 100644 games/mille/mille.h create mode 100644 games/mille/misc.c create mode 100644 games/mille/move.c create mode 100644 games/mille/print.c create mode 100644 games/mille/roll.c create mode 100644 games/mille/save.c create mode 100644 games/mille/table.c create mode 100644 games/mille/types.c create mode 100644 games/mille/unctrl.h create mode 100644 games/mille/varpush.c create mode 100644 games/monop/:rofix create mode 100644 games/monop/Makefile create mode 100644 games/monop/brd.dat create mode 100644 games/monop/cards.c create mode 100644 games/monop/cards.inp create mode 100644 games/monop/deck.h create mode 100644 games/monop/execute.c create mode 100644 games/monop/getinp.c create mode 100644 games/monop/houses.c create mode 100644 games/monop/initdeck.c create mode 100644 games/monop/jail.c create mode 100644 games/monop/misc.c create mode 100644 games/monop/mon.dat create mode 100644 games/monop/monop.c create mode 100644 games/monop/monop.def create mode 100644 games/monop/monop.ext create mode 100644 games/monop/monop.h create mode 100644 games/monop/morg.c create mode 100644 games/monop/print.c create mode 100644 games/monop/prop.c create mode 100644 games/monop/prop.dat create mode 100644 games/monop/rent.c create mode 100644 games/monop/roll.c create mode 100644 games/monop/spec.c create mode 100644 games/monop/strcmp.c create mode 100644 games/monop/strings create mode 100644 games/monop/trade.c create mode 100644 games/morse.c create mode 100644 games/number.c create mode 100644 games/pdp/Makefile create mode 100644 games/pdp/bj.s create mode 100644 games/pdp/chess/Makefile create mode 100644 games/pdp/chess/README create mode 100644 games/pdp/chess/agen.c create mode 100644 games/pdp/chess/att.s create mode 100644 games/pdp/chess/bgen.s create mode 100644 games/pdp/chess/bheur.c create mode 100644 games/pdp/chess/bmove.s create mode 100644 games/pdp/chess/book.c create mode 100644 games/pdp/chess/bplay.c create mode 100644 games/pdp/chess/ctrl.s create mode 100644 games/pdp/chess/data.c create mode 100644 games/pdp/chess/init.c create mode 100644 games/pdp/chess/io.c create mode 100644 games/pdp/chess/mater.c create mode 100644 games/pdp/chess/old.h create mode 100644 games/pdp/chess/pio.c create mode 100644 games/pdp/chess/play.c create mode 100644 games/pdp/chess/qsort.s create mode 100644 games/pdp/chess/savres.c create mode 100644 games/pdp/chess/setup.c create mode 100644 games/pdp/chess/stat.c create mode 100644 games/pdp/chess/stdin.c create mode 100644 games/pdp/chess/wgen.s create mode 100644 games/pdp/chess/wheur.c create mode 100644 games/pdp/chess/wmove.s create mode 100644 games/pdp/chess/wplay.c create mode 100644 games/pdp/etc.s create mode 100644 games/pdp/factor.nofp.s create mode 100644 games/pdp/factor.s create mode 100644 games/pdp/moo.s create mode 100644 games/pdp/primes.nofp.s create mode 100644 games/pdp/primes.s create mode 100644 games/pdp/ttt.s create mode 100644 games/pdp/us.s create mode 100644 games/pdp/zork/1.s create mode 100644 games/pdp/zork/Makefile create mode 100644 games/pdp/zork/READ_ME create mode 100644 games/pdp/zork/d create mode 100644 games/pdp/zork/dindex.dat create mode 100644 games/pdp/zork/doverlay create mode 100644 games/pdp/zork/dtext.dat create mode 100644 games/pdp/zork/notes create mode 100644 games/pdp/zork/o.s create mode 100755 games/pdp/zork/p1 create mode 100644 games/pdp/zork/z.c create mode 100644 games/pdp/zork/zork.c create mode 100644 games/phantasia/Makefile create mode 100644 games/phantasia/fight.c create mode 100644 games/phantasia/func0.c create mode 100644 games/phantasia/func1.c create mode 100644 games/phantasia/func2.c create mode 100644 games/phantasia/main.c create mode 100644 games/phantasia/monsters create mode 100644 games/phantasia/phant.h create mode 100644 games/phantasia/phant.nr create mode 100644 games/phantasia/phant_run.c create mode 100644 games/phantasia/setfiles.c create mode 100644 games/phantasia/test.c create mode 100644 games/ppt.c create mode 100644 games/primes.c create mode 100644 games/quiz/Makefile create mode 100644 games/quiz/quiz.c create mode 100644 games/quiz/quiz.k/africa create mode 100644 games/quiz/quiz.k/america create mode 100644 games/quiz/quiz.k/areas create mode 100644 games/quiz/quiz.k/arith create mode 100644 games/quiz/quiz.k/asia create mode 100644 games/quiz/quiz.k/babies create mode 100644 games/quiz/quiz.k/bard create mode 100644 games/quiz/quiz.k/chinese create mode 100644 games/quiz/quiz.k/collectives create mode 100644 games/quiz/quiz.k/ed create mode 100644 games/quiz/quiz.k/elements create mode 100644 games/quiz/quiz.k/europe create mode 100644 games/quiz/quiz.k/greek create mode 100644 games/quiz/quiz.k/inca create mode 100644 games/quiz/quiz.k/index create mode 100644 games/quiz/quiz.k/latin create mode 100644 games/quiz/quiz.k/locomotive create mode 100644 games/quiz/quiz.k/midearth create mode 100644 games/quiz/quiz.k/morse create mode 100644 games/quiz/quiz.k/murders create mode 100644 games/quiz/quiz.k/poetry create mode 100644 games/quiz/quiz.k/posneg create mode 100644 games/quiz/quiz.k/pres create mode 100644 games/quiz/quiz.k/province create mode 100644 games/quiz/quiz.k/seq-easy create mode 100644 games/quiz/quiz.k/seq-hard create mode 100644 games/quiz/quiz.k/sexes create mode 100644 games/quiz/quiz.k/sov create mode 100644 games/quiz/quiz.k/spell create mode 100644 games/quiz/quiz.k/state create mode 100644 games/quiz/quiz.k/trek create mode 100644 games/quiz/quiz.k/ucc create mode 100644 games/rain.c create mode 100644 games/robots/Makefile create mode 100644 games/robots/extern.c create mode 100644 games/robots/flush_in.c create mode 100644 games/robots/init_field.c create mode 100644 games/robots/main.c create mode 100644 games/robots/make_level.c create mode 100644 games/robots/move.c create mode 100644 games/robots/move_robs.c create mode 100644 games/robots/play_level.c create mode 100644 games/robots/query.c create mode 100644 games/robots/rnd_pos.c create mode 100644 games/robots/robots.h create mode 100644 games/robots/score.c create mode 100644 games/rogue/CHANGES create mode 100644 games/rogue/Makefile create mode 100644 games/rogue/curses.c create mode 100644 games/rogue/hit.c create mode 100644 games/rogue/init.c create mode 100644 games/rogue/inventory.c create mode 100644 games/rogue/level.c create mode 100644 games/rogue/machdep.c create mode 100644 games/rogue/main.c create mode 100644 games/rogue/message.c create mode 100644 games/rogue/monster.c create mode 100644 games/rogue/move.c create mode 100644 games/rogue/object.c create mode 100644 games/rogue/pack.c create mode 100644 games/rogue/play.c create mode 100644 games/rogue/random.c create mode 100644 games/rogue/ring.c create mode 100644 games/rogue/rogue.h create mode 100644 games/rogue/room.c create mode 100644 games/rogue/save.c create mode 100644 games/rogue/score.c create mode 100644 games/rogue/spec_hit.c create mode 100644 games/rogue/throw.c create mode 100644 games/rogue/trap.c create mode 100644 games/rogue/use.c create mode 100644 games/rogue/zap.c create mode 100644 games/sail/:file create mode 100644 games/sail/:scene create mode 100644 games/sail/:ship create mode 100644 games/sail/:specs create mode 100644 games/sail/Makefile create mode 100644 games/sail/assorted.c create mode 100644 games/sail/dr_1.c create mode 100644 games/sail/dr_2.c create mode 100644 games/sail/dr_3.c create mode 100644 games/sail/dr_4.c create mode 100644 games/sail/dr_5.c create mode 100644 games/sail/dr_main.c create mode 100644 games/sail/driver.h create mode 100644 games/sail/externs.h create mode 100644 games/sail/game.c create mode 100644 games/sail/globals.c create mode 100644 games/sail/lo_main.c create mode 100644 games/sail/machdep.h create mode 100644 games/sail/main.c create mode 100644 games/sail/misc.c create mode 100644 games/sail/parties.c create mode 100644 games/sail/pl_1.c create mode 100644 games/sail/pl_2.c create mode 100644 games/sail/pl_3.c create mode 100644 games/sail/pl_4.c create mode 100644 games/sail/pl_5.c create mode 100644 games/sail/pl_6.c create mode 100644 games/sail/pl_7.c create mode 100644 games/sail/pl_main.c create mode 100644 games/sail/player.h create mode 100644 games/sail/sail.6 create mode 100644 games/sail/sync.c create mode 100644 games/sail/version.c create mode 100644 games/snake/Makefile create mode 100644 games/snake/busy.c create mode 100644 games/snake/move.c create mode 100644 games/snake/snake.c create mode 100644 games/snake/snake.h create mode 100644 games/snake/snscore.c create mode 100644 games/trek/DOC/read_me.nr create mode 100644 games/trek/DOC/things create mode 100644 games/trek/DOC/trekmanual.nr create mode 100644 games/trek/Makefile create mode 100644 games/trek/README create mode 100644 games/trek/abandon.c create mode 100644 games/trek/attack.c create mode 100644 games/trek/autover.c create mode 100644 games/trek/board.x create mode 100644 games/trek/capture.c create mode 100644 games/trek/cgetc.c create mode 100644 games/trek/check_out.c create mode 100644 games/trek/checkcond.c create mode 100644 games/trek/compkl.c create mode 100644 games/trek/computer.c create mode 100644 games/trek/damage.c create mode 100644 games/trek/damaged.c create mode 100644 games/trek/dcrept.c create mode 100644 games/trek/destruct.c create mode 100644 games/trek/dock.c create mode 100644 games/trek/dumpgame.c create mode 100644 games/trek/dumpme.c create mode 100644 games/trek/dumpssradio.c create mode 100644 games/trek/events.c create mode 100644 games/trek/externs.c create mode 100644 games/trek/getcodi.c create mode 100644 games/trek/getpar.c create mode 100644 games/trek/getpar.h create mode 100644 games/trek/help.c create mode 100644 games/trek/impulse.c create mode 100644 games/trek/initquad.c create mode 100644 games/trek/kill.c create mode 100644 games/trek/klmove.c create mode 100644 games/trek/lose.c create mode 100644 games/trek/lrscan.c create mode 100644 games/trek/main.c create mode 100644 games/trek/move.c create mode 100644 games/trek/nova.c create mode 100644 games/trek/out.c create mode 100644 games/trek/phaser.c create mode 100644 games/trek/play.c create mode 100644 games/trek/ram.c create mode 100644 games/trek/ranf.c create mode 100644 games/trek/rest.c create mode 100644 games/trek/schedule.c create mode 100644 games/trek/score.c create mode 100644 games/trek/setup.c create mode 100644 games/trek/setwarp.c create mode 100644 games/trek/shell.c create mode 100644 games/trek/shield.c create mode 100644 games/trek/snova.c create mode 100644 games/trek/srscan.c create mode 100644 games/trek/systemname.c create mode 100644 games/trek/torped.c create mode 100644 games/trek/trek.h create mode 100644 games/trek/utility.c create mode 100644 games/trek/visual.c create mode 100644 games/trek/warp.c create mode 100644 games/trek/win.c create mode 100644 games/wargames.sh create mode 100755 games/warp/Configure create mode 100644 games/warp/EXTERN.h create mode 100644 games/warp/INTERN.h create mode 100644 games/warp/MAKELOG create mode 100644 games/warp/MANIFEST create mode 100644 games/warp/Makefile create mode 100644 games/warp/Makefile.SH create mode 100644 games/warp/README create mode 100755 games/warp/UU/filexp create mode 100644 games/warp/UU/grimble create mode 100644 games/warp/UU/myread create mode 100644 games/warp/bang.c create mode 100644 games/warp/bang.h create mode 100644 games/warp/config.H create mode 100644 games/warp/config.h create mode 100644 games/warp/config.h.SH create mode 100644 games/warp/config.sh create mode 100755 games/warp/filexp create mode 100644 games/warp/init.c create mode 100644 games/warp/init.h create mode 100644 games/warp/intrp.c create mode 100644 games/warp/intrp.h create mode 100755 games/warp/makedepend create mode 100644 games/warp/makedepend.SH create mode 100755 games/warp/makedir create mode 100644 games/warp/makedir.SH create mode 100644 games/warp/move.c create mode 100644 games/warp/move.h create mode 100644 games/warp/ndir.c create mode 100644 games/warp/ndir.h create mode 100644 games/warp/object.c create mode 100644 games/warp/object.h create mode 100644 games/warp/patchlevel.h create mode 100644 games/warp/play.c create mode 100644 games/warp/play.h create mode 100644 games/warp/score.c create mode 100644 games/warp/score.h create mode 100644 games/warp/sig.c create mode 100644 games/warp/sig.h create mode 100644 games/warp/sm.c create mode 100644 games/warp/smp.0 create mode 100644 games/warp/smp.1 create mode 100644 games/warp/smp.2 create mode 100644 games/warp/smp.3 create mode 100644 games/warp/smp.4 create mode 100644 games/warp/smp.5 create mode 100644 games/warp/smp.6 create mode 100644 games/warp/smp.7 create mode 100644 games/warp/term.c create mode 100644 games/warp/term.h create mode 100644 games/warp/them.c create mode 100644 games/warp/them.h create mode 100644 games/warp/us.c create mode 100644 games/warp/us.h create mode 100644 games/warp/util.c create mode 100644 games/warp/util.h create mode 100644 games/warp/version.c create mode 100644 games/warp/version.h create mode 100644 games/warp/warp.c create mode 100644 games/warp/warp.doc create mode 100644 games/warp/warp.h create mode 100644 games/warp/warp.man create mode 100644 games/warp/warp.news create mode 100644 games/warp/weapon.c create mode 100644 games/warp/weapon.h create mode 100644 games/words/Makefile create mode 100644 games/words/words.sh create mode 100644 games/words/words1.c create mode 100644 games/worm.c create mode 100644 games/worms.c create mode 100644 games/wump.c create mode 100644 include/Makefile create mode 100644 include/Makefile.install create mode 100644 include/OLD/dk.h create mode 100644 include/OLD/psout.h create mode 100644 include/a.out.h create mode 100644 include/ar.h create mode 100644 include/arpa/ftp.h create mode 100644 include/arpa/inet.h create mode 100644 include/arpa/nameser.h create mode 100644 include/arpa/telnet.h create mode 100644 include/arpa/tftp.h create mode 100644 include/assert.h create mode 100644 include/ctype.h create mode 100644 include/curses.h create mode 100644 include/dbm.h create mode 100644 include/errno.h create mode 100644 include/fcntl.h create mode 100644 include/frame.h create mode 100644 include/fstab.h create mode 100644 include/grp.h create mode 100644 include/lastlog.h create mode 100644 include/math.h create mode 100644 include/memory.h create mode 100644 include/mp.h create mode 100644 include/mtab.h create mode 100644 include/ndbm.h create mode 100644 include/netdb.h create mode 100644 include/nlist.h create mode 100644 include/pascal/unixio.h create mode 100644 include/pascal/unixio.i create mode 100644 include/paths.h create mode 100644 include/pcc.h create mode 100644 include/protocols/dumprestor.h create mode 100644 include/protocols/routed.h create mode 100644 include/protocols/rwhod.h create mode 100644 include/protocols/talkd.h create mode 100644 include/protocols/timed.h create mode 100644 include/pwd.h create mode 100644 include/ranlib.h create mode 100644 include/regexp.h create mode 100644 include/resolv.h create mode 100644 include/setjmp.h create mode 100644 include/sgtty.h create mode 100644 include/signal.h create mode 100644 include/stab.h create mode 100644 include/stdio.h create mode 100644 include/string.h create mode 100644 include/strings.h create mode 100644 include/struct.h create mode 100644 include/syscall.h create mode 100644 include/sysexits.h create mode 100644 include/syslog.h create mode 100644 include/time.h create mode 100644 include/ttyent.h create mode 100644 include/tzfile.h create mode 100644 include/utmp.h create mode 100644 include/varargs.h create mode 100644 include/vfont.h create mode 100644 include/vmf.h create mode 100644 lib/Makefile create mode 100644 lib/PORT/mip.tar.Z create mode 100644 lib/PORT/pcc.tar.Z create mode 100644 lib/c2/Makefile create mode 100644 lib/c2/c2.h create mode 100644 lib/c2/c20.c create mode 100644 lib/c2/c21.c create mode 100644 lib/ccom/Makefile create mode 100644 lib/ccom/TEST/Makefile create mode 100644 lib/ccom/TEST/README create mode 100644 lib/ccom/TEST/ctest create mode 100644 lib/ccom/TEST/old-assn.l create mode 100644 lib/ccom/TEST/tpr.c create mode 100644 lib/ccom/TEST/tprint.c create mode 100644 lib/ccom/TEST/tst_adec.c create mode 100644 lib/ccom/TEST/tst_asm.c create mode 100644 lib/ccom/TEST/tst_assign.c create mode 100644 lib/ccom/TEST/tst_lgm-g.c create mode 100644 lib/ccom/TEST/tst_lgm.c create mode 100644 lib/ccom/TEST/tst_longsym.c create mode 100644 lib/ccom/TEST/tst_pntint.c create mode 100644 lib/ccom/TEST/tst_rhh-g.c create mode 100644 lib/ccom/TEST/tst_rhh.c create mode 100644 lib/ccom/TEST/tst_sgncmp.c create mode 100644 lib/ccom/c0.h create mode 100644 lib/ccom/c00.c create mode 100644 lib/ccom/c01.c create mode 100644 lib/ccom/c02.c create mode 100644 lib/ccom/c03.c create mode 100644 lib/ccom/c04.c create mode 100644 lib/ccom/c05.c create mode 100644 lib/ccom/c1.h create mode 100644 lib/ccom/c10.c create mode 100644 lib/ccom/c11.c create mode 100644 lib/ccom/c12.c create mode 100644 lib/ccom/c13.c create mode 100644 lib/ccom/cvopt.c create mode 100644 lib/ccom/optable create mode 100644 lib/cpp/Makefile create mode 100644 lib/cpp/README create mode 100644 lib/cpp/cpp.c create mode 100644 lib/cpp/cpy.y create mode 100644 lib/cpp/yylex.c create mode 100644 lib/libc/Makefile create mode 100644 lib/libc/compat-4.1/Makefile create mode 100644 lib/libc/compat-4.1/ftime.c create mode 100644 lib/libc/compat-4.1/gtty.c create mode 100644 lib/libc/compat-4.1/nice.c create mode 100644 lib/libc/compat-4.1/pause.c create mode 100644 lib/libc/compat-4.1/rand.c create mode 100644 lib/libc/compat-4.1/stty.c create mode 100644 lib/libc/compat-4.1/times.c create mode 100644 lib/libc/compat-4.1/utime.c create mode 100644 lib/libc/compat-43/Makefile create mode 100644 lib/libc/compat-43/creat.c create mode 100644 lib/libc/compat-43/gethostid.c create mode 100644 lib/libc/compat-43/sethostid.c create mode 100644 lib/libc/compat-43/setregid.c create mode 100644 lib/libc/compat-43/setreuid.c create mode 100644 lib/libc/compat-43/setrgid.c create mode 100644 lib/libc/compat-43/setruid.c create mode 100644 lib/libc/compat-43/sigcompat.c create mode 100644 lib/libc/compat-sys5/Makefile create mode 100644 lib/libc/compat-sys5/memccpy.c create mode 100644 lib/libc/compat-sys5/memchr.c create mode 100644 lib/libc/compat-sys5/memcmp.c create mode 100644 lib/libc/compat-sys5/memcpy.c create mode 100644 lib/libc/compat-sys5/memset.c create mode 100644 lib/libc/compat-sys5/strchr.c create mode 100644 lib/libc/compat-sys5/strrchr.c create mode 100644 lib/libc/compat-sys5/tmpnam.c create mode 100644 lib/libc/gen/Makefile create mode 100644 lib/libc/gen/abort.c create mode 100644 lib/libc/gen/abs.c create mode 100644 lib/libc/gen/alarm.c create mode 100644 lib/libc/gen/atoi.c create mode 100644 lib/libc/gen/atol.c create mode 100644 lib/libc/gen/bcmp.c create mode 100644 lib/libc/gen/bcopy.c create mode 100644 lib/libc/gen/bzero.c create mode 100644 lib/libc/gen/calloc.c create mode 100644 lib/libc/gen/closedir.c create mode 100644 lib/libc/gen/crypt.c create mode 100644 lib/libc/gen/ctime.c create mode 100644 lib/libc/gen/ctype_.c create mode 100644 lib/libc/gen/daemon.c create mode 100644 lib/libc/gen/devname.c create mode 100644 lib/libc/gen/disklabel.c create mode 100644 lib/libc/gen/err.c create mode 100644 lib/libc/gen/execvp.c create mode 100644 lib/libc/gen/fabs.c create mode 100644 lib/libc/gen/fakcu.c create mode 100644 lib/libc/gen/ffs.c create mode 100644 lib/libc/gen/frexp.c create mode 100644 lib/libc/gen/fstab.c create mode 100644 lib/libc/gen/gcvt.c create mode 100644 lib/libc/gen/getenv.c create mode 100644 lib/libc/gen/getgrent.c create mode 100644 lib/libc/gen/getgrgid.c create mode 100644 lib/libc/gen/getgrnam.c create mode 100644 lib/libc/gen/getgrouplist.c create mode 100644 lib/libc/gen/gethostname.c create mode 100644 lib/libc/gen/getloadavg.c create mode 100644 lib/libc/gen/getlogin.c create mode 100644 lib/libc/gen/getmntinfo.c create mode 100644 lib/libc/gen/getpagesize.c create mode 100644 lib/libc/gen/getpass.c create mode 100644 lib/libc/gen/getpwent.c create mode 100644 lib/libc/gen/getttyent.c create mode 100644 lib/libc/gen/getttynam.c create mode 100644 lib/libc/gen/getusershell.c create mode 100644 lib/libc/gen/getwd.c create mode 100644 lib/libc/gen/index.c create mode 100644 lib/libc/gen/initgroups.c create mode 100644 lib/libc/gen/insque.c create mode 100644 lib/libc/gen/isatty.c create mode 100644 lib/libc/gen/malloc.c create mode 100644 lib/libc/gen/mktemp.c create mode 100644 lib/libc/gen/ndbm.c create mode 100644 lib/libc/gen/nlist.c create mode 100644 lib/libc/gen/opendir.c create mode 100644 lib/libc/gen/perror.c create mode 100644 lib/libc/gen/popen.c create mode 100644 lib/libc/gen/psignal.c create mode 100644 lib/libc/gen/qsort.c create mode 100644 lib/libc/gen/random.c create mode 100644 lib/libc/gen/readdir.c create mode 100644 lib/libc/gen/regex.c create mode 100644 lib/libc/gen/remque.c create mode 100644 lib/libc/gen/rindex.c create mode 100644 lib/libc/gen/scandir.c create mode 100644 lib/libc/gen/seekdir.c create mode 100644 lib/libc/gen/setenv.c create mode 100644 lib/libc/gen/sethostname.c create mode 100644 lib/libc/gen/setmode.c create mode 100644 lib/libc/gen/siginterrupt.c create mode 100644 lib/libc/gen/siglist.c create mode 100644 lib/libc/gen/signal.c create mode 100644 lib/libc/gen/sigsetops.c create mode 100644 lib/libc/gen/sleep.c create mode 100644 lib/libc/gen/strcasecmp.c create mode 100644 lib/libc/gen/strcat.c create mode 100644 lib/libc/gen/strcmp.c create mode 100644 lib/libc/gen/strcpy.c create mode 100644 lib/libc/gen/strdup.c create mode 100644 lib/libc/gen/strftime.c create mode 100644 lib/libc/gen/strlen.c create mode 100644 lib/libc/gen/strncat.c create mode 100644 lib/libc/gen/strncmp.c create mode 100644 lib/libc/gen/strncpy.c create mode 100644 lib/libc/gen/swab.c create mode 100644 lib/libc/gen/sysctl.c create mode 100644 lib/libc/gen/syserrlst.c create mode 100644 lib/libc/gen/syslog.c create mode 100644 lib/libc/gen/system.c create mode 100644 lib/libc/gen/telldir.c create mode 100644 lib/libc/gen/time.c create mode 100644 lib/libc/gen/timezone.c create mode 100644 lib/libc/gen/ttyname.c create mode 100644 lib/libc/gen/ttyslot.c create mode 100644 lib/libc/gen/ualarm.c create mode 100644 lib/libc/gen/uname.c create mode 100644 lib/libc/gen/usleep.c create mode 100644 lib/libc/gen/valloc.c create mode 100644 lib/libc/gen/wait.c create mode 100644 lib/libc/gen/wait3.c create mode 100644 lib/libc/gen/waitpid.c create mode 100644 lib/libc/inet/Makefile create mode 100644 lib/libc/inet/inet_addr.c create mode 100644 lib/libc/inet/inet_lnaof.c create mode 100644 lib/libc/inet/inet_maddr.c create mode 100644 lib/libc/inet/inet_netof.c create mode 100644 lib/libc/inet/inet_network.c create mode 100644 lib/libc/inet/inet_ntoa.c create mode 100644 lib/libc/net/Makefile create mode 100644 lib/libc/net/getnbyaddr.c create mode 100644 lib/libc/net/getnbyname.c create mode 100644 lib/libc/net/getnent.c create mode 100644 lib/libc/net/getpent.c create mode 100644 lib/libc/net/getpname.c create mode 100644 lib/libc/net/getproto.c create mode 100644 lib/libc/net/getsbyname.c create mode 100644 lib/libc/net/getsbyport.c create mode 100644 lib/libc/net/getsent.c create mode 100644 lib/libc/net/herror.c create mode 100644 lib/libc/net/hosttable/Makefile create mode 100644 lib/libc/net/hosttable/gethnamadr.c create mode 100644 lib/libc/net/hosttable/gethostent.c create mode 100644 lib/libc/net/named/Makefile create mode 100644 lib/libc/net/named/gethnamadr.c create mode 100644 lib/libc/net/named/sethostent.c create mode 100644 lib/libc/net/rcmd.c create mode 100644 lib/libc/net/res_comp.c create mode 100644 lib/libc/net/res_debug.c create mode 100644 lib/libc/net/res_init.c create mode 100644 lib/libc/net/res_mkquery.c create mode 100644 lib/libc/net/res_query.c create mode 100644 lib/libc/net/res_send.c create mode 100644 lib/libc/net/rexec.c create mode 100644 lib/libc/net/ruserpass.c create mode 100644 lib/libc/ns/Makefile create mode 100644 lib/libc/ns/ns_addr.c create mode 100644 lib/libc/ns/ns_ntoa.c create mode 100644 lib/libc/pdp/Makefile create mode 100644 lib/libc/pdp/compat-2.9/Makefile create mode 120000 lib/libc/pdp/compat-2.9/SYS.h create mode 100644 lib/libc/pdp/compat-2.9/fetchi.s create mode 100644 lib/libc/pdp/compat-2.9/fperr.s create mode 100644 lib/libc/pdp/compat-2.9/l3.c create mode 100644 lib/libc/pdp/compat-2.9/lock.s create mode 100644 lib/libc/pdp/compat-2.9/phys.s create mode 100644 lib/libc/pdp/compat-2.9/ucall.s create mode 120000 lib/libc/pdp/crt/DEFS.h create mode 100644 lib/libc/pdp/crt/Makefile create mode 100644 lib/libc/pdp/crt/aldiv.s create mode 100644 lib/libc/pdp/crt/almul.s create mode 100644 lib/libc/pdp/crt/alrem.s create mode 100644 lib/libc/pdp/crt/csv.s create mode 100644 lib/libc/pdp/crt/ldiv.s create mode 100644 lib/libc/pdp/crt/lmul.s create mode 100644 lib/libc/pdp/crt/lrem.s create mode 100644 lib/libc/pdp/crt/udiv.s create mode 100644 lib/libc/pdp/crt/uldiv.s create mode 100644 lib/libc/pdp/crt/ulrem.s create mode 100644 lib/libc/pdp/crt/ulsh.s create mode 100644 lib/libc/pdp/crt/ultof.s create mode 100644 lib/libc/pdp/csu/Makefile create mode 100644 lib/libc/pdp/csu/PORT/gmon.c create mode 100644 lib/libc/pdp/csu/PORT/gmon.ex create mode 100644 lib/libc/pdp/csu/PORT/gmon.h create mode 100644 lib/libc/pdp/csu/crt0.s create mode 100644 lib/libc/pdp/csu/mcount.s create mode 100644 lib/libc/pdp/csu/mon.c create mode 100644 lib/libc/pdp/csu/mon.ex create mode 100644 lib/libc/pdp/gen/DEFS.h create mode 100644 lib/libc/pdp/gen/Makefile create mode 100644 lib/libc/pdp/gen/_setjmp.s create mode 100644 lib/libc/pdp/gen/abs.s create mode 100644 lib/libc/pdp/gen/alloca.s create mode 100644 lib/libc/pdp/gen/atof.c create mode 100644 lib/libc/pdp/gen/bcmp.s create mode 100644 lib/libc/pdp/gen/bcopy.s create mode 100644 lib/libc/pdp/gen/bzero.s create mode 100644 lib/libc/pdp/gen/ecvt.c create mode 100644 lib/libc/pdp/gen/fabs.s create mode 100644 lib/libc/pdp/gen/ffs.s create mode 100644 lib/libc/pdp/gen/frexp.s create mode 100644 lib/libc/pdp/gen/index.s create mode 100644 lib/libc/pdp/gen/insque.s create mode 100644 lib/libc/pdp/gen/ldexp.s create mode 100644 lib/libc/pdp/gen/ldfps.s create mode 100644 lib/libc/pdp/gen/modf.s create mode 100644 lib/libc/pdp/gen/nsym.c create mode 100644 lib/libc/pdp/gen/remque.s create mode 100644 lib/libc/pdp/gen/rindex.s create mode 100644 lib/libc/pdp/gen/rollback.s create mode 100644 lib/libc/pdp/gen/setjmp.s create mode 100644 lib/libc/pdp/gen/setjmperr.c create mode 100644 lib/libc/pdp/gen/strcat.s create mode 100644 lib/libc/pdp/gen/strcmp.s create mode 100644 lib/libc/pdp/gen/strcpy.s create mode 100644 lib/libc/pdp/gen/strlen.s create mode 100644 lib/libc/pdp/gen/strncat.s create mode 100644 lib/libc/pdp/gen/strncmp.s create mode 100644 lib/libc/pdp/gen/strncpy.s create mode 120000 lib/libc/pdp/net/DEFS.h create mode 100644 lib/libc/pdp/net/Makefile create mode 100644 lib/libc/pdp/net/htonl.s create mode 100644 lib/libc/pdp/net/htons.s create mode 120000 lib/libc/pdp/stdio/DEFS.h create mode 100644 lib/libc/pdp/stdio/Makefile create mode 100644 lib/libc/pdp/stdio/STDIO.h create mode 100644 lib/libc/pdp/stdio/doprnt.s create mode 100644 lib/libc/pdp/stdio/ffltpr.s create mode 100644 lib/libc/pdp/stdio/fgetc.s create mode 100644 lib/libc/pdp/stdio/fgets.s create mode 100644 lib/libc/pdp/stdio/fltpr.s create mode 100644 lib/libc/pdp/stdio/fputc.s create mode 100644 lib/libc/pdp/stdio/gets.s create mode 100644 lib/libc/pdp/stdio/puts.s create mode 100644 lib/libc/pdp/sys/Makefile create mode 100644 lib/libc/pdp/sys/SYS.h create mode 100644 lib/libc/pdp/sys/_exit.s create mode 100644 lib/libc/pdp/sys/brk.s create mode 100644 lib/libc/pdp/sys/execl.s create mode 100644 lib/libc/pdp/sys/execle.s create mode 100644 lib/libc/pdp/sys/execv.s create mode 100644 lib/libc/pdp/sys/fork.s create mode 100644 lib/libc/pdp/sys/pipe.s create mode 100644 lib/libc/pdp/sys/ptrace.s create mode 100644 lib/libc/pdp/sys/sbrk.s create mode 100644 lib/libc/pdp/sys/setlogin.s create mode 100644 lib/libc/pdp/sys/sigaction.s create mode 100644 lib/libc/pdp/sys/sigreturn.s create mode 100644 lib/libc/pdp/sys/vfork.s create mode 100644 lib/libc/stdio/Makefile create mode 100644 lib/libc/stdio/clrerr.c create mode 100644 lib/libc/stdio/doscan.c create mode 100644 lib/libc/stdio/exit.c create mode 100644 lib/libc/stdio/fdopen.c create mode 100644 lib/libc/stdio/fgetc.c create mode 100644 lib/libc/stdio/fgets.c create mode 100644 lib/libc/stdio/filbuf.c create mode 100644 lib/libc/stdio/findiop.c create mode 100644 lib/libc/stdio/flsbuf.c create mode 100644 lib/libc/stdio/fopen.c create mode 100644 lib/libc/stdio/fprintf.c create mode 100644 lib/libc/stdio/fputc.c create mode 100644 lib/libc/stdio/fputs.c create mode 100644 lib/libc/stdio/fread.c create mode 100644 lib/libc/stdio/freopen.c create mode 100644 lib/libc/stdio/fseek.c create mode 100644 lib/libc/stdio/ftell.c create mode 100644 lib/libc/stdio/fwrite.c create mode 100644 lib/libc/stdio/getchar.c create mode 100644 lib/libc/stdio/gets.c create mode 100644 lib/libc/stdio/getw.c create mode 100644 lib/libc/stdio/printf.c create mode 100644 lib/libc/stdio/putchar.c create mode 100644 lib/libc/stdio/puts.c create mode 100644 lib/libc/stdio/putw.c create mode 100644 lib/libc/stdio/rew.c create mode 100644 lib/libc/stdio/scanf.c create mode 100644 lib/libc/stdio/setbuf.c create mode 100644 lib/libc/stdio/setbuffer.c create mode 100644 lib/libc/stdio/setvbuf.c create mode 100644 lib/libc/stdio/sprintf.c create mode 100644 lib/libc/stdio/strout.c create mode 100644 lib/libc/stdio/ungetc.c create mode 100644 lib/libc/stdio/vfprintf.c create mode 100644 lib/libc/stdio/vprintf.c create mode 100644 lib/libc/stdio/vsprintf.c create mode 100644 lib/libc/stdlib/Makefile create mode 100644 lib/libc/stdlib/getopt.c create mode 100644 lib/libc/stdlib/getsubopt.c create mode 100644 lib/libc/stdlib/strtol.c create mode 100644 lib/libc/stdlib/strtoul.c create mode 100644 lib/libc/string/Makefile create mode 100644 lib/libc/string/strcspn.c create mode 100644 lib/libc/string/strerror.c create mode 100644 lib/libc/string/strpbrk.c create mode 100644 lib/libc/string/strsep.c create mode 100644 lib/libc/string/strspn.c create mode 100644 lib/libc/string/strstr.c create mode 100644 lib/libc/string/strtok.c create mode 100644 lib/libc/tags create mode 100644 lib/libkern/Makefile create mode 100644 lib/mip/CONVERT create mode 100644 lib/mip/FCONVERT create mode 100644 lib/mip/INDEX create mode 100644 lib/mip/allo.c create mode 100644 lib/mip/cgram.y create mode 100644 lib/mip/common.c create mode 100644 lib/mip/config.h create mode 100644 lib/mip/fort.c create mode 100644 lib/mip/manifest.h create mode 100644 lib/mip/match.c create mode 100644 lib/mip/ndu.h create mode 100644 lib/mip/onepass.h create mode 100644 lib/mip/optim.c create mode 100644 lib/mip/pass1.h create mode 100644 lib/mip/pass2.h create mode 100644 lib/mip/pftn.c create mode 100644 lib/mip/reader.c create mode 100644 lib/mip/scan.c create mode 100644 lib/mip/trees.c create mode 100644 lib/mip/xdefs.c create mode 100755 lib/pcc/:yyfix create mode 100644 lib/pcc/DEBUGS create mode 100644 lib/pcc/INFO create mode 100644 lib/pcc/Makefile create mode 100644 lib/pcc/Makefile.twopass create mode 100644 lib/pcc/code.c create mode 100644 lib/pcc/fort.h create mode 100644 lib/pcc/local.c create mode 100644 lib/pcc/local2.c create mode 100644 lib/pcc/localdefs.h create mode 100644 lib/pcc/mac2defs.h create mode 100644 lib/pcc/macdefs.h create mode 100644 lib/pcc/order.c create mode 100644 lib/pcc/stab.c create mode 100644 lib/pcc/table.c create mode 100644 libexec/Makefile create mode 100644 libexec/acctd/Makefile create mode 100644 libexec/acctd/acctd.8 create mode 100644 libexec/acctd/acctd.c create mode 100644 libexec/comsat/Makefile create mode 100644 libexec/comsat/comsat.8 create mode 100644 libexec/comsat/comsat.c create mode 100644 libexec/ctimed/Makefile create mode 100644 libexec/ctimed/ctimed.c create mode 100644 libexec/fingerd/Makefile create mode 100644 libexec/fingerd/fingerd.8 create mode 100644 libexec/fingerd/fingerd.c create mode 100644 libexec/fingerd/pathnames.h create mode 100644 libexec/ftpd/Makefile create mode 100644 libexec/ftpd/ftpcmd.y create mode 100644 libexec/ftpd/ftpd.8 create mode 100644 libexec/ftpd/ftpd.c create mode 120000 libexec/ftpd/glob.c create mode 100644 libexec/ftpd/logwtmp.c create mode 100644 libexec/ftpd/newvers.sh create mode 100644 libexec/ftpd/pathnames.h create mode 100644 libexec/ftpd/popen.c create mode 100644 libexec/ftpd/vers.c create mode 100644 libexec/ftpd/version create mode 100644 libexec/getNAME/Makefile create mode 100644 libexec/getNAME/getNAME.c create mode 100644 libexec/getty/Makefile create mode 100644 libexec/getty/get_date.c create mode 100644 libexec/getty/gettytab.c create mode 100644 libexec/getty/gettytab.h create mode 100644 libexec/getty/init.c create mode 100644 libexec/getty/main.c create mode 100644 libexec/getty/subr.c create mode 100644 libexec/identd/CREDITS create mode 100644 libexec/identd/ChangeLog create mode 100644 libexec/identd/FAQ create mode 100644 libexec/identd/INSTALL create mode 100644 libexec/identd/Makefile create mode 100644 libexec/identd/README create mode 100644 libexec/identd/READMEs/README.DES create mode 100644 libexec/identd/READMEs/README.aix create mode 100644 libexec/identd/READMEs/README.dynix3 create mode 100644 libexec/identd/READMEs/README.irix4 create mode 100644 libexec/identd/READMEs/README.irix5 create mode 100644 libexec/identd/READMEs/README.next create mode 100644 libexec/identd/READMEs/README.next31-m68k-i486 create mode 100644 libexec/identd/READMEs/README.ptx create mode 100644 libexec/identd/READMEs/README.riscos4 create mode 100644 libexec/identd/READMEs/README.sunos3 create mode 100644 libexec/identd/READMEs/README.sunos4 create mode 100644 libexec/identd/READMEs/README.sunos5 create mode 100644 libexec/identd/READMEs/README.ultrix create mode 100644 libexec/identd/READMEs/README.unicos6 create mode 100644 libexec/identd/TODO create mode 100644 libexec/identd/doc/RFC1413 create mode 100644 libexec/identd/doc/TAP.doc create mode 100644 libexec/identd/doc/TAPvsIDENT create mode 100644 libexec/identd/doc/TESTRESULTS create mode 100644 libexec/identd/doc/why-encrypt.txt create mode 100644 libexec/identd/doc/why-ident.txt create mode 100644 libexec/identd/doc/why-tap.txt create mode 100644 libexec/identd/idecrypt.man create mode 100755 libexec/identd/identconn.sh create mode 100644 libexec/identd/identd.8 create mode 100644 libexec/identd/identd.man create mode 100755 libexec/identd/install-sh create mode 100644 libexec/identd/src/Makefile create mode 100644 libexec/identd/src/config.c create mode 100644 libexec/identd/src/crypto.c create mode 100644 libexec/identd/src/crypto.h create mode 100644 libexec/identd/src/error.h create mode 100644 libexec/identd/src/idecrypt.c create mode 100644 libexec/identd/src/identd.c create mode 100644 libexec/identd/src/identd.h create mode 100644 libexec/identd/src/itest.c create mode 100644 libexec/identd/src/kernel/2.11bsd.c create mode 100644 libexec/identd/src/kernel/386bsd.c create mode 100644 libexec/identd/src/kernel/4.3bsd.c create mode 100644 libexec/identd/src/kernel/aix.c create mode 100644 libexec/identd/src/kernel/alpha3.c create mode 100644 libexec/identd/src/kernel/apollo.c create mode 100644 libexec/identd/src/kernel/aux.c create mode 100644 libexec/identd/src/kernel/aux301.c create mode 100644 libexec/identd/src/kernel/bsdi.c create mode 100644 libexec/identd/src/kernel/freebsd.c create mode 100644 libexec/identd/src/kernel/hpux.c create mode 100644 libexec/identd/src/kernel/irix4.c create mode 100644 libexec/identd/src/kernel/irix5.c create mode 100644 libexec/identd/src/kernel/kvm.h create mode 100644 libexec/identd/src/kernel/linux.c create mode 100644 libexec/identd/src/kernel/machten.c create mode 100644 libexec/identd/src/kernel/netbsd.c create mode 100644 libexec/identd/src/kernel/next_mach.c create mode 100644 libexec/identd/src/kernel/other.c create mode 100644 libexec/identd/src/kernel/ptx2.c create mode 100644 libexec/identd/src/kernel/ptx4.c create mode 100644 libexec/identd/src/kernel/sco324.c create mode 100644 libexec/identd/src/kernel/sco32_42+5.c create mode 100644 libexec/identd/src/kernel/sunos4.c create mode 100644 libexec/identd/src/kernel/sunos5.c create mode 100644 libexec/identd/src/kernel/svr4.c create mode 100644 libexec/identd/src/kernel/unicos6.c create mode 100644 libexec/identd/src/kernel/uw2.c create mode 100644 libexec/identd/src/kvm.c create mode 100644 libexec/identd/src/parse.c create mode 100644 libexec/identd/src/paths.h create mode 100644 libexec/identd/src/proxy.c create mode 100644 libexec/identd/src/version.c create mode 100644 libexec/identd/testdir/Makefile create mode 100644 libexec/identd/testdir/test1.c create mode 100644 libexec/makekey/Makefile create mode 100644 libexec/makekey/makekey.c create mode 100644 libexec/popper/Makefile create mode 100644 libexec/popper/README create mode 100644 libexec/popper/pop3.rfc1081 create mode 100644 libexec/popper/pop3e.rfc1082 create mode 100644 libexec/popper/pop_dele.c create mode 100644 libexec/popper/pop_dropcopy.c create mode 100644 libexec/popper/pop_dropinfo.c create mode 100644 libexec/popper/pop_get_command.c create mode 100644 libexec/popper/pop_get_subcommand.c create mode 100644 libexec/popper/pop_init.c create mode 100644 libexec/popper/pop_last.c create mode 100644 libexec/popper/pop_list.c create mode 100644 libexec/popper/pop_log.c create mode 100644 libexec/popper/pop_lower.c create mode 100644 libexec/popper/pop_msg.c create mode 100644 libexec/popper/pop_parse.c create mode 100644 libexec/popper/pop_pass.c create mode 100644 libexec/popper/pop_quit.c create mode 100644 libexec/popper/pop_rset.c create mode 100644 libexec/popper/pop_send.c create mode 100644 libexec/popper/pop_stat.c create mode 100644 libexec/popper/pop_updt.c create mode 100644 libexec/popper/pop_user.c create mode 100644 libexec/popper/pop_xmit.c create mode 100644 libexec/popper/pop_xtnd.c create mode 100644 libexec/popper/popper.8 create mode 100644 libexec/popper/popper.c create mode 100644 libexec/popper/popper.h create mode 100644 libexec/popper/version.h create mode 100644 libexec/rexecd/Makefile create mode 100644 libexec/rexecd/rexecd.8 create mode 100644 libexec/rexecd/rexecd.c create mode 100644 libexec/rlogind/Makefile create mode 100644 libexec/rlogind/rlogind.8 create mode 100644 libexec/rlogind/rlogind.c create mode 100644 libexec/rshd/Makefile create mode 100644 libexec/rshd/pathnames.h create mode 100644 libexec/rshd/rshd.8 create mode 100644 libexec/rshd/rshd.c create mode 100644 libexec/talkd/Makefile create mode 100644 libexec/talkd/announce.c create mode 100644 libexec/talkd/print.c create mode 100644 libexec/talkd/process.c create mode 100644 libexec/talkd/table.c create mode 100644 libexec/talkd/talkd.8 create mode 100644 libexec/talkd/talkd.c create mode 100644 libexec/tcpd/BLURB create mode 100644 libexec/tcpd/Banners.Makefile create mode 100644 libexec/tcpd/CHANGES create mode 100644 libexec/tcpd/DISCLAIMER create mode 100644 libexec/tcpd/Makefile create mode 100644 libexec/tcpd/Makefile.orig create mode 100644 libexec/tcpd/README create mode 100644 libexec/tcpd/README.IRIX create mode 100644 libexec/tcpd/README.NIS create mode 100644 libexec/tcpd/clean_exit.c create mode 100644 libexec/tcpd/diag.c create mode 100644 libexec/tcpd/environ.c create mode 100644 libexec/tcpd/eval.c create mode 100644 libexec/tcpd/fakelog.c create mode 100644 libexec/tcpd/fix_options.c create mode 100644 libexec/tcpd/fromhost.c create mode 100644 libexec/tcpd/hosts_access.3 create mode 100644 libexec/tcpd/hosts_access.5 create mode 100644 libexec/tcpd/hosts_access.c create mode 100644 libexec/tcpd/hosts_ctl.c create mode 100644 libexec/tcpd/hosts_options.5 create mode 100644 libexec/tcpd/inetcf.c create mode 100644 libexec/tcpd/inetcf.h create mode 100644 libexec/tcpd/misc.c create mode 100644 libexec/tcpd/miscd.c create mode 100644 libexec/tcpd/mystdarg.h create mode 100644 libexec/tcpd/myvsyslog.c create mode 100644 libexec/tcpd/ncr.c create mode 100644 libexec/tcpd/options.c create mode 100644 libexec/tcpd/patchlevel.h create mode 100644 libexec/tcpd/percent_m.c create mode 100644 libexec/tcpd/percent_x.c create mode 100644 libexec/tcpd/printf.ck create mode 100644 libexec/tcpd/ptx.c create mode 100644 libexec/tcpd/refuse.c create mode 100644 libexec/tcpd/rfc931.c create mode 100644 libexec/tcpd/safe_finger.c create mode 100644 libexec/tcpd/scaffold.c create mode 100644 libexec/tcpd/scaffold.h create mode 100644 libexec/tcpd/setenv.c create mode 100644 libexec/tcpd/shell_cmd.c create mode 100644 libexec/tcpd/socket.c create mode 100644 libexec/tcpd/strcasecmp.c create mode 100644 libexec/tcpd/tcpd.8 create mode 100644 libexec/tcpd/tcpd.c create mode 100644 libexec/tcpd/tcpd.h create mode 100644 libexec/tcpd/tcpdchk.8 create mode 100644 libexec/tcpd/tcpdchk.c create mode 100644 libexec/tcpd/tcpdmatch.8 create mode 100644 libexec/tcpd/tcpdmatch.c create mode 100644 libexec/tcpd/tli-sequent.c create mode 100644 libexec/tcpd/tli-sequent.h create mode 100644 libexec/tcpd/tli.c create mode 100644 libexec/tcpd/try-from.c create mode 100644 libexec/tcpd/update.c create mode 100644 libexec/tcpd/vfprintf.c create mode 100644 libexec/tcpd/workarounds.c create mode 100644 libexec/telnetd/Makefile create mode 100644 libexec/telnetd/telnetd.8 create mode 100644 libexec/telnetd/telnetd.c create mode 100644 libexec/tftpd/Makefile create mode 100644 libexec/tftpd/tftpd.8 create mode 100644 libexec/tftpd/tftpd.c create mode 120000 libexec/tftpd/tftpsubs.c create mode 100644 local/Makefile create mode 100644 local/afio/Makefile create mode 100644 local/afio/README create mode 100644 local/afio/afio.1 create mode 100644 local/afio/afio.c create mode 100644 local/cxref/README create mode 100644 local/cxref/SORT1 create mode 100644 local/cxref/SORT2 create mode 100644 local/cxref/SORT3 create mode 100644 local/cxref/basename.c create mode 100644 local/cxref/constdefs.h create mode 100644 local/cxref/cscan.l create mode 100644 local/cxref/cxref.1 create mode 100644 local/cxref/cxref.c create mode 100644 local/cxref/cxrfilt.c create mode 100644 local/cxref/docxref.c create mode 100644 local/cxref/fmtxref.c create mode 100644 local/cxref/makefile create mode 100644 local/ddd/Makefile create mode 100644 local/ddd/README create mode 100644 local/ddd/ddd.1 create mode 100644 local/ddd/ddd.c create mode 100644 local/decompr16.c create mode 100644 local/less/README create mode 100644 local/less/ch.c create mode 100644 local/less/command.c create mode 100644 local/less/funcs.h create mode 100644 local/less/help.c create mode 100644 local/less/input.c create mode 100755 local/less/install create mode 100644 local/less/less.h create mode 100644 local/less/less.help create mode 100644 local/less/less.nro create mode 100644 local/less/line.c create mode 100644 local/less/main.c create mode 100644 local/less/makefile create mode 100644 local/less/mkfuncs.awk create mode 100644 local/less/option.c create mode 100644 local/less/output.c create mode 100644 local/less/position.c create mode 100644 local/less/position.h create mode 100644 local/less/prim.c create mode 100644 local/less/prompt.c create mode 100644 local/less/screen.c create mode 100644 local/less/signal.c create mode 100644 local/less/ttyin.c create mode 100644 local/less/version.c create mode 100644 local/mkovmake/Makefile create mode 100644 local/mkovmake/README create mode 100644 local/mkovmake/mkovmake.1 create mode 100644 local/mkovmake/mkovmake.c create mode 100644 local/mp/CHANGES create mode 100644 local/mp/Data/Mail create mode 100644 local/mp/Data/MailFolder create mode 100644 local/mp/Data/NewsArticle1 create mode 100644 local/mp/Data/NewsArticle2 create mode 100644 local/mp/Data/NewsDigest create mode 100644 local/mp/FILES create mode 100644 local/mp/MANIFEST create mode 100644 local/mp/Makefile create mode 100644 local/mp/Makefile.dist create mode 100644 local/mp/README create mode 100644 local/mp/TODO create mode 100644 local/mp/extern.h create mode 100644 local/mp/header.c create mode 100644 local/mp/io.c create mode 100644 local/mp/mailp create mode 100644 local/mp/mailp.man create mode 100644 local/mp/mailp.man.text create mode 100644 local/mp/main.c create mode 100644 local/mp/misc.c create mode 100644 local/mp/mp.common.ps create mode 100644 local/mp/mp.el create mode 100644 local/mp/mp.h create mode 100644 local/mp/mp.man create mode 100644 local/mp/mp.man.text create mode 100644 local/mp/mp.pro.alt.ps create mode 100644 local/mp/mp.pro.altl.ps create mode 100644 local/mp/mp.pro.ff.ps create mode 100644 local/mp/mp.pro.fp.ps create mode 100644 local/mp/mp.pro.l.ps create mode 100644 local/mp/mp.pro.ps create mode 100644 local/mp/mp.pro.tm.ps create mode 100644 local/mp/mp.pro.ts.ps create mode 100644 local/mp/patchlevel.h create mode 100644 local/mp/print.c create mode 100644 local/mtools/Configure create mode 100644 local/mtools/Makefile create mode 100644 local/mtools/Mattrib.1 create mode 100644 local/mtools/Mcd.1 create mode 100644 local/mtools/Mcopy.1 create mode 100644 local/mtools/Mdel.1 create mode 100644 local/mtools/Mdir.1 create mode 100644 local/mtools/Mformat.1 create mode 100644 local/mtools/Mkmanifest.1 create mode 100644 local/mtools/Mlabel.1 create mode 100644 local/mtools/Mmd.1 create mode 100644 local/mtools/Mrd.1 create mode 100644 local/mtools/Mread.1 create mode 100644 local/mtools/Mren.1 create mode 100644 local/mtools/Mtools.1 create mode 100644 local/mtools/Mtype.1 create mode 100644 local/mtools/Mwrite.1 create mode 100644 local/mtools/Readme create mode 100644 local/mtools/Release.notes create mode 100644 local/mtools/buf_read.c create mode 100644 local/mtools/buf_write.c create mode 100644 local/mtools/devices.c create mode 100644 local/mtools/dir_make.c create mode 100644 local/mtools/dir_read.c create mode 100644 local/mtools/dir_write.c create mode 100644 local/mtools/expand.c create mode 100644 local/mtools/fat_free.c create mode 100644 local/mtools/fat_read.c create mode 100644 local/mtools/fat_write.c create mode 100644 local/mtools/file_read.c create mode 100644 local/mtools/file_write.c create mode 100644 local/mtools/init.c create mode 100644 local/mtools/is_dir.c create mode 100644 local/mtools/match.c create mode 100644 local/mtools/mattrib.c create mode 100644 local/mtools/mcd.c create mode 100644 local/mtools/mcopy.c create mode 100644 local/mtools/mdel.c create mode 100644 local/mtools/mdir.c create mode 100644 local/mtools/mformat.c create mode 100644 local/mtools/mkmanifest.c create mode 100644 local/mtools/mlabel.c create mode 100644 local/mtools/mmd.c create mode 100644 local/mtools/mrd.c create mode 100644 local/mtools/mread.c create mode 100644 local/mtools/mren.c create mode 100644 local/mtools/msdos.h create mode 100644 local/mtools/mtype.c create mode 100644 local/mtools/mwrite.c create mode 100644 local/mtools/parse.c create mode 100644 local/mtools/patchlevel.h create mode 100644 local/mtools/subdir.c create mode 100644 local/qterm/Makefile create mode 100644 local/qterm/README create mode 100644 local/qterm/options.3 create mode 100644 local/qterm/options.c create mode 100644 local/qterm/options.h create mode 100644 local/qterm/qterm.1 create mode 100644 local/qterm/qterm.c create mode 100644 local/qterm/qterm.h create mode 100644 local/qterm/qtermtab create mode 100644 local/trace.c create mode 100644 local/welcome/Makefile create mode 100644 local/welcome/README create mode 100644 local/welcome/cpu.h create mode 100644 local/welcome/welcome.1 create mode 100644 local/welcome/welcome.c create mode 100644 local/zmodem/Makefile create mode 100644 local/zmodem/crc.1 create mode 100644 local/zmodem/crc.c create mode 100644 local/zmodem/crctab.c create mode 100644 local/zmodem/genie.c create mode 100644 local/zmodem/makefile.generic create mode 100644 local/zmodem/minirb.1 create mode 100644 local/zmodem/minirb.c create mode 100644 local/zmodem/ptest.sh create mode 100644 local/zmodem/rbsb.c create mode 100644 local/zmodem/rz.1 create mode 100644 local/zmodem/rz.c create mode 100644 local/zmodem/sz.1 create mode 100644 local/zmodem/sz.c create mode 100644 local/zmodem/vmodem.h create mode 100644 local/zmodem/vrzsz.c create mode 100644 local/zmodem/vupl.t create mode 100644 local/zmodem/vuplfile.t create mode 100644 local/zmodem/vvmodem.c create mode 100644 local/zmodem/zm.c create mode 100644 local/zmodem/zmodem.h create mode 100644 local/zmodem/zmr.c create mode 100644 local/zmodem/zupl.t create mode 100644 man/Makefile create mode 100644 man/makewhatis.sed create mode 100644 man/man.template create mode 100644 man/man0/Makefile create mode 100644 man/man0/break create mode 100644 man/man0/cshcmd create mode 100644 man/man0/ignore create mode 100644 man/man0/intro.ms create mode 100644 man/man0/preface.ms create mode 100644 man/man0/ptx.in create mode 100644 man/man0/ptxx create mode 100644 man/man0/title.prm create mode 100644 man/man0/title.urm create mode 100644 man/man0/toc.in create mode 100644 man/man0/toc1 create mode 100644 man/man0/toc2 create mode 100644 man/man0/toc3 create mode 100644 man/man0/toc3f create mode 100644 man/man0/toc4 create mode 100644 man/man0/toc5 create mode 100644 man/man0/toc6 create mode 100644 man/man0/toc7 create mode 100644 man/man0/toc8 create mode 100755 man/man0/tocrc create mode 100644 man/man0/tocx1 create mode 100644 man/man0/tocx2 create mode 100644 man/man0/tocx3 create mode 100644 man/man0/tocx3f create mode 100644 man/man0/tocx4 create mode 100644 man/man0/tocx5 create mode 100644 man/man0/tocx6 create mode 100644 man/man0/tocx7 create mode 100644 man/man0/tocx8 create mode 100644 man/man1/Makefile create mode 100644 man/man1/adb.1 create mode 100644 man/man1/addbib.1 create mode 100644 man/man1/apply.1 create mode 100644 man/man1/apropos.1 create mode 100644 man/man1/as.1 create mode 100644 man/man1/at.1 create mode 100644 man/man1/atq.1 create mode 100644 man/man1/atrm.1 create mode 100644 man/man1/awk.1 create mode 100644 man/man1/basename.1 create mode 100644 man/man1/bc.1 create mode 100644 man/man1/biff.1 create mode 100644 man/man1/binmail.1 create mode 100644 man/man1/cal.1 create mode 100644 man/man1/calendar.1 create mode 100644 man/man1/cat.1 create mode 100644 man/man1/cb.1 create mode 100644 man/man1/cc.1 create mode 100644 man/man1/cd.1 create mode 100644 man/man1/checknr.1 create mode 100644 man/man1/chgrp.1 create mode 100644 man/man1/chmod.1 create mode 100644 man/man1/clear.1 create mode 100644 man/man1/cmp.1 create mode 100644 man/man1/col.1 create mode 100644 man/man1/colcrt.1 create mode 100644 man/man1/colrm.1 create mode 100644 man/man1/comm.1 create mode 100644 man/man1/compress.1 create mode 100644 man/man1/cp.1 create mode 100644 man/man1/csh.1 create mode 100644 man/man1/ctags.1 create mode 100644 man/man1/date.1 create mode 100644 man/man1/dc.1 create mode 100644 man/man1/dd.1 create mode 100644 man/man1/deroff.1 create mode 100644 man/man1/df.1 create mode 100644 man/man1/diction.1 create mode 100644 man/man1/diff.1 create mode 100644 man/man1/diff3.1 create mode 100644 man/man1/du.1 create mode 100644 man/man1/echo.1 create mode 100644 man/man1/ed.1 create mode 100644 man/man1/efl.1 create mode 100644 man/man1/eqn.1 create mode 100644 man/man1/error.1 create mode 100644 man/man1/ex.1 create mode 100644 man/man1/expand.1 create mode 100644 man/man1/expr.1 create mode 100644 man/man1/f77.1 create mode 100644 man/man1/false.1 create mode 100644 man/man1/file.1 create mode 100644 man/man1/find.1 create mode 100644 man/man1/fmt.1 create mode 100644 man/man1/fold.1 create mode 100644 man/man1/fpr.1 create mode 100644 man/man1/from.1 create mode 100644 man/man1/fsplit.1 create mode 100644 man/man1/gcore.1 create mode 100644 man/man1/graph.1 create mode 100644 man/man1/grep.1 create mode 100644 man/man1/head.1 create mode 100644 man/man1/hostid.1 create mode 100644 man/man1/indent.1 create mode 100644 man/man1/intro.1 create mode 100644 man/man1/iostat.1 create mode 100644 man/man1/join.1 create mode 100644 man/man1/kill.1 create mode 100644 man/man1/last.1 create mode 100644 man/man1/lastcomm.1 create mode 100644 man/man1/learn.1 create mode 100644 man/man1/leave.1 create mode 100644 man/man1/lex.1 create mode 100644 man/man1/lint.1 create mode 100644 man/man1/lisp.1 create mode 100644 man/man1/ln.1 create mode 100644 man/man1/logger.1 create mode 100644 man/man1/login.1 create mode 100644 man/man1/look.1 create mode 100644 man/man1/lookbib.1 create mode 100644 man/man1/lorder.1 create mode 100644 man/man1/lpq.1 create mode 100644 man/man1/lpr.1 create mode 100644 man/man1/lprm.1 create mode 100644 man/man1/lptest.1 create mode 100644 man/man1/ls.1 create mode 100644 man/man1/lxref.1 create mode 100644 man/man1/m4.1 create mode 100644 man/man1/mail.1 create mode 100644 man/man1/make.1 create mode 100644 man/man1/man.1 create mode 100644 man/man1/mesg.1 create mode 100644 man/man1/mkdep.1 create mode 100644 man/man1/mkdir.1 create mode 100644 man/man1/mkstr.1 create mode 100644 man/man1/more.1 create mode 100644 man/man1/mset.1 create mode 100644 man/man1/msgs.1 create mode 100644 man/man1/mt.1 create mode 100644 man/man1/mv.1 create mode 100644 man/man1/netstat.1 create mode 100644 man/man1/newaliases.1 create mode 100644 man/man1/nice.1 create mode 100644 man/man1/nm.1 create mode 100644 man/man1/nroff.1 create mode 100644 man/man1/nslookup.1 create mode 100644 man/man1/od.1 create mode 100644 man/man1/pagesize.1 create mode 100644 man/man1/pdx.1 create mode 100644 man/man1/pi.1 create mode 100644 man/man1/pix.1 create mode 100644 man/man1/plot.1 create mode 100644 man/man1/pmerge.1 create mode 100644 man/man1/pr.1 create mode 100644 man/man1/printenv.1 create mode 100644 man/man1/prof.1 create mode 100644 man/man1/ps.1 create mode 100644 man/man1/ptx.1 create mode 100644 man/man1/pwd.1 create mode 100644 man/man1/px.1 create mode 100644 man/man1/pxp.1 create mode 100644 man/man1/pxref.1 create mode 100644 man/man1/quota.1 create mode 100644 man/man1/ratfor.1 create mode 100644 man/man1/rcp.1 create mode 100644 man/man1/rdist.1 create mode 100644 man/man1/refer.1 create mode 100644 man/man1/rev.1 create mode 100644 man/man1/rlogin.1 create mode 100644 man/man1/rm.1 create mode 100644 man/man1/rmail.1 create mode 100644 man/man1/rmdir.1 create mode 100644 man/man1/roffbib.1 create mode 100644 man/man1/rsh.1 create mode 100644 man/man1/ruptime.1 create mode 100644 man/man1/rwho.1 create mode 100644 man/man1/sccs.1 create mode 100644 man/man1/script.1 create mode 100644 man/man1/sed.1 create mode 100644 man/man1/sendbug.1 create mode 100644 man/man1/sh.1 create mode 100644 man/man1/size.1 create mode 100644 man/man1/sleep.1 create mode 100644 man/man1/soelim.1 create mode 100644 man/man1/sort.1 create mode 100644 man/man1/sortbib.1 create mode 100644 man/man1/spell.1 create mode 100644 man/man1/spline.1 create mode 100644 man/man1/split.1 create mode 100644 man/man1/strcompact.1 create mode 100644 man/man1/strings.1 create mode 100644 man/man1/strip.1 create mode 100644 man/man1/struct.1 create mode 100644 man/man1/style.1 create mode 100644 man/man1/su.1 create mode 100644 man/man1/sum.1 create mode 100644 man/man1/symcompact.1 create mode 100644 man/man1/symorder.1 create mode 100644 man/man1/tabs.1 create mode 100644 man/man1/tail.1 create mode 100644 man/man1/talk.1 create mode 100644 man/man1/tar.1 create mode 100644 man/man1/tbl.1 create mode 100644 man/man1/tc.1 create mode 100644 man/man1/tcopy.1 create mode 100644 man/man1/tee.1 create mode 100644 man/man1/telnet.1 create mode 100644 man/man1/time.1 create mode 100644 man/man1/tip.1 create mode 100644 man/man1/tk.1 create mode 100644 man/man1/tn3270.1 create mode 100644 man/man1/touch.1 create mode 100644 man/man1/tp.1 create mode 100644 man/man1/tr.1 create mode 100644 man/man1/troff.1 create mode 100644 man/man1/true.1 create mode 100644 man/man1/tsort.1 create mode 100644 man/man1/tty.1 create mode 100644 man/man1/ul.1 create mode 100644 man/man1/unifdef.1 create mode 100644 man/man1/uniq.1 create mode 100644 man/man1/units.1 create mode 100644 man/man1/uptime.1 create mode 100644 man/man1/users.1 create mode 100644 man/man1/uucp.1 create mode 100644 man/man1/uuencode.1 create mode 100644 man/man1/uulog.1 create mode 100644 man/man1/uuname.1 create mode 100644 man/man1/uuq.1 create mode 100644 man/man1/uusend.1 create mode 100644 man/man1/uux.1 create mode 100644 man/man1/vacation.1 create mode 100644 man/man1/vgrind.1 create mode 100644 man/man1/vi.1 create mode 100644 man/man1/vmstat.1 create mode 100644 man/man1/vwidth.1 create mode 100644 man/man1/w.1 create mode 100644 man/man1/wait.1 create mode 100644 man/man1/wall.1 create mode 100644 man/man1/wc.1 create mode 100644 man/man1/what.1 create mode 100644 man/man1/whatis.1 create mode 100644 man/man1/which.1 create mode 100644 man/man1/who.1 create mode 100644 man/man1/whois.1 create mode 100644 man/man1/window.1 create mode 100644 man/man1/write.1 create mode 100644 man/man1/xstr.1 create mode 100644 man/man1/yacc.1 create mode 100644 man/man1/yes.1 create mode 100644 man/man2/Makefile create mode 100644 man/man2/accept.2 create mode 100644 man/man2/access.2 create mode 100644 man/man2/acct.2 create mode 100644 man/man2/adjtime.2 create mode 100644 man/man2/bind.2 create mode 100644 man/man2/brk.2 create mode 100644 man/man2/chdir.2 create mode 100644 man/man2/chflags.2 create mode 100644 man/man2/chmod.2 create mode 100644 man/man2/chown.2 create mode 100644 man/man2/chroot.2 create mode 100644 man/man2/close.2 create mode 100644 man/man2/connect.2 create mode 100644 man/man2/creat.2 create mode 100644 man/man2/dup.2 create mode 100644 man/man2/execve.2 create mode 100644 man/man2/exit.2 create mode 100644 man/man2/fcntl.2 create mode 100644 man/man2/fetchi.2 create mode 100644 man/man2/flock.2 create mode 100644 man/man2/fork.2 create mode 100644 man/man2/fperr.2 create mode 100644 man/man2/fsync.2 create mode 100644 man/man2/getdtablesize.2 create mode 100644 man/man2/getfsstat.2 create mode 100644 man/man2/getgid.2 create mode 100644 man/man2/getgroups.2 create mode 100644 man/man2/gethostid.2 create mode 100644 man/man2/gethostname.2 create mode 100644 man/man2/getitimer.2 create mode 100644 man/man2/getlogin.2 create mode 100644 man/man2/getpagesize.2 create mode 100644 man/man2/getpeername.2 create mode 100644 man/man2/getpgrp.2 create mode 100644 man/man2/getpid.2 create mode 100644 man/man2/getpriority.2 create mode 100644 man/man2/getrlimit.2 create mode 100644 man/man2/getrusage.2 create mode 100644 man/man2/getsockname.2 create mode 100644 man/man2/getsockopt.2 create mode 100644 man/man2/gettimeofday.2 create mode 100644 man/man2/getuid.2 create mode 100644 man/man2/intro.2 create mode 100644 man/man2/ioctl.2 create mode 100644 man/man2/kill.2 create mode 100644 man/man2/killpg.2 create mode 100644 man/man2/link.2 create mode 100644 man/man2/listen.2 create mode 100644 man/man2/lock.2 create mode 100644 man/man2/lseek.2 create mode 100644 man/man2/mkdir.2 create mode 100644 man/man2/mknod.2 create mode 100644 man/man2/mount.2 create mode 100644 man/man2/nostk.2 create mode 100644 man/man2/open.2 create mode 100644 man/man2/phys.2 create mode 100644 man/man2/pipe.2 create mode 100644 man/man2/profil.2 create mode 100644 man/man2/ptrace.2 create mode 100644 man/man2/quota.2 create mode 100644 man/man2/read.2 create mode 100644 man/man2/readlink.2 create mode 100644 man/man2/reboot.2 create mode 100644 man/man2/recv.2 create mode 100644 man/man2/rename.2 create mode 100644 man/man2/rmdir.2 create mode 100644 man/man2/select.2 create mode 100644 man/man2/send.2 create mode 100644 man/man2/setgroups.2 create mode 100644 man/man2/setpgrp.2 create mode 100644 man/man2/setquota.2 create mode 100644 man/man2/setregid.2 create mode 100644 man/man2/setreuid.2 create mode 100644 man/man2/setuid.2 create mode 100644 man/man2/shutdown.2 create mode 100644 man/man2/sigaction.2 create mode 100644 man/man2/sigaltstack.2 create mode 100644 man/man2/sigblock.2 create mode 100644 man/man2/sigpause.2 create mode 100644 man/man2/sigpending.2 create mode 100644 man/man2/sigprocmask.2 create mode 100644 man/man2/sigreturn.2 create mode 100644 man/man2/sigsetmask.2 create mode 100644 man/man2/sigstack.2 create mode 100644 man/man2/sigsuspend.2 create mode 100644 man/man2/sigvec.2 create mode 100644 man/man2/sigwait.2 create mode 100644 man/man2/socket.2 create mode 100644 man/man2/socketpair.2 create mode 100644 man/man2/stat.2 create mode 100644 man/man2/statfs.2 create mode 100644 man/man2/swapon.2 create mode 100644 man/man2/symlink.2 create mode 100644 man/man2/sync.2 create mode 100644 man/man2/syscall.2 create mode 100644 man/man2/truncate.2 create mode 100644 man/man2/ucall.2 create mode 100644 man/man2/umask.2 create mode 100644 man/man2/unlink.2 create mode 100644 man/man2/utimes.2 create mode 100644 man/man2/vfork.2 create mode 100644 man/man2/vhangup.2 create mode 100644 man/man2/wait.2 create mode 100644 man/man2/write.2 create mode 100644 man/man3/Makefile create mode 100644 man/man3/abort.3 create mode 100644 man/man3/abs.3 create mode 100644 man/man3/alarm.3 create mode 100644 man/man3/asinh.3 create mode 100644 man/man3/assert.3 create mode 100644 man/man3/atof.3 create mode 100644 man/man3/bstring.3 create mode 100644 man/man3/byteorder.3 create mode 100644 man/man3/compat-sys5.3 create mode 100644 man/man3/crypt.3 create mode 100644 man/man3/ctime.3 create mode 100644 man/man3/ctype.3 create mode 100644 man/man3/curses.3 create mode 100644 man/man3/daemon.3 create mode 100644 man/man3/dbm.3 create mode 100644 man/man3/devname.3 create mode 100644 man/man3/directory.3 create mode 100644 man/man3/ecvt.3 create mode 100644 man/man3/end.3 create mode 100644 man/man3/erf.3 create mode 100644 man/man3/err.3 create mode 100644 man/man3/execl.3 create mode 100644 man/man3/exit.3 create mode 100644 man/man3/exp.3 create mode 100644 man/man3/fclose.3 create mode 100644 man/man3/ferror.3 create mode 100644 man/man3/floor.3 create mode 100644 man/man3/fopen.3 create mode 100644 man/man3/fread.3 create mode 100644 man/man3/frexp.3 create mode 100644 man/man3/fseek.3 create mode 100644 man/man3/getc.3 create mode 100644 man/man3/getdisk.3 create mode 100644 man/man3/getenv.3 create mode 100644 man/man3/getfsent.3 create mode 100644 man/man3/getgrent.3 create mode 100644 man/man3/getgrouplist.3 create mode 100644 man/man3/gethostbyname.3 create mode 100644 man/man3/getloadavg.3 create mode 100644 man/man3/getmntinfo.3 create mode 100644 man/man3/getnetent.3 create mode 100644 man/man3/getopt.3 create mode 100644 man/man3/getpass.3 create mode 100644 man/man3/getprotoent.3 create mode 100644 man/man3/getpwent.3 create mode 100644 man/man3/gets.3 create mode 100644 man/man3/getservent.3 create mode 100644 man/man3/getsubopt.3 create mode 100644 man/man3/getttyent.3 create mode 100644 man/man3/getusershell.3 create mode 100644 man/man3/getwd.3 create mode 100644 man/man3/hypot.3 create mode 100644 man/man3/ieee.3 create mode 100644 man/man3/inet.3 create mode 100644 man/man3/infnan.3 create mode 100644 man/man3/initgroups.3 create mode 100644 man/man3/insque.3 create mode 100644 man/man3/intro.3 create mode 100644 man/man3/j0.3 create mode 100644 man/man3/l3tol.3 create mode 100644 man/man3/ldfps.3 create mode 100644 man/man3/lgamma.3 create mode 100644 man/man3/lib2648.3 create mode 100644 man/man3/malloc.3 create mode 100644 man/man3/math.3 create mode 100644 man/man3/mktemp.3 create mode 100644 man/man3/monitor.3 create mode 100644 man/man3/mp.3 create mode 100644 man/man3/ndbm.3 create mode 100644 man/man3/nice.3 create mode 100644 man/man3/nlist.3 create mode 100644 man/man3/ns.3 create mode 100644 man/man3/pause.3 create mode 100644 man/man3/perror.3 create mode 100644 man/man3/plot.3 create mode 100644 man/man3/popen.3 create mode 100644 man/man3/printf.3 create mode 100644 man/man3/psignal.3 create mode 100644 man/man3/putc.3 create mode 100644 man/man3/puts.3 create mode 100644 man/man3/qsort.3 create mode 100644 man/man3/rand.3 create mode 100644 man/man3/random.3 create mode 100644 man/man3/rcmd.3 create mode 100644 man/man3/regex.3 create mode 100644 man/man3/resolver.3 create mode 100644 man/man3/rexec.3 create mode 100644 man/man3/scandir.3 create mode 100644 man/man3/scanf.3 create mode 100644 man/man3/setbuf.3 create mode 100644 man/man3/setjmp.3 create mode 100644 man/man3/setmode.3 create mode 100644 man/man3/setruid.3 create mode 100644 man/man3/siginterrupt.3 create mode 100644 man/man3/signal.3 create mode 100644 man/man3/sigsetops.3 create mode 100644 man/man3/sin.3 create mode 100644 man/man3/sinh.3 create mode 100644 man/man3/sleep.3 create mode 100644 man/man3/sqrt.3 create mode 100644 man/man3/stdio.3 create mode 100644 man/man3/strcspn.3 create mode 100644 man/man3/strftime.3 create mode 100644 man/man3/string.3 create mode 100644 man/man3/strpbrk.3 create mode 100644 man/man3/strsep.3 create mode 100644 man/man3/strspn.3 create mode 100644 man/man3/strstr.3 create mode 100644 man/man3/strtok.3 create mode 100644 man/man3/strtol.3 create mode 100644 man/man3/strtoul.3 create mode 100644 man/man3/stty.3 create mode 100644 man/man3/swab.3 create mode 100644 man/man3/sysctl.3 create mode 100644 man/man3/syserrlst.3 create mode 100644 man/man3/syslog.3 create mode 100644 man/man3/system.3 create mode 100644 man/man3/termcap.3 create mode 100644 man/man3/time.3 create mode 100644 man/man3/times.3 create mode 100644 man/man3/ttyname.3 create mode 100644 man/man3/ualarm.3 create mode 100644 man/man3/uname.3 create mode 100644 man/man3/ungetc.3 create mode 100644 man/man3/utime.3 create mode 100644 man/man3/valloc.3 create mode 100644 man/man3/varargs.3 create mode 100644 man/man3f/Makefile create mode 100644 man/man3f/abort.3 create mode 100644 man/man3f/access.3 create mode 100644 man/man3f/alarm.3 create mode 100644 man/man3f/bessel.3 create mode 100644 man/man3f/bit.3 create mode 100644 man/man3f/chdir.3 create mode 100644 man/man3f/chmod.3 create mode 100644 man/man3f/etime.3 create mode 100644 man/man3f/exit.3 create mode 100644 man/man3f/fdate.3 create mode 100644 man/man3f/flmin.3 create mode 100644 man/man3f/flush.3 create mode 100644 man/man3f/fork.3 create mode 100644 man/man3f/fseek.3 create mode 100644 man/man3f/getarg.3 create mode 100644 man/man3f/getc.3 create mode 100644 man/man3f/getcwd.3 create mode 100644 man/man3f/getenv.3 create mode 100644 man/man3f/getlog.3 create mode 100644 man/man3f/getpid.3 create mode 100644 man/man3f/getuid.3 create mode 100644 man/man3f/hostnm.3 create mode 100644 man/man3f/idate.3 create mode 100644 man/man3f/index.3 create mode 100644 man/man3f/intro.3 create mode 100644 man/man3f/ioinit.3 create mode 100644 man/man3f/kill.3 create mode 100644 man/man3f/link.3 create mode 100644 man/man3f/loc.3 create mode 100644 man/man3f/long.3 create mode 100644 man/man3f/malloc.3 create mode 100644 man/man3f/perror.3 create mode 100644 man/man3f/plot.3 create mode 100644 man/man3f/putc.3 create mode 100644 man/man3f/qsort.3 create mode 100644 man/man3f/rand.3 create mode 100644 man/man3f/random.3 create mode 100644 man/man3f/rename.3 create mode 100644 man/man3f/signal.3 create mode 100644 man/man3f/sleep.3 create mode 100644 man/man3f/stat.3 create mode 100644 man/man3f/system.3 create mode 100644 man/man3f/time.3 create mode 100644 man/man3f/topen.3 create mode 100644 man/man3f/traper.3 create mode 100644 man/man3f/trapov.3 create mode 100644 man/man3f/trpfpe.3 create mode 100644 man/man3f/ttynam.3 create mode 100644 man/man3f/unlink.3 create mode 100644 man/man3f/wait.3 create mode 100644 man/man4/Makefile create mode 100644 man/man4/acc.4 create mode 100644 man/man4/arp.4 create mode 100644 man/man4/bk.4 create mode 100644 man/man4/br.4 create mode 100644 man/man4/cons.4 create mode 100644 man/man4/css.4 create mode 100644 man/man4/de.4 create mode 100644 man/man4/dh.4 create mode 100644 man/man4/dhu.4 create mode 100644 man/man4/dhv.4 create mode 100644 man/man4/dmc.4 create mode 100644 man/man4/dr.4 create mode 100644 man/man4/dz.4 create mode 100644 man/man4/ec.4 create mode 100644 man/man4/en.4 create mode 100644 man/man4/fd.4 create mode 100644 man/man4/hk.4 create mode 100644 man/man4/ht.4 create mode 100644 man/man4/hy.4 create mode 100644 man/man4/icmp.4 create mode 100644 man/man4/idp.4 create mode 100644 man/man4/il.4 create mode 100644 man/man4/imp.4 create mode 100644 man/man4/impconf.4 create mode 100644 man/man4/inet.4 create mode 100644 man/man4/intro.4 create mode 100644 man/man4/ip.4 create mode 100644 man/man4/lo.4 create mode 100644 man/man4/lp.4 create mode 100644 man/man4/mem.4 create mode 100644 man/man4/mtio.4 create mode 100644 man/man4/networking.4 create mode 100644 man/man4/ns.4 create mode 100644 man/man4/nsip.4 create mode 100644 man/man4/null.4 create mode 100644 man/man4/pty.4 create mode 100644 man/man4/qe.4 create mode 100644 man/man4/ra.4 create mode 100644 man/man4/ram.4 create mode 100644 man/man4/rk.4 create mode 100644 man/man4/rl.4 create mode 100644 man/man4/rx.4 create mode 100644 man/man4/si.4 create mode 100644 man/man4/spp.4 create mode 100644 man/man4/sri.4 create mode 100644 man/man4/swap.4 create mode 100644 man/man4/tb.4 create mode 100644 man/man4/tcp.4 create mode 100644 man/man4/tm.4 create mode 100644 man/man4/tmscp.4 create mode 100644 man/man4/ts.4 create mode 100644 man/man4/tty.4 create mode 100644 man/man4/udp.4 create mode 100644 man/man4/vv.4 create mode 100644 man/man4/xp.4 create mode 100644 man/man5/L-devices.5 create mode 100644 man/man5/L-dialcodes.5 create mode 100644 man/man5/L.aliases.5 create mode 100644 man/man5/L.cmds.5 create mode 100644 man/man5/L.sys.5 create mode 100644 man/man5/Makefile create mode 100644 man/man5/USERFILE.5 create mode 100644 man/man5/a.out.5 create mode 100644 man/man5/acct.5 create mode 100644 man/man5/aliases.5 create mode 100644 man/man5/core.5 create mode 100644 man/man5/dbx.5 create mode 100644 man/man5/dir.5 create mode 100644 man/man5/disktab.5 create mode 100644 man/man5/dtab.5 create mode 100644 man/man5/dump.5 create mode 100644 man/man5/fs.5 create mode 100644 man/man5/fstab.5 create mode 100644 man/man5/gettytab.5 create mode 100644 man/man5/group.5 create mode 100644 man/man5/hosts.5 create mode 100644 man/man5/map3270.5 create mode 100644 man/man5/networks.5 create mode 100644 man/man5/passwd.5 create mode 100644 man/man5/phones.5 create mode 100644 man/man5/plot.5 create mode 100644 man/man5/printcap.5 create mode 100644 man/man5/protocols.5 create mode 100644 man/man5/remote.5 create mode 100644 man/man5/resolver.5 create mode 100644 man/man5/services.5 create mode 100644 man/man5/shells.5 create mode 100644 man/man5/stack.5 create mode 100644 man/man5/syserrlst.5 create mode 100644 man/man5/tar.5 create mode 100644 man/man5/termcap.5 create mode 100644 man/man5/tp.5 create mode 100644 man/man5/ttys.5 create mode 100644 man/man5/types.5 create mode 100644 man/man5/tzfile.5 create mode 100644 man/man5/utmp.5 create mode 100644 man/man5/uuencode.5 create mode 100644 man/man5/vfont.5 create mode 100644 man/man5/vgrindefs.5 create mode 100644 man/man6/Makefile create mode 100644 man/man6/aardvark.6 create mode 100644 man/man6/adventure.6 create mode 100644 man/man6/arithmetic.6 create mode 100644 man/man6/backgammon.6 create mode 100644 man/man6/banner.6 create mode 100644 man/man6/bcd.6 create mode 100644 man/man6/bj.6 create mode 100644 man/man6/boggle.6 create mode 100644 man/man6/canfield.6 create mode 100644 man/man6/chess.6 create mode 100644 man/man6/ching.6 create mode 100644 man/man6/cribbage.6 create mode 100644 man/man6/doctor.6 create mode 100644 man/man6/fish.6 create mode 100644 man/man6/fortune.6 create mode 100644 man/man6/hangman.6 create mode 100644 man/man6/hunt.6 create mode 100644 man/man6/mille.6 create mode 100644 man/man6/monop.6 create mode 100644 man/man6/moo.6 create mode 100644 man/man6/number.6 create mode 100644 man/man6/quiz.6 create mode 100644 man/man6/rain.6 create mode 100644 man/man6/robots.6 create mode 100644 man/man6/rogue.6 create mode 100644 man/man6/snake.6 create mode 100644 man/man6/trek.6 create mode 100644 man/man6/ttt.6 create mode 100644 man/man6/warp.6 create mode 100644 man/man6/words.6 create mode 100644 man/man6/worm.6 create mode 100644 man/man6/worms.6 create mode 100644 man/man6/wump.6 create mode 100644 man/man6/zork.6 create mode 100644 man/man7/Makefile create mode 100644 man/man7/ascii.7 create mode 100644 man/man7/environ.7 create mode 100644 man/man7/eqnchar.7 create mode 100644 man/man7/hier.7 create mode 100644 man/man7/hostname.7 create mode 100644 man/man7/intro.7 create mode 100644 man/man7/mailaddr.7 create mode 100644 man/man7/man.7 create mode 100644 man/man7/me.7 create mode 100644 man/man7/ms.7 create mode 100644 man/man7/term.7 create mode 100644 man/man8/Makefile create mode 100644 man/man8/XNSrouted.8 create mode 100644 man/man8/adduser.8 create mode 100644 man/man8/autoconfig.8 create mode 100644 man/man8/boot.8 create mode 100644 man/man8/bugfiler.8 create mode 100644 man/man8/crash.8 create mode 100644 man/man8/drtest.8 create mode 100644 man/man8/dump.8 create mode 100644 man/man8/dumpdir.8 create mode 100644 man/man8/format.8 create mode 100644 man/man8/fsck.8 create mode 100644 man/man8/getty.8 create mode 100644 man/man8/htable.8 create mode 100644 man/man8/intro.8 create mode 100644 man/man8/lpc.8 create mode 100644 man/man8/lpd.8 create mode 100644 man/man8/makedev.8 create mode 100644 man/man8/makekey.8 create mode 100644 man/man8/named.8 create mode 100644 man/man8/pac.8 create mode 100644 man/man8/rc.8 create mode 100644 man/man8/rdump.8 create mode 100644 man/man8/routed.8 create mode 100644 man/man8/rrestore.8 create mode 100644 man/man8/sendmail.8 create mode 100644 man/man8/sticky.8 create mode 100644 man/man8/sync.8 create mode 100644 man/man8/timed.8 create mode 100644 man/man8/timedc.8 create mode 100644 man/man8/uucico.8 create mode 100644 man/man8/uuclean.8 create mode 100644 man/man8/uupoll.8 create mode 100644 man/man8/uusnap.8 create mode 100644 man/man8/uuxqt.8 create mode 100755 man/manroff create mode 100644 new/Makefile create mode 100644 new/OLD/Makefile create mode 100644 new/OLD/README create mode 100644 new/OLD/apl.tar.Z create mode 100644 new/OLD/buildcore.c create mode 100644 new/OLD/cpm.tar.Z create mode 100644 new/OLD/efs.tar.Z create mode 100644 new/OLD/getsyspr.tar.Z create mode 100644 new/OLD/grab.tar.Z create mode 100644 new/OLD/lisp11.tar.Z create mode 100644 new/OLD/mh.tar.Z create mode 100644 new/OLD/rand.tar.Z create mode 100644 new/OLD/rinstall.tar.Z create mode 100644 new/OLD/sched.tar.Z create mode 100644 new/OLD/seqn.tar.Z create mode 100644 new/OLD/sroff.tar.Z create mode 100644 new/OLD/subnet.tar.Z create mode 100644 new/PORT/B.tar.Z create mode 100644 new/PORT/Makefile create mode 100644 new/PORT/README create mode 100644 new/PORT/apl.tar.Z create mode 100644 new/PORT/bib.tar.Z create mode 100644 new/PORT/cpm.tar.Z create mode 100644 new/PORT/help.tar.Z create mode 100644 new/PORT/mkmf.tar.Z create mode 100644 new/PORT/spms.tar.Z create mode 100644 new/PORT/tac.tar.Z create mode 100644 new/PORT/tools.tar.Z create mode 100644 new/ansi/Makefile create mode 100644 new/ansi/ansitape.1 create mode 100644 new/ansi/ansitape.c create mode 100644 new/ansi/vmsprep.1 create mode 100644 new/ansi/vmsprep.c create mode 100644 new/bm/Execute.c create mode 100644 new/bm/Extern.h create mode 100644 new/bm/GetPatFile.c create mode 100644 new/bm/Global.c create mode 100644 new/bm/MakeDesc.c create mode 100644 new/bm/MakeSkip.c create mode 100644 new/bm/Makefile create mode 100644 new/bm/MatchFound.c create mode 100644 new/bm/MkDescVec.c create mode 100644 new/bm/MoveResidue.c create mode 100644 new/bm/PrintLine.c create mode 100644 new/bm/PutUsage.c create mode 100644 new/bm/README create mode 100644 new/bm/Search.c create mode 100644 new/bm/bm.1 create mode 100644 new/bm/bm.c create mode 100644 new/bm/bm.h create mode 100644 new/crash/Makefile create mode 100644 new/crash/crash.1 create mode 100644 new/crash/crash.c create mode 100644 new/crash/crash.h create mode 100644 new/crash/crashsubs.c create mode 100644 new/crash/dispnet.c create mode 100644 new/crash/if.c create mode 100644 new/crash/inet.c create mode 100644 new/crash/net.h create mode 100644 new/crash/route.c create mode 100644 new/crash/symbol.c create mode 100644 new/jove/Makefile create mode 100644 new/jove/Makefile.dos create mode 100644 new/jove/Ovmakefile create mode 100644 new/jove/README create mode 100644 new/jove/Readme.dos create mode 100644 new/jove/Readme.mac create mode 100644 new/jove/abbrev.c create mode 100644 new/jove/argcount.c create mode 100644 new/jove/ask.c create mode 100644 new/jove/buf.c create mode 100644 new/jove/c.c create mode 100644 new/jove/case.c create mode 100644 new/jove/ctype.c create mode 100644 new/jove/ctype.h create mode 100644 new/jove/delete.c create mode 100644 new/jove/disp.c create mode 100644 new/jove/doc/README create mode 100644 new/jove/doc/cmds.doc create mode 100644 new/jove/doc/cmds.doc.nr create mode 100644 new/jove/doc/example.rc create mode 100644 new/jove/doc/jove.1 create mode 100644 new/jove/doc/jove.2 create mode 100644 new/jove/doc/jove.3 create mode 100644 new/jove/doc/jove.4 create mode 100644 new/jove/doc/jove.5 create mode 100644 new/jove/doc/jove.nr create mode 100644 new/jove/doc/jove.qref create mode 100644 new/jove/doc/system.rc create mode 100644 new/jove/doc/teach-jove create mode 100644 new/jove/doc/teachjove.nr create mode 100644 new/jove/extend.c create mode 100644 new/jove/externs.h create mode 100644 new/jove/fmt.c create mode 100644 new/jove/fp.c create mode 100644 new/jove/funcdefs.c create mode 100644 new/jove/getch.c create mode 100644 new/jove/insert.c create mode 100644 new/jove/io.c create mode 100644 new/jove/io.h create mode 100644 new/jove/iproc-pipes.c create mode 100644 new/jove/iproc-ptys.c create mode 100644 new/jove/iproc.c create mode 100644 new/jove/jove.c create mode 100644 new/jove/jove.h create mode 100644 new/jove/keymaps.txt create mode 100644 new/jove/mac.c create mode 100644 new/jove/mac.h create mode 100644 new/jove/macros.c create mode 100644 new/jove/macvert.c create mode 100644 new/jove/malloc.c create mode 100644 new/jove/marks.c create mode 100644 new/jove/menumaps.txt create mode 100644 new/jove/misc.c create mode 100644 new/jove/mjovers.Hqx create mode 100644 new/jove/move.c create mode 100644 new/jove/paragraph.c create mode 100644 new/jove/portsrv.c create mode 100644 new/jove/proc.c create mode 100644 new/jove/re.c create mode 100644 new/jove/re.h create mode 100644 new/jove/re1.c create mode 100644 new/jove/rec.c create mode 100644 new/jove/rec.h create mode 100644 new/jove/recover.c create mode 100644 new/jove/scandir.c create mode 100644 new/jove/screen.c create mode 100644 new/jove/setmaps.c create mode 100644 new/jove/table.c create mode 100644 new/jove/table.h create mode 100644 new/jove/teachjove.c create mode 100644 new/jove/temp.h create mode 100644 new/jove/term.c create mode 100644 new/jove/termcap.h create mode 100644 new/jove/tune.dos create mode 100644 new/jove/tune.h create mode 100644 new/jove/tune.template create mode 100644 new/jove/util.c create mode 100644 new/jove/vars.c create mode 100644 new/jove/version.c create mode 100644 new/jove/wind.c create mode 100644 new/kermit5.188/ckcasc.h create mode 100644 new/kermit5.188/ckcdeb.h create mode 100644 new/kermit5.188/ckcfil.h create mode 100644 new/kermit5.188/ckcfn2.c create mode 100644 new/kermit5.188/ckcfn3.c create mode 100644 new/kermit5.188/ckcfns.c create mode 100644 new/kermit5.188/ckcker.h create mode 100644 new/kermit5.188/ckcmai.c create mode 100644 new/kermit5.188/ckcmdb.c create mode 100644 new/kermit5.188/ckcnet.c create mode 100644 new/kermit5.188/ckcnet.h create mode 100644 new/kermit5.188/ckcpro.w create mode 100644 new/kermit5.188/ckcsym.h create mode 100644 new/kermit5.188/ckcxla.h create mode 100644 new/kermit5.188/cku2tm.c create mode 100644 new/kermit5.188/ckucmd.c create mode 100644 new/kermit5.188/ckucmd.h create mode 100644 new/kermit5.188/ckucon.c create mode 100644 new/kermit5.188/ckudia.c create mode 100644 new/kermit5.188/ckufio.c create mode 100644 new/kermit5.188/ckuscr.c create mode 100644 new/kermit5.188/ckustr.c create mode 100755 new/kermit5.188/ckustr.sed create mode 100644 new/kermit5.188/ckutio.c create mode 100644 new/kermit5.188/ckuus2.c create mode 100644 new/kermit5.188/ckuus3.c create mode 100644 new/kermit5.188/ckuus4.c create mode 100644 new/kermit5.188/ckuus5.c create mode 100644 new/kermit5.188/ckuus6.c create mode 100644 new/kermit5.188/ckuus7.c create mode 100644 new/kermit5.188/ckuusr.c create mode 100644 new/kermit5.188/ckuusr.h create mode 100644 new/kermit5.188/ckuusx.c create mode 100644 new/kermit5.188/ckuusy.c create mode 100644 new/kermit5.188/ckuver.h create mode 100644 new/kermit5.188/ckuxla.c create mode 100644 new/kermit5.188/ckuxla.h create mode 100644 new/kermit5.188/ckwart.c create mode 100644 new/kermit5.188/makefile create mode 100644 new/l11/Makefile create mode 100644 new/l11/ReadMe create mode 100644 new/l11/in.c create mode 100644 new/l11/link.c create mode 100644 new/l11/link.h create mode 100644 new/l11/obint.c create mode 100644 new/l11/pass2.c create mode 100644 new/l11/sup.c create mode 100644 new/la/Makefile create mode 100644 new/la/la.1 create mode 100644 new/la/la.c create mode 100644 new/m11/Document create mode 100644 new/m11/Makefile create mode 100644 new/m11/READme create mode 100644 new/m11/at.sml create mode 100644 new/m11/code.m11 create mode 100644 new/m11/debug.m11 create mode 100644 new/m11/errs.m11 create mode 100644 new/m11/exec.m11 create mode 100644 new/m11/expr.m11 create mode 100644 new/m11/fltg.m11 create mode 100644 new/m11/getl.m11 create mode 100755 new/m11/l11.x create mode 100644 new/m11/lout.m11 create mode 100644 new/m11/m11.1 create mode 100755 new/m11/m11.x create mode 100644 new/m11/mac.m11 create mode 100644 new/m11/macro.m11 create mode 100644 new/m11/macxrf.c create mode 100644 new/m11/misc.m11 create mode 100644 new/m11/often.m11 create mode 100644 new/m11/pst.m11 create mode 100644 new/m11/srch.m11 create mode 100644 new/m11/syscalls.m11 create mode 100644 new/m11/xlat.m11 create mode 100644 new/m11/xpcor.m11 create mode 100644 new/nntp/CHANGES create mode 100644 new/nntp/Makefile create mode 100644 new/nntp/README create mode 100644 new/nntp/common/Makefile create mode 100644 new/nntp/common/README create mode 100644 new/nntp/common/README.HPUX create mode 100644 new/nntp/common/README.LIB create mode 100644 new/nntp/common/README.SYSV create mode 100644 new/nntp/common/clientlib.c create mode 100644 new/nntp/common/clientlib.h create mode 100644 new/nntp/common/conf.h create mode 100644 new/nntp/common/nntp.h create mode 120000 new/nntp/common/response_codes.h create mode 100644 new/nntp/common/version.c create mode 100644 new/nntp/doc/Makefile create mode 100644 new/nntp/doc/README create mode 100755 new/nntp/doc/config.sh create mode 100644 new/nntp/doc/getactive.dst create mode 100644 new/nntp/doc/mkgrdates.dst create mode 100644 new/nntp/doc/nntpd.dst create mode 100644 new/nntp/doc/rfc977 create mode 100644 new/nntp/inews/Makefile create mode 100644 new/nntp/inews/README create mode 100644 new/nntp/inews/inews.c create mode 100644 new/nntp/inews/test create mode 100644 new/nntp/inews/test1 create mode 100644 new/nntp/inews/test2 create mode 100644 new/nntp/inews/uname.c create mode 100644 new/nntp/server/Makefile create mode 100644 new/nntp/server/README create mode 100644 new/nntp/server/SYSLOG create mode 100644 new/nntp/server/access.c create mode 100644 new/nntp/server/access_dnet.c create mode 100644 new/nntp/server/access_inet.c create mode 100644 new/nntp/server/active.c create mode 100644 new/nntp/server/ahbs.c create mode 100644 new/nntp/server/common.h create mode 100644 new/nntp/server/fakesyslog.c create mode 100644 new/nntp/server/fakesyslog.h create mode 100644 new/nntp/server/globals.c create mode 100644 new/nntp/server/group.c create mode 100644 new/nntp/server/help.c create mode 100644 new/nntp/server/ihave.c create mode 100644 new/nntp/server/list.c create mode 100644 new/nntp/server/main.c create mode 100644 new/nntp/server/misc.c create mode 100644 new/nntp/server/netaux.c create mode 100644 new/nntp/server/newgroups.c create mode 100644 new/nntp/server/newnews.c create mode 100644 new/nntp/server/nextlast.c create mode 100644 new/nntp/server/ngmatch.c create mode 100644 new/nntp/server/parsit.c create mode 100644 new/nntp/server/post.c create mode 100644 new/nntp/server/profile.c create mode 100644 new/nntp/server/scandir.c create mode 100644 new/nntp/server/serve.c create mode 100644 new/nntp/server/slave.c create mode 100644 new/nntp/server/spawn.c create mode 100644 new/nntp/server/strcasecmp.c create mode 100644 new/nntp/server/subnet.c create mode 100644 new/nntp/server/time.c create mode 100644 new/nntp/server/time.h create mode 100644 new/nntp/server/xhdr.c create mode 100644 new/nntp/support/Makefile create mode 100644 new/nntp/support/README create mode 100644 new/nntp/support/access_file create mode 100644 new/nntp/support/mkgrdates.c create mode 100644 new/nntp/support/nntp_awk create mode 100644 new/nntp/support/nntp_awk.ucbva create mode 100644 new/nntp/xfer/Makefile create mode 100644 new/nntp/xfer/README create mode 100644 new/nntp/xfer/nntpxfer.c create mode 100644 new/nntp/xmit/Makefile create mode 100644 new/nntp/xmit/README create mode 100644 new/nntp/xmit/get_tcp_conn.c create mode 100644 new/nntp/xmit/get_tcp_conn.h create mode 100644 new/nntp/xmit/llist.c create mode 100644 new/nntp/xmit/llist.h create mode 100644 new/nntp/xmit/nntp.h create mode 100644 new/nntp/xmit/nntp_awk create mode 100755 new/nntp/xmit/nntpsend.csh create mode 100644 new/nntp/xmit/nntpsend.sh create mode 100644 new/nntp/xmit/nntpxmit.1 create mode 100644 new/nntp/xmit/nntpxmit.c create mode 100644 new/nntp/xmit/nntpxmit.h create mode 100644 new/nntp/xmit/remote.c create mode 100644 new/nntp/xmit/shlock.c create mode 100644 new/nntp/xmit/sysexits.h create mode 100644 new/notes/Answer.this create mode 100644 new/notes/HINTS create mode 100644 new/notes/MANIFEST create mode 100644 new/notes/Makefile create mode 100644 new/notes/Mod.diffs/diffs.doc create mode 100644 new/notes/Mod.diffs/diffs.man create mode 100644 new/notes/Mod.diffs/diffs.src create mode 100644 new/notes/README create mode 100644 new/notes/README2 create mode 100644 new/notes/Samples/Archive-into create mode 100644 new/notes/Samples/Makefile create mode 100644 new/notes/Samples/Read_me create mode 100644 new/notes/Samples/access-templat create mode 100644 new/notes/Samples/archlist create mode 100644 new/notes/Samples/avail.notes create mode 100755 new/notes/Samples/cron.convex.sh create mode 100755 new/notes/Samples/cron.csh create mode 100755 new/notes/Samples/cron.sh create mode 100755 new/notes/Samples/cronXarch.sh create mode 100755 new/notes/Samples/cronarch-3.sh create mode 100644 new/notes/Samples/cronarch.sh create mode 100644 new/notes/Samples/cronarch2.sh create mode 100644 new/notes/Samples/cronlocal.sh create mode 100644 new/notes/Samples/cronnet.sh create mode 100644 new/notes/Samples/crontab create mode 100755 new/notes/Samples/hourly.csh create mode 100644 new/notes/Samples/make.moderated create mode 100644 new/notes/Samples/moderators create mode 100644 new/notes/Samples/net.how create mode 100644 new/notes/Samples/newsgroups create mode 100644 new/notes/Samples/short.names create mode 100755 new/notes/Samples/shorten create mode 100755 new/notes/Samples/syncnews create mode 100644 new/notes/Samples/sys create mode 100644 new/notes/Samples/sysA create mode 100644 new/notes/Samples/sysB create mode 100644 new/notes/Samples/uiucdcs.list create mode 100644 new/notes/Samples/uiucdcsb.list create mode 100644 new/notes/Samples/uiucdcsi.list create mode 100644 new/notes/doc/0.long create mode 100644 new/notes/doc/0.short create mode 100644 new/notes/doc/1 create mode 100644 new/notes/doc/2.1 create mode 100644 new/notes/doc/2.2 create mode 100644 new/notes/doc/3.1 create mode 100644 new/notes/doc/3.2 create mode 100644 new/notes/doc/4.0 create mode 100644 new/notes/doc/4.1 create mode 100644 new/notes/doc/4.2 create mode 100644 new/notes/doc/4.3 create mode 100644 new/notes/doc/4.4 create mode 100644 new/notes/doc/4.5 create mode 100644 new/notes/doc/4.6 create mode 100644 new/notes/doc/4.7 create mode 100644 new/notes/doc/5 create mode 100644 new/notes/doc/Makefile create mode 100644 new/notes/doc/RCS/2.1,v create mode 100644 new/notes/doc/RCS/2.2,v create mode 100644 new/notes/doc/RCS/3.1,v create mode 100644 new/notes/doc/a.checklist create mode 100644 new/notes/doc/acks create mode 100644 new/notes/doc/b.interface create mode 100644 new/notes/doc/c.changes create mode 100644 new/notes/doc/macros create mode 100644 new/notes/doc/vtoc create mode 100644 new/notes/man/Makefile create mode 100644 new/notes/man/autoseq.1 create mode 100644 new/notes/man/checknotes.1 create mode 100755 new/notes/man/doit create mode 100644 new/notes/man/getdate.3 create mode 100644 new/notes/man/mknf.8 create mode 100644 new/notes/man/newsinput.8 create mode 100644 new/notes/man/newsoutput.8 create mode 100644 new/notes/man/nfabort.3 create mode 100644 new/notes/man/nfaccess.8 create mode 100644 new/notes/man/nfadmin.8 create mode 100644 new/notes/man/nfarchive.8 create mode 100644 new/notes/man/nfcomment.3 create mode 100644 new/notes/man/nfdump.8 create mode 100644 new/notes/man/nfload.8 create mode 100644 new/notes/man/nfmail.8 create mode 100644 new/notes/man/nfpipe.1 create mode 100644 new/notes/man/nfprint.1 create mode 100644 new/notes/man/nfrcv.8 create mode 100644 new/notes/man/nfstats.1 create mode 100644 new/notes/man/nftimestamp.8 create mode 100644 new/notes/man/nfxmit.8 create mode 100644 new/notes/man/notes.1 create mode 100644 new/notes/man/readnotes.1 create mode 100644 new/notes/man/rmnf.8 create mode 100755 new/notes/man/rscript create mode 120000 new/notes/src/Makefile create mode 100644 new/notes/src/Makefile.net create mode 100644 new/notes/src/Makefile.pdp create mode 100644 new/notes/src/Makefile.user create mode 100644 new/notes/src/Makefile.util create mode 100644 new/notes/src/Makefile.vax create mode 100644 new/notes/src/Revisions create mode 100644 new/notes/src/access.c create mode 100644 new/notes/src/access.help create mode 100644 new/notes/src/acssort.c create mode 100644 new/notes/src/adnote.c create mode 100644 new/notes/src/adresp.c create mode 100644 new/notes/src/archiver.c create mode 100644 new/notes/src/asearch.c create mode 100644 new/notes/src/bnewshead.c create mode 100644 new/notes/src/buildnf.c create mode 100644 new/notes/src/canon.h create mode 100644 new/notes/src/check.c create mode 100644 new/notes/src/checknotes.c create mode 100644 new/notes/src/compress.c create mode 100644 new/notes/src/control.c create mode 100644 new/notes/src/cursor.c create mode 100644 new/notes/src/datein.c create mode 100644 new/notes/src/delete.c create mode 100644 new/notes/src/dir.help create mode 100644 new/notes/src/dmpnote.c create mode 100644 new/notes/src/dmpresp.c create mode 100644 new/notes/src/doc.h create mode 100644 new/notes/src/dropt.c create mode 100644 new/notes/src/dsply.c create mode 100644 new/notes/src/dump.c create mode 100644 new/notes/src/dump.h create mode 100644 new/notes/src/expand.c create mode 100644 new/notes/src/find.c create mode 100644 new/notes/src/ftime.c create mode 100644 new/notes/src/gdate.c create mode 100644 new/notes/src/getdate.y create mode 100644 new/notes/src/getnet.c create mode 100644 new/notes/src/gname.c create mode 100644 new/notes/src/gtext.c create mode 100644 new/notes/src/gtime.c create mode 100644 new/notes/src/help.c create mode 100644 new/notes/src/index.c create mode 100644 new/notes/src/index.help create mode 100644 new/notes/src/ldmisc.c create mode 100644 new/notes/src/lim.help create mode 100644 new/notes/src/limindx.c create mode 100644 new/notes/src/loadem.c create mode 100644 new/notes/src/loadnf.c create mode 100644 new/notes/src/loadproto1.c create mode 100644 new/notes/src/loadvars.c create mode 100644 new/notes/src/lprnote.c create mode 100644 new/notes/src/lrsp.c create mode 100644 new/notes/src/mailit.c create mode 100644 new/notes/src/main.c create mode 100644 new/notes/src/misc.c create mode 100644 new/notes/src/miscio.c create mode 100644 new/notes/src/mknf.c create mode 100644 new/notes/src/moderators create mode 100644 new/notes/src/net.h create mode 100644 new/notes/src/newsdump.c create mode 100644 new/notes/src/newsgate.h create mode 100644 new/notes/src/newsgroup.c create mode 100644 new/notes/src/newsinput.c create mode 100644 new/notes/src/newsout.c create mode 100644 new/notes/src/newsoutput.c create mode 100644 new/notes/src/newspath.c create mode 100644 new/notes/src/next.c create mode 100644 new/notes/src/nfabort.c create mode 100644 new/notes/src/nfaccess.c create mode 100644 new/notes/src/nfadmin.c create mode 100644 new/notes/src/nfalias.c create mode 100644 new/notes/src/nfarchive.c create mode 100644 new/notes/src/nfcomment.c create mode 100644 new/notes/src/nfdump.c create mode 100644 new/notes/src/nfload.c create mode 100644 new/notes/src/nfmail.c create mode 100644 new/notes/src/nfpipe.c create mode 100644 new/notes/src/nfprint.c create mode 100644 new/notes/src/nfrcv.c create mode 100644 new/notes/src/nfsend.c create mode 100644 new/notes/src/nfstats.c create mode 100644 new/notes/src/nftimestamp.c create mode 100644 new/notes/src/nfxmit.c create mode 100644 new/notes/src/note.c create mode 100644 new/notes/src/notes.lock create mode 100644 new/notes/src/notes.lock.ori create mode 100644 new/notes/src/pagein.c create mode 100644 new/notes/src/pagemove.c create mode 100644 new/notes/src/pageout.c create mode 100644 new/notes/src/parms.h create mode 100644 new/notes/src/parse.c create mode 100644 new/notes/src/parsepath.c create mode 100644 new/notes/src/pattern.c create mode 100644 new/notes/src/permit.c create mode 100644 new/notes/src/perms.c create mode 100644 new/notes/src/placedoc create mode 100644 new/notes/src/placelib create mode 100644 new/notes/src/preptxt.c create mode 100644 new/notes/src/prtind.c create mode 100644 new/notes/src/read.help create mode 100644 new/notes/src/readem.c create mode 100644 new/notes/src/recsio.c create mode 100644 new/notes/src/resp.c create mode 100755 new/notes/src/rinstall create mode 100644 new/notes/src/rmnf.c create mode 100644 new/notes/src/savtxt.c create mode 100644 new/notes/src/startup.c create mode 100644 new/notes/src/strcasecmp.c create mode 100644 new/notes/src/structs.h create mode 100644 new/notes/src/tags create mode 100644 new/notes/src/talkto.c create mode 100644 new/notes/src/times.c create mode 100644 new/notes/src/tsearch.c create mode 100644 new/pathalias/CHANGES create mode 100644 new/pathalias/Makefile create mode 100644 new/pathalias/README create mode 100644 new/pathalias/addlink.c create mode 100644 new/pathalias/addnode.c create mode 100644 new/pathalias/arpa-privates create mode 100644 new/pathalias/arpatxt.c create mode 100644 new/pathalias/config.h create mode 100644 new/pathalias/def.h create mode 100644 new/pathalias/getstruct.c create mode 100644 new/pathalias/local.c create mode 100644 new/pathalias/main.c create mode 100644 new/pathalias/make.honey create mode 100644 new/pathalias/makedb.c create mode 100644 new/pathalias/mapaux.c create mode 100644 new/pathalias/mapit.c create mode 100644 new/pathalias/mem.c create mode 100644 new/pathalias/parse.y create mode 100644 new/pathalias/pathalias.1 create mode 100644 new/pathalias/printit.c create mode 100644 new/pathalias/venix.patch create mode 100644 new/rcs/BUGS create mode 100644 new/rcs/Makefile create mode 100644 new/rcs/README create mode 100644 new/rcs/README-2.10 create mode 100644 new/rcs/doc/rcs.ms create mode 100644 new/rcs/doc/rcs_functs.ms create mode 100644 new/rcs/man/Makefile create mode 100644 new/rcs/man/ci.1 create mode 100644 new/rcs/man/co.1 create mode 100644 new/rcs/man/ident.1 create mode 100644 new/rcs/man/merge.1 create mode 100644 new/rcs/man/rcs.1 create mode 100644 new/rcs/man/rcsdiff.1 create mode 100644 new/rcs/man/rcsfile.5 create mode 100644 new/rcs/man/rcsfreeze.1 create mode 100644 new/rcs/man/rcsintro.1 create mode 100644 new/rcs/man/rcsmerge.1 create mode 100644 new/rcs/man/rlog.1 create mode 100644 new/rcs/man/sccstorcs.1 create mode 100644 new/rcs/src/Makefile create mode 100644 new/rcs/src/READ_ME create mode 100644 new/rcs/src/ci.c create mode 100644 new/rcs/src/co.c create mode 100644 new/rcs/src/curdir.c create mode 100644 new/rcs/src/ident.c create mode 100644 new/rcs/src/maketime.c create mode 100644 new/rcs/src/merge.sh create mode 100644 new/rcs/src/partime.c create mode 100644 new/rcs/src/rcs.c create mode 100644 new/rcs/src/rcsbase.h create mode 100644 new/rcs/src/rcsclean.c create mode 100644 new/rcs/src/rcsclean.sh create mode 100644 new/rcs/src/rcsdiff.c create mode 100644 new/rcs/src/rcsedit.c create mode 100644 new/rcs/src/rcsfcmp.c create mode 100644 new/rcs/src/rcsfnms.c create mode 100644 new/rcs/src/rcsfreeze.sh create mode 100644 new/rcs/src/rcsgen.c create mode 100644 new/rcs/src/rcskeep.c create mode 100644 new/rcs/src/rcskeys.c create mode 100644 new/rcs/src/rcslex.c create mode 100644 new/rcs/src/rcsmerge.c create mode 100644 new/rcs/src/rcsrev.c create mode 100644 new/rcs/src/rcssyn.c create mode 100644 new/rcs/src/rcsutil.c create mode 100644 new/rcs/src/rlog.c create mode 100644 new/rcs/src/sccstorcs.c create mode 100644 new/rcs/src/snoop.c create mode 100644 new/rcs/src/time.h create mode 100644 new/rn/.falseactive create mode 100755 new/rn/Configure create mode 100644 new/rn/EXTERN.h create mode 100644 new/rn/HACKERSGUIDE create mode 100644 new/rn/INIT create mode 100644 new/rn/INTERN.h create mode 100644 new/rn/MANIFEST create mode 100644 new/rn/Makefile create mode 100644 new/rn/Makefile.SH create mode 100644 new/rn/NEW create mode 100755 new/rn/Pnews create mode 100644 new/rn/Pnews.1 create mode 100644 new/rn/Pnews.SH create mode 100644 new/rn/Pnews.header create mode 100644 new/rn/README create mode 100755 new/rn/Rnmail create mode 100644 new/rn/Rnmail.1 create mode 100644 new/rn/Rnmail.SH create mode 100644 new/rn/Wishlist create mode 100644 new/rn/addng.c create mode 100644 new/rn/addng.h create mode 100644 new/rn/all create mode 100644 new/rn/art.c create mode 100644 new/rn/art.h create mode 100755 new/rn/art.help create mode 100644 new/rn/art.help.SH create mode 100644 new/rn/artio.c create mode 100644 new/rn/artio.h create mode 100644 new/rn/artsrch.c create mode 100644 new/rn/artsrch.h create mode 100644 new/rn/artstate.h create mode 100644 new/rn/backpage.c create mode 100644 new/rn/backpage.h create mode 100644 new/rn/bits.c create mode 100644 new/rn/bits.h create mode 100755 new/rn/bsd create mode 100644 new/rn/cheat.c create mode 100644 new/rn/cheat.h create mode 100644 new/rn/common.h create mode 100644 new/rn/config.h create mode 100644 new/rn/config.sh create mode 100755 new/rn/eunice create mode 100755 new/rn/filexp create mode 100644 new/rn/final.c create mode 100644 new/rn/final.h create mode 100644 new/rn/getactive.c create mode 100644 new/rn/head.c create mode 100644 new/rn/head.c.bak create mode 100644 new/rn/head.h create mode 100644 new/rn/header.c.1.pat create mode 100644 new/rn/header.c.2.pat create mode 100644 new/rn/header.h.1.pat create mode 100644 new/rn/header.h.2.pat create mode 100644 new/rn/help.c create mode 100644 new/rn/help.h create mode 100644 new/rn/inews.c.1.pat create mode 100644 new/rn/inews.c.2.pat create mode 100644 new/rn/init.c create mode 100644 new/rn/init.h create mode 100644 new/rn/intrp.c create mode 100644 new/rn/intrp.h create mode 100644 new/rn/kfile.c create mode 100644 new/rn/kfile.h create mode 100644 new/rn/kitleader create mode 100644 new/rn/kitlists.c create mode 100644 new/rn/kittrailer create mode 100644 new/rn/last.c create mode 100644 new/rn/last.h create mode 100755 new/rn/loc create mode 100755 new/rn/makedepend create mode 100644 new/rn/makedepend.SH create mode 100755 new/rn/makedir create mode 100644 new/rn/makedir.SH create mode 100644 new/rn/makedist create mode 100644 new/rn/makekit create mode 100644 new/rn/manifake create mode 100644 new/rn/manimake create mode 100755 new/rn/mbox.saver create mode 100644 new/rn/mbox.saver.SH create mode 100644 new/rn/myread create mode 100644 new/rn/ndir.c create mode 100644 new/rn/ndir.h create mode 100755 new/rn/newsetup create mode 100644 new/rn/newsetup.1 create mode 100644 new/rn/newsetup.SH create mode 100755 new/rn/newsgroups create mode 100644 new/rn/newsgroups.1 create mode 100644 new/rn/newsgroups.SH create mode 100644 new/rn/newsnews create mode 100644 new/rn/newsnews.SH create mode 100644 new/rn/ng.c create mode 100644 new/rn/ng.h create mode 100755 new/rn/ng.help create mode 100644 new/rn/ng.help.SH create mode 100644 new/rn/ngdata.c create mode 100644 new/rn/ngdata.h create mode 100644 new/rn/ngsrch.c create mode 100644 new/rn/ngsrch.h create mode 100644 new/rn/ngstuff.c create mode 100644 new/rn/ngstuff.h create mode 100755 new/rn/norm.saver create mode 100644 new/rn/norm.saver.SH create mode 100644 new/rn/only.c create mode 100644 new/rn/only.h create mode 100755 new/rn/pager.help create mode 100644 new/rn/pager.help.SH create mode 100644 new/rn/patchlevel create mode 100755 new/rn/pdp11 create mode 100644 new/rn/rcln.c create mode 100644 new/rn/rcln.h create mode 100644 new/rn/rcstuff.c create mode 100644 new/rn/rcstuff.h create mode 100644 new/rn/respond.c create mode 100644 new/rn/respond.h create mode 100644 new/rn/rn.1 create mode 100644 new/rn/rn.c create mode 100644 new/rn/rn.h create mode 100644 new/rn/search.c create mode 100644 new/rn/search.h create mode 100644 new/rn/server.h create mode 100755 new/rn/subs.help create mode 100644 new/rn/subs.help.SH create mode 100644 new/rn/sw.c create mode 100644 new/rn/sw.h create mode 100644 new/rn/term.c create mode 100644 new/rn/term.h create mode 100755 new/rn/usg create mode 100644 new/rn/util.c create mode 100644 new/rn/util.h create mode 100755 new/rn/v7 create mode 100644 new/vmsbackup/Makefile create mode 100644 new/vmsbackup/README create mode 100644 new/vmsbackup/match.c create mode 100644 new/vmsbackup/vmsbackup.1 create mode 100644 new/vmsbackup/vmsbackup.c create mode 100644 old/512dumpdir.c create mode 100644 old/512restor.c create mode 100644 old/Makefile create mode 100644 old/arcv/Makefile create mode 100644 old/arcv/arcv.8 create mode 100644 old/arcv/arcv.c create mode 100644 old/astags/astags.1 create mode 100755 old/astags/astags.sh create mode 100644 old/checkobj/Makefile create mode 100644 old/checkobj/checkobj.1 create mode 100644 old/checkobj/checkobj.c create mode 100644 old/compact/Makefile create mode 100644 old/compact/ccat.sh create mode 100644 old/compact/compact.c create mode 100644 old/compact/compact.h create mode 100644 old/compact/tree.c create mode 100644 old/compact/uncompact.c create mode 100644 old/cu/cu.1c create mode 100644 old/cu/cu.c create mode 100644 old/dump/Makefile create mode 100644 old/dump/dump.h create mode 100644 old/dump/dumpdir.c create mode 100644 old/dump/dumpitime.c create mode 100644 old/dump/dumpmain.c create mode 100644 old/dump/dumpoptr.c create mode 100644 old/dump/dumptape.c create mode 100644 old/dump/dumptraverse.c create mode 100644 old/dump/unctime.c create mode 100644 old/nmcoll/Makefile create mode 100644 old/nmcoll/nmcoll.1 create mode 100644 old/nmcoll/nmcoll.sh create mode 100644 old/num.c create mode 100644 old/oldassn/Makefile create mode 100644 old/oldassn/oldassn.1 create mode 100644 old/oldassn/oldassn.l create mode 100644 old/prep/Makefile create mode 100644 old/prep/prep.1 create mode 100644 old/prep/prep.h create mode 100644 old/prep/prep0.c create mode 100644 old/prep/prep1.c create mode 100644 old/prep/prep2.c create mode 100644 old/prmail/prmail.1 create mode 100644 old/prmail/prmail.c create mode 100644 old/regexp.c create mode 100644 old/shortc/Makefile create mode 100644 old/shortc/shortc.1 create mode 100644 old/shortc/shortc.c create mode 100644 old/uudiff/Makefile create mode 100644 old/uudiff/lenrem.c create mode 100644 old/uudiff/locpart.c create mode 100644 old/uudiff/printable.c create mode 100644 old/uudiff/remdiff create mode 100644 old/uudiff/run1.c create mode 100644 old/uudiff/trim.c create mode 100644 old/v6/Makefile create mode 100644 old/v6/filsys.h create mode 100644 old/v6/inode.h create mode 100644 old/v6/v6.c create mode 100644 old/vpr.tar.Z create mode 100644 sbin/Makefile create mode 100644 sbin/XNSrouted/Makefile create mode 100644 sbin/XNSrouted/XNSrouted.c create mode 100644 sbin/badsect/Makefile create mode 100644 sbin/badsect/badsect.8 create mode 100644 sbin/badsect/badsect.c create mode 100644 sbin/clri/Makefile create mode 100644 sbin/clri/clri.8 create mode 100644 sbin/clri/clri.c create mode 100644 sbin/dcheck/Makefile create mode 100644 sbin/dcheck/dcheck.8 create mode 100644 sbin/dcheck/dcheck.c create mode 100644 sbin/dmesg/Makefile create mode 100644 sbin/dmesg/dmesg.8 create mode 100644 sbin/dmesg/dmesg.c create mode 100644 sbin/dump/Makefile create mode 100644 sbin/dump/dump.h create mode 100644 sbin/dump/dumpdir.c create mode 100644 sbin/dump/dumpitime.c create mode 100644 sbin/dump/dumpmain.c create mode 100644 sbin/dump/dumpoptr.c create mode 100644 sbin/dump/dumprmt.c create mode 100644 sbin/dump/dumptape.c create mode 100644 sbin/dump/dumptraverse.c create mode 100644 sbin/dump/unctime.c create mode 100644 sbin/dumpfs/Makefile create mode 100644 sbin/dumpfs/dumpfs.8 create mode 100644 sbin/dumpfs/dumpfs.c create mode 100644 sbin/fsck/Makefile create mode 100644 sbin/fsck/dir.c create mode 100644 sbin/fsck/fsck.h create mode 100644 sbin/fsck/inode.c create mode 100644 sbin/fsck/main.c create mode 100644 sbin/fsck/pass1.c create mode 100644 sbin/fsck/pass1b.c create mode 100644 sbin/fsck/pass2.c create mode 100644 sbin/fsck/pass3.c create mode 100644 sbin/fsck/pass4.c create mode 100644 sbin/fsck/pass5.c create mode 100644 sbin/fsck/setup.c create mode 100644 sbin/fsck/utilities.c create mode 100644 sbin/gt307/Makefile create mode 100644 sbin/gt307/gt307.8 create mode 100644 sbin/gt307/gt307.c create mode 100644 sbin/icheck/Makefile create mode 100644 sbin/icheck/icheck.8 create mode 100644 sbin/icheck/icheck.c create mode 100644 sbin/ifconfig/Makefile create mode 100644 sbin/ifconfig/ifconfig.8 create mode 100644 sbin/ifconfig/ifconfig.c create mode 100644 sbin/init/Makefile create mode 100644 sbin/init/init.8 create mode 100644 sbin/init/init.c create mode 100644 sbin/mkfs/Makefile create mode 100644 sbin/mkfs/mkfs.8 create mode 100644 sbin/mkfs/mkfs.c create mode 100644 sbin/mknod/Makefile create mode 100644 sbin/mknod/mknod.8 create mode 100644 sbin/mknod/mknod.c create mode 100644 sbin/mkpasswd/Makefile create mode 100644 sbin/mkpasswd/mkpasswd.8 create mode 100644 sbin/mkpasswd/mkpasswd.c create mode 100644 sbin/mount/Makefile create mode 100644 sbin/mount/getmntopts.3 create mode 100644 sbin/mount/getmntopts.c create mode 100644 sbin/mount/mntopts.h create mode 100644 sbin/mount/mount.8 create mode 100644 sbin/mount/mount.c create mode 100644 sbin/mount/mount_ufs.c create mode 100644 sbin/mount/pathnames.h create mode 100644 sbin/ncheck/Makefile create mode 100644 sbin/ncheck/ncheck.8 create mode 100644 sbin/ncheck/ncheck.c create mode 100644 sbin/newfs/Makefile create mode 100644 sbin/newfs/newfs.8 create mode 100644 sbin/newfs/newfs.c create mode 100644 sbin/quotacheck/Makefile create mode 100644 sbin/quotacheck/preen.c create mode 100644 sbin/quotacheck/quotacheck.8 create mode 100644 sbin/quotacheck/quotacheck.c create mode 100644 sbin/reboot/Makefile create mode 100644 sbin/reboot/reboot.8 create mode 100644 sbin/reboot/reboot.c create mode 100644 sbin/restor/Makefile create mode 100644 sbin/restor/restor.8 create mode 100644 sbin/restor/restor.c create mode 100644 sbin/route/Makefile create mode 100644 sbin/route/route.8 create mode 100644 sbin/route/route.c create mode 100644 sbin/routed/Makefile create mode 100644 sbin/routed/af.c create mode 100644 sbin/routed/af.h create mode 100644 sbin/routed/defs.h create mode 100644 sbin/routed/if.c create mode 100644 sbin/routed/inet.c create mode 100644 sbin/routed/input.c create mode 100644 sbin/routed/interface.h create mode 100644 sbin/routed/main.c create mode 100644 sbin/routed/make.out create mode 100644 sbin/routed/output.c create mode 100644 sbin/routed/startup.c create mode 100644 sbin/routed/table.h create mode 100644 sbin/routed/tables.c create mode 100644 sbin/routed/timer.c create mode 100644 sbin/routed/tools/Makefile create mode 100644 sbin/routed/tools/query.c create mode 100644 sbin/routed/tools/trace.c create mode 100644 sbin/routed/trace.c create mode 100644 sbin/routed/trace.h create mode 100644 sbin/savecore/Makefile create mode 100644 sbin/savecore/savecore.8 create mode 100644 sbin/savecore/savecore.c create mode 100644 sbin/shutdown/Makefile create mode 100644 sbin/shutdown/shutdown.8 create mode 100644 sbin/shutdown/shutdown.c create mode 100644 sbin/slattach/Makefile create mode 100644 sbin/slattach/slattach.8 create mode 100644 sbin/slattach/slattach.c create mode 100644 sbin/swapon/Makefile create mode 100644 sbin/swapon/swapon.8 create mode 100644 sbin/swapon/swapon.c create mode 100644 sbin/testnet/Makefile create mode 100644 sbin/testnet/testnet.c create mode 100644 sbin/tunefs/Makefile create mode 100644 sbin/tunefs/tunefs.8 create mode 100644 sbin/tunefs/tunefs.c create mode 100644 sbin/umount/Makefile create mode 100644 sbin/umount/umount.8 create mode 100644 sbin/umount/umount.c create mode 100644 share/Makefile create mode 100644 share/adb/Makefile create mode 100644 share/adb/N/buf create mode 100644 share/adb/N/idp create mode 100644 share/adb/N/ifaddr create mode 100644 share/adb/N/nspcb create mode 100644 share/adb/N/nsrtentry create mode 100644 share/adb/N/route create mode 100644 share/adb/N/spp create mode 100644 share/adb/N/sppcb create mode 100644 share/adb/N/tty create mode 100644 share/adb/N/xx create mode 100644 share/adb/PORT/clist create mode 100644 share/adb/PORT/clist.nxt create mode 100644 share/adb/PORT/dino create mode 100644 share/adb/PORT/dir create mode 100644 share/adb/PORT/dir.nxt create mode 100644 share/adb/PORT/dirblk create mode 100644 share/adb/PORT/dmap create mode 100644 share/adb/PORT/dmcstats create mode 100644 share/adb/PORT/file create mode 100644 share/adb/PORT/filsys create mode 100644 share/adb/PORT/findinode create mode 100644 share/adb/PORT/findinode.nxt create mode 100644 share/adb/PORT/findproc create mode 100644 share/adb/PORT/findproc.nxt create mode 100644 share/adb/PORT/frame create mode 100644 share/adb/PORT/host.nxt create mode 100644 share/adb/PORT/hosts create mode 100644 share/adb/PORT/hosts.nxt create mode 100644 share/adb/PORT/hosttable create mode 100644 share/adb/PORT/ifnet create mode 100644 share/adb/PORT/ifrw create mode 100644 share/adb/PORT/ifuba create mode 100644 share/adb/PORT/ifubinfo create mode 100644 share/adb/PORT/ifxmt create mode 100644 share/adb/PORT/imp create mode 100644 share/adb/PORT/in_ifaddr create mode 100644 share/adb/PORT/inode create mode 100644 share/adb/PORT/inpcb create mode 100644 share/adb/PORT/iovec create mode 100644 share/adb/PORT/ipreass create mode 100644 share/adb/PORT/ipreass.nxt create mode 100644 share/adb/PORT/mact create mode 100644 share/adb/PORT/mact.nxt create mode 100644 share/adb/PORT/mba_device create mode 100644 share/adb/PORT/mba_hd create mode 100644 share/adb/PORT/mbstat create mode 100644 share/adb/PORT/mbufchain create mode 100644 share/adb/PORT/mount create mode 100644 share/adb/PORT/nameidata create mode 100644 share/adb/PORT/nl create mode 100644 share/adb/PORT/nu create mode 100644 share/adb/PORT/oimp create mode 100644 share/adb/PORT/packetchain create mode 100644 share/adb/PORT/pcb create mode 100644 share/adb/PORT/proc create mode 100644 share/adb/PORT/protosw create mode 100644 share/adb/PORT/quota create mode 100644 share/adb/PORT/rawcb create mode 100644 share/adb/PORT/rtentry create mode 100644 share/adb/PORT/rusage create mode 100644 share/adb/PORT/setproc create mode 100644 share/adb/PORT/setproc.done create mode 100644 share/adb/PORT/setproc.nxt create mode 100644 share/adb/PORT/socket create mode 100644 share/adb/PORT/stacktrace create mode 100644 share/adb/PORT/stat create mode 100644 share/adb/PORT/tcpcb create mode 100644 share/adb/PORT/tcpip create mode 100644 share/adb/PORT/tcpreass create mode 100644 share/adb/PORT/tcpreass.nxt create mode 100644 share/adb/PORT/text create mode 100644 share/adb/PORT/traceall create mode 100644 share/adb/PORT/traceall.nxt create mode 100644 share/adb/PORT/trapframe create mode 100644 share/adb/PORT/tty create mode 100644 share/adb/PORT/u.all create mode 100644 share/adb/PORT/ubadev create mode 100644 share/adb/PORT/ubahd create mode 100644 share/adb/PORT/uio create mode 100644 share/adb/PORT/un create mode 100644 share/adb/PORT/unpcb create mode 100644 share/adb/PORT/vtimes create mode 100644 share/adb/buf create mode 100644 share/adb/callout create mode 100644 share/adb/callout.next create mode 100644 share/adb/file create mode 100644 share/adb/ifaddr create mode 100644 share/adb/ifnet create mode 100644 share/adb/inode create mode 100644 share/adb/ip create mode 100644 share/adb/label create mode 100644 share/adb/mbstat create mode 100644 share/adb/mbuf create mode 100644 share/adb/mbuf.nxt create mode 100644 share/adb/mbufs create mode 100644 share/adb/mbufs.nxt create mode 100644 share/adb/proc create mode 100644 share/adb/protosw create mode 100644 share/adb/rusage create mode 100644 share/adb/socket create mode 100644 share/adb/tcpcb create mode 100644 share/adb/u create mode 100644 share/adb/xip create mode 100644 share/font/Makefile create mode 100644 share/font/fontlist create mode 100644 share/font/ftB create mode 100644 share/font/ftBC create mode 100644 share/font/ftC create mode 100644 share/font/ftCE create mode 100644 share/font/ftCI create mode 100644 share/font/ftCK create mode 100644 share/font/ftCW create mode 100644 share/font/ftFD create mode 100644 share/font/ftG create mode 100644 share/font/ftGI create mode 100644 share/font/ftGM create mode 100644 share/font/ftGR create mode 100644 share/font/ftH create mode 100644 share/font/ftHI create mode 100644 share/font/ftHM create mode 100644 share/font/ftI create mode 100644 share/font/ftL create mode 100644 share/font/ftLI create mode 100644 share/font/ftPA create mode 100644 share/font/ftPB create mode 100644 share/font/ftPI create mode 100644 share/font/ftR create mode 100644 share/font/ftS create mode 100644 share/font/ftSB create mode 100644 share/font/ftSI create mode 100644 share/font/ftSM create mode 100644 share/font/ftTB create mode 100644 share/font/ftTI create mode 100644 share/font/ftTR create mode 100644 share/font/ftTS create mode 100644 share/font/ftUD create mode 100644 share/font/ftap create mode 100644 share/font/ftbb create mode 100644 share/font/ftbi create mode 100644 share/font/ftbk create mode 100644 share/font/ftbr create mode 100644 share/font/ftcb create mode 100644 share/font/ftch create mode 100644 share/font/ftci create mode 100644 share/font/ftcl create mode 100644 share/font/ftco create mode 100644 share/font/ftcr create mode 100644 share/font/ftct create mode 100644 share/font/ftcy create mode 100644 share/font/ftdb create mode 100644 share/font/ftdi create mode 100644 share/font/ftdr create mode 100644 share/font/ftfx create mode 100644 share/font/ftgb create mode 100644 share/font/ftgf create mode 100644 share/font/ftgi create mode 100644 share/font/ftgk create mode 100644 share/font/ftgr create mode 100644 share/font/fthb create mode 100644 share/font/fthn create mode 100644 share/font/ftm create mode 100644 share/font/ftmb create mode 100644 share/font/ftmi create mode 100644 share/font/ftmn create mode 100644 share/font/ftmr create mode 100644 share/font/ftnb create mode 100644 share/font/ftni create mode 100644 share/font/ftnr create mode 100644 share/font/ftob create mode 100644 share/font/ftoe create mode 100644 share/font/ftoi create mode 100644 share/font/ftor create mode 100644 share/font/ftpb create mode 100644 share/font/ftpp create mode 100644 share/font/ftsb create mode 100644 share/font/ftsc create mode 100644 share/font/ftsg create mode 100644 share/font/ftsh create mode 100644 share/font/ftsi create mode 100644 share/font/ftsl create mode 100644 share/font/ftsr create mode 100644 share/font/fttB create mode 100644 share/font/fttI create mode 100644 share/font/fttR create mode 100644 share/font/fttS create mode 100644 share/font/fttb create mode 100644 share/font/ftti create mode 100644 share/font/fttr create mode 100644 share/font/ftts create mode 100644 share/font/ftwp create mode 100644 share/font/ftxx create mode 100644 share/fontinfo/Makefile create mode 100644 share/fontinfo/apl create mode 100644 share/fontinfo/basker.b create mode 100644 share/fontinfo/basker.i create mode 100644 share/fontinfo/basker.r create mode 100644 share/fontinfo/bocklin create mode 100644 share/fontinfo/bodoni.b create mode 100644 share/fontinfo/bodoni.i create mode 100644 share/fontinfo/bodoni.r create mode 100644 share/fontinfo/chess create mode 100644 share/fontinfo/clarendon create mode 100644 share/fontinfo/cm.b create mode 100644 share/fontinfo/cm.i create mode 100644 share/fontinfo/cm.r create mode 100644 share/fontinfo/countdown create mode 100644 share/fontinfo/cyrillic create mode 100644 share/fontinfo/delegate.b create mode 100644 share/fontinfo/delegate.i create mode 100644 share/fontinfo/delegate.r create mode 100644 share/fontinfo/fix create mode 100644 share/fontinfo/gacham.b create mode 100644 share/fontinfo/gacham.i create mode 100644 share/fontinfo/gacham.r create mode 100644 share/fontinfo/graphics create mode 100644 share/fontinfo/greek create mode 100644 share/fontinfo/h19 create mode 100644 share/fontinfo/hebrew create mode 100644 share/fontinfo/meteor.b create mode 100644 share/fontinfo/meteor.i create mode 100644 share/fontinfo/meteor.r create mode 100644 share/fontinfo/mona create mode 100644 share/fontinfo/nonie.b create mode 100644 share/fontinfo/nonie.i create mode 100644 share/fontinfo/nonie.r create mode 100644 share/fontinfo/oldenglish create mode 100644 share/fontinfo/otimes.b create mode 100644 share/fontinfo/otimes.i create mode 100644 share/fontinfo/otimes.r create mode 100644 share/fontinfo/otimes.s create mode 100644 share/fontinfo/pip create mode 100644 share/fontinfo/playbill create mode 100644 share/fontinfo/script create mode 100644 share/fontinfo/seal create mode 100644 share/fontinfo/shadow create mode 100644 share/fontinfo/sign create mode 100644 share/fontinfo/stare.b create mode 100644 share/fontinfo/stare.i create mode 100644 share/fontinfo/stare.r create mode 100644 share/fontinfo/times.b create mode 100644 share/fontinfo/times.i create mode 100644 share/fontinfo/times.r create mode 100644 share/fontinfo/times.s create mode 100644 share/fontinfo/ugramma create mode 100644 share/fontinfo/wumpus create mode 100644 share/learn/C/L0 create mode 100644 share/learn/C/L0.1a create mode 100644 share/learn/C/L1.1a create mode 100644 share/learn/C/L1.1b create mode 100644 share/learn/C/L1.1c create mode 100644 share/learn/C/L1.1d create mode 100644 share/learn/C/L1.1e create mode 100644 share/learn/C/L1.1f create mode 100644 share/learn/C/L10 create mode 100644 share/learn/C/L11.1a create mode 100644 share/learn/C/L11.2a create mode 100644 share/learn/C/L12.1a create mode 100644 share/learn/C/L12.1b create mode 100644 share/learn/C/L13.1a create mode 100644 share/learn/C/L14.1a create mode 100644 share/learn/C/L14.2a create mode 100644 share/learn/C/L14.2b create mode 100644 share/learn/C/L15.1a create mode 100644 share/learn/C/L15.1b create mode 100644 share/learn/C/L16.2a create mode 100644 share/learn/C/L16.2b create mode 100644 share/learn/C/L16.2c create mode 100644 share/learn/C/L17.1a create mode 100644 share/learn/C/L17.1c create mode 100644 share/learn/C/L18.1a create mode 100644 share/learn/C/L19.1a create mode 100644 share/learn/C/L2.1a create mode 100644 share/learn/C/L2.1b create mode 100644 share/learn/C/L2.1c create mode 100644 share/learn/C/L2.1d create mode 100644 share/learn/C/L2.1e create mode 100644 share/learn/C/L20.1a create mode 100644 share/learn/C/L3.1a create mode 100644 share/learn/C/L3.1b create mode 100644 share/learn/C/L30.1a create mode 100644 share/learn/C/L31.1a create mode 100644 share/learn/C/L32.1a create mode 100644 share/learn/C/L33.1a create mode 100644 share/learn/C/L35.1a create mode 100644 share/learn/C/L37.1a create mode 100644 share/learn/C/L4.1a create mode 100644 share/learn/C/L40.1a create mode 100644 share/learn/C/L41.1a create mode 100644 share/learn/C/L42.1a create mode 100644 share/learn/C/L43.1a create mode 100644 share/learn/C/L43.1b create mode 100644 share/learn/C/L5.1a create mode 100644 share/learn/C/L5.1b create mode 100644 share/learn/C/L5.1c create mode 100644 share/learn/C/L5.1d create mode 100644 share/learn/C/L5.1e create mode 100644 share/learn/C/L5.1f create mode 100644 share/learn/C/L5.1g create mode 100644 share/learn/C/L5.2a create mode 100644 share/learn/C/L5.2b create mode 100644 share/learn/C/L5.2e create mode 100644 share/learn/C/L5.3e create mode 100644 share/learn/C/L50.1a create mode 100644 share/learn/C/L9.1a create mode 100644 share/learn/C/getline.c create mode 100644 share/learn/C/getnum.c create mode 100644 share/learn/Linfo create mode 100644 share/learn/Makefile create mode 100644 share/learn/Xinfo create mode 100644 share/learn/editor/L0 create mode 100644 share/learn/editor/L1.1a create mode 100644 share/learn/editor/L10.1a create mode 100644 share/learn/editor/L10.1b create mode 100644 share/learn/editor/L10.2a create mode 100644 share/learn/editor/L10.2b create mode 100644 share/learn/editor/L10.2c create mode 100644 share/learn/editor/L10.3a create mode 100644 share/learn/editor/L10.3b create mode 100644 share/learn/editor/L10.3c create mode 100644 share/learn/editor/L10.3d create mode 100644 share/learn/editor/L10.3e create mode 100644 share/learn/editor/L10.3f create mode 100644 share/learn/editor/L11.1a create mode 100644 share/learn/editor/L11.2a create mode 100644 share/learn/editor/L11.2b create mode 100644 share/learn/editor/L11.2c create mode 100644 share/learn/editor/L12.1a create mode 100644 share/learn/editor/L12.1b create mode 100644 share/learn/editor/L12.2a create mode 100644 share/learn/editor/L12.2b create mode 100644 share/learn/editor/L12.2c create mode 100644 share/learn/editor/L12.3a create mode 100644 share/learn/editor/L13.1a create mode 100644 share/learn/editor/L13.2a create mode 100644 share/learn/editor/L13.2b create mode 100644 share/learn/editor/L13.3a create mode 100644 share/learn/editor/L14.1a create mode 100644 share/learn/editor/L14.2a create mode 100644 share/learn/editor/L14.2b create mode 100644 share/learn/editor/L15.1a create mode 100644 share/learn/editor/L15.1b create mode 100644 share/learn/editor/L15.2a create mode 100644 share/learn/editor/L15.2b create mode 100644 share/learn/editor/L15.2c create mode 100644 share/learn/editor/L15.2d create mode 100644 share/learn/editor/L15.3b create mode 100644 share/learn/editor/L15.3d create mode 100644 share/learn/editor/L15.3e create mode 100644 share/learn/editor/L15.3f create mode 100644 share/learn/editor/L16.1a create mode 100644 share/learn/editor/L16.1b create mode 100644 share/learn/editor/L16.1c create mode 100644 share/learn/editor/L16.2a create mode 100644 share/learn/editor/L16.2c create mode 100644 share/learn/editor/L17.2a create mode 100644 share/learn/editor/L17.2b create mode 100644 share/learn/editor/L17.2c create mode 100644 share/learn/editor/L17.2d create mode 100644 share/learn/editor/L18.1a create mode 100644 share/learn/editor/L18.2a create mode 100644 share/learn/editor/L18.2c create mode 100644 share/learn/editor/L18.2d create mode 100644 share/learn/editor/L18.2e create mode 100644 share/learn/editor/L18.3a create mode 100644 share/learn/editor/L18.3b create mode 100644 share/learn/editor/L19.1a create mode 100644 share/learn/editor/L19.1b create mode 100644 share/learn/editor/L19.2a create mode 100644 share/learn/editor/L19.2c create mode 100644 share/learn/editor/L19.2d create mode 100644 share/learn/editor/L19.2e create mode 100644 share/learn/editor/L19.2f create mode 100644 share/learn/editor/L19.3b create mode 100644 share/learn/editor/L2.1a create mode 100644 share/learn/editor/L2.2a create mode 100644 share/learn/editor/L20.01a create mode 100644 share/learn/editor/L20.01b create mode 100644 share/learn/editor/L20.01c create mode 100644 share/learn/editor/L20.1a create mode 100644 share/learn/editor/L20.2a create mode 100644 share/learn/editor/L20.2b create mode 100644 share/learn/editor/L20.2c create mode 100644 share/learn/editor/L21.1a create mode 100644 share/learn/editor/L21.1b create mode 100644 share/learn/editor/L21.1c create mode 100644 share/learn/editor/L21.1d create mode 100644 share/learn/editor/L21.1e create mode 100644 share/learn/editor/L3.1a create mode 100644 share/learn/editor/L3.1b create mode 100644 share/learn/editor/L3.1c create mode 100644 share/learn/editor/L30.1a create mode 100644 share/learn/editor/L30.1b create mode 100644 share/learn/editor/L30.2a create mode 100644 share/learn/editor/L30.2b create mode 100644 share/learn/editor/L30.2c create mode 100644 share/learn/editor/L30.2d create mode 100644 share/learn/editor/L30.2e create mode 100644 share/learn/editor/L30.2f create mode 100644 share/learn/editor/L30.2g create mode 100644 share/learn/editor/L30.2h create mode 100644 share/learn/editor/L31.1a create mode 100644 share/learn/editor/L31.2b create mode 100644 share/learn/editor/L31.2c create mode 100644 share/learn/editor/L32.1a create mode 100644 share/learn/editor/L32.1b create mode 100644 share/learn/editor/L32.1c create mode 100644 share/learn/editor/L32.2a create mode 100644 share/learn/editor/L32.2b create mode 100644 share/learn/editor/L32.2c create mode 100644 share/learn/editor/L32.2d create mode 100644 share/learn/editor/L32.2e create mode 100644 share/learn/editor/L32.2f create mode 100644 share/learn/editor/L32.2g create mode 100644 share/learn/editor/L33.1a create mode 100644 share/learn/editor/L33.1b create mode 100644 share/learn/editor/L33.2a create mode 100644 share/learn/editor/L33.2b create mode 100644 share/learn/editor/L33.2c create mode 100644 share/learn/editor/L34.1a create mode 100644 share/learn/editor/L34.1b create mode 100644 share/learn/editor/L34.2a create mode 100644 share/learn/editor/L34.2b create mode 100644 share/learn/editor/L34.2c create mode 100644 share/learn/editor/L34.2d create mode 100644 share/learn/editor/L34.2e create mode 100644 share/learn/editor/L34.2f create mode 100644 share/learn/editor/L35.1a create mode 100644 share/learn/editor/L35.2a create mode 100644 share/learn/editor/L35.2b create mode 100644 share/learn/editor/L35.2c create mode 100644 share/learn/editor/L35.2d create mode 100644 share/learn/editor/L35.2e create mode 100644 share/learn/editor/L36.1a create mode 100644 share/learn/editor/L36.2a create mode 100644 share/learn/editor/L36.2b create mode 100644 share/learn/editor/L36.2c create mode 100644 share/learn/editor/L36.2d create mode 100644 share/learn/editor/L37.1a create mode 100644 share/learn/editor/L37.2a create mode 100644 share/learn/editor/L37.2b create mode 100644 share/learn/editor/L37.2c create mode 100644 share/learn/editor/L37.2d create mode 100644 share/learn/editor/L37.2e create mode 100644 share/learn/editor/L37.2f create mode 100644 share/learn/editor/L38.1a create mode 100644 share/learn/editor/L38.2a create mode 100644 share/learn/editor/L38.2b create mode 100644 share/learn/editor/L39.1a create mode 100644 share/learn/editor/L4.1a create mode 100644 share/learn/editor/L4.1b create mode 100644 share/learn/editor/L4.2a create mode 100644 share/learn/editor/L4.2b create mode 100644 share/learn/editor/L40.1a create mode 100644 share/learn/editor/L40.1b create mode 100644 share/learn/editor/L40.2b create mode 100644 share/learn/editor/L40.2c create mode 100644 share/learn/editor/L40.2d create mode 100644 share/learn/editor/L41.1a create mode 100644 share/learn/editor/L41.1b create mode 100644 share/learn/editor/L42.1a create mode 100644 share/learn/editor/L42.2a create mode 100644 share/learn/editor/L42.2b create mode 100644 share/learn/editor/L42.2c create mode 100644 share/learn/editor/L43.1a create mode 100644 share/learn/editor/L43.2a create mode 100644 share/learn/editor/L43.2b create mode 100644 share/learn/editor/L43.2c create mode 100644 share/learn/editor/L43.2d create mode 100644 share/learn/editor/L44.1a create mode 100644 share/learn/editor/L44.1b create mode 100644 share/learn/editor/L44.1c create mode 100644 share/learn/editor/L44.1d create mode 100644 share/learn/editor/L44.1e create mode 100644 share/learn/editor/L44.1f create mode 100644 share/learn/editor/L44.1g create mode 100644 share/learn/editor/L44.1h create mode 100644 share/learn/editor/L44.1i create mode 100644 share/learn/editor/L45.1a create mode 100644 share/learn/editor/L45.1b create mode 100644 share/learn/editor/L5.1a create mode 100644 share/learn/editor/L50.1a create mode 100644 share/learn/editor/L50.1b create mode 100644 share/learn/editor/L50.1c create mode 100644 share/learn/editor/L50.2c create mode 100644 share/learn/editor/L50.2d create mode 100644 share/learn/editor/L50.2e create mode 100644 share/learn/editor/L50.2f create mode 100644 share/learn/editor/L50.2g create mode 100644 share/learn/editor/L51.1a create mode 100644 share/learn/editor/L51.2a create mode 100644 share/learn/editor/L51.2b create mode 100644 share/learn/editor/L51.2c create mode 100644 share/learn/editor/L52.1a create mode 100644 share/learn/editor/L52.1b create mode 100644 share/learn/editor/L52.2a create mode 100644 share/learn/editor/L52.2b create mode 100644 share/learn/editor/L52.2c create mode 100644 share/learn/editor/L53.1a create mode 100644 share/learn/editor/L53.2b create mode 100644 share/learn/editor/L54.1a create mode 100644 share/learn/editor/L54.1b create mode 100644 share/learn/editor/L55.1a create mode 100644 share/learn/editor/L56.1a create mode 100644 share/learn/editor/L57.1a create mode 100644 share/learn/editor/L6.1a create mode 100644 share/learn/editor/L6.2a create mode 100644 share/learn/editor/L6.2b create mode 100644 share/learn/editor/L60.1a create mode 100644 share/learn/editor/L60.1b create mode 100644 share/learn/editor/L60.2a create mode 100644 share/learn/editor/L60.2b create mode 100644 share/learn/editor/L60.2c create mode 100644 share/learn/editor/L60.2d create mode 100644 share/learn/editor/L61.1a create mode 100644 share/learn/editor/L62.1a create mode 100644 share/learn/editor/L62.2a create mode 100644 share/learn/editor/L62.2b create mode 100644 share/learn/editor/L62.2c create mode 100644 share/learn/editor/L63.1a create mode 100644 share/learn/editor/L63.1b create mode 100644 share/learn/editor/L63.1c create mode 100644 share/learn/editor/L63.1d create mode 100644 share/learn/editor/L63.1e create mode 100644 share/learn/editor/L64.1a create mode 100644 share/learn/editor/L64.1b create mode 100644 share/learn/editor/L65.1a create mode 100644 share/learn/editor/L66.1a create mode 100644 share/learn/editor/L7.1a create mode 100644 share/learn/editor/L7.1b create mode 100644 share/learn/editor/L7.2c create mode 100644 share/learn/editor/L70.1a create mode 100644 share/learn/editor/L70.2a create mode 100644 share/learn/editor/L70.2b create mode 100644 share/learn/editor/L70.2c create mode 100644 share/learn/editor/L70.2d create mode 100644 share/learn/editor/L70.2e create mode 100644 share/learn/editor/L70.2f create mode 100644 share/learn/editor/L70.2g create mode 100644 share/learn/editor/L71.1a create mode 100644 share/learn/editor/L72.1a create mode 100644 share/learn/editor/L72.2a create mode 100644 share/learn/editor/L72.2b create mode 100644 share/learn/editor/L72.2c create mode 100644 share/learn/editor/L72.2d create mode 100644 share/learn/editor/L73.1a create mode 100644 share/learn/editor/L74.1a create mode 100644 share/learn/editor/L8.1a create mode 100644 share/learn/editor/L8.1b create mode 100644 share/learn/editor/L8.2a create mode 100644 share/learn/editor/L8.2b create mode 100644 share/learn/editor/L8.2c create mode 100644 share/learn/editor/L9.1a create mode 100644 share/learn/editor/L9.2a create mode 100644 share/learn/editor/L9.2b create mode 100644 share/learn/editor/L9.2d create mode 100644 share/learn/editor/L9.2e create mode 100644 share/learn/editor/L9.3c create mode 100644 share/learn/eqn/Init create mode 100644 share/learn/eqn/L0 create mode 100644 share/learn/eqn/L0.1a create mode 100644 share/learn/eqn/L1.1a create mode 100644 share/learn/eqn/L1.1b create mode 100644 share/learn/eqn/L1.1c create mode 100644 share/learn/eqn/L1.1d create mode 100644 share/learn/eqn/L1.1e create mode 100644 share/learn/eqn/L1.1f create mode 100644 share/learn/eqn/L10.1a create mode 100644 share/learn/eqn/L10.1b create mode 100644 share/learn/eqn/L10.1c create mode 100644 share/learn/eqn/L10.2c create mode 100644 share/learn/eqn/L11.1a create mode 100644 share/learn/eqn/L11.1b create mode 100644 share/learn/eqn/L11.1c create mode 100644 share/learn/eqn/L11.1d create mode 100644 share/learn/eqn/L11.1e create mode 100644 share/learn/eqn/L11.1f create mode 100644 share/learn/eqn/L11.1g create mode 100644 share/learn/eqn/L12.1a create mode 100644 share/learn/eqn/L12.1b create mode 100644 share/learn/eqn/L12.1c create mode 100644 share/learn/eqn/L12.1d create mode 100644 share/learn/eqn/L12.1e create mode 100644 share/learn/eqn/L2.1a create mode 100644 share/learn/eqn/L2.1b create mode 100644 share/learn/eqn/L2.1c create mode 100644 share/learn/eqn/L2.1d create mode 100644 share/learn/eqn/L2.1e create mode 100644 share/learn/eqn/L2.1f create mode 100644 share/learn/eqn/L2.2a create mode 100644 share/learn/eqn/L2.2b create mode 100644 share/learn/eqn/L2.2e create mode 100644 share/learn/eqn/L3.1a create mode 100644 share/learn/eqn/L3.1b create mode 100644 share/learn/eqn/L3.1c create mode 100644 share/learn/eqn/L3.1d create mode 100644 share/learn/eqn/L3.1e create mode 100644 share/learn/eqn/L3.2a create mode 100644 share/learn/eqn/L3.2c create mode 100644 share/learn/eqn/L3.2d create mode 100644 share/learn/eqn/L4.1a create mode 100644 share/learn/eqn/L4.1b create mode 100644 share/learn/eqn/L4.1c create mode 100644 share/learn/eqn/L4.1d create mode 100644 share/learn/eqn/L4.2a create mode 100644 share/learn/eqn/L4.2c create mode 100644 share/learn/eqn/L5.1a create mode 100644 share/learn/eqn/L5.1b create mode 100644 share/learn/eqn/L5.1c create mode 100644 share/learn/eqn/L5.1d create mode 100644 share/learn/eqn/L5.1e create mode 100644 share/learn/eqn/L5.1f create mode 100644 share/learn/eqn/L5.1g create mode 100644 share/learn/eqn/L5.1h create mode 100644 share/learn/eqn/L5.2b create mode 100644 share/learn/eqn/L5.2d create mode 100644 share/learn/eqn/L5.2g create mode 100644 share/learn/eqn/L6.1a create mode 100644 share/learn/eqn/L6.1b create mode 100644 share/learn/eqn/L6.1c create mode 100644 share/learn/eqn/L6.1d create mode 100644 share/learn/eqn/L7.1a create mode 100644 share/learn/eqn/L7.1b create mode 100644 share/learn/eqn/L7.1c create mode 100644 share/learn/eqn/L7.1d create mode 100644 share/learn/eqn/L7.2b create mode 100644 share/learn/eqn/L7.2c create mode 100644 share/learn/eqn/L8.1a create mode 100644 share/learn/eqn/L8.1b create mode 100644 share/learn/eqn/L8.2b create mode 100644 share/learn/eqn/L9.1a create mode 100644 share/learn/eqn/L9.1b create mode 100644 share/learn/eqn/L9.2a create mode 100644 share/learn/eqn/L9.2b create mode 100644 share/learn/eqn/L9.3b create mode 100644 share/learn/eqn/tinyms create mode 100644 share/learn/files/L0 create mode 100644 share/learn/files/L0.01a create mode 100644 share/learn/files/L0.1a create mode 100644 share/learn/files/L0.1b create mode 100644 share/learn/files/L0.1c create mode 100644 share/learn/files/L0.1d create mode 100644 share/learn/files/L1.1a create mode 100644 share/learn/files/L1.2a create mode 100644 share/learn/files/L1.2b create mode 100644 share/learn/files/L10.1a create mode 100644 share/learn/files/L10.2a create mode 100644 share/learn/files/L10.2b create mode 100644 share/learn/files/L10.3a create mode 100644 share/learn/files/L10.3b create mode 100644 share/learn/files/L10.3c create mode 100644 share/learn/files/L10.3d create mode 100644 share/learn/files/L11.1a create mode 100644 share/learn/files/L11.2a create mode 100644 share/learn/files/L11.2b create mode 100644 share/learn/files/L11.3a create mode 100644 share/learn/files/L11.3b create mode 100644 share/learn/files/L11.3c create mode 100644 share/learn/files/L12.1a create mode 100644 share/learn/files/L12.2a create mode 100644 share/learn/files/L12.2b create mode 100644 share/learn/files/L12.2c create mode 100644 share/learn/files/L12.3a create mode 100644 share/learn/files/L12.3b create mode 100644 share/learn/files/L12.3c create mode 100644 share/learn/files/L13.01a create mode 100644 share/learn/files/L13.1a create mode 100644 share/learn/files/L13.1b create mode 100644 share/learn/files/L13.1c create mode 100644 share/learn/files/L13.1d create mode 100644 share/learn/files/L13.1e create mode 100644 share/learn/files/L13.1f create mode 100644 share/learn/files/L13.1g create mode 100644 share/learn/files/L2.1a create mode 100644 share/learn/files/L2.2a create mode 100644 share/learn/files/L2.2b create mode 100644 share/learn/files/L3.1a create mode 100644 share/learn/files/L3.2a create mode 100644 share/learn/files/L3.2b create mode 100644 share/learn/files/L3.3a create mode 100644 share/learn/files/L3.3b create mode 100644 share/learn/files/L4.1a create mode 100644 share/learn/files/L4.2a create mode 100644 share/learn/files/L4.2b create mode 100644 share/learn/files/L4.3a create mode 100644 share/learn/files/L4.3b create mode 100644 share/learn/files/L4.3c create mode 100644 share/learn/files/L5.1a create mode 100644 share/learn/files/L5.1b create mode 100644 share/learn/files/L5.1c create mode 100644 share/learn/files/L5.1d create mode 100644 share/learn/files/L5.1e create mode 100644 share/learn/files/L6.1a create mode 100644 share/learn/files/L6.1b create mode 100644 share/learn/files/L6.1c create mode 100644 share/learn/files/L6.1d create mode 100644 share/learn/files/L6.1e create mode 100644 share/learn/files/L6.2a create mode 100644 share/learn/files/L6.2b create mode 100644 share/learn/files/L7.1a create mode 100644 share/learn/files/L7.2a create mode 100644 share/learn/files/L7.2b create mode 100644 share/learn/files/L7.3a create mode 100644 share/learn/files/L7.3b create mode 100644 share/learn/files/L7.3c create mode 100644 share/learn/files/L8.1a create mode 100644 share/learn/files/L8.2a create mode 100644 share/learn/files/L8.2b create mode 100644 share/learn/files/L8.2c create mode 100644 share/learn/files/L9.1a create mode 100644 share/learn/files/L9.2a create mode 100644 share/learn/files/L9.2b create mode 100644 share/learn/files/L9.2c create mode 100644 share/learn/macros/L0 create mode 100644 share/learn/macros/L1.1a create mode 100644 share/learn/macros/L10.1a create mode 100644 share/learn/macros/L11.1a create mode 100644 share/learn/macros/L12.1a create mode 100644 share/learn/macros/L13.1a create mode 100644 share/learn/macros/L14.1a create mode 100644 share/learn/macros/L15.1a create mode 100644 share/learn/macros/L2.1a create mode 100644 share/learn/macros/L3.1a create mode 100644 share/learn/macros/L4.1a create mode 100644 share/learn/macros/L5.1a create mode 100644 share/learn/macros/L6.1a create mode 100644 share/learn/macros/L7.1a create mode 100644 share/learn/macros/L8.1a create mode 100644 share/learn/macros/L9.1a create mode 100644 share/learn/morefiles/L0 create mode 100644 share/learn/morefiles/L0.1a create mode 100644 share/learn/morefiles/L0.1b create mode 100644 share/learn/morefiles/L0.1c create mode 100644 share/learn/morefiles/L0.1d create mode 100644 share/learn/morefiles/L0.1e create mode 100644 share/learn/morefiles/L0.1f create mode 100644 share/learn/morefiles/L0.1g create mode 100644 share/learn/morefiles/L1.1a create mode 100644 share/learn/morefiles/L1.1b create mode 100644 share/learn/morefiles/L1.1c create mode 100644 share/learn/morefiles/L1.1d create mode 100644 share/learn/morefiles/L2.1a create mode 100644 share/learn/morefiles/L2.1b create mode 100644 share/learn/morefiles/L2.1c create mode 100644 share/learn/morefiles/L2.1d create mode 100644 share/learn/morefiles/L2.1e create mode 100644 share/learn/morefiles/L2.1f create mode 100644 share/learn/morefiles/L3.1a create mode 100644 share/learn/morefiles/L3.1b create mode 100644 share/learn/morefiles/L3.1c create mode 100644 share/learn/morefiles/L3.1d create mode 100644 share/learn/morefiles/L3.1e create mode 100644 share/learn/morefiles/L3.1f create mode 100644 share/learn/morefiles/L3.1g create mode 100644 share/learn/morefiles/L4.1a create mode 100644 share/learn/morefiles/L4.1b create mode 100644 share/learn/morefiles/L4.1c create mode 100644 share/learn/morefiles/L4.1d create mode 100644 share/learn/morefiles/L4.1e create mode 100644 share/learn/morefiles/L4.1f create mode 100644 share/learn/morefiles/L4.1g create mode 100644 share/learn/morefiles/L4.2a create mode 100644 share/learn/morefiles/L5.1a create mode 100644 share/learn/morefiles/L5.1b create mode 100644 share/learn/morefiles/L5.1c create mode 100644 share/learn/morefiles/L5.1d create mode 100644 share/learn/morefiles/L5.1e create mode 100644 share/learn/morefiles/L6.1a create mode 100644 share/learn/morefiles/L6.1b create mode 100644 share/learn/morefiles/L6.1c create mode 100644 share/learn/morefiles/L6.1d create mode 100644 share/learn/morefiles/L6.1e create mode 100644 share/learn/morefiles/L6.2e create mode 100644 share/learn/morefiles/L7.1a create mode 100644 share/learn/vi/Init create mode 100644 share/learn/vi/L0 create mode 100644 share/learn/vi/L1.1a create mode 100644 share/learn/vi/L1.1b create mode 100644 share/learn/vi/L1.2 create mode 100644 share/learn/vi/L2.1 create mode 100644 share/learn/vi/L2.2 create mode 100644 share/learn/vi/L2.3 create mode 100644 share/learn/vi/L2.4 create mode 100644 share/learn/vi/L3.1 create mode 100644 share/learn/vi/L3.2 create mode 100644 share/learn/vi/L3.3 create mode 100644 share/learn/vi/L3.4 create mode 100644 share/learn/vi/L4.0 create mode 100644 share/learn/vi/L4.1 create mode 100644 share/learn/vi/L4.2 create mode 100644 share/learn/vi/L4.3 create mode 100644 share/learn/vi/L5.1 create mode 100644 share/learn/vi/L5.2 create mode 100644 share/learn/vi/L5.3 create mode 100644 share/learn/vi/L5.4 create mode 100644 share/learn/vi/L6.1 create mode 100644 share/learn/vi/L6.2 create mode 100644 share/learn/vi/L6.3 create mode 100644 share/learn/vi/L6.4 create mode 100644 share/learn/vi/longtext create mode 100644 share/lint/Makefile create mode 100644 share/lint/llib-lc create mode 100644 share/lint/llib-lcurses create mode 100644 share/lint/llib-ldbm create mode 100644 share/lint/llib-lm create mode 100644 share/lint/llib-lmp create mode 100644 share/lint/llib-lplot create mode 100644 share/lint/llib-ltermcap create mode 100644 share/lint/llib-port create mode 100644 share/me/Makefile create mode 100644 share/me/acm.me create mode 100644 share/me/chars.me create mode 100644 share/me/deltext.me create mode 100644 share/me/eqn.me create mode 100644 share/me/float.me create mode 100644 share/me/footnote.me create mode 100644 share/me/index.me create mode 100644 share/me/letterhead.me create mode 100644 share/me/local.me create mode 100644 share/me/null.me create mode 100644 share/me/refer.me create mode 100644 share/me/revisions create mode 100644 share/me/sh.me create mode 100644 share/me/summary.extern create mode 100644 share/me/tbl.me create mode 100644 share/me/test.accent create mode 100644 share/me/test.umlaut create mode 100644 share/me/thesis.me create mode 100644 share/me/tmac.e create mode 100644 share/misc/Mail.help create mode 100644 share/misc/Mail.tildehelp create mode 100644 share/misc/Makefile create mode 100644 share/misc/eign create mode 100644 share/misc/gprof.callg create mode 100644 share/misc/gprof.flat create mode 100755 share/misc/lib.b create mode 100644 share/misc/mkproto.data create mode 100644 share/misc/units create mode 100644 share/misc/vlpmacs create mode 100644 share/ms/Makefile create mode 100644 share/ms/README create mode 100644 share/ms/end.awk create mode 100755 share/ms/endnote create mode 100644 share/ms/s.acc create mode 100644 share/ms/s.cov create mode 100644 share/ms/s.eqn create mode 100644 share/ms/s.ref create mode 100644 share/ms/s.tbl create mode 100644 share/ms/s.ths create mode 100644 share/ms/s.toc create mode 100644 share/termcap/Makefile create mode 100644 share/termcap/README create mode 100644 share/termcap/map3270 create mode 100644 share/termcap/reorder create mode 100644 share/termcap/tabset/3101 create mode 100644 share/termcap/tabset/aa create mode 100644 share/termcap/tabset/aed512 create mode 100644 share/termcap/tabset/beehive create mode 100644 share/termcap/tabset/diablo create mode 100644 share/termcap/tabset/dtc382 create mode 100644 share/termcap/tabset/ibm3101 create mode 100644 share/termcap/tabset/std create mode 100644 share/termcap/tabset/stdcrt create mode 100644 share/termcap/tabset/tandem653 create mode 100644 share/termcap/tabset/teleray create mode 100644 share/termcap/tabset/vt100 create mode 100644 share/termcap/tabset/wyse-adds create mode 100644 share/termcap/tabset/xerox1720 create mode 100644 share/termcap/tabset/xerox1730 create mode 100644 share/termcap/tabset/xerox1730-lm create mode 100644 share/termcap/tabset/zenith29 create mode 100644 share/termcap/termcap.local create mode 100644 share/termcap/termcap.src create mode 100644 share/tmac/Makefile create mode 100644 share/tmac/tmac.a create mode 100644 share/tmac/tmac.an create mode 100644 share/tmac/tmac.an.new create mode 100644 share/tmac/tmac.an6n create mode 100644 share/tmac/tmac.an6t create mode 100644 share/tmac/tmac.ayday create mode 100644 share/tmac/tmac.cp create mode 100644 share/tmac/tmac.imagen create mode 100644 share/tmac/tmac.os create mode 100644 share/tmac/tmac.r create mode 100644 share/tmac/tmac.s create mode 100644 share/tmac/tmac.scover create mode 100644 share/tmac/tmac.sdisp create mode 100644 share/tmac/tmac.skeep create mode 100644 share/tmac/tmac.srefs create mode 100644 share/tmac/tmac.vcat create mode 100644 share/zoneinfo/Makefile create mode 100644 share/zoneinfo/README create mode 100644 share/zoneinfo/Theory create mode 100644 share/zoneinfo/asia create mode 100644 share/zoneinfo/australasia create mode 100644 share/zoneinfo/etcetera create mode 100644 share/zoneinfo/europe create mode 100644 share/zoneinfo/ialloc.c create mode 100644 share/zoneinfo/northamerica create mode 100644 share/zoneinfo/pacificnew create mode 100644 share/zoneinfo/scheck.c create mode 100644 share/zoneinfo/solar87 create mode 100644 share/zoneinfo/systemv create mode 100644 share/zoneinfo/zdump.8 create mode 100644 share/zoneinfo/zdump.c create mode 100644 share/zoneinfo/zic.8 create mode 100644 share/zoneinfo/zic.c create mode 100644 sys/CURLY/Make.net create mode 100644 sys/CURLY/Make.pdp create mode 100644 sys/CURLY/Make.pdpmba create mode 100644 sys/CURLY/Make.pdpnet create mode 100644 sys/CURLY/Make.pdpuba create mode 100644 sys/CURLY/Make.sys create mode 100644 sys/CURLY/Makefile create mode 100644 sys/CURLY/NETSPLFIX create mode 100644 sys/CURLY/SPLFIX create mode 100644 sys/CURLY/acc.h create mode 100644 sys/CURLY/boot.s create mode 100644 sys/CURLY/br.h create mode 100644 sys/CURLY/cn.h create mode 100644 sys/CURLY/css.h create mode 100644 sys/CURLY/de.h create mode 100644 sys/CURLY/dh.h create mode 100644 sys/CURLY/dhu.h create mode 100644 sys/CURLY/dhv.h create mode 100644 sys/CURLY/dmc.h create mode 100644 sys/CURLY/dn.h create mode 100644 sys/CURLY/dr.h create mode 100644 sys/CURLY/dz.h create mode 100644 sys/CURLY/ec.h create mode 100644 sys/CURLY/en.h create mode 100644 sys/CURLY/ether.h create mode 100644 sys/CURLY/hk.h create mode 100644 sys/CURLY/ht.h create mode 100644 sys/CURLY/hy.h create mode 100644 sys/CURLY/il.h create mode 100644 sys/CURLY/imp.h create mode 100644 sys/CURLY/ingres.h create mode 100644 sys/CURLY/ioconf.c create mode 100644 sys/CURLY/localopts.h create mode 100644 sys/CURLY/loop.h create mode 100644 sys/CURLY/lp.h create mode 100644 sys/CURLY/param.c create mode 100644 sys/CURLY/pty.h create mode 100644 sys/CURLY/qe.h create mode 100644 sys/CURLY/qt.h create mode 100644 sys/CURLY/ra.h create mode 100644 sys/CURLY/ram.h create mode 100644 sys/CURLY/rk.h create mode 100644 sys/CURLY/rl.h create mode 100644 sys/CURLY/rx.h create mode 100644 sys/CURLY/si.h create mode 100644 sys/CURLY/sl.h create mode 100644 sys/CURLY/sri.h create mode 100644 sys/CURLY/tb.h create mode 100644 sys/CURLY/tm.h create mode 100644 sys/CURLY/tms.h create mode 100644 sys/CURLY/ts.h create mode 100644 sys/CURLY/vers.c create mode 100644 sys/CURLY/version create mode 100644 sys/CURLY/vv.h create mode 100644 sys/CURLY/xp.h create mode 100644 sys/GENERIC/Make.pdp create mode 100644 sys/GENERIC/Make.pdpmba create mode 100644 sys/GENERIC/Make.pdpuba create mode 100644 sys/GENERIC/Make.sys create mode 100644 sys/GENERIC/Makefile create mode 100644 sys/GENERIC/SPLFIX create mode 100644 sys/GENERIC/acc.h create mode 100644 sys/GENERIC/boot.s create mode 100644 sys/GENERIC/br.h create mode 100644 sys/GENERIC/cn.h create mode 100644 sys/GENERIC/css.h create mode 100644 sys/GENERIC/de.h create mode 100644 sys/GENERIC/dh.h create mode 100644 sys/GENERIC/dhu.h create mode 100644 sys/GENERIC/dhv.h create mode 100644 sys/GENERIC/dmc.h create mode 100644 sys/GENERIC/dn.h create mode 100644 sys/GENERIC/dr.h create mode 100644 sys/GENERIC/dz.h create mode 100644 sys/GENERIC/ec.h create mode 100644 sys/GENERIC/en.h create mode 100644 sys/GENERIC/ether.h create mode 100644 sys/GENERIC/hk.h create mode 100644 sys/GENERIC/ht.h create mode 100644 sys/GENERIC/hy.h create mode 100644 sys/GENERIC/il.h create mode 100644 sys/GENERIC/imp.h create mode 100644 sys/GENERIC/ingres.h create mode 100644 sys/GENERIC/ioconf.c create mode 100644 sys/GENERIC/localopts.h create mode 100644 sys/GENERIC/loop.h create mode 100644 sys/GENERIC/lp.h create mode 100644 sys/GENERIC/param.c create mode 100644 sys/GENERIC/pty.h create mode 100644 sys/GENERIC/qe.h create mode 100644 sys/GENERIC/qt.h create mode 100644 sys/GENERIC/ra.h create mode 100644 sys/GENERIC/ram.h create mode 100644 sys/GENERIC/rk.h create mode 100644 sys/GENERIC/rl.h create mode 100644 sys/GENERIC/rx.h create mode 100644 sys/GENERIC/si.h create mode 100644 sys/GENERIC/sl.h create mode 100644 sys/GENERIC/sri.h create mode 100644 sys/GENERIC/tb.h create mode 100644 sys/GENERIC/tm.h create mode 100644 sys/GENERIC/tms.h create mode 100644 sys/GENERIC/ts.h create mode 100644 sys/GENERIC/vers.c create mode 100644 sys/GENERIC/version create mode 100644 sys/GENERIC/vv.h create mode 100644 sys/GENERIC/xp.h create mode 100644 sys/OTHERS/EXOS.204/if_ex.c.diffs create mode 100644 sys/OTHERS/GLUE/c.c create mode 100644 sys/OTHERS/GLUE/l.s create mode 100644 sys/OTHERS/GLUE/uprobe.c create mode 100644 sys/OTHERS/PRO/PRO create mode 100644 sys/OTHERS/PRO/PRO.diff create mode 100644 sys/OTHERS/README create mode 100644 sys/OTHERS/acucntrl create mode 100644 sys/OTHERS/bad144/bad144.c create mode 100644 sys/OTHERS/bad144/conf.c.diff create mode 100644 sys/OTHERS/bad144/dkio.h create mode 100644 sys/OTHERS/bad144/xp.c create mode 100644 sys/OTHERS/berknet/README create mode 100644 sys/OTHERS/berknet/berknet_driver create mode 100644 sys/OTHERS/berknet/bk.c create mode 100644 sys/OTHERS/berknet/bkmac.h create mode 100644 sys/OTHERS/berknet/bkmac.h.43 create mode 100644 sys/OTHERS/berknet/for_tty_conf.c create mode 100644 sys/OTHERS/berknet/tty_bk.c create mode 100644 sys/OTHERS/cat/cat.c create mode 100644 sys/OTHERS/cr11/cr.c create mode 100644 sys/OTHERS/cr11/crreg.h create mode 100644 sys/OTHERS/dc11/dc.c create mode 100644 sys/OTHERS/dc11/dcreg.h create mode 100644 sys/OTHERS/de11/de.c create mode 100644 sys/OTHERS/de11/de_locore create mode 100644 sys/OTHERS/de11/dereg.h create mode 100644 sys/OTHERS/dig_anal/ds.4l create mode 100644 sys/OTHERS/dig_anal/ds.c create mode 100644 sys/OTHERS/dig_anal/dsc.h create mode 100644 sys/OTHERS/dig_anal/dsreg.h create mode 100644 sys/OTHERS/dj11/dj.c create mode 100644 sys/OTHERS/dj11/djreg.h create mode 100644 sys/OTHERS/dm11/dhdm.c create mode 100644 sys/OTHERS/dm11/dhfdm.c create mode 100644 sys/OTHERS/dmc11/dmc.c create mode 100644 sys/OTHERS/dsd480/rx3.c create mode 100644 sys/OTHERS/du11/du.c create mode 100644 sys/OTHERS/du11/dureg.h create mode 100644 sys/OTHERS/dv/dv.c create mode 100644 sys/OTHERS/dvhp/dvhp.c create mode 100644 sys/OTHERS/dvhp/dvhp_stand.c create mode 100644 sys/OTHERS/emulex-cs02/cs02-q22-fixes create mode 100644 sys/OTHERS/fast_timer/ft.c create mode 100644 sys/OTHERS/fuji_160/README create mode 100644 sys/OTHERS/fuji_160/dev/xp.c create mode 100644 sys/OTHERS/fuji_160/include/hpreg.h create mode 100644 sys/OTHERS/fuji_160/ioconf.c create mode 100644 sys/OTHERS/fuji_160/libsa/xp.c create mode 100644 sys/OTHERS/fuji_160/xp.h create mode 100644 sys/OTHERS/ht/ht.c create mode 100644 sys/OTHERS/ht/ht_fix create mode 100644 sys/OTHERS/interleave/dkleave.c create mode 100644 sys/OTHERS/interleave/param.h create mode 100644 sys/OTHERS/kl/README create mode 100644 sys/OTHERS/kl/kl.c create mode 100644 sys/OTHERS/kl/kl.h create mode 100644 sys/OTHERS/kl/klreg.h create mode 100644 sys/OTHERS/ml11/ml.c create mode 100644 sys/OTHERS/ml11/mlreg.h create mode 100644 sys/OTHERS/multiplexor/mx1.c create mode 100644 sys/OTHERS/multiplexor/mx2.c create mode 100644 sys/OTHERS/nap/nap.c create mode 100644 sys/OTHERS/packet_driver/pack.h create mode 100644 sys/OTHERS/packet_driver/pack.h_#2 create mode 100644 sys/OTHERS/packet_driver/pk.h create mode 100644 sys/OTHERS/packet_driver/pk0.c create mode 100644 sys/OTHERS/packet_driver/pk1.c create mode 100644 sys/OTHERS/packet_driver/pk2.c create mode 100644 sys/OTHERS/packet_driver/pk3.c create mode 100644 sys/OTHERS/pdpstand/tm-ts-pred create mode 100644 sys/OTHERS/ra/mdec.rauboot.s create mode 100644 sys/OTHERS/ra/stand.ra.c create mode 100644 sys/OTHERS/rc/rc.c create mode 100644 sys/OTHERS/rc/rcreg.h create mode 100644 sys/OTHERS/rf11/rf.c create mode 100644 sys/OTHERS/rf11/rfreg.h create mode 100644 sys/OTHERS/rm02.03.05/rm.c create mode 100644 sys/OTHERS/rm02.03.05/rm_GENERIC create mode 100644 sys/OTHERS/rm02.03.05/rm_autoconfig create mode 100644 sys/OTHERS/rm02.03.05/rm_conf.c create mode 100644 sys/OTHERS/rm02.03.05/rm_config create mode 100644 sys/OTHERS/rm02.03.05/rm_scb.s create mode 100644 sys/OTHERS/rm02.03.05/rm_stand.c create mode 100644 sys/OTHERS/rp03/rp.c create mode 100644 sys/OTHERS/rp03/rp.pdpstand.c create mode 100644 sys/OTHERS/rp03/rp03.b create mode 100644 sys/OTHERS/rp03/rpreg.h create mode 100644 sys/OTHERS/rp03/rpuboot.s create mode 100644 sys/OTHERS/rp04.06/hp.c create mode 100644 sys/OTHERS/rp04.06/hp_GENERIC create mode 100644 sys/OTHERS/rp04.06/hp_autoconfig create mode 100644 sys/OTHERS/rp04.06/hp_conf.c create mode 100644 sys/OTHERS/rp04.06/hp_config create mode 100644 sys/OTHERS/rp04.06/hp_scb.s create mode 100644 sys/OTHERS/rp04.06/hpauto.c create mode 100644 sys/OTHERS/rp04.06/hpreg.h create mode 100644 sys/OTHERS/rs03.04/hs.c create mode 100644 sys/OTHERS/rs03.04/hsreg.h create mode 100644 sys/OTHERS/rx01/README create mode 100644 sys/OTHERS/rx01/rx.c create mode 100644 sys/OTHERS/rx01/rx.h create mode 100644 sys/OTHERS/rx01/rxreg.h create mode 100644 sys/OTHERS/rx02/#1/rx2.c create mode 100644 sys/OTHERS/rx02/#1/rx2reg.h create mode 100644 sys/OTHERS/rx11/rx.c create mode 100644 sys/OTHERS/scsi/scsi.c create mode 100644 sys/OTHERS/scsi/scsi_locore create mode 100644 sys/OTHERS/scsi/scsireg.h create mode 100644 sys/OTHERS/scsi2/README create mode 100644 sys/OTHERS/scsi2/xe.c create mode 100644 sys/OTHERS/scsi2/xereg.h create mode 100644 sys/OTHERS/scsi2/xestand.c create mode 100644 sys/OTHERS/scsi2/xeuboot.s create mode 120000 sys/OTHERS/tags create mode 100644 sys/OTHERS/tektronix/tektronix create mode 100644 sys/OTHERS/tk/4.3BSD/tmscp.h create mode 100644 sys/OTHERS/tk/bin/tk.c create mode 100644 sys/OTHERS/tk/pdpstand/tk.c create mode 100644 sys/OTHERS/tk/pdpstand/tk_saio.h create mode 100644 sys/OTHERS/tk/pdpstand/tkboot.s create mode 100644 sys/OTHERS/tk/pdpuba/tk.c create mode 100644 sys/OTHERS/ts/ts.c create mode 100644 sys/OTHERS/ts/ts.c_Q22 create mode 100644 sys/OTHERS/ung_bass_dr11w/if_un.c create mode 100644 sys/OTHERS/versatec/h.vcmd.h create mode 100644 sys/OTHERS/versatec/pdpuba.vcmd.h create mode 100644 sys/OTHERS/versatec/vp.c create mode 100644 sys/OTHERS/versatec/vp_GENERIC create mode 100644 sys/OTHERS/versatec/vp_autoconfig create mode 100644 sys/OTHERS/versatec/vp_conf.c create mode 100644 sys/OTHERS/versatec/vp_config create mode 100644 sys/OTHERS/versatec/vp_scb.s create mode 100644 sys/OTHERS/versatec/vpauto.c create mode 100644 sys/OTHERS/versatec/vpreg.h create mode 100644 sys/QT/Make.net create mode 100644 sys/QT/Make.pdp create mode 100644 sys/QT/Make.pdpmba create mode 100644 sys/QT/Make.pdpnet create mode 100644 sys/QT/Make.pdpuba create mode 100644 sys/QT/Make.sys create mode 100644 sys/QT/Makefile create mode 100644 sys/QT/NETSPLFIX create mode 100644 sys/QT/SPLFIX create mode 100644 sys/QT/acc.h create mode 100644 sys/QT/boot.s create mode 100644 sys/QT/br.h create mode 100644 sys/QT/cn.h create mode 100644 sys/QT/css.h create mode 100644 sys/QT/de.h create mode 100644 sys/QT/dh.h create mode 100644 sys/QT/dhu.h create mode 100644 sys/QT/dhv.h create mode 100644 sys/QT/dmc.h create mode 100644 sys/QT/dn.h create mode 100644 sys/QT/dr.h create mode 100644 sys/QT/dz.h create mode 100644 sys/QT/ec.h create mode 100644 sys/QT/en.h create mode 100644 sys/QT/ether.h create mode 100644 sys/QT/hk.h create mode 100644 sys/QT/ht.h create mode 100644 sys/QT/hy.h create mode 100644 sys/QT/il.h create mode 100644 sys/QT/imp.h create mode 100644 sys/QT/ingres.h create mode 100644 sys/QT/ioconf.c create mode 100644 sys/QT/localopts.h create mode 100644 sys/QT/loop.h create mode 100644 sys/QT/lp.h create mode 100644 sys/QT/param.c create mode 100644 sys/QT/pty.h create mode 100644 sys/QT/qe.h create mode 100644 sys/QT/qt.h create mode 100644 sys/QT/ra.h create mode 100644 sys/QT/ram.h create mode 100644 sys/QT/rk.h create mode 100644 sys/QT/rl.h create mode 100644 sys/QT/rx.h create mode 100644 sys/QT/si.h create mode 100644 sys/QT/sl.h create mode 100644 sys/QT/sri.h create mode 100644 sys/QT/tb.h create mode 100644 sys/QT/tm.h create mode 100644 sys/QT/tms.h create mode 100644 sys/QT/ts.h create mode 100644 sys/QT/vers.c create mode 100644 sys/QT/version create mode 100644 sys/QT/vv.h create mode 100644 sys/QT/xp.h create mode 100644 sys/autoconfig/Makefile create mode 100644 sys/autoconfig/attach.c create mode 100644 sys/autoconfig/brauto.c create mode 100644 sys/autoconfig/cnauto.c create mode 100644 sys/autoconfig/dhauto.c create mode 100644 sys/autoconfig/dhuauto.c create mode 100644 sys/autoconfig/dhvauto.c create mode 100644 sys/autoconfig/dnauto.c create mode 100644 sys/autoconfig/do_config.c create mode 100644 sys/autoconfig/drauto.c create mode 100644 sys/autoconfig/dtab.h create mode 100644 sys/autoconfig/dzauto.c create mode 100644 sys/autoconfig/hkauto.c create mode 100644 sys/autoconfig/htauto.c create mode 100644 sys/autoconfig/ivec.h create mode 100644 sys/autoconfig/lpauto.c create mode 100644 sys/autoconfig/main.c create mode 100644 sys/autoconfig/raauto.c create mode 100644 sys/autoconfig/read_dtab.c create mode 100644 sys/autoconfig/read_nlist.c create mode 100644 sys/autoconfig/rkauto.c create mode 100644 sys/autoconfig/rlauto.c create mode 100644 sys/autoconfig/rxauto.c create mode 100644 sys/autoconfig/siauto.c create mode 100644 sys/autoconfig/tags create mode 100644 sys/autoconfig/tmauto.c create mode 100644 sys/autoconfig/tmsauto.c create mode 100644 sys/autoconfig/tsauto.c create mode 100644 sys/autoconfig/uprobe.c create mode 100644 sys/autoconfig/uprobe.h create mode 100644 sys/autoconfig/xpauto.c create mode 100644 sys/bootrom/siboot.s create mode 120000 sys/bootrom/tags create mode 100644 sys/conf/:comm-to-bss create mode 100644 sys/conf/CURLY create mode 100644 sys/conf/GENERIC create mode 100644 sys/conf/Make.net create mode 100644 sys/conf/Make.nsunix create mode 100644 sys/conf/Make.pdp create mode 100644 sys/conf/Make.pdpmba create mode 100644 sys/conf/Make.pdpnet create mode 100644 sys/conf/Make.pdpuba create mode 100644 sys/conf/Make.sunix create mode 100644 sys/conf/Make.sys create mode 100644 sys/conf/Make.unix create mode 100644 sys/conf/NONET create mode 100644 sys/conf/QT create mode 100644 sys/conf/README create mode 100644 sys/conf/boot/Makefile create mode 100644 sys/conf/boot/NONEboot.s create mode 100644 sys/conf/boot/brboot.s create mode 100644 sys/conf/boot/dvhpboot.s create mode 100644 sys/conf/boot/hk6boot.s create mode 100644 sys/conf/boot/hk7boot.s create mode 100644 sys/conf/boot/raboot.s create mode 100644 sys/conf/boot/rlboot.s create mode 100644 sys/conf/boot/rmboot.s create mode 100644 sys/conf/boot/sc11boot.s create mode 100644 sys/conf/boot/sc21boot.s create mode 100644 sys/conf/boot/siboot.s create mode 100644 sys/conf/checksys.c create mode 100755 sys/conf/config create mode 100644 sys/conf/ioconf.c create mode 100644 sys/conf/netbind.c create mode 100644 sys/conf/newvers.sh create mode 100644 sys/conf/param.c create mode 100644 sys/conf/spl/splfix.mfps.sed create mode 100644 sys/conf/spl/splfix.movb+mfps.sed create mode 100644 sys/conf/spl/splfix.movb.sed create mode 100644 sys/conf/spl/splfix.profil.sed create mode 100644 sys/conf/spl/splfix.spl.sed create mode 100644 sys/conf/spl_3com/splfix.mfps.sed create mode 100644 sys/conf/spl_3com/splfix.movb+mfps.sed create mode 100644 sys/conf/spl_3com/splfix.movb.sed create mode 100644 sys/conf/spl_3com/splfix.profil.sed create mode 100644 sys/conf/spl_3com/splfix.spl.sed create mode 100644 sys/h/acct.h create mode 100644 sys/h/buf.h create mode 100644 sys/h/callout.h create mode 100644 sys/h/clist.h create mode 100644 sys/h/conf.h create mode 100644 sys/h/dir.h create mode 100644 sys/h/disk.h create mode 100644 sys/h/disklabel.h create mode 100644 sys/h/dk.h create mode 100644 sys/h/dkbad.h create mode 100644 sys/h/domain.h create mode 100644 sys/h/errno.h create mode 100644 sys/h/exec.h create mode 100644 sys/h/file.h create mode 100644 sys/h/fs.h create mode 100644 sys/h/gprof.h create mode 100644 sys/h/ingreslock.h create mode 100644 sys/h/inode.h create mode 100644 sys/h/ioctl.h create mode 100644 sys/h/ioctl_compat.h create mode 100644 sys/h/kernel.h create mode 100644 sys/h/localopts.h create mode 100644 sys/h/map.h create mode 100644 sys/h/mbuf.h create mode 100644 sys/h/mount.h create mode 100644 sys/h/msgbuf.h create mode 100644 sys/h/mtio.h create mode 100644 sys/h/namei.h create mode 100644 sys/h/param.h create mode 100644 sys/h/proc.h create mode 100644 sys/h/protosw.h create mode 100644 sys/h/ptrace.h create mode 100644 sys/h/quota.h create mode 100644 sys/h/reboot.h create mode 100644 sys/h/resource.h create mode 100644 sys/h/select.h create mode 100644 sys/h/signal.h create mode 100644 sys/h/signalvar.h create mode 100644 sys/h/socket.h create mode 100644 sys/h/socketvar.h create mode 100644 sys/h/stat.h create mode 100644 sys/h/stddef.h create mode 100644 sys/h/sysctl.h create mode 100644 sys/h/syslog.h create mode 100644 sys/h/systm.h create mode 100644 sys/h/tablet.h create mode 120000 sys/h/tags create mode 100644 sys/h/text.h create mode 100644 sys/h/time.h create mode 100644 sys/h/timeb.h create mode 100644 sys/h/times.h create mode 100644 sys/h/trace.h create mode 100644 sys/h/tty.h create mode 100644 sys/h/ttychars.h create mode 100644 sys/h/ttydefaults.h create mode 100644 sys/h/ttydev.h create mode 100644 sys/h/types.h create mode 100644 sys/h/uba.h create mode 100644 sys/h/uio.h create mode 100644 sys/h/un.h create mode 100644 sys/h/unpcb.h create mode 100644 sys/h/user.h create mode 100644 sys/h/utsname.h create mode 100644 sys/h/vcmd.h create mode 100644 sys/h/vm.h create mode 100644 sys/h/vmmac.h create mode 100644 sys/h/vmmeter.h create mode 100644 sys/h/vmparam.h create mode 100644 sys/h/vmsystm.h create mode 100644 sys/h/wait.h create mode 120000 sys/machine create mode 100644 sys/mdec/Makefile create mode 100644 sys/mdec/boilerplate create mode 100644 sys/mdec/bruboot.s create mode 100644 sys/mdec/dvhpuboot.s create mode 100644 sys/mdec/hkuboot.s create mode 100644 sys/mdec/hpuboot.s create mode 100644 sys/mdec/rauboot.s create mode 100644 sys/mdec/rkuboot.s create mode 100644 sys/mdec/rluboot.s create mode 100644 sys/mdec/rm03uboot.s create mode 100644 sys/mdec/rm05uboot.s create mode 100644 sys/mdec/rx01uboot.s create mode 100644 sys/mdec/rx02uboot.s create mode 100644 sys/mdec/si51uboot.s create mode 100644 sys/mdec/si94uboot.s create mode 100644 sys/mdec/si95uboot.s create mode 100644 sys/net/af.c create mode 100644 sys/net/af.h create mode 100644 sys/net/if.c create mode 100644 sys/net/if.h create mode 100644 sys/net/if_arp.h create mode 100644 sys/net/if_loop.c create mode 100644 sys/net/if_sl.c create mode 100644 sys/net/netisr.h create mode 100644 sys/net/raw_cb.c create mode 100644 sys/net/raw_cb.h create mode 100644 sys/net/raw_usrreq.c create mode 100644 sys/net/route.c create mode 100644 sys/net/route.h create mode 120000 sys/net/tags create mode 100644 sys/netimp/if_imp.c create mode 100644 sys/netimp/if_imp.h create mode 100644 sys/netimp/if_imphost.c create mode 100644 sys/netimp/if_imphost.h create mode 100644 sys/netimp/raw_imp.c create mode 120000 sys/netimp/tags create mode 100644 sys/netinet/icmp_var.h create mode 100644 sys/netinet/if_ether.c create mode 100644 sys/netinet/if_ether.h create mode 100644 sys/netinet/in.c create mode 100644 sys/netinet/in.h create mode 100644 sys/netinet/in_pcb.c create mode 100644 sys/netinet/in_pcb.h create mode 100644 sys/netinet/in_proto.c create mode 100644 sys/netinet/in_systm.h create mode 100644 sys/netinet/in_var.h create mode 100644 sys/netinet/ip.h create mode 100644 sys/netinet/ip_icmp.c create mode 100644 sys/netinet/ip_icmp.h create mode 100644 sys/netinet/ip_input.c create mode 100644 sys/netinet/ip_output.c create mode 100644 sys/netinet/ip_var.h create mode 100644 sys/netinet/raw_ip.c create mode 120000 sys/netinet/tags create mode 100644 sys/netinet/tcp.h create mode 100644 sys/netinet/tcp_debug.c create mode 100644 sys/netinet/tcp_debug.h create mode 100644 sys/netinet/tcp_fsm.h create mode 100644 sys/netinet/tcp_input.c create mode 100644 sys/netinet/tcp_output.c create mode 100644 sys/netinet/tcp_seq.h create mode 100644 sys/netinet/tcp_subr.c create mode 100644 sys/netinet/tcp_timer.c create mode 100644 sys/netinet/tcp_timer.h create mode 100644 sys/netinet/tcp_usrreq.c create mode 100644 sys/netinet/tcp_var.h create mode 100644 sys/netinet/tcpip.h create mode 100644 sys/netinet/udp.h create mode 100644 sys/netinet/udp_usrreq.c create mode 100644 sys/netinet/udp_var.h create mode 100644 sys/netns/idp.h create mode 100644 sys/netns/idp_usrreq.c create mode 100644 sys/netns/idp_var.h create mode 100644 sys/netns/ns.c create mode 100644 sys/netns/ns.h create mode 100644 sys/netns/ns_error.c create mode 100644 sys/netns/ns_error.h create mode 100644 sys/netns/ns_if.h create mode 100644 sys/netns/ns_input.c create mode 100644 sys/netns/ns_ip.c create mode 100644 sys/netns/ns_output.c create mode 100644 sys/netns/ns_pcb.c create mode 100644 sys/netns/ns_pcb.h create mode 100644 sys/netns/ns_proto.c create mode 100644 sys/netns/sp.h create mode 100644 sys/netns/spidp.h create mode 100644 sys/netns/spp_debug.c create mode 100644 sys/netns/spp_debug.h create mode 100644 sys/netns/spp_timer.h create mode 100644 sys/netns/spp_usrreq.c create mode 100644 sys/netns/spp_var.h create mode 120000 sys/netns/tags create mode 100644 sys/pdp/DEFS.h create mode 100644 sys/pdp/autoconfig.h create mode 100644 sys/pdp/cksum-fix create mode 100644 sys/pdp/clock.c create mode 100644 sys/pdp/clock.h create mode 100644 sys/pdp/conf.c create mode 100644 sys/pdp/cons.c create mode 100644 sys/pdp/cons.h create mode 100644 sys/pdp/cpu.h create mode 100644 sys/pdp/enable34.c create mode 100644 sys/pdp/enable34.h create mode 100644 sys/pdp/fperr.h create mode 100644 sys/pdp/frame.h create mode 100644 sys/pdp/genassym.c create mode 100644 sys/pdp/in_cksum.c create mode 100644 sys/pdp/iopage.h create mode 100644 sys/pdp/kern_pdp.c create mode 100644 sys/pdp/koverlay.h create mode 100644 sys/pdp/limits.h create mode 100644 sys/pdp/machdep.c create mode 100644 sys/pdp/machdep2.c create mode 100644 sys/pdp/machparam.h create mode 100644 sys/pdp/mch_KScall.s create mode 100644 sys/pdp/mch_backup.s create mode 100644 sys/pdp/mch_click.s create mode 100644 sys/pdp/mch_copy.s create mode 100644 sys/pdp/mch_cpu.h create mode 100644 sys/pdp/mch_csv.s create mode 100644 sys/pdp/mch_dump.s create mode 100644 sys/pdp/mch_dzpdma.s create mode 100644 sys/pdp/mch_fpsim.s create mode 100644 sys/pdp/mch_iopage.h create mode 100644 sys/pdp/mch_profile.s create mode 100644 sys/pdp/mch_start.s create mode 100644 sys/pdp/mch_trap.s create mode 100644 sys/pdp/mch_vars.s create mode 100644 sys/pdp/mch_xxx.s create mode 100644 sys/pdp/mem.c create mode 100644 sys/pdp/mscp.h create mode 100644 sys/pdp/mscp_common.h create mode 100644 sys/pdp/net_SKcall.s create mode 100644 sys/pdp/net_copy.s create mode 100644 sys/pdp/net_csv.s create mode 100644 sys/pdp/net_mac.h create mode 100644 sys/pdp/net_mbuf.s create mode 100644 sys/pdp/net_scb.s create mode 100644 sys/pdp/net_trap.s create mode 100644 sys/pdp/net_xxx.s create mode 100644 sys/pdp/psl.h create mode 100644 sys/pdp/ram.c create mode 100644 sys/pdp/reg.h create mode 100644 sys/pdp/scb.s create mode 100644 sys/pdp/seg.h create mode 100644 sys/pdp/symbols.raw create mode 100644 sys/pdp/symbols.sort create mode 120000 sys/pdp/tags create mode 100644 sys/pdp/tmscp.h create mode 100644 sys/pdp/toy.s create mode 100644 sys/pdp/trap.c create mode 100644 sys/pdp/trap.h create mode 100644 sys/pdp/vmparam.h create mode 100644 sys/pdpif/if_acc.c create mode 100644 sys/pdpif/if_acc.h create mode 100644 sys/pdpif/if_css.c create mode 100644 sys/pdpif/if_css.h create mode 100644 sys/pdpif/if_de.c create mode 100644 sys/pdpif/if_de.h create mode 100644 sys/pdpif/if_dereg.h create mode 100644 sys/pdpif/if_dmc.c create mode 100644 sys/pdpif/if_dmc.h create mode 100644 sys/pdpif/if_ec.c create mode 100644 sys/pdpif/if_ecreg.h create mode 100644 sys/pdpif/if_en.c create mode 100644 sys/pdpif/if_en.h create mode 100644 sys/pdpif/if_enreg.h create mode 100644 sys/pdpif/if_il.c create mode 100644 sys/pdpif/if_il.h create mode 100644 sys/pdpif/if_ilreg.h create mode 100644 sys/pdpif/if_qe.c create mode 100644 sys/pdpif/if_qereg.h create mode 100644 sys/pdpif/if_qt.c create mode 100644 sys/pdpif/if_qtreg.h create mode 100644 sys/pdpif/if_sri.c create mode 100644 sys/pdpif/if_sri.h create mode 100644 sys/pdpif/if_uba.c create mode 100644 sys/pdpif/if_uba.h create mode 100644 sys/pdpif/if_un.h create mode 100644 sys/pdpif/if_vv.c create mode 100644 sys/pdpif/if_vv.h create mode 120000 sys/pdpif/tags create mode 120000 sys/pdpmba/tags create mode 100644 sys/pdpstand/M.o create mode 100644 sys/pdpstand/M.s create mode 100644 sys/pdpstand/Makefile create mode 100644 sys/pdpstand/NEW/bads.c create mode 100644 sys/pdpstand/NEW/dkbad.c create mode 100644 sys/pdpstand/NEW/dskinit.c create mode 100644 sys/pdpstand/NEW/rabads.c create mode 100644 sys/pdpstand/OLD/bcopy.c create mode 100644 sys/pdpstand/OLD/cat.c create mode 100644 sys/pdpstand/OLD/copy.c create mode 100755 sys/pdpstand/boot create mode 100644 sys/pdpstand/boot.c create mode 100644 sys/pdpstand/boot.o create mode 100644 sys/pdpstand/br.c create mode 100644 sys/pdpstand/br.o create mode 100644 sys/pdpstand/conf.c create mode 100644 sys/pdpstand/conf.o create mode 100755 sys/pdpstand/disklabel create mode 100644 sys/pdpstand/disklabel.c create mode 100644 sys/pdpstand/disklabel.o create mode 100644 sys/pdpstand/displaylab.c create mode 100644 sys/pdpstand/displaylab.o create mode 100644 sys/pdpstand/hk.c create mode 100644 sys/pdpstand/hk.o create mode 100644 sys/pdpstand/ht.c create mode 100644 sys/pdpstand/ht.o create mode 100755 sys/pdpstand/icheck create mode 100644 sys/pdpstand/icheck.o create mode 100644 sys/pdpstand/label.c create mode 100644 sys/pdpstand/label.o create mode 100644 sys/pdpstand/libsa.a create mode 100755 sys/pdpstand/makesimtape create mode 100644 sys/pdpstand/makesimtape.c create mode 100755 sys/pdpstand/maketape create mode 100644 sys/pdpstand/maketape.c create mode 100644 sys/pdpstand/maketape.data create mode 100755 sys/pdpstand/mkfs create mode 100644 sys/pdpstand/mkfs.o create mode 100644 sys/pdpstand/mtboot create mode 100644 sys/pdpstand/mtboot.s create mode 100644 sys/pdpstand/prf.c create mode 100644 sys/pdpstand/prf.o create mode 100644 sys/pdpstand/ra.c create mode 100644 sys/pdpstand/ra.o create mode 100755 sys/pdpstand/restor create mode 100644 sys/pdpstand/restor.o create mode 100644 sys/pdpstand/rk.c create mode 100644 sys/pdpstand/rk.o create mode 100644 sys/pdpstand/rl.c create mode 100644 sys/pdpstand/rl.o create mode 100644 sys/pdpstand/rx.c create mode 100644 sys/pdpstand/rx.o create mode 100644 sys/pdpstand/saio.h create mode 100644 sys/pdpstand/si.c create mode 100644 sys/pdpstand/si.o create mode 100644 sys/pdpstand/srt0-i.o create mode 100644 sys/pdpstand/srt0.o create mode 100644 sys/pdpstand/srt0.s create mode 100644 sys/pdpstand/sys.c create mode 100644 sys/pdpstand/sys.o create mode 100644 sys/pdpstand/tm.c create mode 100644 sys/pdpstand/tm.o create mode 100644 sys/pdpstand/tmscp.c create mode 100644 sys/pdpstand/tmscp.o create mode 100755 sys/pdpstand/toyset create mode 100644 sys/pdpstand/toyset.o create mode 100644 sys/pdpstand/toyset.s create mode 100644 sys/pdpstand/ts.c create mode 100644 sys/pdpstand/ts.o create mode 100644 sys/pdpstand/ubmapset.c create mode 100644 sys/pdpstand/ubmapset.o create mode 100644 sys/pdpstand/xp.c create mode 100644 sys/pdpstand/xp.o create mode 100644 sys/pdpuba/br.c create mode 100644 sys/pdpuba/brreg.h create mode 100644 sys/pdpuba/dh.c create mode 100644 sys/pdpuba/dhreg.h create mode 100644 sys/pdpuba/dhu.c create mode 100644 sys/pdpuba/dhureg.h create mode 100644 sys/pdpuba/dhv.c create mode 100644 sys/pdpuba/dhvreg.h create mode 100644 sys/pdpuba/dkbad.c create mode 100644 sys/pdpuba/dmreg.h create mode 100644 sys/pdpuba/dn.c create mode 100644 sys/pdpuba/dnreg.h create mode 100644 sys/pdpuba/dr.c create mode 100644 sys/pdpuba/drreg.h create mode 100644 sys/pdpuba/dz.c create mode 100644 sys/pdpuba/dzreg.h create mode 100644 sys/pdpuba/hk.c create mode 100644 sys/pdpuba/hkreg.h create mode 100644 sys/pdpuba/hpreg.h create mode 100644 sys/pdpuba/ht.c create mode 100644 sys/pdpuba/htreg.h create mode 100644 sys/pdpuba/lp.c create mode 100644 sys/pdpuba/pdma.h create mode 100644 sys/pdpuba/ra.c create mode 100644 sys/pdpuba/rareg.h create mode 100644 sys/pdpuba/rk.c create mode 100644 sys/pdpuba/rkreg.h create mode 100644 sys/pdpuba/rl.c create mode 100644 sys/pdpuba/rlreg.h create mode 100644 sys/pdpuba/rx.c create mode 100644 sys/pdpuba/rxreg.h create mode 100644 sys/pdpuba/si.c create mode 100644 sys/pdpuba/sireg.h create mode 120000 sys/pdpuba/tags create mode 100644 sys/pdpuba/tm.c create mode 100644 sys/pdpuba/tmreg.h create mode 100644 sys/pdpuba/tmscp.c create mode 100644 sys/pdpuba/tmscpdump.c create mode 100644 sys/pdpuba/tmscpreg.h create mode 100644 sys/pdpuba/ts.c create mode 100644 sys/pdpuba/tsreg.h create mode 100644 sys/pdpuba/ubavar.h create mode 100644 sys/pdpuba/xp.c create mode 100644 sys/sys/ingreslock.c create mode 100644 sys/sys/init_main.c create mode 100644 sys/sys/init_sysent.c create mode 100644 sys/sys/kern_acct.c create mode 100644 sys/sys/kern_clock.c create mode 100644 sys/sys/kern_descrip.c create mode 100644 sys/sys/kern_exec.c create mode 100644 sys/sys/kern_exit.c create mode 100644 sys/sys/kern_fork.c create mode 100644 sys/sys/kern_mman.c create mode 100644 sys/sys/kern_proc.c create mode 100644 sys/sys/kern_prot.c create mode 100644 sys/sys/kern_prot2.c create mode 100644 sys/sys/kern_resource.c create mode 100644 sys/sys/kern_sig.c create mode 100644 sys/sys/kern_sig2.c create mode 100644 sys/sys/kern_subr.c create mode 100644 sys/sys/kern_synch.c create mode 100644 sys/sys/kern_sysctl.c create mode 100644 sys/sys/kern_time.c create mode 100644 sys/sys/kern_xxx.c create mode 100644 sys/sys/quota_kern.c create mode 100644 sys/sys/quota_subr.c create mode 100644 sys/sys/quota_sys.c create mode 100644 sys/sys/quota_ufs.c create mode 100644 sys/sys/subr_log.c create mode 100644 sys/sys/subr_prf.c create mode 100644 sys/sys/subr_rmap.c create mode 100644 sys/sys/subr_xxx.c create mode 100644 sys/sys/sys_generic.c create mode 100644 sys/sys/sys_inode.c create mode 100644 sys/sys/sys_kern.c create mode 100644 sys/sys/sys_net.c create mode 100644 sys/sys/sys_pipe.c create mode 100644 sys/sys/sys_process.c create mode 100644 sys/sys/sys_socket.c create mode 100644 sys/sys/syscalls.c create mode 100644 sys/sys/tags create mode 100644 sys/sys/tty.c create mode 100644 sys/sys/tty_conf.c create mode 100644 sys/sys/tty_pty.c create mode 100644 sys/sys/tty_subr.c create mode 100644 sys/sys/tty_tb.c create mode 100644 sys/sys/tty_tty.c create mode 100644 sys/sys/ufs_alloc.c create mode 100644 sys/sys/ufs_bio.c create mode 100644 sys/sys/ufs_bmap.c create mode 100644 sys/sys/ufs_disksubr.c create mode 100644 sys/sys/ufs_dsort.c create mode 100644 sys/sys/ufs_fio.c create mode 100644 sys/sys/ufs_inode.c create mode 100644 sys/sys/ufs_mount.c create mode 100644 sys/sys/ufs_namei.c create mode 100644 sys/sys/ufs_subr.c create mode 100644 sys/sys/ufs_syscalls.c create mode 100644 sys/sys/ufs_syscalls2.c create mode 100644 sys/sys/uipc_domain.c create mode 100644 sys/sys/uipc_mbuf.c create mode 100644 sys/sys/uipc_proto.c create mode 100644 sys/sys/uipc_socket.c create mode 100644 sys/sys/uipc_socket2.c create mode 100644 sys/sys/uipc_syscalls.c create mode 100644 sys/sys/uipc_usrreq.c create mode 100644 sys/sys/vfs_vnops.c create mode 100644 sys/sys/vm_proc.c create mode 100644 sys/sys/vm_sched.c create mode 100644 sys/sys/vm_swap.c create mode 100644 sys/sys/vm_swp.c create mode 100644 sys/sys/vm_text.c create mode 100644 sys/vaxif/if_acc.c create mode 100644 sys/vaxif/if_accreg.h create mode 100644 sys/vaxif/if_css.c create mode 100644 sys/vaxif/if_cssreg.h create mode 100644 sys/vaxif/if_ddn.c create mode 100644 sys/vaxif/if_ddnreg.h create mode 100644 sys/vaxif/if_ddnvar.h create mode 100644 sys/vaxif/if_de.c create mode 100644 sys/vaxif/if_dereg.h create mode 100644 sys/vaxif/if_dmc.c create mode 100644 sys/vaxif/if_dmc.h create mode 100644 sys/vaxif/if_ec.c create mode 100644 sys/vaxif/if_ecreg.h create mode 100644 sys/vaxif/if_en.c create mode 100644 sys/vaxif/if_en.h create mode 100644 sys/vaxif/if_enreg.h create mode 100644 sys/vaxif/if_ex.c create mode 100644 sys/vaxif/if_exreg.h create mode 100644 sys/vaxif/if_hdh.c create mode 100644 sys/vaxif/if_hdhreg.h create mode 100644 sys/vaxif/if_hy.c create mode 100644 sys/vaxif/if_hy.h create mode 100644 sys/vaxif/if_hyreg.h create mode 100644 sys/vaxif/if_il.c create mode 100644 sys/vaxif/if_il.h create mode 100644 sys/vaxif/if_ilreg.h create mode 100644 sys/vaxif/if_ix.h create mode 100644 sys/vaxif/if_pcl.c create mode 100644 sys/vaxif/if_pclreg.h create mode 100644 sys/vaxif/if_qe.c create mode 100644 sys/vaxif/if_qereg.h create mode 100644 sys/vaxif/if_uba.c create mode 100644 sys/vaxif/if_uba.h create mode 100644 sys/vaxif/if_vv.c create mode 100644 sys/vaxif/if_vv.h create mode 100644 sys/vaxif/raw_hy.c create mode 120000 sys/vaxif/tags create mode 100644 sys/vaxuba/rxreg.h create mode 120000 sys/vaxuba/tags create mode 100644 ucb/MANIFEST create mode 100644 ucb/Mail/Mail.rc create mode 100644 ucb/Mail/Makefile create mode 100644 ucb/Mail/aux.c create mode 100644 ucb/Mail/cmd1.c create mode 100644 ucb/Mail/cmd2.c create mode 100644 ucb/Mail/cmd3.c create mode 100644 ucb/Mail/cmdtab.c create mode 100644 ucb/Mail/collect.c create mode 100644 ucb/Mail/def.h create mode 100644 ucb/Mail/edit.c create mode 100644 ucb/Mail/fio.c create mode 100644 ucb/Mail/fmt.c create mode 100644 ucb/Mail/getname.c create mode 100644 ucb/Mail/glob.h create mode 100644 ucb/Mail/head.c create mode 100644 ucb/Mail/lex.c create mode 100644 ucb/Mail/list.c create mode 100644 ucb/Mail/main.c create mode 100644 ucb/Mail/names.c create mode 100644 ucb/Mail/pathnames.h create mode 100644 ucb/Mail/popen.c create mode 100644 ucb/Mail/quit.c create mode 100644 ucb/Mail/rcv.h create mode 100644 ucb/Mail/send.c create mode 100644 ucb/Mail/strings.c create mode 100644 ucb/Mail/temp.c create mode 100644 ucb/Mail/tty.c create mode 100644 ucb/Mail/v7.local.c create mode 100644 ucb/Mail/vars.c create mode 100644 ucb/Mail/version.c create mode 100644 ucb/Makefile create mode 100644 ucb/PORT/gprof.tar.Z create mode 100644 ucb/PORT/pascal.tar.Z create mode 100644 ucb/PORT/pc.1 create mode 100644 ucb/PORT/symorder.c.Z create mode 100644 ucb/PORT/sysline.1 create mode 100644 ucb/PORT/sysline.tar.Z create mode 100644 ucb/PORT/systat.tar.Z create mode 100644 ucb/PORT/vlp.tar.Z create mode 100644 ucb/apply.c create mode 100644 ucb/biff.c create mode 100644 ucb/checknr.c create mode 100644 ucb/clear.c create mode 100644 ucb/colcrt.c create mode 100644 ucb/colrm.c create mode 100644 ucb/compress/Makefile create mode 100644 ucb/compress/README create mode 100644 ucb/compress/USERMEM create mode 100644 ucb/compress/compress.c create mode 100644 ucb/compress/usermem.sh create mode 100644 ucb/ctags.c create mode 100644 ucb/dbx/Makefile create mode 100644 ucb/dbx/dbx.c create mode 100644 ucb/error/Makefile create mode 100644 ucb/error/error.h create mode 100644 ucb/error/errorfilter.c create mode 100644 ucb/error/errorinput.c create mode 100644 ucb/error/errormain.c create mode 100644 ucb/error/errorpi.c create mode 100644 ucb/error/errorsubr.c create mode 100644 ucb/error/errortouch.c create mode 100644 ucb/ex/Makefile create mode 100644 ucb/ex/READ_ME create mode 100644 ucb/ex/TODO create mode 100644 ucb/ex/ex.c create mode 100644 ucb/ex/ex.h create mode 100644 ucb/ex/ex.news create mode 100644 ucb/ex/ex_addr.c create mode 100644 ucb/ex/ex_argv.h create mode 100644 ucb/ex/ex_cmds.c create mode 100644 ucb/ex/ex_cmds2.c create mode 100644 ucb/ex/ex_cmdsub.c create mode 100644 ucb/ex/ex_data.c create mode 100644 ucb/ex/ex_extern.c create mode 100644 ucb/ex/ex_get.c create mode 100644 ucb/ex/ex_io.c create mode 100644 ucb/ex/ex_put.c create mode 100644 ucb/ex/ex_re.c create mode 100644 ucb/ex/ex_re.h create mode 100644 ucb/ex/ex_set.c create mode 100644 ucb/ex/ex_subr.c create mode 100644 ucb/ex/ex_tagio.c create mode 100644 ucb/ex/ex_temp.c create mode 100644 ucb/ex/ex_temp.h create mode 100644 ucb/ex/ex_tty.c create mode 100644 ucb/ex/ex_tty.h create mode 100644 ucb/ex/ex_tune.h create mode 100644 ucb/ex/ex_unix.c create mode 100644 ucb/ex/ex_v.c create mode 100644 ucb/ex/ex_vadj.c create mode 100644 ucb/ex/ex_vars.h create mode 100644 ucb/ex/ex_vget.c create mode 100644 ucb/ex/ex_vis.h create mode 100644 ucb/ex/ex_vmain.c create mode 100644 ucb/ex/ex_voper.c create mode 100644 ucb/ex/ex_vops.c create mode 100644 ucb/ex/ex_vops2.c create mode 100644 ucb/ex/ex_vops3.c create mode 100644 ucb/ex/ex_vput.c create mode 100644 ucb/ex/ex_vwind.c create mode 100644 ucb/ex/expreserve.c create mode 100644 ucb/ex/exrecover.c create mode 100644 ucb/ex/makeoptions create mode 100644 ucb/ex/printf.c create mode 100644 ucb/ex/uparm.h create mode 100644 ucb/expand.c create mode 100644 ucb/finger/Makefile create mode 100644 ucb/finger/finger.1 create mode 100644 ucb/finger/finger.c create mode 100644 ucb/finger/finger.h create mode 100644 ucb/finger/lprint.c create mode 100644 ucb/finger/net.c create mode 100644 ucb/finger/pathnames.h create mode 100644 ucb/finger/sprint.c create mode 100644 ucb/finger/util.c create mode 100644 ucb/fold.c create mode 100644 ucb/fp/Makefile create mode 100644 ucb/fp/fp.c create mode 100644 ucb/from.c create mode 100644 ucb/ftp/Makefile create mode 100644 ucb/ftp/cmds.c create mode 100644 ucb/ftp/cmdtab.c create mode 100644 ucb/ftp/domacro.c create mode 100644 ucb/ftp/ftp.1 create mode 100644 ucb/ftp/ftp.c create mode 100644 ucb/ftp/ftp_var.h create mode 100644 ucb/ftp/glob.c create mode 100644 ucb/ftp/main.c create mode 100644 ucb/ftp/pathnames.h create mode 100644 ucb/ftp/ruserpass.c create mode 100644 ucb/gcore.c create mode 100644 ucb/gprof.c create mode 100644 ucb/grep.c create mode 100644 ucb/head.c create mode 100644 ucb/indent/Makefile create mode 100644 ucb/indent/README create mode 100644 ucb/indent/args.c create mode 100644 ucb/indent/indent.c create mode 100644 ucb/indent/indent_codes.h create mode 100644 ucb/indent/indent_globs.h create mode 100644 ucb/indent/io.c create mode 100644 ucb/indent/lexi.c create mode 100644 ucb/indent/parse.c create mode 100644 ucb/indent/pr_comment.c create mode 100644 ucb/last.c create mode 100644 ucb/lastcomm.c create mode 100644 ucb/leave.c create mode 100644 ucb/lisp/Makefile create mode 100644 ucb/lisp/lisp.c create mode 100644 ucb/lock/Makefile create mode 100644 ucb/lock/lock.1 create mode 100644 ucb/lock/lock.c create mode 100644 ucb/logger.c create mode 100644 ucb/man/Makefile create mode 100644 ucb/man/apropos.c create mode 100644 ucb/man/man.c create mode 100644 ucb/mkstr.c create mode 100644 ucb/more/Makefile create mode 100644 ucb/more/more.c create mode 100644 ucb/more/more.help create mode 100644 ucb/msgs/Makefile create mode 100644 ucb/msgs/msgs.c create mode 100644 ucb/msgs/msgs.h create mode 100644 ucb/netstat/Makefile create mode 120000 ucb/netstat/host.c create mode 100644 ucb/netstat/host.c.newimp create mode 100644 ucb/netstat/host.c.oldimp create mode 100644 ucb/netstat/if.c create mode 100644 ucb/netstat/inet.c create mode 120000 ucb/netstat/main.c create mode 100644 ucb/netstat/main.c.newimp create mode 100644 ucb/netstat/main.c.oldimp create mode 100644 ucb/netstat/mbuf.c create mode 100644 ucb/netstat/ns.c create mode 100644 ucb/netstat/route.c create mode 100644 ucb/netstat/unix.c create mode 100644 ucb/pascal/Makefile create mode 100644 ucb/pascal/eyacc/Makefile create mode 100644 ucb/pascal/eyacc/READ_ME create mode 100644 ucb/pascal/eyacc/ey.h create mode 100644 ucb/pascal/eyacc/ey0.c create mode 100644 ucb/pascal/eyacc/ey1.c create mode 100644 ucb/pascal/eyacc/ey2.c create mode 100644 ucb/pascal/eyacc/ey3.c create mode 100644 ucb/pascal/eyacc/ey4.c create mode 100644 ucb/pascal/eyacc/ey5.c create mode 100644 ucb/pascal/pi/0.h create mode 100644 ucb/pascal/pi/Makefile create mode 100644 ucb/pascal/pi/OPnames.h create mode 100644 ucb/pascal/pi/READ_ME create mode 100644 ucb/pascal/pi/TESTS/t.p create mode 100644 ucb/pascal/pi/TESTS/test.p create mode 100644 ucb/pascal/pi/TESTS/test2.p create mode 100644 ucb/pascal/pi/TODO create mode 100644 ucb/pascal/pi/TRdata.c create mode 100644 ucb/pascal/pi/ato.c create mode 100644 ucb/pascal/pi/call.c create mode 100644 ucb/pascal/pi/case.c create mode 100644 ucb/pascal/pi/clas.c create mode 100644 ucb/pascal/pi/const.c create mode 100644 ucb/pascal/pi/conv.c create mode 100644 ucb/pascal/pi/cset.c create mode 100644 ucb/pascal/pi/error.c create mode 100644 ucb/pascal/pi/fdec.c create mode 100644 ucb/pascal/pi/func.c create mode 100644 ucb/pascal/pi/gen.c create mode 100644 ucb/pascal/pi/gram.ex create mode 100644 ucb/pascal/pi/hash.c create mode 100644 ucb/pascal/pi/how_pi create mode 100644 ucb/pascal/pi/how_pix create mode 100644 ucb/pascal/pi/lab.c create mode 100644 ucb/pascal/pi/lookup.c create mode 100644 ucb/pascal/pi/lval.c create mode 100644 ucb/pascal/pi/main.c create mode 100644 ucb/pascal/pi/nl.c create mode 100644 ucb/pascal/pi/opcode.h create mode 100644 ucb/pascal/pi/pas.y create mode 100644 ucb/pascal/pi/pix.c create mode 100644 ucb/pascal/pi/proc.c create mode 100644 ucb/pascal/pi/put.c create mode 100644 ucb/pascal/pi/putn.c create mode 100644 ucb/pascal/pi/px_header.c create mode 100644 ucb/pascal/pi/rec.c create mode 100644 ucb/pascal/pi/rval.c create mode 100644 ucb/pascal/pi/send.h create mode 100644 ucb/pascal/pi/stat.c create mode 100644 ucb/pascal/pi/string.c create mode 100644 ucb/pascal/pi/subr.c create mode 100644 ucb/pascal/pi/tree.c create mode 100644 ucb/pascal/pi/tree.h create mode 100644 ucb/pascal/pi/treen.c create mode 100644 ucb/pascal/pi/type.c create mode 100644 ucb/pascal/pi/var.c create mode 100644 ucb/pascal/pi/version.c create mode 100644 ucb/pascal/pi/whoami create mode 100644 ucb/pascal/pi/yy.h create mode 100644 ucb/pascal/pi/yycopy.c create mode 100644 ucb/pascal/pi/yycosts.c create mode 100644 ucb/pascal/pi/yyerror.c create mode 100644 ucb/pascal/pi/yyget.c create mode 100644 ucb/pascal/pi/yyid.c create mode 100644 ucb/pascal/pi/yylex.c create mode 100644 ucb/pascal/pi/yymain.c create mode 100644 ucb/pascal/pi/yyoptions.c create mode 100644 ucb/pascal/pi/yypanic.c create mode 100644 ucb/pascal/pi/yyparse.c create mode 100644 ucb/pascal/pi/yyprint.c create mode 100644 ucb/pascal/pi/yyput.c create mode 100644 ucb/pascal/pi/yyrecover.c create mode 100644 ucb/pascal/pi/yyseman.c create mode 100644 ucb/pascal/pi/yytree.c create mode 100644 ucb/pascal/px/00int.s create mode 100644 ucb/pascal/px/02rel.s create mode 100644 ucb/pascal/px/02relset.s create mode 100644 ucb/pascal/px/03bool.s create mode 100644 ucb/pascal/px/04as.s create mode 100644 ucb/pascal/px/05lv.s create mode 100644 ucb/pascal/px/06add.s create mode 100644 ucb/pascal/px/07sub.s create mode 100644 ucb/pascal/px/0x.h create mode 100644 ucb/pascal/px/10mul.s create mode 100644 ucb/pascal/px/12div.s create mode 100644 ucb/pascal/px/13mod.s create mode 100644 ucb/pascal/px/14neg.s create mode 100644 ucb/pascal/px/16dvd.s create mode 100644 ucb/pascal/px/17ind.s create mode 100644 ucb/pascal/px/17rv.s create mode 100644 ucb/pascal/px/20con.s create mode 100644 ucb/pascal/px/21rang.s create mode 100644 ucb/pascal/px/24case.s create mode 100644 ucb/pascal/px/24pxp.s create mode 100644 ucb/pascal/px/25set.s create mode 100644 ucb/pascal/px/26for.s create mode 100644 ucb/pascal/px/27conv.s create mode 100644 ucb/pascal/px/30atof.s create mode 100644 ucb/pascal/px/30getname.s create mode 100644 ucb/pascal/px/30io.s create mode 100644 ucb/pascal/px/30iosubs.s create mode 100644 ucb/pascal/px/30read.s create mode 100644 ucb/pascal/px/30write.s create mode 100644 ucb/pascal/px/34fun.s create mode 100644 ucb/pascal/px/Edata create mode 100644 ucb/pascal/px/Emake.ed create mode 100644 ucb/pascal/px/Makefile create mode 100644 ucb/pascal/px/README create mode 100644 ucb/pascal/px/README2 create mode 100644 ucb/pascal/px/doub.p create mode 100644 ucb/pascal/px/exit.c create mode 100644 ucb/pascal/px/gather.c create mode 100644 ucb/pascal/px/getc.s create mode 100644 ucb/pascal/px/int.c create mode 100644 ucb/pascal/px/opcode.h create mode 100644 ucb/pascal/px/opcode.s create mode 100644 ucb/pascal/px/palloc.c create mode 100644 ucb/pascal/px/pcttot.c create mode 100644 ucb/pascal/px/pdattim.c create mode 100644 ucb/pascal/px/perror.c create mode 100644 ucb/pascal/px/putc.s create mode 100644 ucb/pascal/px/pwrite.c create mode 100644 ucb/pascal/pxp/0.h create mode 100644 ucb/pascal/pxp/Makefile create mode 100644 ucb/pascal/pxp/TRdata.c create mode 100644 ucb/pascal/pxp/Version.c create mode 100644 ucb/pascal/pxp/call.c create mode 100644 ucb/pascal/pxp/case.c create mode 100644 ucb/pascal/pxp/const.c create mode 100644 ucb/pascal/pxp/cset.c create mode 100644 ucb/pascal/pxp/error.c create mode 100644 ucb/pascal/pxp/fdec.c create mode 100644 ucb/pascal/pxp/func.c create mode 100644 ucb/pascal/pxp/gram.ex create mode 100644 ucb/pascal/pxp/hash.c create mode 100644 ucb/pascal/pxp/how_pxp create mode 100644 ucb/pascal/pxp/lab.c create mode 100644 ucb/pascal/pxp/lval.c create mode 100644 ucb/pascal/pxp/main.c create mode 100644 ucb/pascal/pxp/nl.c create mode 100644 ucb/pascal/pxp/opcode.h create mode 100644 ucb/pascal/pxp/pas.y create mode 100644 ucb/pascal/pxp/pmon.c create mode 100644 ucb/pascal/pxp/pp.c create mode 100644 ucb/pascal/pxp/printf.s create mode 100644 ucb/pascal/pxp/proc.c create mode 100644 ucb/pascal/pxp/rec.c create mode 100644 ucb/pascal/pxp/rval.c create mode 100644 ucb/pascal/pxp/stat.c create mode 100644 ucb/pascal/pxp/string.c create mode 100644 ucb/pascal/pxp/subr.c create mode 100644 ucb/pascal/pxp/tree.c create mode 100644 ucb/pascal/pxp/tree.h create mode 100644 ucb/pascal/pxp/treen.s create mode 100644 ucb/pascal/pxp/type.c create mode 100644 ucb/pascal/pxp/var.c create mode 100644 ucb/pascal/pxp/y.tab.h create mode 100644 ucb/pascal/pxp/yy.h create mode 100644 ucb/pascal/pxp/yycomm.c create mode 100644 ucb/pascal/pxp/yycopy.s create mode 100644 ucb/pascal/pxp/yycosts.c create mode 100644 ucb/pascal/pxp/yyerror.c create mode 100644 ucb/pascal/pxp/yyget.c create mode 100644 ucb/pascal/pxp/yyid.c create mode 100644 ucb/pascal/pxp/yylex.c create mode 100644 ucb/pascal/pxp/yymain.c create mode 100644 ucb/pascal/pxp/yypanic.c create mode 100644 ucb/pascal/pxp/yyparse.c create mode 100644 ucb/pascal/pxp/yyprint.c create mode 100644 ucb/pascal/pxp/yyput.c create mode 100644 ucb/pascal/pxp/yyrecover.c create mode 100644 ucb/pascal/pxp/yyseman.c create mode 100644 ucb/pascal/pxp/yytree.c create mode 100644 ucb/printenv.c create mode 100644 ucb/quota.c create mode 100644 ucb/rdist/Makefile create mode 100644 ucb/rdist/cron.entry create mode 100644 ucb/rdist/defs.h create mode 100644 ucb/rdist/docmd.c create mode 100644 ucb/rdist/expand.c create mode 100644 ucb/rdist/gram.y create mode 100644 ucb/rdist/lookup.c create mode 100644 ucb/rdist/main.c create mode 100644 ucb/rdist/pathnames.h create mode 100644 ucb/rdist/server.c create mode 100644 ucb/rlogin.c create mode 100644 ucb/rsh.c create mode 100644 ucb/ruptime.c create mode 100644 ucb/rwho.c create mode 100644 ucb/sccs.c create mode 100644 ucb/script.c create mode 100644 ucb/sendbug/Makefile create mode 100644 ucb/sendbug/bugfiler.c create mode 100644 ucb/sendbug/bugformat create mode 100644 ucb/sendbug/sendbug.sh create mode 100644 ucb/sendbug/unixtomh.c create mode 100644 ucb/soelim.c create mode 100644 ucb/strcompact.c create mode 100644 ucb/strings.c create mode 100644 ucb/symcompact.c create mode 100644 ucb/symdump.c create mode 100644 ucb/symorder.c create mode 100644 ucb/tail.c create mode 100644 ucb/talk/Makefile create mode 100644 ucb/talk/ctl.c create mode 100644 ucb/talk/ctl_transact.c create mode 100644 ucb/talk/display.c create mode 100644 ucb/talk/get_addrs.c create mode 100644 ucb/talk/get_names.c create mode 100644 ucb/talk/init_disp.c create mode 100644 ucb/talk/invite.c create mode 100644 ucb/talk/io.c create mode 100644 ucb/talk/look_up.c create mode 100644 ucb/talk/msgs.c create mode 100644 ucb/talk/talk.c create mode 100644 ucb/talk/talk.h create mode 100644 ucb/talk/talk_ctl.h create mode 100644 ucb/tcopy.c create mode 100644 ucb/telnet.c create mode 100644 ucb/tftp/Makefile create mode 100644 ucb/tftp/main.c create mode 100644 ucb/tftp/tftp.1 create mode 100644 ucb/tftp/tftp.c create mode 100644 ucb/tftp/tftpsubs.c create mode 100644 ucb/tn3270/3270.h create mode 100644 ucb/tn3270/DEFS.h create mode 100644 ucb/tn3270/Makefile create mode 100644 ucb/tn3270/README create mode 100644 ucb/tn3270/ascebc.h create mode 100644 ucb/tn3270/asctab.c create mode 100644 ucb/tn3270/datastream.c create mode 100644 ucb/tn3270/default.map3270 create mode 100644 ucb/tn3270/ebctab.c create mode 100644 ucb/tn3270/ectype.c create mode 100644 ucb/tn3270/ectype.h create mode 100644 ucb/tn3270/genbsubs.c create mode 100644 ucb/tn3270/keyboard.c create mode 100644 ucb/tn3270/map3270.c create mode 100644 ucb/tn3270/mset.c create mode 100644 ucb/tn3270/options.c create mode 100644 ucb/tn3270/options.h create mode 100644 ucb/tn3270/pdpbsubs.s create mode 100644 ucb/tn3270/screen.c create mode 100644 ucb/tn3270/screen.h create mode 100644 ucb/tn3270/state.h create mode 100644 ucb/tn3270/termcodes.m4 create mode 100644 ucb/tn3270/termin.c create mode 100644 ucb/tn3270/tn3270.c create mode 100644 ucb/tn3270/vaxbsubs.s create mode 100644 ucb/tset/Makefile create mode 100644 ucb/tset/tset.1 create mode 100644 ucb/tset/tset.c create mode 100644 ucb/ul.c create mode 100644 ucb/unexpand.c create mode 100644 ucb/unifdef.c create mode 100644 ucb/users.c create mode 100644 ucb/vacation.c create mode 100644 ucb/vgrind/Makefile create mode 100644 ucb/vgrind/regexp.c create mode 100644 ucb/vgrind/retest.c create mode 100644 ucb/vgrind/tmac.vgrind create mode 100644 ucb/vgrind/vfontedpr.c create mode 100644 ucb/vgrind/vgrind.sh create mode 100644 ucb/vgrind/vgrindefs.c create mode 100644 ucb/vgrind/vgrindefs.src create mode 100644 ucb/vlp/Makefile create mode 100644 ucb/vlp/vlp.c create mode 100644 ucb/vmstat.c create mode 100644 ucb/w.c create mode 100644 ucb/wc.c create mode 100644 ucb/what.c create mode 100644 ucb/whereis.c create mode 100644 ucb/which.csh create mode 100644 ucb/whois.c create mode 100644 ucb/window/:tt create mode 100644 ucb/window/:tty create mode 100644 ucb/window/:var create mode 100644 ucb/window/:ww create mode 100644 ucb/window/Makefile create mode 100644 ucb/window/README create mode 100644 ucb/window/TODO create mode 100644 ucb/window/alias.h create mode 100644 ucb/window/char.c create mode 100644 ucb/window/char.h create mode 100644 ucb/window/cmd.c create mode 100644 ucb/window/cmd1.c create mode 100644 ucb/window/cmd2.c create mode 100644 ucb/window/cmd3.c create mode 100644 ucb/window/cmd4.c create mode 100644 ucb/window/cmd5.c create mode 100644 ucb/window/cmd6.c create mode 100644 ucb/window/cmd7.c create mode 100644 ucb/window/context.c create mode 100644 ucb/window/context.h create mode 100644 ucb/window/defs.h create mode 100644 ucb/window/error.c create mode 100644 ucb/window/lcmd.c create mode 100644 ucb/window/lcmd.h create mode 100644 ucb/window/lcmd1.c create mode 100644 ucb/window/lcmd2.c create mode 100644 ucb/window/local.h create mode 100644 ucb/window/main.c create mode 100644 ucb/window/mloop.c create mode 100644 ucb/window/parser.h create mode 100644 ucb/window/parser1.c create mode 100644 ucb/window/parser2.c create mode 100644 ucb/window/parser3.c create mode 100644 ucb/window/parser4.c create mode 100644 ucb/window/parser5.c create mode 100644 ucb/window/scanner.c create mode 100644 ucb/window/startup.c create mode 100644 ucb/window/string.c create mode 100644 ucb/window/string.h create mode 100644 ucb/window/token.h create mode 100644 ucb/window/tt.h create mode 100644 ucb/window/ttf100.c create mode 100644 ucb/window/ttgeneric.c create mode 100644 ucb/window/tth19.c create mode 100644 ucb/window/tth29.c create mode 100644 ucb/window/ttinit.c create mode 100644 ucb/window/ttoutput.c create mode 100644 ucb/window/tttermcap.c create mode 100644 ucb/window/tttvi925.c create mode 100644 ucb/window/value.h create mode 100644 ucb/window/var.c create mode 100644 ucb/window/var.h create mode 100644 ucb/window/win.c create mode 100644 ucb/window/windowrc create mode 100644 ucb/window/ww.h create mode 100644 ucb/window/wwadd.c create mode 100644 ucb/window/wwalloc.c create mode 100644 ucb/window/wwbox.c create mode 100644 ucb/window/wwchild.c create mode 100644 ucb/window/wwclose.c create mode 100644 ucb/window/wwclreol.c create mode 100644 ucb/window/wwclreos.c create mode 100644 ucb/window/wwcursor.c create mode 100644 ucb/window/wwdata.c create mode 100644 ucb/window/wwdelchar.c create mode 100644 ucb/window/wwdelete.c create mode 100644 ucb/window/wwdelline.c create mode 100644 ucb/window/wwdump.c create mode 100644 ucb/window/wwend.c create mode 100644 ucb/window/wwenviron.c create mode 100644 ucb/window/wwerror.c create mode 100644 ucb/window/wwflush.c create mode 100644 ucb/window/wwframe.c create mode 100644 ucb/window/wwgets.c create mode 100644 ucb/window/wwinit.c create mode 100644 ucb/window/wwinschar.c create mode 100644 ucb/window/wwinsline.c create mode 100644 ucb/window/wwiomux.c create mode 100644 ucb/window/wwlabel.c create mode 100644 ucb/window/wwmisc.c create mode 100644 ucb/window/wwmove.c create mode 100644 ucb/window/wwopen.c create mode 100644 ucb/window/wwprintf.c create mode 100644 ucb/window/wwpty.c create mode 100644 ucb/window/wwputc.c create mode 100644 ucb/window/wwputs.c create mode 100644 ucb/window/wwredraw.c create mode 100644 ucb/window/wwredrawwin.c create mode 100644 ucb/window/wwrint.c create mode 100644 ucb/window/wwscroll.c create mode 100644 ucb/window/wwsize.c create mode 100644 ucb/window/wwspawn.c create mode 100644 ucb/window/wwsuspend.c create mode 100644 ucb/window/wwtty.c create mode 100644 ucb/window/wwunframe.c create mode 100644 ucb/window/wwupdate.c create mode 100644 ucb/window/wwwrite.c create mode 100644 ucb/xstr.c create mode 100644 ucb/yes.c create mode 100644 usr.bin/MANIFEST create mode 100644 usr.bin/Makefile create mode 100644 usr.bin/PORT/ar11.c.Z create mode 100644 usr.bin/PORT/efl.tar.Z create mode 100644 usr.bin/PORT/file.c.Z create mode 100644 usr.bin/PORT/lint.tar.Z create mode 100644 usr.bin/PORT/ranlib.c.Z create mode 100644 usr.bin/at/Makefile create mode 100644 usr.bin/at/at.c create mode 100644 usr.bin/at/atq.c create mode 100644 usr.bin/at/atrm.c create mode 100644 usr.bin/at/atrun.c create mode 100644 usr.bin/basename.c create mode 100644 usr.bin/bc.y create mode 100644 usr.bin/cal.c create mode 100644 usr.bin/calendar/Makefile create mode 100644 usr.bin/calendar/calendar.c create mode 100644 usr.bin/calendar/calendar.sh create mode 100644 usr.bin/cb.c create mode 100644 usr.bin/checkeq.c create mode 100644 usr.bin/col.c create mode 100644 usr.bin/comm.c create mode 100644 usr.bin/crypt.c create mode 100644 usr.bin/dc/Makefile create mode 100644 usr.bin/dc/dc.c create mode 100644 usr.bin/dc/dc.h create mode 100644 usr.bin/deroff.c create mode 100644 usr.bin/diction/Makefile create mode 100644 usr.bin/diction/abbrev.c create mode 100644 usr.bin/diction/conp.h create mode 100644 usr.bin/diction/dict.c create mode 100644 usr.bin/diction/dict.d create mode 100644 usr.bin/diction/diction.c create mode 100644 usr.bin/diction/diction.sh create mode 100644 usr.bin/diction/edict.c create mode 100644 usr.bin/diction/ehash.c create mode 100644 usr.bin/diction/end.l create mode 100644 usr.bin/diction/explain.d create mode 100644 usr.bin/diction/explain.sh create mode 100644 usr.bin/diction/names.h create mode 100644 usr.bin/diction/nhash.c create mode 100644 usr.bin/diction/nwords.l create mode 100644 usr.bin/diction/outp.c create mode 100644 usr.bin/diction/part.l create mode 100644 usr.bin/diction/pscan.c create mode 100644 usr.bin/diction/style.h create mode 100644 usr.bin/diction/style.sh create mode 100644 usr.bin/diction/suggest.sh create mode 100644 usr.bin/diction/ydict.c create mode 100644 usr.bin/diff3/Makefile create mode 100644 usr.bin/diff3/diff3.c create mode 100644 usr.bin/diff3/diff3.sh create mode 100644 usr.bin/egrep.y create mode 100644 usr.bin/eqn/Makefile create mode 100644 usr.bin/eqn/diacrit.c create mode 100644 usr.bin/eqn/e.h create mode 100644 usr.bin/eqn/e.y create mode 100644 usr.bin/eqn/eqnbox.c create mode 100644 usr.bin/eqn/font.c create mode 100644 usr.bin/eqn/fromto.c create mode 100644 usr.bin/eqn/funny.c create mode 100644 usr.bin/eqn/glob.c create mode 100644 usr.bin/eqn/integral.c create mode 100644 usr.bin/eqn/io.c create mode 100644 usr.bin/eqn/lex.c create mode 100644 usr.bin/eqn/lookup.c create mode 100644 usr.bin/eqn/mark.c create mode 100644 usr.bin/eqn/matrix.c create mode 100644 usr.bin/eqn/move.c create mode 100644 usr.bin/eqn/over.c create mode 100644 usr.bin/eqn/paren.c create mode 100644 usr.bin/eqn/pile.c create mode 100644 usr.bin/eqn/shift.c create mode 100644 usr.bin/eqn/size.c create mode 100644 usr.bin/eqn/sqrt.c create mode 100644 usr.bin/eqn/text.c create mode 100644 usr.bin/f77/:gram.fix create mode 100644 usr.bin/f77/:rofix create mode 100644 usr.bin/f77/BUG? create mode 100644 usr.bin/f77/Makefile create mode 100644 usr.bin/f77/README create mode 100644 usr.bin/f77/data.c create mode 100644 usr.bin/f77/defines create mode 100644 usr.bin/f77/defs create mode 100644 usr.bin/f77/defs.orig create mode 100644 usr.bin/f77/dmrdefs create mode 100644 usr.bin/f77/drivedefs create mode 100644 usr.bin/f77/driver.c create mode 100644 usr.bin/f77/equiv.c create mode 100644 usr.bin/f77/error.c create mode 100644 usr.bin/f77/exec.c create mode 100644 usr.bin/f77/expr.c create mode 100644 usr.bin/f77/ftypes create mode 100644 usr.bin/f77/gram.dcl create mode 100644 usr.bin/f77/gram.exec create mode 100644 usr.bin/f77/gram.expr create mode 100644 usr.bin/f77/gram.head create mode 100644 usr.bin/f77/gram.io create mode 100644 usr.bin/f77/includes create mode 100644 usr.bin/f77/init.c create mode 100644 usr.bin/f77/intr.c create mode 100644 usr.bin/f77/io.c create mode 100644 usr.bin/f77/lex.c create mode 100644 usr.bin/f77/locdefs create mode 100644 usr.bin/f77/main.c create mode 100644 usr.bin/f77/malloc.c create mode 100644 usr.bin/f77/misc.c create mode 100644 usr.bin/f77/pdp11.c create mode 100644 usr.bin/f77/pdp11defs create mode 100644 usr.bin/f77/pdp11x.c create mode 100644 usr.bin/f77/proc.c create mode 100644 usr.bin/f77/put.c create mode 100644 usr.bin/f77/putdmr.c create mode 100644 usr.bin/f77/scjdefs create mode 100644 usr.bin/f77/string_defs create mode 100644 usr.bin/f77/tags create mode 100644 usr.bin/f77/tokdefs create mode 100644 usr.bin/f77/tokens create mode 100644 usr.bin/fgrep.c create mode 100644 usr.bin/file.c create mode 100644 usr.bin/find/Makefile create mode 100644 usr.bin/find/bigram.c create mode 100644 usr.bin/find/code.c create mode 100644 usr.bin/find/find.c create mode 100644 usr.bin/find/updatedb.csh create mode 100644 usr.bin/fstat/Makefile create mode 100644 usr.bin/fstat/fstat.8 create mode 100644 usr.bin/fstat/fstat.c create mode 100644 usr.bin/graph/Makefile create mode 100644 usr.bin/graph/graph.c create mode 100644 usr.bin/id/Makefile create mode 100644 usr.bin/id/groups.1 create mode 100644 usr.bin/id/groups.sh create mode 100644 usr.bin/id/id.1 create mode 100644 usr.bin/id/id.c create mode 100644 usr.bin/id/whoami.1 create mode 100644 usr.bin/id/whoami.sh create mode 100644 usr.bin/iostat.c create mode 100644 usr.bin/join.c create mode 100644 usr.bin/learn/Makefile create mode 100644 usr.bin/learn/README create mode 100644 usr.bin/learn/copy.c create mode 100644 usr.bin/learn/dounit.c create mode 100644 usr.bin/learn/getlesson.c create mode 100644 usr.bin/learn/lcount.c create mode 100644 usr.bin/learn/learn.c create mode 100644 usr.bin/learn/list.c create mode 100644 usr.bin/learn/lrnref.h create mode 100644 usr.bin/learn/lrntee.c create mode 100644 usr.bin/learn/makpipe.c create mode 100644 usr.bin/learn/maktee.c create mode 100644 usr.bin/learn/mem.c create mode 100644 usr.bin/learn/mysys.c create mode 100644 usr.bin/learn/selsub.c create mode 100644 usr.bin/learn/selunit.c create mode 100644 usr.bin/learn/start.c create mode 100644 usr.bin/learn/tags create mode 100644 usr.bin/learn/tee.c create mode 100644 usr.bin/learn/whatnow.c create mode 100644 usr.bin/learn/wrapup.c create mode 100644 usr.bin/lex/Makefile create mode 100644 usr.bin/lex/header.c create mode 100644 usr.bin/lex/ldefs.c create mode 100644 usr.bin/lex/lmain.c create mode 100644 usr.bin/lex/ncform create mode 100644 usr.bin/lex/nrform create mode 100644 usr.bin/lex/once.c create mode 100644 usr.bin/lex/parser.y create mode 100644 usr.bin/lex/sub1.c create mode 100644 usr.bin/lex/sub2.c create mode 100644 usr.bin/lint/Makefile create mode 100644 usr.bin/lint/READ_ME create mode 100644 usr.bin/lint/SHELL create mode 100644 usr.bin/lint/hash.c create mode 100755 usr.bin/lint/libs create mode 100644 usr.bin/lint/lint.c create mode 100644 usr.bin/lint/lmanifest.h create mode 100644 usr.bin/lint/lpass2.c create mode 100644 usr.bin/lint/macdefs.h create mode 100644 usr.bin/look.c create mode 100644 usr.bin/lorder.sh create mode 100644 usr.bin/m4/Makefile create mode 100644 usr.bin/m4/NOTES create mode 100644 usr.bin/m4/TEST/ack.m4 create mode 100644 usr.bin/m4/TEST/hanoi.m4 create mode 100644 usr.bin/m4/TEST/hash.m4 create mode 100644 usr.bin/m4/TEST/sqroot.m4 create mode 100644 usr.bin/m4/TEST/string.m4 create mode 100644 usr.bin/m4/TEST/test.m4 create mode 100644 usr.bin/m4/eval.c create mode 100644 usr.bin/m4/expr.c create mode 100644 usr.bin/m4/extern.h create mode 100644 usr.bin/m4/look.c create mode 100644 usr.bin/m4/main.c create mode 100644 usr.bin/m4/mdef.h create mode 100644 usr.bin/m4/misc.c create mode 100644 usr.bin/m4/pathnames.h create mode 100644 usr.bin/m4/stdd.h create mode 100644 usr.bin/m4/tags create mode 100644 usr.bin/mesg.c create mode 100644 usr.bin/mkdep.sh create mode 100644 usr.bin/mkerrlst/Makefile create mode 100644 usr.bin/mkerrlst/mkerrlst.1 create mode 100644 usr.bin/mkerrlst/mkerrlst.c create mode 100644 usr.bin/neqn/Makefile create mode 100644 usr.bin/nohup.sh create mode 100644 usr.bin/patch/EXTERN.h create mode 100644 usr.bin/patch/INTERN.h create mode 100644 usr.bin/patch/MANIFEST create mode 100644 usr.bin/patch/Makefile create mode 100644 usr.bin/patch/README create mode 100644 usr.bin/patch/common.h create mode 100644 usr.bin/patch/config.h create mode 100644 usr.bin/patch/dist/Configure create mode 100644 usr.bin/patch/dist/Makefile create mode 100644 usr.bin/patch/dist/Makefile.SH create mode 100644 usr.bin/patch/dist/config.H create mode 100644 usr.bin/patch/dist/config.h.SH create mode 100644 usr.bin/patch/dist/config.sh create mode 100755 usr.bin/patch/dist/filexp create mode 100644 usr.bin/patch/dist/myread create mode 100644 usr.bin/patch/dist/util.c create mode 100644 usr.bin/patch/inp.c create mode 100644 usr.bin/patch/inp.h create mode 100644 usr.bin/patch/malloc.c create mode 100644 usr.bin/patch/patch.c create mode 100644 usr.bin/patch/patch.man create mode 100644 usr.bin/patch/patchlevel.h create mode 100644 usr.bin/patch/pch.c create mode 100644 usr.bin/patch/pch.h create mode 100644 usr.bin/patch/util.c create mode 100644 usr.bin/patch/util.h create mode 100644 usr.bin/patch/version.c create mode 100644 usr.bin/patch/version.h create mode 100644 usr.bin/plot/Makefile create mode 100644 usr.bin/plot/atoplot.c create mode 100644 usr.bin/plot/chrtab.c create mode 100644 usr.bin/plot/crtdriver.c create mode 100644 usr.bin/plot/crtplot.c create mode 100644 usr.bin/plot/debug.c create mode 100644 usr.bin/plot/driver.c create mode 100644 usr.bin/plot/plot.sh create mode 100644 usr.bin/plot/plottoa.c create mode 100644 usr.bin/printf/Makefile create mode 100644 usr.bin/printf/printf.1 create mode 100644 usr.bin/printf/printf.c create mode 100644 usr.bin/prof/Makefile create mode 100644 usr.bin/prof/prof.c create mode 100644 usr.bin/ptx.c create mode 100644 usr.bin/ranlib/Makefile create mode 100644 usr.bin/ranlib/build.c create mode 100644 usr.bin/ranlib/misc.c create mode 100644 usr.bin/ranlib/pathnames.h create mode 100644 usr.bin/ranlib/ranlib.1 create mode 100644 usr.bin/ranlib/ranlib.5.5 create mode 100644 usr.bin/ranlib/ranlib.c create mode 100644 usr.bin/ranlib/touch.c create mode 100644 usr.bin/ratfor/Makefile create mode 100644 usr.bin/ratfor/r.g create mode 100644 usr.bin/ratfor/r.h create mode 100644 usr.bin/ratfor/r0.c create mode 100644 usr.bin/ratfor/r1.c create mode 100644 usr.bin/ratfor/r2.c create mode 100644 usr.bin/ratfor/rio.c create mode 100644 usr.bin/ratfor/rlex.c create mode 100644 usr.bin/ratfor/rlook.c create mode 100644 usr.bin/refer/Makefile create mode 100644 usr.bin/refer/TEST create mode 100644 usr.bin/refer/TOFIX create mode 100644 usr.bin/refer/addbib.c create mode 100644 usr.bin/refer/annobib.c create mode 100644 usr.bin/refer/deliv1.c create mode 100644 usr.bin/refer/deliv2.c create mode 100644 usr.bin/refer/flagger.c create mode 100644 usr.bin/refer/glue1.c create mode 100644 usr.bin/refer/glue2.c create mode 100644 usr.bin/refer/glue3.c create mode 100644 usr.bin/refer/glue4.c create mode 100644 usr.bin/refer/glue5.c create mode 100644 usr.bin/refer/hunt1.c create mode 100644 usr.bin/refer/hunt2.c create mode 100644 usr.bin/refer/hunt3.c create mode 100644 usr.bin/refer/hunt5.c create mode 100644 usr.bin/refer/hunt6.c create mode 100644 usr.bin/refer/hunt7.c create mode 100644 usr.bin/refer/hunt8.c create mode 100644 usr.bin/refer/hunt9.c create mode 100644 usr.bin/refer/indxbib.sh create mode 100644 usr.bin/refer/inv1.c create mode 100644 usr.bin/refer/inv2.c create mode 100644 usr.bin/refer/inv3.c create mode 100644 usr.bin/refer/inv5.c create mode 100644 usr.bin/refer/inv6.c create mode 100644 usr.bin/refer/kaiser.c create mode 100644 usr.bin/refer/lookbib.c create mode 100644 usr.bin/refer/mkey1.c create mode 100644 usr.bin/refer/mkey2.c create mode 100644 usr.bin/refer/mkey3.c create mode 100644 usr.bin/refer/refer..c create mode 100644 usr.bin/refer/refer0.c create mode 100644 usr.bin/refer/refer1.c create mode 100644 usr.bin/refer/refer2.c create mode 100644 usr.bin/refer/refer3.c create mode 100644 usr.bin/refer/refer4.c create mode 100644 usr.bin/refer/refer5.c create mode 100644 usr.bin/refer/refer6.c create mode 100644 usr.bin/refer/refer7.c create mode 100644 usr.bin/refer/refer8.c create mode 100644 usr.bin/refer/roffbib.sh create mode 100644 usr.bin/refer/shell.c create mode 100644 usr.bin/refer/sortbib.c create mode 100644 usr.bin/refer/thash.c create mode 100644 usr.bin/refer/tick.c create mode 100644 usr.bin/refer/tmac.bib create mode 100644 usr.bin/refer/types.c create mode 100644 usr.bin/refer/what..c create mode 100644 usr.bin/refer/what1.c create mode 100644 usr.bin/refer/what2.c create mode 100644 usr.bin/refer/what3.c create mode 100644 usr.bin/refer/what4.c create mode 100644 usr.bin/renice/Makefile create mode 100644 usr.bin/renice/renice.8 create mode 100644 usr.bin/renice/renice.c create mode 100644 usr.bin/rev.c create mode 100644 usr.bin/roff/Makefile create mode 100644 usr.bin/roff/common_source/README create mode 100644 usr.bin/roff/common_source/d.h create mode 100644 usr.bin/roff/common_source/hytab.c create mode 100644 usr.bin/roff/common_source/n1.c create mode 100644 usr.bin/roff/common_source/n2.c create mode 100644 usr.bin/roff/common_source/n3.c create mode 100644 usr.bin/roff/common_source/n4.c create mode 100644 usr.bin/roff/common_source/n5.c create mode 100644 usr.bin/roff/common_source/n7.c create mode 100644 usr.bin/roff/common_source/n8.c create mode 100644 usr.bin/roff/common_source/n9.c create mode 100644 usr.bin/roff/common_source/ni.c create mode 100644 usr.bin/roff/common_source/nii.c create mode 100644 usr.bin/roff/common_source/sdef.h create mode 100644 usr.bin/roff/common_source/suftab.c create mode 100644 usr.bin/roff/common_source/tdef.h create mode 100644 usr.bin/roff/common_source/textscript create mode 100644 usr.bin/roff/common_source/tw.h create mode 100644 usr.bin/roff/common_source/v.h create mode 100644 usr.bin/roff/nroff/Makefile create mode 100644 usr.bin/roff/nroff/n10.c create mode 100644 usr.bin/roff/nroff/n6.c create mode 100644 usr.bin/roff/nroff/ntab.c create mode 100644 usr.bin/roff/nroff_term/Makefile create mode 100644 usr.bin/roff/nroff_term/README create mode 100644 usr.bin/roff/nroff_term/chartst create mode 100644 usr.bin/roff/nroff_term/code.300 create mode 100644 usr.bin/roff/nroff_term/code.aj833 create mode 100644 usr.bin/roff/nroff_term/code.itoh create mode 100644 usr.bin/roff/nroff_term/code.nec create mode 100644 usr.bin/roff/nroff_term/code.x-ecs create mode 100644 usr.bin/roff/nroff_term/code.xerox create mode 100644 usr.bin/roff/nroff_term/tab300-12.c create mode 100644 usr.bin/roff/nroff_term/tab300.c create mode 100644 usr.bin/roff/nroff_term/tab302-12.c create mode 100644 usr.bin/roff/nroff_term/tab302.c create mode 100644 usr.bin/roff/nroff_term/tab37.c create mode 100644 usr.bin/roff/nroff_term/tab382-12.c create mode 100644 usr.bin/roff/nroff_term/tab382.c create mode 100644 usr.bin/roff/nroff_term/tab450-12.c create mode 100644 usr.bin/roff/nroff_term/tab450.c create mode 100644 usr.bin/roff/nroff_term/tab833-12.c create mode 100644 usr.bin/roff/nroff_term/tab833.c create mode 100644 usr.bin/roff/nroff_term/tabepson.c create mode 100644 usr.bin/roff/nroff_term/tabitoh.c create mode 100644 usr.bin/roff/nroff_term/tabitoh12.c create mode 100644 usr.bin/roff/nroff_term/tablpr.c create mode 100644 usr.bin/roff/nroff_term/tabnec-t.c create mode 100644 usr.bin/roff/nroff_term/tabnec.c create mode 100644 usr.bin/roff/nroff_term/tabnec12.c create mode 100644 usr.bin/roff/nroff_term/tabnec25-t.c create mode 100644 usr.bin/roff/nroff_term/tabqume.c create mode 100644 usr.bin/roff/nroff_term/tabqume12.c create mode 100644 usr.bin/roff/nroff_term/tabx-ecs.c create mode 100644 usr.bin/roff/nroff_term/tabx-ecs12.c create mode 100644 usr.bin/roff/nroff_term/tabxerox.c create mode 100644 usr.bin/roff/nroff_term/tabxerox12.c create mode 100644 usr.bin/roff/troff/Makefile create mode 100644 usr.bin/roff/troff/svt6.c create mode 100644 usr.bin/roff/troff/t10.c create mode 100644 usr.bin/roff/troff/t6.c create mode 100644 usr.bin/roff/troff/tab3.c create mode 100644 usr.bin/roff/troff_font/Makefile create mode 100644 usr.bin/roff/troff_font/ftBC.n create mode 100644 usr.bin/roff/troff_font/ftC.n create mode 100644 usr.bin/roff/troff_font/ftCW.n create mode 100644 usr.bin/roff/troff_font/ftGR.n create mode 100644 usr.bin/roff/troff_font/ftR.n create mode 100755 usr.bin/roff/troff_font/linkrc create mode 100644 usr.bin/roff/troff_font/mkfont.c create mode 100644 usr.bin/roff/troff_font/mkfont1.c create mode 100755 usr.bin/roff/troff_font/onefont create mode 100644 usr.bin/shar/Makefile create mode 100644 usr.bin/shar/shar.1 create mode 100644 usr.bin/shar/shar.c create mode 100644 usr.bin/shar/traverse.3 create mode 100644 usr.bin/shar/traverse.c create mode 100644 usr.bin/sleep.c create mode 100644 usr.bin/sort.c create mode 100644 usr.bin/spell/Makefile create mode 100644 usr.bin/spell/american create mode 100644 usr.bin/spell/british create mode 100644 usr.bin/spell/local create mode 100644 usr.bin/spell/spell.c create mode 100644 usr.bin/spell/spell.h create mode 100644 usr.bin/spell/spell.sh create mode 100644 usr.bin/spell/spellin.c create mode 100644 usr.bin/spell/spellout.c create mode 100644 usr.bin/spell/stop create mode 100644 usr.bin/spline.c create mode 100644 usr.bin/split.c create mode 100644 usr.bin/struct/0.alloc.c create mode 100644 usr.bin/struct/0.args.c create mode 100644 usr.bin/struct/0.def.c create mode 100644 usr.bin/struct/0.extr.c create mode 100644 usr.bin/struct/0.graph.c create mode 100644 usr.bin/struct/0.list.c create mode 100644 usr.bin/struct/0.parts.c create mode 100644 usr.bin/struct/0.string.c create mode 100644 usr.bin/struct/1.defs.h create mode 100644 usr.bin/struct/1.finish.c create mode 100644 usr.bin/struct/1.form.c create mode 100644 usr.bin/struct/1.fort.c create mode 100644 usr.bin/struct/1.hash.c create mode 100644 usr.bin/struct/1.incl.h create mode 100644 usr.bin/struct/1.init.c create mode 100644 usr.bin/struct/1.line.c create mode 100644 usr.bin/struct/1.main.c create mode 100644 usr.bin/struct/1.node.c create mode 100644 usr.bin/struct/1.recog.c create mode 100644 usr.bin/struct/1.tables.c create mode 100644 usr.bin/struct/2.def.h create mode 100644 usr.bin/struct/2.dfs.c create mode 100644 usr.bin/struct/2.dom.c create mode 100644 usr.bin/struct/2.head.c create mode 100644 usr.bin/struct/2.inarc.c create mode 100644 usr.bin/struct/2.main.c create mode 100644 usr.bin/struct/2.tree.c create mode 100644 usr.bin/struct/3.branch.c create mode 100644 usr.bin/struct/3.def.h create mode 100644 usr.bin/struct/3.flow.c create mode 100644 usr.bin/struct/3.loop.c create mode 100644 usr.bin/struct/3.main.c create mode 100644 usr.bin/struct/3.reach.c create mode 100644 usr.bin/struct/3.then.c create mode 100644 usr.bin/struct/4.brace.c create mode 100644 usr.bin/struct/4.def.h create mode 100644 usr.bin/struct/4.form.c create mode 100644 usr.bin/struct/4.main.c create mode 100644 usr.bin/struct/4.out.c create mode 100644 usr.bin/struct/Makefile create mode 100644 usr.bin/struct/b.h create mode 100644 usr.bin/struct/bdef.c create mode 100644 usr.bin/struct/beauty.y create mode 100644 usr.bin/struct/def.h create mode 100644 usr.bin/struct/lextab.l create mode 100644 usr.bin/struct/main.c create mode 100644 usr.bin/struct/struct create mode 100644 usr.bin/struct/tree.c create mode 100644 usr.bin/sum.c create mode 100644 usr.bin/tabs.c create mode 100644 usr.bin/tbl/Makefile create mode 100644 usr.bin/tbl/t..c create mode 100644 usr.bin/tbl/t0.c create mode 100644 usr.bin/tbl/t1.c create mode 100644 usr.bin/tbl/t2.c create mode 100644 usr.bin/tbl/t3.c create mode 100644 usr.bin/tbl/t4.c create mode 100644 usr.bin/tbl/t5.c create mode 100644 usr.bin/tbl/t6.c create mode 100644 usr.bin/tbl/t7.c create mode 100644 usr.bin/tbl/t8.c create mode 100644 usr.bin/tbl/t9.c create mode 100644 usr.bin/tbl/tb.c create mode 100644 usr.bin/tbl/tc.c create mode 100644 usr.bin/tbl/te.c create mode 100644 usr.bin/tbl/tf.c create mode 100644 usr.bin/tbl/tg.c create mode 100644 usr.bin/tbl/ti.c create mode 100644 usr.bin/tbl/tm.c create mode 100644 usr.bin/tbl/ts.c create mode 100644 usr.bin/tbl/tt.c create mode 100644 usr.bin/tbl/tu.c create mode 100644 usr.bin/tbl/tv.c create mode 100644 usr.bin/tc.c create mode 100644 usr.bin/tip/Makefile create mode 100644 usr.bin/tip/README create mode 100644 usr.bin/tip/TODO create mode 100644 usr.bin/tip/acu.c create mode 100644 usr.bin/tip/aculib/Makefile create mode 100644 usr.bin/tip/aculib/biz22.c create mode 100644 usr.bin/tip/aculib/biz31.c create mode 100644 usr.bin/tip/aculib/courier.c create mode 100644 usr.bin/tip/aculib/df.c create mode 100644 usr.bin/tip/aculib/dn11.c create mode 100644 usr.bin/tip/aculib/hayes.c create mode 100644 usr.bin/tip/aculib/penril.c create mode 100644 usr.bin/tip/aculib/v3451.c create mode 100644 usr.bin/tip/aculib/v831.c create mode 100644 usr.bin/tip/aculib/ventel.c create mode 100644 usr.bin/tip/acutab.c create mode 100644 usr.bin/tip/cmds.c create mode 100644 usr.bin/tip/cmdtab.c create mode 100644 usr.bin/tip/cu.c create mode 100644 usr.bin/tip/hunt.c create mode 100644 usr.bin/tip/log.c create mode 100644 usr.bin/tip/partab.c create mode 100644 usr.bin/tip/phones-file create mode 100644 usr.bin/tip/remcap.c create mode 100644 usr.bin/tip/remote-file create mode 100644 usr.bin/tip/remote.c create mode 100644 usr.bin/tip/tip.c create mode 100644 usr.bin/tip/tip.h create mode 100644 usr.bin/tip/tipout.c create mode 100644 usr.bin/tip/uucplock.c create mode 100644 usr.bin/tip/value.c create mode 100644 usr.bin/tip/vars.c create mode 100644 usr.bin/tk.c create mode 100644 usr.bin/touch.c create mode 100644 usr.bin/tr.c create mode 100644 usr.bin/tsort.c create mode 100644 usr.bin/tty.c create mode 100644 usr.bin/uname/Makefile create mode 100644 usr.bin/uname/uname.1 create mode 100644 usr.bin/uname/uname.c create mode 100644 usr.bin/uniq.c create mode 100644 usr.bin/units.c create mode 100644 usr.bin/uucp/CHANGES create mode 100644 usr.bin/uucp/Makefile create mode 100644 usr.bin/uucp/README create mode 100644 usr.bin/uucp/README.TCP create mode 100644 usr.bin/uucp/README.dialino create mode 100644 usr.bin/uucp/UUAIDS/L-devices create mode 100644 usr.bin/uucp/UUAIDS/L-dialcodes create mode 100644 usr.bin/uucp/UUAIDS/L.aliases create mode 100644 usr.bin/uucp/UUAIDS/L.cmds create mode 100644 usr.bin/uucp/UUAIDS/L.sys create mode 100644 usr.bin/uucp/UUAIDS/Notes.L.sys create mode 100644 usr.bin/uucp/UUAIDS/USERFILE create mode 100644 usr.bin/uucp/UUAIDS/setup.tblms create mode 100644 usr.bin/uucp/UUAIDS/uu.daily create mode 100644 usr.bin/uucp/UUAIDS/uu.daily.seism create mode 100644 usr.bin/uucp/UUAIDS/uu.hourly create mode 100644 usr.bin/uucp/UUAIDS/uu.weekly create mode 100644 usr.bin/uucp/UUAIDS/uucp.daily create mode 100644 usr.bin/uucp/UUAIDS/uucpsrv.c create mode 100644 usr.bin/uucp/UUAIDS/uucpsummary create mode 100644 usr.bin/uucp/UUAIDS/uucpsummary.mo create mode 100644 usr.bin/uucp/UUAIDS/uurate create mode 100644 usr.bin/uucp/UUAIDS/uutbl create mode 100644 usr.bin/uucp/UUAIDS/uuusage create mode 100644 usr.bin/uucp/acucntrl.8 create mode 100644 usr.bin/uucp/acucntrl.c create mode 100644 usr.bin/uucp/aculib/Makefile create mode 100644 usr.bin/uucp/aculib/att2224.c create mode 100644 usr.bin/uucp/aculib/bsdtcp.c create mode 100644 usr.bin/uucp/aculib/cds224.c create mode 100644 usr.bin/uucp/aculib/df12.c create mode 100644 usr.bin/uucp/aculib/df2.c create mode 100644 usr.bin/uucp/aculib/dk.c create mode 100644 usr.bin/uucp/aculib/dn.c create mode 100644 usr.bin/uucp/aculib/hys.c create mode 100644 usr.bin/uucp/aculib/hys24.c create mode 100644 usr.bin/uucp/aculib/hysq.c create mode 100644 usr.bin/uucp/aculib/mic.c create mode 100644 usr.bin/uucp/aculib/nov.c create mode 100644 usr.bin/uucp/aculib/pen.c create mode 100644 usr.bin/uucp/aculib/pnet.c create mode 100644 usr.bin/uucp/aculib/rvmacs.c create mode 100644 usr.bin/uucp/aculib/sy.c create mode 100644 usr.bin/uucp/aculib/unet.c create mode 100644 usr.bin/uucp/aculib/va212.c create mode 100644 usr.bin/uucp/aculib/va811.c create mode 100644 usr.bin/uucp/aculib/va820.c create mode 100644 usr.bin/uucp/aculib/vad.c create mode 100644 usr.bin/uucp/aculib/vent.c create mode 100644 usr.bin/uucp/aculib/vmacs.c create mode 100644 usr.bin/uucp/anlwrk.c create mode 100644 usr.bin/uucp/anyread.c create mode 100644 usr.bin/uucp/assert.c create mode 100644 usr.bin/uucp/cfgets.c create mode 100644 usr.bin/uucp/chkpth.c create mode 100644 usr.bin/uucp/chksum.c create mode 100644 usr.bin/uucp/cico.c create mode 100644 usr.bin/uucp/cntrl.c create mode 100644 usr.bin/uucp/condevs.c create mode 100644 usr.bin/uucp/condevs.h create mode 100644 usr.bin/uucp/conn.c create mode 100644 usr.bin/uucp/cpmv.c create mode 100644 usr.bin/uucp/expfile.c create mode 100644 usr.bin/uucp/fio.c create mode 100644 usr.bin/uucp/gename.c create mode 100644 usr.bin/uucp/getargs.c create mode 100644 usr.bin/uucp/getprm.c create mode 100644 usr.bin/uucp/getpwinfo.c create mode 100644 usr.bin/uucp/gio.c create mode 100644 usr.bin/uucp/gnamef.c create mode 100644 usr.bin/uucp/gnsys.c create mode 100644 usr.bin/uucp/gnxseq.c create mode 100644 usr.bin/uucp/imsg.c create mode 100644 usr.bin/uucp/lastpart.c create mode 100644 usr.bin/uucp/logent.c create mode 100644 usr.bin/uucp/mailst.c create mode 100644 usr.bin/uucp/pk.h create mode 100644 usr.bin/uucp/pk0.c create mode 100644 usr.bin/uucp/pk1.c create mode 100644 usr.bin/uucp/prefix.c create mode 100644 usr.bin/uucp/setline.c create mode 100644 usr.bin/uucp/subdir.c create mode 100644 usr.bin/uucp/sysacct.c create mode 100644 usr.bin/uucp/systat.c create mode 100644 usr.bin/uucp/tio.c create mode 100644 usr.bin/uucp/ulockf.c create mode 100644 usr.bin/uucp/uuclean.c create mode 100644 usr.bin/uucp/uucp.c create mode 100644 usr.bin/uucp/uucp.h create mode 100644 usr.bin/uucp/uucpd.c create mode 100644 usr.bin/uucp/uucpdefs.c create mode 100644 usr.bin/uucp/uucpname.c create mode 100644 usr.bin/uucp/uudecode.c create mode 100644 usr.bin/uucp/uuencode.c create mode 100644 usr.bin/uucp/uulog.c create mode 100644 usr.bin/uucp/uuname.c create mode 100644 usr.bin/uucp/uupoll.c create mode 100644 usr.bin/uucp/uuq.c create mode 100644 usr.bin/uucp/uusend.c create mode 100644 usr.bin/uucp/uusnap.c create mode 100644 usr.bin/uucp/uust.h create mode 100644 usr.bin/uucp/uusub.h create mode 100644 usr.bin/uucp/uux.c create mode 100644 usr.bin/uucp/uuxqt.c create mode 100644 usr.bin/uucp/versys.c create mode 100644 usr.bin/uucp/vms.tar.Z create mode 100644 usr.bin/uucp/xqt.c create mode 100644 usr.bin/whereis/Makefile create mode 100644 usr.bin/whereis/whereis.1 create mode 100644 usr.bin/whereis/whereis.c create mode 100644 usr.bin/xargs/Makefile create mode 100644 usr.bin/xargs/pathnames.h create mode 100644 usr.bin/xargs/xargs.1 create mode 100644 usr.bin/xargs/xargs.c create mode 100644 usr.bin/xinstall/Makefile create mode 100644 usr.bin/xinstall/install.1 create mode 100644 usr.bin/xinstall/pathnames.h create mode 100644 usr.bin/xinstall/xinstall.c create mode 100644 usr.bin/yacc/Makefile create mode 100644 usr.bin/yacc/dextern create mode 100644 usr.bin/yacc/files create mode 100644 usr.bin/yacc/y1.c create mode 100644 usr.bin/yacc/y2.c create mode 100644 usr.bin/yacc/y3.c create mode 100644 usr.bin/yacc/y4.c create mode 100644 usr.bin/yacc/yaccdiffs create mode 100644 usr.bin/yacc/yaccnews create mode 100644 usr.bin/yacc/yaccpar create mode 100644 usr.lib/MANIFEST create mode 100644 usr.lib/Makefile create mode 100644 usr.lib/PORT/libg.tar.Z create mode 100644 usr.lib/PORT/libm.tar.Z create mode 100644 usr.lib/PORT/libpc.tar.Z create mode 100644 usr.lib/lib2648/2648.h create mode 100644 usr.lib/lib2648/Makefile create mode 100644 usr.lib/lib2648/agoto.c create mode 100644 usr.lib/lib2648/aminmax.c create mode 100644 usr.lib/lib2648/aon.c create mode 100644 usr.lib/lib2648/areaclear.c create mode 100644 usr.lib/lib2648/beep.c create mode 100644 usr.lib/lib2648/bit.h create mode 100644 usr.lib/lib2648/bitcopy.c create mode 100644 usr.lib/lib2648/cleara.c create mode 100644 usr.lib/lib2648/clearg.c create mode 100644 usr.lib/lib2648/curon.c create mode 100644 usr.lib/lib2648/dispmsg.c create mode 100644 usr.lib/lib2648/draw.c create mode 100644 usr.lib/lib2648/drawbox.c create mode 100644 usr.lib/lib2648/dumpmat.c create mode 100644 usr.lib/lib2648/emptyrow.c create mode 100644 usr.lib/lib2648/error.c create mode 100644 usr.lib/lib2648/escseq.c create mode 100644 usr.lib/lib2648/gdefault.c create mode 100644 usr.lib/lib2648/gon.c create mode 100644 usr.lib/lib2648/kon.c create mode 100644 usr.lib/lib2648/line.c create mode 100644 usr.lib/lib2648/mat.c create mode 100644 usr.lib/lib2648/message.c create mode 100644 usr.lib/lib2648/minmax.c create mode 100644 usr.lib/lib2648/motion.c create mode 100644 usr.lib/lib2648/move.c create mode 100644 usr.lib/lib2648/movecurs.c create mode 100644 usr.lib/lib2648/newmat.c create mode 100644 usr.lib/lib2648/outchar.c create mode 100644 usr.lib/lib2648/outstr.c create mode 100644 usr.lib/lib2648/printg.c create mode 100644 usr.lib/lib2648/rawchar.c create mode 100644 usr.lib/lib2648/rbon.c create mode 100644 usr.lib/lib2648/rdchar.c create mode 100644 usr.lib/lib2648/readline.c create mode 100644 usr.lib/lib2648/set.c create mode 100644 usr.lib/lib2648/setmat.c create mode 100644 usr.lib/lib2648/sync.c create mode 100644 usr.lib/lib2648/texton.c create mode 100644 usr.lib/lib2648/ttyinit.c create mode 100644 usr.lib/lib2648/update.c create mode 100644 usr.lib/lib2648/video.c create mode 100644 usr.lib/lib2648/zermat.c create mode 100644 usr.lib/lib2648/zoomn.c create mode 100644 usr.lib/lib2648/zoomon.c create mode 100644 usr.lib/lib2648/zoomout.c create mode 100644 usr.lib/libF77/Makefile create mode 100644 usr.lib/libF77/NEWS create mode 100644 usr.lib/libF77/READ_ME create mode 100755 usr.lib/libF77/Revision create mode 100755 usr.lib/libF77/Test_float create mode 100644 usr.lib/libF77/Usef.c create mode 100644 usr.lib/libF77/Version.c create mode 100644 usr.lib/libF77/abort_.c create mode 100644 usr.lib/libF77/besj0_.c create mode 100644 usr.lib/libF77/besj1_.c create mode 100644 usr.lib/libF77/besjn_.c create mode 100644 usr.lib/libF77/besy0_.c create mode 100644 usr.lib/libF77/besy1_.c create mode 100644 usr.lib/libF77/besyn_.c create mode 100644 usr.lib/libF77/c_abs.c create mode 100644 usr.lib/libF77/c_cos.c create mode 100644 usr.lib/libF77/c_div.c create mode 100644 usr.lib/libF77/c_exp.c create mode 100644 usr.lib/libF77/c_log.c create mode 100644 usr.lib/libF77/c_sin.c create mode 100644 usr.lib/libF77/c_sqrt.c create mode 100755 usr.lib/libF77/complex create mode 100644 usr.lib/libF77/d_abs.c create mode 100644 usr.lib/libF77/d_acos.c create mode 100644 usr.lib/libF77/d_asin.c create mode 100644 usr.lib/libF77/d_atan.c create mode 100644 usr.lib/libF77/d_atn2.c create mode 100644 usr.lib/libF77/d_cnjg.c create mode 100644 usr.lib/libF77/d_cos.c create mode 100644 usr.lib/libF77/d_cosh.c create mode 100644 usr.lib/libF77/d_dim.c create mode 100644 usr.lib/libF77/d_dprod.c create mode 100644 usr.lib/libF77/d_exp.c create mode 100644 usr.lib/libF77/d_imag.c create mode 100644 usr.lib/libF77/d_int.c create mode 100644 usr.lib/libF77/d_lg10.c create mode 100644 usr.lib/libF77/d_log.c create mode 100644 usr.lib/libF77/d_mod.c create mode 100644 usr.lib/libF77/d_nint.c create mode 100644 usr.lib/libF77/d_prod.c create mode 100644 usr.lib/libF77/d_sign.c create mode 100644 usr.lib/libF77/d_sin.c create mode 100644 usr.lib/libF77/d_sinh.c create mode 100644 usr.lib/libF77/d_tan.c create mode 100644 usr.lib/libF77/d_tanh.c create mode 100644 usr.lib/libF77/dbesj0_.c create mode 100644 usr.lib/libF77/dbesj1_.c create mode 100644 usr.lib/libF77/dbesjn_.c create mode 100644 usr.lib/libF77/dbesy0_.c create mode 100644 usr.lib/libF77/dbesy1_.c create mode 100644 usr.lib/libF77/dbesyn_.c create mode 100644 usr.lib/libF77/derf_.c create mode 100644 usr.lib/libF77/derfc_.c create mode 100644 usr.lib/libF77/ef1asc_.c create mode 100644 usr.lib/libF77/ef1cmc_.c create mode 100644 usr.lib/libF77/erf_.c create mode 100644 usr.lib/libF77/erfc_.c create mode 100644 usr.lib/libF77/exit_.c create mode 100644 usr.lib/libF77/h_abs.c create mode 100644 usr.lib/libF77/h_dim.c create mode 100644 usr.lib/libF77/h_dnnt.c create mode 100644 usr.lib/libF77/h_indx.c create mode 100644 usr.lib/libF77/h_len.c create mode 100644 usr.lib/libF77/h_mod.c create mode 100644 usr.lib/libF77/h_nint.c create mode 100644 usr.lib/libF77/h_sign.c create mode 100644 usr.lib/libF77/hl_ge.c create mode 100644 usr.lib/libF77/hl_gt.c create mode 100644 usr.lib/libF77/hl_le.c create mode 100644 usr.lib/libF77/hl_lt.c create mode 100644 usr.lib/libF77/i_abs.c create mode 100644 usr.lib/libF77/i_dim.c create mode 100644 usr.lib/libF77/i_dnnt.c create mode 100644 usr.lib/libF77/i_indx.c create mode 100644 usr.lib/libF77/i_len.c create mode 100644 usr.lib/libF77/i_mod.c create mode 100644 usr.lib/libF77/i_nint.c create mode 100644 usr.lib/libF77/i_sign.c create mode 100644 usr.lib/libF77/l_ge.c create mode 100644 usr.lib/libF77/l_gt.c create mode 100644 usr.lib/libF77/l_le.c create mode 100644 usr.lib/libF77/l_lt.c create mode 100644 usr.lib/libF77/lnblnk_.c create mode 100644 usr.lib/libF77/long_.c create mode 100644 usr.lib/libF77/main.c create mode 100755 usr.lib/libF77/mkindx create mode 100644 usr.lib/libF77/mkindx.c create mode 100755 usr.lib/libF77/mkvers create mode 100644 usr.lib/libF77/mkvers.c create mode 100644 usr.lib/libF77/opcodes.h create mode 100644 usr.lib/libF77/operand.h create mode 100644 usr.lib/libF77/pow_ci.c create mode 100644 usr.lib/libF77/pow_dd.c create mode 100644 usr.lib/libF77/pow_di.c create mode 100644 usr.lib/libF77/pow_hh.c create mode 100644 usr.lib/libF77/pow_ii.c create mode 100644 usr.lib/libF77/pow_ri.c create mode 100644 usr.lib/libF77/pow_zi.c create mode 100644 usr.lib/libF77/pow_zz.c create mode 100755 usr.lib/libF77/profiled/Version create mode 100644 usr.lib/libF77/r_abs.c create mode 100644 usr.lib/libF77/r_acos.c create mode 100644 usr.lib/libF77/r_asin.c create mode 100644 usr.lib/libF77/r_atan.c create mode 100644 usr.lib/libF77/r_atn2.c create mode 100644 usr.lib/libF77/r_cnjg.c create mode 100644 usr.lib/libF77/r_cos.c create mode 100644 usr.lib/libF77/r_cosh.c create mode 100644 usr.lib/libF77/r_dim.c create mode 100644 usr.lib/libF77/r_exp.c create mode 100644 usr.lib/libF77/r_imag.c create mode 100644 usr.lib/libF77/r_int.c create mode 100644 usr.lib/libF77/r_lg10.c create mode 100644 usr.lib/libF77/r_log.c create mode 100644 usr.lib/libF77/r_mod.c create mode 100644 usr.lib/libF77/r_nint.c create mode 100644 usr.lib/libF77/r_sign.c create mode 100644 usr.lib/libF77/r_sin.c create mode 100644 usr.lib/libF77/r_sinh.c create mode 100644 usr.lib/libF77/r_sqrt.c create mode 100644 usr.lib/libF77/r_tan.c create mode 100644 usr.lib/libF77/r_tanh.c create mode 100644 usr.lib/libF77/rand_.c create mode 100644 usr.lib/libF77/rand_.c.other create mode 100644 usr.lib/libF77/rand_.s.vax create mode 100644 usr.lib/libF77/random_.c create mode 100644 usr.lib/libF77/range.c create mode 100644 usr.lib/libF77/rindex_.c create mode 100644 usr.lib/libF77/s_cat.c create mode 100644 usr.lib/libF77/s_cmp.c create mode 100644 usr.lib/libF77/s_copy.c create mode 100644 usr.lib/libF77/s_paus.c create mode 100644 usr.lib/libF77/s_rnge.c create mode 100644 usr.lib/libF77/s_stop.c create mode 100644 usr.lib/libF77/short_.c create mode 100644 usr.lib/libF77/signal_.c create mode 100644 usr.lib/libF77/subout.c create mode 100644 usr.lib/libF77/test/fpetst.f create mode 100644 usr.lib/libF77/traper_.c create mode 100644 usr.lib/libF77/trapov_.c create mode 100644 usr.lib/libF77/trpfpe_.c create mode 100644 usr.lib/libF77/z_cos.c create mode 100644 usr.lib/libF77/z_div.c create mode 100644 usr.lib/libF77/z_exp.c create mode 100644 usr.lib/libF77/z_log.c create mode 100644 usr.lib/libF77/z_sin.c create mode 100644 usr.lib/libF77/z_sqrt.c create mode 100644 usr.lib/libI77/Makefile create mode 100644 usr.lib/libI77/NEWS create mode 100644 usr.lib/libI77/READ_ME create mode 100755 usr.lib/libI77/Version create mode 100644 usr.lib/libI77/Version.c create mode 100644 usr.lib/libI77/backspace.c create mode 100644 usr.lib/libI77/c_dfe.c create mode 100644 usr.lib/libI77/c_iio.c create mode 100644 usr.lib/libI77/c_sfe.c create mode 100644 usr.lib/libI77/close.c create mode 100644 usr.lib/libI77/dofio.c create mode 100644 usr.lib/libI77/dolio.c create mode 100644 usr.lib/libI77/douio.c create mode 100644 usr.lib/libI77/due.c create mode 100644 usr.lib/libI77/endfile.c create mode 100644 usr.lib/libI77/err.c create mode 100644 usr.lib/libI77/f77_abort.c create mode 100644 usr.lib/libI77/f_errlist.c create mode 100644 usr.lib/libI77/f_errno.h create mode 100644 usr.lib/libI77/fio.h create mode 100644 usr.lib/libI77/fiodefs.h create mode 100644 usr.lib/libI77/fmt.c create mode 100644 usr.lib/libI77/fmtlib.c create mode 100644 usr.lib/libI77/format.h create mode 100644 usr.lib/libI77/inquire.c create mode 100644 usr.lib/libI77/libI66.c create mode 100644 usr.lib/libI77/lio.h create mode 100644 usr.lib/libI77/lread.c create mode 100644 usr.lib/libI77/lwrite.c create mode 100755 usr.lib/libI77/mkindx create mode 100644 usr.lib/libI77/mkindx.c create mode 100755 usr.lib/libI77/mkvers create mode 100644 usr.lib/libI77/mkvers.c create mode 100644 usr.lib/libI77/nmlio.h create mode 100644 usr.lib/libI77/open.c create mode 100755 usr.lib/libI77/profiled/Version create mode 100644 usr.lib/libI77/rdfe.c create mode 100644 usr.lib/libI77/rdfmt.c create mode 100644 usr.lib/libI77/rewind.c create mode 100644 usr.lib/libI77/rfi.c create mode 100644 usr.lib/libI77/rsfe.c create mode 100644 usr.lib/libI77/rsli.c create mode 100644 usr.lib/libI77/rsnmle.c create mode 100644 usr.lib/libI77/sue.c create mode 100755 usr.lib/libI77/test/f2.f create mode 100755 usr.lib/libI77/test/fmtst.f create mode 100755 usr.lib/libI77/test/ioitst.f create mode 100755 usr.lib/libI77/test/nmlist.data create mode 100755 usr.lib/libI77/test/nmlist.f create mode 100755 usr.lib/libI77/test/nmlist.log create mode 100755 usr.lib/libI77/test/pe.f create mode 100755 usr.lib/libI77/test/trunctst.f create mode 100755 usr.lib/libI77/test/try_env.f create mode 100644 usr.lib/libI77/util.c create mode 100644 usr.lib/libI77/wdfe.c create mode 100644 usr.lib/libI77/wfi.c create mode 100644 usr.lib/libI77/wrtfmt.c create mode 100644 usr.lib/libI77/wsfe.c create mode 100644 usr.lib/libI77/wsli.c create mode 100644 usr.lib/libI77/wsnmle.c create mode 100644 usr.lib/libU77/Makefile create mode 100644 usr.lib/libU77/NEWS create mode 100644 usr.lib/libU77/READ_ME create mode 100755 usr.lib/libU77/Version create mode 100644 usr.lib/libU77/Version.c create mode 100644 usr.lib/libU77/access_.c create mode 100644 usr.lib/libU77/alarm_.c create mode 100644 usr.lib/libU77/chdir_.c create mode 100644 usr.lib/libU77/chmod_.c create mode 100644 usr.lib/libU77/ctime_.c create mode 100644 usr.lib/libU77/dtime_.c create mode 100644 usr.lib/libU77/etime_.c create mode 100644 usr.lib/libU77/f77lid_.c create mode 100644 usr.lib/libU77/fdate_.c create mode 100644 usr.lib/libU77/fgetc_.c create mode 100644 usr.lib/libU77/fork_.c create mode 100644 usr.lib/libU77/fputc_.c create mode 100644 usr.lib/libU77/fseek_.c create mode 100644 usr.lib/libU77/fstat_.c create mode 100644 usr.lib/libU77/ftell_.c create mode 100644 usr.lib/libU77/gerror_.c create mode 100644 usr.lib/libU77/getarg_.c create mode 100644 usr.lib/libU77/getc_.c create mode 100644 usr.lib/libU77/getcwd_.c create mode 100644 usr.lib/libU77/getenv_.c create mode 100644 usr.lib/libU77/getgid_.c create mode 100644 usr.lib/libU77/getlog_.c create mode 100644 usr.lib/libU77/getpid_.c create mode 100644 usr.lib/libU77/getuid_.c create mode 100644 usr.lib/libU77/gmtime_.c create mode 100644 usr.lib/libU77/hostnm_.c create mode 100644 usr.lib/libU77/iargc_.c create mode 100644 usr.lib/libU77/idate_.c create mode 100644 usr.lib/libU77/ierrno_.c create mode 100644 usr.lib/libU77/ioinit.f create mode 100644 usr.lib/libU77/isatty_.c create mode 100644 usr.lib/libU77/itime_.c create mode 100644 usr.lib/libU77/kill_.c create mode 100644 usr.lib/libU77/link_.c create mode 100644 usr.lib/libU77/loc_.c create mode 100644 usr.lib/libU77/lstat_.c create mode 100644 usr.lib/libU77/ltime_.c create mode 100644 usr.lib/libU77/malloc_.c create mode 100755 usr.lib/libU77/mkindx create mode 100644 usr.lib/libU77/mkindx.c create mode 100755 usr.lib/libU77/mkvers create mode 100644 usr.lib/libU77/mkvers.c create mode 100644 usr.lib/libU77/perror_.c create mode 100755 usr.lib/libU77/profiled/Version create mode 100644 usr.lib/libU77/putc_.c create mode 100644 usr.lib/libU77/qsort_.c create mode 100644 usr.lib/libU77/rename_.c create mode 100644 usr.lib/libU77/sleep_.c create mode 100644 usr.lib/libU77/stat_.c create mode 100644 usr.lib/libU77/symlnk_.c create mode 100644 usr.lib/libU77/system_.c create mode 100644 usr.lib/libU77/tapeio.c create mode 100644 usr.lib/libU77/test/actst.f create mode 100644 usr.lib/libU77/test/argtst.f create mode 100644 usr.lib/libU77/test/bitst.f create mode 100644 usr.lib/libU77/test/chdtst.f create mode 100644 usr.lib/libU77/test/datst.f create mode 100644 usr.lib/libU77/test/def create mode 100644 usr.lib/libU77/test/ertst.f create mode 100644 usr.lib/libU77/test/fktst.f create mode 100644 usr.lib/libU77/test/flid.f create mode 100644 usr.lib/libU77/test/gpctst.f create mode 100644 usr.lib/libU77/test/gwdtst.f create mode 100644 usr.lib/libU77/test/idtst.f create mode 100644 usr.lib/libU77/test/loctst.f create mode 100644 usr.lib/libU77/test/makefile create mode 100644 usr.lib/libU77/test/rngtst.f create mode 100644 usr.lib/libU77/test/rnmtst.f create mode 100644 usr.lib/libU77/test/seektst.f create mode 100644 usr.lib/libU77/test/serrno_.c create mode 100644 usr.lib/libU77/test/sigfpe.f create mode 100644 usr.lib/libU77/test/sigfpe.s create mode 100644 usr.lib/libU77/test/sigtrtst.f create mode 100644 usr.lib/libU77/test/sigtst.f create mode 100644 usr.lib/libU77/test/sortst.f create mode 100644 usr.lib/libU77/test/statst.f create mode 100644 usr.lib/libU77/test/syml.f create mode 100644 usr.lib/libU77/test/systst.f create mode 100644 usr.lib/libU77/test/taptst.f create mode 100644 usr.lib/libU77/test/timtst.f create mode 100644 usr.lib/libU77/test/ttnam.f create mode 100644 usr.lib/libU77/time_.c create mode 100644 usr.lib/libU77/ttynam_.c create mode 100644 usr.lib/libU77/unlink_.c create mode 100644 usr.lib/libU77/wait_.c create mode 100644 usr.lib/libcurses/Makefile create mode 100644 usr.lib/libcurses/addch.c create mode 100644 usr.lib/libcurses/addstr.c create mode 100644 usr.lib/libcurses/box.c create mode 100644 usr.lib/libcurses/clear.c create mode 100644 usr.lib/libcurses/clrtobot.c create mode 100644 usr.lib/libcurses/clrtoeol.c create mode 100644 usr.lib/libcurses/cr_put.c create mode 100644 usr.lib/libcurses/cr_tty.c create mode 100644 usr.lib/libcurses/curses.c create mode 100644 usr.lib/libcurses/curses.ext create mode 100644 usr.lib/libcurses/curses.h create mode 100644 usr.lib/libcurses/delch.c create mode 100644 usr.lib/libcurses/deleteln.c create mode 100644 usr.lib/libcurses/delwin.c create mode 100644 usr.lib/libcurses/endwin.c create mode 100644 usr.lib/libcurses/erase.c create mode 100644 usr.lib/libcurses/fullname.c create mode 100644 usr.lib/libcurses/getch.c create mode 100644 usr.lib/libcurses/getstr.c create mode 100644 usr.lib/libcurses/id_subwins.c create mode 100644 usr.lib/libcurses/idlok.c create mode 100644 usr.lib/libcurses/initscr.c create mode 100644 usr.lib/libcurses/insch.c create mode 100644 usr.lib/libcurses/insertln.c create mode 100644 usr.lib/libcurses/longname.c create mode 100644 usr.lib/libcurses/move.c create mode 100644 usr.lib/libcurses/mvprintw.c create mode 100644 usr.lib/libcurses/mvscanw.c create mode 100644 usr.lib/libcurses/mvwin.c create mode 100644 usr.lib/libcurses/newwin.c create mode 100644 usr.lib/libcurses/overlay.c create mode 100644 usr.lib/libcurses/overwrite.c create mode 100644 usr.lib/libcurses/printw.c create mode 100644 usr.lib/libcurses/putchar.c create mode 100644 usr.lib/libcurses/refresh.c create mode 100644 usr.lib/libcurses/scanw.c create mode 100644 usr.lib/libcurses/scroll.c create mode 100644 usr.lib/libcurses/standout.c create mode 100644 usr.lib/libcurses/test.c create mode 100644 usr.lib/libcurses/toucholap.c create mode 100644 usr.lib/libcurses/touchwin.c create mode 100644 usr.lib/libcurses/tstp.c create mode 100644 usr.lib/libcurses/unctrl.c create mode 100644 usr.lib/libdbm/Makefile create mode 100644 usr.lib/libdbm/dbm.c create mode 100644 usr.lib/libdbm/dbm.h create mode 100644 usr.lib/liberrlst/Makefile create mode 100644 usr.lib/liberrlst/errlst.c create mode 100644 usr.lib/libident/INSTALL create mode 100644 usr.lib/libident/Makefile create mode 100644 usr.lib/libident/README create mode 100644 usr.lib/libident/id_close.c create mode 100644 usr.lib/libident/id_open.c create mode 100644 usr.lib/libident/id_parse.c create mode 100644 usr.lib/libident/id_query.c create mode 100644 usr.lib/libident/ident-tester.c create mode 100644 usr.lib/libident/ident.3 create mode 100644 usr.lib/libident/ident.c create mode 100644 usr.lib/libident/ident.h create mode 100644 usr.lib/libident/lookup-tester.c create mode 100644 usr.lib/libident/support.c create mode 100644 usr.lib/libident/version.c create mode 100644 usr.lib/libln/Makefile create mode 100644 usr.lib/libln/allprint.c create mode 100644 usr.lib/libln/main.c create mode 100644 usr.lib/libln/reject.c create mode 100644 usr.lib/libln/yyless.c create mode 100644 usr.lib/libln/yywrap.c create mode 100644 usr.lib/libmp/Makefile create mode 100644 usr.lib/libmp/gcd.c create mode 100644 usr.lib/libmp/madd.c create mode 100644 usr.lib/libmp/mdiv.c create mode 100644 usr.lib/libmp/mout.c create mode 100644 usr.lib/libmp/msqrt.c create mode 100644 usr.lib/libmp/mult.c create mode 100644 usr.lib/libmp/pow.c create mode 100644 usr.lib/libmp/util.c create mode 100644 usr.lib/libom/Makefile create mode 100644 usr.lib/libom/asin.c create mode 100644 usr.lib/libom/atan.c create mode 100644 usr.lib/libom/erf.c create mode 100644 usr.lib/libom/exp.c create mode 100644 usr.lib/libom/floor.c create mode 100644 usr.lib/libom/gamma.c create mode 100644 usr.lib/libom/hypot.c create mode 100644 usr.lib/libom/j0.c create mode 100644 usr.lib/libom/j1.c create mode 100644 usr.lib/libom/jn.c create mode 100644 usr.lib/libom/log.c create mode 100644 usr.lib/libom/pow.c create mode 100644 usr.lib/libom/sin.c create mode 100644 usr.lib/libom/sinh.c create mode 100644 usr.lib/libom/sqrt.c create mode 100644 usr.lib/libom/tan.c create mode 100644 usr.lib/libom/tanh.c create mode 100644 usr.lib/libplot/Makefile create mode 100644 usr.lib/libplot/aed/Makefile create mode 100644 usr.lib/libplot/aed/aed.h create mode 100644 usr.lib/libplot/aed/arc.c create mode 100644 usr.lib/libplot/aed/box.c create mode 100644 usr.lib/libplot/aed/circle.c create mode 100644 usr.lib/libplot/aed/close.c create mode 100644 usr.lib/libplot/aed/cont.c create mode 100644 usr.lib/libplot/aed/dot.c create mode 100644 usr.lib/libplot/aed/erase.c create mode 100644 usr.lib/libplot/aed/label.c create mode 100644 usr.lib/libplot/aed/line.c create mode 100644 usr.lib/libplot/aed/linemod.c create mode 100644 usr.lib/libplot/aed/move.c create mode 100644 usr.lib/libplot/aed/open.c create mode 100644 usr.lib/libplot/aed/point.c create mode 100644 usr.lib/libplot/aed/space.c create mode 100644 usr.lib/libplot/aed/subr.c create mode 100644 usr.lib/libplot/bitgraph/Makefile create mode 100644 usr.lib/libplot/bitgraph/arc.c create mode 100644 usr.lib/libplot/bitgraph/bg.h create mode 100644 usr.lib/libplot/bitgraph/box.c create mode 100644 usr.lib/libplot/bitgraph/circle.c create mode 100644 usr.lib/libplot/bitgraph/close.c create mode 100644 usr.lib/libplot/bitgraph/cont.c create mode 100644 usr.lib/libplot/bitgraph/dot.c create mode 100644 usr.lib/libplot/bitgraph/erase.c create mode 100644 usr.lib/libplot/bitgraph/label.c create mode 100644 usr.lib/libplot/bitgraph/line.c create mode 100644 usr.lib/libplot/bitgraph/linemod.c create mode 100644 usr.lib/libplot/bitgraph/move.c create mode 100644 usr.lib/libplot/bitgraph/open.c create mode 100644 usr.lib/libplot/bitgraph/point.c create mode 100644 usr.lib/libplot/bitgraph/space.c create mode 100644 usr.lib/libplot/dumb/Makefile create mode 100644 usr.lib/libplot/dumb/arc.c create mode 100644 usr.lib/libplot/dumb/box.c create mode 100644 usr.lib/libplot/dumb/circle.c create mode 100644 usr.lib/libplot/dumb/close.c create mode 100644 usr.lib/libplot/dumb/cont.c create mode 100644 usr.lib/libplot/dumb/dot.c create mode 100644 usr.lib/libplot/dumb/dumb.h create mode 100644 usr.lib/libplot/dumb/erase.c create mode 100644 usr.lib/libplot/dumb/label.c create mode 100644 usr.lib/libplot/dumb/line.c create mode 100644 usr.lib/libplot/dumb/linemod.c create mode 100644 usr.lib/libplot/dumb/move.c create mode 100644 usr.lib/libplot/dumb/open.c create mode 100644 usr.lib/libplot/dumb/point.c create mode 100644 usr.lib/libplot/dumb/space.c create mode 100644 usr.lib/libplot/dumb/subr.c create mode 100644 usr.lib/libplot/gigi/Makefile create mode 100644 usr.lib/libplot/gigi/arc.c create mode 100644 usr.lib/libplot/gigi/box.c create mode 100644 usr.lib/libplot/gigi/circle.c create mode 100644 usr.lib/libplot/gigi/close.c create mode 100644 usr.lib/libplot/gigi/cont.c create mode 100644 usr.lib/libplot/gigi/dot.c create mode 100644 usr.lib/libplot/gigi/erase.c create mode 100644 usr.lib/libplot/gigi/gigi.h create mode 100644 usr.lib/libplot/gigi/label.c create mode 100644 usr.lib/libplot/gigi/line.c create mode 100644 usr.lib/libplot/gigi/linemod.c create mode 100644 usr.lib/libplot/gigi/move.c create mode 100644 usr.lib/libplot/gigi/open.c create mode 100644 usr.lib/libplot/gigi/point.c create mode 100644 usr.lib/libplot/gigi/space.c create mode 100644 usr.lib/libplot/hp2648/Makefile create mode 100644 usr.lib/libplot/hp2648/arc.c create mode 100644 usr.lib/libplot/hp2648/box.c create mode 100644 usr.lib/libplot/hp2648/circle.c create mode 100644 usr.lib/libplot/hp2648/close.c create mode 100644 usr.lib/libplot/hp2648/cont.c create mode 100644 usr.lib/libplot/hp2648/dot.c create mode 100644 usr.lib/libplot/hp2648/erase.c create mode 100644 usr.lib/libplot/hp2648/hp2648.h create mode 100644 usr.lib/libplot/hp2648/label.c create mode 100644 usr.lib/libplot/hp2648/line.c create mode 100644 usr.lib/libplot/hp2648/linemod.c create mode 100644 usr.lib/libplot/hp2648/move.c create mode 100644 usr.lib/libplot/hp2648/open.c create mode 100644 usr.lib/libplot/hp2648/point.c create mode 100644 usr.lib/libplot/hp2648/space.c create mode 100644 usr.lib/libplot/hp2648/subr.c create mode 100644 usr.lib/libplot/hp7221/Makefile create mode 100644 usr.lib/libplot/hp7221/arc.c create mode 100644 usr.lib/libplot/hp7221/box.c create mode 100644 usr.lib/libplot/hp7221/circle.c create mode 100644 usr.lib/libplot/hp7221/close.c create mode 100644 usr.lib/libplot/hp7221/cont.c create mode 100644 usr.lib/libplot/hp7221/dot.c create mode 100644 usr.lib/libplot/hp7221/erase.c create mode 100644 usr.lib/libplot/hp7221/hp7221.h create mode 100644 usr.lib/libplot/hp7221/label.c create mode 100644 usr.lib/libplot/hp7221/line.c create mode 100644 usr.lib/libplot/hp7221/linemod.c create mode 100644 usr.lib/libplot/hp7221/move.c create mode 100644 usr.lib/libplot/hp7221/open.c create mode 100644 usr.lib/libplot/hp7221/point.c create mode 100644 usr.lib/libplot/hp7221/space.c create mode 100644 usr.lib/libplot/hp7221/subr.c create mode 100644 usr.lib/libplot/imagen/Makefile create mode 100644 usr.lib/libplot/imagen/arc.c create mode 100644 usr.lib/libplot/imagen/box.c create mode 100644 usr.lib/libplot/imagen/charset.c create mode 100644 usr.lib/libplot/imagen/circle.c create mode 100644 usr.lib/libplot/imagen/close.c create mode 100644 usr.lib/libplot/imagen/cont.c create mode 100644 usr.lib/libplot/imagen/dot.c create mode 100644 usr.lib/libplot/imagen/erase.c create mode 100644 usr.lib/libplot/imagen/imPcodes.h create mode 100644 usr.lib/libplot/imagen/imp.h create mode 100644 usr.lib/libplot/imagen/label.c create mode 100644 usr.lib/libplot/imagen/line.c create mode 100644 usr.lib/libplot/imagen/linemod.c create mode 100644 usr.lib/libplot/imagen/move.c create mode 100644 usr.lib/libplot/imagen/open.c create mode 100644 usr.lib/libplot/imagen/point.c create mode 100644 usr.lib/libplot/imagen/scale.c create mode 100644 usr.lib/libplot/imagen/space.c create mode 100644 usr.lib/libplot/plot/Makefile create mode 100644 usr.lib/libplot/plot/arc.c create mode 100644 usr.lib/libplot/plot/box.c create mode 100644 usr.lib/libplot/plot/circle.c create mode 100644 usr.lib/libplot/plot/close.c create mode 100644 usr.lib/libplot/plot/cont.c create mode 100644 usr.lib/libplot/plot/dot.c create mode 100644 usr.lib/libplot/plot/erase.c create mode 100644 usr.lib/libplot/plot/label.c create mode 100644 usr.lib/libplot/plot/line.c create mode 100644 usr.lib/libplot/plot/linmod.c create mode 100644 usr.lib/libplot/plot/move.c create mode 100644 usr.lib/libplot/plot/open.c create mode 100644 usr.lib/libplot/plot/point.c create mode 100644 usr.lib/libplot/plot/putsi.c create mode 100644 usr.lib/libplot/plot/space.c create mode 100644 usr.lib/libplot/t300/Makefile create mode 100644 usr.lib/libplot/t300/arc.c create mode 100644 usr.lib/libplot/t300/box.c create mode 100644 usr.lib/libplot/t300/circle.c create mode 100644 usr.lib/libplot/t300/close.c create mode 100644 usr.lib/libplot/t300/con.h create mode 100644 usr.lib/libplot/t300/dot.c create mode 100644 usr.lib/libplot/t300/erase.c create mode 100644 usr.lib/libplot/t300/label.c create mode 100644 usr.lib/libplot/t300/line.c create mode 100644 usr.lib/libplot/t300/linmod.c create mode 100644 usr.lib/libplot/t300/move.c create mode 100644 usr.lib/libplot/t300/open.c create mode 100644 usr.lib/libplot/t300/point.c create mode 100644 usr.lib/libplot/t300/space.c create mode 100644 usr.lib/libplot/t300/subr.c create mode 100644 usr.lib/libplot/t300s/Makefile create mode 100644 usr.lib/libplot/t300s/arc.c create mode 100644 usr.lib/libplot/t300s/box.c create mode 100644 usr.lib/libplot/t300s/circle.c create mode 100644 usr.lib/libplot/t300s/close.c create mode 100644 usr.lib/libplot/t300s/con.h create mode 100644 usr.lib/libplot/t300s/dot.c create mode 100644 usr.lib/libplot/t300s/erase.c create mode 100644 usr.lib/libplot/t300s/label.c create mode 100644 usr.lib/libplot/t300s/line.c create mode 100644 usr.lib/libplot/t300s/linmod.c create mode 100644 usr.lib/libplot/t300s/move.c create mode 100644 usr.lib/libplot/t300s/open.c create mode 100644 usr.lib/libplot/t300s/point.c create mode 100644 usr.lib/libplot/t300s/space.c create mode 100644 usr.lib/libplot/t300s/subr.c create mode 100644 usr.lib/libplot/t4013/Makefile create mode 100644 usr.lib/libplot/t4013/arc.c create mode 100644 usr.lib/libplot/t4013/box.c create mode 100644 usr.lib/libplot/t4013/circle.c create mode 100644 usr.lib/libplot/t4013/close.c create mode 100644 usr.lib/libplot/t4013/dot.c create mode 100644 usr.lib/libplot/t4013/erase.c create mode 100644 usr.lib/libplot/t4013/label.c create mode 100644 usr.lib/libplot/t4013/line.c create mode 100644 usr.lib/libplot/t4013/linemod.c create mode 100644 usr.lib/libplot/t4013/move.c create mode 100644 usr.lib/libplot/t4013/open.c create mode 100644 usr.lib/libplot/t4013/point.c create mode 100644 usr.lib/libplot/t4013/scale.c create mode 100644 usr.lib/libplot/t4013/space.c create mode 100644 usr.lib/libplot/t4013/subr.c create mode 100644 usr.lib/libplot/t4014/Makefile create mode 100644 usr.lib/libplot/t4014/arc.c create mode 100644 usr.lib/libplot/t4014/box.c create mode 100644 usr.lib/libplot/t4014/circle.c create mode 100644 usr.lib/libplot/t4014/close.c create mode 100644 usr.lib/libplot/t4014/dot.c create mode 100644 usr.lib/libplot/t4014/erase.c create mode 100644 usr.lib/libplot/t4014/label.c create mode 100644 usr.lib/libplot/t4014/line.c create mode 100644 usr.lib/libplot/t4014/linemod.c create mode 100644 usr.lib/libplot/t4014/move.c create mode 100644 usr.lib/libplot/t4014/open.c create mode 100644 usr.lib/libplot/t4014/point.c create mode 100644 usr.lib/libplot/t4014/scale.c create mode 100644 usr.lib/libplot/t4014/space.c create mode 100644 usr.lib/libplot/t4014/subr.c create mode 100644 usr.lib/libplot/t450/Makefile create mode 100644 usr.lib/libplot/t450/arc.c create mode 100644 usr.lib/libplot/t450/box.c create mode 100644 usr.lib/libplot/t450/circle.c create mode 100644 usr.lib/libplot/t450/close.c create mode 100644 usr.lib/libplot/t450/con.h create mode 100644 usr.lib/libplot/t450/dot.c create mode 100644 usr.lib/libplot/t450/erase.c create mode 100644 usr.lib/libplot/t450/label.c create mode 100644 usr.lib/libplot/t450/line.c create mode 100644 usr.lib/libplot/t450/linmod.c create mode 100644 usr.lib/libplot/t450/move.c create mode 100644 usr.lib/libplot/t450/open.c create mode 100644 usr.lib/libplot/t450/point.c create mode 100644 usr.lib/libplot/t450/space.c create mode 100644 usr.lib/libplot/t450/subr.c create mode 100644 usr.lib/libplot/tf77/Makefile create mode 100644 usr.lib/libplot/tf77/arc.c create mode 100644 usr.lib/libplot/tf77/box.c create mode 100644 usr.lib/libplot/tf77/circle.c create mode 100644 usr.lib/libplot/tf77/clospl.c create mode 100644 usr.lib/libplot/tf77/cont.c create mode 100644 usr.lib/libplot/tf77/dot.c create mode 100644 usr.lib/libplot/tf77/erase.c create mode 100644 usr.lib/libplot/tf77/label.c create mode 100644 usr.lib/libplot/tf77/line.c create mode 100644 usr.lib/libplot/tf77/linemd.c create mode 100644 usr.lib/libplot/tf77/move.c create mode 100644 usr.lib/libplot/tf77/open.c create mode 100644 usr.lib/libplot/tf77/point.c create mode 100644 usr.lib/libplot/tf77/space.c create mode 100644 usr.lib/libplot/vt0/Makefile create mode 100644 usr.lib/libplot/vt0/arc.c create mode 100644 usr.lib/libplot/vt0/box.c create mode 100644 usr.lib/libplot/vt0/circle.c create mode 100644 usr.lib/libplot/vt0/close.c create mode 100644 usr.lib/libplot/vt0/dot.c create mode 100644 usr.lib/libplot/vt0/erase.c create mode 100644 usr.lib/libplot/vt0/frame.c create mode 100644 usr.lib/libplot/vt0/label.c create mode 100644 usr.lib/libplot/vt0/line.c create mode 100644 usr.lib/libplot/vt0/linmod.c create mode 100644 usr.lib/libplot/vt0/move.c create mode 100644 usr.lib/libplot/vt0/open.c create mode 100644 usr.lib/libplot/vt0/point.c create mode 100644 usr.lib/libplot/vt0/space.c create mode 100644 usr.lib/libplot/vt0/subr.c create mode 100644 usr.lib/libstubs/Makefile create mode 100644 usr.lib/libstubs/stubs.c create mode 100644 usr.lib/libstubs/stubtest.c create mode 100644 usr.lib/libtermlib/Makefile create mode 100644 usr.lib/libtermlib/tc1.c create mode 100644 usr.lib/libtermlib/tc2.c create mode 100644 usr.lib/libtermlib/tc3.c create mode 100644 usr.lib/libtermlib/termcap.c create mode 100644 usr.lib/libtermlib/tgoto.c create mode 100644 usr.lib/libtermlib/tputs.c create mode 100644 usr.lib/libutil/Makefile create mode 100644 usr.lib/libutil/dkcksum.c create mode 100644 usr.lib/libutil/login.c create mode 100644 usr.lib/libutil/logout.c create mode 100644 usr.lib/libutil/logwtmp.c create mode 100644 usr.lib/libutil/pathnames.h create mode 100644 usr.lib/libvmf/makefile create mode 100644 usr.lib/libvmf/vmf.3 create mode 100644 usr.lib/libvmf/vmf.c create mode 100644 usr.lib/libvmf/vmlib.ms create mode 100644 usr.lib/liby/Makefile create mode 100644 usr.lib/liby/libmai.c create mode 100644 usr.lib/liby/libzer.c create mode 100644 usr.sbin/Makefile create mode 100644 usr.sbin/PORT/XNSrouted.tar.Z create mode 100644 usr.sbin/PORT/bad144.c.Z create mode 100644 usr.sbin/PORT/badsect.c.Z create mode 100644 usr.sbin/PORT/diskpart.c.Z create mode 100644 usr.sbin/PORT/dump.tar.Z create mode 100644 usr.sbin/PORT/implog.tar.Z create mode 100644 usr.sbin/PORT/kgmon.c.Z create mode 100644 usr.sbin/PORT/restore.tar.Z create mode 100644 usr.sbin/ac/Makefile create mode 100644 usr.sbin/ac/ac.8 create mode 100644 usr.sbin/ac/ac.c create mode 100644 usr.sbin/accton/Makefile create mode 100644 usr.sbin/accton/accton.8 create mode 100644 usr.sbin/accton/accton.c create mode 100644 usr.sbin/arff/Makefile create mode 100644 usr.sbin/arff/arff.8 create mode 100644 usr.sbin/arff/arff.c create mode 100644 usr.sbin/arp/Makefile create mode 100644 usr.sbin/arp/arp.8 create mode 100644 usr.sbin/arp/arp.c create mode 100644 usr.sbin/bad144/Makefile create mode 100644 usr.sbin/bad144/bad144.8 create mode 100644 usr.sbin/bad144/bad144.c create mode 100644 usr.sbin/catman/Makefile create mode 100644 usr.sbin/catman/catman.8 create mode 100644 usr.sbin/catman/catman.c create mode 100644 usr.sbin/chown/Makefile create mode 100644 usr.sbin/chown/chown.8 create mode 100644 usr.sbin/chown/chown.c create mode 100644 usr.sbin/chroot/Makefile create mode 100644 usr.sbin/chroot/chroot.8 create mode 100644 usr.sbin/chroot/chroot.c create mode 100644 usr.sbin/chroot/pathnames.h create mode 100644 usr.sbin/config/Makefile create mode 100644 usr.sbin/config/config.c create mode 100644 usr.sbin/cron/Makefile create mode 100644 usr.sbin/cron/README create mode 100644 usr.sbin/cron/README.2BSD create mode 100644 usr.sbin/cron/bitstring.3 create mode 100644 usr.sbin/cron/bitstring.h create mode 100644 usr.sbin/cron/compat.c create mode 100644 usr.sbin/cron/compat.h create mode 100644 usr.sbin/cron/config.h create mode 100644 usr.sbin/cron/cron.8 create mode 100644 usr.sbin/cron/cron.c create mode 100644 usr.sbin/cron/cron.h create mode 100644 usr.sbin/cron/crontab.1 create mode 100644 usr.sbin/cron/crontab.5 create mode 100644 usr.sbin/cron/crontab.c create mode 100644 usr.sbin/cron/database.c create mode 100644 usr.sbin/cron/do_command.c create mode 100644 usr.sbin/cron/entry.c create mode 100644 usr.sbin/cron/env.c create mode 100644 usr.sbin/cron/externs.h create mode 100644 usr.sbin/cron/grot/CHANGES create mode 100644 usr.sbin/cron/grot/CONVERSION create mode 100644 usr.sbin/cron/grot/FEATURES create mode 100644 usr.sbin/cron/grot/INSTALL create mode 100644 usr.sbin/cron/grot/MAIL create mode 100644 usr.sbin/cron/grot/MANIFEST create mode 100644 usr.sbin/cron/grot/THANKS create mode 100644 usr.sbin/cron/grot/diffs create mode 100644 usr.sbin/cron/job.c create mode 100644 usr.sbin/cron/misc.c create mode 100644 usr.sbin/cron/pathnames.h create mode 100644 usr.sbin/cron/popen.c create mode 100644 usr.sbin/cron/putman.sh create mode 100644 usr.sbin/cron/user.c create mode 100644 usr.sbin/dev_mkdb/Makefile create mode 100644 usr.sbin/dev_mkdb/dev_mkdb.8 create mode 100644 usr.sbin/dev_mkdb/dev_mkdb.c create mode 100644 usr.sbin/diskpart/Makefile create mode 100644 usr.sbin/diskpart/diskpart.8 create mode 100644 usr.sbin/diskpart/diskpart.c create mode 100644 usr.sbin/edquota/Makefile create mode 100644 usr.sbin/edquota/edquota.8 create mode 100644 usr.sbin/edquota/edquota.c create mode 100644 usr.sbin/flcopy/Makefile create mode 100644 usr.sbin/flcopy/flcopy.c create mode 100644 usr.sbin/gettable/Makefile create mode 100644 usr.sbin/gettable/gettable.8 create mode 100644 usr.sbin/gettable/gettable.c create mode 100644 usr.sbin/htable/Makefile create mode 100644 usr.sbin/htable/hosts create mode 100644 usr.sbin/htable/htable.c create mode 100644 usr.sbin/htable/htable.h create mode 100644 usr.sbin/htable/localgateways create mode 100644 usr.sbin/htable/localhosts create mode 100644 usr.sbin/htable/localnetworks create mode 100644 usr.sbin/htable/parse.y create mode 100644 usr.sbin/htable/scan.l create mode 100644 usr.sbin/implog/Makefile create mode 100644 usr.sbin/implog/implog.8 create mode 100644 usr.sbin/implog/implog.c create mode 100644 usr.sbin/implogd/Makefile create mode 100644 usr.sbin/implogd/implogd.8 create mode 100644 usr.sbin/implogd/implogd.c create mode 100644 usr.sbin/inetd/Makefile create mode 100644 usr.sbin/inetd/inetd.8 create mode 100644 usr.sbin/inetd/inetd.c create mode 100644 usr.sbin/inetd/pathnames.h create mode 100644 usr.sbin/kgmon/Makefile create mode 100644 usr.sbin/kgmon/kgmon.8 create mode 100644 usr.sbin/kgmon/kgmon.c create mode 100644 usr.sbin/lpr/Makefile create mode 100644 usr.sbin/lpr/cmds.c create mode 100644 usr.sbin/lpr/cmdtab.c create mode 100644 usr.sbin/lpr/common.c create mode 100644 usr.sbin/lpr/displayq.c create mode 100644 usr.sbin/lpr/etc.printcap create mode 100644 usr.sbin/lpr/filters/Makefile create mode 100644 usr.sbin/lpr/filters/README create mode 100644 usr.sbin/lpr/filters/chrtab.c create mode 100644 usr.sbin/lpr/filters/fcvt.c create mode 100644 usr.sbin/lpr/filters/lpf.c create mode 100644 usr.sbin/lpr/filters/necf.c create mode 100644 usr.sbin/lpr/filters/railmag.c create mode 100644 usr.sbin/lpr/filters/rotate.c create mode 100644 usr.sbin/lpr/filters/rotprt.c create mode 100644 usr.sbin/lpr/filters/rvcat.c create mode 100644 usr.sbin/lpr/filters/rvsort.c create mode 100644 usr.sbin/lpr/filters/vcat.c create mode 100644 usr.sbin/lpr/filters/vdmp.c create mode 100644 usr.sbin/lpr/filters/vfontinfo.c create mode 100644 usr.sbin/lpr/filters/vfw.c create mode 100644 usr.sbin/lpr/filters/vpf.c create mode 100644 usr.sbin/lpr/filters/vplotf.c create mode 100644 usr.sbin/lpr/filters/vpltdmp.c create mode 100644 usr.sbin/lpr/filters/vpsf.c create mode 100644 usr.sbin/lpr/filters/vsort.c create mode 100644 usr.sbin/lpr/filters/vwidth.c create mode 100644 usr.sbin/lpr/lp.h create mode 100644 usr.sbin/lpr/lp.local.h create mode 100644 usr.sbin/lpr/lpc.c create mode 100644 usr.sbin/lpr/lpc.h create mode 100644 usr.sbin/lpr/lpd.c create mode 100644 usr.sbin/lpr/lpdchar.c create mode 100644 usr.sbin/lpr/lpq.c create mode 100644 usr.sbin/lpr/lpr.c create mode 100644 usr.sbin/lpr/lprm.c create mode 100644 usr.sbin/lpr/lptest.c create mode 100644 usr.sbin/lpr/pac.c create mode 100644 usr.sbin/lpr/printcap.c create mode 100644 usr.sbin/lpr/printjob.c create mode 100644 usr.sbin/lpr/recvjob.c create mode 100644 usr.sbin/lpr/rmjob.c create mode 100644 usr.sbin/lpr/startdaemon.c create mode 100644 usr.sbin/makewhatis/Makefile create mode 100644 usr.sbin/makewhatis/makewhatis.sh create mode 100644 usr.sbin/mkhosts/Makefile create mode 100644 usr.sbin/mkhosts/mkhosts.8 create mode 100644 usr.sbin/mkhosts/mkhosts.c create mode 100644 usr.sbin/mklost+found/Makefile create mode 100644 usr.sbin/mklost+found/mklost+found.8 create mode 100644 usr.sbin/mklost+found/mklost+found.sh create mode 100644 usr.sbin/mkproto/Makefile create mode 100644 usr.sbin/mkproto/mkproto.8 create mode 100644 usr.sbin/mkproto/mkproto.c create mode 100644 usr.sbin/named/CHANGES create mode 100644 usr.sbin/named/Makefile create mode 100644 usr.sbin/named/README create mode 100644 usr.sbin/named/doc/rfc1032.lpr create mode 100644 usr.sbin/named/doc/rfc1033.lpr create mode 100644 usr.sbin/named/doc/rfc1034.lpr create mode 100644 usr.sbin/named/doc/rfc1035.lpr create mode 100644 usr.sbin/named/doc/rfc920.lpr create mode 100644 usr.sbin/named/doc/rfc974.lpr create mode 100644 usr.sbin/named/master/:pwedit create mode 100644 usr.sbin/named/master/Index create mode 100644 usr.sbin/named/master/README create mode 100644 usr.sbin/named/master/atod.y create mode 100644 usr.sbin/named/master/named.boot create mode 100644 usr.sbin/named/master/named.boot.mas create mode 100644 usr.sbin/named/master/named.hosts create mode 100644 usr.sbin/named/master/named.local create mode 100644 usr.sbin/named/master/named.rev create mode 100644 usr.sbin/named/master/root.cache create mode 100644 usr.sbin/named/named/Makefile create mode 100644 usr.sbin/named/named/Version.c create mode 100644 usr.sbin/named/named/databuf create mode 100644 usr.sbin/named/named/databufs create mode 100644 usr.sbin/named/named/db.h create mode 100644 usr.sbin/named/named/db_dump.c create mode 100644 usr.sbin/named/named/db_load.c create mode 100644 usr.sbin/named/named/db_lookup.c create mode 100644 usr.sbin/named/named/db_reload.c create mode 100644 usr.sbin/named/named/db_save.c create mode 100644 usr.sbin/named/named/db_update.c create mode 100644 usr.sbin/named/named/namebuf create mode 100755 usr.sbin/named/named/named.reload create mode 100755 usr.sbin/named/named/named.restart create mode 100644 usr.sbin/named/named/newvers.sh create mode 100644 usr.sbin/named/named/ns.h create mode 100644 usr.sbin/named/named/ns_forw.c create mode 100644 usr.sbin/named/named/ns_init.c create mode 100644 usr.sbin/named/named/ns_main.c create mode 100644 usr.sbin/named/named/ns_maint.c create mode 100644 usr.sbin/named/named/ns_req.c create mode 100644 usr.sbin/named/named/ns_resp.c create mode 100644 usr.sbin/named/named/ns_sort.c create mode 100644 usr.sbin/named/named/ns_stats.c create mode 100644 usr.sbin/named/named/storage.c create mode 100644 usr.sbin/named/named/version create mode 100644 usr.sbin/named/tools/Makefile create mode 100644 usr.sbin/named/tools/nslookup/Makefile create mode 100644 usr.sbin/named/tools/nslookup/commands.l create mode 100644 usr.sbin/named/tools/nslookup/debug.c create mode 100644 usr.sbin/named/tools/nslookup/getinfo.c create mode 100644 usr.sbin/named/tools/nslookup/list.c create mode 100644 usr.sbin/named/tools/nslookup/main.c create mode 100644 usr.sbin/named/tools/nslookup/nslookup.8 create mode 100644 usr.sbin/named/tools/nslookup/nslookup.help create mode 100644 usr.sbin/named/tools/nslookup/pathnames.h create mode 100644 usr.sbin/named/tools/nslookup/res.h create mode 100644 usr.sbin/named/tools/nslookup/res_debug.c create mode 100644 usr.sbin/named/tools/nslookup/send.c create mode 100644 usr.sbin/named/tools/nslookup/skip.c create mode 100644 usr.sbin/named/tools/nslookup/subr.c create mode 100644 usr.sbin/named/tools/nsquery.c create mode 100644 usr.sbin/named/tools/nstest.c create mode 100644 usr.sbin/ntp/Makefile create mode 100644 usr.sbin/ntp/README create mode 100755 usr.sbin/ntp/extract.pl create mode 100644 usr.sbin/ntp/man/Makefile create mode 100644 usr.sbin/ntp/man/clock.txt create mode 100644 usr.sbin/ntp/man/loop.c create mode 100644 usr.sbin/ntp/man/ntp.8 create mode 100644 usr.sbin/ntp/man/ntpd.8 create mode 100644 usr.sbin/ntp/man/ntpdc.8 create mode 100644 usr.sbin/ntp/ntp.c create mode 100644 usr.sbin/ntp/ntp.conf create mode 100644 usr.sbin/ntp/ntp.h create mode 100644 usr.sbin/ntp/ntp_adjust.c create mode 100644 usr.sbin/ntp/ntp_proto.c create mode 100644 usr.sbin/ntp/ntp_sock.c create mode 100644 usr.sbin/ntp/ntpd.c create mode 100644 usr.sbin/ntp/ntpdc.c create mode 100644 usr.sbin/ntp/ntpsubs.c create mode 100644 usr.sbin/ntp/patchl create mode 100644 usr.sbin/ntp/patchlevel.h create mode 100644 usr.sbin/ntp/read_local.c create mode 100644 usr.sbin/ntp/read_psti.c create mode 100644 usr.sbin/ntp/stat.pl create mode 100644 usr.sbin/ntp/test.c create mode 100644 usr.sbin/pstat/Makefile create mode 100644 usr.sbin/pstat/pstat.8 create mode 100644 usr.sbin/pstat/pstat.c create mode 100644 usr.sbin/quot/Makefile create mode 100644 usr.sbin/quot/quot.8 create mode 100644 usr.sbin/quot/quot.c create mode 100644 usr.sbin/quotaon/Makefile create mode 100644 usr.sbin/quotaon/quotaon.8 create mode 100644 usr.sbin/quotaon/quotaon.c create mode 100644 usr.sbin/repquota/Makefile create mode 100644 usr.sbin/repquota/repquota.8 create mode 100644 usr.sbin/repquota/repquota.c create mode 100644 usr.sbin/rmt/Makefile create mode 100644 usr.sbin/rmt/rmt.8 create mode 100644 usr.sbin/rmt/rmt.c create mode 100644 usr.sbin/rwhod/Makefile create mode 100644 usr.sbin/rwhod/rwhod.8 create mode 100644 usr.sbin/rwhod/rwhod.c create mode 100644 usr.sbin/rxformat/Makefile create mode 100644 usr.sbin/rxformat/rxformat.8 create mode 100644 usr.sbin/rxformat/rxformat.c create mode 100644 usr.sbin/sa/Makefile create mode 100644 usr.sbin/sa/sa.8 create mode 100644 usr.sbin/sa/sa.c create mode 100644 usr.sbin/sendmail.MX/Makefile create mode 100644 usr.sbin/sendmail.MX/READ_ME create mode 100644 usr.sbin/sendmail.MX/adb/event create mode 100644 usr.sbin/sendmail.MX/adb/event2 create mode 100644 usr.sbin/sendmail.MX/adm/SU.LOG create mode 100644 usr.sbin/sendmail.MX/adm/TODO create mode 100644 usr.sbin/sendmail.MX/adm/TraceFlags create mode 100644 usr.sbin/sendmail.MX/adm/cbosgd.sl create mode 100644 usr.sbin/sendmail.MX/adm/csvax.m4 create mode 100644 usr.sbin/sendmail.MX/adm/ingvax.m4 create mode 100644 usr.sbin/sendmail.MX/adm/jek.sl create mode 100644 usr.sbin/sendmail.MX/adm/kim.m4 create mode 100644 usr.sbin/sendmail.MX/adm/mh.cf.m4 create mode 100644 usr.sbin/sendmail.MX/adm/mh.whoami.m4 create mode 100644 usr.sbin/sendmail.MX/adm/sl.sed create mode 100644 usr.sbin/sendmail.MX/aux/Makefile create mode 100644 usr.sbin/sendmail.MX/aux/addr.c create mode 100644 usr.sbin/sendmail.MX/aux/arpa.c create mode 100644 usr.sbin/sendmail.MX/aux/bbn_daemon.c create mode 100644 usr.sbin/sendmail.MX/aux/delivermail.sh create mode 100644 usr.sbin/sendmail.MX/aux/mail-dm.c create mode 100644 usr.sbin/sendmail.MX/aux/mailstats.c create mode 100644 usr.sbin/sendmail.MX/aux/matchhdr.c create mode 100644 usr.sbin/sendmail.MX/aux/mconnect.c create mode 100644 usr.sbin/sendmail.MX/aux/newaliases.c create mode 100644 usr.sbin/sendmail.MX/aux/praliases.c create mode 120000 usr.sbin/sendmail.MX/cf create mode 100644 usr.sbin/sendmail.MX/cf.hosttable/KEY create mode 100644 usr.sbin/sendmail.MX/cf.hosttable/Makefile create mode 100644 usr.sbin/sendmail.MX/cf.hosttable/NEW/base.m4 create mode 100644 usr.sbin/sendmail.MX/cf.hosttable/NEW/ucbvax.mc create mode 100644 usr.sbin/sendmail.MX/cf.hosttable/NEW/uucpm.m4 create mode 100644 usr.sbin/sendmail.MX/cf.hosttable/TestMatrix create mode 100644 usr.sbin/sendmail.MX/cf.hosttable/arpa.mc create mode 100644 usr.sbin/sendmail.MX/cf.hosttable/arpaproto.mc create mode 100644 usr.sbin/sendmail.MX/cf.hosttable/base.m4 create mode 100644 usr.sbin/sendmail.MX/cf.hosttable/berkhosts.m4 create mode 100644 usr.sbin/sendmail.MX/cf.hosttable/berkm.m4 create mode 100644 usr.sbin/sendmail.MX/cf.hosttable/calder.mc create mode 100644 usr.sbin/sendmail.MX/cf.hosttable/ccbase.m4 create mode 100644 usr.sbin/sendmail.MX/cf.hosttable/cchosts.m4 create mode 100644 usr.sbin/sendmail.MX/cf.hosttable/cogsci.mc create mode 100644 usr.sbin/sendmail.MX/cf.hosttable/compat.m4 create mode 100644 usr.sbin/sendmail.MX/cf.hosttable/csbase.m4 create mode 100644 usr.sbin/sendmail.MX/cf.hosttable/csether.mc create mode 100644 usr.sbin/sendmail.MX/cf.hosttable/dali.mc create mode 100644 usr.sbin/sendmail.MX/cf.hosttable/degas.mc create mode 100644 usr.sbin/sendmail.MX/cf.hosttable/ernie.mc create mode 100644 usr.sbin/sendmail.MX/cf.hosttable/ether.m4 create mode 100644 usr.sbin/sendmail.MX/cf.hosttable/etherm.m4 create mode 100644 usr.sbin/sendmail.MX/cf.hosttable/fncpm.m4 create mode 100644 usr.sbin/sendmail.MX/cf.hosttable/fudge.m4 create mode 100644 usr.sbin/sendmail.MX/cf.hosttable/guessing create mode 100644 usr.sbin/sendmail.MX/cf.hosttable/ibmm.m4 create mode 100644 usr.sbin/sendmail.MX/cf.hosttable/ji.mc create mode 100644 usr.sbin/sendmail.MX/cf.hosttable/kim.mc create mode 100644 usr.sbin/sendmail.MX/cf.hosttable/lanleaf.mc create mode 100644 usr.sbin/sendmail.MX/cf.hosttable/lanroot.mc create mode 100644 usr.sbin/sendmail.MX/cf.hosttable/localm.m4 create mode 100644 usr.sbin/sendmail.MX/cf.hosttable/matisse.mc create mode 100644 usr.sbin/sendmail.MX/cf.hosttable/miro.mc create mode 100644 usr.sbin/sendmail.MX/cf.hosttable/mmdfm.m4 create mode 100644 usr.sbin/sendmail.MX/cf.hosttable/monet.mc create mode 100644 usr.sbin/sendmail.MX/cf.hosttable/ncpm.m4 create mode 100644 usr.sbin/sendmail.MX/cf.hosttable/okeeffe.mc create mode 100644 usr.sbin/sendmail.MX/cf.hosttable/renoir.mc create mode 100644 usr.sbin/sendmail.MX/cf.hosttable/suucpm.m4 create mode 100644 usr.sbin/sendmail.MX/cf.hosttable/tcphosts.m4 create mode 100644 usr.sbin/sendmail.MX/cf.hosttable/tcpm.m4 create mode 100644 usr.sbin/sendmail.MX/cf.hosttable/ucbvax.mc create mode 100644 usr.sbin/sendmail.MX/cf.hosttable/uucpm.m4 create mode 100644 usr.sbin/sendmail.MX/cf.hosttable/uucpproto.mc create mode 100644 usr.sbin/sendmail.MX/cf.hosttable/version.m4 create mode 100644 usr.sbin/sendmail.MX/cf.hosttable/zerobase.m4 create mode 100644 usr.sbin/sendmail.MX/doc/Makefile create mode 100644 usr.sbin/sendmail.MX/doc/abstract create mode 100644 usr.sbin/sendmail.MX/doc/diagram create mode 100644 usr.sbin/sendmail.MX/doc/refs create mode 100644 usr.sbin/sendmail.MX/doc/rfc819.lpr create mode 100644 usr.sbin/sendmail.MX/doc/rfc821.lpr create mode 100644 usr.sbin/sendmail.MX/doc/rfc822.lpr create mode 100644 usr.sbin/sendmail.MX/doc/spell.good create mode 100644 usr.sbin/sendmail.MX/doc/usenix create mode 100644 usr.sbin/sendmail.MX/doc/usenix.me create mode 100644 usr.sbin/sendmail.MX/include/asm.sed create mode 100644 usr.sbin/sendmail.MX/include/asm.sed.pdp create mode 100644 usr.sbin/sendmail.MX/include/asm.sed.vax create mode 100644 usr.sbin/sendmail.MX/include/useful.h create mode 100644 usr.sbin/sendmail.MX/include/userdbm.h create mode 100644 usr.sbin/sendmail.MX/lib/Makefile create mode 100644 usr.sbin/sendmail.MX/lib/aliases create mode 100644 usr.sbin/sendmail.MX/lib/sendmail.hf create mode 100644 usr.sbin/sendmail.MX/md/c.nvmunix.m4 create mode 100644 usr.sbin/sendmail.MX/md/c.v6.m4 create mode 100644 usr.sbin/sendmail.MX/md/c.v7.m4 create mode 100644 usr.sbin/sendmail.MX/md/c.vmunix.m4 create mode 100644 usr.sbin/sendmail.MX/md/config.dst create mode 100644 usr.sbin/sendmail.MX/md/config.m4 create mode 100644 usr.sbin/sendmail.MX/md/config.m4.mone create mode 100644 usr.sbin/sendmail.MX/src/Makefile create mode 100644 usr.sbin/sendmail.MX/src/READ_ME create mode 100644 usr.sbin/sendmail.MX/src/TODO create mode 100644 usr.sbin/sendmail.MX/src/Version.c create mode 100644 usr.sbin/sendmail.MX/src/alias.c create mode 100644 usr.sbin/sendmail.MX/src/arpadate.c create mode 100644 usr.sbin/sendmail.MX/src/clock.c create mode 100644 usr.sbin/sendmail.MX/src/collect.c create mode 100644 usr.sbin/sendmail.MX/src/conf.c create mode 100644 usr.sbin/sendmail.MX/src/conf.h create mode 100644 usr.sbin/sendmail.MX/src/convtime.c create mode 100644 usr.sbin/sendmail.MX/src/daemon.c create mode 100644 usr.sbin/sendmail.MX/src/deliver.c create mode 100644 usr.sbin/sendmail.MX/src/domain.c create mode 100644 usr.sbin/sendmail.MX/src/envelope.c create mode 100644 usr.sbin/sendmail.MX/src/err.c create mode 100644 usr.sbin/sendmail.MX/src/extract.c create mode 100644 usr.sbin/sendmail.MX/src/headers.c create mode 100644 usr.sbin/sendmail.MX/src/macro.c create mode 100644 usr.sbin/sendmail.MX/src/mailstats.h create mode 100644 usr.sbin/sendmail.MX/src/main.c create mode 100755 usr.sbin/sendmail.MX/src/mkstrcc create mode 100644 usr.sbin/sendmail.MX/src/parseaddr.c create mode 100644 usr.sbin/sendmail.MX/src/queue.c create mode 100644 usr.sbin/sendmail.MX/src/readcf.c create mode 100644 usr.sbin/sendmail.MX/src/recipient.c create mode 100644 usr.sbin/sendmail.MX/src/savemail.c create mode 100644 usr.sbin/sendmail.MX/src/sendmail.h create mode 100644 usr.sbin/sendmail.MX/src/srvrsmtp.c create mode 100644 usr.sbin/sendmail.MX/src/stab.c create mode 100644 usr.sbin/sendmail.MX/src/stats.c create mode 100644 usr.sbin/sendmail.MX/src/sysexits.c create mode 100644 usr.sbin/sendmail.MX/src/trace.c create mode 100644 usr.sbin/sendmail.MX/src/trace.h create mode 100644 usr.sbin/sendmail.MX/src/usersmtp.c create mode 100644 usr.sbin/sendmail.MX/src/util.c create mode 100644 usr.sbin/sendmail.MX/src/version.c create mode 100644 usr.sbin/sendmail/FILES create mode 100644 usr.sbin/sendmail/Makefile create mode 100644 usr.sbin/sendmail/README_FOR_NAM create mode 100644 usr.sbin/sendmail/READ_ME create mode 100644 usr.sbin/sendmail/adb/event create mode 100644 usr.sbin/sendmail/adb/event2 create mode 100644 usr.sbin/sendmail/adm/SU.LOG create mode 100644 usr.sbin/sendmail/adm/TODO create mode 100644 usr.sbin/sendmail/adm/TraceFlags create mode 100644 usr.sbin/sendmail/adm/cbosgd.sl create mode 100644 usr.sbin/sendmail/adm/csvax.m4 create mode 100644 usr.sbin/sendmail/adm/ingvax.m4 create mode 100644 usr.sbin/sendmail/adm/jek.sl create mode 100644 usr.sbin/sendmail/adm/kim.m4 create mode 100644 usr.sbin/sendmail/adm/mh.cf.m4 create mode 100644 usr.sbin/sendmail/adm/mh.whoami.m4 create mode 100644 usr.sbin/sendmail/adm/sl.sed create mode 100644 usr.sbin/sendmail/aux/4.1a_daemon.c create mode 100644 usr.sbin/sendmail/aux/Makefile create mode 100644 usr.sbin/sendmail/aux/Makefile.m4 create mode 100644 usr.sbin/sendmail/aux/addr.c create mode 100644 usr.sbin/sendmail/aux/arpa.c create mode 100644 usr.sbin/sendmail/aux/asm.sed create mode 100644 usr.sbin/sendmail/aux/bbn_daemon.c create mode 100644 usr.sbin/sendmail/aux/c.ingvax.h create mode 100644 usr.sbin/sendmail/aux/conf.h create mode 100644 usr.sbin/sendmail/aux/mail-dm.c create mode 100644 usr.sbin/sendmail/aux/mailstats.c create mode 100644 usr.sbin/sendmail/aux/matchhdr.c create mode 100644 usr.sbin/sendmail/aux/mconnect.c create mode 100644 usr.sbin/sendmail/aux/newaliases.c create mode 100644 usr.sbin/sendmail/aux/newsyslog create mode 100644 usr.sbin/sendmail/aux/praliases.c create mode 100644 usr.sbin/sendmail/aux/rmail.c create mode 100644 usr.sbin/sendmail/aux/showdbm.c create mode 100644 usr.sbin/sendmail/aux/uname.c create mode 120000 usr.sbin/sendmail/cf create mode 100644 usr.sbin/sendmail/cf.hosttable/KEY create mode 100644 usr.sbin/sendmail/cf.hosttable/Makefile create mode 100644 usr.sbin/sendmail/cf.hosttable/TestMatrix create mode 100644 usr.sbin/sendmail/cf.hosttable/arpa.mc create mode 100644 usr.sbin/sendmail/cf.hosttable/arpaproto.mc create mode 100644 usr.sbin/sendmail/cf.hosttable/base.m4 create mode 100644 usr.sbin/sendmail/cf.hosttable/berkhosts.m4 create mode 100644 usr.sbin/sendmail/cf.hosttable/berkm.m4 create mode 100644 usr.sbin/sendmail/cf.hosttable/calder.mc create mode 100644 usr.sbin/sendmail/cf.hosttable/ccbase.m4 create mode 100644 usr.sbin/sendmail/cf.hosttable/cchosts.m4 create mode 100644 usr.sbin/sendmail/cf.hosttable/cogsci.mc create mode 100644 usr.sbin/sendmail/cf.hosttable/compat.m4 create mode 100644 usr.sbin/sendmail/cf.hosttable/csbase.m4 create mode 100644 usr.sbin/sendmail/cf.hosttable/csether.mc create mode 100644 usr.sbin/sendmail/cf.hosttable/dali.mc create mode 100644 usr.sbin/sendmail/cf.hosttable/degas.mc create mode 100644 usr.sbin/sendmail/cf.hosttable/ernie.mc create mode 100644 usr.sbin/sendmail/cf.hosttable/ether.m4 create mode 100644 usr.sbin/sendmail/cf.hosttable/etherm.m4 create mode 100644 usr.sbin/sendmail/cf.hosttable/fncpm.m4 create mode 100644 usr.sbin/sendmail/cf.hosttable/fudge.m4 create mode 100644 usr.sbin/sendmail/cf.hosttable/ibmm.m4 create mode 100644 usr.sbin/sendmail/cf.hosttable/ji.mc create mode 100644 usr.sbin/sendmail/cf.hosttable/kim.mc create mode 100644 usr.sbin/sendmail/cf.hosttable/lanleaf.mc create mode 100644 usr.sbin/sendmail/cf.hosttable/lanroot.mc create mode 100644 usr.sbin/sendmail/cf.hosttable/localm.m4 create mode 100644 usr.sbin/sendmail/cf.hosttable/matisse.mc create mode 100644 usr.sbin/sendmail/cf.hosttable/miro.mc create mode 100644 usr.sbin/sendmail/cf.hosttable/mmdfm.m4 create mode 100644 usr.sbin/sendmail/cf.hosttable/monet.mc create mode 100644 usr.sbin/sendmail/cf.hosttable/ncpm.m4 create mode 100644 usr.sbin/sendmail/cf.hosttable/okeeffe.mc create mode 100644 usr.sbin/sendmail/cf.hosttable/renoir.mc create mode 100644 usr.sbin/sendmail/cf.hosttable/suucpm.m4 create mode 100644 usr.sbin/sendmail/cf.hosttable/tcphosts.m4 create mode 100644 usr.sbin/sendmail/cf.hosttable/tcpm.m4 create mode 100644 usr.sbin/sendmail/cf.hosttable/ucbvax.mc create mode 100644 usr.sbin/sendmail/cf.hosttable/uucpm.m4 create mode 100644 usr.sbin/sendmail/cf.hosttable/uucpproto.mc create mode 100644 usr.sbin/sendmail/cf.hosttable/version.m4 create mode 100644 usr.sbin/sendmail/cf.hosttable/zerobase.m4 create mode 100644 usr.sbin/sendmail/cf.named/Makefile create mode 100644 usr.sbin/sendmail/cf.named/arpa.ed create mode 100644 usr.sbin/sendmail/cf.named/arpa.mc create mode 100644 usr.sbin/sendmail/cf.named/berkhosts.m4 create mode 100644 usr.sbin/sendmail/cf.named/berkm.m4 create mode 100644 usr.sbin/sendmail/cf.named/boilerplate.m4 create mode 100644 usr.sbin/sendmail/cf.named/cchosts.m4 create mode 100644 usr.sbin/sendmail/cf.named/euucpm.m4 create mode 100644 usr.sbin/sendmail/cf.named/kim.mc create mode 100644 usr.sbin/sendmail/cf.named/localm.m4 create mode 100644 usr.sbin/sendmail/cf.named/mmdfm.m4 create mode 100644 usr.sbin/sendmail/cf.named/monet.mc create mode 100644 usr.sbin/sendmail/cf.named/nicregistered.m4 create mode 100644 usr.sbin/sendmail/cf.named/nsclasses.m4 create mode 100644 usr.sbin/sendmail/cf.named/nsmacros.m4 create mode 100644 usr.sbin/sendmail/cf.named/nstcpldm.m4 create mode 100644 usr.sbin/sendmail/cf.named/nstcpm.m4 create mode 100644 usr.sbin/sendmail/cf.named/postwriterule.m4 create mode 100644 usr.sbin/sendmail/cf.named/prewriterule.m4 create mode 100644 usr.sbin/sendmail/cf.named/rule0.m4 create mode 100644 usr.sbin/sendmail/cf.named/rule3.m4 create mode 100644 usr.sbin/sendmail/cf.named/rule5.m4 create mode 100644 usr.sbin/sendmail/cf.named/suucpm.m4 create mode 100644 usr.sbin/sendmail/cf.named/ucbtcp.mc create mode 100644 usr.sbin/sendmail/cf.named/ucbvax.mc create mode 100644 usr.sbin/sendmail/cf.named/uucphosts.m4 create mode 100644 usr.sbin/sendmail/cf.named/uucpm.m4 create mode 100644 usr.sbin/sendmail/cf.named/version.m4 create mode 100644 usr.sbin/sendmail/doc/Makefile create mode 100644 usr.sbin/sendmail/doc/abstract create mode 100644 usr.sbin/sendmail/doc/diagram create mode 100644 usr.sbin/sendmail/doc/refs create mode 100644 usr.sbin/sendmail/doc/rfc819.lpr create mode 100644 usr.sbin/sendmail/doc/rfc821.lpr create mode 100644 usr.sbin/sendmail/doc/rfc822.lpr create mode 100644 usr.sbin/sendmail/doc/spell.good create mode 100644 usr.sbin/sendmail/doc/usenix create mode 100644 usr.sbin/sendmail/doc/usenix.me create mode 100644 usr.sbin/sendmail/include/asm.sed create mode 100644 usr.sbin/sendmail/include/asm.sed.pdp create mode 100644 usr.sbin/sendmail/include/asm.sed.vax create mode 100644 usr.sbin/sendmail/include/useful.h create mode 100644 usr.sbin/sendmail/include/userdbm.h create mode 100644 usr.sbin/sendmail/lib/Makefile create mode 100644 usr.sbin/sendmail/lib/Makefile.m4 create mode 100644 usr.sbin/sendmail/lib/aliases create mode 100644 usr.sbin/sendmail/lib/sendmail.hf create mode 100644 usr.sbin/sendmail/md/c.nvmunix.m4 create mode 100644 usr.sbin/sendmail/md/c.v6.m4 create mode 100644 usr.sbin/sendmail/md/c.v7.m4 create mode 100644 usr.sbin/sendmail/md/c.vmunix.m4 create mode 100644 usr.sbin/sendmail/md/config.m4 create mode 100644 usr.sbin/sendmail/src/FILES create mode 100644 usr.sbin/sendmail/src/Makefile create mode 100644 usr.sbin/sendmail/src/Makefile.m4 create mode 100644 usr.sbin/sendmail/src/READ_ME create mode 100644 usr.sbin/sendmail/src/TODO create mode 100644 usr.sbin/sendmail/src/Version.c create mode 100644 usr.sbin/sendmail/src/alias.c create mode 100644 usr.sbin/sendmail/src/arpadate.c create mode 100644 usr.sbin/sendmail/src/bcopy.c create mode 100644 usr.sbin/sendmail/src/bmove.11.s create mode 100644 usr.sbin/sendmail/src/bmove.vax.s create mode 100644 usr.sbin/sendmail/src/clock.c create mode 100644 usr.sbin/sendmail/src/collect.c create mode 100644 usr.sbin/sendmail/src/conf.c create mode 100644 usr.sbin/sendmail/src/conf.h create mode 100644 usr.sbin/sendmail/src/convtime.c create mode 100644 usr.sbin/sendmail/src/daemon.c create mode 100644 usr.sbin/sendmail/src/deliver.c create mode 100644 usr.sbin/sendmail/src/envelope.c create mode 100644 usr.sbin/sendmail/src/err.c create mode 100644 usr.sbin/sendmail/src/extract.c create mode 100644 usr.sbin/sendmail/src/headers.c create mode 100644 usr.sbin/sendmail/src/macro.c create mode 100644 usr.sbin/sendmail/src/mailstats.h create mode 100644 usr.sbin/sendmail/src/main.c create mode 100755 usr.sbin/sendmail/src/mkstrcc create mode 100644 usr.sbin/sendmail/src/parseaddr.c create mode 100644 usr.sbin/sendmail/src/queue.c create mode 100644 usr.sbin/sendmail/src/readcf.c create mode 100644 usr.sbin/sendmail/src/recipient.c create mode 100644 usr.sbin/sendmail/src/savemail.c create mode 100644 usr.sbin/sendmail/src/sendmail.h create mode 100644 usr.sbin/sendmail/src/sendmail.hf create mode 100644 usr.sbin/sendmail/src/srvrsmtp.c create mode 100644 usr.sbin/sendmail/src/stab.c create mode 100644 usr.sbin/sendmail/src/stats.c create mode 100644 usr.sbin/sendmail/src/sysexits.c create mode 100644 usr.sbin/sendmail/src/tags create mode 100644 usr.sbin/sendmail/src/trace.c create mode 100644 usr.sbin/sendmail/src/trace.h create mode 100644 usr.sbin/sendmail/src/usersmtp.c create mode 100644 usr.sbin/sendmail/src/util.c create mode 100644 usr.sbin/sendmail/test/fail1 create mode 100644 usr.sbin/sendmail/test/fail2 create mode 100644 usr.sbin/sendmail/test/tempfail create mode 100644 usr.sbin/sysgen/Makefile create mode 100644 usr.sbin/sysgen/devices.h create mode 100644 usr.sbin/sysgen/sysgen.1 create mode 100644 usr.sbin/sysgen/sysgen.c create mode 100644 usr.sbin/syslogd/Makefile create mode 100644 usr.sbin/syslogd/syslogd.8 create mode 100644 usr.sbin/syslogd/syslogd.c create mode 100644 usr.sbin/timed/Makefile create mode 100644 usr.sbin/timed/acksend.c create mode 100644 usr.sbin/timed/byteorder.c create mode 100644 usr.sbin/timed/candidate.c create mode 100644 usr.sbin/timed/cmds.c create mode 100644 usr.sbin/timed/cmdtab.c create mode 100644 usr.sbin/timed/correct.c create mode 100644 usr.sbin/timed/globals.h create mode 100644 usr.sbin/timed/m68000/cksum.c create mode 100644 usr.sbin/timed/m68000/ocsum.s create mode 100644 usr.sbin/timed/master.c create mode 100644 usr.sbin/timed/measure.c create mode 100644 usr.sbin/timed/networkdelta.c create mode 100644 usr.sbin/timed/pdp/cksum-fix create mode 100644 usr.sbin/timed/pdp/cksum.c create mode 100644 usr.sbin/timed/readmsg.c create mode 100644 usr.sbin/timed/slave.c create mode 100644 usr.sbin/timed/tags create mode 100644 usr.sbin/timed/timed.c create mode 100644 usr.sbin/timed/timedc.c create mode 100644 usr.sbin/timed/timedc.h create mode 100644 usr.sbin/timed/vax/cksum.c create mode 100644 usr.sbin/traceroute/Makefile create mode 100644 usr.sbin/traceroute/README create mode 100644 usr.sbin/traceroute/mean.awk create mode 100644 usr.sbin/traceroute/median.awk create mode 100644 usr.sbin/traceroute/traceroute.8 create mode 100644 usr.sbin/traceroute/traceroute.c create mode 100644 usr.sbin/trpt/Makefile create mode 100644 usr.sbin/trpt/trpt.8 create mode 100644 usr.sbin/trpt/trpt.c create mode 100644 usr.sbin/trsp/Makefile create mode 100644 usr.sbin/trsp/trsp.8 create mode 100644 usr.sbin/trsp/trsp.c create mode 100644 usr.sbin/update/Makefile create mode 100644 usr.sbin/update/update.8 create mode 100644 usr.sbin/update/update.c create mode 100644 usr.sbin/vipw/Makefile create mode 100644 usr.sbin/vipw/vipw.8 create mode 100644 usr.sbin/vipw/vipw.c diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..45d9515 --- /dev/null +++ b/Makefile @@ -0,0 +1,118 @@ +# +# Copyright (c) 1986 Regents of the University of California. +# All rights reserved. The Berkeley software License Agreement +# specifies the terms and conditions for redistribution. +# +# @(#)Makefile 4.15 (2.11BSD) 96/10/21 +# +# This makefile is designed to be run as: +# make build +# make installsrc +# The `make build' will compile and install the libraries +# before building the rest of the sources. The `make installsrc' +# will then install the remaining binaries. +# +# It can also be run in the more conventional way: +# make +# make install +# The `make' will compile everything without installing anything. +# The `make install' will then install everything. Note however +# that all the binaries will have been loaded with the old libraries. +# +# C library options: passed to libc makefile. +# See lib/libc/Makefile for explanation. +# NOTE: The method of hostname lookup (hosts file or nameserver) is no +# longer selected here. Make sure to edit lib/libc/Makefile to set +# HOSTLOOKUP +# DFLMON must be either mon.o or gmon.o. +# DEFS may include -DLIBC_SCCS, -DSYSLIBC_SCCS, both, or neither. +# +DFLMON=mon.o +DEFS= +LIBCDEFS= DFLMON=${DFLMON} DEFS="${DEFS}" + +# global flags +# SRC_MFLAGS are used on makes in command source directories, +# but not in library or compiler directories that will be installed +# for use in compiling everything else. +# +DESTDIR= +CFLAGS= -O +SRC_MFLAGS = -k + +# Programs that live in subdirectories, and have makefiles of their own. +# +# 'share' has to be towards the front of the list because programs such as +# lint(1) need their data files, etc installed first. + +LIBDIR= lib usr.lib +SRCDIR= share bin sbin etc games libexec local new ucb usr.bin usr.sbin man + +all: ${LIBDIR} ${SRCDIR} + +lib: FRC + cd lib/libc; make ${MFLAGS} ${LIBCDEFS} + cd lib; make ${MFLAGS} ccom cpp c2 + +usr.lib ${SRCDIR}: FRC + cd $@; make ${MFLAGS} ${SRC_MFLAGS} + +build: buildlib ${SRCDIR} + +buildlib: FRC + @echo installing /usr/include + # cd include; make ${MFLAGS} DESTDIR=${DESTDIR} install + @echo + @echo compiling libc.a + cd lib/libc; make ${MFLAGS} ${LIBCDEFS} + @echo installing /lib/libc.a + cd lib/libc; make ${MFLAGS} DESTDIR=${DESTDIR} install + @echo + @echo compiling C compiler + cd lib; make ${MFLAGS} ccom cpp c2 + @echo installing C compiler + cd lib/ccom; make ${MFLAGS} DESTDIR=${DESTDIR} install + cd lib/cpp; make ${MFLAGS} DESTDIR=${DESTDIR} install + cd lib/c2; make ${MFLAGS} DESTDIR=${DESTDIR} install + cd lib; make ${MFLAGS} clean + @echo + @echo re-compiling libc.a + cd lib/libc; make ${MFLAGS} ${LIBCDEFS} + @echo re-installing /lib/libc.a + cd lib/libc; make ${MFLAGS} DESTDIR=${DESTDIR} install + @echo + @echo re-compiling C compiler + cd lib; make ${MFLAGS} ccom cpp c2 + @echo re-installing C compiler + cd lib/ccom; make ${MFLAGS} DESTDIR=${DESTDIR} install + cd lib/cpp; make ${MFLAGS} DESTDIR=${DESTDIR} install + cd lib/c2; make ${MFLAGS} DESTDIR=${DESTDIR} install + @echo + @echo compiling usr.lib + cd usr.lib; make ${MFLAGS} ${SRC_MFLAGS} + @echo installing /usr/lib + cd usr.lib; make ${MFLAGS} ${SRC_MFLAGS} DESTDIR=${DESTDIR} install + +FRC: + +install: + -for i in ${LIBDIR} ${SRCDIR}; do \ + (cd $$i; \ + make ${MFLAGS} ${SRC_MFLAGS} DESTDIR=${DESTDIR} install); \ + done + +installsrc: + -for i in ${SRCDIR}; do \ + (cd $$i; \ + make ${MFLAGS} ${SRC_MFLAGS} DESTDIR=${DESTDIR} install); \ + done + +tags: + for i in include lib usr.lib; do \ + (cd $$i; make ${MFLAGS} TAGSFILE=../tags tags); \ + done + sort -u +0 -1 -o tags tags + +clean: + rm -f a.out core *.s *.o + for i in ${LIBDIR} ${SRCDIR}; do (cd $$i; make -k ${MFLAGS} clean); done diff --git a/asm.sed b/asm.sed new file mode 100644 index 0000000..33f6312 --- /dev/null +++ b/asm.sed @@ -0,0 +1 @@ +s,asm.sed.pdp 4.1 82/10/06,asm.sed.pdp 4.1 82/10/06, diff --git a/asm.sed.pdp b/asm.sed.pdp new file mode 100644 index 0000000..33f6312 --- /dev/null +++ b/asm.sed.pdp @@ -0,0 +1 @@ +s,asm.sed.pdp 4.1 82/10/06,asm.sed.pdp 4.1 82/10/06, diff --git a/asm.sed.vax b/asm.sed.vax new file mode 100644 index 0000000..60a1629 --- /dev/null +++ b/asm.sed.vax @@ -0,0 +1,93 @@ +s,asm.sed.vax 4.1 82/10/06,asm.sed.vax 4.1 82/10/06, +s/calls $0,_spl0/mfpr $18,r0\ + mtpr $0,$18/ +s/calls $0,_spl1/mfpr $18,r0\ + mtpr $0,$18/ +s/calls $0,_splnet/mfpr $18,r0\ + mtpr $0xc,$18/ +s/calls $0,_spl4/mfpr $18,r0\ + mtpr $0x14,$18/ +s/calls r[0-9]*,_spl4/mfpr $18,r0\ + mtpr $0x14,$18/ +s/calls $0,_spl5/mfpr $18,r0\ + mtpr $0x15,$18/ +s/calls r[0-9]*,_spl5/mfpr $18,r0\ + mtpr $0x15,$18/ +s/calls $0,_spl6/mfpr $18,r0\ + mtpr $0x18,$18/ +s/calls r[0-9]*,_spl6/mfpr $18,r0\ + mtpr $0x18,$18/ +s/calls $0,_spl7/mfpr $18,r0\ + mtpr $0x1f,$18/ +s/calls $1,_splx/mfpr $18,r0\ + mtpr (sp)+,$18/ +s/calls $1,_mfpr/mfpr (sp)+,r0/ +s/calls $2,_mtpr/mtpr 4(sp),(sp)\ + addl2 $8,sp/ +s/calls $1,_resume/ashl $9,(sp)+,r0 \ + movpsl -(sp) \ + jsb _Resume/ +s/calls $3,_bcmp/cmpc3 8(sp),*(sp),*4(sp)\ + addl2 $12,sp/ +s/calls $3,_bcopy/movc3 8(sp),*(sp),*4(sp)\ + addl2 $12,sp/ +s/calls $2,_bzero/movc5 $0,(r0),$0,4(sp),*(sp)\ + addl2 $8,sp/ +s/calls $3,_copyin/jsb _Copyin\ + addl2 $12,sp/ +s/calls $3,_copyout/jsb _Copyout\ + addl2 $12,sp/ +s/calls $1,_fubyte/movl (sp)+,r0 \ + jsb _Fubyte/ +s/calls $1,_fuibyte/movl (sp)+,r0 \ + jsb _Fubyte/ +s/calls $1,_fuword/movl (sp)+,r0 \ + jsb _Fuword/ +s/calls $1,_fuiword/movl (sp)+,r0 \ + jsb _Fuword/ +s/calls $2,_subyte/movl (sp)+,r0 \ + movl (sp)+,r1 \ + jsb _Subyte/ +s/calls $2,_suibyte/movl (sp)+,r0 \ + movl (sp)+,r1 \ + jsb _Subyte/ +s/calls $2,_suword/movl (sp)+,r0 \ + movl (sp)+,r1 \ + jsb _Suword/ +s/calls $2,_suiword/movl (sp)+,r0 \ + movl (sp)+,r1 \ + jsb _Suword/ +s/calls $1,_setrq/movl (sp)+,r0 \ + jsb _Setrq/ +s/calls $1,_remrq/movl (sp)+,r0 \ + jsb _Remrq/ +s/calls $0,_swtch/movpsl -(sp)\ + jsb _Swtch/ +s/calls $1,_ffs/ffs $0,$32,(sp)+,r0 \ + bneq 1f \ + mnegl $1,r0 \ +1: \ + incl r0/ +s/calls $1,_htons/rotl $8,(sp),r0\ + movb 1(sp),r0\ + movzwl r0,r0\ + addl2 $4,sp/ +s/calls $1,_ntohs/rotl $8,(sp),r0\ + movb 1(sp),r0\ + movzwl r0,r0\ + addl2 $4,sp/ +s/calls $1,_htonl/rotl $-8,(sp),r0\ + insv r0,$16,$8,r0\ + movb 3(sp),r0\ + addl2 $4,sp/ +s/calls $1,_ntohl/rotl $-8,(sp),r0\ + insv r0,$16,$8,r0\ + movb 3(sp),r0\ + addl2 $4,sp/ +s/calls $2,__insque/insque *(sp)+,*(sp)+/ +s/calls $1,__remque/remque *(sp)+,r0/ +s/calls $2,__queue/movl (sp)+,r0\ + movl (sp)+,r1\ + insque r1,*4(r0)/ +s/calls $1,__dequeue/movl (sp)+,r0\ + remque *(r0),r0/ diff --git a/bin/MANIFEST b/bin/MANIFEST new file mode 100644 index 0000000..18be700 --- /dev/null +++ b/bin/MANIFEST @@ -0,0 +1,68 @@ +Application Version +----------- ------- +Makefile 4.3 (small mods for load type (separate I&D or pure)) +adb/ 2.10 (impossible to convert - PDP11 specific) +ar.c 2.10 (see PORT; unclear it's worth the effort) +as/ 2.10 (impossible to convert - PDP11 specific) +awk/ 4.3 (small mods to Makefile for sep/nonsep loading) +cat.c 4.3 +cc.c 4.3 +chgrp.c 4.3 +chmod.c 4.3 +cmp.c 4.4 +cp.c 4.3 +csh/ 4.3 (2.10BSD malloc & doprnt, long/int fixes, shorter names) +date.c 4.4 (timed code disabled for now) +dd.c 4.3 +df.c 4.3 (small mods for 2.10BSD super block format) +diff/ 4.3 (small mods to Makefile and shorter names in diffreg.c) +du.c 4.3 +echo.c 4.3 +ed.c 4.3 +expr.y 4.3 +false.sh 4.3 +grep.c 4.3 +hostid.c 4.3 (some long/int fixes, fix lack of %#x in 2.10BSD printf) +hostname.c 4.3 (small mods for shorter names) +kill.c 4.3 +ld.c 2.10 (not convertible, but fairly close to 4.3's) +ln.c 4.3 +login.c 4.3+ (minor mods for shorter names) +ls.c 4.3 (minor long/int fixes and shorter names) +mail.c 4.3+ (minor long/int fixes, include short_name.h. +make/ 4.3 (small mods to Makefile and smaller sizes in defs) +mkdir.c 4.3 +mt.c 4.3 +mv.c 4.3 +nice.c 4.3 +nm.c 2.10 (see PORT; but not clear worth the effort) +od.c 4.3 +pagesize.c 4.3 +passwd.c 4.3 (small mods for shorter names) +pr.c 4.3 +ps.c 2.10 (too hard to convert now) +pwd.c 4.3 +rcp.c 4.3 +rm.c 4.3 +rmail.c 4.3 +rmdir.c 4.3 +sed/ 4.3 (small mods to Makefile for sep/nonsep loading) +sh/ 4.3 (small mods to Makefile for sep/nonsep loading) +size.c 4.3 (small mods for 2.10BSD a.out format) +strip.c 4.3 (small mods for 2.10BSD a.out format) +stty.c 4.3 +su.c 4.3 +sync.c 4.3 +tar.c 4.3 +tee.c 4.3 +test.c 4.3 +time.c 4.3 +true.sh 4.3 +tp/ 4.3 (small mods to Makefile for sep/nonsep loading) +wall.c 4.3 (small mods for shorter names) +who.c 4.3 (small mods for shorter names) +write.c 4.3 (small mods for shorter names) + + The directory PORT is special. It contains source code from the +4.3BSD distribution that should probably be ported to 2.10 as soon as +someone has the time and inclination to do so. diff --git a/bin/Makefile b/bin/Makefile new file mode 100644 index 0000000..19f93a6 --- /dev/null +++ b/bin/Makefile @@ -0,0 +1,109 @@ +# +# Copyright (c) 1980 Regents of the University of California. +# All rights reserved. The Berkeley software License Agreement +# specifies the terms and conditions for redistribution. +# +# @(#)Makefile 5.19.10 (2.11BSD GTE) 1997/3/27 +# +DESTDIR= +CFLAGS= -O +SEPFLAG= -i + +# Programs that live in subdirectories, and have makefiles of their own. +# +SUBDIR= adb ar as awk chflags chpass csh diff disklabel hostname ld login \ + ls make nm passwd ping sed sh stty sysctl tcsh test tp + +# Shell scripts that need only be installed and are never removed. +# +SCRIPT= false true + +# C programs that live in the current directory and do not need +# explicit make lines. +# +STD= cat cc chgrp chmod cmp cp date dd du echo ed grep hostid \ + kill ln mkdir mt mv nice od pagesize pr \ + pwd rm rmail rmdir size sync tar tee time who + +# C programs that live in the current directory and need explicit make lines. +# +NSTD= expr + +# Programs that must run setuid to root +# +SETUID= mail rcp su + +# Programs that run set-group-id operator +# +OPERATOR= df + +# Programs that must run set-group-id kmem. +# +KMEM= ps + +# Programs that must run set-group-id tty. +# +TTY= wall write + +# 'strip' is handled specially because 'install -s' now uses 'strip' and +# thus we can't do a 'install -s strip /bin/strip' without an error. +# +BINS= ${STD} ${NSTD} ${SETUID} ${OPERATOR} ${KMEM} ${TTY} strip + +all: ${SUBDIR} ${BINS} + +${SUBDIR}: FRC + cd $@; make ${MFLAGS} SEPFLAG=${SEPFLAG} + +FRC: + + +${STD} ${SETUID} ${KMEM} ${OPERATOR} ${TTY} strip: + ${CC} ${CFLAGS} ${SEPFLAG} -o $@ $@.c + +install: ${BINS} + install -s -m 751 -g staff ${STD} ${NSTD} ${DESTDIR}/bin + -for i in ${SUBDIR}; do \ + (cd $$i; make ${MFLAGS} DESTDIR=${DESTDIR} install); done + -for i in ${SCRIPT}; do (install -c $$i.sh ${DESTDIR}/bin/$$i); done + -for i in ${SETUID}; do \ + (install -o root -m 4751 -s $$i ${DESTDIR}/bin/$$i); done + -for i in ${OPERATOR}; do \ + (install -g operator -m 2751 -s $$i ${DESTDIR}/bin/$$i); done + -for i in ${KMEM}; do \ + (install -g kmem -m 2751 -s $$i ${DESTDIR}/bin/$$i); done + -for i in ${TTY}; do \ + (install -g tty -m 2751 -s $$i ${DESTDIR}/bin/$$i); done + -install -s -m 751 -g staff strip ${DESTDIR}/bin/xstrip + -mv ${DESTDIR}/bin/xstrip ${DESTDIR}/bin/strip + rm -f ${DESTDIR}/bin/e; ln ${DESTDIR}/bin/ed ${DESTDIR}/bin/e + +clean: + rm -f ${BINS} expr.c a.out core *.s *.o errs + for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} clean); done + +depend: expr.c + for i in ${BINS}; do \ + cc -M ${INCPATH} $$i.c | sed 's/\.o//' | \ + awk ' { if ($$1 != prev) \ + { if (rec != "") print rec; rec = $$0; prev = $$1; } \ + else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \ + else rec = rec " " $$2 } } \ + END { print rec } ' >> makedep; done + echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep + echo '$$r makedep' >>eddep + echo 'w' >>eddep + cp Makefile Makefile.bak + ed - Makefile < eddep + rm eddep makedep + echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile + echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile + echo '# see make depend above' >> Makefile + +# Files listed in ${NSTD} have explicit make lines given below. + +expr: expr.o + ${CC} ${CFLAGS} ${SEPFLAG} -o expr expr.o + +# DO NOT DELETE THIS LINE -- make depend uses it + diff --git a/bin/PORT/ar.c.Z b/bin/PORT/ar.c.Z new file mode 100644 index 0000000000000000000000000000000000000000..4e4f7c647ca48c72160d95040f5fcba97722ea4b GIT binary patch literal 6328 zcmYLIc{~$*{GV+$bG12#)SN@PMwlF%VZJVz-o0AJ}fBGVPGSX5^%g^@-!hDT{#G*@U#HMT%Q&Ik`qQI%#CsuIE zQh^vv747(=sFFYjB zFWhBNlv3#>U4M2u7a~@Bt+DYiMM->J>^8e>z430s1Y2SuVuVq5<6(_i1NYX1WL5Nv z*xML#loJ7HcRUv?1RJOnYnznM84xsq=O*$l#La97E~Q%--p=k@%lDe*R0Ki1{|GajEcs+-QY>_O zf=#=#p>8T*hO*%lI-VH*1!1m(H+`&XW@9R#K?n4+C8vhrV)Vi!BkresAJ}!l3Jz>> zW5e0j!#-_z!W8$`X~MLfpnJO+Y$@r)GySR0?KArQ>UXEyIwH1bDD0M)rwa8bCkgWO zGJ)G(H5ek{A1p<$4#)A98}HNJRS$aZzUQh-puNSkZQkRm^f$QA+v<}Px0*TS1zF`e z8w&YAoDcnLb4>6;Sew&zj~~}dLr1nNpDSSuA~M9td2I92?kBfNg%zFa z7vIXm@@kPtfu20igizJ|Rj4GN0B7Jv4)8s~H~BU#t6Bgc;)bo2LlHrBL37CNRJ0yg z40QO)*ZP4<6rX-#FaJ_sPEO`=zVeY}?la>?PnN-)N1KEsn&(V%Lpahkjh~BJzrB=p z38$qh@dh#SL*a?vguENLRJ3iZA(u@H@TZvGa0<>4ou z(9?mc90Vb6X)h#QVI(9qDXCwmNhjqb3#=C*_}YXVfNNzg@uA0it54DL1e>J_n|y7K zZ2&BY!vbJ*y|J=$nuYeqFGXmsepO3FhS%LlUiN^Wco59|VaReG3T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*F~qN*nRXW za_oqgkjSaWv1s)^_p*N9f=A9fncN;3AuFu}8U%254z4-|*Tf;f>@8MKmMY#%;TWsl zgrZXsXK#X{N=txTjP$Ri$jsKL9mXifXrvQ`o3T8zjGb78OPn_;PL6DT0v`XAlBu{? zoe7AyxZqhG#5HRsn93A~W6`iI2L}k_O6R}uI*&!F+r!Sw%X)?|M+%VO zx7AOS#52oY4(oBJwoCXJmvDK}f3`Q_{v-Cp3vRCvZl+E+bB*IJ0)VBQB-4bZjS2ER zaK!Ltyi=*9`b~pZY%K0_vPNuym4dNBO{cpP7>q-_BAUgHq+hnKXZ5|H>&J42u9=mX z&X0V-3DdR_V6j(di#fRy)2E%{h_|s$Pf=cu2|LD|->dU#88&4R+0k-o)0Lq{f`pP+jIduVtztOgLGT<%07!eK34ApW-K8SJLqi7 z$IVxq{LH~7@;hJG0PqP!>&#Sn=RRCc@3*;6F+OsXDHY%IeP=5|5`mPSMIe*l-&TrB_q literal 0 HcmV?d00001 diff --git a/bin/adb/Makefile b/bin/adb/Makefile new file mode 100644 index 0000000..291eef2 --- /dev/null +++ b/bin/adb/Makefile @@ -0,0 +1,41 @@ +DESTDIR= +CFLAGS= -O -DNUM_SYMS_CACHE=50 +LDFLAGS= +SEPFLAG= -i +CFILES= access.c command.c expr.c findfn.c format.c input.c main.c message.c \ + opset.c output.c pcs.c print.c runpcs.c setup.c sym.c + +OFILES= access.o command.o expr.o findfn.o format.o input.o main.o message.o \ + opset.o output.o pcs.o print.o runpcs.o setup.o sym.o + +adb: ${OFILES} + ${CC} ${SEPFLAG} ${LDFLAGS} -o adb ${OFILES} + +install: adb + install -m 755 -s adb ${DESTDIR}/bin + +clean: + -rm -f adb ${OFILES} + +print: + @ls -l | pr + @pr -f Makefile *.h ${CFILES} + +lint: + lint -haxc -I. ${CFILES} + +access.o: defs.h access.c +command.o: defs.h command.c +expr.o: defs.h expr.c +findfn.o: defs.h findfn.c +format.o: defs.h format.c +input.o: defs.h input.c +main.o: defs.h main.c +message.o: defs.h message.c +opset.o: defs.h opset.c +output.o: defs.h output.c +pcs.o: defs.h pcs.c +print.o: defs.h print.c +runpcs.o: defs.h runpcs.c +setup.o: defs.h setup.c +sym.o: defs.h sym.c diff --git a/bin/adb/READ_ME b/bin/adb/READ_ME new file mode 100644 index 0000000..cd2857a --- /dev/null +++ b/bin/adb/READ_ME @@ -0,0 +1,73 @@ + The makefile can be adjusted to make a version of adb for +nonseparate I/D machines. Change the -DNUM_VM_PAGES value to +something like 6 to 8, this will use less real memory (and cause +adb to run a bit slower) and allow adb to run on a non-split I/D +machine. + +Changes for overlaid processes are intended to work in the most obvious way +and are: + + 1. There is an additional map for an overlay (430 or 431) object + file, described by the triple (bo,eo,fo). bo is initialized + on startup, and the others are changed on setting an overlay. + This is done automatically if there is an appropriate corefile + or when a traced subprocess stops, and can be done manually + (described below). + + 2. There are two additional internal variables set for overlay objects. + The variable o is the sum of the overlay sizes. c is the current + overlay number. It is set automatically as described above, + and can be changed manually (#>c). This changes the overlay + map (eo and fo) to map in the named overlay. This affects only + adb's mapping. + + 3. Although the variable c controls the overlay map, the "register" + variable "ov" reflects the overlay actually mapped when the + process stopped (or dumped core). This value is shown as "ov" + in the register list ($r). It may also be used as other register + variables, in the "<" and ">" commands. In the latter case, + this actually causes the kernel to remap the subprocess, and the + correct overlay must be mapped to restart the process. NOTE: + the kernel routine procxmt must support overlay changes for this + to work. The (1982) 2bsd distribution includes the necessary + changes. + + 4. For text symbols in overlaid objects, the default symbol + used to find "name" is "~name" rather than "_name". This + means that the actual subroutine, rather than its thunk, is + found. To examine a thunk, use "_name" explicitly. + + 5. In the overlaid segment, only symbols in the current overlay + (c) are used in symbolic addresses. In order to find these + overlay numbers, the new version of (ov)ld must be used. + The reason for this is that the previous version of ovld put + the overlay number only in symbols for thunks, + not in local text symbols. + + 6. In order to support breakpoints in overlaid segments, the + strategy used by adb has been changed slightly. Breakpoints + are written into the subprocess immediately when a ":b" + command is executed, and deleted immediately with ":d". + +Changes to support overlaid kernels: + + 1. The user's saved registers are in different places in the + kernel stack. They are found relative to the entry u.u_ar0 + in the core file if there is one, with offsets from + and . If there is no core file,a default is + used. This default is defined as UAR0 in defs.h. +******* UAR0 should be checked whenever the user structure changes. + + 2. There is a new command-line flag, -k, which sets things + appropriately for the kernel. + It sets the mapping of the core file appropriately + for 407, 411 and 430 kernels, and changes the debugger's idea of + saved register locations. Thus, $r will print the register + values saved by dump, and $c will use the saved r5 from low core. + +In addition, a number of minor bugs have been fixed. + + Mike Karels + ucbvax!virus!mike + Department of Molecular Biology + University of California, Berkeley diff --git a/bin/adb/access.c b/bin/adb/access.c new file mode 100644 index 0000000..6056f19 --- /dev/null +++ b/bin/adb/access.c @@ -0,0 +1,161 @@ +#include "defs.h" + + MSG ODDADR; + MSG BADDAT; + MSG BADTXT; + MAP txtmap; + MAP datmap; + int wtflag; + char *errflg; + int pid; + struct ovlhdr ovlseg; + long ovloff[]; + char curov; + int overlay; + long var[]; + static within(); + +/* file handling and access routines */ + +put(adr,space,value) + long adr; +{ + acces(WT,adr,space,value); +} + +u_int +get(adr, space) +long adr; +{ + return(acces(RD,adr,space,0)); +} + +u_int +chkget(n, space) + long n; +{ + register int w; + + w = get(n, space); + chkerr(); + return(w); +} + +acces(mode,adr,space,value) + long adr; +{ + int w, w1, pmode, rd, file; + BKPTR bkptr, scanbkpt(); + + 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?PT_READ_D:PT_WRITE_D):(rd?PT_READ_I:PT_WRITE_I)); + if (bkptr=scanbkpt((u_int)adr)) { + if (rd) { + return(bkptr->ins); + } else { + bkptr->ins = value; + return(0); + } + } + 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 (lseek(file,adr, 0) == -1L || + (rd ? read(file,&w,2) : write(file,&value,2)) < 1) + errflg = (space & DSP ? BADDAT : BADTXT); + return(w); +} + +chkmap(adr,space) + register long *adr; + register int space; +{ + register MAPPTR amap; + + amap=((space&DSP?&datmap:&txtmap)); + switch(space&(ISP|DSP|STAR)) { + + case ISP: + IF within(*adr, amap->b1, amap->e1) + THEN *adr += (amap->f1) - (amap->b1); + break; + ELIF within(*adr, amap->bo, amap->eo) + THEN *adr += (amap->fo) - (amap->bo); + break; + FI + /* falls through */ + + case ISP+STAR: + IF within(*adr, amap->b2, amap->e2) + THEN *adr += (amap->f2) - (amap->b2); + break; + ELSE goto err; + FI + + case DSP: + IF within(*adr, amap->b1, amap->e1) + THEN *adr += (amap->f1) - (amap->b1); + break; + FI + /* falls through */ + + case DSP+STAR: + IF within(*adr, amap->b2, amap->e2) + THEN *adr += (amap->f2) - (amap->b2); + break; + FI + /* falls through */ + + default: + err: + errflg = (space&DSP ? BADDAT: BADTXT); + return(0); + } + return(1); +} + +setovmap(ovno) + char ovno; + { + register MAPPTR amap; + + if ((!overlay) || (ovno < 0) || (ovno > NOVL)) + return; + amap = &txtmap; + IF ovno == 0 + THEN amap->eo = amap->bo; + amap->fo = 0; + ELSE amap->eo = amap->bo + ovlseg.ov_siz[ovno-1]; + amap->fo = ovloff[ovno-1]; + FI + var[VARC] = curov = ovno; + if (pid) + choverlay(ovno); +} + +static +within(adr,lbd,ubd) + long adr, lbd, ubd; +{ + return(adr>=lbd && adrb2); + ELSE mp = &(smap->b1); + FI + WHILE fcount-- ANDF expr(0) + DO *(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); + printc(EOR); + PER expr(0) ANDF errflg==0 DONE + dot=savdot; + chkerr(); + break; + + default: + lp--; + getformat(eqcom ? eqformat : stformat); + IF !eqcom + THEN IF symov ANDF symov!=curov ANDF + ptype == ISYM ANDF dot>=txtmap.bo + THEN setovmap(symov); + var[VARC]=symov; + FI + IF *stformat!='a' + THEN psymoff(dot,ptype,":%16t"); + FI + FI + scanform(cntval,(eqcom?eqformat:stformat),itype,ptype); + } + break; + + case '>': + lastcom=0; savc=rdc(); + IF (regptr=getreg(savc)) != NOREG + THEN uar0[regptr]=shorten(dot); + ptrace(PT_WRITE_U,pid,(int)&uar0[regptr]-(int)&corhdr, + uar0[regptr]); + IF (uar0+regptr) == &(((U*)corhdr)->u_ovdata.uo_curov) + THEN var[VARC]=dot; setovmap((char)dot); FI + ELIF (modifier=varchk(savc)) != -1 + THEN var[modifier]=dot; + IF modifier == VARC THEN setovmap((char)dot); FI + 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: + printf("%s\n", myname); + break; + + default: error(BADCOM); + } + + flushbuf(); + PER rdc()==';' DONE + IF buf THEN lp=savlp; ELSE lp--; FI + return(adrflg ANDF dot!=0); +} + diff --git a/bin/adb/defs.h b/bin/adb/defs.h new file mode 100644 index 0000000..d50eece --- /dev/null +++ b/bin/adb/defs.h @@ -0,0 +1,198 @@ +/* + * + * UNIX debugger - common definitions + * + * 1998/4/21 - remove local redefinitions used with ptrace + * + * Layout of a.out file (fsym): + * + * This has changed over time - see a.out.h, sys/exec.h and nlist.h + * for the current a.out definition and format. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#define MAXSYMLEN 32 +#define MAXCOM 64 +#define MAXARG 32 +#define LINSIZ 512 + +#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 ANDF && +#define ORF || + +#define LPRMODE "%Q" +#define OFFMODE "+%o" + +/* + * This is the memory resident portion of a symbol. The only difference + * between this and a 'nlist' entry is the size of the string offset By + * restricting the string table to be less than 64kb we save 2 bytes per + * symbol - approximately 7.5kb of D space in the case of /unix's symbol + * table. In practice this restriction is unlikely to be reached since + * even the kernel's symbol table of ~28kb only has a strings table of 21kb. +*/ + + struct SYMbol + { + u_short value; + char type; + char ovno; + u_short soff; /* low order of string table offset */ + }; + +#define SYMTYPE(symflag) (( symflag>=041 || (symflag>=02 && symflag<=04))\ + ? ((symflag&07)>=3 ? DSYM : (symflag&07))\ + : NSYM) + +typedef char MSG[]; +typedef struct map MAP; +typedef MAP *MAPPTR; +typedef struct bkpt BKPT; +typedef BKPT *BKPTR; +typedef struct user U; + +/* file address maps */ +struct map { + long b1; + long e1; + long f1; + long bo; + long eo; + long fo; + long b2; + long e2; + long f2; + int ufd; +}; + +struct bkpt { + int loc; + int ins; + int count; + int initcnt; + char flag; + char ovly; + char comm[MAXCOM]; + BKPT *nxtbkpt; +}; + +typedef struct reglist REGLIST; +typedef REGLIST *REGPTR; +struct reglist { + char *rname; + int roffs; +}; + +/* + * Internal variables --- + * They are addressed by name. (e.g. (`0'-`9', `a'-`b')) + * thus there can only be 36 of them. + */ + +#define VARB 11 +#define VARC 12 /* current overlay number */ +#define VARD 13 +#define VARE 14 +#define VARM 22 +#define VARO 24 /* overlay text segment addition */ +#define VARS 28 +#define VART 29 + +#define RD 0 +#define WT 1 +#define NSP 0 +#define ISP 1 +#define DSP 2 +#define STAR 4 +#define DSYM 7 +#define ISYM 2 +#define ASYM 1 +#define NSYM 0 +#define ESYM 0177 +#define BKPTSET 1 +#define BKPTEXEC 2 + +#define BPT 03 + +#define NOREG 32767 /* impossible return from getreg() */ +#define NREG 9 /* 8 regs + PS from kernel stack */ +/* + * UAR0 is the value used for subprocesses when there is no core file. + * If it doesn't correspond to reality, use pstat -u on a core file to + * get uar0, subtract 0140000, and divide by 2 (sizeof int). + */ +#define UAR0 (&corhdr[ctob(USIZE)/sizeof(u_int) - 3]) /* default address of r0 (u.u_ar0) */ + +#define KR0 (0300/2) /* location of r0 in kernel dump */ +#define KR1 (KR0+1) +#define KR2 (KR0+2) +#define KR3 (KR0+3) +#define KR4 (KR0+4) +#define KR5 (KR0+5) +#define KSP (KR0+6) +#define KA6 (KR0+7) /* saved ka6 in kernel dump */ + +#define MAXOFF 255 +#define MAXPOS 80 +#define MAXLIN 128 + +#define TRUE (-1) +#define FALSE 0 +#define LOBYTE 0377 +#define HIBYTE 0177400 +#define STRIP 0177 + +#define SP ' ' +#define TB '\t' +#define EOR '\n' +#define QUOTE 0200 +#define EVEN (~1) + +/* long to ints and back (puns) */ +union { + int I[2]; + long 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 */ +long inkdot(); +struct SYMbol *lookupsym(); +struct SYMbol *symget(); +u_int get(), chkget(); +char *exform(); +char *cache_sym(), *no_cache_sym(); +long round(); +BKPTR scanbkpt(); + +struct sgttyb adbtty, usrtty; +jmp_buf erradb; diff --git a/bin/adb/expr.c b/bin/adb/expr.c new file mode 100644 index 0000000..2ca5bcf --- /dev/null +++ b/bin/adb/expr.c @@ -0,0 +1,322 @@ +#include "defs.h" +#include + + MSG BADSYM; + MSG BADVAR; + MSG BADKET; + MSG BADSYN; + MSG NOCFN; + MSG NOADR; + MSG BADLOC; + +extern struct SYMbol *symbol, *cache_by_string(); + int lastframe; + int kernel; + int savlastf; + long savframe; + char svlastov; + int savpc; + int callpc; + char *lp; + int octal; + char *errflg; + long localval; + static char isymbol[MAXSYMLEN + 2]; + char lastc; + u_int *uar0; + u_int corhdr[]; + char curov, startov, lastsymov; + int overlay; + long dot; + long ditto; + int dotinc; + long var[]; + long expv; + +expr(a) +{ /* term | term dyadic expr | */ + int rc; + long lhs; + + lastsymov = 0; + 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 | . | ^ | value; lastsymov=symp->ovno; + FI + lp--; + + + ELIF isdigit(lastc) ORF (hex=TRUE, lastc=='#' ANDF isxdigit(readchar())) + THEN expv = 0; + base = (lastc == '0' ORF octal ? 8 : (hex ? 16 : 10)); + WHILE (hex ? isxdigit(lastc) : isdigit(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 isdigit(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 savov = curov; + curov = svlastov; + lastframe=savlastf; callpc=savpc; findroutine(savframe); + chkloc(savframe); + if(overlay) + setovmap(savov); + 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)) != NOREG + THEN expv=uar0[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() +{ + register char *p; + + p = isymbol; + REP IF p < &isymbol[MAXSYMLEN] + THEN *p++ = lastc; + FI + readchar(); + PER symchar(1) DONE + *p++ = 0; +} + +struct SYMbol * +lookupsym(symstr) + char *symstr; +{ + register struct SYMbol *symp, *sc; + + symset(); + while (symp = symget()) + { + if (overlay && (symp->type == ISYM)) + { + if (sc = cache_by_string(symstr, 1)) + return(sc); + if (eqsym(no_cache_sym(symp), symstr,'~')) + break; + } + else + { + if (sc = cache_by_string(symstr, 0)) + return(sc); + if (eqsym(no_cache_sym(symp), symstr,'_')) + break; + } + } +/* + * We did not enter anything into the cache (no sense inserting hundreds + * of symbols which didn't match) while examining the (entire) symbol table. + * Now that we have a match put it into the cache (doing a lookup on it is + * the easiest way). +*/ + if (symp) + (void)cache_sym(symp); + return(symp); +} + +convdig(c) +char c; +{ + IF isdigit(c) + THEN return(c-'0'); + ELIF isxdigit(c) + THEN return(c-'a'+10); + ELSE return(17); + FI +} + +symchar(dig) +{ + IF lastc=='\\' THEN readchar(); return(TRUE); FI + return( isalpha(lastc) ORF lastc=='_' ORF dig ANDF isdigit(lastc) ); +} + +varchk(name) +{ + IF isdigit(name) THEN return(name-'0'); FI + IF isalpha(name) THEN return((name&037)-1+10); FI + return(-1); +} + +chkloc(frame) +long frame; +{ + readsym(); + REP IF localsym(frame)==0 THEN error(BADLOC); FI + expv=localval; + PER !eqsym(cache_sym(symbol), isymbol,'~') DONE +} + +eqsym(s1, s2, c) +register char *s1, *s2; + char c; + { + + if (!strcmp(s1, s2)) + return(TRUE); + else if (*s1++ == c) + return(!strcmp(s1, s2)); + return(FALSE); + } diff --git a/bin/adb/findfn.c b/bin/adb/findfn.c new file mode 100644 index 0000000..be255b5 --- /dev/null +++ b/bin/adb/findfn.c @@ -0,0 +1,64 @@ +#include "defs.h" + + MSG NOCFN; + int callpc; + char localok; +extern struct SYMbol *symbol; + char *errflg; + char curov; + int overlay; + long var[36]; + +findroutine(cframe) + long cframe; +{ + register int narg, inst; + int lastpc, back2; + char v; + char savov, curovl; + + v=FALSE; localok=FALSE; lastpc=callpc; + if(overlay) { + /* + * Save the previous overlay. Don't restore it, + * so that the next call will have the correct previous + * overlay. The caller must save and restor the original + * overlay if needed. + */ + savov = curov; + curovl=get(cframe-2, DSP); + setovmap(curovl); + } + 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 (overlay) + setovmap(savov); /* previous overlay, for findsym */ + if (findsym((v ? lastpc : ((inst==04767?callpc:0) + back2)),ISYM) == -1 + && !v) + symbol = NULL; + else + localok=TRUE; + if (overlay) + setovmap(curovl); + inst = get(leng(callpc), ISP); + IF inst == 062706 /* add $n,sp */ + THEN + narg += get(leng(callpc+2), ISP)/2; + return(narg); + FI + if (inst == 05726 || inst == 010026) /* tst (sp)+ or mov r0,(sp)+ */ + return(narg+1); + IF inst == 022626 /* cmp (sp)+,(sp)+ */ + THEN + return(narg+2); + FI + return(narg); +} diff --git a/bin/adb/format.c b/bin/adb/format.c new file mode 100644 index 0000000..fbdf532 --- /dev/null +++ b/bin/adb/format.c @@ -0,0 +1,265 @@ +#include "defs.h" +#include + + MSG BADMOD; + MSG NOFORK; + MSG ADWRAP; +extern struct SYMbol *symbol; + int mkfault; + char *lp; + char *printptr, printbuf[]; + int maxoff; + int sigint; + int sigqit; + char *errflg; + char lastc; + long dot; + int dotinc; + long var[]; + +scanform(icount,ifp,itype,ptype) + long icount; + char *ifp; +{ + char *fp; + char modifier; + int fcount, init=1; + long savdot; + + WHILE icount + DO fp=ifp; + IF init==0 ANDF findsym(shorten(dot),ptype)==0 ANDF maxoff + THEN printf("\n%s:%16t", cache_sym(symbol)); + FI + savdot=dot; init=0; + + /*now loop over format*/ + WHILE *fp ANDF errflg==0 + DO IF isdigit(modifier = *fp) + THEN fcount=0; + WHILE isdigit(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((char *)0); FI + OD +} + +char * +exform(fcount,ifp,itype,ptype) + int fcount; + char *ifp; + int itype, ptype; +{ + /* execute single format item `fcount' times + * sets `dotinc' and moves `dot' + * returns address of next format item + */ + u_int w; + long savdot, wx; + char *fp; + char c, modifier, longpr; + struct { + long sa; + int sb,sc; + } fw; + + 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((char *)0); FI + var[0]=wx; + modifier = *fp++; + dotinc=(longpr?4:2);; + + if (!(printptr - printbuf) && modifier != 'a') + printf("%16m"); + + 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(itype,w); printc(EOR); break; + + case 'd': + printf("%-8d", w); break; + + case 'D': + printf("%-16D", wx); break; + + case 'f': + *(double *)&fw = 0.0; + fw.sa = wx; + printf("%-16.9f", *(double *)&fw); + dotinc=4; break; + + case 'F': + fw.sa = wx; + printf("%-32.18F", *(double *)&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; + char *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,SIG_IGN); + WHILE (rc = wait(&status)) != unixpid ANDF rc != -1 DONE + signal(SIGINT,sigint); + printc('!'); lp--; + FI +} + + +printesc(c) +{ + c &= STRIP; + IF c'~' ORF c=='@' + THEN printf("@%c",(c=='@' ? '@' : c^0140)); + ELSE printc(c); + FI +} + +long +inkdot(incr) +{ + long newdot; + + newdot=dot+incr; + IF (dot ^ newdot) >> 24 THEN error(ADWRAP); FI + return(newdot); +} diff --git a/bin/adb/input.c b/bin/adb/input.c new file mode 100644 index 0000000..cb7d1d5 --- /dev/null +++ b/bin/adb/input.c @@ -0,0 +1,73 @@ +#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 || c==';'); +} + +rdc() +{ REP readchar(); + PER lastc==SP ORF lastc==TB + DONE + return(lastc); +} + +readchar() +{ + IF eof + THEN lastc = '\0'; + ELSE IF lp==0 + THEN lp=line; + REP eof = read(infile,lp,1)==0; + IF mkfault THEN error((char *)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) + char *deformat; +{ + register char *fptr; + register int 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/bin/adb/main.c b/bin/adb/main.c new file mode 100644 index 0000000..74a695f --- /dev/null +++ b/bin/adb/main.c @@ -0,0 +1,158 @@ +#include "defs.h" + + MSG NOEOR; + char *myname; /* program name */ + int argcount; + int mkfault; + int executing; + int infile; + char *lp; + int maxoff; + int maxpos; + int (*sigint)(); + int (*sigqit)(); + int wtflag; + int kernel; + long maxfile; + long maxstor; + long txtsiz; + long datsiz; + long datbas; + long stksiz; + long ovlsiz; + int overlay; + char *errflg; + int exitflg; + int magic; + long entrypt; + char lastc; + int eof; + int lastcom; + long var[36]; + char *symfil; + char *corfil; + char *printptr; + char *Ipath = "/usr/share/adb"; + +long round(a,b) +long a, b; +{ + long w; + w = ((a+b-1)/b)*b; + return(w); +} + +/* error handling */ + +chkerr() +{ + IF errflg ORF mkfault + THEN error(errflg); + FI +} + +error(n) + char *n; +{ + errflg=n; + iclose(0, 1); oclose(); + longjmp(erradb,1); +} + +fault(a) +{ + signal(a,fault); + lseek(infile,0L,2); + mkfault++; +} + +/* set up files and initial address mappings */ + +main(argc, argv) + register char **argv; + int argc; +{ + short mynamelen; /* length of program name */ + + maxfile = 1L << 24; + maxstor = 1L << 16; + if (isatty(0)) + myname = *argv; + else + myname = "adb"; + mynamelen = strlen(myname); + + gtty(0,&adbtty); + gtty(0,&usrtty); + WHILE argc>1 + DO IF !strcmp("-w",argv[1]) + THEN wtflag=2; argc--; argv++; continue; + ELIF !strcmp("-k",argv[1]) + THEN kernel++; argc--; argv++; continue; + ELIF !strcmp("-I",argv[1]) + THEN Ipath = argv[2]; argc -= 2; argv += 2; continue; + 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 text overlay, enter total overlay area size */ + IF overlay + THEN var[VARO] = ovlsiz; + FI + + IF (sigint=signal(SIGINT,SIG_IGN))!=SIG_IGN + THEN sigint=fault; signal(SIGINT,fault); + FI + sigqit=signal(SIGQUIT,SIG_IGN); + siginterrupt(SIGINT, 1); + siginterrupt(SIGQUIT, 1); + setjmp(erradb); + IF executing THEN delbp(); FI + executing=FALSE; + + LOOP flushbuf(); + IF errflg + THEN printf("%s\n",errflg); + exitflg=(int)errflg; + errflg=0; + FI + IF mkfault + THEN mkfault=0; printc(EOR); + printf("%s\n", myname); + FI + IF myname ANDF !infile + THEN write(1,myname,mynamelen); + write(1,"> ",2); + FI + lp=0; rdc(); lp--; + IF eof + THEN IF infile + THEN iclose(-1, 0); 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/bin/adb/message.c b/bin/adb/message.c new file mode 100644 index 0000000..4395af6 --- /dev/null +++ b/bin/adb/message.c @@ -0,0 +1,30 @@ +#include "defs.h" + + 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 LONGFIL = "filename too long"; + MSG NOTOPEN = "cannot open"; + MSG TOODEEP = "$<< nesting too deep"; diff --git a/bin/adb/opset.c b/bin/adb/opset.c new file mode 100644 index 0000000..e3233cd --- /dev/null +++ b/bin/adb/opset.c @@ -0,0 +1,456 @@ +#if !defined(lint) && defined(DOSCCS) +static char sccsid[] = "@(#)opset.c 2.7 (2.11BSD) 2000/2/28"; +#endif + +#include "defs.h" + + char *errflg; + long dot; + int dotinc; + long var[]; + MAP datmap; + +#undef SINGLE + +/* 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 + +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, DOUBLW, "add", + 0007777, 0160000, DOUBLW, "sub", + 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", + 0000077, 0106700, SINGLW, "mfps", + 0000077, 0106400, SINGLW, "mtps", + 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", + 0000000, 0000006, NOADDR, "rtt", + 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", + 0000000, 0000007, NOADDR, "mfpt", + 0000077, 0007000, JMP, "csm", + 0000077, 0007300, SINGLW, "wrtlck", + 0000077, 0007200, SINGLW, "tstset", + 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, DFAULT, "spl", + 0177777, 0000000, DFAULT, "", +}; + +char *systab[] = { + "indir", /* 0 - indir*/ + "exit", + "fork", + "read", + "write", + "open", + "close", + "wait4", + NULL, /* 8 - unused */ + "link", + "unlink", /* 10 */ + "execv", + "chdir", + "fchdir", + "mknod", + "chmod", + "chown", + "chflags", + "fchflags", + "lseek", + "getpid", /* 20 */ + "mount", + "umount", + "__sysctl", + "getuid", + "geteuid", /* 25 */ + "ptrace", + "getppid", + NULL, /* 28 - unused */ + NULL, /* 29 - unused */ + NULL, /* 30 - unused */ + "sigaction", /* 31 - sigaction */ + "sigprocmask", /* 32 - sigprocmask */ + "access", + "sigpending", /* 34 - sigpending */ + "sigaltstack", /* 35 - sigaltstack */ + "sync", + "kill", + "stat", + "_getlogin", /* 39 - _getlogin */ + "lstat", + "dup", + "pipe", + "setlogin", /* 43 - unused */ + "profil", + "setuid", /* 45 - setuid */ + "seteuid", /* 46 - seteuid */ + "getgid", + "getegid", + "setgid", /* 49 - setgid */ + "setegid", /* 50 - setegid */ + "acct", + "phys", + "lock", + "ioctl", + "reboot", + NULL, /* 56 - unused */ + "symlink", + "readlink", + "execve", + "umask", + "chroot", + "fstat", + NULL, /* 63 - unused */ + NULL, /* 64 - unused */ + "pselect", /* 65 - pselect */ + "vfork", + NULL, /* 67 - unused */ + NULL, /* 68 - unused */ + "sbrk", + NULL, /* 70 - unused */ + NULL, /* 71 - unused */ + NULL, /* 72 - unused */ + NULL, /* 73 - unused */ + NULL, /* 74 - unused */ + NULL, /* 75 - unused */ + "vhangup", + NULL, /* 77 - unused */ + NULL, /* 78 - unused */ + "getgroups", + "setgroups", + "getpgrp", + "setpgrp", + "setitimer", + NULL, /* 84 - unused */ + NULL, /* 85 - unused */ + "getitimer", + NULL, /* 87 - unused */ + NULL, /* 88 - unused */ + "getdtablesize", + "dup2", + NULL, /* 91 - unused */ + "fcntl", + "select", + NULL, /* 94 - unused */ + "fsync", + "setpriority", + "socket", + "connect", + "accept", + "getpriority", + "send", + "recv", /* 102 - recv */ + "sigreturn", + "bind", + "setsockopt", + "listen", + "sigsuspend", /* 107 - sigsuspend */ + NULL, /* 108 - unused */ + NULL, /* 109 - unused */ + NULL, /* 110 - unused */ + NULL, /* 111 - unused */ + "old sigstack", /* 112 - sigstack COMPAT-43 for zork */ + "recvmsg", + "sendmsg", + NULL, /* 115 - unused */ + "gettimeofday", + "getrusage", + "getsockopt", + NULL, /* 119 - unused */ + "readv", + "writev", + "settimeofday", + "fchown", + "fchmod", + "recvfrom", + NULL, /* 126 - unused */ + NULL, /* 127 - unused */ + "rename", + "truncate", + "ftruncate", + "flock", + NULL, /* 132 - unused */ + "sendto", + "shutdown", + "socketpair", + "mkdir", + "rmdir", + "utimes", + NULL, /* 139 - unused */ + "adjtime", + "getpeername", + NULL, /* 142 - unused */ + NULL, /* 143 - unused */ + "getrlimit", + "setrlimit", + "killpg", + NULL, /* 147 - unused */ + "setquota", + "quota", + "getsockname", + /* + * 2.11BSD special calls + */ + NULL, /* 151 - unused */ + "nostk", + "fetchi", + "ucall", + "fperr", +}; + +#define NUMSYSCALLS (sizeof (systab) / sizeof (char *)) + +char *regname[] = { "r0", "r1", "r2", "r3", "r4", "r5", "sp", "pc"}; + + u_int type, space, incp; + +printins(idsp,ins) + register int ins; +{ + int byte; + register struct optab *p; + + type=DSYM; space=idsp; incp=2; + FOR p=optab;; p++ + DO IF (ins & ~p->mask) == p->val + THEN break; + FI + OD + printf(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: + if (ins < NUMSYSCALLS && systab[ins]) + printf("%8t%s", systab[ins]); + else + printf("%8t%d", ins); + break; + + case TRAP: + case DFAULT: + default: + printf("%8t%o", ins); + } + dotinc=incp; +} + +doubl(a,b) +{ + paddr("%8t",a); paddr(",",b); +} + +branch(s,ins) + char *s; + register int ins; +{ + printf(s); + IF ins&0200 THEN ins |= 0177400; FI + ins = shorten(dot) + (ins<<1) + 2; + psymoff(leng(ins),ISYM,""); +} + +paddr(s, a) + char *s; + register int a; +{ + register 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 = (int)regname[r]; + switch (a) { + /* r */ + case 000: + printf(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/bin/adb/output.c b/bin/adb/output.c new file mode 100644 index 0000000..980b7b4 --- /dev/null +++ b/bin/adb/output.c @@ -0,0 +1,323 @@ +#include "defs.h" + + int mkfault; + int infile; + int outfile = 1; + int maxpos; + char printbuf[MAXLIN]; + char *printptr = printbuf; + char *digitptr; + MSG TOODEEP; + long var[]; + +printc(c) + char c; +{ + char d; + char *q; + int posn, tabs, p; + + IF mkfault + THEN return; + ELIF (*printptr=c)==EOR + THEN tabs=0; posn=0; q=printbuf; + FOR p=0; p0 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 + IF printptr >= &printbuf[MAXLIN-9] THEN + write(outfile, printbuf, printptr-printbuf); + printptr = printbuf; + FI +} + +flushbuf() +{ IF printptr!=printbuf + THEN printc(EOR); + FI +} + +/*VARARGS*/ +printf(fmat,a1) + char *fmat; + char **a1; +{ + char *fptr, *s; + int *vptr; + long *dptr; + double *rptr; + int width, prec; + char c, adj; + int x, decpt, n; + long lx; + char digits[64]; + char *ecvt(); + + fptr = fmat; vptr = (int *)&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 == '*') + { + width = *vptr++; + fptr++; + } + if (*fptr == '.') + { + fptr++; + prec = convert(&fptr); + if (*fptr == '*') + { + prec = *vptr++; + fptr++; + } + } + else + prec = -1; + digitptr=digits; + dptr=(long *)(rptr=(double *)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=(char *)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 -= ((printptr - printbuf) % width); + FI + break; + default: + printc(c); vptr--; + } + + IF s==0 + THEN *digitptr=0; s=digits; + FI + n = strlen(s); + n=(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) + long tvec; +{ + register int i; + register char *timeptr; + extern char *ctime(); + + 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 +} + +convert(cp) + register char **cp; +{ + register char c; + int n = 0; + + WHILE ((c = *(*cp)++)>='0') ANDF (c<='9') DO n=n*10+c-'0'; OD + (*cp)--; + return(n); +} + +printnum(n,fmat,base) + register int n; +{ + register char k; + register int *dptr; + int digs[15]; + + dptr=digs; + IF n<0 ANDF fmat=='d' THEN n = -n; *digitptr++ = '-'; FI + WHILE n + DO *dptr++ = ((u_int)n)%base; + n=((u_int)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) + long o; + int s; +{ + int i; + long 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], *dptr; + char k; + double 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 +} + +#define MAXIFD 5 +struct { + int fd; + long r9; +} istack[MAXIFD]; + + int ifiledepth; + +iclose(stack, err) +{ + IF err + THEN IF infile + THEN close(infile); infile=0; + FI + WHILE --ifiledepth >= 0 + DO IF istack[ifiledepth].fd + THEN close(istack[ifiledepth].fd); infile=0; + FI + OD + ifiledepth = 0; + ELIF stack == 0 + THEN IF infile + THEN close(infile); infile=0; + FI + ELIF stack > 0 + THEN IF ifiledepth >= MAXIFD + THEN error(TOODEEP); + FI + istack[ifiledepth].fd = infile; + istack[ifiledepth].r9 = var[9]; + ifiledepth++; + infile = 0; + ELSE IF infile + THEN close(infile); infile=0; + FI + IF ifiledepth > 0 + THEN infile = istack[--ifiledepth].fd; + var[9] = istack[ifiledepth].r9; + FI + FI +} + +oclose() +{ + IF outfile!=1 + THEN flushbuf(); close(outfile); outfile=1; + FI +} + +endline() +{ + if ((printptr - printbuf) >= maxpos) + printc('\n'); +} diff --git a/bin/adb/pcs.c b/bin/adb/pcs.c new file mode 100644 index 0000000..5156b6a --- /dev/null +++ b/bin/adb/pcs.c @@ -0,0 +1,124 @@ +#include "defs.h" + + MSG NOBKPT; + MSG SZBKPT; + MSG EXBKPT; + MSG NOPCS; + MSG BADMOD; + +/* breakpoints */ + BKPTR bkpthead; + + char *lp; + char lastc; + u_int corhdr[ctob(USIZE)/sizeof(u_int)]; + MAP txtmap; + int signo; + long dot; + int pid; + long cntval; + long loopcnt; + int overlay; + char curov, symov; + +/* sub process control */ + +subpcs(modif) +{ + register int check; + int execsig, runmode; + register BKPTR bkptr; + char *comptr; + + execsig=0; loopcnt=cntval; + + switch(modif) { + + /* delete breakpoint */ + case 'd': case 'D': + if (symov && symov!=curov) + setovmap(symov); + IF (bkptr=scanbkpt(shorten(dot))) + THEN bkptr->flag=0; + if (pid) del1bp(bkptr); + return; + ELSE error(NOBKPT); + FI + + /* set breakpoint */ + case 'b': case 'B': + if (symov && symov!=curov) + setovmap(symov); + IF (bkptr=scanbkpt(shorten(dot))) + THEN bkptr->flag=0; + if (pid) del1bp(bkptr); + FI + FOR bkptr=bkpthead; bkptr; bkptr=bkptr->nxtbkpt + DO IF bkptr->flag == 0 + THEN break; + FI + OD + IF bkptr==0 + THEN IF (bkptr=(BKPTR)malloc(sizeof *bkptr)) == (BKPTR)NULL + THEN error(SZBKPT); + ELSE bkptr->nxtbkpt=bkpthead; + bkpthead=bkptr; + FI + FI + bkptr->loc = dot; + bkptr->initcnt = bkptr->count = cntval; + bkptr->flag = BKPTSET; + if (overlay && dot>txtmap.bo) + bkptr->ovly = symov ? symov : curov; + else bkptr->ovly = 0; /* base seg */ + check=MAXCOM-1; comptr=bkptr->comm; rdc(); lp--; + REP *comptr++ = readchar(); + PER check-- ANDF lastc!=EOR DONE + *comptr=0; lp--; + IF check + THEN if (pid) set1bp(bkptr); + 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(); + setbp(); + runmode=PT_CONTINUE; + break; + + /* single step */ + case 's': case 'S': + runmode=PT_STEP; + 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=PT_CONTINUE; + execsig=getsig(signo); + break; + + default: error(BADMOD); + } + + IF loopcnt>0 ANDF runpcs(runmode, execsig) + THEN printf("breakpoint%16t"); + ELSE printf("stopped at%16t"); + FI + printpc(); +} + diff --git a/bin/adb/print.c b/bin/adb/print.c new file mode 100644 index 0000000..2971efe --- /dev/null +++ b/bin/adb/print.c @@ -0,0 +1,420 @@ +#include "defs.h" +#include + + MSG LONGFIL; + MSG NOTOPEN; + MSG A68BAD; + MSG A68LNK; + MSG BADMOD; + MAP txtmap; + MAP datmap; + char curov; + int overlay; +extern struct SYMbol *symbol; + int lastframe; + int kernel; + int callpc; + int infile; + int outfile; + char *lp; + int maxoff; + int maxpos; + int octal; + long localval; + BKPTR bkpthead; + char lastc; + u_int corhdr[]; + u_int *uar0; + int fcor; + char *errflg; + int signo; + long dot; + long var[]; + char *symfil; + char *corfil; + int pid; + long adrval; + int adrflg; + long cntval; + int cntflg; + int overlay; + + REGLIST reglist [] = { + "ps", RPS, + "pc", PC, + "sp", R6, + "r5", R5, + "r4", R4, + "r3", R3, + "r2", R2, + "r1", R1, + "r0", R0 + }; + + REGLIST kregs[] = { + "sp", KSP, + "r5", KR5, + "r4", KR4, + "r3", KR3, + "r2", KR2, + "r1", KR1, + "r0", KR0 + }; + + +/* general printing routines ($) */ + +printtrace(modif) +{ + int narg, i, stat, name, limit; + u_int dynam; + register BKPTR bkptr; + char hi, lo; + int word, stack; + char *comptr; + long argp, frame, link; + register struct SYMbol *symp; + char savov; + + IF cntflg==0 THEN cntval = -1; FI + + switch (modif) { + + case '<': + IF cntval == 0 + THEN WHILE readchar() != EOR + DO OD + lp--; + break; + FI + IF rdc() == '<' + THEN stack = 1; + ELSE stack = 0; lp--; + FI + /* fall thru ... */ + case '>': + { + char file[64]; + char Ifile[128]; + extern char *Ipath; + int index; + + index=0; + 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 IF Ipath THEN + strcpy(Ifile, Ipath); + strcat(Ifile, "/"); + strcat(Ifile, file); + FI + IF strcmp(file, "-") != 0 + THEN iclose(stack, 0); + infile=open(file,0); + IF infile<0 + THEN infile = open(Ifile, 0); + FI + ELSE lseek(infile, 0L, 0); + FI + IF infile<0 + THEN infile=0; error(NOTOPEN); + ELSE IF cntflg + THEN var[9] = cntval; + ELSE var[9] = 1; + FI + FI + ELSE oclose(); + outfile = open(file, O_CREAT|O_WRONLY, 0644); + lseek(outfile,0L,2); + FI + + ELSE IF modif == '<' + THEN iclose(-1, 0); + ELSE oclose(); + 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': + printf("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 printf("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:(kernel?corhdr[KR5]:uar0[R5]))&EVEN; + lastframe=0; + savov = curov; + callpc=(adrflg?get(frame+2,DSP):(kernel?(-2):uar0[PC])); + WHILE cntval-- + DO chkerr(); + printf("%07O: ", frame); /* Add frame address info */ + narg = findroutine(frame); + printf("%s(", cache_sym(symbol)); + 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 + /* Add return-PC info. Force printout of + * symbol+offset (never just a number! ) by using + * max possible offset. Overlay has already been set + * properly by findfn. + */ + printf(") from "); + { + int savmaxoff = maxoff; + + maxoff = ((unsigned)-1)>>1; + psymoff((long)callpc,ISYM,""); + maxoff = savmaxoff; + } + printc('\n'); + + IF modif=='C' + THEN WHILE localsym(frame) + DO word=get(localval,DSP); + printf("%8t%s:%10t", cache_sym(symbol)); + IF errflg THEN printf("?\n"); errflg=0; ELSE printf("%o\n",word); FI + OD + FI + + lastframe=frame; + frame=get(frame, DSP)&EVEN; + IF kernel? ((u_int)frame>((u_int)0140000+ctob(USIZE))): + (frame==0) + THEN break; FI + OD + if (overlay) + setovmap(savov); + break; + + /*print externals*/ + case 'e': case 'E': + symset(); + WHILE (symp=symget()) + DO chkerr(); + IF (symp->type == N_EXT|N_DATA) || (symp->type== N_EXT|N_BSS) + THEN printf("%s:%12t%o\n", no_cache_sym(symp), + get(leng(symp->value),DSP)); + FI + OD + break; + + case 'a': case 'A': + frame=(adrflg ? adrval : uar0[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*/ + printf(" ? "); + 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"); + savov = curov; + FOR bkptr=bkpthead; bkptr; bkptr=bkptr->nxtbkpt + DO IF bkptr->flag + THEN printf("%-8.8d",bkptr->count); + curov = bkptr->ovly; + psymoff(leng(bkptr->loc),ISYM,"%24t"); + comptr=bkptr->comm; + WHILE *comptr DO printc(*comptr++); OD + FI + OD + curov = savov; + break; + + default: error(BADMOD); + } + +} + +printmap(s,amap) + char *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); + IF amap->bo + THEN printf("\n\t{ bo = %-16Q",amap->bo); + printf("eo = %-16Q",amap->eo); + printf("fo = %-16Q}",amap->fo); + FI + printf("\nb2 = %-16Q",amap->b2); + printf("e2 = %-16Q",amap->e2); + printf("f2 = %-16Q",amap->f2); + printc(EOR); +} + +/* + * ARGH. Completely incorrect. Apparently the way the FP regs were stored + * in the U area changed between V7 and 2.10/2.11BSD and adb was never fixed. + * The kernel always saves the FP regs as 'double' and saves the registers in + * order (0 thru 5) now. Tended to 1998/4/21 +*/ + +printfregs(longpr) + int longpr; + { + register int i; + int prec; + register struct fps *pfp; + + pfp = (struct fps *)&((U*)corhdr)->u_fps; + printf("fpsr\t%o\n", pfp->u_fpsr); + if (longpr || (pfp->u_fpsr & 0200)) + prec = 16; + else + prec = 8; + for (i = 0; i < 6; i++) + printf("fr%d\t%-24.*f\n", i, prec, pfp->u_fpregs[i]); + } + +printregs() +{ + register REGPTR p; + int v; + + IF kernel + THEN FOR p=kregs; p<&kregs[7]; p++ + DO printf("%s%8t%o%8t", p->rname, v=corhdr[p->roffs]); + valpr(v,DSYM); + printc(EOR); + OD + ELSE FOR p=reglist; p < ®list[NREG]; p++ + DO printf("%s%8t%o%8t", p->rname, v=uar0[p->roffs]); + valpr(v,(p->roffs==PC?ISYM:DSYM)); + printc(EOR); + OD + IF overlay + THEN setovmap(((U *)corhdr)->u_ovdata.uo_curov); + var[VARC] = curov; + printf("ov%8t%o\n", curov); + FI + printpc(); + FI +} + +getreg(regnam) +{ + register REGPTR p; + register char *regptr; + char regnxt; + + IF kernel THEN return(NOREG); FI /* not supported */ + regnxt=readchar(); + FOR p=reglist; p<®list[NREG]; p++ + DO regptr=p->rname; + IF (regnam == *regptr++) ANDF (regnxt == *regptr) + THEN return(p->roffs); + FI + OD + IF regnam == 'o' && regnxt == 'v' + THEN return((u_int *)&(((U *)corhdr)->u_ovdata.uo_curov) - uar0); + FI + lp--; + return(NOREG); +} + +printpc() +{ + dot=uar0[PC]; + psymoff(dot,ISYM,":%16t"); printins(ISP,chkget(dot,ISP)); + printc(EOR); +} + +sigprint() +{ + extern char *sys_siglist[]; /* signal list */ + + if (signo >= 0 && signo < NSIG) + printf("%s",sys_siglist[signo]); + else + printf("unknown signal %d",signo); +} diff --git a/bin/adb/runpcs.c b/bin/adb/runpcs.c new file mode 100644 index 0000000..1dc1f35 --- /dev/null +++ b/bin/adb/runpcs.c @@ -0,0 +1,298 @@ +#include "defs.h" +#include + + MSG NOFORK; + MSG ENDPCS; + MSG BADWAIT; + char *lp; + int sigint; + int sigqit; + BKPTR bkpthead; + REGLIST reglist[]; + char lastc; + u_int corhdr[]; + u_int *uar0; + int overlay; + char curov; + int fcor; + int fsym; + char *errflg; + int signo; + long dot; + char *symfil; + int wtflag; + int pid; + long expv; + int adrflg; + long loopcnt; + long var[]; + int userpc=1; + +/* service routines for sub process control */ + +getsig(sig) + { + return(expr(0) ? shorten(expv) : sig); + } + +runpcs(runmode, execsig) +{ + int rc; + register BKPTR bkpt; + + IF adrflg + THEN userpc=shorten(dot); + FI + if (overlay) + choverlay(((U*)corhdr)->u_ovdata.uo_curov); + 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(uar0[PC]-2)) + THEN /*stopped at bkpt*/ + userpc=uar0[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() +{ + register BKPTR bkptr; + + IF pid + THEN ptrace(PT_KILL,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(PT_TRACE_ME,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((char *)0); + FI + FI +} + +execbkpt(bkptr) +BKPTR bkptr; +{ + int bkptloc; +#ifdef DEBUG + printf("exbkpt: %d\n",bkptr->count); +#endif + bkptloc = bkptr->loc; + ptrace(PT_WRITE_I,pid,bkptloc,bkptr->ins); + stty(0,&usrtty); + ptrace(PT_STEP,pid,bkptloc,0); + bpwait(); chkerr(); + ptrace(PT_WRITE_I,pid,bkptloc,BPT); + bkptr->flag=BKPTSET; +} + +doexec() +{ + char *argl[MAXARG]; + char args[LINSIZ]; + char *p, **ap, *filnam; + + ap=argl; p=args; + *ap++=symfil; + REP IF rdc()==EOR THEN break; FI + /* + * If we find an argument beginning with a `<' or a `>', open + * the following file name for input and output, respectively + * and back the argument collocation pointer, p, back up. + */ + *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 + p = *ap; + ELIF **ap=='>' + THEN close(1); + IF open(filnam, O_CREAT|O_WRONLY, 0666)<0 + THEN printf("%s: cannot create\n",filnam); exit(0); + FI + p = *ap; + ELSE ap++; + FI + PER lastc!=EOR DONE + *ap++=0; + execv(symfil, argl); +} + +BKPTR scanbkpt(adr) +{ + register BKPTR bkptr; + + FOR bkptr=bkpthead; bkptr; bkptr=bkptr->nxtbkpt + DO IF bkptr->flag ANDF bkptr->loc==adr ANDF + (bkptr->ovly == 0 || bkptr->ovly==curov) + THEN break; + FI + OD + return(bkptr); +} + +delbp() +{ + register BKPTR bkptr; + + FOR bkptr=bkpthead; bkptr; bkptr=bkptr->nxtbkpt + DO IF bkptr->flag + THEN del1bp(bkptr); + FI + OD +} + +del1bp(bkptr) +BKPTR bkptr; +{ + if (bkptr->ovly) + choverlay(bkptr->ovly); + ptrace(PT_WRITE_I,pid,bkptr->loc,bkptr->ins); +} + +/* change overlay in subprocess */ +choverlay(ovno) + char ovno; +{ + errno = 0; + if (overlay && pid && ovno>0 && ovno<=NOVL) + ptrace(PT_WRITE_U,pid,&(((U*)0)->u_ovdata.uo_curov),ovno); + IF errno + THEN printf("cannot change to overlay %d\n", ovno); + FI +} + +setbp() +{ + register BKPTR bkptr; + + FOR bkptr=bkpthead; bkptr; bkptr=bkptr->nxtbkpt + DO IF bkptr->flag + THEN set1bp(bkptr); + FI + OD +} +set1bp(bkptr) +BKPTR bkptr; +{ + register int a; + + a = bkptr->loc; + if (bkptr->ovly) + choverlay(bkptr->ovly); + bkptr->ins = ptrace(PT_READ_I, pid, a, 0); + ptrace(PT_WRITE_I, pid, a, BPT); + IF errno + THEN printf("cannot set breakpoint: "); + psymoff(leng(bkptr->loc),ISYM,"\n"); + FI +} + +bpwait() +{ + register int w; + int stat; + + signal(SIGINT, SIG_IGN); + 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 printf(" - core dumped"); + close(fcor); + setcor(); + FI + pid=0; + errflg=ENDPCS; + ELSE signo = stat>>8; + IF signo!=SIGTRAP + THEN sigprint(); + ELSE signo=0; + FI + flushbuf(); + FI +} + +readregs() +{ + /*get REG values from pcs*/ + register u_int i, *afp; + char ovno; + + FOR i=0; iu_ovdata.uo_curov),0); + var[VARC] = ovno; + ((U *)corhdr)->u_ovdata.uo_curov = ovno; + setovmap(ovno); + FI +/* + * The following section was totally and completely broken. It had been that + * way since V7. If you've ever wondered why the FP regs couldn't be displayed + * for a traced program that was the reason. The reading of the FP regs was + * redone 1998/4/21 for 2.11BSD. +*/ + i = offsetof(struct user, u_fps); + afp = (u_int *)&((U *)corhdr)->u_fps; + while (i < offsetof(struct user, u_fps) + sizeof (struct fps)) + { + *afp++ = ptrace(PT_READ_U, pid, i, 0); + i += sizeof (u_int); + } +} diff --git a/bin/adb/setup.c b/bin/adb/setup.c new file mode 100644 index 0000000..7b446a2 --- /dev/null +++ b/bin/adb/setup.c @@ -0,0 +1,218 @@ +#include "defs.h" +#include + + MAP txtmap; + MAP datmap; + int wtflag; + int kernel; + int fcor; + int fsym; + long maxfile; + long maxstor; + long txtsiz; + long datsiz; + long bss; + long datbas; + long stksiz; + char *errflg; + int magic; + long entrypt; + long var[]; + int argcount; + int signo; + u_int corhdr[ctob(USIZE)/sizeof(u_int)]; + u_int *uar0 = UAR0; + char *symfil = "a.out"; + char *corfil = "core"; + struct ovlhdr ovlseg; + long ovlsiz; + long ovloff[NOVL+1]; + char startov; + int overlay; + off_t symoff, stroff; + +setsym() +{ + struct xexec hdr; + int ovly; + + bzero(&txtmap, sizeof (txtmap)); + fsym=getfile(symfil,1); + txtmap.ufd=fsym; + + if (read(fsym, &hdr, sizeof (hdr)) >= (int)sizeof (hdr.e)) + { + magic= hdr.e.a_magic; + txtsiz = hdr.e.a_text; + datsiz = hdr.e.a_data; + bss = hdr.e.a_bss; + entrypt = hdr.e.a_entry; + + txtmap.f1 = N_TXTOFF(hdr.e); + symoff = N_SYMOFF(hdr); + stroff = N_STROFF(hdr); + + switch (magic) + { + case 0407: + txtmap.e1 = txtmap.e2 = txtsiz+datsiz; + txtmap.f2 = txtmap.f1; + break; + case 0410: + txtmap.e1 = txtsiz; + txtmap.b2 = round(txtsiz, TXTRNDSIZ); + txtmap.e2 = txtmap.b2+datsiz; + txtmap.f2 = txtsiz + txtmap.f1; + break; + case 0405: + case 0411: + txtmap.e1 = txtsiz; + txtmap.e2 = datsiz; + txtmap.f2 = txtsiz + txtmap.f1; + break; + case 0430: + case 0431: + ovlseg = hdr.o; + txtmap.e1 = txtsiz; + txtmap.bo = round(txtsiz, TXTRNDSIZ); + FOR ovly = 0; ovly < NOVL; ovly++ + DO ovloff[ovly] = ovlsiz + txtsiz + + txtmap.f1; + ovlsiz += ovlseg.ov_siz[ovly]; + OD + IF magic == 0430 + THEN txtmap.b2 = + round(txtmap.bo+(long)ovlseg.max_ovl, TXTRNDSIZ); + FI + txtmap.f2 = txtmap.f1 + txtsiz+ovlsiz; + txtmap.e2 = txtmap.b2 + datsiz; + overlay = 1; + break; + default: + magic = 0; + txtsiz = 0; + datsiz = 0; + bss = 0; + entrypt = 0; + } + datbas = txtmap.b2; + symINI(&hdr); + } + IF magic==0 THEN txtmap.e1=maxfile; FI +} + +setcor() +{ + fcor=getfile(corfil,2); + datmap.ufd=fcor; + IF read(fcor, corhdr, sizeof corhdr)==sizeof corhdr + THEN IF !kernel + THEN txtsiz = ((U*)corhdr)->u_tsize << 6; + datsiz = ((U*)corhdr)->u_dsize << 6; + stksiz = ((U*)corhdr)->u_ssize << 6; + datmap.f1 = ctob(USIZE); + datmap.b2 = maxstor-stksiz; + datmap.e2 = maxstor; + ELSE datsiz = round(datsiz+bss,64L); + stksiz = (long) ctob(USIZE); + datmap.f1 = 0; + datmap.b2 = 0140000L; + datmap.e2 = 0140000L + ctob(USIZE); + FI + switch (magic) + { + case 0407: + datmap.b1 = 0; + datmap.e1 = txtsiz+datsiz; + IF kernel + THEN datmap.f2 = (long)corhdr[KA6] * + 0100L; + ELSE datmap.f2 = ctob(USIZE)+txtsiz+datsiz; + FI + break; + + case 0410: + datmap.b1 = round(txtsiz, TXTRNDSIZ); + datmap.e1 = datmap.b1+datsiz; + datmap.f2 = datsiz+ctob(USIZE); + break; + + case 0405: + case 0411: + case 0431: + datmap.b1 = 0; + datmap.e1 = datsiz; + IF kernel + THEN datmap.f2 = (long)corhdr[KA6] * + 0100L; + ELSE datmap.f2 = datsiz+ctob(USIZE); + FI + break; + + case 0430: + datmap.b1 = round(round(txtsiz, + TXTRNDSIZ)+ovlseg.max_ovl, + TXTRNDSIZ); + datmap.e1 = datmap.b1+datsiz; + IF kernel + THEN datmap.b1 = 0; + datmap.f2 = (long)corhdr[KA6] * + 0100L; + ELSE datmap.f2 = datsiz+ctob(USIZE); + FI + break; + + default: + magic = 0; + datmap.b1 = 0; + datmap.e1 = maxfile; + datmap.f1 = 0; + datmap.b2 = 0; + datmap.e2 = 0; + datmap.f2 = 0; + } + datbas = datmap.b1; + if (!kernel && magic) { + /* + * Note that we can no longer compare the magic + * number of the core against that of the object + * since the user structure no longer contains + * the exec header ... + */ + register u_int *ar0; + ar0 = (u_int *)(((U *)corhdr)->u_ar0); + if (ar0 > (u_int *)0140000 + && ar0 < (u_int *)(0140000 + ctob(USIZE)) + && !((unsigned)ar0&01)) + uar0 = (u_int *)&corhdr[ar0-(u_int *)0140000]; + if (overlay) { + startov = ((U *)corhdr)->u_ovdata.uo_curov; + var[VARC] = (long)startov; + setovmap(startov); + } + /* else dig out __ovno if overlaid? */ + } + ELSE datmap.e1 = maxfile; + FI +} + +getfile(filnam,cnt) + char *filnam; + int cnt; +{ + register int f; + + IF strcmp("-",filnam) + THEN f = open(filnam,wtflag); + IF f < 0 ANDF argcount>cnt + THEN IF wtflag + THEN f = open(filnam, O_CREAT|O_TRUNC|wtflag,644); + FI + IF f < 0 + THEN printf("cannot open `%s'\n", filnam); + FI + FI + ELSE f = -1; + FI + return(f); +} diff --git a/bin/adb/sym.c b/bin/adb/sym.c new file mode 100644 index 0000000..98943f8 --- /dev/null +++ b/bin/adb/sym.c @@ -0,0 +1,351 @@ +#include +#include "defs.h" +#include +#include + + struct SYMbol *symbol; + char localok; + int lastframe; + u_int maxoff; + long maxstor; + MAP txtmap; + char curov; + int overlay; + long localval; + char *errflg; + u_int findsym(); + + struct SYMcache + { + char *name; + int used; + struct SYMbol *syment; + }; + +#ifndef NUM_SYMS_CACHE +#define NUM_SYMS_CACHE 50 +#endif + +static struct SYMcache symcache[NUM_SYMS_CACHE]; +static struct SYMcache *endcache = &symcache[NUM_SYMS_CACHE]; +static struct SYMbol *symtab; +static FILE *strfp; +static int symcnt; +static int symnum; +static char *sgets(); + +extern char *myname, *symfil, *strdup(); +extern off_t symoff, stroff; + +/* symbol table and file handling service routines */ + +valpr(v,idsp) +{ + u_int d; + + d = findsym(v,idsp); + IF d < maxoff + THEN printf("%s", cache_sym(symbol)); + IF d + THEN printf(OFFMODE, d); + FI + FI +} + +localsym(cframe) + long cframe; +{ + int symflg; + + WHILE symget() && localok && (symflg= (int)symbol->type) != N_FN + && *no_cache_sym(symbol) != '~' + DO IF symflg>=2 ANDF symflg<=4 + THEN localval=symbol->value; + return(TRUE); + ELIF symflg==1 + THEN localval=leng(shorten(cframe)+symbol->value); + return(TRUE); + ELIF symflg==20 ANDF lastframe + THEN localval=leng(lastframe+2*symbol->value - (overlay?12:10)); + return(TRUE); + FI + OD + return(FALSE); +} + +psymoff(v,type,s) + long v; + int type; + char *s; +{ + u_int w; + + w = findsym(shorten(v),type); + IF w >= maxoff + THEN printf(LPRMODE,v); + ELSE printf("%s", cache_sym(symbol)); + IF w THEN printf(OFFMODE,w); FI + FI + printf(s); +} + +u_int +findsym(svalue,type) + u_int svalue; + int type; + { + long diff, value, symval; + register struct SYMbol *sp; + struct SYMbol *symsav; + int i; + char ov = 0; + + if (txtmap.bo && type==ISYM && svalue>=txtmap.bo) + ov=curov; + value = svalue; + diff = 0377777L; + + if (type != NSYM && symnum) + { + for (i = 0, sp = symtab; diff && i < symnum; i++, sp++) + { + if (SYMTYPE(sp->type) == type && + (!ov || ov == sp->ovno)) + { + symval = leng(sp->value); + if ((value - symval) < diff && + value >= symval) + { + diff = value - symval; + symsav = sp; + } + } + } + } + if (symsav) + symcnt = symsav - symtab; + symbol = symsav; + return(shorten(diff)); + } + +/* sequential search through table */ +symset() + { + + symcnt = -1; + } + +struct SYMbol * +symget() + { + + if (symcnt >= symnum || !symnum) + return(NULL); + symcnt++; + symbol = &symtab[symcnt]; + return(symbol); + } + +/* + * This only _looks_ expensive ;-) The extra scan over the symbol + * table allows us to cut down the amount of memory needed. This is + * where symbols with string table offsets over 64kb are excluded. Also, + * a late addition to the program excludes register symbols - the assembler + * generates *lots* of them and they're useless to us. +*/ +symINI(ex) + struct exec *ex; + { + register struct SYMbol *sp; + register FILE *fp; + struct nlist sym; + int i, nused, globals_only = 0; + + fp = fopen(symfil, "r"); + strfp = fp; + if (!fp) + return; + fcntl(fileno(fp), F_SETFD, 1); + + symnum = ex->a_syms / sizeof (sym); + + fseek(fp, symoff, L_SET); + nused = 0; + for (i = 0; i < symnum; i++) + { + fread(&sym, sizeof (sym), 1, fp); + if (sym.n_type == N_REG) + continue; + if (sym.n_un.n_strx >= 0200000L) + printf("symbol %d string offset > 64k - ignored\n",i); + else + nused++; + } + fseek(fp, symoff, L_SET); + + symtab = (struct SYMbol *)malloc(nused * sizeof (struct SYMbol)); + if (!symtab) + { + globals_only = 1; + nused = 0; + for (symcnt = 0; symcnt < symnum; symcnt++) + { + fread(&sym, 1, sizeof (sym), fp); + if (sym.n_type == N_REG) + continue; + if ((sym.n_type & N_EXT) == 0) + continue; + if (sym.n_un.n_strx >= 0200000L) + continue; + nused++; + } + symtab = (struct SYMbol *)malloc(nused * sizeof(struct SYMbol)); + if (!symtab) + { + printf("%s: no memory for symbols\n", myname); + symnum = 0; + return; + } + } + fseek(fp, symoff, L_SET); + sp = symtab; + for (symcnt = 0; symcnt < symnum; symcnt++) + { + fread(&sym, 1, sizeof (sym), fp); + if (sym.n_type == N_REG) + continue; + if (globals_only && !(sym.n_type & N_EXT)) + continue; + if (sym.n_un.n_strx >= 0200000L) + continue; + sp->value = sym.n_value; + sp->ovno = sym.n_ovly; + sp->type = sym.n_type; + sp->soff = shorten(sym.n_un.n_strx); + sp++; + } + symnum = nused; +#ifdef debug + printf("%d symbols loaded\n", nused); +#endif + if (globals_only) + printf("%s: could only do global symbols\n", myname); + symset(); + return(0); + } + +/* + * Look in the cache for a symbol in memory. If it is not found use + * the least recently used entry in the cache and update it with the + * symbol name. +*/ +char * +cache_sym(symp) + register struct SYMbol *symp; + { + register struct SYMcache *sc = symcache; + struct SYMcache *current; + int lru; + + if (!symp) + return("?"); + for (current = NULL, lru = 30000 ; sc < endcache; sc++) + { + if (sc->syment == symp) + { + sc->used++; + if (sc->used >= 30000) + sc->used = 10000; + return(sc->name); + } + if (sc->used < lru) + { + lru = sc->used; + current = sc; + } + } + sc = current; + if (sc->name) + free(sc->name); + sc->used = 1; + sc->syment = symp; + sc->name = strdup(sgets(symp->soff)); + return(sc->name); + } + +/* + * We take a look in the cache but do not update the cache on a miss. + * This is done when scanning thru the symbol table (printing all externals + * for example) for large numbers of symbols which probably won't be + * used again any time soon. +*/ +char * +no_cache_sym(symp) + register struct SYMbol *symp; + { + register struct SYMcache *sc = symcache; + + if (!symp) + return("?"); + for ( ; sc < endcache; sc++) + { + if (sc == symp) + { + sc->used++; + if (sc->used >= 30000) + sc->used = 10000; + return(sc->name); + } + } + return(sgets(symp->soff)); + } + +/* + * Looks in the cache for a match by string value rather than string + * file offset. +*/ + +struct SYMbol * +cache_by_string(str, ovsym) + char *str; + int ovsym; + { + register struct SYMcache *sc; + + for (sc = symcache; sc < endcache; sc++) + { + if (!sc->name) + continue; + if (eqsym(sc->name, str, ovsym ? '~' : '_')) + break; + } + if (sc < endcache) + { + sc->used++; + if (sc->used > 30000) + sc->used = 10000; + return(sc->syment); + } + return(0); + } + +static char * +sgets(soff) + u_short soff; + { + static char symname[MAXSYMLEN + 2]; + register char *buf = symname; + int c; + register int i; + + fseek(strfp, stroff + soff, L_SET); + for (i = 0; i < MAXSYMLEN; i++) + { + c = getc(strfp); + *buf++ = c; + if (c == '\0') + break; + } + *buf = '\0'; + return(symname); + } diff --git a/bin/ar/Makefile b/bin/ar/Makefile new file mode 100644 index 0000000..0046ad9 --- /dev/null +++ b/bin/ar/Makefile @@ -0,0 +1,36 @@ +# @(#)Makefile 5.8 (Berkeley) 3/10/91 + +CFLAGS= -I. -O +LFLAGS= -z + +SRCS= append.c ar.c archive.c contents.c delete.c extract.c misc.c \ + move.c print.c replace.c + +EXTRASRCS= strmode.c + +OBJS= append.o ar.o archive.o contents.o delete.o extract.o misc.o \ + move.o print.o replace.o + +EXTRAOBJ= strmode.o # strftime.o ctime.o + +all: ar ar.1.0 ar.5.0 + +ar: ${OBJS} ${EXTRAOBJ} + cc ${LFLAGS} -o ar ${OBJS} ${EXTRAOBJ} + +ar.1.0: ar.1 + nroff -man ar.1 > ar.1.0 + +ar.5.0: ar.5.5 + nroff -man ar.5.5 > ar.5.0 + +install: + install -s -m 755 ar ${DESTDIR}/bin/ar + install -c -o bin -g bin -m 444 ar.1.0 ${DESTDIR}/usr/man/cat1/ar.0 + install -c -o bin -g bin -m 444 ar.5.0 ${DESTDIR}/usr/man/cat5/ar.0 + +lint: + lint -havx -I. ${SRCS} ${EXTRASRCS} + +clean: + rm -f core ar *.o ar.1.0 ar.5.0 diff --git a/bin/ar/append.c b/bin/ar/append.c new file mode 100644 index 0000000..1893ef7 --- /dev/null +++ b/bin/ar/append.c @@ -0,0 +1,90 @@ +/*- + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Hugh Smith at The University of Guelph. + * + * 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. + */ + +#if defined(DOSCCS) && !defined(lint) +static char sccsid[] = "@(#)append.c 5.6 (Berkeley) 3/12/91"; +#endif + +#include +#include +#include +#include +#include +#include +#include +#include "archive.h" +#include "extern.h" + +extern char *archive; /* archive name */ +extern int errno; + +/* + * append -- + * Append files to the archive - modifies original archive or creates + * a new archive if named archive does not exist. + */ +append(argv) + char **argv; +{ + register int fd, afd; + register char *file; + struct stat sb; + CF cf; + int eval; + + afd = open_archive(O_CREAT|O_RDWR); + if (lseek(afd, (off_t)0, L_XTND) == (off_t)-1) + error(archive); + + /* Read from disk, write to an archive; pad on write. */ + SETCF(0, 0, afd, archive, WPAD); + for (eval = 0; file = *argv++;) { + if ((fd = open(file, O_RDONLY)) < 0) { + (void)fprintf(stderr, + "ar: %s: %s.\n", file, strerror(errno)); + eval = 1; + continue; + } + if (options & AR_V) + (void)printf("q - %s\n", file); + cf.rfd = fd; + cf.rname = file; + put_arobj(&cf, &sb); + (void)close(fd); + } + close_archive(afd); + return(eval); +} diff --git a/bin/ar/ar.1 b/bin/ar/ar.1 new file mode 100644 index 0000000..008fa19 --- /dev/null +++ b/bin/ar/ar.1 @@ -0,0 +1,255 @@ +.\" Copyright (c) 1990 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Hugh Smith at The University of Guelph. +.\" +.\" 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. +.\" +.\" @(#)ar.1 6.10 (Berkeley) 3/21/91 +.\" +.TH AR 1 "March 21, 1991" +.AT 3 +.SH NAME +ar \- create and maintain library archives +.SH SYNOPSIS +.nf +.ft B +ar -d [-Tv] archive file ... +ar -m [-Tv] archive file ... +ar -m [-abiTv] position archive file ... +ar -p [-Tv] archive [file ...] +ar -q [-cTv] archive file ... +ar -r [-cuTv] archive file ... +ar -r [-abciuTv] position archive file ... +ar -t [-Tv] archive [file ...] +ar -x [-ouTv] archive [file ...] +.fi +.ft R +.SH DESCRIPTION +The +.I ar +utility creates and maintains groups of files combined into an archive. +Once an archive has been created, new files can be added and existing +files can be extracted, deleted, or replaced. +.PP +Files are named in the archive by a single component, i.e., if a file +referenced by a path containing a slash (``/'') is archived it will be +named by the last component of that path. +When matching paths listed on the command line against file names stored +in the archive, only the last component of the path will be compared. +.PP +All informational and error messages use the path listed on the command +line, if any was specified, otherwise the name in the archive is used. +If multiple files in the archive have the same name, and paths are listed +on the command line to ``select'' archive files for an operation, only the +.B first +file with a matching name will be selected. +.PP +The normal use of +.I ar +is for the creation and maintenance of libraries suitable for use with +the loader (see +.IR ld (1)) +although it is not restricted to this purpose. +The options are as follows: +.TP +\-a +A positioning modifier used with the options \-r and \-m. +The files are entered or moved +.B after +the archive member +.IR position , +which must be specified. +.TP +\-b +A positioning modifier used with the options \-r and \-m. +The files are entered or moved +.B before +the archive member +.IR position , +which must be specified. +.TP +\-c +Whenever an archive is created, an informational message to that effect +is written to standard error. +If the \-c option is specified, +.I ar +creates the archive silently. +.TP +\-d +Delete the specified archive files. +.TP +\-i +Identical to the \-b option. +.TP +\-m +Move the specified archive files within the archive. +If one of the options \-a, \-b or \-i are specified, the files are moved +before or after the +.I position +file in the archive. +If none of those options are specified, the files are moved +to the end of the archive. +.TP +\-o +Set the access and modification times of extracted files to the +modification time of the file when it was entered into the archive. +This will fail if the user is not the owner of the extracted file +or the super-user. +.TP +\-p +Write the contents of the specified archive files to the standard output. +If no files are specified, the contents of all the files in the archive +are written in the order they appear in the archive. +.TP +\-q +(Quickly) append the specified files to the archive. +If the archive does not exist a new archive file is created. +Much faster than the \-r option, when creating a large archive +piece-by-piece, as no checking is done to see if the files already +exist in the archive. +.TP +\-r +Replace or add the specified files to the archive. +If the archive does not exist a new archive file is created. +Files that replace existing files do not change the order of the files +within the archive. +New files are appended to the archive unless one of the options \-a, \-b +or \-i is specified. +.TP +\-T +Select and/or name archive members using only the first fifteen characters +of the archive member or command line file name. +The historic archive format had sixteen bytes for the name, but some +historic archiver and loader implementations were unable to handle names +that used the entire space. +This means that file names that are not unique in their first fifteen +characters can subsequently be confused. +A warning message is printed to the standard error output if any file +names are truncated. +(See +.IR ar (5) +for more information.) +.TP +\-t +List the specified files in the order in which they appear in the archive, +each on a separate line. +If no files are specified, all files in the archive are listed. +.TP +\-u +Update files. +When used with the \-r option, files in the archive will be replaced +only if the disk file has a newer modification time than the file in +the archive. +When used with the \-x option, files in the archive will be extracted +only if the archive file has a newer modification time than the file +on disk. +.TP +\-v +Provide verbose output. +When used with the \-d, \-m, \-q or \-x options, +.I ar +gives a file-by-file description of the archive modification. +This description consists of three, white-space separated fields: the +option letter, a dash (``-'') and the file name. +When used with the \-r option, +.I ar +displays the description as above, but the initial letter is an ``a'' if +the file is added to the archive and an ``r'' if the file replaces a file +already in the archive. +.IP +When used with the \-p option, +the name of each printed file is written to the standard output before +the contents of the file, preceded by a single newline character, and +followed by two newline characters, enclosed in less-than (``<'') and +greater-than (``>'') characters. +.IP +When used with the \-t option, +.I ar +displays an ``ls -l'' style listing of information about the members of +the archive. +This listing consists of eight, white-space separated fields: +the file permissions (see +.IR strmode (3)), +the decimal user and group ID's, separated by a single slash (``/''), +the file size (in bytes), the file modification time (in the +.IR date (1) +format ``%b %e %H:%M %Y''), and the name of the file. +.TP +\-x +Extract the specified archive members into the files named by the command +line arguments. +If no members are specified, all the members of the archive are extracted into +the current directory. +.IP +If the file does not exist, it is created; if it does exist, the owner +and group will be unchanged. +The file access and modification times are the time of the extraction +(but see the \-o option). +The file permissions will be set to those of the file when it was entered +into the archive; this will fail if the user is not the owner of the +extracted file or the super-user. +.PP +The +.I ar +utility exits 0 on success, and >0 if an error occurs. +.SH ENVIRONMENT +.TP +TMPDIR +The pathname of the directory to use when creating temporary files. +.SH FILES +.TP 14 +/tmp +default temporary file directory +.TP 14 +ar.XXXXXX +temporary file names +.SH COMPATIBILITY +By default, +.I ar +writes archives that may be incompatible with historic archives, as +the format used for storing archive members with names longer than +fifteen characters has changed. +This implementation of +.I ar +is backward compatible with previous versions of +.I ar +in that it can read and write (using the \-T option) historic archives. +The \-T option is provided for compatibility only, and will be deleted +in a future release. +See +.IR ar (5) +for more information. +.SH STANDARDS +The +.I ar +utility is expected to offer a superset of the POSIX 1003.2 functionality. +.SH "SEE ALSO" +ld(1), ranlib(1), strmode(3), ar(5) diff --git a/bin/ar/ar.5.5 b/bin/ar/ar.5.5 new file mode 100644 index 0000000..31c5c9e --- /dev/null +++ b/bin/ar/ar.5.5 @@ -0,0 +1,143 @@ +.\" Copyright (c) 1990, 1991 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. +.\" +.\" @(#)ar.5.5 6.3 (Berkeley) 5/10/91 +.\" 6.3.1 (2.11BSD) 9/24/93 +.\" +.TH AR 5 "September 24, 1993" +.UC 2 +.SH NAME +ar \- archive (library) file format +.SH SYNOPSIS +#include +.SH DESCRIPTION +The archive command +.I ar +combines several files into one. +Archives are mainly used as libraries of object files intended to be +loaded using the link-editor +.IR ld (1). +.PP +A file created with +.I ar +begins with the ``magic'' string "!\en". +The rest of the archive is made up of objects, each of which is composed +of a header for a file, a possible file name, and the file contents. +The header is portable between machine architectures, and, if the file +contents are printable, the archive is itself printable. +.PP +The header is made up of six variable length +ASCII +fields, followed by a +two character trailer. +The fields are the object name (16 characters), the file last modification +time (12 characters), the user and group id's (each 6 characters), the file +mode (8 characters) and the file size (10 characters). +All numeric fields are in decimal, except for the file mode which is in +octal. +.PP +The modification time is the file +.I st_mtime +field, i.e., +.B CUT +seconds since +the epoch. +The user and group id's are the file +.I st_uid +and +.I st_gid +fields. +The file mode is the file +.I st_mode +field. +The file size is the file +.I st_size +field. +The two-byte trailer is the string "\`\en". +.PP +Only the name field has any provision for overflow. +If any file name is more than 16 characters in length or contains an +embedded space, the string "#1/" followed by the +ASCII +length of the +name is written in the name field. +The file size (stored in the archive header) is incremented by the length +of the name. +The name is then written immediately following the archive header. +.PP +Any unused characters in any of these fields are written as space +characters. +If any fields are their particular maximum number of characters in +length, there will be no separation between the fields. +.PP +Objects in the archive are always an even number of bytes long; files +which are an odd number of bytes long are padded with a newline (``\en'') +character, although the size in the header does not reflect this. +.SH SEE ALSO +.IR ar (1), +.IR stat (2) +.SH HISTORY +There have been at least four +.I ar +formats. +The first was denoted by the leading ``magic'' number 0177555 (stored as +type int). +These archives were almost certainly created on a 16-bit machine, and +contain headers made up of five fields. +The fields are the object name (8 characters), the file last modification +time (type long), the user id (type char), the file mode (type char) and +the file size (type unsigned int). +Files were padded to an even number of bytes. +.PP +The second was denoted by the leading ``magic'' number 0177545 (stored as +type int). +These archives may have been created on either 16 or 32-bit machines, and +contain headers made up of six fields. +The fields are the object name (14 characters), the file last modification +time (type long), the user and group id's (each type char), the file mode +(type int) and the file size (type long). +Files were padded to an even number of bytes. +For more information on converting from this format see +.IR arcv (8). +.PP +The current archive format (without support for long character names and +names with embedded spaces) was introduced in 4.0BSD. +The headers were the same as the current format, with the exception that +names longer than 16 characters were truncated, and names with embedded +spaces (and often trailing spaces) were not supported. +It has been extended for these reasons, +as described above. +This format is under development. +.SH COMPATIBILITY +No archive format is currently specified by any standard. +AT&T System V UNIX +has historically distributed archives in a different format from +all of the above. diff --git a/bin/ar/ar.c b/bin/ar/ar.c new file mode 100644 index 0000000..63c1f15 --- /dev/null +++ b/bin/ar/ar.c @@ -0,0 +1,238 @@ +/*- + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Hugh Smith at The University of Guelph. + * + * 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. + */ + +#if defined(DOSCCS) && !defined(lint) +char copyright[] = +"@(#) Copyright (c) 1990 The Regents of the University of California.\n\ + All rights reserved.\n"; + +static char sccsid[] = "@(#)ar.c 5.11 (Berkeley) 3/21/91"; +#endif + +#include +#include +#include +#include +#include +#include +#include +#include "archive.h" +#include "extern.h" + +extern char *malloc(); +extern int errno; + +CHDR chdr; +u_int options; +char *archive, *envtmp, *posarg, *posname; +static void badoptions(), usage(); + +/* + * main -- + * main basically uses getopt to parse options and calls the appropriate + * functions. Some hacks that let us be backward compatible with 4.3 ar + * option parsing and sanity checking. + */ +main(argc, argv) + int argc; + char **argv; +{ + extern int optind; + int c; + char *p; + int (*fcall)(), append(), contents(), delete(), extract(), + move(), print(), replace(); + + if (argc < 3) + usage(); + + /* + * Historic versions didn't require a '-' in front of the options. + * Fix it, if necessary. + */ + if (*argv[1] != '-') { + if (!(p = malloc((u_int)(strlen(argv[1]) + 2)))) { + (void)fprintf(stderr, "ar: %s.\n", strerror(errno)); + exit(1); + } + *p = '-'; + (void)strcpy(p + 1, argv[1]); + argv[1] = p; + } + + while ((c = getopt(argc, argv, "abcdilmopqrTtuvx")) != EOF) { + switch(c) { + case 'a': + options |= AR_A; + break; + case 'b': + case 'i': + options |= AR_B; + break; + case 'c': + options |= AR_C; + break; + case 'd': + options |= AR_D; + fcall = delete; + break; + case 'l': /* not documented, compatibility only */ + envtmp = "."; + break; + case 'm': + options |= AR_M; + fcall = move; + break; + case 'o': + options |= AR_O; + break; + case 'p': + options |= AR_P; + fcall = print; + break; + case 'q': + options |= AR_Q; + fcall = append; + break; + case 'r': + options |= AR_R; + fcall = replace; + break; + case 'T': + options |= AR_TR; + break; + case 't': + options |= AR_T; + fcall = contents; + break; + case 'u': + options |= AR_U; + break; + case 'v': + options |= AR_V; + break; + case 'x': + options |= AR_X; + fcall = extract; + break; + default: + usage(); + } + } + + argv += optind; + argc -= optind; + + /* One of -dmpqrtx required. */ + if (!(options & (AR_D|AR_M|AR_P|AR_Q|AR_R|AR_T|AR_X))) { + (void)fprintf(stderr, + "ar: one of options -dmpqrtx is required.\n"); + usage(); + } + /* Only one of -a and -bi allowed. */ + if (options & AR_A && options & AR_B) { + (void)fprintf(stderr, + "ar: only one of -a and -[bi] options allowed.\n"); + usage(); + } + /* -ab require a position argument. */ + if (options & (AR_A|AR_B)) { + if (!(posarg = *argv++)) { + (void)fprintf(stderr, + "ar: no position operand specified.\n"); + usage(); + } + posname = rname(posarg); + } + /* -d only valid with -Tv. */ + if (options & AR_D && options & ~(AR_D|AR_TR|AR_V)) + badoptions("-d"); + /* -m only valid with -abiTv. */ + if (options & AR_M && options & ~(AR_A|AR_B|AR_M|AR_TR|AR_V)) + badoptions("-m"); + /* -p only valid with -Tv. */ + if (options & AR_P && options & ~(AR_P|AR_TR|AR_V)) + badoptions("-p"); + /* -q only valid with -cTv. */ + if (options & AR_Q && options & ~(AR_C|AR_Q|AR_TR|AR_V)) + badoptions("-q"); + /* -r only valid with -abcuTv. */ + if (options & AR_R && options & ~(AR_A|AR_B|AR_C|AR_R|AR_U|AR_TR|AR_V)) + badoptions("-r"); + /* -t only valid with -Tv. */ + if (options & AR_T && options & ~(AR_T|AR_TR|AR_V)) + badoptions("-t"); + /* -x only valid with -ouTv. */ + if (options & AR_X && options & ~(AR_O|AR_U|AR_TR|AR_V|AR_X)) + badoptions("-x"); + + if (!(archive = *argv++)) { + (void)fprintf(stderr, "ar: no archive specified.\n"); + usage(); + } + + /* -dmqr require a list of archive elements. */ + if (options & (AR_D|AR_M|AR_Q|AR_R) && !*argv) { + (void)fprintf(stderr, "ar: no archive members specified.\n"); + usage(); + } + + exit((*fcall)(argv)); +} + +static void +badoptions(arg) + char *arg; +{ + (void)fprintf(stderr, + "ar: illegal option combination for %s.\n", arg); + usage(); +} + +static void +usage() +{ + (void)fprintf(stderr, "usage: ar -d [-Tv] archive file ...\n"); + (void)fprintf(stderr, "\tar -m [-Tv] archive file ...\n"); + (void)fprintf(stderr, "\tar -m [-abiTv] position archive file ...\n"); + (void)fprintf(stderr, "\tar -p [-Tv] archive [file ...]\n"); + (void)fprintf(stderr, "\tar -q [-cTv] archive file ...\n"); + (void)fprintf(stderr, "\tar -r [-cuTv] archive file ...\n"); + (void)fprintf(stderr, "\tar -r [-abciuTv] position archive file ...\n"); + (void)fprintf(stderr, "\tar -t [-Tv] archive [file ...]\n"); + (void)fprintf(stderr, "\tar -x [-ouTv] archive [file ...]\n"); + exit(1); +} diff --git a/bin/ar/archive.c b/bin/ar/archive.c new file mode 100644 index 0000000..af69d54 --- /dev/null +++ b/bin/ar/archive.c @@ -0,0 +1,323 @@ +/*- + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Hugh Smith at The University of Guelph. + * + * 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. + */ + +#if defined(DOSCCS) && !defined(lint) +static char sccsid[] = "@(#)archive.c 5.7 (Berkeley) 3/21/91"; +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include "archive.h" +#include "extern.h" + +extern CHDR chdr; /* converted header */ +extern char *archive; /* archive name */ +extern int errno; + +typedef struct ar_hdr HDR; +static char hb[sizeof(HDR) + 1]; /* real header */ + +open_archive(mode) + int mode; +{ + int created, fd, nr; + char buf[SARMAG]; + + created = 0; + if (mode & O_CREAT) { + mode |= O_EXCL; + if ((fd = open(archive, mode, 0666)) >= 0) { + /* POSIX.2 puts create message on stderr. */ + if (!(options & AR_C)) + (void)fprintf(stderr, + "ar: creating archive %s.\n", archive); + created = 1; + goto opened; + } + if (errno != EEXIST) + error(archive); + mode &= ~O_EXCL; + } + if ((fd = open(archive, mode, 0666)) < 0) + error(archive); + + /* + * Attempt to place a lock on the opened file - if we get an + * error then someone is already working on this library (or + * it's going across NFS). + */ +opened: if (flock(fd, LOCK_EX|LOCK_NB) && errno != EOPNOTSUPP) + error(archive); + + /* + * If not created, O_RDONLY|O_RDWR indicates that it has to be + * in archive format. + */ + if (!created && + ((mode & 3) == O_RDONLY || (mode & 3) == O_RDWR)) { + if ((nr = read(fd, buf, SARMAG) != SARMAG)) { + if (nr >= 0) + badfmt(); + error(archive); + } else if (bcmp(buf, ARMAG, SARMAG)) + badfmt(); + } else if (write(fd, ARMAG, SARMAG) != SARMAG) + error(archive); + return(fd); +} + +void +close_archive(fd) + int fd; +{ + (void)close(fd); /* Implicit unlock. */ +} + +/* Convert ar header field to an integer. */ +#define AR_ATOI(from, to, len, base) { \ + bcopy(from, buf, len); \ + buf[len] = '\0'; \ + to = strtol(buf, (char **)NULL, base); \ +} + +/* + * get_arobj -- + * read the archive header for this member + */ +get_arobj(fd) + int fd; +{ + struct ar_hdr *hdr; + register int len, nr; + register char *p; + char buf[20]; + + nr = read(fd, hb, sizeof(HDR)); + if (nr != sizeof(HDR)) { + if (!nr) + return(0); + if (nr < 0) + error(archive); + badfmt(); + } + + hdr = (struct ar_hdr *)hb; + if (strncmp(hdr->ar_fmag, ARFMAG, sizeof(ARFMAG) - 1)) + badfmt(); + + /* Convert the header into the internal format. */ +#define DECIMAL 10 +#define OCTAL 8 + + AR_ATOI(hdr->ar_date, chdr.date, sizeof(hdr->ar_date), DECIMAL); + AR_ATOI(hdr->ar_uid, chdr.uid, sizeof(hdr->ar_uid), DECIMAL); + AR_ATOI(hdr->ar_gid, chdr.gid, sizeof(hdr->ar_gid), DECIMAL); + AR_ATOI(hdr->ar_mode, chdr.mode, sizeof(hdr->ar_mode), OCTAL); + AR_ATOI(hdr->ar_size, chdr.size, sizeof(hdr->ar_size), DECIMAL); + + /* Leading spaces should never happen. */ + if (hdr->ar_name[0] == ' ') + badfmt(); + + /* + * Long name support. Set the "real" size of the file, and the + * long name flag/size. + */ + if (!bcmp(hdr->ar_name, AR_EFMT1, sizeof(AR_EFMT1) - 1)) { + chdr.lname = len = atoi(hdr->ar_name + sizeof(AR_EFMT1) - 1); + if (len <= 0 || len > MAXNAMLEN) + badfmt(); + nr = read(fd, chdr.name, (size_t)len); + if (nr != len) { + if (nr < 0) + error(archive); + badfmt(); + } + chdr.name[len] = 0; + chdr.size -= len; + } else { + chdr.lname = 0; + bcopy(hdr->ar_name, chdr.name, sizeof(hdr->ar_name)); + + /* Strip trailing spaces, null terminate. */ + for (p = chdr.name + sizeof(hdr->ar_name) - 1; *p == ' '; --p); + *++p = '\0'; + } + return(1); +} + +static int already_written; + +/* + * put_arobj -- + * Write an archive member to a file. + */ +put_arobj(cfp, sb) + CF *cfp; + struct stat *sb; +{ + register int lname; + register char *name; + struct ar_hdr *hdr; + off_t size; + + /* + * If passed an sb structure, reading a file from disk. Get stat(2) + * information, build a name and construct a header. (Files are named + * by their last component in the archive.) If not, then just write + * the last header read. + */ + if (sb) { + name = rname(cfp->rname); + (void)fstat(cfp->rfd, sb); + + /* + * If not truncating names and the name is too long or contains + * a space, use extended format 1. + */ + lname = strlen(name); + if (options & AR_TR) { + if (lname > OLDARMAXNAME) { + (void)fflush(stdout); + (void)fprintf(stderr, + "ar: warning: %s truncated to %.*s\n", + name, OLDARMAXNAME, name); + (void)fflush(stderr); + } + (void)sprintf(hb, HDR3, name, sb->st_mtime, sb->st_uid, + sb->st_gid, sb->st_mode, sb->st_size, ARFMAG); + lname = 0; + } else if (lname > sizeof(hdr->ar_name) || index(name, ' ')) + (void)sprintf(hb, HDR1, AR_EFMT1, lname, sb->st_mtime, + sb->st_uid, sb->st_gid, sb->st_mode, + sb->st_size + lname, ARFMAG); + else { + lname = 0; + (void)sprintf(hb, HDR2, name, sb->st_mtime, sb->st_uid, + sb->st_gid, sb->st_mode, sb->st_size, ARFMAG); + } + size = sb->st_size; + } else { + lname = chdr.lname; + name = chdr.name; + size = chdr.size; + } + + if (write(cfp->wfd, hb, sizeof(HDR)) != sizeof(HDR)) + error(cfp->wname); + if (lname) { + if (write(cfp->wfd, name, (size_t)lname) != lname) + error(cfp->wname); + already_written = lname; + } + copy_ar(cfp, size); + already_written = 0; +} + +/* + * copy_ar -- + * Copy size bytes from one file to another - taking care to handle the + * extra byte (for odd size files) when reading archives and writing an + * extra byte if necessary when adding files to archive. The length of + * the object is the long name plus the object itself; the variable + * already_written gets set if a long name was written. + * + * The padding is really unnecessary, and is almost certainly a remnant + * of early archive formats where the header included binary data which + * a PDP-11 required to start on an even byte boundary. (Or, perhaps, + * because 16-bit word addressed copies were faster?) Anyhow, it should + * have been ripped out long ago. + */ +copy_ar(cfp, size) + CF *cfp; + off_t size; +{ + static char pad = '\n'; + off_t sz; + register int from, nr, nw, off, to; +#ifdef pdp11 + char buf[2*1024]; +#else + char buf[8*1024]; +#endif + + if (!(sz = size)) + return; + + from = cfp->rfd; + to = cfp->wfd; + while (sz && (nr = read(from, buf, (size_t)(MIN(sz, sizeof(buf))))) > 0) { + sz -= nr; + for (off = 0; off < nr; nr -= off, off += nw) + if ((nw = write(to, buf + off, (size_t)nr)) < 0) + error(cfp->wname); + } + if (sz) { + if (nr == 0) + badfmt(); + error(cfp->rname); + } + + if (cfp->flags & RPAD && size & 1 && (nr = read(from, buf, 1)) != 1) { + if (nr == 0) + badfmt(); + error(cfp->rname); + } + if (cfp->flags & WPAD && (size + already_written) & 1 && + write(to, &pad, 1) != 1) + error(cfp->wname); +} + +/* + * skip_arobj - + * Skip over an object -- taking care to skip the pad bytes. + */ +void +skip_arobj(fd) + int fd; +{ + off_t len; + + len = chdr.size + (chdr.size + chdr.lname & 1); + if (lseek(fd, len, L_INCR) == (off_t)-1) + error(archive); +} diff --git a/bin/ar/archive.h b/bin/ar/archive.h new file mode 100644 index 0000000..b513aad --- /dev/null +++ b/bin/ar/archive.h @@ -0,0 +1,101 @@ +/*- + * Copyright (c) 1991 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Hugh Smith at The University of Guelph. + * + * 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. + * + * @(#)archive.h 5.8 (Berkeley) 4/12/91 + */ + +/* Ar(1) options. */ +#define AR_A 0x0001 +#define AR_B 0x0002 +#define AR_C 0x0004 +#define AR_D 0x0008 +#define AR_M 0x0010 +#define AR_O 0x0020 +#define AR_P 0x0040 +#define AR_Q 0x0080 +#define AR_R 0x0100 +#define AR_T 0x0200 +#define AR_TR 0x0400 +#define AR_U 0x0800 +#define AR_V 0x1000 +#define AR_X 0x2000 +extern u_int options; + +/* Set up file copy. */ +#define SETCF(from, fromname, to, toname, pad) { \ + cf.rfd = from; \ + cf.rname = fromname; \ + cf.wfd = to; \ + cf.wname = toname; \ + cf.flags = pad; \ +} + +/* File copy structure. */ +typedef struct { + int rfd; /* read file descriptor */ + char *rname; /* read name */ + int wfd; /* write file descriptor */ + char *wname; /* write name */ +#define NOPAD 0x00 /* don't pad */ +#define RPAD 0x01 /* pad on reads */ +#define WPAD 0x02 /* pad on writes */ + u_int flags; /* pad flags */ +} CF; + +/* Header structure internal format. */ +typedef struct { + off_t size; /* size of the object in bytes */ + long date; /* date */ + int lname; /* size of the long name in bytes */ + int gid; /* group */ + int uid; /* owner */ + u_short mode; /* permissions */ + char name[MAXNAMLEN + 1]; /* name */ +} CHDR; + +/* Header format strings. */ +#define HDR1 "%s%-13d%-12ld%-6u%-6u%-8o%-10ld%2s" +#define HDR2 "%-16.16s%-12ld%-6u%-6u%-8o%-10ld%2s" + +#define OLDARMAXNAME 15 +#define HDR3 "%-16.15s%-12ld%-6u%-6u%-8o%-10ld%2s" + + +void close_archive(); +void skip_arobj(); +int copy_ar(); +int get_arobj(); +int open_archive(); +int put_arobj(); diff --git a/bin/ar/contents.c b/bin/ar/contents.c new file mode 100644 index 0000000..82ad098 --- /dev/null +++ b/bin/ar/contents.c @@ -0,0 +1,113 @@ +/*- + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Hugh Smith at The University of Guelph. + * + * 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. + */ + +#if defined(DOSCCS) && !defined(lint) +static char sccsid[] = "@(#)contents.c 5.6 (Berkeley) 3/12/91"; +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "archive.h" +#include "extern.h" + +extern CHDR chdr; /* converted header */ +extern char *archive; /* archive name */ + +/* + * contents -- + * Handles t[v] option - opens the archive and then reads headers, + * skipping member contents. + */ +contents(argv) + register char **argv; +{ + register int afd, all; + struct tm *tp; + char *file, buf[25]; + + afd = open_archive(O_RDONLY); + + for (all = !*argv; get_arobj(afd);) { + if (all) + file = chdr.name; + else if (!(file = files(argv))) + goto next; + if (options & AR_V) { + (void)strmode(chdr.mode, buf); + (void)printf("%s %6d/%-6d %8ld ", + buf + 1, chdr.uid, chdr.gid, chdr.size); + tp = localtime(&chdr.date); +#ifdef bloat + (void)strftime(buf, sizeof(buf), "%b %e %H:%M %Y", tp); + (void)printf("%s %s\n", buf, file); +#else + { +/* + * Bloat avoidance alert! Doing the date this way saves dragging in not only + * strftime() but mktime() and ctime() for a savings of over 8kb. God, those + * leap seconds or whatever don't come cheap, the old (4.3BSD) timezone code + * was big enough but this new stuff (posix?) is horrid. +*/ + static char *months[] = {"Jan", "Feb", "Mar", "Apr", + "May", "Jun", "Jul", "Aug", + "Sep", "Oct", "Nov", "Dec"}; + + (void)printf("%s %02d %02d:%02d %4d %s\n", + months[tp->tm_mon], tp->tm_mday, tp->tm_hour, + tp->tm_min, 1900+tp->tm_year, file); + } +#endif + } else + (void)printf("%s\n", file); + if (!all && !*argv) + break; +next: skip_arobj(afd); + } + close_archive(afd); + + if (*argv) { + orphans(argv); + return(1); + } + return(0); +} diff --git a/bin/ar/delete.c b/bin/ar/delete.c new file mode 100644 index 0000000..477472b --- /dev/null +++ b/bin/ar/delete.c @@ -0,0 +1,97 @@ +/*- + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Hugh Smith at The University of Guelph. + * + * 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. + */ + +#if defined(DOSCCS) && !defined(lint) +static char sccsid[] = "@(#)delete.c 5.6 (Berkeley) 3/12/91"; +#endif + +#include +#include +#include +#include +#include +#include +#include +#include "archive.h" +#include "extern.h" +#include "pathnames.h" + +extern CHDR chdr; /* converted header */ +extern char *archive; /* archive name */ +extern char *tname; /* temporary file "name" */ + +/*- + * delete -- + * Deletes named members from the archive. + */ +delete(argv) + register char **argv; +{ + CF cf; + off_t size; + int afd, tfd; + char *file; + + afd = open_archive(O_RDWR); + tfd = tmp(); + + /* Read and write to an archive; pad on both. */ + SETCF(afd, archive, tfd, tname, RPAD|WPAD); + while (get_arobj(afd)) { + if (*argv && (file = files(argv))) { + if (options & AR_V) + (void)printf("d - %s\n", file); + skip_arobj(afd); + continue; + } + put_arobj(&cf, (struct stat *)NULL); + } + + size = lseek(tfd, (off_t)0, L_INCR); + (void)lseek(tfd, (off_t)0, L_SET); + (void)lseek(afd, (off_t)SARMAG, L_SET); + SETCF(tfd, tname, afd, archive, NOPAD); + copy_ar(&cf, size); + (void)close(tfd); + (void)ftruncate(afd, size + SARMAG); + close_archive(afd); + + if (*argv) { + orphans(argv); + return(1); + } + return(0); +} diff --git a/bin/ar/extern.h b/bin/ar/extern.h new file mode 100644 index 0000000..3b4bde0 --- /dev/null +++ b/bin/ar/extern.h @@ -0,0 +1,46 @@ +/*- + * Copyright (c) 1991 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)extern.h 5.1 (Berkeley) 4/3/91 + */ + +void badfmt(); +void error(); +void orphans(); +int compare(); +int tmp(); +char *files(); +char *rname(); +void strmode(); +extern long strtol(); +extern off_t lseek(); +extern char *getenv(); diff --git a/bin/ar/extract.c b/bin/ar/extract.c new file mode 100644 index 0000000..71491e8 --- /dev/null +++ b/bin/ar/extract.c @@ -0,0 +1,127 @@ +/*- + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Hugh Smith at The University of Guelph. + * + * 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. + */ + +#if defined(DOSCCS) && !defined(lint) +static char sccsid[] = "@(#)extract.c 5.5 (Berkeley) 3/12/91"; +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include "archive.h" +#include "extern.h" + +extern int errno; +extern CHDR chdr; /* converted header */ +extern char *archive; /* archive name */ + +/* + * extract -- + * Extract files from the named archive - if member names given only + * extract those members otherwise extract all members. If 'o' option + * selected modify date of newly created file to be same as archive + * members date otherwise date is time of extraction. Does not modify + * archive. + */ +extract(argv) + char **argv; +{ + register int afd, all, tfd; + struct timeval tv[2]; + struct stat sb; + CF cf; + char *file; + + tv[0].tv_usec = tv[1].tv_usec = 0; + + afd = open_archive(O_RDONLY); + + /* Read from an archive, write to disk; pad on read. */ + SETCF(afd, archive, 0, 0, RPAD); + for (all = !*argv; get_arobj(afd);) { + if (all) + file = chdr.name; + else if (!(file = files(argv))) { + skip_arobj(afd); + continue; + } + + if (options & AR_U && !stat(file, &sb) && + sb.st_mtime > chdr.date) + continue; + + if ((tfd = open(file, O_WRONLY|O_CREAT|O_TRUNC, 0200)) < 0) { + (void)fprintf(stderr, "ar: %s: %s.\n", + file, strerror(errno)); + skip_arobj(afd); + continue; + } + + if (options & AR_V) + (void)printf("x - %s\n", file); + + cf.wfd = tfd; + cf.wname = file; + copy_ar(&cf, chdr.size); + + if (fchmod(tfd, (short)chdr.mode)) { + (void)fprintf(stderr, "ar: %s: chmod: %s\n", + file, strerror(errno)); + } + if (options & AR_O) { + tv[0].tv_sec = tv[1].tv_sec = chdr.date; + if (utimes(file, tv)) { + (void)fprintf(stderr, "ar: %s: utimes: %s\n", + file, strerror(errno)); + } + } + (void)close(tfd); + if (!all && !*argv) + break; + } + close_archive(afd); + + if (*argv) { + orphans(argv); + return(1); + } + return(0); +} diff --git a/bin/ar/misc.c b/bin/ar/misc.c new file mode 100644 index 0000000..ccbbb3c --- /dev/null +++ b/bin/ar/misc.c @@ -0,0 +1,142 @@ +/*- + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Hugh Smith at The University of Guelph. + * + * 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. + */ + +#if defined(DOSCCS) && !defined(lint) +static char sccsid[] = "@(#)misc.c 5.7.1 (2.11BSD) 1999/10/25"; +#endif + +#include +#include +#include +#include +#include +#include +#include "archive.h" +#include "extern.h" +#include "pathnames.h" + +extern CHDR chdr; /* converted header */ +extern char *archive; /* archive name */ +char *tname = "temporary file"; /* temporary file "name" */ + +tmp() +{ + extern char *envtmp; + sigset_t set, oset; + static int first; + int fd; + char path[MAXPATHLEN]; + + if (!first && !envtmp) { + envtmp = (char *)getenv("TMPDIR"); + first = 1; + } + + if (envtmp) + (void)sprintf(path, "%s/%s", envtmp, _NAME_ARTMP); + else + bcopy(_PATH_ARTMP, path, sizeof(_PATH_ARTMP)); + + sigfillset(&set); + (void)sigprocmask(SIG_BLOCK, &set, &oset); + if ((fd = mkstemp(path)) == -1) + error(tname); + (void)unlink(path); + (void)sigprocmask(SIG_SETMASK, &oset, NULL); + return(fd); +} + +/* + * files -- + * See if the current file matches any file in the argument list; if it + * does, remove it from the argument list. + */ +char * +files(argv) + char **argv; +{ + register char **list; + char *p; + + for (list = argv; *list; ++list) + if (compare(*list)) { + p = *list; + for (; list[0] = list[1]; ++list); + return(p); + } + return(NULL); +} + +void +orphans(argv) + char **argv; +{ + for (; *argv; ++argv) + (void)fprintf(stderr, + "ar: %s: not found in archive.\n", *argv); +} + +char * +rname(path) + char *path; +{ + register char *ind; + + return((ind = rindex(path, '/')) ? ind + 1 : path); +} + +compare(dest) + char *dest; +{ + if (options & AR_TR) + return(!strncmp(chdr.name, rname(dest), OLDARMAXNAME)); + return(!strcmp(chdr.name, rname(dest))); +} + +void +badfmt() +{ + errno = EINVAL; + error(archive); +} + +void +error(name) + char *name; +{ + (void)fprintf(stderr, "ar: %s: %s\n", name, strerror(errno)); + exit(1); +} diff --git a/bin/ar/move.c b/bin/ar/move.c new file mode 100644 index 0000000..ee7dcf5 --- /dev/null +++ b/bin/ar/move.c @@ -0,0 +1,142 @@ +/*- + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Hugh Smith at The University of Guelph. + * + * 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. + */ + +#if defined(DOSCCS) && !defined(lint) +static char sccsid[] = "@(#)move.c 5.6 (Berkeley) 3/12/91"; +#endif + +#include +#include +#include +#include +#include +#include +#include +#include "archive.h" +#include "extern.h" +#include "pathnames.h" + +extern CHDR chdr; /* converted header */ +extern char *archive; /* archive name */ +extern char *tname; /* temporary file "name" */ + +/* + * move -- + * Change location of named members in archive - if 'b' or 'i' option + * selected then named members are placed before 'posname'. If 'a' + * option selected members go after 'posname'. If no options, members + * are moved to end of archive. + */ +move(argv) + char **argv; +{ + extern char *posarg, *posname; /* positioning file names */ + CF cf; + off_t size, tsize; + int afd, curfd, mods, tfd1, tfd2, tfd3; + char *file; + + afd = open_archive(O_RDWR); + mods = options & (AR_A|AR_B); + + tfd1 = tmp(); /* Files before key file. */ + tfd2 = tmp(); /* Files selected by user. */ + tfd3 = tmp(); /* Files after key file. */ + + /* + * Break archive into three parts -- selected entries and entries + * before and after the key entry. If positioning before the key, + * place the key at the beginning of the after key entries and if + * positioning after the key, place the key at the end of the before + * key entries. Put it all back together at the end. + */ + + /* Read and write to an archive; pad on both. */ + SETCF(afd, archive, 0, tname, RPAD|WPAD); + for (curfd = tfd1; get_arobj(afd);) { + if (*argv && (file = files(argv))) { + if (options & AR_V) + (void)printf("m - %s\n", file); + cf.wfd = tfd2; + put_arobj(&cf, (struct stat *)NULL); + continue; + } + if (mods && compare(posname)) { + mods = 0; + if (options & AR_B) + curfd = tfd3; + cf.wfd = curfd; + put_arobj(&cf, (struct stat *)NULL); + if (options & AR_A) + curfd = tfd3; + } else { + cf.wfd = curfd; + put_arobj(&cf, (struct stat *)NULL); + } + } + + if (mods) { + (void)fprintf(stderr, "ar: %s: archive member not found.\n", + posarg); + close_archive(afd); + return(1); + } + (void)lseek(afd, (off_t)SARMAG, L_SET); + + SETCF(tfd1, tname, afd, archive, NOPAD); + tsize = size = lseek(tfd1, (off_t)0, L_INCR); + (void)lseek(tfd1, (off_t)0, L_SET); + copy_ar(&cf, size); + + tsize += size = lseek(tfd2, (off_t)0, L_INCR); + (void)lseek(tfd2, (off_t)0, L_SET); + cf.rfd = tfd2; + copy_ar(&cf, size); + + tsize += size = lseek(tfd3, (off_t)0, L_INCR); + (void)lseek(tfd3, (off_t)0, L_SET); + cf.rfd = tfd3; + copy_ar(&cf, size); + + (void)ftruncate(afd, tsize + SARMAG); + close_archive(afd); + + if (*argv) { + orphans(argv); + return(1); + } + return(0); +} diff --git a/bin/ar/pathnames.h b/bin/ar/pathnames.h new file mode 100644 index 0000000..f175b08 --- /dev/null +++ b/bin/ar/pathnames.h @@ -0,0 +1,40 @@ +/*- + * Copyright (c) 1991 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Hugh Smith at The University of Guelph. + * + * 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. + * + * @(#)pathnames.h 5.4 (Berkeley) 4/12/91 + */ + +#define _NAME_ARTMP "ar.XXXXXX" +#define _PATH_ARTMP "/tmp/ar.XXXXXX" diff --git a/bin/ar/print.c b/bin/ar/print.c new file mode 100644 index 0000000..1b404ba --- /dev/null +++ b/bin/ar/print.c @@ -0,0 +1,89 @@ +/*- + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Hugh Smith at The University of Guelph. + * + * 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. + */ + +#if defined(DOSCCS) && !defined(lint) +static char sccsid[] = "@(#)print.c 5.6 (Berkeley) 3/12/91"; +#endif + +#include +#include +#include +#include +#include "archive.h" +#include "extern.h" + +extern CHDR chdr; /* converted header */ +extern char *archive; /* archive name */ + +/* + * print -- + * Prints archive members on stdout - if member names given only + * print those members, otherwise print all members. + */ +print(argv) + char **argv; +{ + CF cf; + register int afd, all; + char *file; + + afd = open_archive(O_RDONLY); + + /* Read from an archive, write to stdout; pad on read. */ + SETCF(afd, archive, fileno(stdout), "stdout", RPAD); + for (all = !*argv; get_arobj(afd);) { + if (all) + file = chdr.name; + else if (!(file = files(argv))) { + skip_arobj(afd); + continue; + } + if (options & AR_V) { + (void)printf("\n<%s>\n\n", file); + (void)fflush(stdout); + } + copy_ar(&cf, chdr.size); + if (!all && !*argv) + break; + } + close_archive(afd); + + if (*argv) { + orphans(argv); + return(1); + } + return(0); +} diff --git a/bin/ar/replace.c b/bin/ar/replace.c new file mode 100644 index 0000000..fdbdb50 --- /dev/null +++ b/bin/ar/replace.c @@ -0,0 +1,186 @@ +/*- + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Hugh Smith at The University of Guelph. + * + * 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. + */ + +#if defined(DOSCCS) && !defined(lint) +static char sccsid[] = "@(#)replace.c 5.8 (Berkeley) 3/15/91"; +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "archive.h" +#include "extern.h" + +extern int errno; +extern CHDR chdr; /* converted header */ +extern char *archive; /* archive name */ +extern char *tname; /* temporary file "name" */ + +/* + * replace -- + * Replace or add named members to archive. Entries already in the + * archive are swapped in place. Others are added before or after + * the key entry, based on the a, b and i options. If the u option + * is specified, modification dates select for replacement. + */ +replace(argv) + char **argv; +{ + extern char *posarg, *posname; /* positioning file name */ + register char *file; + register int afd, curfd, mods, sfd; + struct stat sb; + CF cf; + off_t size, tsize; + int err, exists, tfd1, tfd2; + char *rname(); + + err = 0; + /* + * If doesn't exist, simply append to the archive. There's + * a race here, but it's pretty short, and not worth fixing. + */ + exists = !stat(archive, &sb); + afd = open_archive(O_CREAT|O_RDWR); + + if (!exists) { + tfd1 = -1; + tfd2 = tmp(); + goto append; + } + + tfd1 = tmp(); /* Files before key file. */ + tfd2 = tmp(); /* Files after key file. */ + + /* + * Break archive into two parts -- entries before and after the key + * entry. If positioning before the key, place the key at the + * beginning of the after key entries and if positioning after the + * key, place the key at the end of the before key entries. Put it + * all back together at the end. + */ + mods = (options & (AR_A|AR_B)); + for (curfd = tfd1; get_arobj(afd);) { + if (*argv && (file = files(argv))) { + if ((sfd = open(file, O_RDONLY)) < 0) { + err = 1; + (void)fprintf(stderr, "ar: %s: %s.\n", + file, strerror(errno)); + goto useold; + } + (void)fstat(sfd, &sb); + if (options & AR_U && sb.st_mtime <= chdr.date) { + (void)close(sfd); + goto useold; + } + + if (options & AR_V) + (void)printf("r - %s\n", file); + + /* Read from disk, write to an archive; pad on write */ + SETCF(sfd, file, curfd, tname, WPAD); + put_arobj(&cf, &sb); + (void)close(sfd); + skip_arobj(afd); + continue; + } + + if (mods && compare(posname)) { + mods = 0; + if (options & AR_B) + curfd = tfd2; + /* Read and write to an archive; pad on both. */ + SETCF(afd, archive, curfd, tname, RPAD|WPAD); + put_arobj(&cf, (struct stat *)NULL); + if (options & AR_A) + curfd = tfd2; + } else { + /* Read and write to an archive; pad on both. */ +useold: SETCF(afd, archive, curfd, tname, RPAD|WPAD); + put_arobj(&cf, (struct stat *)NULL); + } + } + + if (mods) { + (void)fprintf(stderr, "ar: %s: archive member not found.\n", + posarg); + close_archive(afd); + return(1); + } + + /* Append any left-over arguments to the end of the after file. */ +append: while (file = *argv++) { + if (options & AR_V) + (void)printf("a - %s\n", file); + if ((sfd = open(file, O_RDONLY)) < 0) { + err = 1; + (void)fprintf(stderr, "ar: %s: %s.\n", + file, strerror(errno)); + continue; + } + (void)fstat(sfd, &sb); + /* Read from disk, write to an archive; pad on write. */ + SETCF(sfd, file, + options & (AR_A|AR_B) ? tfd1 : tfd2, tname, WPAD); + put_arobj(&cf, &sb); + (void)close(sfd); + } + + (void)lseek(afd, (off_t)SARMAG, L_SET); + + SETCF(tfd1, tname, afd, archive, NOPAD); + if (tfd1 != -1) { + tsize = size = lseek(tfd1, (off_t)0, L_INCR); + (void)lseek(tfd1, (off_t)0, L_SET); + copy_ar(&cf, size); + } else + tsize = 0; + + tsize += size = lseek(tfd2, (off_t)0, L_INCR); + (void)lseek(tfd2, (off_t)0, L_SET); + cf.rfd = tfd2; + copy_ar(&cf, size); + + (void)ftruncate(afd, tsize + SARMAG); + close_archive(afd); + return(err); +} diff --git a/bin/ar/strmode.c b/bin/ar/strmode.c new file mode 100644 index 0000000..2bdcf1f --- /dev/null +++ b/bin/ar/strmode.c @@ -0,0 +1,146 @@ +/*- + * Copyright (c) 1990 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. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)strmode.c 5.3.2 (2.11BSD GTE) 1996/1/27"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include + +void +strmode(mode, p) + register mode_t mode; + register char *p; +{ + /* print type */ + switch (mode & S_IFMT) { + case S_IFDIR: /* directory */ + *p++ = 'd'; + break; + case S_IFCHR: /* character special */ + *p++ = 'c'; + break; + case S_IFBLK: /* block special */ + *p++ = 'b'; + break; + case S_IFREG: /* regular */ + *p++ = '-'; + break; + case S_IFLNK: /* symbolic link */ + *p++ = 'l'; + break; + case S_IFSOCK: /* socket */ + *p++ = 's'; + break; +#ifdef S_IFIFO + case S_IFIFO: /* fifo */ + *p++ = 'p'; + break; +#endif + default: /* unknown */ + *p++ = '?'; + break; + } + /* usr */ + if (mode & S_IRUSR) + *p++ = 'r'; + else + *p++ = '-'; + if (mode & S_IWUSR) + *p++ = 'w'; + else + *p++ = '-'; + switch (mode & (S_IXUSR | S_ISUID)) { + case 0: + *p++ = '-'; + break; + case S_IXUSR: + *p++ = 'x'; + break; + case S_ISUID: + *p++ = 'S'; + break; + case S_IXUSR | S_ISUID: + *p++ = 's'; + break; + } + /* group */ + if (mode & S_IRGRP) + *p++ = 'r'; + else + *p++ = '-'; + if (mode & S_IWGRP) + *p++ = 'w'; + else + *p++ = '-'; + switch (mode & (S_IXGRP | S_ISGID)) { + case 0: + *p++ = '-'; + break; + case S_IXGRP: + *p++ = 'x'; + break; + case S_ISGID: + *p++ = 'S'; + break; + case S_IXGRP | S_ISGID: + *p++ = 's'; + break; + } + /* other */ + if (mode & S_IROTH) + *p++ = 'r'; + else + *p++ = '-'; + if (mode & S_IWOTH) + *p++ = 'w'; + else + *p++ = '-'; + switch (mode & (S_IXOTH | S_ISVTX)) { + case 0: + *p++ = '-'; + break; + case S_IXOTH: + *p++ = 'x'; + break; + case S_ISVTX: + *p++ = 'T'; + break; + case S_IXOTH | S_ISVTX: + *p++ = 't'; + break; + } + *p++ = ' '; /* will be a '+' if ACL's implemented */ + *p = '\0'; +} diff --git a/bin/as/Makefile b/bin/as/Makefile new file mode 100644 index 0000000..a22c1aa --- /dev/null +++ b/bin/as/Makefile @@ -0,0 +1,17 @@ +# +# makefile for as +# + +AS= /bin/as +SEPFLAG= -i -X + +all: as + +as: as0.o as2.o + ld ${SEPFLAG} -o $@ /lib/crt0.o as0.o as2.o -lc + +install: all + install -s as ${DESTDIR}/bin + +clean: + rm -f *.o a.out as core errs diff --git a/bin/as/as0.s b/bin/as/as0.s new file mode 100644 index 0000000..23eb4b5 --- /dev/null +++ b/bin/as/as0.s @@ -0,0 +1,1982 @@ + .globl _main, _write, _close, _execl, __exit, _brk + .globl _read, _signal, _stat, _open, _mkstemp, _calloc, _realloc + + .globl error, errore, errora, checkeos, pass1, aexit, argb + .globl overlaid, defund, a.outp, errflg, passno, filerr, outmod + .globl wrterr, argb, hshsiz, dot, dotdot, savdot, ch, outbuf + .globl line, savop, inbuf, fbptr, fbtbl, symnum, hshtab, symblk + .globl symleft, dotrel, symtab, fin, fout, curfb, nxtfb, ibufp + .globl ibufc, a.tmp1, usymtab, SYMENTSZ, SYMBLKSZ, PSTENTSZ + .globl obufp, Newsym, symbol,csv + +/ This assembler supports _both_ the old style object files (with +/ fixed 8 character symbols) and the new style (with a strings table). +/ The variable 'Newsym' defined below specifies which format will be +/ emitted, if the value is '0' the old style is output, if non-zero +/ then the new 'string table' format is output. +/ +/ The old style on disc symbol table entries looked like this: +/ struct symbol +/ { +/ char name[8]; +/ short type; +/ short value; +/ }; +/ +/ The new style of on disc symbol table entry looks like: +/ struct symbol +/ { +/ off_t offset_in_string_table; +/ short type; +/ short value; +/ }; + + .data +Newsym: 1 + .text + +PSTENTSZ = 6. +SYMENTSZ = 8. + +/ User symbols and Permanent Symbol Table entries used to have the +/ same 12 byte format. Merging the two phases of the assembler, moving +/ the symbol name characters to an externally allocated heap and +/ using a non-contiguous user symbol table meant that the symbol number +/ could no longer be calculated by subtracting the base of the symbol +/ table and dividing by the size of an entry. What was done was to +/ expand the symbol table entry by another word and keep the symbol number +/ in that. The new internal symbol structure is: +/ +/ char *name; +/ u_short flags; +/ u_short value; +/ u_short number; + +SYMBLKSZ = 512. +STRBLKSZ = 1024. +hshsiz = 3001. + +/ PDP-11 assembler +_main: + jsr r5,csv + mov $1,-(sp) / signal(SIGINT, SIG_IGN) + mov $2,-(sp) + jsr pc,_signal + cmp (sp)+,(sp)+ + ror r0 + bcs 1f + + mov $aexit,-(sp) / signal(SIGINT, aexit) + mov $2,-(sp) + jsr pc,_signal + cmp (sp)+,(sp)+ +1: + mov 4(r5),r0 / argc + mov 6(r5),curarg / argv +9: + dec r0 / argc-- + add $2,curarg / argv++ +1: + mov *curarg,r1 + cmpb (r1)+,$'- + bne 1f + cmpb (r1),$'- / is this "--"? + bne 8f / no - br + tstb 1(r1) / check for null terminator + beq 1f / got it, the "--" means read 'stdin' +8: + add $2,curarg / argv++ + dec r0 / argc-- + cmpb (r1),$'u + beq 3f + cmpb (r1), $'V + bne 2f + inc overlaid + br 1b +2: + tstb (r1) + bne 2f +3: + mov $40,defund + br 1b +2: + cmpb (r1),$'o + bne 1f + mov *curarg,a.outp + br 9b +1: + +/ The new object file format puts a ceiling of 32 characters on symbols. +/ If it is desired to raise this limit all that need be done is increase +/ the same ceiling in the C compiler and linker (ld). + + tst Newsym + beq 1f + movb $32.,Ncps +1: + mov r0,nargs / # of remaining args + bne 8f / br if any left + inc nargs / fake at least one arg + mov $dash, curarg / of '-' so we read stdin +8: + mov $a.tmp1,-(sp) + jsr pc,_mkstemp / fout = mkstemp(a.tmp1); + tst (sp)+ + mov r0,fout + bmi oops + +/ the symbol table is a single linked list of dynamically allocated +/ 'SYMBLKSZ' byte blocks. Allocate the first one now. + mov $SYMBLKSZ+2,-(sp) / symblk = calloc(1, SYMBLKSZ+2) + mov $1,-(sp) + jsr pc,_calloc + cmp (sp)+,(sp)+ + mov r0,symblk + mov r0,usymtab / pointer to first block + tst (r0)+ / skip link word + mov r0,symend / current end in block + mov $SYMBLKSZ,symleft / number of bytes left in block + +/ The string portion of symbol table entries is now allocated dynamically. +/ We allocate the strings in 1kb chunks to cut down the number of times +/ the string table needs to be extended (besides, long variable names are +/ coming real soon now). +/ +/ NOTE: the string blocks are linked together for debugging purposes only, +/ nothing depends on the link. + + mov $STRBLKSZ+2,-(sp) + mov $1,-(sp) + jsr pc,_calloc / strblk = calloc(1, STRBLKSZ+2) + / check for failure??? + cmp (sp)+,(sp)+ + mov r0,strblk / save pointer to string block + tst (r0)+ / skip link word + mov r0,strend / set available string pointer + mov $STRBLKSZ,strleft / set amount left in block + +/ the hash table is now dynamically allocated so that it can be +/ reused in pass 2 and re-alloced if necessary. + mov $2,-(sp) / hshtab = calloc($hshsiz, sizeof(int)) + mov $hshsiz,-(sp) + jsr pc,_calloc + cmp (sp)+,(sp)+ + mov r0, hshtab + + mov $symtab,r1 +1: + clr r3 + mov (r1),r2 / pointer to PST symbol's string +2: + movb (r2)+,r4 + beq 2f + add r4,r3 + swab r3 + br 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 r1,(r3) + add $PSTENTSZ,r1 + cmp r1,$ebsymtab + blo 1b + +/ perform pass 0 processing + jsr pc,pass0 + +/ flush the intermediate object file + mov $1024.,-(sp) / write(fout, outbuf, 1024) + mov $outbuf,-(sp) + mov fout,-(sp) + jsr pc,_write + add $6,sp + + tst errflg / any errors? + beq 1f / yes - br + jsr pc,aexit +/ not reached +1: + inc passno / go from -1 to 0 + clr line / reset line number + jmp pass1 / pass1 does both passes 1, 2, exit + +oops: + mov $9f-8f,-(sp) / write(fileno(stderr),8f,strlen()) + mov $8f,-(sp) + mov $2,-(sp) + jsr pc,_write + mov $2,(sp) + jsr pc,__exit + .data +8: + +9: + .even + .text + +error: + tst passno / on pass1,2 ? + bpl errorp2 + inc errflg + mov r0,-(sp) + mov r1,-(sp) + mov r5,r0 + tst *curarg + beq 1f + mov r0,-(sp) + mov *curarg,-(sp) + clr *curarg + jsr pc,filerr + tst (sp)+ + mov (sp)+,r0 +1: + mov r2,-(sp) + mov r3,-(sp) + jsr pc,errcmn + mov (sp)+,r3 + mov (sp)+,r2 + mov (sp)+,r1 + mov (sp)+,r0 + rts pc + +errorp2: + mov pc,errflg + mov $666,outmod / make nonexecutable + mov r3,-(sp) + mov r2,-(sp) + mov r1,-(sp) + mov r0,-(sp) + + tst -(sp) / write(1, argb, strlen(argb)) + mov $argb,-(sp) + mov $1,-(sp) + mov $argb,r1 + clr r0 +1: + tstb (r1)+ + beq 2f + inc r0 + br 1b +2: + mov r0,4(sp) + jsr pc,_write + add $6,sp + + movb 12(sp),r0 + jsr pc,errcmn + mov (sp)+,r0 + mov (sp)+,r1 + mov (sp)+,r2 + mov (sp)+,r3 + mov (sp)+,(sp) + rts pc + +errcmn: + mov line,r3 + movb r0,9f + mov $9f+6,r0 + mov $4,r1 +2: + clr r2 + div $10.,r2 + add $'0,r3 + movb r3,-(r0) + mov r2,r3 + sob r1,2b + + mov $7,-(sp) / write(1, 9f, 7) + mov $9f,-(sp) + mov $1,-(sp) + jsr pc,_write + add $6,sp + rts pc + + .data +9: + .even + .text + +p0putw: + tst ifflg + beq 1f + cmp r4,$'\n + bne 2f +1: + mov r4,*obufp + add $2,obufp + cmp obufp,$outbuf+1024. + blo 2f + mov $outbuf,obufp + + mov r1,-(sp) / protect r1 from library + mov $1024.,-(sp) / write(fout, outbuf, 1024) + mov $outbuf,-(sp) + mov fout,-(sp) + jsr pc,_write + add $6,sp + mov (sp)+,r1 + tst r0 + bpl 2f + jmp wrterr +2: + rts pc + +/ Pass 0. + +pass0: + jsr pc,p0readop + jsr pc,checkeos + br 7f + tst ifflg + beq 3f + cmp r4,$200 + blos pass0 + cmpb (r4),$21 /if + bne 2f + inc ifflg +2: + cmpb (r4),$22 /endif + bne pass0 + dec ifflg + br pass0 +3: + mov r4,-(sp) + jsr pc,p0readop + 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 + mov $'x,r5 + jsr pc,error + br pass0 +1: + bitb $37,(r4) + beq 1f + mov $'m,r5 + jsr pc,error +1: + bisb dot-2,(r4) + mov dot,2(r4) + br pass0 +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) + + cmp fbfree,$4 / room for another fb entry? + bge 5f / yes - br + jsr pc,growfb / no - grow the table +5: + sub $4,fbfree / four bytes less available + mov nxtfb,*fbptr / store first word + add $2,fbptr / advance to next + mov nxtfb+2,*fbptr / store second word + add $2,fbptr / point to next entry + br pass0 +4: + jsr pc,p0readop + jsr pc,expres + mov (sp)+,r1 + cmp r1,$200 + bhis 1f + mov $'x,r5 + jsr pc,error +7: + 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: + mov $'.,r5 + jsr pc,error + movb $2,dotrel +ealoop: + cmp r4,$'; + beq 9f + cmp r4,$'\n + bne 1f + inc line + br 9f +1: + cmp r4,$'\e + bne 2f + tst ifflg + beq 1f + mov $'x,r5 + jsr pc,error +1: + rts pc +2: + mov $'x,r5 + jsr pc,error +2: + jsr pc,checkeos + br 9f + jsr pc,p0readop + br 2b +9: + jmp pass0 + +fbcheck: + cmp r0,$9. + bhi 1f + rts pc +1: + mov $'f,r5 + jsr pc,error + clr r0 + rts pc + +/ the 'fb' table never grows to be large. In fact all of the assemblies +/ of C compiler generated code which were processed by 'c2' never +/ produced a table larger than 0 bytes. So we 'realloc' because +/ this is not done enough to matter. + +growfb: + mov r1,-(sp) / save r1 from library + add $256.,fbtblsz / new size of fb table + mov $256.,fbfree / number available now + mov fbtblsz,-(sp) / fbtbl = realloc(fbtbl, fbtblsz); + mov fbtbl,-(sp) + bne 1f / extending table - br + mov $1,(sp) / r0 = calloc(1, fbtblsz); + jsr pc,_calloc + br 2f +1: + jsr pc,_realloc +2: + cmp (sp)+,(sp)+ + mov r0,fbtbl + bne 1f + iot / Can never happen (I hope) +1: + add fbtblsz,r0 / fbptr starts 256 bytes from + sub $256.,r0 / end of new region + mov r0,fbptr + mov (sp)+,r1 / restore register + rts pc + +/ Symbol table lookup and hashtable maintenance. + +rname: + mov r1,-(sp) + mov r2,-(sp) + mov r3,-(sp) + movb Ncps,r5 / Max num of chars to accept + mov $symbol,r2 + clr (r2) + clr -(sp) + clr -(sp) + cmp r0,$'~ / symbol not for hash table? + bne 1f / no - br + inc 2(sp) + clr 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: + clrb (r2)+ / null terminate string + movb r0,ch + mov (sp)+,r1 + clr r0 + tst (sp)+ + beq 1f + mov symend,r4 + br 4f / go insert into symtable (!hashtbl) +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 $8f-9f,-(sp) / write(fileno(stdout),9f,8f-9f); + mov $9f,-(sp) + mov $1,-(sp) + jsr pc,_write + add $6,sp + jsr pc,aexit +/ not reached + + .data +timesaround: 0 +9: + +8: + .even + .text +3: + inc timesaround +2: + mov $symbol,r2 + mov -(r1),r4 + beq 3f + mov (r4)+,r3 / ptr to symbol's name +9: + cmpb (r2),(r3)+ + bne 1b / not the right symbol - br + tstb (r2)+ / at end of symbol? + bne 9b / nope - keep looking + br 1f / yep - br +3: + mov symend,r4 + jsr pc,isroom / make sure there's room in block + mov r4,(r1) +4: + jsr pc,isroom / check for room in current block + + mov $symbol,r2 / length of string (including null) +8 : + tstb (r2)+ + bne 8b + sub $symbol,r2 + jsr pc,astring / allocate string space + mov r0,(r4)+ / save string pointer in symtab entry + mov $symbol,r1 +9: + movb (r1)+,(r0)+ / copy symbol name to string block + bne 9b + sub $SYMENTSZ,symleft + +/ each new symbol is assigned a unique one up number. This is done because +/ the user symbol table is no longer contiguous - the symbol number can +/ not be calculated by subtracting a base address and dividing by the +/ size of a symbol. + + clr (r4)+ / flags word + clr (r4)+ / value word + mov symnum,(r4)+ + inc symnum + mov r4,symend + sub $6,r4 / point to flags word +1: + mov r4,-(sp) + mov r4,r3 + tst -(r3) / back to beginning of entry + cmp r3,$ebsymtab / Permanent Symbol Table(opcode, etc)? + blo 1f / yes - br + mov 6(r3),r4 / get symbol number + add $4000,r4 / user symbol flag + br 2f +1: + +/ PST entries are PSTENTSZ bytes each because they do not have a 'symnum' +/ entry associated with them. + + sub $symtab,r3 + clr r2 + div $PSTENTSZ,r2 + mov r2,r4 + add $1000,r4 / builtin symbol +2: + jsr pc,p0putw + mov (sp)+,r4 + mov (sp)+,r3 + mov (sp)+,r2 + mov (sp)+,r1 + tst (sp)+ + rts pc + +isroom: + cmp symleft,$SYMENTSZ / room for another symbol? + bge 1f / yes - br + mov r1,-(sp) / save from library + mov $SYMBLKSZ+2,-(sp) / size of sym block plus link word + mov $1,-(sp) / number of blocks to allocate + jsr pc,_calloc / calloc(1, SYMBLKSZ+2); + cmp (sp)+,(sp)+ + / check for failure? + mov r0,*symblk / link new block to old + mov r0,symblk / this is now the current block + tst (r0)+ / skip link word + mov $SYMBLKSZ,symleft / number of bytes available + mov r0,r4 / put where it's expected + mov (sp)+,r1 / restore saved register +1: + rts pc / return + +/ allocate room for a string, the length is in R2 and includes room for +/ a terminating null byte. + +astring: + cmp r2,strleft / room in current block? + ble 1f / yes - go carve out a chunk + mov $STRBLKSZ+2,-(sp) + mov $1,-(sp) + jsr pc,_calloc / symblk = calloc(1,STRBLKSZ+2) + / check for failure? + cmp (sp)+,(sp)+ + mov r0,*strblk / update forward link between blocks + mov r0,strblk / update current string block pointer + tst (r0)+ / skip link word + mov r0,strend / current data pointer + mov $STRBLKSZ,strleft / amount of space left +1: + mov strend,r0 / string address + add r2,strend / update current end point + sub r2,strleft / update amount of space left + rts pc + +number: + mov r2,-(sp) + mov r3,-(sp) + mov r5,-(sp) + clr r1 + clr r5 +1: + jsr pc,rch + cmp r0,$'0 + blt 1f + cmp r0,$'9 + bgt 1f + sub $'0,r0 + mul $10.,r5 + add r0,r5 + ash $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 ibufc + blt 2f + movb *ibufp,r0 + inc ibufp + bic $!177,r0 + beq 1b + rts pc +2: + mov fin,r0 + bmi 3f + mov r1,-(sp) / protect r1 from library + mov $1024.,-(sp) / read(fin, inbuf, 1024) + mov $inbuf,-(sp) + mov r0,-(sp) + jsr pc,_read + add $6,sp + mov (sp)+,r1 + tst r0 + ble 2f + mov r0,ibufc + mov $inbuf,ibufp + br 1b +2: + mov r1,-(sp) / protect r1 from library + mov fin,-(sp) / close(r0) + jsr pc,_close + tst (sp)+ + mov $-1,fin + mov (sp)+,r1 +3: + dec nargs + bge 2f + mov $'\e,r0 + rts pc +2: + tst ifflg + beq 2f + mov $'i,r5 + jsr pc,error + jsr pc,aexit +/ not reached + +2: +/ check for the filename arguments of "-" or "--", these mean to read 'stdin'. +/ Additional filenames are permitted and will be processed when EOF +/ is detected on stdin. + mov *curarg,r0 + cmpb (r0)+,$'- + bne 5f / not the special case - br + tstb (r0) / must be '-' by itself + beq 4f + cmpb (r0)+,$'- / check for "--" + bne 5f / not a double -, must be a filename + tstb (r0) / null terminated? + bne 5f / no - must be a filename +4: + clr fin / file descriptor is 0 for stdin + br 2f +5: + mov r1,-(sp) / protect r1 from library + clr -(sp) / open((r0), O_RDONLY, 0) + clr -(sp) + mov *curarg,-(sp) + jsr pc,_open + add $6,sp + mov (sp)+,r1 + mov r0,fin + bpl 2f + mov *curarg,-(sp) + jsr pc,filerr + tst (sp)+ + jsr pc,aexit +/not reached +2: + mov $1,line + mov r4,-(sp) + mov r1,-(sp) + mov $5,r4 + jsr pc,p0putw + mov *curarg,r1 +2: + movb (r1)+,r4 + beq 2f + jsr pc,p0putw + br 2b +2: + add $2,curarg + mov $-1,r4 + jsr pc,p0putw + mov (sp)+,r1 + mov (sp)+,r4 + br 1b + +p0readop: + mov savop,r4 + beq 1f + clr savop + rts pc +1: + jsr pc,8f + jsr pc,p0putw + rts pc + +8: + jsr pc,rch + mov r0,r4 + movb chartab(r0),r1 + bgt rdname + jmp *1f-2(r1) + + .data + fixor + escp + 8b + retread + dquote + garb + squote + rdname + skip + rdnum + retread + string +1: + .text +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 + + .data +esctab: + .byte '/, '/ + .byte '\<, 035 + .byte '>, 036 + .byte '%, 037 + .byte 0, 0 + .text + +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,p0putw + mov numval,r4 + jsr pc,p0putw + 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: + mov $'g,r5 + jsr pc,error + br 8b + +string: + mov $'<,r4 + jsr pc,p0putw + clr numval +1: + jsr pc,rsch + tst r1 + bne 1f + mov r0,r4 + bis $400,r4 + jsr pc,p0putw + inc numval + br 1b +1: + mov $-1,r4 + jsr pc,p0putw + 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: + mov $'<,r5 + jsr pc,error + jsr pc,aexit +/ not reached + + .data +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 + .text + +opline: + mov r4,r0 + bmi 1f + cmp r0,$200 + bgt 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 + cmp r0,$5 + blt xpr + cmp r0,$36 + bgt xpr + mov r0,-(sp) + jsr pc,p0readop + mov (sp)+,r0 + asl r0 + jmp *1f-12(r0) + + .data +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 + .text + +opl35: / jbr + mov $4,-(sp) + br 1f + +opl36: / jeq, etc + 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 + +opl13: +opl7: /double + jsr pc,addres +op2: + cmp r4,$', + beq 1f + jsr pc,errora + rts pc +1: + jsr pc,p0readop +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,p0readop + +opl6: +opl10: +opl11: /branch + jsr pc,expres + add $2,dot + rts pc + +opl16: / .byte + jsr pc,expres + inc dot + cmp r4,$', + bne 1f + jsr pc,p0readop + br opl16 +1: + rts pc + +opl17: / < (.ascii) + add numval,dot + jsr pc,p0readop + rts pc + +opl20: /.even + inc dot + bic $1,dot + rts pc + +opl21: /.if + jsr pc,expres + tst r3 + bne 1f + mov $'U,r5 + jsr pc,error +1: + tst r2 + bne opl22 + inc ifflg +opl22: /endif + rts pc + +opl23: /.globl + cmp r4,$200 + blo 1f + bisb $40,(r4) + jsr pc,p0readop + cmp r4,$', + bne 1f + jsr pc,p0readop + 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 + +opl32: / .common + cmp r4,$200 + blo 1f + bis $40,(r4) + jsr pc,p0readop + cmp r4,$', + bne 1f + jsr pc,p0readop + jsr pc,expres + rts pc +1: + mov $'x,r5 + jsr pc,error + 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,p0readop + jsr pc,expres + jsr pc,checkreg + jsr pc,checkrp +1: + add $2,dot + clr r0 + rts pc +2: + cmp r3,$24 / register type + bne 1b + jsr pc,checkreg + clr r0 + rts pc + +alp: + jsr pc,p0readop + jsr pc,expres + jsr pc,checkrp + jsr pc,checkreg + cmp r4,$'+ + bne 1f + jsr pc,p0readop + clr r0 + rts pc +1: + mov $2,r0 + rts pc + +amin: + jsr pc,p0readop + cmp r4,$'( + beq 1f + mov r4,savop + mov $'-,r4 + br getx +1: + jsr pc,p0readop + jsr pc,expres + jsr pc,checkrp + jsr pc,checkreg + clr r0 + rts pc + +adoll: + jsr pc,p0readop + jsr pc,expres + add $2,dot + clr r0 + rts pc + +astar: + jsr pc,p0readop + cmp r4,$'* + bne 1f + mov $'*,r5 + jsr pc,error +1: + jsr pc,addres + add r0,dot + rts pc + +errora: + mov $'a,r5 + jsr pc,error + 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: + mov $'e,r5 + jsr pc,error + rts pc + +checkrp: + cmp r4,$') + beq 1f + mov $'),r5 + jsr pc,error + rts pc +1: + jsr pc,p0readop + rts pc + +expres: + mov r5,-(sp) + mov $'+,-(sp) + clr opfound + clr r2 + mov $1,r3 + br 1f +advanc: + jsr pc,p0readop +1: + mov r4,r0 + tst r0 + blt 6f + cmp r0,$177 + ble 7f +6: + 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 + mov $'f,r5 + jsr pc,error + 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) + + .data +esw1: + '+; binop + '-; binop + '*; binop + '/; binop + '&; binop + 037; binop + 035; binop + 036; binop + '%; binop + '[; brack + '^; binop + 1; exnum + '!; binop + 0; 0 + .text + +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,p0readop + jsr pc,expres + cmp r4,$'] + beq 1f + mov $'],r5 + jsr pc,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) + + .data +exsw2: + '+; exadd + '-; exsub + '*; exmul + '/; exdiv + 037; exor + '&; exand + 035;exlsh + 036;exrsh + '%; exmod + '!; exnot + '^; excmbin + 0; 0 + .text + +excmbin: + mov r0,r3 / give left flag of right + br eoprnd + +exrsh: + neg r1 + beq exlsh + inc r1 + clc + ror r2 +exlsh: + clr r5 + jsr pc,combin + ash r1,r2 + br eoprnd + +exmod: + clr r5 + jsr pc,combin + mov r1,-(sp) + mov r2,r1 + clr r0 + div (sp)+,r0 + mov r1,r2 + br eoprnd + +exadd: + clr r5 + jsr pc,combin + add r1,r2 + br eoprnd + +exsub: + mov $1,r5 + jsr pc,combin + sub r1,r2 + br eoprnd + +exand: + clr r5 + jsr pc,combin + com r1 + bic r1,r2 + br eoprnd + +exor: + clr r5 + jsr pc,combin + bis r1,r2 + br eoprnd + +exmul: + clr r5 + jsr pc,combin + mul r2,r1 + mov r1,r2 + br eoprnd + +exdiv: + clr r5 + jsr pc,combin + mov r1,-(sp) + mov r2,r1 + clr r0 + div (sp)+,r0 + mov r0,r2 + br eoprnd + +exnot: + clr r5 + jsr pc,combin + 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: + clr r3 +2: + bis (sp)+,r3 + rts pc + + .data +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 + +a.tmp1: +Ncps: .byte 8. +1: <-\0> + .even +dash: 1b +fin: -1 +fout: -1 +/ The next two _must_ be adjacent! Not sure why, but then this whole +/ assembler is weird beyond belief. +curfb: -1;-1;-1;-1;-1;-1;-1;-1;-1;-1 +nxtfb: .=.+20. / first 4 used by pass0, all 20. by pass1+2 + .bss +curfbr: .=.+10. +savdot: .=.+6 +hshtab: .=.+2 / dynamically allocated +ch: .=.+2 +symnum: .=.+2 / symbol number +symbol: .=.+32. / XXX + .=.+2 / paranoia to make sure a null is present +inbuf: .=.+1024. +line: .=.+2 +ifflg: .=.+2 +nargs: .=.+2 +curarg: .=.+2 +opfound:.=.+2 +savop: .=.+2 +numval: .=.+2 +fbtblsz:.=.+2 +fbfree: .=.+2 +fbptr: .=.+2 +fbtbl: .=.+2 +usymtab:.=.+2 / ptr to first block of symbols +symleft:.=.+2 / bytes left in current symbol block +symend: .=.+2 / ptr to next symbol space in block +symblk: .=.+2 / ptr to beginning of current sym block +strleft:.=.+2 / amount left in string block +strend: .=.+2 / ptr to next available string byte +strblk: .=.+2 / ptr to current string block link word + +/ key to types + +/ 0 undefined +/ 1 absolute (nop, reset, bpt, ...) +/ 2 text +/ 3 data +/ 4 bss +/ 5 flop freg,dst (movfo, = stcfd) +/ 6 branch +/ 7 jsr +/ 10 rts +/ 11 sys, trap +/ 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 +/ the format of PST entries was changed. rather than fixed 8 byte strings +/ (often with many trailing nulls) a pointer to a null terminated string +/ is now used. This saves quite a bit of space since most PST entries are +/ only 3 or 4 characters long. we had to do this the hard way since there +/ is no macro capability in the assembler and i'd chuck out the SDI [Span +/ Dependent Instruction] stuff and use my own assembler before trying to +/ add macros to this one. Symbols beginning with 'L' are used since the +/ linker can be told to discard those. + +symtab: +/ special symbols + +L1; dotrel: 02; dot: 0000000 +L2; 01; dotdot: 0000000 + +/ register + +L3; 24; 000000 +L4; 24; 000001 +L5; 24; 000002 +L6; 24; 000003 +L7; 24; 000004 +L8; 24; 000005 +L9; 24; 000006 +L10; 24; 000007 + +/ double operand + +L11; 13; 0010000 +L12; 13; 0110000 +L13; 13; 0020000 +L14; 13; 0120000 +L15; 13; 0030000 +L16; 13; 0130000 +L17; 13; 0040000 +L18; 13; 0140000 +L19; 13; 0050000 +L20; 13; 0150000 +L21; 13; 0060000 +L22; 13; 0160000 + +/ branch + +L23; 06; 0000400 +L24; 06; 0001000 +L25; 06; 0001400 +L26; 06; 0002000 +L27; 06; 0002400 +L28; 06; 0003000 +L29; 06; 0003400 +L30; 06; 0100000 +L31; 06; 0100400 +L32; 06; 0101000 +L33; 06; 0101400 +L34; 06; 0102000 +L35; 06; 0102400 +L36; 06; 0103000 +L37; 06; 0103000 +L38; 06; 0103000 +L39; 06; 0103400 +L40; 06; 0103400 +L41; 06; 0103400 + +/ jump/branch type + +L42; 35; 0000400 +L43; 36; 0001000 +L44; 36; 0001400 +L45; 36; 0002000 +L46; 36; 0002400 +L47; 36; 0003000 +L48; 36; 0003400 +L49; 36; 0100000 +L50; 36; 0100400 +L51; 36; 0101000 +L52; 36; 0101400 +L53; 36; 0102000 +L54; 36; 0102400 +L55; 36; 0103000 +L56; 36; 0103000 +L57; 36; 0103000 +L58; 36; 0103400 +L59; 36; 0103400 +L60; 36; 0103400 + +/ single operand + +L61; 15; 0005000 +L62; 15; 0105000 +L63; 15; 0005100 +L64; 15; 0105100 +L65; 15; 0005200 +L66; 15; 0105200 +L67; 15; 0005300 +L68; 15; 0105300 +L69; 15; 0005400 +L70; 15; 0105400 +L71; 15; 0005500 +L72; 15; 0105500 +L73; 15; 0005600 +L74; 15; 0105600 +L75; 15; 0005700 +L76; 15; 0105700 +L77; 15; 0006000 +L78; 15; 0106000 +L79; 15; 0006100 +L80; 15; 0106100 +L81; 15; 0006200 +L82; 15; 0106200 +L83; 15; 0006300 +L84; 15; 0106300 +L85; 15; 0000100 +L86; 15; 0000300 +L87; 15; 0006500 +L88; 15; 0006600 +L89; 15; 0106500 +L90; 15; 0106600 +L91; 15; 0170300 +L92; 15; 0106700 +L93; 15; 0106400 +L94; 15; 0007000 +L95; 15; 0007200 +L96; 15; 0007300 + +/ jsr + +L97; 07; 0004000 + +/ rts + +L98; 010; 000200 + +/ simple operand + +L99; 011; 104400 +L102; 011; 000230 + +/ flag-setting + +L103; 01; 0000240 +L104; 01; 0000241 +L105; 01; 0000242 +L106; 01; 0000244 +L107; 01; 0000250 +L108; 01; 0000257 +L109; 01; 0000261 +L110; 01; 0000262 +L111; 01; 0000264 +L112; 01; 0000270 +L113; 01; 0000277 +L114; 01; 0000000 +L115; 01; 0000001 +L116; 01; 0000002 +L117; 01; 0000003 +L118; 01; 0000004 +L119; 01; 0000005 +L120; 01; 0000006 +L121; 01; 0000007 + +/ floating point ops + +L122; 01; 170000 +L123; 01; 170001 +L124; 01; 170011 +L125; 01; 170002 +L126; 01; 170012 +L127; 15; 170400 +L128; 15; 170700 +L129; 15; 170600 +L130; 15; 170500 +L131; 12; 172400 +L132; 14; 177000 +L133; 05; 175400 +L134; 14; 177400 +L135; 05; 176000 +L136; 14; 172000 +L137; 14; 173000 +L138; 14; 171000 +L139; 14; 174400 +L140; 14; 173400 +L141; 14; 171400 +L142; 14; 176400 +L143; 05; 175000 +L144; 15; 170100 +L145; 15; 170200 +L146; 24; 000000 +L147; 24; 000001 +L148; 24; 000002 +L149; 24; 000003 +L150; 24; 000004 +L151; 24; 000005 + +L152; 30; 070000 +L153; 30; 071000 +L154; 30; 072000 +L155; 30; 073000 +L156; 07; 074000 +L157; 15; 006700 +L158; 11; 006400 +L159; 31; 077000 + +/ pseudo ops + +L160; 16; 000000 +L161; 20; 000000 +L162; 21; 000000 +L163; 22; 000000 +L164; 23; 000000 +L165; 25; 000000 +L166; 26; 000000 +L167; 27; 000000 +L168; 32; 000000 + +ebsymtab: + +L1: <.\0> +L2: <..\0> +L3: +L4: +L5: +L6: +L7: +L8: +L9: +L10: +L11: +L12: +L13: +L14: +L15: +L16: +L17: +L18: +L19: +L20: +L21: +L22: +L23: +L24: +L25: +L26: +L27: +L28: +L29: +L30: +L31: +L32: +L33: +L34: +L35: +L36: +L37: +L38: +L39: +L40: +L41: +L42: +L43: +L44: +L45: +L46: +L47: +L48: +L49: +L50: +L51: +L52: +L53: +L54: +L55: +L56: +L57: +L58: +L59: +L60: +L61: +L62: +L63: +L64: +L65: +L66: +L67: +L68: +L69: +L70: +L71: +L72: +L73: +L74: +L75: +L76: +L77: +L78: +L79: +L80: +L81: +L82: +L83: +L84: +L85: +L86: +L87: +L88: +L89: +L90: +L91: +L92: +L93: +L94: +L95: +L96: +L97: +L98: +L99: +L102: +L103: +L104: +L105: +L106: +L107: +L108: +L109: +L110: +L111: +L112: +L113: +L114: +L115: +L116: +L117: +L118: +L119: +L120: +L121: +L122: +L123: +L124: +L125: +L126: +L127: +L128: +L129: +L130: +L131: +L132: +L133: +L134: +L135: +L136: +L137: +L138: +L139: +L140: +L141: +L142: +L143: +L144: +L145: +L146: +L147: +L148: +L149: +L150: +L151: +L152: +L153: +L154: +L155: +L156: +L157: +L158: +L159: +L160: <.byte\0> +L161: <.even\0> +L162: <.if\0> +L163: <.endif\0> +L164: <.globl\0> +L165: <.text\0> +L166: <.data\0> +L167: <.bss\0> +L168: <.comm\0> + .text diff --git a/bin/as/as2.s b/bin/as/as2.s new file mode 100644 index 0000000..c9472b5 --- /dev/null +++ b/bin/as/as2.s @@ -0,0 +1,1799 @@ +/ Sept 10, 1997 - fix coredump caused by using wrong error reporting +/ calling convention in three places. + + .globl _signal, _close, _lseek, _unlink, _umask, _chmod, __exit + .globl _write, _read, _brk, _end, _open, _realloc, _fchmod + .globl pass1, hshsiz, outmod, dot, dotdot, error + .globl checkeos, curfb, savdot, ch, line, savop, inbuf, errflg + .globl fbptr, fbtbl, symnum, hshtab, symblk, symleft, dotrel + .globl symtab, aexit, overlaid, defund, a.outp, passno, filerr + .globl wrterr, argb, curfb, nxtfb, usymtab + .globl fin, fout, a.tmp1, ibufc, ibufp, obufp, outbuf, symbol + .globl PSTENTSZ, SYMENTSZ, SYMBLKSZ, Newsym + +pass1: + mov fout,fin / tmp file is now input file + mov $666,-(sp) / mode + mov $3001 ,-(sp) / O_WRONLY|O_CREAT|O_TRUNC + mov a.outp,-(sp) / filename + jsr pc,_open + add $6,sp + mov r0,fout / file descriptor any good? + bpl 1f / yes - br + mov a.outp,-(sp) + jsr pc,filerr +1: + +/ 'symnum' has number of symbols. The hashtable from pass 0 is no +/ longer needed - we can reuse it directly for 'usymtab' if there are less +/ than 'hshsiz' symbols. If there are more than 'hshsiz' (currently +/ 1500) symbols we have to realloc. +/ +/ The 'fb' table (usually 0 long) is appended to the 'usymtab' (4 byte +/ entries per symbol). + + mov fbptr,r0 + sub fbtbl,r0 / # bytes in 'fb' table + asr r0 / convert to number of words + add symnum,r0 / add in number of symbols twice + add symnum,r0 / because we need 2 words per symbol + inc r0 / one more for terminator word + cmp r0,$hshsiz / is hashtable big enough already? + blo 1f / yes -br + asl r0 / convert to bytes + mov r0,-(sp) + mov hshtab,-(sp) + jsr pc,_realloc / hshtab = realloc(hshtab, r0) + mov r0,hshtab + bne 1f + iot / should never happen +1: + mov hshtab,r1 + mov usymtab,r2 +9: + mov r2,symblk / save ptr to start of block + tst (r2)+ / skip link word + mov $SYMBLKSZ,symleft / init amount left in block +1: + tst (r2) / end of symbol table block + beq 4f / yes - br + add $8.,symsiz / size of symbol table + tst Newsym / are we doing new style? + bne 8f / yes - br + add $4,symsiz / no, symbol table entries are bigger +8: + mov 2(r2),r0 / flags word + bic $!37,r0 + cmp r0,$2 /text + blo 2f + cmp r0,$3 /data + bhi 2f + add $31,r0 /mark "estimated" + mov r0,(r1)+ / store flags word + mov 4(r2),(r1)+ / copy value word + br 3f +2: + clr (r1)+ + clr (r1)+ +3: + add $SYMENTSZ,r2 / skip to next symbol entry + sub $SYMENTSZ,symleft / one symbol less in block + cmp symleft,$SYMENTSZ / room for another symbol? + bge 1b / yes - br +4: + mov *symblk,r2 / follow link to next block + bne 9b / if not at end +1: + +/ The 'fb' table needs to be appended to the 'usymtab' table now + + mov fbtbl,r0 + mov r1,fbbufp / save start of 'fb' table +1: + cmp r0,fbptr / at end of table? + bhis 2f / yes - br + mov (r0)+,r4 + add $31,r4 / "estimated" + mov r4,(r1)+ + mov (r0)+,(r1)+ + br 1b +2: + mov r1,endtable + mov $100000,(r1)+ + + mov $savdot,r0 / reset the 'psect' (text,data,bss) + clr (r0)+ / counters for the next pass + clr (r0)+ + clr (r0)+ + jsr pc,setup / init fb stuff + + jsr pc,pass1_2 / do pass 1 + +/ prepare for pass 2 + inc passno + cmp outmod,$777 + beq 1f + jsr pc,aexit +/ not reached +1: + jsr pc,setup + 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 hshtab,r1 +1: + jsr pc,doreloc + add $4,r1 + cmp r1,endtable + blo 1b + clr r0 + clr r1 + mov $txtp,-(sp) + jsr pc,oset + mov trelseek,r0 + mov trelseek+2,r1 + mov $relp,-(sp) + jsr pc,oset + mov $8.,r2 + mov $txtmagic,r1 +1: + mov (r1)+,r0 + mov $txtp,-(sp) + jsr pc,putw + sob r2,1b + + jsr pc,pass1_2 / do pass 2 + +/polish off text and relocation + + mov $txtp,-(sp) + jsr pc,flush + mov $relp,-(sp) + jsr pc,flush + +/ append full symbol table + mov symseek,r0 + mov symseek+2,r1 + mov $txtp,-(sp) + jsr pc,oset + + mov usymtab,r2 / pointer to first symbol block + mov hshtab,r1 / 'type' and 'value' array + + tst Newsym + beq 8f + jsr pc,nsymout + br 9f +8: + jsr pc,osymout +9: + mov $txtp,-(sp) + jsr pc,flush + jsr pc,aexit +/ not reached + +saexit: + mov pc,errflg + +aexit: + mov $a.tmp1,-(sp) / unlink(a.tmp1) + jsr pc,_unlink + tst errflg + bne 2f + + clr (sp) + jsr pc,_umask + + bic r0,outmod / fchmod(fout, outmod&umask(0)) + mov outmod,(sp) + mov fout,-(sp) + jsr pc,_fchmod + tst (sp)+ + clr (sp) + br 1f +2: + mov $2,(sp) +1: + jsr pc,__exit / _exit(errflg ? 2 : 0) + +filerr: + mov 2(sp),r0 / filename string. no need to clean + tst -(sp) / stack, this routine goes to saexit. + mov r0,-(sp) + mov $1,-(sp) +1: + tstb (r0)+ + bne 1b + sub 2(sp),r0 + dec r0 + mov r0,4(sp) + jsr pc,_write + add $6,sp + + mov $2,-(sp) / write(1, "?\n", 2) + mov $qnl,-(sp) + mov $1,-(sp) + jsr pc,_write + add $6,sp + tst passno + bpl saexit + rts pc + +osymout: +9: + mov r2,symblk / save ptr to current sym block + tst (r2)+ / skip link word + mov $SYMBLKSZ,symleft / space left in symbol block +1: + mov (r2),r4 / pointer to symbol name + beq 4f / end of block - br + + mov $8.,r5 / max number to copy + mov $symbol,r0 / destination buffer +2: + movb (r4),(r0)+ / copy a byte + beq 6f + inc r4 / non null - bump source ptr +6: + sob r5,2b + +/ Now put four words of symbol name to the object file + mov $4,r5 / number of words to do + mov $symbol,r4 +6: + mov (r4)+,r0 / word (2 chars) of symbol name + mov $txtp,-(sp) + jsr pc,putw + sob r5,6b + +/ values from 'hshtab' (parallel array to symbol table) are retrieved now, +/ they take the place of the flags and value entries of the symbol table. + mov (r1)+,r0 + mov $txtp,-(sp) + jsr pc,putw + mov (r1)+,r0 + mov $txtp,-(sp) + jsr pc,putw + add $SYMENTSZ,r2 / skip to next symbol + sub $SYMENTSZ,symleft / one less symbol in block + cmp symleft,$SYMENTSZ / room for another? + bge 1b / yes - br +4: + mov *symblk,r2 / no, follow link to next block + bne 9b / unless it's end of list + rts pc + +nsymout: + clr totalsz + mov $4,totalsz+2 / string table min size is 4 +9: + mov r2,symblk / save ptr to current symbol block + tst (r2)+ / skip link word + mov $SYMBLKSZ,symleft / amount of space left in block +1: + mov (r2),r4 / pointer to symbol's string + beq 4f / end of block - br + mov totalsz,r0 / now output the... + mov $txtp,-(sp) / high order of the string index... + jsr pc,putw / to the object file + mov totalsz+2,r0 + mov $txtp,-(sp) + jsr pc,putw / and the low order word +2: + tstb (r4)+ / find the end of the string + bne 2b + sub (r2),r4 / compute length including the null + add r4,totalsz+2 / offset of next string + adc totalsz + mov (r1)+,r0 / 'type' word of symbol + mov $txtp,-(sp) + jsr pc,putw + mov (r1)+,r0 / 'value' word of symbol + mov $txtp,-(sp) + jsr pc,putw + add $SYMENTSZ,r2 / advance to next symbol + sub $SYMENTSZ,symleft / adjust amount left in symbol block + cmp symleft,$SYMENTSZ / is there enough for another symbol? + bge 1b / yes - br +4: + mov *symblk,r2 / follow link to next symbol block + bne 9b / more - br + mov totalsz,r0 / now output the string table length + mov $txtp,-(sp) / high order word first + jsr pc,putw + mov totalsz+2,r0 / followed by the low order + mov $txtp,-(sp) + jsr pc,putw + +/ Now write the strings out + + mov usymtab,r2 / start at beginning of symbols +9: + mov r2,symblk / save pointer to current block + tst (r2)+ / skip link word + mov $SYMBLKSZ,symleft / amount left in block +1: + mov (r2),r4 / pointer to symbol's string + beq 4f / at end of block - br + jsr pc,putstring / write out the string + add $SYMENTSZ,r2 / advance to next symbol + sub $SYMENTSZ,symleft / adjust amount left in block + cmp symleft,$SYMENTSZ / enough for another symbol? + bge 1b / yes - br +4: + mov *symblk,r2 / move to next block of symbols + bne 9b / any left - br + +/ probably not necessary but let us leave the file size on an even +/ byte boundary. + + bit $1,totalsz+2 / odd number of bytes in string table? + beq 5f / no - br + mov symblk,r4 / we know 'symblk' points to a null + jsr pc,putstring / output a single null +5: + rts pc + +/ R4 has the address of a null terminated string to write to the output +/ file. The terminating null is included in the output. This routine +/ "inlines" the 'txtp seek structure' manipulation because the 'putw' +/ routine was 1) not suitable to byte output and 2) symbol strings are +/ only written using the 'txtp' (as opposed to 'relp' - relocation info) +/ structure. + +putstring: + cmp txtp,txtp+2 / room for another byte? + bhis 1f / no - br +3: + movb (r4),*txtp / put byte in buffer + inc txtp / advance output position + tstb (r4)+ / did we just do the null? + bne putstring / no - go again + rts pc / yes - we're done, return +1: + mov r2,-(sp) / save r2 from being destroyed + mov $txtp,-(sp) / flush buffered output and... + jsr pc,flush / reset the pointers + mov (sp)+,r2 / restore symbol pointer + br 3b / go output a byte + +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 + +setup: + clr dot + mov $2,dotrel + mov $..,dotdot + clr brtabp + + mov $curfb,r4 +1: + clr (r4)+ + cmp r4,$curfb+40. + blo 1b + clr r4 +1: + jsr pc,fbadv + inc r4 + cmp r4,$10. + blt 1b +/ just rewind /tmp/atm1xx rather than close and re-open + clr -(sp) + clr -(sp) + clr -(sp) + mov fin,-(sp) + jsr pc,_lseek / lseek(fin, 0L, 0) + add $8.,sp + clr ibufc + rts pc + +outw: + cmp dot-2,$4 + beq 9f + bit $1,dot + bne 1f + add $2,dot + tst 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 hshtab,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: + mov $'r,-(sp) + jsr pc,error +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 + mov $txtp,-(sp) + jsr pc,putw + mov tseekp,r0 + add $2,2(r0) + adc (r0) + mov r3,r0 + mov $relp,-(sp) + jsr pc,putw + mov rseekp,r0 + add $2,2(r0) + adc (r0) +8: + rts pc +1: + mov $'o,-(sp) + jsr pc,error + clr r3 + jsr pc,outb + rts pc +9: + mov $'x,-(sp) + jsr pc,error + rts pc + +outb: + cmp dot-2,$4 / test bss mode + beq 9b + cmp r3,$1 + blos 1f + mov $'r,-(sp) + jsr pc,error +1: + tst passno + beq 2f + mov r2,r0 + bit $1,dot + bne 1f + mov $txtp,-(sp) + jsr pc,putw + clr r0 + mov $relp,-(sp) + jsr pc,putw + 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 + +/ pass 1 and 2 common code + +pass1_2: + 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: + tst passno + bne eal1 + movb dotrel,r0 + asl r0 + cmp dot,txtsiz-4(r0) + bhi 8f + jmp ealoop +8: + mov dot,txtsiz-4(r0) +eal1: + jmp ealoop +1: + mov (sp)+,r4 + cmp r4,$200 + bhis 1f + cmp r4,$2 + beq 3f + mov $'x,-(sp) + jsr pc,error + br pass1_2 +1: + tst passno + bne 2f + movb (r4),r0 + bic $!37,r0 + beq 5f + cmp r0,$33 + blt 6f + cmp r0,$34 + ble 5f +6: + mov $'m,-(sp) + jsr pc,error +5: + bic $37,(r4) + bis dotrel,(r4) + mov 2(r4),brdelt + sub dot,brdelt + mov dot,2(r4) + br pass1_2 +2: + cmp dot,2(r4) + beq pass1_2 + mov $'p,-(sp) + jsr pc,error + br pass1_2 +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 pass1_2 +4: + jsr pc,readop + jsr pc,expres + mov (sp)+,r1 + cmp r1,$dotrel /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: + mov $'.,-(sp) + jsr pc,error + br ealoop +1: + cmp r3,$40 + bne 1f + mov $'r,-(sp) + jsr pc,error +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 pass1_2 + +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 + +oset: + mov r2,-(sp) + mov r3,-(sp) + mov 6(sp),r3 + mov r1,r2 + bic $!1777,r1 + add r3,r1 + add $8,r1 + mov r1,(r3)+ / next slot + mov r3,r1 + add $2006,r1 + mov r1,(r3)+ / buf max + mov r0,(r3)+ + mov r2,(r3)+ / seek addr + mov (sp)+,r3 + mov (sp)+,r2 + mov (sp)+,(sp) + rts pc + +putw: + mov r1,-(sp) + mov r2,-(sp) + mov 6(sp),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 pc,flush1 + mov (sp)+,r0 + mov r0,*(r2)+ + add $2,-(r2) +2: + mov (sp)+,r2 + mov (sp)+,r1 + mov (sp)+,(sp) +ret: + rts pc + +flush: + mov 2(sp),r2 + mov (sp)+,(sp) + cmp (r2)+,(r2)+ +flush1: + + clr -(sp) / lseek(fout, (r2)L+, L_SET) + mov 2(r2),-(sp) + mov (r2)+,-(sp) + tst (r2)+ + mov fout,-(sp) + jsr pc,_lseek + add $8.,sp + + cmp -(sp),-(sp) / write(fout, , ) + bic $!1777,r1 + add r2,r1 / write address + mov r1,-(sp) / { } + mov r2,r0 + bis $1777,-(r2) + add $1,(r2) / new seek addr + adc -(r2) + cmp -(r2),-(r2) + sub (r2),r1 + neg r1 + mov r1,2(sp) / count + mov r0,(r2) / new next slot + + mov fout,-(sp) + mov r1,6(sp) / protect r1 from library + jsr pc,_write + add $6,sp + mov (sp)+,r1 + tst r0 + bpl ret +/ fall thru to wrterr + +wrterr: + mov $8f-9f,-(sp) / write(1, 9f, 8f-9f) + mov $9f,-(sp) + mov $1,-(sp) + jsr pc,_write + add $6,sp + jsr pc,saexit +/ not reached + + .data +9: + +8: + .even + .text + +readop: + mov savop,r4 + beq 1f + clr savop + rts pc +1: + jsr pc,getw1 + cmp r4,$200 + blo 1f + cmp r4,$4000 + blo 2f + sub $4000,r4 + asl r4 + asl r4 + add hshtab,r4 + rts pc +2: +/ remove PST flag (1000) then multiply by PSTENTSZ. In pass 0 the PST +/ symbol number was divided by PSTENTSZ(to make it fit) - we now reverse +/ that process. + mov r5,-(sp) + mov r4,r5 + sub $1000,r5 + mul $PSTENTSZ,r5 + mov r5,r4 + mov (sp)+,r5 + add $dotrel,r4 / point at dot's flag field +1: + rts pc + +getw: + mov savop,r4 + beq getw1 + clr savop + rts pc +getw1: + dec ibufc + bgt 1f + + mov r1,-(sp) / protect r1 from library + mov $1024.,-(sp) / read(fin, inbuf, 1024) + mov $inbuf,-(sp) + mov fin,-(sp) + jsr pc,_read + add $6,sp + mov (sp)+,r1 + asr r0 + mov r0,ibufc + bgt 2f + mov $4,r4 + sev + rts pc +2: + mov $inbuf,ibufp +1: + mov *ibufp,r4 + add $2,ibufp + rts pc + +opline: + mov r4,r0 + bmi 2f + cmp r0,$177 + bgt 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 + cmp r0,$5 + blt xpr + cmp r0,$36 + bgt 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) + .data +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 + .text + +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: / mul, div etc + inc swapf + mov $1000,rlimit + br opl13 + +opl14: / flop freg,fsrc + inc swapf + +opl5: / flop src,freg + mov $400,rlimit + +opl13: /double + 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 + mov $'x,-(sp) + jsr pc,error +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 + +opl35: / jbr +opl36: / jeq, jne, etc + jsr pc,expres + tst 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 + +opl31: / sob + jsr pc,expres + jsr pc,checkreg + swab r2 + asr r2 + asr r2 + bis r2,(sp) + jsr pc,readop + jsr pc,expres + tst passno + beq 3f + sub dot,r2 + neg r2 + mov r2,r0 + cmp r0,$-2 + blt 2f + cmp r0,$175 + bgt 2f + add $4,r2 + br 1f + +opl6: /branch + jsr pc,expres + tst passno + beq 3f +dobranch: + sub dot,r2 + mov r2,r0 + cmp r0,$-254. + blt 2f + cmp r0,$256. + bgt 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: + mov $'b,-(sp) + jsr pc,error + clr r2 + br 3b + +opl7: /jsr + jsr pc,expres + jsr pc,checkreg + jmp op2a + +opl10: / rts + jsr pc,expres + jsr pc,checkreg + br 1f + +opl11: / sys + jsr pc,expres + cmp r2,$256. + bhis 0f + cmp r3,$1 + ble 1f +0: + mov $'a,-(sp) + jsr pc,error +1: + bis (sp)+,r2 + jsr pc,outw + rts pc + +opl16: / .byte + jsr pc,expres + jsr pc,outb + cmp r4,$', + bne 1f + jsr pc,readop + br opl16 +1: + tst (sp)+ + rts pc + +opl17: / < (.ascii) + 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 + +opl20: /.even + 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 + +opl23: /.globl + 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 + +opl25: / .text, .data, .bss +opl26: +opl27: + inc dot + bic $1,dot + mov r0,-(sp) + mov dot-2,r1 + asl r1 + mov dot,savdot-4(r1) + tst passno + beq 1f + mov $txtp,-(sp) + jsr pc,flush + mov $relp,-(sp) + jsr pc,flush + mov (sp),r2 + asl r2 + add $txtseek-[4*25],r2 + mov r2,tseekp + mov (r2),r0 + mov 2(r2),r1 + mov $txtp,-(sp) + jsr pc,oset + add $trelseek-txtseek,r2 + mov (r2),r0 + mov 2(r2),r1 + mov r2,rseekp + mov $relp,-(sp) + jsr pc,oset +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 + mov $'*,-(sp) + jsr pc,error +1: + mov $10,(sp) + jsr pc,readop + jmp 4b + +checkreg: + cmp r2,$7 + bhi 1f + cmp r1,$1 + blos 2f + cmp r3,$5 + blo 1f +2: + rts pc +1: + mov $'a,-(sp) + jsr pc,error + clr r2 + clr r3 + rts pc + +checkrp: + cmp r4,$') + beq 1f + mov $'),-(sp) + jsr pc,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: + cmp r0,$-254. + blt 1f + cmp r0,$256. + ble 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 + +expres: + clr xsymbol +expres1: + mov r5,-(sp) + mov $'+,-(sp) + clr r2 + mov $1,r3 + br 1f +advanc: + jsr pc,readop +1: + mov r4,r0 + blt 6f + cmp r0,$177 + ble 7f +6: + movb (r4),r0 + bne 1f + tst passno + beq 1f + mov $'u,-(sp) + jsr pc,error +1: + tst overlaid + beq 0f +/ +/ Bill Shannon's hack to the assembler to force globl text +/ references to remain undefined so that the link editor may +/ resolve them. This is necessary if a function is used as an +/ arg in an overlay located piece of code, and the function is +/ actually in another overlay. Elsewise, the assembler fix's up +/ the reference before the link editor changes the globl refrence +/ to the thunk. -wfj 5/80 + cmp r0,$42 / is it globl text ? + bne 0f / nope + mov $40,r0 / yes, treat it as undefined external +0: + 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) + .data +esw1: + '+; binop + '-; binop + '*; binop + '/; binop + '&; binop + 037; binop + 035; binop + 036; binop + '%; binop + '[; brack + '^; binop + 1; exnum + 2; exnum1 + '!; binop + 200; 0 + .text +binop: + cmpb (sp),$'+ + beq 1f + mov $'e,-(sp) + jsr pc,error +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 + mov $'],-(sp) + jsr pc,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) + .data +exsw2: + '+; exadd + '-; exsub + '*; exmul + '/; exdiv + 037; exor + '&; exand + 035;exlsh + 036;exrsh + '%; exmod + '^; excmbin + '!; exnot + 200; 0 + .text +excmbin: + mov r0,r3 + br eoprnd + +exrsh: + neg r1 + beq exlsh + inc r1 + clc + ror r2 +exlsh: + mov $relte2,r5 + jsr pc,combin + ash r1,r2 + br eoprnd + +exmod: + mov $relte2,r5 + jsr pc,combin + mov r3,r0 + mov r2,r3 + clr r2 + div r1,r2 + mov r3,r2 + mov r0,r3 + br eoprnd + +exadd: + mov $reltp2,r5 + jsr pc,combin + add r1,r2 + br eoprnd + +exsub: + mov $reltm2,r5 + jsr pc,combin + sub r1,r2 + br eoprnd + +exand: + mov $relte2,r5 + jsr pc,combin + com r1 + bic r1,r2 + br eoprnd + +exor: + mov $relte2,r5 + jsr pc,combin + bis r1,r2 + br eoprnd + +exmul: + mov $relte2,r5 + jsr pc,combin + mul r2,r1 + mov r1,r2 + br eoprnd + +exdiv: + mov $relte2,r5 + jsr pc,combin + mov r3,r0 + mov r2,r3 + clr r2 + div r1,r2 + mov r0,r3 + br eoprnd + +exnot: + mov $relte2,r5 + jsr pc,combin + com r1 + add r1,r2 + br eoprnd + +eoprnd: + mov $'+,(sp) + jmp advanc + +combin: + tst 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: + clr r3 +2: + bis (sp)+,r3 + rts pc +combin1: + mov r1,-(sp) + clr maxtyp + jsr pc,maprel + mov r0,r1 + mul $6,r1 + mov r3,r0 + jsr pc,maprel + add r5,r0 + add r1,r0 + movb (r0),r3 + bpl 1f + cmp r3,$-1 + beq 2f + mov $'r,-(sp) + jsr pc,error +2: + mov maxtyp,r3 +1: + mov (sp)+,r1 + rts pc + +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 + .data +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 + +qnl: +a.out: + .even +a.outp: a.out + +obufp: outbuf +passno: -1 +outmod: 0777 + +tseekp: txtseek +rseekp: trelseek + +txtmagic: + br .+20 +txtsiz: .=.+2 +datsiz: .=.+2 +bsssiz: .=.+2 +symsiz: .=.+2 + .=.+6 + +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 +datbase:.=.+2 +bssbase:.=.+2 +ibufc: .=.+2 +overlaid: .=.+2 +adrbuf: .=.+12. +xsymbol:.=.+2 +errflg: .=.+2 +argb: .=.+22. +numval: .=.+2 +maxtyp: .=.+2 +ibufp: .=.+2 +txtp: .=.+8. + .=.+1024. +relp: .=.+8. +outbuf: + .=.+1024. +swapf: .=.+2 +rlimit: .=.+2 +endtable:.=.+2 +totalsz: / string table length + .=.+4 + .text diff --git a/bin/awk/EXPLAIN b/bin/awk/EXPLAIN new file mode 100644 index 0000000..69ab718 --- /dev/null +++ b/bin/awk/EXPLAIN @@ -0,0 +1,87 @@ +Nov 30, 1979: + +Awk has been modified yet again, in an attempt to make +its behavior more rational and predictable in the areas +of initialization, comparison, and type coercion. +Herewith what we believe the current truth to be: + +1. Each variable and field can potentially be a string +or a number or both at any time. +When a variable is set by the assignment + v = expr +its type is set to that of expr. (This includes +=, ++, etc.) +An arithmetic expression is of type number, a +concatenation is of type string, and so on. + +If the assignment is a simple copy, as in + v1 = v2 +then the type of v1 becomes that of v2. + +2. In comparisons, if both operands are numeric, +the comparison is made numerically. Otherwise, +operands are coerced to string if necessary, and +the comparison is made on strings. + +3. The type of any expression can be coerced to +numeric by subterfuges (kludges?) such as + expr + 0 +and to string by + expr "" +(i.e., concatenation with a null string). + +4. Uninitialized variables have the numeric value +0 and the string value "". Accordingly, if x is +uninitialized, + if (x) ... +is false, and + if (!x) ... + if (x == 0) ... + if (x == "") ... +are all true. But note that + if (x == "0") ... +is false. + +5. The type of a field is determined by context +when possible; for example, + $1++ +clearly implies that $1 is to be numeric, and + $1 = $1 "," $2 +implies that $1 and $2 are both to be strings. +Coercion will be done as needed. + +In contexts where types cannot be reliably determined, e.g., + if ($1 == $2) ... +the type of each field is determined on input by +inspection. All fields are strings; in addition, +each field that contains only a number (in the +sense of Fortran, say) is also considered numeric. +This ensures (for better or worse) that the test + if ($1 == $2) ... +will succeed on the inputs + 0 0.0 + 100 1e2 + +100 100 + 1e-3 1e-3 +and fail on the inputs + (null) 0 + (null) 0.0 + 2E-518 6E-427 +as we believe it should. + +Fields which are explicitly null have the string +value ""; they are not numeric. +Non-existent fields (i.e., fields past NF) are +treated this way too. + +As it is for fields, so it is for array elements +created by split(...). + +6. 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, the AWK Development +Task Force assumes no responsibility for their use by the +recipient. Further, the Task Force assumes no obligation +to furnish any assistance of any kind whatsoever, or to +furnish any additional information or documentation. diff --git a/bin/awk/Makefile b/bin/awk/Makefile new file mode 100644 index 0000000..6bc5d01 --- /dev/null +++ b/bin/awk/Makefile @@ -0,0 +1,55 @@ +# Makefile 4.3 86/05/15 +# +CFLAGS=-O +YFLAGS=-d +SEPFLAG=-i +FILES=awk.lx.o b.o main.o token.o tran.o lib.o run.o parse.o proctab.o freeze.o +SOURCE=awk.def awk.g.y awk.lx.l b.c lib.c main.c parse.c \ + proc.c freeze.c\ + run.c token.c tran.c + +awk: $(FILES) awk.g.o + cc $(CFLAGS) $(SEPFLAG) 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 + ex - proctab.c + +proc: awk.h proc.o token.o + cc -o proc proc.o token.o + +clean: + -rm -f *.o t.* *temp* *.out *junk* y.tab.* awk.h proc proctab.c awk yacc* + +diffs: + -for i in $(SOURCE); do echo $$i:; diff $$i /usr/src/cmd/awk | ind; done diff --git a/bin/awk/README b/bin/awk/README new file mode 100644 index 0000000..30723b8 --- /dev/null +++ b/bin/awk/README @@ -0,0 +1,99 @@ +CHANGES as of July 12: + +1. \ddd allowed in regular expressions. + +2. exit causes the expression to +to be the status return upon completion. + +3. a new builtin called "getline" causes the next +input line to be read immediately. Fields, NR, etc., +are all set, but you are left at exactly the same place +in the awk program. Getline returns 0 for end of file; +1 for a normal record. + + +CHANGES SINCE MEMO: +Update to TM of Sept 1, 1978: + +1. A new form of for loop + for (i in array) + statement +is now available. It provides a way to walk +along the members of an array, most usefully +for associative arrays with non-numeric subscripts. +Elements are accessed in an unpredictable order, +so don't count on anything. +Futhermore, havoc ensues if elements are created +during this operation, or if the index variable +is fiddled. + +2. index(s1, s2) returns the position in s1 +where s2 first occurs, or 0 if it doesn't. + +3. Multi-line records are now supported more +conveniently. If the record separator is null + RS = "" +then a blank line terminates a record, and newline +is a default field separator, along with +blank and tab. + +4. The syntax of split has been changed. + n = split(str, arrayname, sep) +splits the string str into the array using +the separator sep (a single character). +If no sep field is given, FS is used instead. +The elements are array[1] ... array[n]; n +is the function value. + +5. some minor bugs have been fixed. + +IMPLEMENTATION NOTES: + +Things to watch out for when trying to make awk: + +1. The yacc -d business creates a new file y.tab.h +with the yacc #defines in it. this is compared to +awk.h on each successive compile, and major recompilation +is done only if the files differ. (This permits editing +the grammar file without causing everything in sight +to be recompiled, so long as the definitions don't +change.) + +2. The program proc.c is compiled into proc, which +is used to create proctab.c. proctab.c is the +table of function pointers used by run to actually +execute things. Don't try to load proc.c with the +other .c files; it also contains a "main()". + +3. Awk uses structure assignment. Be sure your +version of the C compiler has it. + +4. The loader flag -lm is used to fetch the standard +math library on the Research system. It is more likely +that you will want to use -lS on yours. +run.c also includes "math.h", which contains sensible +definitions for log(), sqrt(), etc. If you don't have this +include file, comment the line out, and all will be well +anyway. + +5. The basic sequence of events (in case make doesn't +seem to do the job) is + yacc -d awk.g.y + cc -O -c y.tab.c + mv y.tab.o awk.g.o + lex awk.lx.l + cc -O -c lex.yy.c + mv lex.yy.o awk.lx.o + cc -O -c b.c + cc -O -c main.c + e - proctab.c + cc -O -c proctab.c + cc -i -O awk.g.o awk.lx.o b.o main.o token.o tran.o lib.o run.o parse.o proctab.o -lm diff --git a/bin/awk/awk.def b/bin/awk/awk.def new file mode 100644 index 0000000..215a0b7 --- /dev/null +++ b/bin/awk/awk.def @@ -0,0 +1,135 @@ +/* awk.def 4.3 83/12/09 */ + +#define hack int +#define AWKFLOAT float +#define xfree(a) { if(a!=NULL) { yfree(a); a=NULL;} } +#define strfree(a) { if(a!=NULL && a!=EMPTY) { yfree(a);} a=EMPTY; } +#define yfree free +#define isnull(x) ((x) == EMPTY || (x) == NULL) + +#ifdef DEBUG +# define dprintf if(dbg)printf +#else +# define dprintf(x1, x2, x3, x4) +#endif +typedef AWKFLOAT 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 char EMPTY[]; +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==EMPTY) +#define isrec(n) (donefld && n.osub==CFLD && n.otype==OCELL && n.optr->nval!=EMPTY) +obj nullproc(); +obj relop(); + +#define MAXSYM 50 +#define HAT 0177 /* matches ^ in regular expr */ + /* watch out for mach dep */ diff --git a/bin/awk/awk.g.y b/bin/awk/awk.g.y new file mode 100644 index 0000000..fb5382a --- /dev/null +++ b/bin/awk/awk.g.y @@ -0,0 +1,274 @@ +/* awk.g.y 4.1 82/05/07 */ + +%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 +%left GETLINE +%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 = (node *)stat3(PROGRAM, $1, $2, $3); } + | error { yyclearin; yyerror("bailing out"); } + ; + +begin: + XBEGIN '{' stat_list '}' { PUTS("XBEGIN list"); $$ = $3; } + | begin NL + | { PUTS("empty XBEGIN"); $$ = (hack)nullstat; } + ; + +end: + XEND '{' stat_list '}' { PUTS("XEND list"); $$ = $3; } + | end NL + | { PUTS("empty END"); $$ = (hack)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("$zero&null", symtab, 0), 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 + | GETLINE { PUTS("getline"); $$ = op1(GETLINE, 0); } + | FNCN { PUTS("func"); + $$ = op2(FNCN, $1, valtonode(lookup("$record", symtab, 0), CFLD)); + } + | FNCN '(' ')' { PUTS("func()"); + $$ = op2(FNCN, $1, valtonode(lookup("$record", symtab, 0), 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"); $$ = (hack)nullstat; } + | pa_stats pa_stat {PUTS("pa_stats pa_stat"); $$ = linkum($1, $2); } + ; + +pattern: + regular_expr { PUTS("regex"); + $$ = op2(MATCH, valtonode(lookup("$record", symtab, 0), 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, 0), 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"); $$ = (hack)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"); $$ = stat1(NEXT, 0); } + | EXIT st { PUTS("exit"); $$ = stat1(EXIT, 0); } + | EXIT expr st { PUTS("exit"); $$ = stat1(EXIT, $2); } + | BREAK st { PUTS("break"); $$ = stat1(BREAK, 0); } + | CONTINUE st { PUTS("continue"); $$ = stat1(CONTINUE, 0); } + | '{' stat_list '}' { PUTS("{statlist}"); $$ = $2; } + ; + +stat_list: + stat_list statement { PUTS("stat_list stat"); $$ = linkum($1, $2); } + | { PUTS("null stat list"); $$ = (hack)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/bin/awk/awk.lx.l b/bin/awk/awk.lx.l new file mode 100644 index 0000000..b0f48d1 --- /dev/null +++ b/bin/awk/awk.lx.l @@ -0,0 +1,211 @@ +/* awk.lx.l 4.3 84/12/08 */ + +%Start A str chc sc reg comment + +%{ +#include "awk.h" +#include "awk.def" +#undef input /* defeat lex */ +extern int yylval; +extern int mustfld; +extern int ldbg; + +int lineno = 1; +#define RETURN(x) {if (ldbg) ptoken(x); return(x); } +#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('}'); + } + +^\n lineno++; +^{WS}*#.*\n lineno++; /* strip comment lines */ +{WS} ; +"\\"\n lineno++; +"||" RETURN(BOR); +BEGIN RETURN(XBEGIN); +END RETURN(XEND); +PROGEND RETURN(EOF); +"&&" RETURN(AND); +"!" RETURN(NOT); +"!=" { yylval = NE; RETURN(RELOP); } +"~" { yylval = MATCH; RETURN(MATCHOP); } +"!~" { yylval = NOTMATCH; RETURN(MATCHOP); } +"<" { yylval = LT; RETURN(RELOP); } +"<=" { yylval = LE; RETURN(RELOP); } +"==" { yylval = EQ; RETURN(RELOP); } +">=" { yylval = GE; RETURN(RELOP); } +">" { yylval = GT; RETURN(RELOP); } +">>" { yylval = APPEND; RETURN(RELOP); } +"++" { yylval = INCR; RETURN(INCR); } +"--" { yylval = DECR; RETURN(DECR); } +"+=" { yylval = ADDEQ; RETURN(ASGNOP); } +"-=" { yylval = SUBEQ; RETURN(ASGNOP); } +"*=" { yylval = MULTEQ; RETURN(ASGNOP); } +"/=" { yylval = DIVEQ; RETURN(ASGNOP); } +"%=" { yylval = MODEQ; RETURN(ASGNOP); } +"=" { yylval = ASSIGN; RETURN(ASGNOP); } + +"$"{D}+ { if (atoi(yytext+1)==0) { + yylval = (hack)lookup("$record", symtab, 0); + RETURN(STRING); + } else { + yylval = fieldadr(atoi(yytext+1)); + RETURN(FIELD); + } + } +"$"{WS}* { RETURN(INDIRECT); } +NF { mustfld=1; yylval = (hack)setsymtab(yytext, EMPTY, 0.0, NUM, symtab); RETURN(VAR); } +({D}+("."?){D}*|"."{D}+)((e|E)("+"|-)?{D}+)? { + yylval = (hack)setsymtab(yytext, EMPTY, atof(yytext), CON|NUM, symtab); RETURN(NUMBER); } +"}"{WS}*\n { BEGIN sc; lineno++; RETURN(';'); } +"}" { BEGIN sc; RETURN(';'); } +;\n { lineno++; RETURN(';'); } +\n { lineno++; RETURN(NL); } +while RETURN(WHILE); +for RETURN(FOR); +if RETURN(IF); +else RETURN(ELSE); +next RETURN(NEXT); +exit RETURN(EXIT); +break RETURN(BREAK); +continue RETURN(CONTINUE); +print { yylval = PRINT; RETURN(PRINT); } +printf { yylval = PRINTF; RETURN(PRINTF); } +sprintf { yylval = SPRINTF; RETURN(SPRINTF); } +split { yylval = SPLIT; RETURN(SPLIT); } +substr RETURN(SUBSTR); +index RETURN(INDEX); +in RETURN(IN); +getline RETURN(GETLINE); +length { yylval = FLENGTH; RETURN(FNCN); } +log { yylval = FLOG; RETURN(FNCN); } +int { yylval = FINT; RETURN(FNCN); } +exp { yylval = FEXP; RETURN(FNCN); } +sqrt { yylval = FSQRT; RETURN(FNCN); } +{A}{B}* { yylval = (hack)setsymtab(yytext, tostring(""), 0.0, STR|NUM, symtab); RETURN(VAR); } +\" { BEGIN str; clen=0; } + +# { BEGIN comment; } +\n { BEGIN A; lineno++; RETURN(NL); } +. ; + +. { yylval = yytext[0]; RETURN(yytext[0]); } + +"[" { BEGIN chc; clen=0; cflag=0; } +"[^" { BEGIN chc; clen=0; cflag=1; } + +"?" RETURN(QUEST); +"+" RETURN(PLUS); +"*" RETURN(STAR); +"|" RETURN(OR); +"." RETURN(DOT); +"(" RETURN('('); +")" RETURN(')'); +"^" RETURN('^'); +"$" RETURN('$'); +\\{D}{D}{D} { sscanf(yytext+1, "%o", &yylval); RETURN(CHAR); } +\\. { if (yytext[1]=='n') yylval = '\n'; + else if (yytext[1] == 't') yylval = '\t'; + else yylval = yytext[1]; + RETURN(CHAR); + } +"/" { BEGIN A; unput('/'); } +\n { yyerror("newline in regular expression"); lineno++; BEGIN A; } +. { yylval = yytext[0]; RETURN(CHAR); } + +\" { char *s; BEGIN A; cbuf[clen]=0; s = tostring(cbuf); + cbuf[clen] = ' '; cbuf[++clen] = 0; + yylval = (hack)setsymtab(cbuf, s, 0.0, CON|STR, symtab); RETURN(STRING); } +\n { yyerror("newline in string"); lineno++; BEGIN A; } +"\\\"" { cbuf[clen++]='"'; } +"\\"n { cbuf[clen++]='\n'; } +"\\"t { cbuf[clen++]='\t'; } +"\\\\" { cbuf[clen++]='\\'; } +. { CADD; } + +"\\""]" { cbuf[clen++]=']'; } +"]" { BEGIN reg; cbuf[clen]=0; yylval = (hack)tostring(cbuf); + if (cflag==0) { RETURN(CCL); } + else { RETURN(NCCL); } } +\n { yyerror("newline in character class"); lineno++; BEGIN A; } +. { 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; +} + +ptoken(n) +{ + extern struct tok { + char *tnm; + int yval; + } tok[]; + extern char yytext[]; + extern int yylval; + + printf("lex:"); + if (n < 128) { + printf(" %c\n",n); + return; + } + if (n <= 256 || n >= LASTTOKEN) { + printf("? %o\n",n); + return; + } + printf(" %s",tok[n-257].tnm); + switch (n) { + + case RELOP: + case MATCHOP: + case ASGNOP: + case STRING: + case FIELD: + case VAR: + case NUMBER: + case FNCN: + printf(" (%s)", yytext); + break; + + case CHAR: + printf(" (%o)", yylval); + break; + } + putchar('\n'); +} diff --git a/bin/awk/b.c b/bin/awk/b.c new file mode 100644 index 0000000..a7081e5 --- /dev/null +++ b/bin/awk/b.c @@ -0,0 +1,539 @@ +#ifndef lint +static char sccsid[] = "@(#)b.c 4.2 8/11/83"; +#endif + +#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= 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/bin/awk/freeze.c b/bin/awk/freeze.c new file mode 100644 index 0000000..372a989 --- /dev/null +++ b/bin/awk/freeze.c @@ -0,0 +1,36 @@ +#ifndef lint +static char sccsid[] = "@(#)freeze.c 4.2 8/11/83"; +#endif + +#include "stdio.h" +freeze(s) char *s; +{ int fd; + unsigned int *len; + len = (unsigned int *)sbrk(0); + if((fd = creat(s, 0666)) < 0) { + perror(s); + return(1); + } + write(fd, &len, sizeof(len)); + write(fd, (char *)0, len); + close(fd); + return(0); +} + +thaw(s) char *s; +{ int fd; + unsigned int *len; + if(*s == 0) { + fprintf(stderr, "empty restore file\n"); + return(1); + } + if((fd = open(s, 0)) < 0) { + perror(s); + return(1); + } + read(fd, &len, sizeof(len)); + (void) brk(len); + read(fd, (char *)0, len); + close(fd); + return(0); +} diff --git a/bin/awk/lib.c b/bin/awk/lib.c new file mode 100644 index 0000000..c479c99 --- /dev/null +++ b/bin/awk/lib.c @@ -0,0 +1,288 @@ +#ifndef lint +static char sccsid[] = "@(#)lib.c 4.4 9/17/84"; +#endif + +#include "stdio.h" +#include "awk.def" +#include "awk.h" +#include "ctype.h" + +FILE *infile = NULL; +char *file; +#define RECSIZE (5 * 512) +char record[RECSIZE]; +char fields[RECSIZE]; +char EMPTY[] = ""; + +#define MAXFLD 100 +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 {EMPTY, EMPTY, 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 || rr > record) { /* normal record */ + recloc->tval &= ~NUM; + recloc->tval |= STR; + ++nrloc->fval; + nrloc->tval &= ~STR; + nrloc->tval |= NUM; + 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; + i = 0; /* number of fields accumulated here */ + 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)) + strfree(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 if (*r != 0) /* if 0, it's a null field */ + for (;;) { + i++; + if (i >= MAXFLD) + error(FATAL, "record `%.20s...' has too many fields", record); + if (!(fldtab[i].tval&FLD)) + strfree(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; + } + *fr = 0; + for (j=MAXFLD-1; j>i; j--) { /* clean out junk from previous record */ + if (!(fldtab[j].tval&FLD)) + strfree(fldtab[j].sval); + fldtab[j].tval = STR | FLD; + fldtab[j].sval = EMPTY; + } + 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, 0), (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 && *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; + + if (s == NULL) + return (0); + 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)) { + do { + d1++; + s++; + } while (isdigit(*s)); + } + if(d1 >= MAXEXPON) + return(0); /* too many digits to convert */ + if (*s == '.') { + point++; + s++; + } + 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/bin/awk/main.c b/bin/awk/main.c new file mode 100644 index 0000000..e48945d --- /dev/null +++ b/bin/awk/main.c @@ -0,0 +1,100 @@ +#ifndef lint +static char sccsid[] = "@(#)main.c 4.4 (Berkeley) 12/8/84"; +#endif + +#include "stdio.h" +#include "ctype.h" +#include "awk.def" +#include "awk.h" +#define TOLOWER(c) (isupper(c) ? tolower(c) : c) /* ugh!!! */ + +int dbg = 0; +int ldbg = 0; +int svflg = 0; +int rstflg = 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, 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]"); + syminit(); + while (argc > 1) { + argc--; + argv++; + /* this nonsense is because gcos argument handling */ + /* folds -F into -f. accordingly, one checks the next + /* character after f to see if it's -f file or -Fx. + */ + if (argv[0][0] == '-' && TOLOWER(argv[0][1]) == 'f' && argv[0][2] == '\0') { + yyin = fopen(argv[1], "r"); + if (yyin == NULL) + error(FATAL, "can't open %s", argv[1]); + argc--; + argv++; + break; + } else if (argv[0][0] == '-' && TOLOWER(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 (strcmp("-l", argv[0])==0) { + ldbg = 1; + } + else if(strcmp("-S", argv[0]) == 0) { + svflg = 1; + } + else if(strncmp("-R", argv[0], 2) == 0) { + if(thaw(argv[0] + 2) == 0) + rstflg = 1; + else { + fprintf(stderr, "not restored\n"); + exit(1); + } + } + } + if (argc <= 1) { + argv[0][0] = '-'; + argv[0][1] = '\0'; + argc++; + argv--; + } + svargc = --argc; + svargv = ++argv; + dprintf("svargc=%d svargv[0]=%s\n", svargc, svargv[0], NULL); + *FILENAME = *svargv; /* initial file name */ + if(rstflg == 0) + yyparse(); + dprintf("errorflag=%d\n", errorflag, NULL, NULL); + if (errorflag) + exit(errorflag); + if(svflg) { + svflg = 0; + if(freeze("awk.out") != 0) + fprintf(stderr, "not saved\n"); + exit(0); + } + run(); + exit(errorflag); +} + +yywrap() +{ + return(1); +} diff --git a/bin/awk/parse.c b/bin/awk/parse.c new file mode 100644 index 0000000..a58f1f3 --- /dev/null +++ b/bin/awk/parse.c @@ -0,0 +1,150 @@ +#ifndef lint +static char sccsid[] = "@(#)parse.c 4.2 8/11/83"; +#endif + +#include "awk.def" +#include "awk.h" +#include "stdio.h" +node *ALLOC(n) +{ + register node *x; + x = (node *) malloc(sizeof(node) + (n-1)*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) +{ + register node *x; + x=ALLOC(0); + x->nnext = NULL; + x->nobj=a; + return(x); +} +node *node1(a,b) node *b; +{ + register 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; +{ + register 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; +{ + register 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; +{ + register 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; +{ + register node *x; + x = node3(a,b,c,d); + x->ntype = NSTAT; + return(x); +} +node *op2(a,b,c) node *b, *c; +{ + register node *x; + x = node2(a,b,c); + x->ntype = NEXPR; + return(x); +} +node *op1(a,b) node *b; +{ + register node *x; + x = node1(a,b); + x->ntype = NEXPR; + return(x); +} +node *stat1(a,b) node *b; +{ + register node *x; + x = node1(a,b); + x->ntype = NSTAT; + return(x); +} +node *op3(a,b,c,d) node *b, *c, *d; +{ + register node *x; + x = node3(a,b,c,d); + x->ntype = NEXPR; + return(x); +} +node *stat2(a,b,c) node *b, *c; +{ + register node *x; + x = node2(a,b,c); + x->ntype = NSTAT; + return(x); +} +node *stat4(a,b,c,d,e) node *b, *c, *d, *e; +{ + register node *x; + x = node4(a,b,c,d,e); + x->ntype = NSTAT; + return(x); +} +node *valtonode(a, b) cell *a; +{ + register node *x; + x = node0(a); + x->ntype = NVALUE; + x->subtype = b; + return(x); +} +node *pa2stat(a,b,c) node *a, *b, *c; +{ + register node *x; + x = node3(paircnt++, a, b, c); + x->ntype = NPA2; + return(x); +} +node *linkum(a,b) node *a, *b; +{ + register 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() +{ + register node *x; + x = stat2(PRINT,valtonode(lookup("$record", symtab, 0), CFLD), nullstat); + return(x); +} diff --git a/bin/awk/proc.c b/bin/awk/proc.c new file mode 100644 index 0000000..96dfb90 --- /dev/null +++ b/bin/awk/proc.c @@ -0,0 +1,89 @@ +#ifndef lint +static char sccsid[] = "@(#)proc.c 4.3 8/11/83"; +#endif + +#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"}, + { GETLINE, "getline", "getline"}, + { 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;itoken!=0; p++) + names[p->token-FIRSTTOKEN] = p->pname; + for(i=0; innext) { + 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()) { + 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 getline() +{ + obj x; + + x = gettemp(); + setfval(x.optr, (awkfloat) getrec()); + return(x); +} + +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)) { + strfree(x->sval); + x->tval &= ~STR; + x->tval |= ARR; + x->sval = (char *) makesymtab(); + } + y.optr = setsymtab(s, tostring(""), 0.0, STR|NUM, 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; + strfree(a.optr->sval); + a.optr->tval = 0; +} + +obj gettemp() +{ + int i; + obj x; + + for (i=0; i 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); + x = gettemp(); + temp = s[n+m-1]; /* with thanks to John Linderman */ + s[n+m-1] = '\0'; + setsval(x.optr, s + m - 1); + s[n+m-1] = temp; + return(x); +} + +obj sindex(a, nnn) node **a; +{ + obj x; + char *s1, *s2, *p1, *p2, *q; + + x = execute(a[0]); + s1 = getsval(x.optr); + tempfree(x); + x = execute(a[1]); + s2 = getsval(x.optr); + tempfree(x); + + 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[200], *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++ = '%'; + s += 2; + continue; + } + for (t=fmt; (*t++ = *s) != '\0'; s++) + if (*s >= 'a' && *s <= 'z' && *s != 'l') + break; + *t = '\0'; + if (t >= fmt + sizeof(fmt)) + 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 'c': + flag = 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: + i += j; + break; + case MINUS: + i -= j; + break; + case MULT: + i *= j; + break; + case DIVIDE: + if (j == 0) + error(FATAL, "division by zero"); + i /= j; + break; + case MOD: + if (j == 0) + error(FATAL, "division by zero"); + i = i - j*(long)(i/j); + break; + case UMINUS: + i = -i; + break; + } + setfval(z.optr, i); + 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|NUM)) == (STR|NUM)) { + setsval(x.optr, y.optr->sval); + x.optr->fval = y.optr->fval; + x.optr->tval |= NUM; + } + else if (y.optr->tval & STR) + setsval(x.optr, y.optr->sval); + else 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: + xf += yf; + break; + case SUBEQ: + xf -= yf; + break; + case MULTEQ: + xf *= yf; + break; + case DIVEQ: + if (yf == 0) + error(FATAL, "division by zero"); + xf /= yf; + break; + case MODEQ: + if (yf == 0) + error(FATAL, "division by zero"); + xf = xf - yf*(long)(xf/yf); + break; + default: + error(FATAL, "illegal assignment operator %d", n); + break; + } + tempfree(y); + setfval(x.optr, xf); + return(x); +} + +obj cat(a,q) node **a; +{ + obj x,y,z; + int n1, n2; + char *s; + + x = execute(a[0]); + y = execute(a[1]); + getsval(x.optr); + getsval(y.optr); + n1 = strlen(x.optr->sval); + n2 = strlen(y.optr->sval); + s = (char *) malloc(n1 + n2 + 1); + strcpy(s, x.optr->sval); + strcpy(s+n1, 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("%s", 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, num[5]; + register int sep; + int n, flag; + + 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); + } + 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(); + + n = 0; + if (sep == ' ') + for (n = 0; ; ) { + while (*s == ' ' || *s == '\t' || *s == '\n') + s++; + if (*s == 0) + break; + n++; + t = s; + do + s++; + while (*s!=' ' && *s!='\t' && *s!='\n' && *s!='\0'); + temp = *s; + *s = '\0'; + sprintf(num, "%d", n); + if (isnumber(t)) + setsymtab(num, tostring(t), atof(t), STR|NUM, ap->sval); + else + setsymtab(num, tostring(t), 0.0, STR, ap->sval); + *s = temp; + if (*s != 0) + s++; + } + else if (*s != 0) + for (;;) { + n++; + t = s; + while (*s != sep && *s != '\n' && *s != '\0') + s++; + temp = *s; + *s = '\0'; + sprintf(num, "%d", n); + if (isnumber(t)) + setsymtab(num, tostring(t), atof(t), STR|NUM, ap->sval); + else + setsymtab(num, tostring(t), 0.0, STR, ap->sval); + *s = temp; + if (*s++ == 0) + break; + } + 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) { + setsval(vp, cp->nval); + x = execute(a[2]); + if (isbreak(x)) { + x = true; + return(x); + } + if (isnext(x) || isexit(x)) + return(x); + tempfree(x); + } + } + return (true); +} + +obj jump(a,n) node **a; +{ + obj x, y; + + x.otype = OJUMP; + switch (n) { + default: + error(FATAL, "illegal jump type %d", n); + break; + case EXIT: + if (a[0] != 0) { + y = execute(a[0]); + errorflag = getfval(y.optr); + } + 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; isval, files[i].fname) == 0) + goto doit; + for (i=0; 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); + files[i].type = a; +doit: + fprintf(files[i].fp, "%s", s); +#ifndef gcos + fflush(files[i].fp); /* in case someone is waiting for the output */ +#endif + tempfree(x); +} diff --git a/bin/awk/test.a b/bin/awk/test.a new file mode 100644 index 0000000..1dab85f --- /dev/null +++ b/bin/awk/test.a @@ -0,0 +1,700 @@ +! +t.0 307335954 9 3 100664 23 ` +{i = i+1; print i, NR} + +t.1.x 307335954 9 3 100664 32 ` +{i="count" $1 $2; print i , $0} +t.2.x 307335954 9 3 100664 31 ` +{i=2; j=$3; $1=i;print i,j,$1} + +t.3 307335954 9 3 100664 23 ` +$1 == "5" || $1 == "4" + +t.3.x 307335954 9 3 100664 50 ` +{ +x = $1 +while (x > 1) { + print x + x = x / 10 +} +} +t.4 307335954 9 3 100664 21 ` +$1 ~ /5/ || $1 ~ /4/ + +t.4.x 307335954 9 3 100664 18 ` +{i=$(1); print i} +t.5.x 307335954 9 3 100664 28 ` +{$(1) = "xxx"; print $1,$0} +t.6 307335954 9 3 100664 76 ` +/a|b|c/ { + i = $1 + print + while (i >= 1) { + print " ", i + i = i / 10 + } +} +t.6.x 307335955 9 3 100664 14 ` +{print NF,$0} +t.6a 307335955 9 3 100664 64 ` +/a|b|c/ { + print + for (i = $1; i >= 1; ) + print " ", i /= 10 +} +t.6b 307335955 9 3 100664 65 ` +/a|b|c/ { + print + for (i = $1; (i /= 10)>= 1; ) + print " ", i +} + +t.8.x 307335955 9 3 100664 15 ` +{$2=$1; print} + +t.a 307335955 9 3 100666 130 ` + {if (amount[$2] "" == "") item[num++] = $2; + amount[$2] += $1 + } +END {for (i=0; i $1 +t.coerce 307335957 9 3 100664 47 ` +END { print i, NR + if (i < NR) + print i, NR +} + +t.comment 307335957 9 3 100664 112 ` +# this is a comment line +# so is this +/#/ { print "this one has a # in it: " $0 # comment + print "again:" $0 + } +t.comment1 307335957 9 3 100664 88 ` +#comment + # +BEGIN { x = 1 } +/abc/ { print $0 } +#comment +END { print NR } +#comment +t.contin 307335957 9 3 100664 130 ` +{ +for (i = 1; i <= NF; i++) { + if ($i ~ /^[0-9]+$/) + continue; + print $i, " is non-numeric" + next +} +print $0, "is all numeric" +} +t.count 307335957 9 3 100664 17 ` +END { print NR } + +t.cum 307335957 9 3 100664 38 ` +{i = i + $1; print i} +END { +print i +} +t.d.x 307335958 9 3 100664 43 ` +BEGIN {FS=":" ; OFS=":"} +{print NF " ",$0} + +t.e 307335958 9 3 100664 23 ` +$1 < 10 || $2 ~ /bwk/ + +t.else 307335958 9 3 100664 46 ` +{ if($1>1000) print "yes" + else print "no" +} +t.exit 307335958 9 3 100664 32 ` +{ print } +$1 < 5000 { exit NR } +t.f 307335958 9 3 100664 15 ` +{print $2, $1} + +t.f.x 307335958 9 3 100664 26 ` +$1>0 {print $1, sqrt($1)} +t.f0 307335959 9 3 100664 20 ` +$1 ~ /x/ {print $0} +t.f1 307335959 9 3 100664 16 ` +{$1 = 1; print} +t.f2 307335959 9 3 100664 19 ` +{$1 = 1; print $0} + +t.f3 307335959 9 3 100664 17 ` +{$1 = NR; print} + +t.f4 307335959 9 3 100664 20 ` +{$1 = NR; print $0} +t.for 307335959 9 3 100664 39 ` +{ for (i=1; i<=NF; i++) + print i, $i +} + +t.for1 307335959 9 3 100664 68 ` +{ + i = 1 + for (;;) { + if (i > NF) + next + print i, $i + i++ + } +} +t.for2 307335960 9 3 100664 61 ` +{ + for (i=1;;i++) { + if (i > NF) + next + print i, $i + } +} + +t.format4 307335985 9 3 100664 127 ` +BEGIN { +text=sprintf ("%125s", "x") +print length (text) +print text +xxx=substr (text,1,105) +print length (xxx) +print xxx +exit +} + +t.func 307335960 9 3 100664 73 ` +{ print $1, length($1), log($1), sqrt($1), int(sqrt($1)), exp($1 % 10) } + +t.getline 307335984 9 3 100666 117 ` +{ x = $1 + for (i = 1; i <= 3; i++) + if (getline) + x = x " " $1 + print x + x = "" +} +END { + if (x != "") print x +} + +t.i.x 307335960 9 3 100664 52 ` +{i=i+log($1); print i,log($1)} +END {print exp(i),i} +t.if 307335960 9 3 100664 21 ` +{if($1 || $2) print} + +t.in 307335960 9 3 100664 98 ` +BEGIN { + x["apple"] = 1; + x["orange"] = 2; + x["lemon"] = 3; + for (i in x) + print i, x[i] + exit +} +t.in1 307335960 9 3 100664 126 ` + { if (amount[$2] == "") + name[++n] = $2 + amount[$2] += $1 + } +END { for (i in name) + print i, name[i], amount[name[i]] + } +t.in2 307335960 9 3 100664 68 ` + { x[substr($2, 1, 1)] += $1 } +END { for (i in x) + print i, x[i] +} +t.in3 307335960 9 3 100664 83 ` + { x[NR] = $0 } +END { + for (i in x) + if (x[i] ~ /shen/) + break + print i, x[i] +} + +t.incr 307335960 9 3 100664 52 ` +{ ++i; --j; k++; l-- } +END { print NR, i, j, k, l } +t.incr2 307335960 9 3 100664 56 ` +{ s = 0 + for (i=1; i <= NF; ) + s += $(i++) + print s +} +t.incr3 307335960 9 3 100664 58 ` +{ s = 0 + for (i=1; i <= NF; s += $(i++)) + ; + print s +} +t.index 307335960 9 3 100664 144 ` +{ n = length + d = 0 + for (i = 1; i <= n; i++) + if ((k = index($0, substr($0, i))) != i) + d = 1 + if (d) + print $0, "has duplicate letters" +} +t.j.x 307335961 9 3 100664 55 ` +{i=i+sqrt($1); print i,sqrt($1)} +END {print sqrt(i),i} + +t.longstr 307335984 9 3 100666 137 ` +BEGIN{ +x = "111111111122222222233333333334444444444555555555566666666667777777777888888888899999999990000000000" +printf "%s\n", x +exit +} + +t.makef 307335961 9 3 100664 30 ` +{$3 = 2*$1; print $1, $2, $3} +t.match 307335961 9 3 100664 15 ` +$2 ~ /ava|bwk/ + +t.max 307335961 9 3 100664 58 ` +length > max { max = length; x = $0} +END { print max, x } +t.mod 307335961 9 3 100664 12 ` +NR % 2 == 1 +t.monotone 307335961 9 3 100664 112 ` +/^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?$|^z?y?x?w?v?u?t?s?r?q?p?o?n?m?l?k?j?i?h?g?f?e?d?c?b?a?$/ +t.nameval 307335961 9 3 100664 132 ` + { if (amount[$2] == "") + name[++n] = $2 + amount[$2] += $1 + } +END { for (i = 1; i <= n; i++) + print name[i], amount[name[i]] + } +t.next 307335961 9 3 100664 29 ` +$1 > 5000 { next } +{ print } + +t.not 307335961 9 3 100664 55 ` +$2 !~ /ava|bwk/ +!($1 < 2000) +!($2 ~ /bwk/) +!$2 ~ /bwk/ + +t.ofmt 307335961 9 3 100664 34 ` +BEGIN {OFMT="%.5g"} + {print $1+0} +t.ofs 307335961 9 3 100664 67 ` +BEGIN { OFS = " %% "; ORS = "##" } + { print $1, $2; print "#x\n" } + +t.pipe 307335962 9 3 100664 54 ` +BEGIN {print "read /usr/bwk/awk/t.pipe" | "mail bwk"} +t.pp 307335962 9 3 100664 8 ` +/a/,/b/ +t.pp1 307335962 9 3 100664 87 ` +/bwk/,/bwk/ { print $2, $1 } +/ava/,/ava/ { print $2, $1 } +/pjw/,/pjw/ { print $2, $1 } + +t.pp2 307335962 9 3 100664 99 ` +/bwk/,/scj/ { print "1: ", $0 } +/bwk/, /bsb/ { print "2: ", $0 } +/mel/, /doug/ { print "3: ", $0 } + +t.printf 307335962 9 3 100664 82 ` +{ + printf "%%: %s ... %s \t", $2, $1 +x = sprintf "%8d %10.10s", $1, $2 + print x +} +t.quote 307335962 9 3 100664 21 ` +{print "\"" $1 "\""} + +t.re1 307335962 9 3 100664 98 ` +/[a-cg-j1-3]/ { print $0 " matches /[a-cg-j1-3]/" } +/[^aeiou]/ { print $0 " matches /[^aeiou]/" } +t.rec 307335962 9 3 100664 19 ` +{ print sqrt($1) } + +t.redir 307335962 9 3 100664 55 ` +$1%2==1 {print >"oddtemp"} +$1%2==0 {print >"eventemp"} + +t.roff 307335962 9 3 100664 251 ` +NF > 0 { + for (i = 1; i <= NF; i++) { + n = length($i) + if (n + olen >= 60) { + print oline + olen = n + oline = $i + } else { + oline = oline " " $i + olen += n + } + } +} + +NF == 0 { + print oline + olen = 0 +} + +END { + if (olen > 0) + print oline +} + +t.sep 307335962 9 3 100664 90 ` +BEGIN { FS = "1"; print "field separator is", FS } +NF>1 { print $0 " has " NF " fields" } +t.seqno 307335962 9 3 100664 15 ` +{print NR, $0} + +t.split 307335962 9 3 100664 64 ` +BEGIN { z = "stuff" } +{ split ($0, x); print x[3], x[2], x[1] } +t.split2 307335962 9 3 100664 36 ` +{ split ($0, x); print x[2], x[1] } +t.split9 307334948 9 3 100666 145 ` +{ + n = split ($0, x, FS) + if (n != NF) + print "botch at ", NR, n, NF + for (i=1; i<=n; i++) + if ($i != x[i]) + print "diff at ", i, x[i], $i +} + +t.split9a 307336346 9 3 100666 164 ` +BEGIN { FS = "a" } +{ + n = split ($0, x, FS) + if (n != NF) + print "botch at ", NR, n, NF + for (i=1; i<=n; i++) + if ($i != x[i]) + print "diff at ", i, x[i], $i +} +t.stately 307335962 9 3 100664 159 ` +/^(al|ak|az|ar|ca|co|ct|de|fl|ga|hi|io|il|in|ia|ks|ky|la|me|md|ma|mi|mn|ms|mo|mt|nb|nv|nh|nj|nm|ny|nc|nd|oh|ok|or|pa|ri|sc|sd|tn|tx|ut|vt|va|wa|wv|wi|-|wy)*$/ + +t.strcmp 307335963 9 3 100664 42 ` +$2 >= "ava" && $2 <= "bwk" || $2 >= "pjw" +t.strcmp1 307335963 9 3 100664 52 ` +$1 != 1 && $1 != 2 && $1 != 3 && $1 != 4 && $1 != 5 +t.substr 307335963 9 3 100664 61 ` +substr($2, 1, 1) ~ /[abc]/ +substr($2, length($2)) !~ /[a-z]/ + +t.time 307335963 9 3 100664 96 ` +BEGIN { + FS = "-" +} + +/ing$/ { + n++ + s += length($NF) + print +} + +END { + print n, s, s/n >"glop" +} +t.vf 307335983 9 3 100664 44 ` +BEGIN { i = 1 } +{print $(i+i)} +{print $(1)} +t.vf1 307335983 9 3 100664 66 ` +{ print + i = 1 + while (i <= NF) { + print " " $i + i = i + 1 + } +} +t.vf3 307335984 9 3 100664 36 ` +BEGIN { i=1; j=2 } +{$i = $j; print} +t.x 307335984 9 3 100664 4 ` +/x/ +Compare 308460881 9 1 100777 165 ` +for i +do + echo $i: + awk -f $i foo >junk1 + a.out -f $i foo >junk2 + if cmp -s junk1 junk2 + then echo $i: good + else echo $i: BAD + fi + diff -b junk1 junk2 | ind +done + +testall 307336168 9 3 100777 27 ` +Compare t.* >test.out 2>&1 + +t.null0 312829527 9 1 100666 397 ` +BEGIN { FS = ":" } +{ if (a) print "a", a + if (b == 0) print "b", b + if ( c == "0") print "c", c + if (d == "") print "d", d + if (e == 1-1) print "e", e +} +$1 == 0 {print "$1 = 0"} +$1 == "0" {print "$1 = quoted 0"} +$1 == "" {print "$1 = null string"} +$5 == 0 {print "$5 = 0"} +$5 == "0" {print "$5 = quoted 0"} +$5 == "" {print "$5 = null string"} +$1 == $3 {print "$1 = $3"} +$5 == $6 {print "$5 = $6"} + +test.data 323961880 9 3 100666 1429 ` +/dev/rrp3: +17379 mel +16693 bwk +16116 ken +15713 srb +11895 lem +10409 scj +10252 rhm + 9853 shen + 9748 a68 + 9492 sif + 9190 pjw + 8912 nls + 8895 dmr + 8491 cda + 8372 bs + 8252 llc + 7450 mb + 7360 ava + 7273 jrv + 7080 bin + 7063 greg + 6567 dict + 6462 lck + 6291 rje + 6211 lwf + 5671 dave + 5373 jhc + 5220 agf + 5167 doug + 5007 valerie + 3963 jca + 3895 bbs + 3796 moh + 3481 xchar + 3200 tbl + 2845 s + 2774 tgs + 2641 met + 2566 jck + 2511 port + 2479 sue + 2127 root + 1989 bsb + 1989 jeg + 1933 eag + 1801 pdj + 1590 tpc + 1385 cvw + 1370 rwm + 1316 avg + 1205 eg + 1194 jam + 1153 dl + 1150 lgm + 1031 cmb + 1018 jwr + 950 gdb + 931 marc + 898 usg + 865 ggr + 822 daemon + 803 mihalis + 700 honey + 624 tad + 559 acs + 541 uucp + 523 raf + 495 adh + 456 kec + 414 craig + 386 donmac + 375 jj + 348 ravi + 344 drw + 327 stars + 288 mrg + 272 jcb + 263 ralph + 253 tom + 251 sjb + 248 haight + 224 sharon + 222 chuck + 213 dsj + 201 bill + 184 god + 176 sys + 166 meh + 163 jon + 144 dan + 143 fox + 123 dale + 116 kab + 95 buz + 80 asc + 79 jas + 79 trt + 64 wsb + 62 dwh + 56 ktf + 54 lr + 47 dlc + 45 dls + 45 jwf + 44 mash + 43 ars + 43 vgl + 37 jfo + 32 rab + 31 pd + 29 jns + 25 spm + 22 rob + 15 egb + 10 hm + 10 mhb + 6 aed + 6 cpb + 5 evp + 4 ber + 4 men + 4 mitch + 3 ast + 3 jfr + 3 lax + 3 nel + 2 blue + 2 jfk + 2 njas + 1 122sec + 1 ddwar + 1 gopi + 1 jk + 1 learn + 1 low + 1 nac + 1 sidor + diff --git a/bin/awk/token.c b/bin/awk/token.c new file mode 100644 index 0000000..566355f --- /dev/null +++ b/bin/awk/token.c @@ -0,0 +1,94 @@ +#ifndef lint +static char sccsid[] = "@(#)token.c 4.3 (Berkeley) 12/8/84"; +#endif + +#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, +"GETLINE", 312, +"RELOP", 313, +"MATCHOP", 314, +"OR", 315, +"STRING", 316, +"DOT", 317, +"CCL", 318, +"NCCL", 319, +"CHAR", 320, +"CAT", 321, +"STAR", 322, +"PLUS", 323, +"QUEST", 324, +"POSTINCR", 325, +"PREINCR", 326, +"POSTDECR", 327, +"PREDECR", 328, +"INCR", 329, +"DECR", 330, +"FIELD", 331, +"INDIRECT", 332, +"LASTTOKEN", 333, +}; + +char *tokname(n) +{ + if (n<=256 || n >= LASTTOKEN) + n = 257; + return(tok[n-257].tnm); +} diff --git a/bin/awk/tokenscript b/bin/awk/tokenscript new file mode 100644 index 0000000..2d8609b --- /dev/null +++ b/bin/awk/tokenscript @@ -0,0 +1,11 @@ +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/bin/awk/tran.c b/bin/awk/tran.c new file mode 100644 index 0000000..5fdd2ae --- /dev/null +++ b/bin/awk/tran.c @@ -0,0 +1,254 @@ +#ifndef lint +static char sccsid[] = "@(#)tran.c 4.4 12/9/83"; +#endif + +#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); + /* this one is used for if(x)... tests: */ + setsymtab("$zero&null", tostring(""), 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, 0), 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", EMPTY, 0.0, STR|FLD, symtab)->sval; + nfloc = setsymtab("NF", EMPTY, 0.0, NUM, symtab); + NF = &nfloc->fval; + nrloc = setsymtab("NR", EMPTY, 0.0, NUM, symtab); + NR = &nrloc->fval; +} + +cell **makesymtab() +{ + int i; + cell **cp; + + cp = (cell **) malloc(MAXSYM * sizeof(cell *)); + if (cp == NULL) + error(FATAL, "out of space in makesymtab"); + for (i = 0; i < MAXSYM; i++) + 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) { + strfree(cp->nval); + strfree(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, 0)) != NULL) { + if (s != EMPTY ) xfree(s); /* careful here */ + 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 unsigned char *s; +{ + register int hashval; + + for (hashval = 0; *s != '\0'; ) + hashval += *s++; + return(hashval % MAXSYM); +} + +cell *lookup(s, tab, flag) /* look for s in tab, flag must match*/ +register char *s; +cell **tab; +{ + register cell *p; + + for (p = tab[hash(s)]; p != NULL; p = p->nextval) + if (strcmp(s, p->nval) == 0 && + (flag == 0 || flag == p->tval)) + 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) && isnull(vp->nval)) + 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) && isnull(vp->nval)) + donerec = 0; + if (!(vp->tval&FLD)) + strfree(vp->sval); + vp->tval &= ~FLD; + return(vp->sval = tostring(s)); +} + +awkfloat getfval(vp) +register cell *vp; +{ + + 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)) + strfree(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; + + if (s==NULL){ + p = malloc(1); + if (p == NULL) + error(FATAL, "out of space in tostring on %s", s); + *p = '\0'; + } else { + 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/bin/cat.c b/bin/cat.c new file mode 100644 index 0000000..a0c4435 --- /dev/null +++ b/bin/cat.c @@ -0,0 +1,222 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#ifndef lint +static char sccsid[] = "@(#)cat.c 5.2 (Berkeley) 12/6/85"; +#endif not lint + +/* + * Concatenate files. + */ + +#include +#include +#include + +/* #define OPTSIZE BUFSIZ /* define this only if not 4.2 BSD or beyond */ + +int bflg, eflg, nflg, sflg, tflg, uflg, vflg; +int spaced, col, lno, inline, ibsize, obsize; + +main(argc, argv) +char **argv; +{ + int fflg = 0; + register FILE *fi; + register c; + int dev, ino = -1; + struct stat statb; + int retval = 0; + + lno = 1; + for( ; argc>1 && argv[1][0]=='-'; argc--,argv++) { + switch(argv[1][1]) { + case 0: + break; + case 'u': + setbuf(stdout, (char *)NULL); + uflg++; + continue; + case 'n': + nflg++; + continue; + case 'b': + bflg++; + nflg++; + continue; + case 'v': + vflg++; + continue; + case 's': + sflg++; + continue; + case 'e': + eflg++; + vflg++; + continue; + case 't': + tflg++; + vflg++; + continue; + } + break; + } + if (fstat(fileno(stdout), &statb) == 0) { + statb.st_mode &= S_IFMT; + if (statb.st_mode!=S_IFCHR && statb.st_mode!=S_IFBLK) { + dev = statb.st_dev; + ino = statb.st_ino; + } +#ifndef OPTSIZE + obsize = statb.st_blksize; +#endif + } + else + obsize = 0; + 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) { + perror(*argv); + retval = 1; + continue; + } + } + if (fstat(fileno(fi), &statb) == 0) { + if ((statb.st_mode & S_IFMT) == S_IFREG && + statb.st_dev==dev && statb.st_ino==ino) { + fprintf(stderr, "cat: input %s is output\n", + fflg?"-": *argv); + fclose(fi); + retval = 1; + continue; + } +#ifndef OPTSIZE + ibsize = statb.st_blksize; +#endif + } + else + ibsize = 0; + if (nflg||sflg||vflg) + copyopt(fi); + else if (uflg) { + while ((c = getc(fi)) != EOF) + putchar(c); + } else + retval |= fastcat(fileno(fi)); /* no flags specified */ + if (fi!=stdin) + fclose(fi); + else + clearerr(fi); /* reset sticky eof */ + if (ferror(stdout)) { + fprintf(stderr, "cat: output write error\n"); + retval = 1; + break; + } + } + exit(retval); +} + +copyopt(f) + register FILE *f; +{ + register int c; + +top: + c = getc(f); + if (c == EOF) + return; + if (c == '\n') { + if (inline == 0) { + if (sflg && spaced) + goto top; + spaced = 1; + } + if (nflg && bflg==0 && inline == 0) + printf("%6d\t", lno++); + if (eflg) + putchar('$'); + putchar('\n'); + inline = 0; + goto top; + } + if (nflg && inline == 0) + printf("%6d\t", lno++); + inline = 1; + if (vflg) { + if (tflg==0 && c == '\t') + putchar(c); + else { + if (c > 0177) { + printf("M-"); + c &= 0177; + } + if (c < ' ') + printf("^%c", c+'@'); + else if (c == 0177) + printf("^?"); + else + putchar(c); + } + } else + putchar(c); + spaced = 0; + goto top; +} + +fastcat(fd) +register int fd; +{ + register int buffsize, n, nwritten, offset; + register char *buff; + struct stat statbuff; + char *malloc(); + +#ifndef OPTSIZE + if (obsize) + buffsize = obsize; /* common case, use output blksize */ + else if (ibsize) + buffsize = ibsize; + else + buffsize = BUFSIZ; +#else + buffsize = OPTSIZE; +#endif + + if ((buff = malloc(buffsize)) == NULL) { + perror("cat: no memory"); + return (1); + } + + /* + * Note that on some systems (V7), very large writes to a pipe + * return less than the requested size of the write. + * In this case, multiple writes are required. + */ + while ((n = read(fd, buff, buffsize)) > 0) { + offset = 0; + do { + nwritten = write(fileno(stdout), &buff[offset], n); + if (nwritten <= 0) { + perror("cat: write error"); + exit(2); + } + offset += nwritten; + } while ((n -= nwritten) > 0); + } + + free(buff); + if (n < 0) { + perror("cat: read error"); + return (1); + } + return (0); +} diff --git a/bin/cc.c b/bin/cc.c new file mode 100644 index 0000000..59aaae2 --- /dev/null +++ b/bin/cc.c @@ -0,0 +1,437 @@ +static char sccsid[] = "@(#)cc.c 4.13 9/18/85"; +/* + * cc - front end for C compiler + */ +#include +#include +#include +#include +#include + +char *cpp = "/lib/cpp"; +char *ccom = "/lib/c0"; +char *ccom1 = "/lib/c1"; +char *c2 = "/lib/c2"; +char *as = "/bin/as"; +char *ld = "/bin/ld"; +char *crt0 = "/lib/crt0.o"; + +char tmp0[30]; /* big enough for /tmp/ctm%05.5d */ +char *tmp1, *tmp2, *tmp3, *tmp4, *tmp5; +char *outfile; +char *savestr(), *strspl(), *setsuf(); +int idexit(); +char **av, **clist, **llist, **plist; +int cflag, eflag, oflag, pflag, sflag, wflag, exflag, proflag; +int Mflag, debug; +int exfail; +char *chpass; +char *npassname; + +int nc, nl, np, nxo, na; + +#define cunlink(s) if (s) unlink(s) + +main(argc, argv) + char **argv; +{ + char *t; + char *assource; + int i, j, c; + + /* ld currently adds upto 5 args; 10 is room to spare */ + av = (char **)calloc(argc+10, sizeof (char **)); + clist = (char **)calloc(argc, sizeof (char **)); + llist = (char **)calloc(argc, sizeof (char **)); + plist = (char **)calloc(argc, sizeof (char **)); + for (i = 1; i < argc; i++) { + if (*argv[i] == '-') switch (argv[i][1]) { + + case 'S': + sflag++; + cflag++; + continue; + case 'o': + if (++i < argc) { + outfile = argv[i]; + switch (getsuf(outfile)) { + + case 'c': + error("-o would overwrite %s", + outfile); + exit(8); + } + } + continue; + case 'O': + oflag++; + continue; + case 'p': + proflag++; + crt0 = "/lib/mcrt0.o"; + if (argv[i][2] == 'g') + crt0 = "/usr/lib/gcrt0.o"; + continue; + case 'w': + wflag++; + continue; + case 'E': + exflag++; + case 'P': + pflag++; + if (argv[i][1]=='P') + fprintf(stderr, + "cc: warning: -P option obsolete; you should use -E instead\n"); + plist[np++] = argv[i]; + case 'c': + cflag++; + continue; + case 'M': + exflag++; + pflag++; + Mflag++; + /* and fall through */ + case 'D': + case 'I': + case 'U': + case 'C': + plist[np++] = argv[i]; + continue; + case 'L': + llist[nl++] = argv[i]; + continue; + case 't': + if (chpass) + error("-t overwrites earlier option", 0); + chpass = argv[i]+2; + if (chpass[0]==0) + chpass = "012p"; + continue; + case 'B': + if (npassname) + error("-B overwrites earlier option", 0); + npassname = argv[i]+2; + if (npassname[0]==0) + npassname = "/usr/c/o"; + continue; + case 'd': + if (argv[i][2] == '\0') { + debug++; + continue; + } + continue; + } + t = argv[i]; + c = getsuf(t); + if (c=='c' || c=='s' || exflag) { + clist[nc++] = t; + t = setsuf(t, 'o'); + } + if (nodup(llist, t)) { + llist[nl++] = t; + if (getsuf(t)=='o') + nxo++; + } + } + if (npassname && chpass ==0) + chpass = "012p"; + if (chpass && npassname==0) + npassname = "/usr/new"; + if (chpass) + for (t=chpass; *t; t++) { + switch (*t) { + + case '0': + ccom = strspl(npassname, "c0"); + continue; + case '1': + ccom1 = strspl(npassname, "c1"); + continue; + case '2': + c2 = strspl(npassname, "c2"); + continue; + case 'p': + cpp = strspl(npassname, "cpp"); + continue; + } + } + if (nc==0) + goto nocom; + if (signal(SIGINT, SIG_IGN) != SIG_IGN) + signal(SIGINT, idexit); + if (signal(SIGTERM, SIG_IGN) != SIG_IGN) + signal(SIGTERM, idexit); + if (signal(SIGHUP, SIG_IGN) != SIG_IGN) + signal(SIGHUP, idexit); + if (pflag==0) + sprintf(tmp0, "/tmp/ctm%05.5d", getpid()); + tmp1 = strspl(tmp0, "1"); + tmp2 = strspl(tmp0, "2"); + tmp3 = strspl(tmp0, "3"); + if (pflag==0) + tmp4 = strspl(tmp0, "4"); + if (oflag) + tmp5 = strspl(tmp0, "5"); + for (i=0; i 1 && !Mflag) { + printf("%s:\n", clist[i]); + fflush(stdout); + } + if (!Mflag && getsuf(clist[i]) == 's') { + assource = clist[i]; + goto assemble; + } else + assource = tmp3; + if (pflag) + tmp4 = setsuf(clist[i], 'i'); + av[0] = "cpp"; av[1] = clist[i]; + na = 2; + if (!exflag) + av[na++] = tmp4; + for (j = 0; j < np; j++) + av[na++] = plist[j]; + av[na++] = 0; + if (callsys(cpp, av)) { + exfail++; + eflag++; + } + if (pflag || exfail) { + cflag++; + continue; + } + if (sflag) { + if (nc==1 && outfile) + tmp3 = outfile; + else + tmp3 = setsuf(clist[i], 's'); + assource = tmp3; + } + av[0] = "c0"; + av[1] = tmp4; av[2] = tmp1; av[3] = tmp2; na = 4; + if (proflag) + av[na++] = "-P"; + if (wflag) + av[na++] = "-w"; + av[na] = 0; + if (callsys(ccom, av)) { + cflag++; + eflag++; + continue; + } + av[0] = "c1"; av[1] = tmp1; av[2] = tmp2; + av[3] = oflag ? tmp5 : tmp3; + av[4] = 0; + if (callsys(ccom1, av)) { + cflag++; + eflag++; + continue; + } + if (oflag) { + av[0] = "c2"; av[1] = tmp5; av[2] = tmp3; av[3] = 0; + if (callsys(c2, av)) { + unlink(tmp3); + tmp3 = assource = tmp5; + } else + unlink(tmp5); + } + if (sflag) + continue; + assemble: + cunlink(tmp1); cunlink(tmp2); cunlink(tmp4); + av[0] = "as"; av[1] = "-V"; + av[2] = "-u"; av[3] = "-o"; + if (cflag && nc==1 && outfile) + av[4] = outfile; + else + av[4] = setsuf(clist[i], 'o'); + av[5] = assource; + av[6] = 0; + if (callsys(as, av) > 1) { + cflag++; + eflag++; + continue; + } + } +nocom: + if (cflag==0 && nl!=0) { + i = 0; + av[0] = "ld"; av[1] = "-X"; av[2] = crt0; na = 3; + if (outfile) { + av[na++] = "-o"; + av[na++] = outfile; + } + while (i < nl) + av[na++] = llist[i++]; + if (proflag) + av[na++] = "-lc_p"; + else + av[na++] = "-lc"; + av[na++] = 0; + eflag |= callsys(ld, av); + if (nc==1 && nxo==1 && eflag==0) + unlink(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); + } + exit(eflag); +} + +error(s, x) + char *s, *x; +{ + FILE *diag = exflag ? stderr : stdout; + + fprintf(diag, "cc: "); + fprintf(diag, s, x); + putc('\n', diag); + exfail++; + 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 <= MAXNAMLEN && c > 2 && *s++ == '.') + return (*s); + return (0); +} + +char * +setsuf(as, ch) + char *as; +{ + register char *s, *s1; + + s = s1 = savestr(as); + while (*s) + if (*s++ == '/') + s1 = s; + s[-1] = ch; + return (s1); +} + +callsys(f, v) + char *f, **v; +{ + int t, status; + char **cpp; + + if (debug) { + fprintf(stderr, "%s:", f); + for (cpp = v; *cpp != 0; cpp++) + fprintf(stderr, " %s", *cpp); + fprintf(stderr, "\n"); + } + t = vfork(); + if (t == -1) { + printf("No more processes\n"); + return (100); + } + if (t == 0) { + execv(f, v); + printf("Can't find %s\n", f); + fflush(stdout); + _exit(100); + } + while (t != wait(&status)) + ; + if ((t=(status&0377)) != 0 && t!=14) { + if (t!=2) { + printf("Fatal error in %s\n", f); + eflag = 8; + } + dexit(); + } + return ((status>>8) & 0377); +} + +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); +} + +#define NSAVETAB 1024 +char *savetab; +int saveleft; + +char * +savestr(cp) + register char *cp; +{ + register int len; + + len = strlen(cp) + 1; + if (len > saveleft) { + saveleft = NSAVETAB; + if (len > saveleft) + saveleft = len; + savetab = (char *)malloc(saveleft); + if (savetab == 0) { + fprintf(stderr, "ran out of memory (savestr)\n"); + exit(1); + } + } + strncpy(savetab, cp, len); + cp = savetab; + savetab += len; + saveleft -= len; + return (cp); +} + +char * +strspl(left, right) + char *left, *right; +{ + char buf[BUFSIZ]; + + strcpy(buf, left); + strcat(buf, right); + return (savestr(buf)); +} diff --git a/bin/chflags/Makefile b/bin/chflags/Makefile new file mode 100644 index 0000000..85234bf --- /dev/null +++ b/bin/chflags/Makefile @@ -0,0 +1,38 @@ +# +# Public Domain. 12/3/1994 - Steven Schultz +# +# @(#)Makefile 1.2 (2.11BSD GTE) 1996/1/27 +# +CFLAGS= -O +SEPFLAG= -i +VPATH= ../ls +SRCS= chflags.c stat_flags.c +OBJS= chflags.o stat_flags.o +MAN= chflags.0 +MANSRC= chflags.1 + +all: chflags chflags.0 + +chflags: ${OBJS} + ${CC} ${CFLAGS} ${SEPFLAG} -o $@ ${OBJS} + +chflags.0: ${MANSRC} + /usr/man/manroff ${MANSRC} > ${MAN} + +clean: + rm -f ${OBJS} ${MAN} chflags tags + +depend: ${SRCS} + mkdep ${CFLAGS} ${SRCS} + +install: chflags + install -c -o bin -g bin -m 444 ${MAN} ${DESTDIR}/usr/man/cat1 + install -s -o root -g bin -m 755 chflags ${DESTDIR}/bin/chflags + +lint: ${SRCS} + lint -hax ${SRCS} + +tags: ${SRCS} + ctags ${SRCS} +# DO NOT DELETE THIS LINE -- mkdep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. diff --git a/bin/chflags/chflags.1 b/bin/chflags/chflags.1 new file mode 100644 index 0000000..df1c582 --- /dev/null +++ b/bin/chflags/chflags.1 @@ -0,0 +1,102 @@ +.\" Copyright (c) 1989, 1990, 1993, 1994 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the Institute of Electrical and Electronics Engineers, Inc. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)chflags.1 8.2.1 (2.11BSD GTE) 11/28/94 +.\" +.TH CHFLAGS 1 "November 28, 1994" +.UC 4 +.SH NAME +chflags \- change file flags +.SH SYNOPSIS +chflags [-R] [-f]\fBflags\fP \fBfile\fP ... +.SH DESCRIPTION +The +.B chflags +utility modifies the file flags of the listed files +as specified by the +.B flags +operand. +.PP +The options are as follows: +.TP 15 +-R +Change the file flags for the file hierarchies rooted +in the files instead of just the files themselves. +.PP +-f +\fBchflags\fP will not complain if it fails to change the flags on a +file. +.PP +Flags are a comma separated list of keywords. +The following keywords are currently defined: +.TP 20 +arch +No effect. This bit is defined and will be set/cleared as requested but +nothing in the system makes use of it yet. +.TP 20 +dump +Set the dump flag +.TP 20 +sappnd +Set the system append-only flag (super-user only) +.TP 20 +schg +Set the system immutable flag (super-user only) +.TP 20 +uappnd +Set the user append-only flag (owner or super-user only) +.TP 20 +uchg +Set the user immutable flag (owner or super-user only) +.PP +Putting the letters +.B no +before an option causes the flag to be turned off. +For example: +.TP 20 +nodump +the file should never be dumped +.PP +Symbolic links do not have flags and are silently ignored by +.B chflags. +When the -R option is given and symbolic links are encountered they are +not traversed. This is the same behaviour as \fBchmod(1)\fP. +.PP +The +.B chflags +utility exits 0 on success, and >0 if an error occurs. +.SH SEE ALSO +chflags(2), +stat(2), +symlink(7) diff --git a/bin/chflags/chflags.c b/bin/chflags/chflags.c new file mode 100644 index 0000000..38dc0b0 --- /dev/null +++ b/bin/chflags/chflags.c @@ -0,0 +1,207 @@ +/* + * Program Name: symcompact.c + * Date: December 3, 1994 + * Author: S.M. Schultz + * + * ----------------- Modification History --------------- + * Version Date Reason For Modification + * 1.0 03Dec94 1. Initial release into the public domain. +*/ + +#include +#include +#include +#include +#include +#include + +static char *fmsg = "Can't fchdir() back to starting directory"; +static int oct, status, fflag, rflag; +static u_short set, clear; +static struct stat st; +static void usage(); + +extern long strtol(); +extern int optind, errno; +extern u_short string_to_flags(); /* from ../ls */ + +main(argc, argv) + int argc; + char *argv[]; + { + register char *p; + char *flags, *ep; + int ch, fcurdir; + long tmp; + + while ((ch = getopt(argc, argv, "Rf")) != EOF) + { + switch (ch) + { + case 'R': + rflag++; + break; + case 'f': + fflag++; + break; + case '?': + default: + usage(); + } + } + argv += optind; + argc += optind; + if (argc < 2) + usage(); + + flags = *argv++; + if (*flags >= '0' && *flags <= '7') + { + tmp = strtol(flags, &ep, 8); + if (tmp < 0 || tmp >= 64L*1024*1024 || *ep) + die("invalid flags: %s", flags); + oct = 1; + set = tmp; + } + else + { + if (string_to_flags(&flags, &set, &clear)) + die("invalid flag: %s", flags); + clear = ~clear; + oct = 0; + } + + if (rflag) + { + fcurdir = open(".", O_RDONLY); + if (fcurdir < 0) + die("Can't open ."); + } + + while (p = *argv++) + { + if (lstat(p, &st) < 0) + { + status |= warning(p); + continue; + } + if (rflag && (st.st_mode&S_IFMT) == S_IFDIR) + { + status |= recurse(p, fcurdir); + continue; + } + if ((st.st_mode&S_IFMT) == S_IFLNK && stat(p, &st) < 0) + { + status |= warning(p); + continue; + } + if (chflags(p, newflags(st.st_flags)) < 0) + { + status |= warning(p); + continue; + } + } + close(fcurdir); + exit(status); + } + +recurse(dir, savedir) + char *dir; + int savedir; + { + register DIR *dirp; + register struct direct *dp; + int ecode; + + if (chdir(dir) < 0) + { + warning(dir); + return(1); + } + if ((dirp = opendir(".")) == NULL) + { + warning(dir); + return(1); + } + dp = readdir(dirp); + dp = readdir(dirp); /* read "." and ".." */ + ecode = 0; + for (dp = readdir(dirp); dp != NULL; dp = readdir(dirp)) + { + if (lstat(dp->d_name, &st) < 0) + { + ecode = warning(dp->d_name); + if (ecode) + break; + continue; + } + if ((st.st_mode&S_IFMT) == S_IFDIR) + { + ecode = recurse(dp->d_name, dirfd(dirp)); + if (ecode) + break; + continue; + } + if ((st.st_mode&S_IFMT) == S_IFLNK) + continue; + if (chflags(dp->d_name, newflags(st.st_flags)) < 0 && + (ecode = warning(dp->d_name))) + break; + } +/* + * Lastly change the flags on the directory we are in before returning to + * the previous level. +*/ + if (fstat(dirfd(dirp), &st) < 0) + die("can't fstat ."); + if (fchflags(dirfd(dirp), newflags(st.st_flags)) < 0) + ecode = warning(dir); + if (fchdir(savedir) < 0) + die(fmsg); + closedir(dirp); + return(ecode); + } + +/* VARARGS1 */ +die(fmt, va_alist) + char *fmt; + va_dcl + { + va_list ap; + + va_start(ap); + vfprintf(stderr, fmt, ap); + fputc('\n', stderr); + va_end(ap); + exit(1); + } + +warning(msg) + char *msg; + { + + if (!fflag) + fprintf(stderr, "chflags: %s: %s\n", msg, strerror(errno)); + return(!fflag); + } + +newflags(flags) + u_short flags; + { + + if (oct) + flags = set; + else + { + flags |= set; + flags &= clear; + } + return(flags); + } + +static void +usage() + { + fputs("usage: chflags [-Rf] flags file ...\n", stderr); + exit(1); + } diff --git a/bin/chgrp.c b/bin/chgrp.c new file mode 100644 index 0000000..2031db7 --- /dev/null +++ b/bin/chgrp.c @@ -0,0 +1,211 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if !defined(lint) && defined(DOSCCS) +static char sccsid[] = "@(#)chgrp.c 5.7.1 (2.11BSD GTE) 11/4/94"; +#endif + +/* + * chgrp -fR gid file ... + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +struct group *gr, *getgrnam(), *getgrgid(); +struct passwd *getpwuid(), *pwd; +struct stat stbuf; +gid_t gid; +uid_t uid; +int status; +int fflag, rflag; +static char *fchdirmsg = "Can't fchdir() back to starting directory"; + +main(argc, argv) + int argc; + char *argv[]; +{ + register c, i; + register char *cp; + int fcurdir; + + argc--, argv++; + while (argc > 0 && argv[0][0] == '-') { + for (cp = &argv[0][1]; *cp; cp++) switch (*cp) { + + case 'f': + fflag++; + break; + + case 'R': + rflag++; + break; + + default: + fatal(255, "unknown option: %c", *cp); + /*NOTREACHED*/ + } + argv++, argc--; + } + if (argc < 2) { + fprintf(stderr, "usage: chgrp [-fR] gid file ...\n"); + exit(255); + } + uid = getuid(); + if (isnumber(argv[0])) { + gid = atoi(argv[0]); + gr = getgrgid(gid); + if (uid && gr == NULL) + fatal(255, "%s: unknown group", argv[0]); + } else { + gr = getgrnam(argv[0]); + if (gr == NULL) + fatal(255, "%s: unknown group", argv[0]); + gid = gr->gr_gid; + } + pwd = getpwuid(uid); + if (pwd == NULL) + fatal(255, "Who are you?"); + if (uid && pwd->pw_gid != gid) { + for (i=0; gr->gr_mem[i]; i++) + if (!(strcmp(pwd->pw_name, gr->gr_mem[i]))) + goto ok; + if (fflag) + exit(0); + fatal(255, "You are not a member of the %s group", argv[0]); + } +ok: + fcurdir = open(".", O_RDONLY); + if (fcurdir < 0) + fatal(255, "Can't open ."); + + for (c = 1; c < argc; c++) { + /* do stat for directory arguments */ + if (lstat(argv[c], &stbuf)) { + status += Perror(argv[c]); + continue; + } + if (uid && uid != stbuf.st_uid) { + status += error("You are not the owner of %s", argv[c]); + continue; + } + if (rflag && ((stbuf.st_mode & S_IFMT) == S_IFDIR)) { + status += chownr(argv[c], stbuf.st_uid, gid, fcurdir); + continue; + } + if (chown(argv[c], -1, gid)) { + status += Perror(argv[c]); + continue; + } + } + exit(status); +} + +isnumber(s) + char *s; +{ + register int c; + + while (c = *s++) + if (!isdigit(c)) + return (0); + return (1); +} + +chownr(dir, uid, gid, savedir) + char *dir; + uid_t uid; + gid_t gid; + int savedir; +{ + register DIR *dirp; + register struct direct *dp; + struct stat st; + int ecode; + + /* + * Change what we are given before doing its contents. + */ + if (chown(dir, -1, gid) < 0 && Perror(dir)) + return (1); + if (chdir(dir) < 0) { + Perror(dir); + return (1); + } + if ((dirp = opendir(".")) == NULL) { + Perror(dir); + return (1); + } + dp = readdir(dirp); + dp = readdir(dirp); /* read "." and ".." */ + ecode = 0; + for (dp = readdir(dirp); dp != NULL; dp = readdir(dirp)) { + if (lstat(dp->d_name, &st) < 0) { + ecode = Perror(dp->d_name); + if (ecode) + break; + continue; + } + if (uid && uid != st.st_uid) { + ecode = error("You are not the owner of %s", + dp->d_name); + continue; + } + if ((st.st_mode & S_IFMT) == S_IFDIR) { + ecode = chownr(dp->d_name, st.st_uid, gid, dirfd(dirp)); + if (ecode) + break; + continue; + } + if (chown(dp->d_name, -1, gid) < 0 && + (ecode = Perror(dp->d_name))) + break; + } + if (fchdir(savedir) < 0) + fatal(255, fchdirmsg); + closedir(dirp); + return (ecode); +} + +error(fmt, a) + char *fmt, *a; +{ + + if (!fflag) { + fprintf(stderr, "chgrp: "); + fprintf(stderr, fmt, a); + putc('\n', stderr); + } + return (!fflag); +} + +/* VARARGS */ +fatal(status, fmt, a) + int status; + char *fmt, *a; +{ + + fflag = 0; + (void) error(fmt, a); + exit(status); +} + +Perror(s) + char *s; +{ + + if (!fflag) { + fprintf(stderr, "chgrp: "); + perror(s); + } + return (!fflag); +} diff --git a/bin/chmod.c b/bin/chmod.c new file mode 100644 index 0000000..e548787 --- /dev/null +++ b/bin/chmod.c @@ -0,0 +1,318 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if !defined(lint) && defined(DOSCCS) +static char sccsid[] = "@(#)chmod.c 5.5.1 (2.11BSD GTE) 11/4/94"; +#endif + +/* + * chmod options mode files + * where + * mode is [ugoa][+-=][rwxXstugo] or an octal number + * options are -Rf + */ +#include +#include +#include +#include +#include + +static char *fchdirmsg = "Can't fchdir() back to starting directory"; +char *modestring, *ms; +int um; +int status; +int fflag; +int rflag; + +main(argc, argv) + char *argv[]; +{ + register char *p, *flags; + register int i; + struct stat st; + int fcurdir; + + if (argc < 3) { + fprintf(stderr, + "Usage: chmod [-Rf] [ugoa][+-=][rwxXstugo] file ...\n"); + exit(-1); + } + argv++, --argc; + while (argc > 0 && argv[0][0] == '-') { + for (p = &argv[0][1]; *p; p++) switch (*p) { + + case 'R': + rflag++; + break; + + case 'f': + fflag++; + break; + + default: + goto done; + } + argc--, argv++; + } +done: + modestring = argv[0]; + um = umask(0); + (void) newmode(0); + if (rflag) + { + fcurdir = open(".", O_RDONLY); + if (fcurdir < 0) + fatal(255, "Can't open ."); + } + + for (i = 1; i < argc; i++) { + p = argv[i]; + /* do stat for directory arguments */ + if (lstat(p, &st) < 0) { + status += Perror(p); + continue; + } + if (rflag && (st.st_mode&S_IFMT) == S_IFDIR) { + status += chmodr(p, newmode(st.st_mode), fcurdir); + continue; + } + if ((st.st_mode&S_IFMT) == S_IFLNK && stat(p, &st) < 0) { + status += Perror(p); + continue; + } + if (chmod(p, newmode(st.st_mode)) < 0) { + status += Perror(p); + continue; + } + } + close(fcurdir); + exit(status); +} + +chmodr(dir, mode, savedir) + char *dir; + int mode; + int savedir; +{ + register DIR *dirp; + register struct direct *dp; + struct stat st; + int ecode; + + /* + * Change what we are given before doing it's contents + */ + if (chmod(dir, newmode(mode)) < 0 && Perror(dir)) + return (1); + if (chdir(dir) < 0) { + Perror(dir); + return (1); + } + if ((dirp = opendir(".")) == NULL) { + Perror(dir); + return (1); + } + dp = readdir(dirp); + dp = readdir(dirp); /* read "." and ".." */ + ecode = 0; + for (dp = readdir(dirp); dp != NULL; dp = readdir(dirp)) { + if (lstat(dp->d_name, &st) < 0) { + ecode = Perror(dp->d_name); + if (ecode) + break; + continue; + } + if ((st.st_mode&S_IFMT) == S_IFDIR) { + ecode = chmodr(dp->d_name, newmode(st.st_mode), dirfd(dirp)); + if (ecode) + break; + continue; + } + if ((st.st_mode&S_IFMT) == S_IFLNK) + continue; + if (chmod(dp->d_name, newmode(st.st_mode)) < 0 && + (ecode = Perror(dp->d_name))) + break; + } + if (fchdir(savedir) < 0) + fatal(255, fchdirmsg); + closedir(dirp); + return (ecode); +} + +error(fmt, a) + char *fmt, *a; +{ + + if (!fflag) { + fprintf(stderr, "chmod: "); + fprintf(stderr, fmt, a); + putc('\n', stderr); + } + return (!fflag); +} + +fatal(status, fmt, a) + int status; + char *fmt, *a; +{ + + fflag = 0; + (void) error(fmt, a); + exit(status); +} + +Perror(s) + char *s; +{ + + if (!fflag) { + fprintf(stderr, "chmod: "); + perror(s); + } + return (!fflag); +} + +newmode(nm) + unsigned nm; +{ + register o, m, b; + int savem; + + ms = modestring; + savem = nm; + m = abs(); + if (*ms == '\0') + 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) + fatal(255, "invalid mode"); + return (nm); +} + +abs() +{ + register c, i; + + i = 0; + while ((c = *ms++) >= '0' && c <= '7') + i = (i << 3) + (c - '0'); + ms--; + return (i); +} + +#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 */ + +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 'X': + if ((om & S_IFDIR) || (om & EXEC)) + m |= EXEC; + continue; + case 's': + m |= SETID; + continue; + case 't': + m |= STICKY; + continue; + default: + ms--; + return (m); + } +} diff --git a/bin/chpass/Makefile b/bin/chpass/Makefile new file mode 100644 index 0000000..ddeea42 --- /dev/null +++ b/bin/chpass/Makefile @@ -0,0 +1,57 @@ +# +# Copyright (c) 1988 The Regents of the University of California. +# All rights reserved. +# +# Redistribution and use in source and binary forms are permitted +# provided that the above copyright notice and this paragraph are +# duplicated in all such forms and that any documentation, +# advertising materials, and other materials related to such +# distribution and use acknowledge that the software was developed +# by the University of California, Berkeley. The name of the +# University may not be used to endorse or promote products derived +# from this software without specific prior written permission. +# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# @(#)Makefile 5.1.2 (2.11BSD) 1996/12/1 +# +CFLAGS= -I. -O +SEPFLAG= -i +SRCS= chpass.c field.c util.c +OBJS= chpass.o field.o util.o +MAN= chpass.0 +MANSRC= chpass.1 + +all: chpass ${MAN} + +chpass: ${OBJS} + ${CC} ${CFLAGS} ${SEPFLAG} -o $@ ${OBJS} + +chpass.0: ${MANSRC} + /usr/man/manroff ${MANSRC} > ${MAN} + +clean: + rm -f ${OBJS} ${MAN} core chpass + +cleandir: clean + rm -f tags .depend + +depend: ${SRCS} + mkdep ${CFLAGS} ${SRCS} + +install: ${MAN} chpass + install -s -o root -g bin -m 4755 chpass ${DESTDIR}/bin/chpass + rm -f ${DESTDIR}/bin/chfn; ln ${DESTDIR}/bin/chpass ${DESTDIR}/bin/chfn + rm -f ${DESTDIR}/bin/chsh; ln ${DESTDIR}/bin/chpass ${DESTDIR}/bin/chsh + install -c -o bin -g bin -m 444 ${MAN} ${DESTDIR}/usr/man/cat1 + rm -f ${DESTDIR}/usr/man/cat1/chfn.0 + rm -f ${DESTDIR}/usr/man/cat1/chsh.0 + -ln ${DESTDIR}/usr/man/cat1/chpass.0 ${DESTDIR}/usr/man/cat1/chfn.0 + -ln ${DESTDIR}/usr/man/cat1/chpass.0 ${DESTDIR}/usr/man/cat1/chsh.0 + +lint: ${SRCS} + lint ${CFLAGS} ${SRCS} + +tags: ${SRCS} + ctags ${SRCS} diff --git a/bin/chpass/chpass.1 b/bin/chpass/chpass.1 new file mode 100644 index 0000000..2e2a65e --- /dev/null +++ b/bin/chpass/chpass.1 @@ -0,0 +1,161 @@ +.\" Copyright (c) 1988 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms are permitted +.\" provided that the above copyright notice and this paragraph are +.\" duplicated in all such forms and that any documentation, +.\" advertising materials, and other materials related to such +.\" distribution and use acknowledge that the software was developed +.\" by the University of California, Berkeley. The name of the +.\" University may not be used to endorse or promote products derived +.\" from this software without specific prior written permission. +.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" @(#)chpass.1 5.6 (Berkeley) 3/12/89 +.\" +.TH CHPASS 1 "March 12, 1989" +.UC 4 +.SH NAME +chpass \- add or change user database information +.SH SYNOPSIS +chpass [ -a list ] [ user ] +.SH DESCRIPTION +.I Chpass +allows editing of the user database information associated +with +.I user +or, by default, the current user. +The information is formatted and supplied to an editor for changes. +The +.I vi +editor will be used unless the environmental variable EDITOR selects +an alternate editor. +When the editor terminates, the information is re-read and used to +update the user database itself. +Only the user, or the super-user, may edit the information associated +with the user. +.PP +Only the information that the user is allowed to change is displayed. +.PP +Possible display items are as follows: +.PP +.RS + Login: user's login name + Password: user's encrypted password + Uid: user's id + Gid: user's login group id + Change: password change time + Expire: account expiration time + Class: user's general classification + Home Directory: user's home directory + Shell: user's login shell + Full Name: user's real name + Location: user's normal location + Home Phone: user's home phone + Office Phone: user's office phone +.RE +.PP +.PP +The +.I login +field is the user name used to access the computer account. +.PP +The +.I password +field contains the encrypted form of the user's password. +.PP +The +.I uid +field is the number associated with the +.I login +field. +Both of these fields should be unique across the system (and often +across a group of systems) as they control file access. +.PP +While it is possible to have multiple entries with identical login names +and/or identical user id's, it is usually a mistake to do so. Routines +that manipulate these files will often return only one of the multiple +entries, and that one by random selection. +.PP +The +.I group +field is the group that the user will be placed in upon login. +Since this system supports multiple groups (see +.IR groups (1)) +this field currently has little special meaning. +This field may be filled in with either a number or a group name (see +.IR group (5)). +.PP +The +.I change +field is the date by which the password must be changed. +.PP +The +.I expire +field is the date on which the account expires. +.PP +Both the +.I change +and +.I expire +fields should be entered in the form ``month day year'' where +.I month +is the month name (the first three characters are sufficient), +.I day +is the day of the month, and +.I year +is the year. +.PP +The +.I class +field is currently unused. In the near future it will be a key to +a +.IR termcap (5) +style database of user attributes. +.PP +The user's home directory is the full UNIX path name where the user +will be placed on login. +.PP +The shell field is the command interpreter the user prefers. +If the +.I shell +field is empty, the Bourne shell (\fI/bin/sh\fP) is assumed. +.PP +When altering a login shell, and not the super-user, the user must +select an approved shell from the list in +.IR /etc/shells . +.PP +The last four fields are for storing the user's full name, office +location, and home and work telephone numbers. +.PP +The super-user is also allowed to directly supply a user database +entry, in the format specified by +.IR passwd (5), +as an argument to the +.I -a +option. +This argument must be a colon (``:'') separated list of all the +user database fields, although they may be empty. +.PP +Once the information has been verified, +.I chpass +uses +.IR mkpasswd (8) +to update the user database. This is run in the background, and, +at very large sites could take several minutes. Until this update +is completed, the password file is unavailable for other updates +and the new information will not be available to programs. +.SH FILES +.DT +/etc/master.passwd The user database +/etc/shells The list of approved shells +.RE +.SH "SEE ALSO" +login(1), finger(1), getusershell(3), passwd(5), mkpasswd(8), vipw(8) +.br +Robert Morris and Ken Thompson, +.I UNIX password security +.SH BUGS +User information should (and eventually will) be stored elsewhere. diff --git a/bin/chpass/chpass.c b/bin/chpass/chpass.c new file mode 100644 index 0000000..be8dc92 --- /dev/null +++ b/bin/chpass/chpass.c @@ -0,0 +1,472 @@ +/* + * Copyright (c) 1988 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if !defined(lint) && defined(DOSCCS) +char copyright[] = +"@(#) Copyright (c) 1988 The Regents of the University of California.\n\ + All rights reserved.\n"; + +static char sccsid[] = "@(#)chpass.c 5.10.1 (2.11BSD) 1996/1/12"; +#endif /* not lint */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +char e1[] = ": "; +char e2[] = ":,"; + +int p_change(), p_class(), p_expire(), p_gecos(), p_gid(), p_hdir(); +int p_login(), p_passwd(), p_shell(), p_uid(); + +struct entry list[] = { + { "Login", p_login, 1, 5, e1, }, + { "Password", p_passwd, 1, 8, e1, }, + { "Uid", p_uid, 1, 3, e1, }, + { "Gid", p_gid, 1, 3, e1, }, + { "Class", p_class, 1, 5, e1, }, + { "Change", p_change, 1, 6, NULL, }, + { "Expire", p_expire, 1, 6, NULL, }, +#define E_NAME 7 + { "Full Name", p_gecos, 0, 9, e2, }, +#define E_BPHONE 8 + { "Office Phone", p_gecos, 0, 12, e2, }, +#define E_HPHONE 9 + { "Home Phone", p_gecos, 0, 10, e2, }, +#define E_LOCATE 10 + { "Location", p_gecos, 0, 8, e2, }, + { "Home directory", p_hdir, 1, 14, e1, }, + { "Shell", p_shell, 0, 5, e1, }, + { NULL, 0, }, +}; + +uid_t uid; + +main(argc, argv) + int argc; + char **argv; +{ + extern int errno, optind; + extern char *optarg; + register char *p; + struct passwd lpw, *pw; + struct rlimit rlim; + FILE *temp_fp; + int aflag, ch, fd; + char *fend, *passwd, *temp, *tend; + char from[MAXPATHLEN], to[MAXPATHLEN]; + char *getusershell(); + + uid = getuid(); + aflag = 0; + while ((ch = getopt(argc, argv, "a:")) != EOF) + switch(ch) { + case 'a': + if (uid) { + (void)fprintf(stderr, + "chpass: %s\n", strerror(EACCES)); + exit(1); + } + loadpw(optarg, pw = &lpw); + aflag = 1; + break; + case '?': + default: + usage(); + } + argc -= optind; + argv += optind; + + if (!aflag) + switch(argc) { + case 0: + if (!(pw = getpwuid(uid))) { + (void)fprintf(stderr, + "chpass: unknown user: uid %u\n", uid); + exit(1); + } + break; + case 1: + if (!(pw = getpwnam(*argv))) { + (void)fprintf(stderr, + "chpass: unknown user %s.\n", *argv); + exit(1); + } + if (uid && uid != pw->pw_uid) { + (void)fprintf(stderr, + "chpass: %s\n", strerror(EACCES)); + exit(1); + } + break; + default: + usage(); + } + + (void)signal(SIGHUP, SIG_IGN); + (void)signal(SIGINT, SIG_IGN); + (void)signal(SIGQUIT, SIG_IGN); + (void)signal(SIGTSTP, SIG_IGN); + + rlim.rlim_cur = rlim.rlim_max = RLIM_INFINITY; + (void)setrlimit(RLIMIT_CPU, &rlim); + (void)setrlimit(RLIMIT_FSIZE, &rlim); + + (void)umask(0); + + temp = _PATH_PTMP; + if ((fd = open(temp, O_WRONLY|O_CREAT|O_EXCL, 0600)) < 0) { + if (errno == EEXIST) { + (void)fprintf(stderr, + "chpass: password file busy -- try again later.\n"); + exit(1); + } + (void)fprintf(stderr, "chpass: %s: %s; ", + temp, strerror(errno)); + goto bad; + } + if (!(temp_fp = fdopen(fd, "w"))) { + (void)fprintf(stderr, "chpass: can't write %s; ", temp); + goto bad; + } + + if (!aflag && !info(pw)) + goto bad; + + /* root should have a 0 uid and a reasonable shell */ + if (!strcmp(pw->pw_name, "root")) { + if (pw->pw_uid) { + (void)fprintf(stderr, "chpass: root uid should be 0."); + exit(1); + } + setusershell(); + for (;;) + if (!(p = getusershell())) { + (void)fprintf(stderr, + "chpass: warning, unknown root shell."); + break; + } + else if (!strcmp(pw->pw_shell, p)) + break; + } + + passwd = _PATH_MASTERPASSWD; + if (!freopen(passwd, "r", stdin)) { + (void)fprintf(stderr, "chpass: can't read %s; ", passwd); + goto bad; + } + if (!copy(pw, temp_fp)) + goto bad; + + (void)fclose(temp_fp); + (void)fclose(stdin); + + switch(fork()) { + case 0: + break; + case -1: + (void)fprintf(stderr, "chpass: can't fork; "); + goto bad; + /* NOTREACHED */ + default: + exit(0); + /* NOTREACHED */ + } + + if (makedb(temp)) { + (void)fprintf(stderr, "chpass: mkpasswd failed; "); +bad: (void)fprintf(stderr, "%s unchanged.\n", _PATH_MASTERPASSWD); + (void)unlink(temp); + exit(1); + } + + /* + * possible race; have to rename four files, and someone could slip + * in between them. LOCK_EX and rename the ``passwd.dir'' file first + * so that getpwent(3) can't slip in; the lock should never fail and + * it's unclear what to do if it does. Rename ``ptmp'' last so that + * passwd/vipw/chpass can't slip in. + */ + (void)setpriority(PRIO_PROCESS, 0, -20); + fend = strcpy(from, temp) + strlen(temp); + tend = strcpy(to, _PATH_PASSWD) + strlen(_PATH_PASSWD); + bcopy(".dir", fend, 5); + bcopy(".dir", tend, 5); + if ((fd = open(from, O_RDONLY, 0)) >= 0) + (void)flock(fd, LOCK_EX); + /* here we go... */ + (void)rename(from, to); + bcopy(".pag", fend, 5); + bcopy(".pag", tend, 5); + (void)rename(from, to); + bcopy(".orig", fend, 6); + (void)rename(from, _PATH_PASSWD); + (void)rename(temp, passwd); + /* done! */ + exit(0); +} + +info(pw) + struct passwd *pw; +{ + struct stat begin, end; + FILE *fp; + int fd, rval; + char *tfile; + + tfile = "/tmp/passwd.XXXXXX"; + if ((fd = mkstemp(tfile)) == -1 || !(fp = fdopen(fd, "w+"))) { + (void)fprintf(stderr, "chpass: no temporary file"); + return(0); + } + + print(fp, pw); + (void)fflush(fp); + + /* + * give the file to the real user; setuid permissions + * are discarded in edit() + */ + (void)fchown(fd, getuid(), getgid()); + + for (rval = 0;;) { + (void)fstat(fd, &begin); + if (edit(tfile)) { + (void)fprintf(stderr, "chpass: edit failed; "); + break; + } + (void)fstat(fd, &end); + if (begin.st_mtime == end.st_mtime) { + (void)fprintf(stderr, "chpass: no changes made; "); + break; + } + (void)rewind(fp); + if (check(fp, pw)) { + rval = 1; + break; + } + (void)fflush(stderr); + if (prompt()) + break; + } + (void)fclose(fp); + (void)unlink(tfile); + return(rval); +} + +check(fp, pw) + FILE *fp; + struct passwd *pw; +{ + register struct entry *ep; + register char *p; + static char buf[256]; + + while (fgets(buf, sizeof(buf), fp)) { + if (!buf[0] || buf[0] == '#') + continue; + if (!(p = index(buf, '\n'))) { + (void)fprintf(stderr, "chpass: line too long.\n"); + return(0); + } + *p = '\0'; + for (ep = list;; ++ep) { + if (!ep->prompt) { + (void)fprintf(stderr, + "chpass: unrecognized field.\n"); + return(0); + } + if (!strncasecmp(buf, ep->prompt, ep->len)) { + if (ep->restricted && uid) + break; + if (!(p = index(buf, ':'))) { + (void)fprintf(stderr, + "chpass: line corrupted.\n"); + return(0); + } + while (isspace(*++p)); + if (ep->except && strpbrk(p, ep->except)) { + (void)fprintf(stderr, + "chpass: illegal character in the \"%s\" field.\n", + ep->prompt); + return(0); + } + if ((ep->func)(p, pw, ep)) + return(0); + break; + } + } + } + /* + * special checks... + * + * there has to be a limit on the size of the gecos fields, + * otherwise getpwent(3) can choke. + * ``if I swallow anything evil, put your fingers down my throat...'' + * -- The Who + */ + if (strlen(list[E_NAME].save) + strlen(list[E_BPHONE].save) + + strlen(list[E_HPHONE].save) + strlen(list[E_LOCATE].save) + > 128) { + (void)fprintf(stderr, "chpass: gecos field too large.\n"); + exit(1); + } + (void)sprintf(pw->pw_gecos = buf, "%s,%s,%s,%s", + list[E_NAME].save, list[E_LOCATE].save, list[E_BPHONE].save, + list[E_HPHONE].save); + return(1); +} + +copy(pw, fp) + struct passwd *pw; + FILE *fp; +{ + register int done; + register char *p; + char buf[256]; + + for (done = 0; fgets(buf, sizeof(buf), stdin);) { + /* skip lines that are too big */ + if (!index(buf, '\n')) { + (void)fprintf(stderr, "chpass: line too long; "); + return(0); + } + if (done) { + (void)fprintf(fp, "%s", buf); + continue; + } + if (!(p = index(buf, ':'))) { + (void)fprintf(stderr, "chpass: corrupted entry; "); + return(0); + } + *p = '\0'; + if (strcmp(buf, pw->pw_name)) { + *p = ':'; + (void)fprintf(fp, "%s", buf); + continue; + } + (void)fprintf(fp, "%s:%s:%d:%d:%s:%ld:%ld:%s:%s:%s\n", + pw->pw_name, pw->pw_passwd, pw->pw_uid, pw->pw_gid, + pw->pw_class, pw->pw_change, pw->pw_expire, pw->pw_gecos, + pw->pw_dir, pw->pw_shell); + done = 1; + } + if (!done) + (void)fprintf(fp, "%s:%s:%d:%d:%s:%ld:%ld:%s:%s:%s\n", + pw->pw_name, pw->pw_passwd, pw->pw_uid, pw->pw_gid, + pw->pw_class, pw->pw_change, pw->pw_expire, pw->pw_gecos, + pw->pw_dir, pw->pw_shell); + return(1); +} + +makedb(file) + char *file; +{ + int status, pid, w; + + if (!(pid = vfork())) { + execl(_PATH_MKPASSWD, "mkpasswd", "-p", file, NULL); + _exit(127); + } + while ((w = wait(&status)) != pid && w != -1); + return(w == -1 || status); +} + +edit(file) + char *file; +{ + int status, pid, w; + char *p, *editor, *getenv(); + + if (editor = getenv("EDITOR")) { + if (p = rindex(editor, '/')) + ++p; + else + p = editor; + } + else + p = editor = "vi"; + if (!(pid = vfork())) { + (void)setgid(getgid()); + (void)setuid(getuid()); + execlp(editor, p, file, NULL); + _exit(127); + } + while ((w = wait(&status)) != pid && w != -1); + return(w == -1 || status); +} + +loadpw(arg, pw) + char *arg; + register struct passwd *pw; +{ + register char *cp; + char *bp = arg; + + pw->pw_name = strsep(&bp, ":"); + pw->pw_passwd = strsep(&bp, ":"); + if (!(cp = strsep(&bp, ":"))) + goto bad; + pw->pw_uid = atoi(cp); + if (!(cp = strsep(&bp, ":"))) + goto bad; + pw->pw_gid = atoi(cp); + pw->pw_class = strsep(&bp, ":"); + if (!(cp = strsep(&bp, ":"))) + goto bad; + pw->pw_change = atol(cp); + if (!(cp = strsep(&bp, ":"))) + goto bad; + pw->pw_expire = atol(cp); + pw->pw_gecos = strsep(&bp, ":"); + pw->pw_dir = strsep(&bp, ":"); + pw->pw_shell = strsep(&bp, ":"); + if (!pw->pw_shell || strsep(&bp, ":")) { +bad: (void)fprintf(stderr, "chpass: bad password list.\n"); + exit(1); + } +} + +prompt() +{ + register int c; + + for (;;) { + (void)printf("re-edit the password file? [y]: "); + (void)fflush(stdout); + c = getchar(); + if (c != EOF && c != (int)'\n') + while (getchar() != (int)'\n'); + return(c == (int)'n'); + } + /* NOTREACHED */ +} + +usage() +{ + (void)fprintf(stderr, "usage: chpass [-a list] [user]\n"); + exit(1); +} diff --git a/bin/chpass/chpass.h b/bin/chpass/chpass.h new file mode 100644 index 0000000..9241d2b --- /dev/null +++ b/bin/chpass/chpass.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) 1988 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * @(#)chpass.h 5.1 (Berkeley) 2/22/89 + */ + +struct entry { + char *prompt; + int (*func)(), restricted, len; + char *except, *save; +}; + +extern uid_t uid; diff --git a/bin/chpass/field.c b/bin/chpass/field.c new file mode 100644 index 0000000..eb73588 --- /dev/null +++ b/bin/chpass/field.c @@ -0,0 +1,244 @@ +/* + * Copyright (c) 1988 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#ifndef lint +static char sccsid[] = "@(#)field.c 5.8 (Berkeley) 3/16/89"; +#endif /* not lint */ + +#include +#include +#include +#include +#include +#include +#include +#include "pathnames.h" + +/* ARGSUSED */ +p_login(p, pw, ep) + char *p; + struct passwd *pw; + struct entry *ep; +{ + if (!*p) { + (void)fprintf(stderr, "chpass: empty login field.\n"); + return(1); + } + if (*p == '-') { + (void)fprintf(stderr, + "chpass: login names may not begin with a hyphen.\n"); + return(1); + } + if (!(pw->pw_name = strdup(p))) { + (void)fprintf(stderr, "chpass: can't save entry.\n"); + return(1); + } + if (index(p, '.')) + (void)fprintf(stderr, + "chpass: \'.\' is dangerous in a login name.\n"); + for (; *p; ++p) + if (isupper(*p)) { + (void)fprintf(stderr, + "chpass: upper-case letters are dangerous in a login name.\n"); + break; + } + return(0); +} + +/* ARGSUSED */ +p_passwd(p, pw, ep) + char *p; + struct passwd *pw; + struct entry *ep; +{ + if (!*p) + pw->pw_passwd = ""; /* "NOLOGIN"; */ + else if (!(pw->pw_passwd = strdup(p))) { + (void)fprintf(stderr, "chpass: can't save password entry.\n"); + return(1); + } + + return(0); +} + +/* ARGSUSED */ +p_uid(p, pw, ep) + register char *p; + struct passwd *pw; + struct entry *ep; +{ + int id; + + if (!*p) { + (void)fprintf(stderr, "chpass: empty uid field.\n"); + return(1); + } + if (!isdigit(*p)) { + (void)fprintf(stderr, "chpass: illegal uid.\n"); + return(1); + } + id = atoi(p); + if ((u_int)id > USHRT_MAX) { + (void)fprintf(stderr, "chpass: %d > max uid value (%d).\n", + id, USHRT_MAX); + return(1); + } + pw->pw_uid = id; + return(0); +} + +/* ARGSUSED */ +p_gid(p, pw, ep) + register char *p; + struct passwd *pw; + struct entry *ep; +{ + struct group *gr; + int id; + + if (!*p) { + (void)fprintf(stderr, "chpass: empty gid field.\n"); + return(1); + } + if (!isdigit(*p)) { + if (!(gr = getgrnam(p))) { + (void)fprintf(stderr, + "chpass: unknown group %s.\n", p); + return(1); + } + pw->pw_gid = gr->gr_gid; + return(0); + } + id = atoi(p); + if ((u_int)id > USHRT_MAX) { + (void)fprintf(stderr, "chpass: %d > max gid value (%d).\n", + id, USHRT_MAX); + return(1); + } + pw->pw_gid = id; + return(0); +} + +/* ARGSUSED */ +p_class(p, pw, ep) + char *p; + struct passwd *pw; + struct entry *ep; +{ + if (!*p) + pw->pw_class = ""; + else if (!(pw->pw_class = strdup(p))) { + (void)fprintf(stderr, "chpass: can't save entry.\n"); + return(1); + } + + return(0); +} + +/* ARGSUSED */ +p_change(p, pw, ep) + char *p; + struct passwd *pw; + struct entry *ep; +{ + if (!atot(p, &pw->pw_change)) + return(0); + (void)fprintf(stderr, "chpass: illegal date for change field.\n"); + return(1); +} + +/* ARGSUSED */ +p_expire(p, pw, ep) + char *p; + struct passwd *pw; + struct entry *ep; +{ + if (!atot(p, &pw->pw_expire)) + return(0); + (void)fprintf(stderr, "chpass: illegal date for expire field.\n"); + return(1); +} + +/* ARGSUSED */ +p_gecos(p, pw, ep) + char *p; + struct passwd *pw; + struct entry *ep; +{ + if (!*p) + ep->save = ""; + else if (!(ep->save = strdup(p))) { + (void)fprintf(stderr, "chpass: can't save entry.\n"); + return(1); + } + return(0); +} + +/* ARGSUSED */ +p_hdir(p, pw, ep) + char *p; + struct passwd *pw; + struct entry *ep; +{ + if (!*p) { + (void)fprintf(stderr, "chpass: empty home directory field.\n"); + return(1); + } + if (!(pw->pw_dir = strdup(p))) { + (void)fprintf(stderr, "chpass: can't save entry.\n"); + return(1); + } + return(0); +} + +/* ARGSUSED */ +p_shell(p, pw, ep) + register char *p; + struct passwd *pw; + struct entry *ep; +{ + register char *sh, *t; + char *getusershell(); + + if (!*p) { + pw->pw_shell = _PATH_BSHELL; + return(0); + } + setusershell(); + for (;;) { + if (!(sh = getusershell())) { + /* only admin can set "restricted" shells */ + if (!uid) + break; + (void)fprintf(stderr, + "chpass: %s: non-standard shell.\n", p); + return(1); + } + if (!strcmp(p, sh)) + break; + /* allow just shell name */ + if ((t = rindex(sh, '/')) && !strcmp(p, t)) { + p = t; + break; + } + } + if (!(pw->pw_shell = strdup(p))) { + (void)fprintf(stderr, "chpass: can't save entry.\n"); + return(1); + } + return(0); +} diff --git a/bin/chpass/pathnames.h b/bin/chpass/pathnames.h new file mode 100644 index 0000000..b2c9f07 --- /dev/null +++ b/bin/chpass/pathnames.h @@ -0,0 +1,20 @@ +/* + * Copyright (c) 1989 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * @(#)pathnames.h 5.1 (Berkeley) 3/5/89 + */ + +#define _PATH_BSHELL "/bin/sh" diff --git a/bin/chpass/util.c b/bin/chpass/util.c new file mode 100644 index 0000000..bc6a19c --- /dev/null +++ b/bin/chpass/util.c @@ -0,0 +1,160 @@ +/* + * Copyright (c) 1988 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if !defined(lint) && defined(DOSCCS) +static char sccsid[] = "@(#)util.c 5.9.1 (2.11BSD) 1996/1/12"; +#endif + +#include +#include +#include +#include +#include +#include +#include +#include "pathnames.h" + +static char dmsize[] = + { -1, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; +static char *months[] = + { "January", "February", "March", "April", "May", "June", + "July", "August", "September", "October", "November", + "December", NULL }; +char * +ttoa(tval) + time_t tval; +{ + register struct tm *tp; + static char tbuf[50]; + + if (tval) { + tp = localtime(&tval); + (void)sprintf(tbuf, "%s %d, 19%d", months[tp->tm_mon], + tp->tm_mday, tp->tm_year); + } + else + *tbuf = '\0'; + return(tbuf); +} + +atot(p, store) + char *p; + time_t *store; +{ + register char *t, **mp; + static struct tm *lt; + time_t tval, time(); + int day, month, year; + + if (!*p) { + *store = 0; + return(0); + } + if (!lt) { + unsetenv("TZ"); + (void)time(&tval); + lt = localtime(&tval); + } + if (!(t = strtok(p, " \t"))) + goto bad; + for (mp = months;; ++mp) { + if (!*mp) + goto bad; + if (!strncasecmp(*mp, t, 3)) { + month = mp - months + 1; + break; + } + } + if (!(t = strtok((char *)NULL, " \t,")) || !isdigit(*t)) + goto bad; + day = atoi(t); + if (!(t = strtok((char *)NULL, " \t,")) || !isdigit(*t)) + goto bad; + year = atoi(t); + if (day < 1 || day > 31 || month < 1 || month > 12 || !year) + goto bad; + +#define TM_YEAR_BASE 1900 +#define EPOCH_YEAR 1970 +#define DAYSPERNYEAR 365 +#define DAYSPERLYEAR 366 +#define HOURSPERDAY 24 +#define MINSPERHOUR 60 +#define SECSPERMIN 60 +#define isleap(y) (((y) % 4) == 0 && ((y) % 100) != 0 || ((y) % 400) == 0) + + if (year < 100) + year += TM_YEAR_BASE; + if (year <= EPOCH_YEAR) +bad: return(1); + tval = isleap(year) && month > 2; + for (--year; year >= EPOCH_YEAR; --year) + tval += isleap(year) ? + DAYSPERLYEAR : DAYSPERNYEAR; + while (--month) + tval += dmsize[month]; + tval += day; + tval = tval * HOURSPERDAY * MINSPERHOUR * SECSPERMIN; + tval -= lt->tm_gmtoff; + *store = tval; + return(0); +} + +print(fp, pw) + register FILE *fp; + struct passwd *pw; +{ + register char *p; + char *bp; + char *getusershell(), *ttoa(); + + fprintf(fp, "#Changing user database information for %s.\n", + pw->pw_name); + if (!uid) { + fprintf(fp, "Login: %s\n", pw->pw_name); + fprintf(fp, "Password: %s\n", pw->pw_passwd); + fprintf(fp, "Uid [#]: %d\n", pw->pw_uid); + fprintf(fp, "Gid [# or name]: %d\n", pw->pw_gid); + fprintf(fp, "Change [month day year]: %s\n", ttoa(pw->pw_change)); + fprintf(fp, "Expire [month day year]: %s\n", ttoa(pw->pw_expire)); + fprintf(fp, "Class: %s\n", pw->pw_class); + fprintf(fp, "Home directory: %s\n", pw->pw_dir); + fprintf(fp, "Shell: %s\n", + *pw->pw_shell ? pw->pw_shell : _PATH_BSHELL); + } + else { + /* only admin can change "restricted" shells */ + setusershell(); + for (;;) + if (!(p = getusershell())) + break; + else if (!strcmp(pw->pw_shell, p)) { + fprintf(fp, "Shell: %s\n", *pw->pw_shell ? + pw->pw_shell : _PATH_BSHELL); + break; + } + } + bp = pw->pw_gecos; + p = strsep(&bp, ","); + fprintf(fp, "Full Name: %s\n", p ? p : ""); + p = strsep(&bp, ","); + fprintf(fp, "Location: %s\n", p ? p : ""); + p = strsep(&bp, ","); + fprintf(fp, "Office Phone: %s\n", p ? p : ""); + p = strsep(&bp, ","); + fprintf(fp, "Home Phone: %s\n", p ? p : ""); +} diff --git a/bin/cmp.c b/bin/cmp.c new file mode 100644 index 0000000..7fc7b0f --- /dev/null +++ b/bin/cmp.c @@ -0,0 +1,251 @@ +/* + * Copyright (c) 1987 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that this notice is preserved and that due credit is given + * to the University of California at Berkeley. The name of the University + * may not be used to endorse or promote products derived from this + * software without specific written prior permission. This software + * is provided ``as is'' without express or implied warranty. + */ + +#ifndef lint +char copyright[] = +"@(#) Copyright (c) 1987 Regents of the University of California.\n\ + All rights reserved.\n"; +#endif /* !lint */ + +#ifndef lint +static char sccsid[] = "@(#)cmp.c 4.8 (Berkeley) 12/21/87"; +#endif /* !lint */ + +#include +#include +#include +#include +#include +#include + +#define DIFF 1 /* found differences */ +#define ERR 2 /* error during run */ +#define NO 0 /* no/false */ +#define OK 0 /* didn't find differences */ +#define YES 1 /* yes/true */ + +static int fd1, fd2, /* file descriptors */ + silent = NO; /* if silent run */ +static short all = NO; /* if report all differences */ +static u_char buf1[MAXBSIZE], /* read buffers */ + buf2[MAXBSIZE]; +static char *file1, *file2; /* file names */ + +main(argc, argv) + int argc; + char **argv; +{ + extern char *optarg; + extern int optind; + int ch; + u_long otoi(); + + while ((ch = getopt(argc, argv, "ls")) != EOF) + switch(ch) { + case 'l': /* print all differences */ + all = YES; + break; + case 's': /* silent run */ + silent = YES; + break; + case '?': + default: + usage(); + } + argv += optind; + argc -= optind; + + if (argc < 2 || argc > 4) + usage(); + + /* open up files; "-" is stdin */ + file1 = argv[0]; + if (strcmp(file1, "-") && (fd1 = open(file1, O_RDONLY, 0)) < 0) + error(file1); + file2 = argv[1]; + if ((fd2 = open(file2, O_RDONLY, 0)) < 0) + error(file2); + + /* handle skip arguments */ + if (argc > 2) { + skip(otoi(argv[2]), fd1, file1); + if (argc == 4) + skip(otoi(argv[3]), fd2, file2); + } + cmp(); + /*NOTREACHED*/ +} + +/* + * skip -- + * skip first part of file + */ +static +skip(dist, fd, fname) + register u_long dist; /* length in bytes, to skip */ + register int fd; /* file descriptor */ + char *fname; /* file name for error */ +{ + register int rlen; /* read length */ + register int nread; + + for (; dist; dist -= rlen) { + rlen = MIN(dist, sizeof(buf1)); + if ((nread = read(fd, buf1, rlen)) != rlen) { + if (nread < 0) + error(fname); + else + endoffile(fname); + } + } +} + +static +cmp() +{ + register u_char *C1, *C2; /* traveling pointers */ + register int cnt, /* counter */ + len1, len2; /* read lengths */ + register long byte, /* byte count */ + line; /* line count */ + short dfound = NO; /* if difference found */ + + for (byte = 0, line = 1;;) { + switch(len1 = read(fd1, buf1, MAXBSIZE)) { + case -1: + error(file1); + case 0: + /* + * read of file 1 just failed, find out + * if there's anything left in file 2 + */ + switch(read(fd2, buf2, 1)) { + case -1: + error(file2); + case 0: + exit(dfound ? DIFF : OK); + default: + endoffile(file1); + } + } + /* + * file1 might be stdio, which means that a read of less than + * MAXBSIZE might not mean an EOF. So, read whatever we read + * from file1 from file2. + */ + if ((len2 = read(fd2, buf2, len1)) == -1) + error(file2); + if (bcmp(buf1, buf2, len2)) { + if (silent) + exit(DIFF); + if (all) { + dfound = YES; + for (C1 = buf1, C2 = buf2, cnt = len2; cnt--; ++C1, ++C2) { + ++byte; + if (*C1 != *C2) + printf("%6ld %3o %3o\n", byte, *C1, *C2); + } + } + else for (C1 = buf1, C2 = buf2;; ++C1, ++C2) { + ++byte; + if (*C1 != *C2) { + printf("%s %s differ: char %ld, line %ld\n", file1, file2, byte, line); + exit(DIFF); + } + if (*C1 == '\n') + ++line; + } + } + else { + byte += len2; + /* + * here's the real performance problem, we've got to + * count the stupid lines, which means that -l is a + * *much* faster version, i.e., unless you really + * *want* to know the line number, run -s or -l. + */ + if (!silent && !all) + for (C1 = buf1, cnt = len2; cnt--;) + if (*C1++ == '\n') + ++line; + } + /* + * couldn't read as much from file2 as from file1; checked + * here because there might be a difference before we got + * to this point, which would have precedence. + */ + if (len2 < len1) + endoffile(file2); + } +} + +/* + * otoi -- + * octal/decimal string to u_long + */ +static u_long +otoi(C) + register char *C; /* argument string */ +{ + register u_long val; /* return value */ + register int base; /* number base */ + + base = (*C == '0') ? 8 : 10; + for (val = 0; isdigit(*C); ++C) + val = val * base + *C - '0'; + return(val); +} + +/* + * error -- + * print I/O error message and die + */ +static +error(filename) + char *filename; +{ + extern int errno; + int sverrno; + + if (!silent) { + sverrno = errno; + (void)fprintf(stderr, "cmp: %s: ", filename); + errno = sverrno; + perror((char *)NULL); + } + exit(ERR); +} + +/* + * endoffile -- + * print end-of-file message and exit indicating the files were different + */ +static +endoffile(filename) + char *filename; +{ + /* 32V put this message on stdout, S5 does it on stderr. */ + if (!silent) + (void)fprintf(stderr, "cmp: EOF on %s\n", filename); + exit(DIFF); +} + +/* + * usage -- + * print usage and die + */ +static +usage() +{ + fputs("usage: cmp [-ls] file1 file2 [skip1] [skip2]\n", stderr); + exit(ERR); +} diff --git a/bin/cp.c b/bin/cp.c new file mode 100644 index 0000000..4cfb295 --- /dev/null +++ b/bin/cp.c @@ -0,0 +1,242 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#ifndef lint +char copyright[] = +"@(#) Copyright (c) 1983 Regents of the University of California.\n\ + All rights reserved.\n"; +#endif not lint + +#ifndef lint +static char sccsid[] = "@(#)cp.c 4.13 (Berkeley) 10/11/85"; +#endif not lint + +/* + * cp + */ +#include +#include +#include +#include +#include + +int iflag; +int rflag; +int pflag; +char *rindex(); + +main(argc, argv) + int argc; + char **argv; +{ + struct stat stb; + int rc, i; + + argc--, argv++; + while (argc > 0 && **argv == '-') { + (*argv)++; + while (**argv) switch (*(*argv)++) { + + case 'i': + iflag++; break; + + case 'R': + case 'r': + rflag++; break; + + case 'p': /* preserve mtimes, atimes, and modes */ + pflag++; + (void) umask(0); + break; + + default: + goto usage; + } + argc--; argv++; + } + if (argc < 2) + goto usage; + if (argc > 2) { + if (stat(argv[argc-1], &stb) < 0) + goto usage; + if ((stb.st_mode&S_IFMT) != S_IFDIR) + goto usage; + } + rc = 0; + for (i = 0; i < argc-1; i++) + rc |= copy(argv[i], argv[argc-1]); + exit(rc); +usage: + fprintf(stderr, + "Usage: cp [-ip] f1 f2; or: cp [-irp] f1 ... fn d2\n"); + exit(1); +} + +copy(from, to) + char *from, *to; +{ + int fold, fnew, n, exists; + char *last, destname[MAXPATHLEN + 1], buf[MAXBSIZE]; + struct stat stfrom, stto; + + fold = open(from, 0); + if (fold < 0) { + Perror(from); + return (1); + } + if (fstat(fold, &stfrom) < 0) { + Perror(from); + (void) close(fold); + return (1); + } + if (stat(to, &stto) >= 0 && + (stto.st_mode&S_IFMT) == S_IFDIR) { + last = rindex(from, '/'); + if (last) last++; else last = from; + if (strlen(to) + strlen(last) >= sizeof destname - 1) { + fprintf(stderr, "cp: %s/%s: Name too long", to, last); + (void) close(fold); + return(1); + } + (void) sprintf(destname, "%s/%s", to, last); + to = destname; + } + if (rflag && (stfrom.st_mode&S_IFMT) == S_IFDIR) { + int fixmode = 0; /* cleanup mode after rcopy */ + + (void) close(fold); + if (stat(to, &stto) < 0) { + if (mkdir(to, (stfrom.st_mode & 07777) | 0700) < 0) { + Perror(to); + return (1); + } + fixmode = 1; + } else if ((stto.st_mode&S_IFMT) != S_IFDIR) { + fprintf(stderr, "cp: %s: Not a directory.\n", to); + return (1); + } else if (pflag) + fixmode = 1; + n = rcopy(from, to); + if (fixmode) + (void) chmod(to, stfrom.st_mode & 07777); + return (n); + } + + if ((stfrom.st_mode&S_IFMT) == S_IFDIR) + fprintf(stderr, + "cp: %s: Is a directory (copying as plain file).\n", + from); + + exists = stat(to, &stto) == 0; + if (exists) { + if (stfrom.st_dev == stto.st_dev && + stfrom.st_ino == stto.st_ino) { + fprintf(stderr, + "cp: %s and %s are identical (not copied).\n", + from, to); + (void) close(fold); + return (1); + } + if (iflag && isatty(fileno(stdin))) { + int i, c; + + fprintf (stderr, "overwrite %s? ", to); + i = c = getchar(); + while (c != '\n' && c != EOF) + c = getchar(); + if (i != 'y') { + (void) close(fold); + return(1); + } + } + } + fnew = creat(to, stfrom.st_mode & 07777); + if (fnew < 0) { + Perror(to); + (void) close(fold); return(1); + } + if (exists && pflag) + (void) fchmod(fnew, stfrom.st_mode & 07777); + + for (;;) { + n = read(fold, buf, sizeof buf); + if (n == 0) + break; + if (n < 0) { + Perror(from); + (void) close(fold); (void) close(fnew); return (1); + } + if (write(fnew, buf, n) != n) { + Perror(to); + (void) close(fold); (void) close(fnew); return (1); + } + } + (void) close(fold); (void) close(fnew); + if (pflag) + return (setimes(to, &stfrom)); + return (0); +} + +rcopy(from, to) + char *from, *to; +{ + DIR *fold = opendir(from); + struct direct *dp; + struct stat statb; + int errs = 0; + char fromname[MAXPATHLEN + 1]; + + if (fold == 0 || (pflag && fstat(fold->dd_fd, &statb) < 0)) { + Perror(from); + return (1); + } + for (;;) { + dp = readdir(fold); + if (dp == 0) { + closedir(fold); + if (pflag) + return (setimes(to, &statb) + errs); + return (errs); + } + if (dp->d_ino == 0) + continue; + if (!strcmp(dp->d_name, ".") || !strcmp(dp->d_name, "..")) + continue; + if (strlen(from)+1+strlen(dp->d_name) >= sizeof fromname - 1) { + fprintf(stderr, "cp: %s/%s: Name too long.\n", + from, dp->d_name); + errs++; + continue; + } + (void) sprintf(fromname, "%s/%s", from, dp->d_name); + errs += copy(fromname, to); + } +} + +int +setimes(path, statp) + char *path; + struct stat *statp; +{ + struct timeval tv[2]; + + tv[0].tv_sec = statp->st_atime; + tv[1].tv_sec = statp->st_mtime; + tv[0].tv_usec = tv[1].tv_usec = 0; + if (utimes(path, tv) < 0) { + Perror(path); + return (1); + } + return (0); +} + +Perror(s) + char *s; +{ + + fprintf(stderr, "cp: "); + perror(s); +} diff --git a/bin/csh/Makefile b/bin/csh/Makefile new file mode 100644 index 0000000..19691bf --- /dev/null +++ b/bin/csh/Makefile @@ -0,0 +1,125 @@ +# +# Copyright (c) 1980 Regents of the University of California. +# All rights reserved. The Berkeley Software License Agreement +# specifies the terms and conditions for redistribution. +# +# @(#)Makefile 5.3.3 (2.11BSD GTE) 1996/12/1 +# +# C Shell with process control; VM/UNIX VAX Makefile +# Bill Joy UC Berkeley; Jim Kulp IIASA, Austria +# +# To profile, put -DPROF in DEFS and -pg in CFLAGS, and recompile. + +DEFS= -DTELL -DVFORK -DFILEC +CFLAGS= $(DEFS) -O +SEPFLAG=-i +XSTR= /usr/ucb/xstr +AS= as +RM= -rm +CXREF= /usr/ucb/cxref +VGRIND= /usr/ucb/vgrind +CTAGS= /usr/ucb/ctags +LIBES= -lc +SCCS= sccs +CPP= /lib/cpp +SED= sed + +BASE= alloc11.o doprnt11.o printf.o sh.char.o sh.dir.o sh.dol.o \ + sh.err.o sh.exp.o sh.file.o sh.func.o sh.glob.o sh.hist.o \ + sh.init.o sh.lex.o sh.misc.o sh.parse.o sh.print.o sh.proc.o sh.sem.o \ + sh.set.o +OV1= sh.o sh.exec.o sh.time.o +OV2= sh.exec2.o + +OBJS= ${BASE} ${OV1} ${OV2} + +LIBOBJS= ndbm.o getpwent.o + +# Special massaging of C files for sharing of strings +.c.o: + ${CC} -E ${CFLAGS} $*.c | ${XSTR} -c - + ${CC} -c ${CFLAGS} x.c + mv -f x.o $*.o + rm -f x.c + +# strings.o must be last since it can change when previous files compile +csh: ${OBJS} strings.o + ar x /lib/libc.a ${LIBOBJS} + rm -f csh + /bin/ld ${SEPFLAG} /lib/crt0.o ${BASE} \ + -Z ${OV1} \ + -Z ${OV2} ${LIBOBJS} \ + -Y strings.o -o csh ${LIBES}; + +.DEFAULT: + ${SCCS} get $< + +# need an old doprnt, whose output we can trap +doprnt11.o: doprnt11.s + ${CPP} doprnt11.s | ${SED} '/^#/d' | ${AS} -o doprnt11.o + +strings.o: strings + ${XSTR} + ${CC} -c xs.c + mv -f xs.o strings.o + rm -f xs.c + +lint: + lint -z ${DEFS} sh*.c alloc.c + +print: + @pr READ_ME + @pr Makefile Makefile.* + @(size -l a.out; size *.o) | pr -h SIZES + @${CXREF} sh*.c | pr -h XREF + @ls -l | pr + @pr sh*.h [a-rt-z]*.h sh*.c alloc.c + +vprint: + @pr -l84 READ_ME TODO + @pr -l84 Makefile Makefile.* + @(size -l a.out; size *.o) | pr -l84 -h SIZES + @${CXREF} sh*.c | pr -l84 -h XREF + @ls -l | pr -l84 + @${CXREF} sh*.c | pr -l84 -h XREF + @pr -l84 sh*.h [a-rt-z]*.h sh*.c alloc.c + +vgrind: + @cp /dev/null index + @-mkdir grind + for i in *.h; do ${VGRIND} -t -h "C Shell" $$i >grind/$$i.t; done + for i in *.c; do ${VGRIND} -t -h "C Shell" $$i >grind/$$i.t; done + ${VGRIND} -t -x -h Index index >grind/index.t + +install: csh + install -m 755 -o bin -g bin -s csh ${DESTDIR}/bin/csh + +clean: + ${RM} -f a.out strings x.c xs.c csh errs + ${RM} -f *.o + ${RM} -rf vgrind + +tags: *.h sh*.c + ${CTAGS} -t *.h sh*.c + +sh.o: sh.h sh.local.h sh.char.h +sh.char.o: sh.char.h +sh.dir.o: sh.h sh.local.h sh.dir.h +sh.dol.o: sh.h sh.local.h sh.char.h +sh.err.o: sh.h sh.local.h sh.char.h +sh.exec.o: sh.h sh.local.h sh.char.h +sh.exec2.o: sh.h sh.local.h sh.char.h +sh.exp.o: sh.h sh.local.h sh.char.h +sh.file.o: sh.h sh.local.h sh.char.h +sh.func.o: sh.h sh.local.h sh.char.h +sh.glob.o: sh.h sh.local.h sh.char.h +sh.hist.o: sh.h sh.local.h sh.char.h +sh.init.o: sh.local.h +sh.lex.o: sh.h sh.local.h sh.char.h +sh.misc.o: sh.h sh.local.h sh.char.h +sh.parse.o: sh.h sh.local.h sh.char.h +sh.print.o: sh.h sh.local.h sh.char.h +sh.proc.o: sh.h sh.local.h sh.dir.h sh.proc.h sh.char.h +sh.sem.o: sh.h sh.local.h sh.proc.h sh.char.h +sh.set.o: sh.h sh.local.h sh.char.h +sh.time.o: sh.h sh.local.h sh.char.h diff --git a/bin/csh/alloc.c b/bin/csh/alloc.c new file mode 100644 index 0000000..2ea7171 --- /dev/null +++ b/bin/csh/alloc.c @@ -0,0 +1,383 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if !defined(lint) && defined(DOSCCS) +/* From "@(#)malloc.c 5.5 (Berkeley) 2/25/86"; */ +static char *sccsid = "@(#)alloc.c 5.3 (Berkeley) 3/29/86"; +#endif + +/* + * malloc.c (Caltech) 2/21/82 + * Chris Kingsley, kingsley@cit-20. + * + * This is a very fast storage allocator. It allocates blocks of a small + * number of different sizes, and keeps free lists of each size. Blocks that + * don't exactly fit are passed up to the next larger size. In this + * implementation, the available sizes are 2^n-4 (or 2^n-10) bytes long. + * This is designed for use in a virtual memory environment. + */ + +#include + +#define NULL 0 + +/* + * The overhead on a block is at least 4 bytes. When free, this space + * contains a pointer to the next free block, and the bottom two bits must + * be zero. When in use, the first byte is set to MAGIC, and the second + * byte is the size index. The remaining bytes are for alignment. + * If range checking is enabled then a second word holds the size of the + * requested block, less 1, rounded up to a multiple of sizeof(RMAGIC). + * The order of elements is critical: ov_magic must overlay the low order + * bits of ov_next, and ov_magic can not be a valid ov_next bit pattern. + */ +union overhead { + union overhead *ov_next; /* when free */ + struct { + u_char ovu_magic; /* magic number */ + u_char ovu_index; /* bucket # */ +#ifdef RCHECK + u_short ovu_rmagic; /* range magic number */ + u_int ovu_size; /* actual block size */ +#endif + } ovu; +#define ov_magic ovu.ovu_magic +#define ov_index ovu.ovu_index +#define ov_rmagic ovu.ovu_rmagic +#define ov_size ovu.ovu_size +}; + +#define MAGIC 0xef /* magic # on accounting info */ +#define RMAGIC 0x5555 /* magic # on range info */ + +#ifdef RCHECK +#define RSLOP sizeof (u_short) +#else +#define RSLOP 0 +#endif + +/* + * nextf[i] is the pointer to the next free block of size 2^(i+3). The + * smallest allocatable block is 8 bytes. The overhead information + * precedes the data area returned to the user. + */ +#define NBUCKETS 30 +static union overhead *nextf[NBUCKETS]; +extern char *sbrk(); + +static int pagesz; /* page size */ +static int pagebucket; /* page size bucket */ + +/* + * nmalloc[i] is the difference between the number of mallocs and frees + * for a given block size. + */ +static u_int nmalloc[NBUCKETS]; + +#if defined(DEBUG) || defined(RCHECK) +#define ASSERT(p) if (!(p)) botch("p") +static +botch(s) + char *s; +{ + printf("\r\nassertion botched: %s\r\n", s); + abort(); +} +#else +#define ASSERT(p) +#endif + +char * +malloc(nbytes) + unsigned nbytes; +{ + register union overhead *op; + register int bucket; + register unsigned amt, n; + + /* + * First time malloc is called, setup page size and + * align break pointer so all data will be page aligned. + */ + if (pagesz == 0) { + pagesz = n = getpagesize(); + op = (union overhead *)sbrk(0); + n = n - sizeof (*op) - ((int)op & (n - 1)); + if (n < 0) + n += pagesz; + if (n) { + if (sbrk(n) == (char *)-1) + return (NULL); + } + bucket = 0; + amt = 8; + while (pagesz > amt) { + amt <<= 1; + bucket++; + } + pagebucket = bucket; + } + /* + * Convert amount of memory requested into closest block size + * stored in hash buckets which satisfies request. + * Account for space used per block for accounting. + */ + if (nbytes <= (n = pagesz - sizeof (*op) - RSLOP)) { +#ifndef RCHECK + amt = 8; /* size of first bucket */ + bucket = 0; +#else + amt = 16; /* size of first bucket */ + bucket = 1; +#endif + n = -(sizeof (*op) + RSLOP); + } else { + amt = pagesz; + bucket = pagebucket; + } + while (nbytes > amt + n) { + amt <<= 1; + if (amt == 0) + return (NULL); + bucket++; + } + /* + * If nothing in hash bucket right now, + * request more memory from the system. + */ + if ((op = nextf[bucket]) == NULL) { + morecore(bucket); + if ((op = nextf[bucket]) == NULL) + return (NULL); + } + /* remove from linked list */ + nextf[bucket] = op->ov_next; + op->ov_magic = MAGIC; + op->ov_index = bucket; + nmalloc[bucket]++; +#ifdef RCHECK + /* + * Record allocated size of block and + * bound space with magic numbers. + */ + op->ov_size = (nbytes + RSLOP - 1) & ~(RSLOP - 1); + op->ov_rmagic = RMAGIC; + *(u_short *)((caddr_t)(op + 1) + op->ov_size) = RMAGIC; +#endif + return ((char *)(op + 1)); +} + +/* + * Allocate more memory to the indicated bucket. + */ +morecore(bucket) + int bucket; +{ + register union overhead *op; + register int sz; /* size of desired block */ + int amt; /* amount to allocate */ + int nblks; /* how many blocks we get */ + + /* + * sbrk_size <= 0 only for big, FLUFFY, requests (about + * 2^30 bytes on a VAX, I think) or for a negative arg. + */ + sz = 1 << (bucket + 3); +#ifdef DEBUG + ASSERT(sz > 0); +#else + if (sz <= 0) + return; +#endif + if (sz < pagesz) { + amt = pagesz; + nblks = amt / sz; + } else { + amt = sz + pagesz; + nblks = 1; + } + op = (union overhead *)sbrk(amt); + /* no more room! */ + if ((int)op == -1) + return; + /* + * Add new memory allocated to that on + * free list for this hash bucket. + */ + nextf[bucket] = op; + while (--nblks > 0) { + op->ov_next = (union overhead *)((caddr_t)op + sz); + op = (union overhead *)((caddr_t)op + sz); + } +} + +free(cp) + char *cp; +{ + register int size; + register union overhead *op; + + if (cp == NULL) + return; + op = (union overhead *)((caddr_t)cp - sizeof (union overhead)); + /* + * The following botch is because csh tries to free a free block + * when processing the =~ or !~ operators. -- layer@ucbmonet + */ +#ifdef CSHbotch /* was DEBUG */ + ASSERT(op->ov_magic == MAGIC); /* make sure it was in use */ +#else + if (op->ov_magic != MAGIC) + return; /* sanity */ +#endif +#ifdef RCHECK + ASSERT(op->ov_rmagic == RMAGIC); + ASSERT(*(u_short *)((caddr_t)(op + 1) + op->ov_size) == RMAGIC); +#endif + size = op->ov_index; + ASSERT(size < NBUCKETS); + op->ov_next = nextf[size]; /* also clobbers ov_magic */ + nextf[size] = op; + nmalloc[size]--; +} + +/* + * When a program attempts "storage compaction" as mentioned in the + * old malloc man page, it realloc's an already freed block. Usually + * this is the last block it freed; occasionally it might be farther + * back. We have to search all the free lists for the block in order + * to determine its bucket: 1st we make one pass thru the lists + * checking only the first block in each; if that fails we search + * ``realloc_srchlen'' blocks in each list for a match (the variable + * is extern so the caller can modify it). If that fails we just copy + * however many bytes was given to realloc() and hope it's not huge. + */ +int realloc_srchlen = 4; /* 4 should be plenty, -1 =>'s whole list */ + +char * +realloc(cp, nbytes) + char *cp; + unsigned nbytes; +{ + register u_int onb, i; + union overhead *op; + char *res; + int was_alloced = 0; + + if (cp == NULL) + return (malloc(nbytes)); + op = (union overhead *)((caddr_t)cp - sizeof (union overhead)); + if (op->ov_magic == MAGIC) { + was_alloced++; + i = op->ov_index; + } else { + /* + * Already free, doing "compaction". + * + * Search for the old block of memory on the + * free list. First, check the most common + * case (last element free'd), then (this failing) + * the last ``realloc_srchlen'' items free'd. + * If all lookups fail, then assume the size of + * the memory block being realloc'd is the + * largest possible (so that all "nbytes" of new + * memory are copied into). Note that this could cause + * a memory fault if the old area was tiny, and the moon + * is gibbous. However, that is very unlikely. + */ + if ((i = findbucket(op, 1)) < 0 && + (i = findbucket(op, realloc_srchlen)) < 0) + i = NBUCKETS; + } + onb = 1 << (i + 3); + if (onb < pagesz) + onb -= sizeof (*op) + RSLOP; + else + onb += pagesz - sizeof (*op) - RSLOP; + /* avoid the copy if same size block */ + if (was_alloced) { + if (i) { + i = 1 << (i + 2); + if (i < pagesz) + i -= sizeof (*op) + RSLOP; + else + i += pagesz - sizeof (*op) - RSLOP; + } + if (nbytes <= onb && nbytes > i) { +#ifdef RCHECK + op->ov_size = (nbytes + RSLOP - 1) & ~(RSLOP - 1); + *(u_short *)((caddr_t)(op + 1) + op->ov_size) = RMAGIC; +#endif + return(cp); + } else + free(cp); + } + if ((res = malloc(nbytes)) == NULL) + return (NULL); + if (cp != res) /* common optimization if "compacting" */ + bcopy(cp, res, (nbytes < onb) ? nbytes : onb); + return (res); +} + +/* + * Search ``srchlen'' elements of each free list for a block whose + * header starts at ``freep''. If srchlen is -1 search the whole list. + * Return bucket number, or -1 if not found. + */ +static +findbucket(freep, srchlen) + union overhead *freep; + int srchlen; +{ + register union overhead *p; + register int i, j; + + for (i = 0; i < NBUCKETS; i++) { + j = 0; + for (p = nextf[i]; p && j != srchlen; p = p->ov_next) { + if (p == freep) + return (i); + j++; + } + } + return (-1); +} + +/* + * mstats - print out statistics about malloc + * + * Prints two lines of numbers, one showing the length of the free list + * for each size category, the second showing the number of mallocs - + * frees for each size category. + */ +showall(s) +char **s; +{ + register int i, j; + register union overhead *p; + int totfree = 0, + totused = 0; + + if (s[1]) + printf("Memory allocation statistics %s\nfree:", s[1]); + for (i = 0; i < NBUCKETS; i++) { + for (j = 0, p = nextf[i]; p; p = p->ov_next, j++) + ; + if (s[1]) + printf(" %d", j); + totfree += j * (1 << (i + 3)); + } + if (s[1]) + printf("\nused:"); + for (i = 0; i < NBUCKETS; i++) { + if (s[1]) + printf(" %d", nmalloc[i]); + totused += nmalloc[i] * (1 << (i + 3)); + } + if (s[1]) + printf("\n"); + printf("Total in use: %d, total free: %d\n", totused, totfree); +} diff --git a/bin/csh/alloc11.c b/bin/csh/alloc11.c new file mode 100644 index 0000000..5923f10 --- /dev/null +++ b/bin/csh/alloc11.c @@ -0,0 +1,220 @@ +#if !defined(lint) && defined(DOSCCS) +static char *sccsid = "@(#)alloc.c 4.1 10/9/80"; +#endif + +#include "sh.local.h" +#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&&qptr = 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=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 + +showall(s) + char **s; +{ + register union store *p, *q; + int used = 0, free = 0, i; + + if (s[1]) + printf("Memory allocation statistics %s\n", s[1]); + for (p = clearbusy(allocs[1].ptr); p != alloct; p = q) { + q = clearbusy(p->ptr); + i = ((unsigned) q - (unsigned) p); + if (testbusy(p->ptr)) { + if (s[1]) + printf(" addr %06o, len %5d BUSY\n", + p, i); + used += i; + } else { + if (s[1]) + printf(" addr %06o, len %5d FREE\n", + p, i); + free += i; + } + } + printf("%d used, %d free, %l end\n", used, free, clearbusy(alloct)); +} diff --git a/bin/csh/doprnt.c b/bin/csh/doprnt.c new file mode 100644 index 0000000..1bdf61e --- /dev/null +++ b/bin/csh/doprnt.c @@ -0,0 +1,481 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley Software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if !defined(lint) && defined(DOSCCS) + .ascii "@(#)doprnt.c 5.2 (Berkeley) 6/6/85" +#endif + + # C library -- conversions + +.globl __doprnt +.globl __strout + +#define flags r10 +#define literb 0 +#define liter 1 +#define ndfndb 0 +#define ndfnd 1 +#define ljustb 1 +#define ljust 2 +#define zfillb 2 +#define zfill 4 +#define precb 3 +#define prec 8 +#define psignb 4 +#define psign 16 +#define gflagb 5 +#define gflag 32 +#define width r9 +#define ndigit r8 +#define fdesc -4(fp) +#define exp -8(fp) +#define sign -9(fp) + .set one,010 # 1.0 in floating immediate + .set ch.zer,'0 # cpp doesn't like single appostrophes + + .align 1 +__doprnt: + .word 0xfc0 # uses r11-r6 + subl2 $128,sp + movl 4(ap),r11 # addr of format string + movl 12(ap),fdesc # output FILE ptr + movl 8(ap),ap # addr of first arg +loop: + movl r11,r0 # current point in format + bicl2 $liter,flags # no literal characters yet +L1: movb (r11)+,width # next character of format + beql L2 # end of format string + cmpb width,$'% + beql L2 # warning character + bisl2 $liter,flags # literal character + jbr L1 +L2: blbc flags,L3 # bbc $literb,flags,L3 # no literals in format + pushl fdesc # file pointer + pushl $0 # no left/right adjust + pushl r0 # addr + subl3 r0,r11,r1 # length + subl3 $1,r1,-(sp) # % or null not part of literal + calls $4,__strout # dump the literal +L3: + blbs width,L4 # % is odd; end of format? + ret # yes + + # htab overlaps last 16 characters of ftab +ftab: .byte 0, 0, 0,'c,'d,'e,'f,'g, 0, 0, 0,'+,'l,'-,'.,'o +htab: .byte '0,'1,'2,'3,'4,'5,'6,'7,'8,'9,'a,'b,'c,'d,'e,'f + +L4: movl sp,r5 # reset output buffer pointer + clrq r9 # width; flags ljustb,ndfndb,zfillb +L4a: movzbl (r11)+,r0 # supposed format + extzv $0,$5,r0,r1 # bottom 5 bits +L4b: cmpb r0,ftab[r1] # good enough? + jneq L6 # no +L4c: casel r1,$3,$22 # yes +L5: .word charac-L5 # c + .word decimal-L5 # d + .word scien-L5 # e + .word float-L5 # f + .word general-L5 # g + .word L6-L5 # h + .word L6-L5 # i + .word L6-L5 # j + .word plus-L5 # + + .word longorunsg-L5 # l + .word minus-L5 # - + .word dot-L5 # . + .word octal-L5 # o + .word gnum0-L5 # 0 + .word gnum-L5 # 1 + .word gnum-L5 # 2 + .word gnum-L5 # 3 + .word gnum-L5 # 4 + .word gnum-L5 # 5 + .word gnum-L5 # 6 + .word gnum-L5 # 7 + .word gnum-L5 # 8 + .word gnum-L5 # 9 + +L6: jbcs $5,r0,L4b # capitals same as small + cmpb r0,$'s + jeql string + cmpb r0,$'x + jeql hex + cmpb r0,$'u + jeql unsigned + cmpb r0,$'r + jeql remote + movzbl -1(r11),r0 # orginal "format" character + cmpb r0,$'* + jeql indir +L9: movb r0,(r5)+ # print the unfound character + jbr prbuf + +nulstr: + .byte '(,'n,'u,'l,'l,'),0 + +string: + movl ndigit,r0 + jbs $precb,flags,L20 # max length was specified + mnegl $1,r0 # default max length +L20: movl (ap)+,r2 # addr first byte + bneq L21 + movab nulstr,r2 +L21: locc $0,r0,(r2) # find the zero at the end + movl r1,r5 # addr last byte +1 + movl r2,r1 # addr first byte + jbr prstr + + +longorunsg: + movb (r11)+,r0 + cmpb r0,$'o + jeql loct + cmpb r0,$'x + jeql lhex + cmpb r0,$'d + jeql long + cmpb r0,$'u + jeql lunsigned + decl r11 + jbr unsigned + +loct: +octal: + movl $30,r2 # init position + movl $3,r3 # field width + movl $10,r4 # result length -1 + jbr L10 + +lhex: +hex: + movl $28,r2 # init position + movl $4,r3 # field width + movl $7,r4 # result length -1 +L10: mnegl r3,r6 # increment + clrl r1 + movl (ap)+,r0 # fetch arg +L11: extzv r2,r3,r0,r1 # pull out a digit + movb htab[r1],(r5)+ # convert to character +L12: acbl $0,r6,r2,L11 # continue until done + clrb (r5) # flag end + skpc $'0,r4,(sp) # skip over leading zeroes + jbr prstr + +patdec: # editpc pattern for decimal printing + .byte 0xA9 # eo$float 9 + .byte 0x01 # eo$end_float + .byte 0x91 # eo$move 1 + .byte 0 # eo$end + +long: +decimal: + cvtlp (ap)+,$10,(sp) # 10 digits max +L14: editpc $10,(sp),patdec,8(sp) # ascii at 8(sp); r5=end+1 + skpc $' ,$10,8(sp) # skip leading blanks; r1=first + +prstr: # r1=addr first byte; r5=addr last byte +1 + cvtbl $' ,-(sp) # blank fill + jbc $zfillb,flags,L15 + cvtbl $'0,(sp) # zero fill +L15: pushl fdesc # FILE + subl2 r1,r5 # r5=actual length=end+1-first + subl3 r5,width,r0 # if >0, how much to fill + bgeq L24 + clrl r0 # no fill +L24: jbs $ljustb,flags,L25 + mnegl r0,r0 +L25: pushl r0 # fill count + pushl r1 # addr first byte + pushl r5 # length + calls $5,__strout + jbr loop + +pone: .byte 0x1C # packed 1 + +unsigned: +lunsigned: + extzv $1,$31,(ap),r0 # right shift logical 1 bit + cvtlp r0,$10,(sp) # convert [n/2] to packed + movp $10,(sp),8(sp) # copy packed + addp4 $10,8(sp),$10,(sp) # 2*[n/2] in packed, at (sp) + blbc (ap)+,L14 # n was even + addp4 $1,pone,$10,(sp) # n was odd + jbr L14 + +charac: + movl $4,r0 # chars per word +L18: movb (ap)+,(r5)+ # transfer char + bneq L19 + decl r5 # omit null characters +L19: sobgtr r0,L18 + +prbuf: + movl sp,r1 # addr first byte + jbr prstr + +plus: bisl2 $psign,flags # always print sign for floats + jbr L4a +minus: bisl2 $ljust,flags # left justification, please + jbr L4a +gnum0: jbs $ndfndb,flags,gnum + jbs $precb,flags,gnump # ignore when reading precision + bisl2 $zfill,flags # leading zero fill, please +gnum: jbs $precb,flags,gnump + moval (width)[width],width # width *= 5; + movaw -ch.zer(r0)[width],width # width = 2*witdh + r0 - '0'; + jbr gnumd +gnump: moval (ndigit)[ndigit],ndigit # ndigit *= 5; + movaw -ch.zer(r0)[ndigit],ndigit # ndigit = 2*ndigit + r0 - '0'; +gnumd: bisl2 $ndfnd,flags # digit seen + jbr L4a +dot: clrl ndigit # start on the precision + bisl2 $prec,flags + bicl2 $ndfnd,flags + jbr L4a +indir: movl (ap)+,ndigit # width specified by parameter + jbr gnumd +remote: movl (ap)+,ap + movl (ap)+,r11 + jbr loop + +float: + bsbw fltcvt +fltg: jbs $ndfndb,flags,float1 + movl $6,ndigit # default # digits to right of decpt. +float1: addl3 exp,ndigit,r7 + movl r7,r6 # for later "underflow" checking + bgeq fxplrd + clrl r7 # poor programmer planning +fxplrd: cmpl r7,$31 # expressible in packed decimal? + bleq fnarro # yes + movl $31,r7 +fnarro: subl3 $17,r7,r0 # where to round + ashp r0,$17,(sp),$5,r7,16(sp) # do it + bvc fnovfl + # band-aid for microcode error (spurious overflow) + clrl r0 # assume even length result + jlbc r7,fleven # right + movl $4,r0 # odd length result +fleven: cmpv r0,$4,16(sp),$0 # top digit zero iff true overflow + bneq fnovfl + # end band-aid + aobleq $0,r6,fnovfl # if "underflow" then jump + movl r7,r0 + incl exp + incl r7 + ashp r0,$1,pone,$0,r7,16(sp) + ashl $-1,r7,r0 # displ to last byte + bisb2 sign,16(sp)[r0] # insert sign +fnovfl: + movc3 $4,patsci,(sp) + clrl r6 # # digits moved so far + movl exp,r0 + bleq fexpng + bsbb patmov # digits to left of decpt. +fexpng: tstl ndigit + jeql fnodp + movc3 $2,fpatdp,(r3) + tstl exp + bgeq fxppos + addl3 exp,ndigit,r6 + bgeq flfakl + clrl r6 # it's all fill +flfakl: subl3 r6,$31,r6 # fake length for patmov +flfill: movc3 $2,fpatzf,(r3) # zero fill to right of dec.pt +fxppos: movl ndigit,r0 + bsbb patmov +fnodp: sobgeq r6,fledit # must move at least 1 digit + movl $31,r6 # none moved; fake it + aobleq $1,ndigit,flfill # with a one-character zero fill +fledit: editpc r7,16(sp),(sp),32(sp) + jbr prflt + +patexp: .byte 0x03 # eo$set_signif + .byte 0x44,'e # eo$insert 'e + .byte 0x42,'+ # eo$load_plus '+ + .byte 0x04 # eo$store_sign + .byte 0x92 # eo$move 2 + .byte 0 # eo$end +patsci: .byte 0x42,'+ # eo$load_plus '+ + .byte 0x03 # eo$set_signif + .byte 0x04 # eo$store_sign + .byte 0x91 # eo$move 1 +fpatdp: .byte 0x44,'. # eo$insert '. +fpatzf: .byte 0x40,'0 # eo$load_fill '0 + + # construct pattern at (r3) to move r0 digits in editpc; + # r6 digits already moved for this number +patmov: + movb $0x90,r2 # eo$move + subl3 r6,$31,r1 # # digits remaining in packed + addl2 r0,r6 + cmpl r0,r1 # enough digits remaining? + bleq patsml # yes + tstl exp # zero 'fill'; before or after rest? + bgeq pataft # after + pushl r1 # # digits remaining + movb $0x80,r2 # eo$fill + subl3 $31,r6,r0 # number of fill bytes + bsbb patsml # recursion! + movl (sp)+,r0 + movb $0x90,r2 # eo$move + jbr patsml +pataft: movl r1,r0 # last of the 31 + bsbb patsml # recursion! + subl3 $31,r6,r0 # number of fill bytes + movb $0x80,r2 # eo$fill +patsml: tstl r0 + bleq patzer # DEC doesn't like repetition counts of 0 + mnegl $15,r1 # 15 digits at a time + subl2 r1,r0 # counteract acbl + jbr pattst +patmlp: bisb3 r2,$15,(r3)+ # 15 +pattst: acbl $16,r1,r0,patmlp # until <= 15 left + bisb3 r2,r0,(r3)+ # rest +patzer: clrb (r3) # eo$end + rsb + +scien: + bsbw fltcvt # get packed digits +scig: incl ndigit + jbs $ndfndb,flags,L23 + movl $7,ndigit +L23: subl3 $17,ndigit,r0 # rounding position + ashp r0,$17,(sp),$5,ndigit,16(sp) # shift and round + bvc snovfl + # band-aid for microcode error (spurious overflow) + clrl r0 # assume even length result + jlbc ndigit,sceven # right + movl $4,r0 # odd length result +sceven: cmpv r0,$4,16(sp),$0 # top digit zero iff true overflow + bneq snovfl + # end band-aid + incl exp # rounding overflowed to 100... + subl3 $1,ndigit,r0 + ashp r0,$1,pone,$0,ndigit,16(sp) + ashl $-1,ndigit,r0 # displ to last byte + bisb2 sign,16(sp)[r0] # insert sign +snovfl: + jbc $gflagb,flags,enotg # not %g format + # find trailing zeroes in packed number + ashl $-1,ndigit,r0 + addl2 r3,r0 # addr of l.s.digit and sign + movl $4,r1 # bit position of digit + movl ndigit,r7 # current length of packed + jbr gtz +gtz1: xorl2 $4,r1 # position of next digit + bneq gtz # same byte + decl r0 # different byte +gtz: cmpv r1,$4,(r0),$0 # a trailing zero? + jneq gntz + sobgtr r7,gtz1 + incl r7 +gntz: # r7: minimum width of fraction + cmpl exp,$-4 + jleq eg # small exponents use %e + subl3 r7,exp,r0 + cmpl $5,r0 + jleq eg # so do (w+5) <= exp + tstl r0 # rest use %f + jleq fg # did we trim too many trailing zeroes? + movl exp,r7 # yes +fg: subl3 ndigit,r7,r0 + ashp r0,ndigit,16(sp),$0,r7,(sp) + movp r7,(sp),16(sp) + subl3 exp,r7,ndigit # correct ndigit for %f + jbr fnovfl +eg: subl3 ndigit,r7,r0 + ashp r0,ndigit,16(sp),$0,r7,(sp) + movp r7,(sp),16(sp) + movl r7,ndigit # packed number has been trimmed +enotg: + movc3 $7,patsci,(sp) + movl $1,r6 # 1P + subl3 $1,ndigit,r0 # digits after dec.pt + bsbw patmov + editpc ndigit,16(sp),(sp),32(sp) # 32(sp)->result, r5->(end+1) + decl exp # compensate: 1 digit left of dec.pt + cvtlp exp,$2,(sp) # exponent + editpc $2,(sp),patexp,(r5) +prflt: movab 32(sp),r1 + jbs $psignb,flags,prflt1 + cmpb (r1)+,$'+ + beql prflt1 + decl r1 +prflt1: skpc $' ,$63,(r1) + jbr prstr + +general: + jbcs $gflagb,flags,scien + jbr scien # safety net + + # convert double-floating at (ap) to 17-digit packed at (sp), + # set 'sign' and 'exp', advance ap. +fltcvt: + clrb sign + movd (ap)+,r5 + jeql fzero + bgtr fpos + mnegd r5,r5 + incb sign +fpos: + extzv $7,$8,r5,r2 # exponent of 2 + movaw -0600(r2)[r2],r2 # unbias and mult by 3 + bgeq epos + subl2 $9,r2 +epos: divl2 $10,r2 + bsbb expten + cmpd r0,r5 + bgtr ceil + incl r2 +ceil: movl r2,exp + mnegl r2,r2 + cmpl r2,$29 # 10^(29+9) is all we can handle + bleq getman + muld2 ten16,r5 + subl2 $16,r2 +getman: addl2 $9,r2 # -ceil(log10(x)) + 9 + bsbb expten + emodd r0,r4,r5,r0,r5 # (r0+r4)*r5; r0=int, r5=frac +fz1: cvtlp r0,$9,16(sp) # leading 9 digits + ashp $8,$9,16(sp),$0,$17,4(sp) # as top 9 of 17 + emodd ten8,$0,r5,r0,r5 + cvtlp r0,$8,16(sp) # trailing 8 digits + addp4 $8,16(sp),$17,4(sp) # combine leading and trailing + bisb2 sign,12(sp) # and insert sign + rsb +fzero: clrl r0 + movl $1,exp # 0.000e+00 and 0.000 rather than 0.000e-01 and .000 + jbr fz1 + + # return 10^r2 as a double float in r0||r1 and 8 extra bits of precision in r4 + # preserve r2, r5||r6 +expten: + movd $one,r0 # begin computing 10^exp10 + clrl r4 # bit counter + movad ten1,r3 # table address + tstl r2 + bgeq e10lp + mnegl r2,r2 # get absolute value + jbss $6,r2,e10lp # flag as negative +e10lp: jbc r4,r2,el1 # want this power? + muld2 (r3),r0 # yes +el1: addl2 $8,r3 # advance to next power + aobleq $5,r4,e10lp # through 10^32 + jbcc $6,r2,el2 # correct for negative exponent + divd3 r0,$one,r0 # by taking reciprocal + mnegl r2,r2 +el2: clrl r4 # 8 extra bits of precision + rsb + + # powers of ten + .align 2 +ten1: .word 0x4220,0,0,0 +ten2: .word 0x43c8,0,0,0 +ten4: .word 0x471c,0x4000,0,0 +ten8: .word 0x4dbe,0xbc20,0,0 +ten16: .word 0x5b0e,0x1bc9,0xbf04,0 +ten32: .word 0x759d,0xc5ad,0xa82b,0x70b6 diff --git a/bin/csh/doprnt11.s b/bin/csh/doprnt11.s new file mode 100644 index 0000000..2cb9d11 --- /dev/null +++ b/bin/csh/doprnt11.s @@ -0,0 +1,303 @@ +#ifdef LIBC_SCCS + <@(#)doprnt.s 5.4 (Berkeley) 1/25/87\0> + .even +#endif LIBC_SCCS + +/* + * doprnt(fmt, argl, iop) + * char *fmt, *argl; + * FILE *iop; + * + * Output argl to iop using fmt - implements printf, etc. Special version of + * doprnt for csh which doesn't need any floating point support. + */ + +.data +nulstr: + <(null)\0> + .even +swtab: + decimal; 'd + octal; 'o + hex; 'x + charac; 'c + string; 's + longorunsg; 'l + longorunsg; 'L + unsigned; 'u + remote; 'r + long; 'D + loct; 'O + lhex; 'X + lunsigned; 'U + 0; 0 +.text + +.globl __strout, csv, cret + +width = -10. +formp = -12. +rjust = -14. +ndfnd = -16. +ndigit = -18. +zfill = -20. + +.globl __doprnt +__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 r0,-(sp) / string + mov r3,-(sp) / count + sub 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) + +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 + +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 r2,-(sp) / string + mov r3,-(sp) / count + 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 diff --git a/bin/csh/printf.c b/bin/csh/printf.c new file mode 100644 index 0000000..352fd46 --- /dev/null +++ b/bin/csh/printf.c @@ -0,0 +1,44 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley Software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if !defined(lint) && defined(DOSCCS) +static char *sccsid = "@(#)printf.c 5.2 (Berkeley) 6/6/85"; +#endif + +/* + * Hacked "printf" which prints through putchar. + * DONT USE WITH STDIO! + */ +printf(fmt, args) +char *fmt; +{ + _doprnt(fmt, &args, 0); +} + +_strout(count, string, adjust, foo, fillch) +register char *string; +register int count; +int adjust; +register struct { int a[6]; } *foo; +{ + + if (foo != 0) + abort(); + while (adjust < 0) { + if (*string=='-' && fillch=='0') { + putchar(*string++); + count--; + } + putchar(fillch); + adjust++; + } + while (--count>=0) + putchar(*string++); + while (adjust) { + putchar(fillch); + adjust--; + } +} diff --git a/bin/csh/sh.c b/bin/csh/sh.c new file mode 100644 index 0000000..4a9ccdd --- /dev/null +++ b/bin/csh/sh.c @@ -0,0 +1,939 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley Software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if !defined(lint) && defined(DOSCCS) +static char *sccsid = "@(#)sh.c 5.3 (Berkeley) 3/29/86"; +#endif + +#include "sh.h" +#include +/* + * C Shell + * + * Bill Joy, UC Berkeley, California, USA + * October 1978, May 1980 + * + * Jim Kulp, IIASA, Laxenburg, Austria + * April 1980 + */ + +char *pathlist[] = { ".", "/usr/ucb", "/bin", "/usr/bin", 0 }; +char *dumphist[] = { "history", "-h", 0, 0 }; +char *loadhist[] = { "source", "-h", "~/.history", 0 }; +char HIST = '!'; +char HISTSUB = '^'; +bool nofile; +bool reenter; +bool nverbose; +bool nexececho; +bool quitit; +bool fast; +bool batch; +bool prompt = 1; +bool enterhist = 0; + +extern gid_t getegid(), getgid(); +extern uid_t geteuid(), getuid(); + +main(c, av) + int c; + char **av; +{ + register char **v, *cp; + register int f; + struct sigvec osv; + + settimes(); /* Immed. estab. timing base */ + v = av; + if (eq(v[0], "a.out")) /* A.out's are quittable */ + quitit = 1; + uid = getuid(); + loginsh = **v == '-' && c == 1; + if (loginsh) + (void) time(&chktim); + + /* + * Move the descriptors to safe places. + * The variable didfds is 0 while we have only FSH* to work with. + * When didfds is true, we have 0,1,2 and prefer to use these. + */ + initdesc(); + + /* + * Initialize the shell variables. + * ARGV and PROMPT are initialized later. + * STATUS is also munged in several places. + * CHILD is munged when forking/waiting + */ + + set("status", "0"); + dinit(cp = getenv("HOME")); /* dinit thinks that HOME == cwd in a + * login shell */ + if (cp == NOSTR) + fast++; /* No home -> can't read scripts */ + else + set("home", savestr(cp)); + /* + * Grab other useful things from the environment. + * Should we grab everything?? + */ + if ((cp = getenv("USER")) != NOSTR) + set("user", savestr(cp)); + if ((cp = getenv("TERM")) != NOSTR) + set("term", savestr(cp)); + /* + * Re-initialize path if set in environment + */ + if ((cp = getenv("PATH")) == NOSTR) + set1("path", saveblk(pathlist), &shvhed); + else + importpath(cp); + set("shell", SHELLPATH); + + doldol = putn(getpid()); /* For $$ */ + shtemp = strspl("/tmp/sh", doldol); /* For << */ + + /* + * Record the interrupt states from the parent process. + * If the parent is non-interruptible our hand must be forced + * or we (and our children) won't be either. + * Our children inherit termination from our parent. + * We catch it only if we are the login shell. + */ + /* parents interruptibility */ + (void) sigvec(SIGINT, (struct sigvec *)0, &osv); + parintr = osv.sv_handler; + /* parents terminability */ + (void) sigvec(SIGTERM, (struct sigvec *)0, &osv); + parterm = osv.sv_handler; + if (loginsh) { + (void) signal(SIGHUP, phup); /* exit processing on HUP */ + (void) signal(SIGXCPU, phup); /* ...and on XCPU */ + (void) signal(SIGXFSZ, phup); /* ...and on XFSZ */ + } + + /* + * Process the arguments. + * + * Note that processing of -v/-x is actually delayed till after + * script processing. + */ + c--, v++; + while (c > 0 && (cp = v[0])[0] == '-' && *++cp != '\0' && !batch) { + do switch (*cp++) { + + case 'b': /* -b Next arg is input file */ + batch++; + break; + + case 'c': /* -c Command input from arg */ + if (c == 1) + exit(0); + c--, v++; + arginp = v[0]; + prompt = 0; + nofile++; + break; + + case 'e': /* -e Exit on any error */ + exiterr++; + break; + + case 'f': /* -f Fast start */ + fast++; + break; + + case 'i': /* -i Interactive, even if !intty */ + intact++; + nofile++; + break; + + case 'n': /* -n Don't execute */ + noexec++; + break; + + case 'q': /* -q (Undoc'd) ... die on quit */ + quitit = 1; + break; + + case 's': /* -s Read from std input */ + nofile++; + break; + + case 't': /* -t Read one line from input */ + onelflg = 2; + prompt = 0; + nofile++; + break; + + case 'v': /* -v Echo hist expanded input */ + nverbose = 1; /* ... later */ + break; + + case 'x': /* -x Echo just before execution */ + nexececho = 1; /* ... later */ + break; + + case 'V': /* -V Echo hist expanded input */ + setNS("verbose"); /* NOW! */ + break; + + case 'X': /* -X Echo just before execution */ + setNS("echo"); /* NOW! */ + break; + + } while (*cp); + v++, c--; + } + + if (quitit) /* With all due haste, for debugging */ + (void) signal(SIGQUIT, SIG_DFL); + + /* + * Unless prevented by -c, -i, -s, or -t, if there + * are remaining arguments the first of them is the name + * of a shell file from which to read commands. + */ + if (nofile == 0 && c > 0) { + nofile = open(v[0], 0); + if (nofile < 0) { + child++; /* So this ... */ + Perror(v[0]); /* ... doesn't return */ + } + file = v[0]; + SHIN = dmove(nofile, FSHIN); /* Replace FSHIN */ + (void) ioctl(SHIN, FIOCLEX, (char *)0); + prompt = 0; + c--, v++; + } + if (!batch && (uid != geteuid() || getgid() != getegid())) { + errno = EACCES; + child++; /* So this ... */ + Perror("csh"); /* ... doesn't return */ + } + /* + * Consider input a tty if it really is or we are interactive. + */ + intty = intact || isatty(SHIN); + /* + * Decide whether we should play with signals or not. + * If we are explicitly told (via -i, or -) or we are a login + * shell (arg0 starts with -) or the input and output are both + * the ttys("csh", or "csh/dev/ttyx") + * Note that in only the login shell is it likely that parent + * may have set signals to be ignored + */ + if (loginsh || intact || intty && isatty(SHOUT)) + setintr = 1; +#ifdef TELL + settell(); +#endif + /* + * Save the remaining arguments in argv. + */ + setq("argv", v, &shvhed); + + /* + * Set up the prompt. + */ + if (prompt) + set("prompt", uid == 0 ? "# " : "% "); + + /* + * If we are an interactive shell, then start fiddling + * with the signals; this is a tricky game. + */ + shpgrp = getpgrp(0); + opgrp = tpgrp = -1; + oldisc = -1; + if (setintr) { + **av = '-'; + if (!quitit) /* Wary! */ + (void) signal(SIGQUIT, SIG_IGN); + (void) signal(SIGINT, pintr); + (void) sigblock(sigmask(SIGINT)); + (void) signal(SIGTERM, SIG_IGN); + if (quitit == 0 && arginp == 0) { + (void) signal(SIGTSTP, SIG_IGN); + (void) signal(SIGTTIN, SIG_IGN); + (void) signal(SIGTTOU, SIG_IGN); + /* + * Wait till in foreground, in case someone + * stupidly runs + * csh & + * dont want to try to grab away the tty. + */ + if (isatty(FSHDIAG)) + f = FSHDIAG; + else if (isatty(FSHOUT)) + f = FSHOUT; + else if (isatty(OLDSTD)) + f = OLDSTD; + else + f = -1; +retry: + if (ioctl(f, TIOCGPGRP, (char *)&tpgrp) == 0 && + tpgrp != -1) { + int ldisc; + if (tpgrp != shpgrp) { + int (*old)() = signal(SIGTTIN, SIG_DFL); + (void) kill(0, SIGTTIN); + (void) signal(SIGTTIN, old); + goto retry; + } + if (ioctl(f, TIOCGETD, (char *)&oldisc) != 0) + goto notty; + if (oldisc != NTTYDISC) { +#ifdef DEBUG + printf("Switching to new tty driver...\n"); +#endif DEBUG + ldisc = NTTYDISC; + (void) ioctl(f, TIOCSETD, + (char *)&ldisc); + } else + oldisc = -1; + opgrp = shpgrp; + shpgrp = getpid(); + tpgrp = shpgrp; + (void) ioctl(f, TIOCSPGRP, (char *)&shpgrp); + (void) setpgrp(0, shpgrp); + (void) ioctl(dcopy(f, FSHTTY), FIOCLEX, + (char *)0); + } else { +notty: + printf("Warning: no access to tty; thus no job control in this shell...\n"); + tpgrp = -1; + } + } + } + if (setintr == 0 && parintr == SIG_DFL) + setintr++; + (void) signal(SIGCHLD, pchild); /* while signals not ready */ + + /* + * Set an exit here in case of an interrupt or error reading + * the shell start-up scripts. + */ + setexit(); + haderr = 0; /* In case second time through */ + if (!fast && reenter == 0) { + reenter++; + /* Will have value("home") here because set fast if don't */ + srccat(value("home"), "/.cshrc"); + if (!fast && !arginp && !onelflg && !havhash) + dohash(); + if (loginsh) { + srccat(value("home"), "/.login"); + } + dosource(loadhist); + } + + /* + * Now are ready for the -v and -x flags + */ + if (nverbose) + setNS("verbose"); + if (nexececho) + setNS("echo"); + + /* + * All the rest of the world is inside this call. + * The argument to process indicates whether it should + * catch "error unwinds". Thus if we are a interactive shell + * our call here will never return by being blown past on an error. + */ + process(setintr); + + /* + * Mop-up. + */ + if (loginsh) { + printf("logout\n"); + (void) close(SHIN); + child++; + goodbye(); + } + rechist(); + exitstat(); +} + +untty() +{ + + if (tpgrp > 0) { + (void) setpgrp(0, opgrp); + (void) ioctl(FSHTTY, TIOCSPGRP, (char *)&opgrp); + if (oldisc != -1 && oldisc != NTTYDISC) { +#ifdef DEBUG + printf("\nReverting to old tty driver...\n"); +#endif DEBUG + (void) ioctl(FSHTTY, TIOCSETD, (char *)&oldisc); + } + } +} + +importpath(cp) + char *cp; +{ + register int i = 0; + register char *dp; + register char **pv; + int c; + static char dot[2] = {'.', 0}; + + for (dp = cp; *dp; dp++) + if (*dp == ':') + i++; + /* + * i+2 where i is the number of colons in the path. + * There are i+1 directories in the path plus we need + * room for a zero terminator. + */ + pv = (char **) calloc((unsigned) (i + 2), sizeof (char **)); + dp = cp; + i = 0; + if (*dp) + for (;;) { + if ((c = *dp) == ':' || c == 0) { + *dp = 0; + pv[i++] = savestr(*cp ? cp : dot); + if (c) { + cp = dp + 1; + *dp = ':'; + } else + break; + } + dp++; + } + pv[i] = 0; + set1("path", pv, &shvhed); +} + +/* + * Source to the file which is the catenation of the argument names. + */ +srccat(cp, dp) + char *cp, *dp; +{ + register char *ep = strspl(cp, dp); + register int unit = dmove(open(ep, 0), -1); + + (void) ioctl(unit, FIOCLEX, (char *)0); + xfree(ep); +#ifdef INGRES + srcunit(unit, 0, 0); +#else + srcunit(unit, 1, 0); +#endif +} + +/* + * Source to a unit. If onlyown it must be our file or our group or + * we don't chance it. This occurs on ".cshrc"s and the like. + */ +srcunit(unit, onlyown, hflg) + register int unit; + bool onlyown; + bool hflg; +{ + /* We have to push down a lot of state here */ + /* All this could go into a structure */ + int oSHIN = -1, oldintty = intty; + struct whyle *oldwhyl = whyles; + char *ogointr = gointr, *oarginp = arginp; + char *oevalp = evalp, **oevalvec = evalvec; + int oonelflg = onelflg; + bool oenterhist = enterhist; + char OHIST = HIST; +#ifdef TELL + bool otell = cantell; +#endif + struct Bin saveB; + + /* The (few) real local variables */ + jmp_buf oldexit; + int reenter; + long omask; + + if (unit < 0) + return; + if (didfds) + donefds(); + if (onlyown) { + struct stat stb; + + if (fstat(unit, &stb) < 0 || + (stb.st_uid != uid && stb.st_gid != getgid())) { + (void) close(unit); + return; + } + } + + /* + * There is a critical section here while we are pushing down the + * input stream since we have stuff in different structures. + * If we weren't careful an interrupt could corrupt SHIN's Bin + * structure and kill the shell. + * + * We could avoid the critical region by grouping all the stuff + * in a single structure and pointing at it to move it all at + * once. This is less efficient globally on many variable references + * however. + */ + getexit(oldexit); + reenter = 0; + if (setintr) + omask = sigblock(sigmask(SIGINT)); + setexit(); + reenter++; + if (reenter == 1) { + /* Setup the new values of the state stuff saved above */ + copy((char *)&saveB, (char *)&B, sizeof saveB); + fbuf = (char **) 0; + fseekp = feobp = fblocks = 0; + oSHIN = SHIN, SHIN = unit, arginp = 0, onelflg = 0; + intty = isatty(SHIN), whyles = 0, gointr = 0; + evalvec = 0; evalp = 0; + enterhist = hflg; + if (enterhist) + HIST = '\0'; + /* + * Now if we are allowing commands to be interrupted, + * we let ourselves be interrupted. + */ + if (setintr) + (void) sigsetmask(omask); +#ifdef TELL + settell(); +#endif + process(0); /* 0 -> blow away on errors */ + } + if (setintr) + (void) sigsetmask(omask); + if (oSHIN >= 0) { + register int i; + + /* We made it to the new state... free up its storage */ + /* This code could get run twice but xfree doesn't care */ + for (i = 0; i < fblocks; i++) + xfree(fbuf[i]); + xfree((char *)fbuf); + + /* Reset input arena */ + copy((char *)&B, (char *)&saveB, sizeof B); + + (void) close(SHIN), SHIN = oSHIN; + arginp = oarginp, onelflg = oonelflg; + evalp = oevalp, evalvec = oevalvec; + intty = oldintty, whyles = oldwhyl, gointr = ogointr; + if (enterhist) + HIST = OHIST; + enterhist = oenterhist; +#ifdef TELL + cantell = otell; +#endif + } + + resexit(oldexit); + /* + * If process reset() (effectively an unwind) then + * we must also unwind. + */ + if (reenter >= 2) + error(NOSTR); +} + +rechist() +{ + char buf[BUFSIZ]; + int fp, ftmp, oldidfds; + + if (!fast) { + if (value("savehist")[0] == '\0') + return; + (void) strcpy(buf, value("home")); + (void) strcat(buf, "/.history"); + fp = creat(buf, 0666); + if (fp == -1) + return; + oldidfds = didfds; + didfds = 0; + ftmp = SHOUT; + SHOUT = fp; + (void) strcpy(buf, value("savehist")); + dumphist[2] = buf; + dohist(dumphist); + (void) close(fp); + SHOUT = ftmp; + didfds = oldidfds; + } +} + +goodbye() +{ + if (loginsh) { + (void) signal(SIGQUIT, SIG_IGN); + (void) signal(SIGINT, SIG_IGN); + (void) signal(SIGTERM, SIG_IGN); + setintr = 0; /* No interrupts after "logout" */ + if (adrof("home")) + srccat(value("home"), "/.logout"); + } + rechist(); + exitstat(); +} + +exitstat() +{ + +#ifdef PROF + monitor(0); +#endif + /* + * Note that if STATUS is corrupted (i.e. getn bombs) + * then error will exit directly because we poke child here. + * Otherwise we might continue unwarrantedly (sic). + */ + child++; + exit(getn(value("status"))); +} + +/* + * in the event of a HUP we want to save the history + */ +phup() +{ + rechist(); + exit(1); +} + +char *jobargv[2] = { "jobs", 0 }; +/* + * Catch an interrupt, e.g. during lexical input. + * If we are an interactive shell, we reset the interrupt catch + * immediately. In any case we drain the shell output, + * and finally go through the normal error mechanism, which + * gets a chance to make the shell go away. + */ +pintr() +{ + pintr1(1); +} + +pintr1(wantnl) + bool wantnl; +{ + register char **v; + long omask; + + omask = sigblock(0L); + if (setintr) { + (void) sigsetmask(omask & ~sigmask(SIGINT)); + if (pjobs) { + pjobs = 0; + printf("\n"); + dojobs(jobargv); + bferr("Interrupted"); + } + } + (void) sigsetmask(omask & ~sigmask(SIGCHLD)); + draino(); + + /* + * If we have an active "onintr" then we search for the label. + * Note that if one does "onintr -" then we shan't be interruptible + * so we needn't worry about that here. + */ + if (gointr) { + search(ZGOTO, 0, gointr); + timflg = 0; + if (v = pargv) + pargv = 0, blkfree(v); + if (v = gargv) + gargv = 0, blkfree(v); + reset(); + } else if (intty && wantnl) + printf("\n"); /* Some like this, others don't */ + error(NOSTR); +} + +/* + * Process is the main driving routine for the shell. + * It runs all command processing, except for those within { ... } + * in expressions (which is run by a routine evalav in sh.exp.c which + * is a stripped down process), and `...` evaluation which is run + * also by a subset of this code in sh.glob.c in the routine backeval. + * + * The code here is a little strange because part of it is interruptible + * and hence freeing of structures appears to occur when none is necessary + * if this is ignored. + * + * Note that if catch is not set then we will unwind on any error. + * If an end-of-file occurs, we return. + */ +process(catch) + bool catch; +{ + jmp_buf osetexit; + register struct command *t; + + getexit(osetexit); + for (;;) { + pendjob(); + paraml.next = paraml.prev = ¶ml; + paraml.word = ""; + t = 0; + setexit(); + justpr = enterhist; /* execute if not entering history */ + + /* + * Interruptible during interactive reads + */ + if (setintr) + (void) sigsetmask(sigblock(0L) & ~sigmask(SIGINT)); + + /* + * For the sake of reset() + */ + freelex(¶ml), freesyn(t), t = 0; + + if (haderr) { + if (!catch) { + /* unwind */ + doneinp = 0; + resexit(osetexit); + reset(); + } + haderr = 0; + /* + * Every error is eventually caught here or + * the shell dies. It is at this + * point that we clean up any left-over open + * files, by closing all but a fixed number + * of pre-defined files. Thus routines don't + * have to worry about leaving files open due + * to deeper errors... they will get closed here. + */ + closem(); + continue; + } + if (doneinp) { + doneinp = 0; + break; + } + if (chkstop) + chkstop--; + if (neednote) + pnote(); + if (intty && prompt && evalvec == 0) { + mailchk(); + /* + * If we are at the end of the input buffer + * then we are going to read fresh stuff. + * Otherwise, we are rereading input and don't + * need or want to prompt. + */ + if (fseekp == feobp) + printprompt(); + } + err = 0; + + /* + * Echo not only on VERBOSE, but also with history expansion. + * If there is a lexical error then we forego history echo. + */ + if (lex(¶ml) && !err && intty || + adrof("verbose")) { + haderr = 1; + prlex(¶ml); + haderr = 0; + } + + /* + * The parser may lose space if interrupted. + */ + if (setintr) + (void) sigblock(sigmask(SIGINT)); + + /* + * Save input text on the history list if + * reading in old history, or it + * is from the terminal at the top level and not + * in a loop. + */ + if (enterhist || catch && intty && !whyles) + savehist(¶ml); + + /* + * Print lexical error messages, except when sourcing + * history lists. + */ + if (!enterhist && err) + error(err); + + /* + * If had a history command :p modifier then + * this is as far as we should go + */ + if (justpr) + reset(); + + alias(¶ml); + + /* + * Parse the words of the input into a parse tree. + */ + t = syntax(paraml.next, ¶ml, 0); + if (err) + error(err); + + /* + * Execute the parse tree + */ + execute(t, tpgrp); + + /* + * Made it! + */ + freelex(¶ml), freesyn(t); + } + resexit(osetexit); +} + +dosource(t) + register char **t; +{ + register char *f; + register int u; + bool hflg = 0; + char buf[BUFSIZ]; + + t++; + if (*t && eq(*t, "-h")) { + t++; + hflg++; + } + (void) strcpy(buf, *t); + f = globone(buf); + u = dmove(open(f, 0), -1); + xfree(f); + if (u < 0 && !hflg) + Perror(f); + (void) ioctl(u, FIOCLEX, (char *)0); + srcunit(u, 0, hflg); +} + +/* + * Check for mail. + * If we are a login shell, then we don't want to tell + * about any mail file unless its been modified + * after the time we started. + * This prevents us from telling the user things he already + * knows, since the login program insists on saying + * "You have mail." + */ +mailchk() +{ + register struct varent *v; + register char **vp; + time_t t; + int intvl, cnt; + struct stat stb; + bool new; + + v = adrof("mail"); + if (v == 0) + return; + (void) time(&t); + vp = v->vec; + cnt = blklen(vp); + intvl = (cnt && number(*vp)) ? (--cnt, getn(*vp++)) : MAILINTVL; + if (intvl < 1) + intvl = 1; + if (chktim + intvl > t) + return; + for (; *vp; vp++) { + if (stat(*vp, &stb) < 0) + continue; + new = stb.st_mtime > time0.tv_sec; + if (stb.st_size == 0 || stb.st_atime > stb.st_mtime || + (stb.st_atime < chktim && stb.st_mtime < chktim) || + loginsh && !new) + continue; + if (cnt == 1) + printf("You have %smail.\n", new ? "new " : ""); + else + printf("%s in %s.\n", new ? "New mail" : "Mail", *vp); + } + chktim = t; +} + +#include +/* + * Extract a home directory from the password file + * The argument points to a buffer where the name of the + * user whose home directory is sought is currently. + * We write the home directory of the user back there. + */ +gethdir(home) + char *home; +{ + register struct passwd *pp = getpwnam(home); + + if (pp == 0) + return (1); + (void) strcpy(home, pp->pw_dir); + return (0); +} + +/* + * Move the initial descriptors to their eventual + * resting places, closin all other units. + */ +initdesc() +{ + + didfds = 0; /* 0, 1, 2 aren't set up */ + (void) ioctl(SHIN = dcopy(0, FSHIN), FIOCLEX, (char *)0); + (void) ioctl(SHOUT = dcopy(1, FSHOUT), FIOCLEX, (char *)0); + (void) ioctl(SHDIAG = dcopy(2, FSHDIAG), FIOCLEX, (char *)0); + (void) ioctl(OLDSTD = dcopy(SHIN, FOLDSTD), FIOCLEX, (char *)0); + closem(); +} + +#ifdef PROF +done(i) +#else +exit(i) +#endif + int i; +{ + + untty(); + _exit(i); +} + +printprompt() +{ + register char *cp; + + if (!whyles) { + for (cp = value("prompt"); *cp; cp++) + if (*cp == HIST) + printf("%d", eventno + 1); + else { + if (*cp == '\\' && cp[1] == HIST) + cp++; + putchar(*cp | QUOTE); + } + } else + /* + * Prompt for forward reading loop + * body content. + */ + printf("? "); + flush(); +} diff --git a/bin/csh/sh.char.c b/bin/csh/sh.char.c new file mode 100644 index 0000000..193b0e2 --- /dev/null +++ b/bin/csh/sh.char.c @@ -0,0 +1,109 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley Software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if !defined(lint) && defined(DOSCCS) +static char *sccsid = "@(#)sh.char.c 5.3 (Berkeley) 3/29/86"; +#endif + +#include "sh.char.h" + +unsigned short _cmap[256] = { +/* nul soh stx etx */ + 0, 0, 0, 0, + +/* eot enq ack bel */ + 0, 0, 0, 0, + +/* bs ht nl vt */ + 0, _SP|_META, _NL|_META, 0, + +/* np cr so si */ + 0, 0, 0, 0, + +/* dle dc1 dc2 dc3 */ + 0, 0, 0, 0, + +/* dc4 nak syn etb */ + 0, 0, 0, 0, + +/* can em sub esc */ + 0, 0, 0, 0, + +/* fs gs rs us */ + 0, 0, 0, 0, + +/* sp ! " # */ + _SP|_META, 0, _Q, _META, + +/* $ % & ' */ + _DOL, 0, _META, _Q, + +/* ( ) * + */ + _META, _META, _GLOB, 0, + +/* , - . / */ + 0, 0, 0, 0, + +/* 0 1 2 3 */ + _DIG, _DIG, _DIG, _DIG, + +/* 4 5 6 7 */ + _DIG, _DIG, _DIG, _DIG, + +/* 8 9 : ; */ + _DIG, _DIG, 0, _META, + +/* < = > ? */ + _META, 0, _META, _GLOB, + +/* @ A B C */ + 0, _LET, _LET, _LET, + +/* D E F G */ + _LET, _LET, _LET, _LET, + +/* H I J K */ + _LET, _LET, _LET, _LET, + +/* L M N O */ + _LET, _LET, _LET, _LET, + +/* P Q R S */ + _LET, _LET, _LET, _LET, + +/* T U V W */ + _LET, _LET, _LET, _LET, + +/* X Y Z [ */ + _LET, _LET, _LET, _GLOB, + +/* \ ] ^ _ */ + _ESC, 0, 0, _LET, + +/* ` a b c */ + _Q1|_GLOB, _LET, _LET, _LET, + +/* d e f g */ + _LET, _LET, _LET, _LET, + +/* h i j k */ + _LET, _LET, _LET, _LET, + +/* l m n o */ + _LET, _LET, _LET, _LET, + +/* p q r s */ + _LET, _LET, _LET, _LET, + +/* t u v w */ + _LET, _LET, _LET, _LET, + +/* x y z { */ + _LET, _LET, _LET, _GLOB, + +/* | } ~ del */ + _META, 0, 0, 0, +}; diff --git a/bin/csh/sh.char.h b/bin/csh/sh.char.h new file mode 100644 index 0000000..36d9388 --- /dev/null +++ b/bin/csh/sh.char.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley Software License Agreement + * specifies the terms and conditions for redistribution. + * + * @(#)sh.char.h 5.3 (Berkeley) 3/29/86 + */ + +/* + * Table for spotting special characters quickly + * + * Makes for very obscure but efficient coding. + */ + +extern unsigned short _cmap[]; + +#define _Q 0x01 /* '" */ +#define _Q1 0x02 /* ` */ +#define _SP 0x04 /* space and tab */ +#define _NL 0x08 /* \n */ +#define _META 0x10 /* lex meta characters, sp #'`";&<>()|\t\n */ +#define _GLOB 0x20 /* glob characters, *?{[` */ +#define _ESC 0x40 /* \ */ +#define _DOL 0x80 /* $ */ +#define _DIG 0x100 /* 0-9 */ +#define _LET 0x200 /* a-z, A-Z, _ */ + +#define cmap(c, bits) (_cmap[(unsigned char)(c)] & (bits)) + +#define isglob(c) cmap(c, _GLOB) +#define isspace(c) cmap(c, _SP) +#define isspnl(c) cmap(c, _SP|_NL) +#define ismeta(c) cmap(c, _META) +#define digit(c) cmap(c, _DIG) +#define letter(c) cmap(c, _LET) +#define alnum(c) (digit(c) || letter(c)) diff --git a/bin/csh/sh.dir.c b/bin/csh/sh.dir.c new file mode 100644 index 0000000..9cec95b --- /dev/null +++ b/bin/csh/sh.dir.c @@ -0,0 +1,473 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley Software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if !defined(lint) && defined(DOSCCS) +static char *sccsid = "@(#)sh.dir.c 5.3 (Berkeley) 6/11/85"; +#endif + +#include "sh.h" +#include "sh.dir.h" + +/* + * C Shell - directory management + */ + +struct directory *dfind(); +char *dfollow(); +char *dcanon(); +struct directory dhead; /* "head" of loop */ +int printd; /* force name to be printed */ +static char *fakev[] = { "dirs", NOSTR }; + +/* + * dinit - initialize current working directory + */ +dinit(hp) + char *hp; +{ + register char *cp; + register struct directory *dp; + char path[MAXPATHLEN]; + + if (loginsh && hp) + cp = hp; + else { + cp = getwd(path); + if (cp == NULL) { + (void) write(2, path, strlen(path)); + exit(1); + } + } + dp = (struct directory *)calloc(sizeof (struct directory), 1); + dp->di_name = savestr(cp); + dp->di_count = 0; + dhead.di_next = dhead.di_prev = dp; + dp->di_next = dp->di_prev = &dhead; + printd = 0; + dnewcwd(dp); +} + +/* + * dodirs - list all directories in directory loop + */ +dodirs(v) + char **v; +{ + register struct directory *dp; + bool lflag; + char *hp = value("home"); + + if (*hp == '\0') + hp = NOSTR; + if (*++v != NOSTR) + if (eq(*v, "-l") && *++v == NOSTR) + lflag = 1; + else + error("Usage: dirs [ -l ]"); + else + lflag = 0; + dp = dcwd; + do { + if (dp == &dhead) + continue; + if (!lflag && hp != NOSTR) { + dtildepr(hp, dp->di_name); + } else + printf("%s", dp->di_name); + printf(" "); + } while ((dp = dp->di_prev) != dcwd); + printf("\n"); +} + +dtildepr(home, dir) + register char *home, *dir; +{ + + if (!eq(home, "/") && prefix(home, dir)) + printf("~%s", dir + strlen(home)); + else + printf("%s", dir); +} + +/* + * dochngd - implement chdir command. + */ +dochngd(v) + char **v; +{ + register char *cp; + register struct directory *dp; + + printd = 0; + if (*++v == NOSTR) { + if ((cp = value("home")) == NOSTR || *cp == 0) + bferr("No home directory"); + if (chdir(cp) < 0) + bferr("Can't change to home directory"); + cp = savestr(cp); + } else if ((dp = dfind(*v)) != 0) { + printd = 1; + if (chdir(dp->di_name) < 0) + Perror(dp->di_name); + dcwd->di_prev->di_next = dcwd->di_next; + dcwd->di_next->di_prev = dcwd->di_prev; + goto flushcwd; + } else + cp = dfollow(*v); + dp = (struct directory *)calloc(sizeof (struct directory), 1); + dp->di_name = cp; + dp->di_count = 0; + dp->di_next = dcwd->di_next; + dp->di_prev = dcwd->di_prev; + dp->di_prev->di_next = dp; + dp->di_next->di_prev = dp; +flushcwd: + dfree(dcwd); + dnewcwd(dp); +} + +/* + * dfollow - change to arg directory; fall back on cdpath if not valid + */ +char * +dfollow(cp) + register char *cp; +{ + register char *dp; + struct varent *c; + + cp = globone(cp); + if (chdir(cp) >= 0) + goto gotcha; + if (cp[0] != '/' && !prefix("./", cp) && !prefix("../", cp) + && (c = adrof("cdpath"))) { + char **cdp; + register char *p; + char buf[MAXPATHLEN]; + + for (cdp = c->vec; *cdp; cdp++) { + for (dp = buf, p = *cdp; *dp++ = *p++;) + ; + dp[-1] = '/'; + for (p = cp; *dp++ = *p++;) + ; + if (chdir(buf) >= 0) { + printd = 1; + xfree(cp); + cp = savestr(buf); + goto gotcha; + } + } + } + dp = value(cp); + if ((dp[0] == '/' || dp[0] == '.') && chdir(dp) >= 0) { + xfree(cp); + cp = savestr(dp); + printd = 1; + goto gotcha; + } + xfree(cp); /* XXX, use after free */ + Perror(cp); + +gotcha: + if (*cp != '/') { + register char *p, *q; + int cwdlen; + + /* + * All in the name of efficiency? + */ + for (p = dcwd->di_name; *p++;) + ; + if ((cwdlen = p - dcwd->di_name - 1) == 1) /* root */ + cwdlen = 0; + for (p = cp; *p++;) + ; + dp = xalloc((unsigned) (cwdlen + (p - cp) + 1)); + for (p = dp, q = dcwd->di_name; *p++ = *q++;) + ; + if (cwdlen) + p[-1] = '/'; + else + p--; /* don't add a / after root */ + for (q = cp; *p++ = *q++;) + ; + xfree(cp); + cp = dp; + dp += cwdlen; + } else + dp = cp; + return dcanon(cp, dp); +} + +/* + * dopushd - push new directory onto directory stack. + * with no arguments exchange top and second. + * with numeric argument (+n) bring it to top. + */ +dopushd(v) + char **v; +{ + register struct directory *dp; + + printd = 1; + if (*++v == NOSTR) { + if ((dp = dcwd->di_prev) == &dhead) + dp = dhead.di_prev; + if (dp == dcwd) + bferr("No other directory"); + if (chdir(dp->di_name) < 0) + Perror(dp->di_name); + dp->di_prev->di_next = dp->di_next; + dp->di_next->di_prev = dp->di_prev; + dp->di_next = dcwd->di_next; + dp->di_prev = dcwd; + dcwd->di_next->di_prev = dp; + dcwd->di_next = dp; + } else if (dp = dfind(*v)) { + if (chdir(dp->di_name) < 0) + Perror(dp->di_name); + } else { + register char *cp; + + cp = dfollow(*v); + dp = (struct directory *)calloc(sizeof (struct directory), 1); + dp->di_name = cp; + dp->di_count = 0; + dp->di_prev = dcwd; + dp->di_next = dcwd->di_next; + dcwd->di_next = dp; + dp->di_next->di_prev = dp; + } + dnewcwd(dp); +} + +/* + * dfind - find a directory if specified by numeric (+n) argument + */ +struct directory * +dfind(cp) + register char *cp; +{ + register struct directory *dp; + register int i; + register char *ep; + + if (*cp++ != '+') + return (0); + for (ep = cp; digit(*ep); ep++) + continue; + if (*ep) + return (0); + i = getn(cp); + if (i <= 0) + return (0); + for (dp = dcwd; i != 0; i--) { + if ((dp = dp->di_prev) == &dhead) + dp = dp->di_prev; + if (dp == dcwd) + bferr("Directory stack not that deep"); + } + return (dp); +} + +/* + * dopopd - pop a directory out of the directory stack + * with a numeric argument just discard it. + */ +dopopd(v) + char **v; +{ + register struct directory *dp, *p; + + printd = 1; + if (*++v == NOSTR) + dp = dcwd; + else if ((dp = dfind(*v)) == 0) + bferr("Bad directory"); + if (dp->di_prev == &dhead && dp->di_next == &dhead) + bferr("Directory stack empty"); + if (dp == dcwd) { + if ((p = dp->di_prev) == &dhead) + p = dhead.di_prev; + if (chdir(p->di_name) < 0) + Perror(p->di_name); + } + dp->di_prev->di_next = dp->di_next; + dp->di_next->di_prev = dp->di_prev; + if (dp == dcwd) + dnewcwd(p); + else + dodirs(fakev); + dfree(dp); +} + +/* + * dfree - free the directory (or keep it if it still has ref count) + */ +dfree(dp) + register struct directory *dp; +{ + + if (dp->di_count != 0) + dp->di_next = dp->di_prev = 0; + else + xfree(dp->di_name), xfree((char *)dp); +} + +/* + * dcanon - canonicalize the pathname, removing excess ./ and ../ etc. + * we are of course assuming that the file system is standardly + * constructed (always have ..'s, directories have links) + */ +char * +dcanon(cp, p) + register char *cp, *p; +{ + register char *sp; + register char *p1, *p2; /* general purpose */ + bool slash; + + if (*cp != '/') + abort(); + while (*p) { /* for each component */ + sp = p; /* save slash address */ + while (*++p == '/') /* flush extra slashes */ + ; + if (p != ++sp) + for (p1 = sp, p2 = p; *p1++ = *p2++;) + ; + p = sp; /* save start of component */ + slash = 0; + while (*++p) /* find next slash or end of path */ + if (*p == '/') { + slash = 1; + *p = 0; + break; + } + if (*sp == '\0') /* if component is null */ + if (--sp == cp) /* if path is one char (i.e. /) */ + break; + else + *sp = '\0'; + else if (sp[0] == '.' && sp[1] == 0) { + if (slash) { + for (p1 = sp, p2 = p + 1; *p1++ = *p2++;) + ; + p = --sp; + } else if (--sp != cp) + *sp = '\0'; + } else if (sp[0] == '.' && sp[1] == '.' && sp[2] == 0) { + char link[MAXPATHLEN]; + int cc; + char *newcp; + + /* + * We have something like "yyy/xxx/..", where "yyy" + * can be null or a path starting at /, and "xxx" + * is a single component. + * Before compressing "xxx/..", we want to expand + * "yyy/xxx", if it is a symbolic link. + */ + *--sp = 0; /* form the pathname for readlink */ + if (sp != cp && + (cc = readlink(cp, link, sizeof link)) >= 0) { + link[cc] = '\0'; + if (slash) + *p = '/'; + /* + * Point p to the '/' in "/..", and restore + * the '/'. + */ + *(p = sp) = '/'; + /* + * find length of p + */ + for (p1 = p; *p1++;) + ; + if (*link != '/') { + /* + * Relative path, expand it between + * the "yyy/" and the "/..". + * First, back sp up to the character + * past "yyy/". + */ + while (*--sp != '/') + ; + sp++; + *sp = 0; + /* + * New length is + * "yyy/" + link + "/.." and rest + */ + p1 = newcp = xalloc((unsigned) + ((sp - cp) + cc + (p1 - p))); + /* + * Copy new path into newcp + */ + for (p2 = cp; *p1++ = *p2++;) + ; + for (p1--, p2 = link; *p1++ = *p2++;) + ; + for (p1--, p2 = p; *p1++ = *p2++;) + ; + /* + * Restart canonicalization at + * expanded "/xxx". + */ + p = sp - cp - 1 + newcp; + } else { + /* + * New length is link + "/.." and rest + */ + p1 = newcp = xalloc((unsigned) + (cc + (p1 - p))); + /* + * Copy new path into newcp + */ + for (p2 = link; *p1++ = *p2++;) + ; + for (p1--, p2 = p; *p1++ = *p2++;) + ; + /* + * Restart canonicalization at beginning + */ + p = newcp; + } + xfree(cp); + cp = newcp; + continue; /* canonicalize the link */ + } + *sp = '/'; + if (sp != cp) + while (*--sp != '/') + ; + if (slash) { + for (p1 = sp + 1, p2 = p + 1; *p1++ = *p2++;) + ; + p = sp; + } else if (cp == sp) + *++sp = '\0'; + else + *sp = '\0'; + } else if (slash) + *p = '/'; + } + return cp; +} + +/* + * dnewcwd - make a new directory in the loop the current one + */ +dnewcwd(dp) + register struct directory *dp; +{ + + dcwd = dp; + set("cwd", savestr(dcwd->di_name)); + if (printd) + dodirs(fakev); +} diff --git a/bin/csh/sh.dir.h b/bin/csh/sh.dir.h new file mode 100644 index 0000000..7e6cb8d --- /dev/null +++ b/bin/csh/sh.dir.h @@ -0,0 +1,18 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley Software License Agreement + * specifies the terms and conditions for redistribution. + * + * @(#)sh.dir.h 5.2 (Berkeley) 6/6/85 + */ + +/* + * Structure for entries in directory stack. + */ +struct directory { + struct directory *di_next; /* next in loop */ + struct directory *di_prev; /* prev in loop */ + unsigned short *di_count; /* refcount of processes */ + char *di_name; /* actual name */ +}; +struct directory *dcwd; /* the one we are in now */ diff --git a/bin/csh/sh.dol.c b/bin/csh/sh.dol.c new file mode 100644 index 0000000..6260a12 --- /dev/null +++ b/bin/csh/sh.dol.c @@ -0,0 +1,704 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley Software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if !defined(lint) && defined(DOSCCS) +static char *sccsid = "@(#)sh.dol.c 5.3 (Berkeley) 3/29/86"; +#endif + +#include "sh.h" + +/* + * C shell + */ + +/* + * These routines perform variable substitution and quoting via ' and ". + * To this point these constructs have been preserved in the divided + * input words. Here we expand variables and turn quoting via ' and " into + * QUOTE bits on characters (which prevent further interpretation). + * If the `:q' modifier was applied during history expansion, then + * some QUOTEing may have occurred already, so we dont "trim()" here. + */ + +int Dpeekc, Dpeekrd; /* Peeks for DgetC and Dreadc */ +char *Dcp, **Dvp; /* Input vector for Dreadc */ + +#define DEOF -1 + +#define unDgetC(c) Dpeekc = c + +#define QUOTES (_Q|_Q1|_ESC) /* \ ' " ` */ + +/* + * The following variables give the information about the current + * $ expansion, recording the current word position, the remaining + * words within this expansion, the count of remaining words, and the + * information about any : modifier which is being applied. + */ +char *dolp; /* Remaining chars from this word */ +char **dolnxt; /* Further words */ +int dolcnt; /* Count of further words */ +char dolmod; /* : modifier character */ +int dolmcnt; /* :gx -> 10000, else 1 */ + +/* + * Fix up the $ expansions and quotations in the + * argument list to command t. + */ +Dfix(t) + register struct command *t; +{ + register char **pp; + register char *p; + + if (noexec) + return; + /* Note that t_dcom isn't trimmed thus !...:q's aren't lost */ + for (pp = t->t_dcom; p = *pp++;) + while (*p) + if (cmap(*p++, _DOL|QUOTES)) { /* $, \, ', ", ` */ + Dfix2(t->t_dcom); /* found one */ + blkfree(t->t_dcom); + t->t_dcom = gargv; + gargv = 0; + return; + } +} + +/* + * $ substitute one word, for i/o redirection + */ +char * +Dfix1(cp) + register char *cp; +{ + char *Dv[2]; + + if (noexec) + return (0); + Dv[0] = cp; Dv[1] = NOSTR; + Dfix2(Dv); + if (gargc != 1) { + setname(cp); + bferr("Ambiguous"); + } + cp = savestr(gargv[0]); + blkfree(gargv), gargv = 0; + return (cp); +} + +/* + * Subroutine to do actual fixing after state initialization. + */ +Dfix2(v) + char **v; +{ + char *agargv[GAVSIZ]; + + ginit(agargv); /* Initialize glob's area pointers */ + Dvp = v; Dcp = ""; /* Setup input vector for Dreadc */ + unDgetC(0); unDredc(0); /* Clear out any old peeks (at error) */ + dolp = 0; dolcnt = 0; /* Clear out residual $ expands (...) */ + while (Dword()) + continue; + gargv = copyblk(gargv); +} + +/* + * Get a word. This routine is analogous to the routine + * word() in sh.lex.c for the main lexical input. One difference + * here is that we don't get a newline to terminate our expansion. + * Rather, DgetC will return a DEOF when we hit the end-of-input. + */ +Dword() +{ + register int c, c1; + char wbuf[BUFSIZ]; + register char *wp = wbuf; + register int i = BUFSIZ - 4; + register bool dolflg; + bool sofar = 0; + +loop: + c = DgetC(DODOL); + switch (c) { + + case DEOF: +deof: + if (sofar == 0) + return (0); + /* finish this word and catch the code above the next time */ + unDredc(c); + /* fall into ... */ + + case '\n': + *wp = 0; + goto ret; + + case ' ': + case '\t': + goto loop; + + case '`': + /* We preserve ` quotations which are done yet later */ + *wp++ = c, --i; + case '\'': + case '"': + /* + * Note that DgetC never returns a QUOTES character + * from an expansion, so only true input quotes will + * get us here or out. + */ + c1 = c; + dolflg = c1 == '"' ? DODOL : 0; + for (;;) { + c = DgetC(dolflg); + if (c == c1) + break; + if (c == '\n' || c == DEOF) + error("Unmatched %c", c1); + if ((c & (QUOTE|TRIM)) == ('\n' | QUOTE)) + --wp, ++i; + if (--i <= 0) + goto toochars; + switch (c1) { + + case '"': + /* + * Leave any `s alone for later. + * Other chars are all quoted, thus `...` + * can tell it was within "...". + */ + *wp++ = c == '`' ? '`' : c | QUOTE; + break; + + case '\'': + /* Prevent all further interpretation */ + *wp++ = c | QUOTE; + break; + + case '`': + /* Leave all text alone for later */ + *wp++ = c; + break; + } + } + if (c1 == '`') + *wp++ = '`', --i; + goto pack; /* continue the word */ + + case '\\': + c = DgetC(0); /* No $ subst! */ + if (c == '\n' || c == DEOF) + goto loop; + c |= QUOTE; + break; + } + unDgetC(c); +pack: + sofar = 1; + /* pack up more characters in this word */ + for (;;) { + c = DgetC(DODOL); + if (c == '\\') { + c = DgetC(0); + if (c == DEOF) + goto deof; + if (c == '\n') + c = ' '; + else + c |= QUOTE; + } + if (c == DEOF) + goto deof; + if (cmap(c, _SP|_NL|_Q|_Q1)) { /* sp \t\n'"` */ + unDgetC(c); + if (cmap(c, QUOTES)) + goto loop; + *wp++ = 0; + goto ret; + } + if (--i <= 0) +toochars: + error("Word too long"); + *wp++ = c; + } +ret: + Gcat("", wbuf); + return (1); +} + +/* + * Get a character, performing $ substitution unless flag is 0. + * Any QUOTES character which is returned from a $ expansion is + * QUOTEd so that it will not be recognized above. + */ +DgetC(flag) + register int flag; +{ + register int c; + +top: + if (c = Dpeekc) { + Dpeekc = 0; + return (c); + } + if (lap) { + c = *lap++ & (QUOTE|TRIM); + if (c == 0) { + lap = 0; + goto top; + } +quotspec: + if (cmap(c, QUOTES)) + return (c | QUOTE); + return (c); + } + if (dolp) { + if (c = *dolp++ & (QUOTE|TRIM)) + goto quotspec; + if (dolcnt > 0) { + setDolp(*dolnxt++); + --dolcnt; + return (' '); + } + dolp = 0; + } + if (dolcnt > 0) { + setDolp(*dolnxt++); + --dolcnt; + goto top; + } + c = Dredc(); + if (c == '$' && flag) { + Dgetdol(); + goto top; + } + return (c); +} + +char *nulvec[] = { 0 }; +struct varent nulargv = { nulvec, "argv", 0 }; + +/* + * Handle the multitudinous $ expansion forms. + * Ugh. + */ +Dgetdol() +{ + register char *np; + register struct varent *vp; + char name[20]; + int c, sc; + int subscr = 0, lwb = 1, upb = 0; + bool dimen = 0, bitset = 0; + char wbuf[BUFSIZ]; + + dolmod = dolmcnt = 0; + c = sc = DgetC(0); + if (c == '{') + c = DgetC(0); /* sc is { to take } later */ + if ((c & TRIM) == '#') + dimen++, c = DgetC(0); /* $# takes dimension */ + else if (c == '?') + bitset++, c = DgetC(0); /* $? tests existence */ + switch (c) { + + case '$': + if (dimen || bitset) + goto syntax; /* No $?$, $#$ */ + setDolp(doldol); + goto eatbrac; + + case '<'|QUOTE: + if (dimen || bitset) + goto syntax; /* No $?<, $#< */ + for (np = wbuf; read(OLDSTD, np, 1) == 1; np++) { + if (np >= &wbuf[BUFSIZ-1]) + error("$< line too long"); + if (*np <= 0 || *np == '\n') + break; + } + *np = 0; + /* + * KLUDGE: dolmod is set here because it will + * cause setDolp to call domod and thus to copy wbuf. + * Otherwise setDolp would use it directly. If we saved + * it ourselves, no one would know when to free it. + * The actual function of the 'q' causes filename + * expansion not to be done on the interpolated value. + */ + dolmod = 'q'; + dolmcnt = 10000; + setDolp(wbuf); + goto eatbrac; + + case DEOF: + case '\n': + goto syntax; + + case '*': + (void) strcpy(name, "argv"); + vp = adrof("argv"); + subscr = -1; /* Prevent eating [...] */ + break; + + default: + np = name; + if (digit(c)) { + if (dimen) + goto syntax; /* No $#1, e.g. */ + subscr = 0; + do { + subscr = subscr * 10 + c - '0'; + c = DgetC(0); + } while (digit(c)); + unDredc(c); + if (subscr < 0) + goto oob; + if (subscr == 0) { + if (bitset) { + dolp = file ? "1" : "0"; + goto eatbrac; + } + if (file == 0) + error("No file for $0"); + setDolp(file); + goto eatbrac; + } + if (bitset) + goto syntax; + vp = adrof("argv"); + if (vp == 0) { + vp = &nulargv; + goto eatmod; + } + break; + } + if (!alnum(c)) + goto syntax; + for (;;) { + *np++ = c; + c = DgetC(0); + if (!alnum(c)) + break; + if (np >= &name[sizeof name - 2]) +syntax: + error("Variable syntax"); + } + *np++ = 0; + unDredc(c); + vp = adrof(name); + } + if (bitset) { + dolp = (vp || getenv(name)) ? "1" : "0"; + goto eatbrac; + } + if (vp == 0) { + np = getenv(name); + if (np) { + addla(np); + goto eatbrac; + } + udvar(name); + /*NOTREACHED*/ + } + c = DgetC(0); + upb = blklen(vp->vec); + if (dimen == 0 && subscr == 0 && c == '[') { + np = name; + for (;;) { + c = DgetC(DODOL); /* Allow $ expand within [ ] */ + if (c == ']') + break; + if (c == '\n' || c == DEOF) + goto syntax; + if (np >= &name[sizeof name - 2]) + goto syntax; + *np++ = c; + } + *np = 0, np = name; + if (dolp || dolcnt) /* $ exp must end before ] */ + goto syntax; + if (!*np) + goto syntax; + if (digit(*np)) { + register int i = 0; + + while (digit(*np)) + i = i * 10 + *np++ - '0'; + if ((i < 0 || i > upb) && !any(*np, "-*")) { +oob: + setname(vp->v_name); + error("Subscript out of range"); + } + lwb = i; + if (!*np) + upb = lwb, np = "*"; + } + if (*np == '*') + np++; + else if (*np != '-') + goto syntax; + else { + register int i = upb; + + np++; + if (digit(*np)) { + i = 0; + while (digit(*np)) + i = i * 10 + *np++ - '0'; + if (i < 0 || i > upb) + goto oob; + } + if (i < lwb) + upb = lwb - 1; + else + upb = i; + } + if (lwb == 0) { + if (upb != 0) + goto oob; + upb = -1; + } + if (*np) + goto syntax; + } else { + if (subscr > 0) + if (subscr > upb) + lwb = 1, upb = 0; + else + lwb = upb = subscr; + unDredc(c); + } + if (dimen) { + char *cp = putn(upb - lwb + 1); + + addla(cp); + xfree(cp); + } else { +eatmod: + c = DgetC(0); + if (c == ':') { + c = DgetC(0), dolmcnt = 1; + if (c == 'g') + c = DgetC(0), dolmcnt = 10000; + if (!any(c, "htrqxe")) + error("Bad : mod in $"); + dolmod = c; + if (c == 'q') + dolmcnt = 10000; + } else + unDredc(c); + dolnxt = &vp->vec[lwb - 1]; + dolcnt = upb - lwb + 1; + } +eatbrac: + if (sc == '{') { + c = Dredc(); + if (c != '}') + goto syntax; + } +} + +setDolp(cp) + register char *cp; +{ + register char *dp; + + if (dolmod == 0 || dolmcnt == 0) { + dolp = cp; + return; + } + dp = domod(cp, dolmod); + if (dp) { + dolmcnt--; + addla(dp); + xfree(dp); + } else + addla(cp); + dolp = ""; +} + +unDredc(c) + int c; +{ + + Dpeekrd = c; +} + +Dredc() +{ + register int c; + + if (c = Dpeekrd) { + Dpeekrd = 0; + return (c); + } + if (Dcp && (c = *Dcp++)) + return (c&(QUOTE|TRIM)); + if (*Dvp == 0) { + Dcp = 0; + return (DEOF); + } + Dcp = *Dvp++; + return (' '); +} + +Dtestq(c) + register int c; +{ + + if (cmap(c, QUOTES)) + gflag = 1; +} + +/* + * Form a shell temporary file (in unit 0) from the words + * of the shell input up to a line the same as "term". + * Unit 0 should have been closed before this call. + */ +heredoc(term) + char *term; +{ + register int c; + char *Dv[2]; + char obuf[BUFSIZ], lbuf[BUFSIZ], mbuf[BUFSIZ]; + int ocnt, lcnt, mcnt; + register char *lbp, *obp, *mbp; + char **vp; + bool quoted; + + if (creat(shtemp, 0600) < 0) + Perror(shtemp); + (void) close(0); + if (open(shtemp, 2) < 0) { + int oerrno = errno; + + (void) unlink(shtemp); + errno = oerrno; + Perror(shtemp); + } + (void) unlink(shtemp); /* 0 0 inode! */ + Dv[0] = term; Dv[1] = NOSTR; gflag = 0; + trim(Dv); rscan(Dv, Dtestq); quoted = gflag; + ocnt = BUFSIZ; obp = obuf; + for (;;) { + /* + * Read up a line + */ + lbp = lbuf; lcnt = BUFSIZ - 4; + for (;;) { + c = readc(1); /* 1 -> Want EOF returns */ + if (c < 0) { + setname(term); + bferr("<< terminator not found"); + } + if (c == '\n') + break; + if (c &= TRIM) { + *lbp++ = c; + if (--lcnt < 0) { + setname("<<"); + error("Line overflow"); + } + } + } + *lbp = 0; + + /* + * Compare to terminator -- before expansion + */ + if (eq(lbuf, term)) { + (void) write(0, obuf, BUFSIZ - ocnt); + (void) lseek(0, (off_t)0, 0); + return; + } + + /* + * If term was quoted or -n just pass it on + */ + if (quoted || noexec) { + *lbp++ = '\n'; *lbp = 0; + for (lbp = lbuf; c = *lbp++;) { + *obp++ = c; + if (--ocnt == 0) { + (void) write(0, obuf, BUFSIZ); + obp = obuf; ocnt = BUFSIZ; + } + } + continue; + } + + /* + * Term wasn't quoted so variable and then command + * expand the input line + */ + Dcp = lbuf; Dvp = Dv + 1; mbp = mbuf; mcnt = BUFSIZ - 4; + for (;;) { + c = DgetC(DODOL); + if (c == DEOF) + break; + if ((c &= TRIM) == 0) + continue; + /* \ quotes \ $ ` here */ + if (c =='\\') { + c = DgetC(0); + if (!any(c, "$\\`")) + unDgetC(c | QUOTE), c = '\\'; + else + c |= QUOTE; + } + *mbp++ = c; + if (--mcnt == 0) { + setname("<<"); + bferr("Line overflow"); + } + } + *mbp++ = 0; + + /* + * If any ` in line do command substitution + */ + mbp = mbuf; + if (any('`', mbp)) { + /* + * 1 arg to dobackp causes substitution to be literal. + * Words are broken only at newlines so that all blanks + * and tabs are preserved. Blank lines (null words) + * are not discarded. + */ + vp = dobackp(mbuf, 1); + } else + /* Setup trivial vector similar to return of dobackp */ + Dv[0] = mbp, Dv[1] = NOSTR, vp = Dv; + + /* + * Resurrect the words from the command substitution + * each separated by a newline. Note that the last + * newline of a command substitution will have been + * discarded, but we put a newline after the last word + * because this represents the newline after the last + * input line! + */ + for (; *vp; vp++) { + for (mbp = *vp; *mbp; mbp++) { + *obp++ = *mbp & TRIM; + if (--ocnt == 0) { + (void) write(0, obuf, BUFSIZ); + obp = obuf; ocnt = BUFSIZ; + } + } + *obp++ = '\n'; + if (--ocnt == 0) { + (void) write(0, obuf, BUFSIZ); + obp = obuf; ocnt = BUFSIZ; + } + } + if (pargv) + blkfree(pargv), pargv = 0; + } +} diff --git a/bin/csh/sh.err.c b/bin/csh/sh.err.c new file mode 100644 index 0000000..fe7731f --- /dev/null +++ b/bin/csh/sh.err.c @@ -0,0 +1,151 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley Software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if !defined(lint) && defined(DOSCCS) +static char *sccsid = "@(#)sh.err.c 5.3 (Berkeley) 5/13/86"; +#endif + +#include "sh.h" +#include + +/* + * C Shell + */ + +bool errspl; /* Argument to error was spliced by seterr2 */ +char one[2] = { '1', 0 }; +char *onev[2] = { one, NOSTR }; +/* + * Print error string s with optional argument arg. + * This routine always resets or exits. The flag haderr + * is set so the routine who catches the unwind can propogate + * it if they want. + * + * Note that any open files at the point of error will eventually + * be closed in the routine process in sh.c which is the only + * place error unwinds are ever caught. + */ +/*VARARGS1*/ +error(s, arg) + char *s; +{ + register char **v; + register char *ep; + + /* + * Must flush before we print as we wish output before the error + * to go on (some form of) standard output, while output after + * goes on (some form of) diagnostic output. + * If didfds then output will go to 1/2 else to FSHOUT/FSHDIAG. + * See flush in sh.print.c. + */ + flush(); + haderr = 1; /* Now to diagnostic output */ + timflg = 0; /* This isn't otherwise reset */ + if (v = pargv) + pargv = 0, blkfree(v); + if (v = gargv) + gargv = 0, blkfree(v); + + /* + * A zero arguments causes no printing, else print + * an error diagnostic here. + */ + if (s) + printf(s, arg), printf(".\n"); + + didfds = 0; /* Forget about 0,1,2 */ + if ((ep = err) && errspl) { + errspl = 0; + xfree(ep); + } + errspl = 0; + + /* + * Go away if -e or we are a child shell + */ + if (exiterr || child) + exit(1); + + /* + * Reset the state of the input. + * This buffered seek to end of file will also + * clear the while/foreach stack. + */ + btoeof(); + + setq("status", onev, &shvhed); + if (tpgrp > 0) + (void) ioctl(FSHTTY, TIOCSPGRP, (char *)&tpgrp); + reset(); /* Unwind */ +} + +/* + * Perror is the shells version of perror which should otherwise + * never be called. + */ +Perror(s) + char *s; +{ + + /* + * Perror uses unit 2, thus if we didn't set up the fd's + * we must set up unit 2 now else the diagnostic will disappear + */ + if (!didfds) { + register int oerrno = errno; + + (void) dcopy(SHDIAG, 2); + errno = oerrno; + } + perror(s); + error(NOSTR); /* To exit or unwind */ +} + +bferr(cp) + char *cp; +{ + + flush(); + haderr = 1; + printf("%s: ", bname); + error(cp); +} + +/* + * The parser and scanner set up errors for later by calling seterr, + * which sets the variable err as a side effect; later to be tested, + * e.g. in process. + */ +seterr(s) + char *s; +{ + + if (err == 0) + err = s, errspl = 0; +} + +/* Set err to a splice of cp and dp, to be freed later in error() */ +seterr2(cp, dp) + char *cp, *dp; +{ + + if (err) + return; + err = strspl(cp, dp); + errspl++; +} + +/* Set err to a splice of cp with a string form of character d */ +seterrc(cp, d) + char *cp, d; +{ + char chbuf[2]; + + chbuf[0] = d; + chbuf[1] = 0; + seterr2(cp, chbuf); +} diff --git a/bin/csh/sh.exec.c b/bin/csh/sh.exec.c new file mode 100644 index 0000000..8df0923 --- /dev/null +++ b/bin/csh/sh.exec.c @@ -0,0 +1,324 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley Software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if !defined(lint) && defined(DOSCCS) +static char *sccsid = "@(#)sh.exec.c 5.2.2 (2.11BSD) 1996/9/20"; +#endif + +#include "sh.h" +#include +#include + +/* + * C shell + */ + +/* + * System level search and execute of a command. + * We look in each directory for the specified command name. + * If the name contains a '/' then we execute only the full path name. + * If there is no search path then we execute only full path names. + */ + +/* + * As we search for the command we note the first non-trivial error + * message for presentation to the user. This allows us often + * to show that a file has the wrong mode/no access when the file + * is not in the last component of the search path, so we must + * go on after first detecting the error. + */ +char *exerr; /* Execution error message */ +char *expath; /* Path for exerr */ + +#include "sh.exec.h" + +/* Dummy search path for just absolute search when no path */ +char *justabs[] = { "", 0 }; + +doexec(t) + register struct command *t; +{ + char *sav; + register char *dp, **pv, **av; + register struct varent *v; + bool slash = any('/', t->t_dcom[0]); + int hashval, hashval1, i; + char *blk[2]; + + /* + * Glob the command name. If this does anything, then we + * will execute the command only relative to ".". One special + * case: if there is no PATH, then we execute only commands + * which start with '/'. + */ + dp = globone(t->t_dcom[0]); + sav = t->t_dcom[0]; + exerr = 0; expath = t->t_dcom[0] = dp; + xfree(sav); + v = adrof("path"); + if (v == 0 && expath[0] != '/') + pexerr(); + slash |= gflag; + + /* + * Glob the argument list, if necessary. + * Otherwise trim off the quote bits. + */ + gflag = 0; av = &t->t_dcom[1]; + tglob(av); + if (gflag) { + av = glob(av); + if (av == 0) + error("No match"); + } + blk[0] = t->t_dcom[0]; + blk[1] = 0; + av = blkspl(blk, av); +#ifdef VFORK + Vav = av; +#endif + trim(av); + + xechoit(av); /* Echo command if -x */ + /* + * Since all internal file descriptors are set to close on exec, + * we don't need to close them explicitly here. Just reorient + * ourselves for error messages. + */ + SHIN = 0; SHOUT = 1; SHDIAG = 2; OLDSTD = 0; + + /* + * We must do this AFTER any possible forking (like `foo` + * in glob) so that this shell can still do subprocesses. + */ + (void) sigsetmask(0L); + + /* + * If no path, no words in path, or a / in the filename + * then restrict the command search. + */ + if (v == 0 || v->vec[0] == 0 || slash) + pv = justabs; + else + pv = v->vec; + sav = strspl("/", *av); /* / command name for postpending */ +#ifdef VFORK + Vsav = sav; +#endif + if (havhash) + hashval = hashname(*av); + i = 0; +#ifdef VFORK + hits++; +#endif + do { + if (!slash && pv[0][0] == '/' && havhash) { + hashval1 = hash(hashval, i); + if (!bit(xhash, hashval1)) + goto cont; + } + if (pv[0][0] == 0 || eq(pv[0], ".")) /* don't make ./xxx */ + texec(*av, av); + else { + dp = strspl(*pv, sav); +#ifdef VFORK + Vdp = dp; +#endif + texec(dp, av); +#ifdef VFORK + Vdp = 0; +#endif + xfree(dp); + } +#ifdef VFORK + misses++; +#endif +cont: + pv++; + i++; + } while (*pv); +#ifdef VFORK + hits--; +#endif +#ifdef VFORK + Vsav = 0; + Vav = 0; +#endif + xfree(sav); + xfree((char *)av); + pexerr(); +} + +pexerr() +{ + + /* Couldn't find the damn thing */ + setname(expath); + /* xfree(expath); */ + if (exerr) + bferr(exerr); + bferr("Command not found"); +} + +/* + * Execute command f, arg list t. + * Record error message if not found. + * Also do shell scripts here. + */ +texec(f, t) + char *f; + register char **t; +{ + register struct varent *v; + register char **vp; + char *lastsh[2]; + + execv(f, t); + switch (errno) { + + case ENOEXEC: + /* + * If there is an alias for shell, then + * put the words of the alias in front of the + * argument list replacing the command name. + * Note no interpretation of the words at this point. + */ + v = adrof1("shell", &aliases); + if (v == 0) { +#ifdef OTHERSH + register int ff = open(f, 0); + char ch; +#endif + + vp = lastsh; + vp[0] = adrof("shell") ? value("shell") : SHELLPATH; + vp[1] = (char *) NULL; +#ifdef OTHERSH + if (ff != -1 && read(ff, &ch, 1) == 1 && ch != '#') + vp[0] = OTHERSH; + (void) close(ff); +#endif + } else + vp = v->vec; + t[0] = f; + t = blkspl(vp, t); /* Splice up the new arglst */ + f = *t; + xfree((char *)t); + execv(f, t); + /* The sky is falling, the sky is falling! */ + + case ENOMEM: + Perror(f); + + case ENOENT: + break; + + default: + if (exerr == 0) { + exerr = syserrlst(errno); + expath = savestr(f); + } + } +} + +/*ARGSUSED*/ +execash(t, kp) + char **t; + register struct command *kp; +{ + + rechist(); + (void) signal(SIGINT, parintr); + (void) signal(SIGQUIT, parintr); + (void) signal(SIGTERM, parterm); /* if doexec loses, screw */ + lshift(kp->t_dcom, 1); + exiterr++; + doexec(kp); + /*NOTREACHED*/ +} + +xechoit(t) + char **t; +{ + + if (adrof("echo")) { + flush(); + haderr = 1; + blkpr(t), putchar('\n'); + haderr = 0; + } +} + +/*VARARGS0*//*ARGSUSED*/ +dohash() +{ + struct stat stb; + DIR *dirp; + register struct direct *dp; + register int cnt; + int i = 0; + struct varent *v = adrof("path"); + char **pv; + int hashval; + + havhash = 1; + for (cnt = 0; cnt < sizeof xhash; cnt++) + xhash[cnt] = 0; + if (v == 0) + return; + for (pv = v->vec; *pv; pv++, i++) { + if (pv[0][0] != '/') + continue; + dirp = opendir(*pv); + if (dirp == NULL) + continue; + if (fstat(dirp->dd_fd, &stb) < 0 || !S_ISDIR(stb.st_mode)) { + closedir(dirp); + continue; + } + while ((dp = readdir(dirp)) != NULL) { + if (dp->d_ino == 0) + continue; + if (dp->d_name[0] == '.' && + (dp->d_name[1] == '\0' || + dp->d_name[1] == '.' && dp->d_name[2] == '\0')) + continue; + hashval = hash(hashname(dp->d_name), i); + bis(xhash, hashval); + } + closedir(dirp); + } +} + +dounhash() +{ + + havhash = 0; +} + +#ifdef VFORK +hashstat() +{ + + if (hits+misses) + printf("%d hits, %d misses, %d%%\n", + hits, misses, + (int)(100L * hits / (hits + misses))); +} +#endif + +/* + * Hash a command name. + */ +hashname(cp) + register char *cp; +{ + register long h = 0; + + while (*cp) + h = hash(h, *cp++); + return ((int) h); +} diff --git a/bin/csh/sh.exec.h b/bin/csh/sh.exec.h new file mode 100644 index 0000000..919f59f --- /dev/null +++ b/bin/csh/sh.exec.h @@ -0,0 +1,23 @@ +/* + * Xhash is an array of HSHSIZ bits (HSHSIZ / 8 chars), which are used + * to hash execs. If it is allocated (havhash true), then to tell + * whether ``name'' is (possibly) present in the i'th component + * of the variable path, you look at the bit in xhash indexed by + * hash(hashname("name"), i). This is setup automatically + * after .login is executed, and recomputed whenever ``path'' is + * changed. + * The two part hash function is designed to let texec() call the + * more expensive hashname() only once and the simple hash() several + * times (once for each path component checked). + * Byte size is assumed to be 8. + */ +#define HSHSIZ 8192 /* 1k bytes */ +#define HSHMASK (HSHSIZ - 1) +#define HSHMUL 243 +char xhash[HSHSIZ / 8]; +#define hash(a, b) ((a) * HSHMUL + (b) & HSHMASK) +#define bit(h, b) ((h)[(b) >> 3] & 1 << ((b) & 7)) /* bit test */ +#define bis(h, b) ((h)[(b) >> 3] |= 1 << ((b) & 7)) /* bit set */ +#ifdef VFORK +int hits, misses; +#endif diff --git a/bin/csh/sh.exec2.c b/bin/csh/sh.exec2.c new file mode 100644 index 0000000..29d4b36 --- /dev/null +++ b/bin/csh/sh.exec2.c @@ -0,0 +1,248 @@ +/* + * From the 4.4-Lite2 CD's csh sources and modified appropriately. +*/ + +#if !defined(lint) && defined(DOSCCS) +static char *sccsid = "@(#)sh.exec2.c 1.0 (2.11BSD) 1996/9/20"; +#endif + +#include "sh.h" +#include +#include +#include +#include +#include "sh.exec.h" + +extern char *justabs[]; /* in sh.exec.c */ + +static int +iscommand(name) + char *name; +{ + register char **pv; + register char *sav; + register struct varent *v; + bool slash = any(name, '/'); + int hashval = 0, hashval1, i; + + v = adrof("path"); + if (v == 0 || v->vec[0] == 0 || slash) + pv = justabs; + else + pv = v->vec; + sav = strspl("/", name); /* / command name for postpending */ + if (havhash) + hashval = hashname(name); + i = 0; + do { + if (!slash && pv[0][0] == '/' && havhash) { + hashval1 = hash(hashval, i); + if (!bit(xhash, hashval1)) + goto cont; + } + if (pv[0][0] == 0 || eq(pv[0], ".")) { /* don't make ./xxx */ + if (executable(NULL, name, 0)) { + xfree(sav); + return i + 1; + } + } + else { + if (executable(*pv, sav, 0)) { + xfree(sav); + return i + 1; + } + } +cont: + pv++; + i++; + } while (*pv); + xfree(sav); + return 0; +} + +/* Also by: + * Andreas Luik + * I S A GmbH - Informationssysteme fuer computerintegrierte Automatisierung + * Azenberstr. 35 + * D-7000 Stuttgart 1 + * West-Germany + * is the executable() routine below and changes to iscommand(). + * Thanks again!! + */ + +/* + * executable() examines the pathname obtained by concatenating dir and name + * (dir may be NULL), and returns 1 either if it is executable by us, or + * if dir_ok is set and the pathname refers to a directory. + * This is a bit kludgy, but in the name of optimization... + */ +static int +executable(dir, name, dir_ok) + char *dir, *name; + bool dir_ok; +{ + struct stat stbuf; + char path[MAXPATHLEN + 1]; + register char *dp, *sp; + char *strname; + + if (dir && *dir) { + for (dp = path, sp = dir; *sp; *dp++ = *sp++) + if (dp == &path[MAXPATHLEN + 1]) { + *--dp = '\0'; + break; + } + for (sp = name; *sp; *dp++ = *sp++) + if (dp == &path[MAXPATHLEN + 1]) { + *--dp = '\0'; + break; + } + *dp = '\0'; + strname = path; + } + else + strname = name; + return (stat(strname, &stbuf) != -1 && + ((S_ISREG(stbuf.st_mode) && + /* save time by not calling access() in the hopeless case */ + (stbuf.st_mode & (S_IXOTH | S_IXGRP | S_IXUSR)) && + access(strname, X_OK) == 0) || + (dir_ok && S_ISDIR(stbuf.st_mode)))); +} +/* The dowhich() is by: + * Andreas Luik + * I S A GmbH - Informationssysteme fuer computerintegrierte Automatisierung + * Azenberstr. 35 + * D-7000 Stuttgart 1 + * West-Germany + * Thanks!! + */ +/*ARGSUSED*/ +void +dowhich(v, c) + register char **v; + struct command *c; +{ + struct wordent lex[3]; + struct varent *vp; + + lex[0].next = &lex[1]; + lex[1].next = &lex[2]; + lex[2].next = &lex[0]; + + lex[0].prev = &lex[2]; + lex[1].prev = &lex[0]; + lex[2].prev = &lex[1]; + + lex[0].word = ""; + lex[2].word = "\n"; + + while (*++v) { + if ((vp = adrof1(*v, &aliases)) != NULL) { + (void) printf("%s: \t aliased to ", *v); + blkpr(vp->vec); + (void) putchar('\n'); + } + else { + lex[1].word = *v; + tellmewhat(lex); + } + } +} + +static void +tellmewhat(lex) + struct wordent *lex; +{ + int i; + struct biltins *bptr; + register struct wordent *sp = lex->next; + bool aliased = 0; + register char *s2; + char *s0, *s1, *cmd; + char qc; + + if (adrof1(sp->word, &aliases)) { + alias(lex); + sp = lex->next; + aliased = 1; + } + + s0 = sp->word; /* to get the memory freeing right... */ + + /* handle quoted alias hack */ + if ((*(sp->word) & (QUOTE | TRIM)) == QUOTE) + (sp->word)++; + + /* do quoting, if it hasn't been done */ + s1 = s2 = sp->word; + while (*s2) + switch (*s2) { + case '\'': + case '"': + qc = *s2++; + while (*s2 && *s2 != qc) + *s1++ = *s2++ | QUOTE; + if (*s2) + s2++; + break; + case '\\': + if (*++s2) + *s1++ = *s2++ | QUOTE; + break; + default: + *s1++ = *s2++; + } + *s1 = '\0'; + + for (bptr = bfunc; bptr < &bfunc[nbfunc]; bptr++) { + if (eq(sp->word, bptr->bname)) { + if (aliased) + prlex(lex); + (void) printf("%s: shell built-in command.\n", sp->word); + sp->word = s0; /* we save and then restore this */ + return; + } + } + + sp->word = cmd = globone(sp->word); + + if ((i = iscommand(strip(sp->word))) != 0) { + register char **pv; + register struct varent *v; + bool slash = any(sp->word, '/'); + + v = adrof("path"); + if (v == 0 || v->vec[0] == 0 || slash) + pv = justabs; + else + pv = v->vec; + + while (--i) + pv++; + if (pv[0][0] == 0 || eq(pv[0], ".")) { + if (!slash) { + sp->word = strspl("./", sp->word); + prlex(lex); + xfree(sp->word); + } + else + prlex(lex); + sp->word = s0; /* we save and then restore this */ + xfree(cmd); + return; + } + s1 = strspl(*pv, "/"); + sp->word = strspl(s1, sp->word); + xfree(s1); + prlex(lex); + xfree(sp->word); + } + else { + if (aliased) + prlex(lex); + (void) printf("%s: Command not found.\n", sp->word); + } + sp->word = s0; /* we save and then restore this */ + xfree(cmd); +} diff --git a/bin/csh/sh.exp.c b/bin/csh/sh.exp.c new file mode 100644 index 0000000..8ba8f41 --- /dev/null +++ b/bin/csh/sh.exp.c @@ -0,0 +1,596 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley Software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if !defined(lint) && defined(DOSCCS) +static char *sccsid = "@(#)sh.exp.c 5.3 (Berkeley) 6/23/85"; +#endif + +#include "sh.h" + +/* + * C shell + */ + +#define IGNORE 1 /* in ignore, it means to ignore value, just parse */ +#define NOGLOB 2 /* in ignore, it means not to globone */ + +#define ADDOP 1 +#define MULOP 2 +#define EQOP 4 +#define RELOP 8 +#define RESTOP 16 +#define ANYOP 31 + +#define EQEQ 1 +#define GTR 2 +#define LSS 4 +#define NOTEQ 6 +#define EQMATCH 7 +#define NOTEQMATCH 8 + +exp(vp) + register char ***vp; +{ + + return (exp0(vp, 0)); +} + +exp0(vp, ignore) + register char ***vp; + bool ignore; +{ + register int p1 = exp1(vp, ignore); + +#ifdef EDEBUG + etraci("exp0 p1", p1, vp); +#endif + if (**vp && eq(**vp, "||")) { + register int p2; + + (*vp)++; + p2 = exp0(vp, (ignore&IGNORE) || p1); +#ifdef EDEBUG + etraci("exp0 p2", p2, vp); +#endif + return (p1 || p2); + } + return (p1); +} + +exp1(vp, ignore) + register char ***vp; +{ + register int p1 = exp2(vp, ignore); + +#ifdef EDEBUG + etraci("exp1 p1", p1, vp); +#endif + if (**vp && eq(**vp, "&&")) { + register int p2; + + (*vp)++; + p2 = exp1(vp, (ignore&IGNORE) || !p1); +#ifdef EDEBUG + etraci("exp1 p2", p2, vp); +#endif + return (p1 && p2); + } + return (p1); +} + +exp2(vp, ignore) + register char ***vp; + bool ignore; +{ + register int p1 = exp2a(vp, ignore); + +#ifdef EDEBUG + etraci("exp3 p1", p1, vp); +#endif + if (**vp && eq(**vp, "|")) { + register int p2; + + (*vp)++; + p2 = exp2(vp, ignore); +#ifdef EDEBUG + etraci("exp3 p2", p2, vp); +#endif + return (p1 | p2); + } + return (p1); +} + +exp2a(vp, ignore) + register char ***vp; + bool ignore; +{ + register int p1 = exp2b(vp, ignore); + +#ifdef EDEBUG + etraci("exp2a p1", p1, vp); +#endif + if (**vp && eq(**vp, "^")) { + register int p2; + + (*vp)++; + p2 = exp2a(vp, ignore); +#ifdef EDEBUG + etraci("exp2a p2", p2, vp); +#endif + return (p1 ^ p2); + } + return (p1); +} + +exp2b(vp, ignore) + register char ***vp; + bool ignore; +{ + register int p1 = exp2c(vp, ignore); + +#ifdef EDEBUG + etraci("exp2b p1", p1, vp); +#endif + if (**vp && eq(**vp, "&")) { + register int p2; + + (*vp)++; + p2 = exp2b(vp, ignore); +#ifdef EDEBUG + etraci("exp2b p2", p2, vp); +#endif + return (p1 & p2); + } + return (p1); +} + +exp2c(vp, ignore) + register char ***vp; + bool ignore; +{ + register char *p1 = exp3(vp, ignore); + register char *p2; + register int i; + +#ifdef EDEBUG + etracc("exp2c p1", p1, vp); +#endif + if (i = isa(**vp, EQOP)) { + (*vp)++; + if (i == EQMATCH || i == NOTEQMATCH) + ignore |= NOGLOB; + p2 = exp3(vp, ignore); +#ifdef EDEBUG + etracc("exp2c p2", p2, vp); +#endif + if (!(ignore&IGNORE)) switch (i) { + + case EQEQ: + i = eq(p1, p2); + break; + + case NOTEQ: + i = !eq(p1, p2); + break; + + case EQMATCH: + i = Gmatch(p1, p2); + break; + + case NOTEQMATCH: + i = !Gmatch(p1, p2); + break; + } + xfree(p1), xfree(p2); + return (i); + } + i = egetn(p1); + xfree(p1); + return (i); +} + +char * +exp3(vp, ignore) + register char ***vp; + bool ignore; +{ + register char *p1, *p2; + register int i; + + p1 = exp3a(vp, ignore); +#ifdef EDEBUG + etracc("exp3 p1", p1, vp); +#endif + if (i = isa(**vp, RELOP)) { + (*vp)++; + if (**vp && eq(**vp, "=")) + i |= 1, (*vp)++; + p2 = exp3(vp, ignore); +#ifdef EDEBUG + etracc("exp3 p2", p2, vp); +#endif + if (!(ignore&IGNORE)) switch (i) { + + case GTR: + i = egetn(p1) > egetn(p2); + break; + + case GTR|1: + i = egetn(p1) >= egetn(p2); + break; + + case LSS: + i = egetn(p1) < egetn(p2); + break; + + case LSS|1: + i = egetn(p1) <= egetn(p2); + break; + } + xfree(p1), xfree(p2); + return (putn(i)); + } + return (p1); +} + +char * +exp3a(vp, ignore) + register char ***vp; + bool ignore; +{ + register char *p1, *p2, *op; + register int i; + + p1 = exp4(vp, ignore); +#ifdef EDEBUG + etracc("exp3a p1", p1, vp); +#endif + op = **vp; + if (op && any(op[0], "<>") && op[0] == op[1]) { + (*vp)++; + p2 = exp3a(vp, ignore); +#ifdef EDEBUG + etracc("exp3a p2", p2, vp); +#endif + if (op[0] == '<') + i = egetn(p1) << egetn(p2); + else + i = egetn(p1) >> egetn(p2); + xfree(p1), xfree(p2); + return (putn(i)); + } + return (p1); +} + +char * +exp4(vp, ignore) + register char ***vp; + bool ignore; +{ + register char *p1, *p2; + register int i = 0; + + p1 = exp5(vp, ignore); +#ifdef EDEBUG + etracc("exp4 p1", p1, vp); +#endif + if (isa(**vp, ADDOP)) { + register char *op = *(*vp)++; + + p2 = exp4(vp, ignore); +#ifdef EDEBUG + etracc("exp4 p2", p2, vp); +#endif + if (!(ignore&IGNORE)) switch (op[0]) { + + case '+': + i = egetn(p1) + egetn(p2); + break; + + case '-': + i = egetn(p1) - egetn(p2); + break; + } + xfree(p1), xfree(p2); + return (putn(i)); + } + return (p1); +} + +char * +exp5(vp, ignore) + register char ***vp; + bool ignore; +{ + register char *p1, *p2; + register int i = 0; + + p1 = exp6(vp, ignore); +#ifdef EDEBUG + etracc("exp5 p1", p1, vp); +#endif + if (isa(**vp, MULOP)) { + register char *op = *(*vp)++; + + p2 = exp5(vp, ignore); +#ifdef EDEBUG + etracc("exp5 p2", p2, vp); +#endif + if (!(ignore&IGNORE)) switch (op[0]) { + + case '*': + i = egetn(p1) * egetn(p2); + break; + + case '/': + i = egetn(p2); + if (i == 0) + error("Divide by 0"); + i = egetn(p1) / i; + break; + + case '%': + i = egetn(p2); + if (i == 0) + error("Mod by 0"); + i = egetn(p1) % i; + break; + } + xfree(p1), xfree(p2); + return (putn(i)); + } + return (p1); +} + +char * +exp6(vp, ignore) + register char ***vp; +{ + int ccode, i; + register char *cp, *dp, *ep; + + if (**vp == 0) + bferr("Expression syntax"); + if (eq(**vp, "!")) { + (*vp)++; + cp = exp6(vp, ignore); +#ifdef EDEBUG + etracc("exp6 ! cp", cp, vp); +#endif + i = egetn(cp); + xfree(cp); + return (putn(!i)); + } + if (eq(**vp, "~")) { + (*vp)++; + cp = exp6(vp, ignore); +#ifdef EDEBUG + etracc("exp6 ~ cp", cp, vp); +#endif + i = egetn(cp); + xfree(cp); + return (putn(~i)); + } + if (eq(**vp, "(")) { + (*vp)++; + ccode = exp0(vp, ignore); +#ifdef EDEBUG + etraci("exp6 () ccode", ccode, vp); +#endif + if (*vp == 0 || **vp == 0 || ***vp != ')') + bferr("Expression syntax"); + (*vp)++; + return (putn(ccode)); + } + if (eq(**vp, "{")) { + register char **v; + struct command faket; + char *fakecom[2]; + + faket.t_dtyp = TCOM; + faket.t_dflg = 0; + faket.t_dcar = faket.t_dcdr = faket.t_dspr = (struct command *)0; + faket.t_dcom = fakecom; + fakecom[0] = "{ ... }"; + fakecom[1] = NOSTR; + (*vp)++; + v = *vp; + for (;;) { + if (!**vp) + bferr("Missing }"); + if (eq(*(*vp)++, "}")) + break; + } + if (ignore&IGNORE) + return (""); + psavejob(); + if (pfork(&faket, -1) == 0) { + *--(*vp) = 0; + evalav(v); + exitstat(); + } + pwait(); + prestjob(); +#ifdef EDEBUG + etraci("exp6 {} status", egetn(value("status")), vp); +#endif + return (putn(egetn(value("status")) == 0)); + } + if (isa(**vp, ANYOP)) + return (""); + cp = *(*vp)++; + if (*cp == '-' && any(cp[1], "erwxfdzo")) { + struct stat stb; + + if (isa(**vp, ANYOP)) + bferr("Missing file name"); + dp = *(*vp)++; + if (ignore&IGNORE) + return (""); + ep = globone(dp); + switch (cp[1]) { + + case 'r': + i = !access(ep, 4); + break; + + case 'w': + i = !access(ep, 2); + break; + + case 'x': + i = !access(ep, 1); + break; + + default: + if (stat(ep, &stb)) { + xfree(ep); + return ("0"); + } + switch (cp[1]) { + + case 'f': + i = (stb.st_mode & S_IFMT) == S_IFREG; + break; + + case 'd': + i = (stb.st_mode & S_IFMT) == S_IFDIR; + break; + + case 'z': + i = stb.st_size == 0; + break; + + case 'e': + i = 1; + break; + + case 'o': + i = stb.st_uid == uid; + break; + } + } +#ifdef EDEBUG + etraci("exp6 -? i", i, vp); +#endif + xfree(ep); + return (putn(i)); + } +#ifdef EDEBUG + etracc("exp6 default", cp, vp); +#endif + return (ignore&NOGLOB ? savestr(cp) : globone(cp)); +} + +evalav(v) + register char **v; +{ + struct wordent paraml; + register struct wordent *hp = ¶ml; + struct command *t; + register struct wordent *wdp = hp; + + set("status", "0"); + hp->prev = hp->next = hp; + hp->word = ""; + while (*v) { + register struct wordent *new = (struct wordent *) calloc(1, sizeof *wdp); + + new->prev = wdp; + new->next = hp; + wdp->next = new; + wdp = new; + wdp->word = savestr(*v++); + } + hp->prev = wdp; + alias(¶ml); + t = syntax(paraml.next, ¶ml, 0); + if (err) + error(err); + execute(t, -1); + freelex(¶ml), freesyn(t); +} + +isa(cp, what) + register char *cp; + register int what; +{ + + if (cp == 0) + return ((what & RESTOP) != 0); + if (cp[1] == 0) { + if (what & ADDOP && (*cp == '+' || *cp == '-')) + return (1); + if (what & MULOP && (*cp == '*' || *cp == '/' || *cp == '%')) + return (1); + if (what & RESTOP && (*cp == '(' || *cp == ')' || *cp == '!' || + *cp == '~' || *cp == '^' || *cp == '"')) + return (1); + } else if (cp[2] == 0) { + if (what & RESTOP) { + if (cp[0] == '|' && cp[1] == '&') + return (1); + if (cp[0] == '<' && cp[1] == '<') + return (1); + if (cp[0] == '>' && cp[1] == '>') + return (1); + } + if (what & EQOP) { + if (cp[0] == '=') { + if (cp[1] == '=') + return (EQEQ); + if (cp[1] == '~') + return (EQMATCH); + } else if (cp[0] == '!') { + if (cp[1] == '=') + return (NOTEQ); + if (cp[1] == '~') + return (NOTEQMATCH); + } + } + } + if (what & RELOP) { + if (*cp == '<') + return (LSS); + if (*cp == '>') + return (GTR); + } + return (0); +} + +egetn(cp) + register char *cp; +{ + + if (*cp && *cp != '-' && !digit(*cp)) + bferr("Expression syntax"); + return (getn(cp)); +} + +/* Phew! */ + +#ifdef EDEBUG +etraci(str, i, vp) + char *str; + int i; + char ***vp; +{ + + printf("%s=%d\t", str, i); + blkpr(*vp); + printf("\n"); +} + +etracc(str, cp, vp) + char *str, *cp; + char ***vp; +{ + + printf("%s=%s\t", str, cp); + blkpr(*vp); + printf("\n"); +} +#endif diff --git a/bin/csh/sh.file.c b/bin/csh/sh.file.c new file mode 100644 index 0000000..1d83175 --- /dev/null +++ b/bin/csh/sh.file.c @@ -0,0 +1,596 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley Software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if !defined(lint) && defined(DOSCCS) +static char *sccsid = "@(#)sh.file.c 5.6 (Berkeley) 5/18/86"; +#endif + +#ifdef FILEC +/* + * Tenex style file name recognition, .. and more. + * History: + * Author: Ken Greer, Sept. 1975, CMU. + * Finally got around to adding to the Cshell., Ken Greer, Dec. 1981. + */ + +#include "sh.h" +#include +#include +#include + +#define TRUE 1 +#define FALSE 0 +#define ON 1 +#define OFF 0 + +#define ESC '\033' + +typedef enum {LIST, RECOGNIZE} COMMAND; + +int sortscmp(); /* defined in sh.glob.c */ + +/* + * Put this here so the binary can be patched with adb to enable file + * completion by default. Filec controls completion, nobeep controls + * ringing the terminal bell on incomplete expansions. + */ +bool filec = 0; + +static +setup_tty(on) + int on; +{ + struct sgttyb sgtty; + static struct tchars tchars; /* INT, QUIT, XON, XOFF, EOF, BRK */ + + if (on) { + (void) ioctl(SHIN, TIOCGETC, (char *)&tchars); + tchars.t_brkc = ESC; + (void) ioctl(SHIN, TIOCSETC, (char *)&tchars); + /* + * This must be done after every command: if + * the tty gets into raw or cbreak mode the user + * can't even type 'reset'. + */ + (void) ioctl(SHIN, TIOCGETP, (char *)&sgtty); + if (sgtty.sg_flags & (RAW|CBREAK)) { + sgtty.sg_flags &= ~(RAW|CBREAK); + (void) ioctl(SHIN, TIOCSETP, (char *)&sgtty); + } + } else { + tchars.t_brkc = -1; + (void) ioctl(SHIN, TIOCSETC, (char *)&tchars); + } +} + +/* + * Move back to beginning of current line + */ +static +back_to_col_1() +{ + struct sgttyb tty, tty_normal; + long omask; + + omask = sigblock(sigmask(SIGINT)); + (void) ioctl(SHIN, TIOCGETP, (char *)&tty); + tty_normal = tty; + tty.sg_flags &= ~CRMOD; + (void) ioctl(SHIN, TIOCSETN, (char *)&tty); + (void) write(SHOUT, "\r", 1); + (void) ioctl(SHIN, TIOCSETN, (char *)&tty_normal); + (void) sigsetmask(omask); +} + +/* + * Push string contents back into tty queue + */ +static +pushback(string) + char *string; +{ + register char *p; + struct sgttyb tty, tty_normal; + long omask; + + omask = sigblock(sigmask(SIGINT)); + (void) ioctl(SHOUT, TIOCGETP, (char *)&tty); + tty_normal = tty; + tty.sg_flags &= ~ECHO; + (void) ioctl(SHOUT, TIOCSETN, (char *)&tty); + + for (p = string; *p; p++) + (void) ioctl(SHOUT, TIOCSTI, p); + (void) ioctl(SHOUT, TIOCSETN, (char *)&tty_normal); + (void) sigsetmask(omask); +} + +/* + * Concatenate src onto tail of des. + * Des is a string whose maximum length is count. + * Always null terminate. + */ +static +catn(des, src, count) + register char *des, *src; + register count; +{ + + while (--count >= 0 && *des) + des++; + while (--count >= 0) + if ((*des++ = *src++) == 0) + return; + *des = '\0'; +} + +/* + * Like strncpy but always leave room for trailing \0 + * and always null terminate. + */ +static +copyn(des, src, count) + register char *des, *src; + register count; +{ + + while (--count >= 0) + if ((*des++ = *src++) == 0) + return; + *des = '\0'; +} + +static char +filetype(dir, file) + char *dir, *file; +{ + char path[MAXPATHLEN]; + struct stat statb; + + catn(strcpy(path, dir), file, sizeof path); + if (lstat(path, &statb) == 0) { + switch(statb.st_mode & S_IFMT) { + case S_IFDIR: + return ('/'); + + case S_IFLNK: + if (stat(path, &statb) == 0 && /* follow it out */ + (statb.st_mode & S_IFMT) == S_IFDIR) + return ('>'); + else + return ('@'); + + case S_IFSOCK: + return ('='); + + default: + if (statb.st_mode & 0111) + return ('*'); + } + } + return (' '); +} + +static struct winsize win; + +/* + * Print sorted down columns + */ +static +print_by_column(dir, items, count) + char *dir, *items[]; +{ + register int i, rows, r, c, maxwidth = 0, columns; + + if (ioctl(SHOUT, TIOCGWINSZ, (char *)&win) < 0 || win.ws_col == 0) + win.ws_col = 80; + for (i = 0; i < count; i++) + maxwidth = maxwidth > (r = strlen(items[i])) ? maxwidth : r; + maxwidth += 2; /* for the file tag and space */ + columns = win.ws_col / maxwidth; + if (columns == 0) + columns = 1; + rows = (count + (columns - 1)) / columns; + for (r = 0; r < rows; r++) { + for (c = 0; c < columns; c++) { + i = c * rows + r; + if (i < count) { + register int w; + + printf("%s", items[i]); + putchar(dir ? filetype(dir, items[i]) : ' '); + if (c < columns - 1) { /* last column? */ + w = strlen(items[i]) + 1; + for (; w < maxwidth; w++) + putchar(' '); + } + } + } + putchar('\n'); + } +} + +/* + * Expand file name with possible tilde usage + * ~person/mumble + * expands to + * home_directory_of_person/mumble + */ +static char * +tilde(new, old) + char *new, *old; +{ + register char *o, *p; + register struct passwd *pw; + static char person[40]; + + if (old[0] != '~') + return (strcpy(new, old)); + + for (p = person, o = &old[1]; *o && *o != '/'; *p++ = *o++) + ; + *p = '\0'; + if (person[0] == '\0') + (void) strcpy(new, value("home")); + else { + pw = getpwnam(person); + if (pw == NULL) + return (NULL); + (void) strcpy(new, pw->pw_dir); + } + (void) strcat(new, o); + return (new); +} + +/* + * Cause pending line to be printed + */ +static +retype() +{ + int pending_input = LPENDIN; + + (void) ioctl(SHOUT, TIOCLBIS, (char *)&pending_input); +} + +static +beep() +{ + + if (adrof("nobeep") == 0) + (void) write(SHOUT, "\007", 1); +} + +/* + * Erase that silly ^[ and + * print the recognized part of the string + */ +static +print_recognized_stuff(recognized_part) + char *recognized_part; +{ + + /* An optimized erasing of that silly ^[ */ + switch (strlen(recognized_part)) { + + case 0: /* erase two characters: ^[ */ + printf("\210\210 \210\210"); + break; + + case 1: /* overstrike the ^, erase the [ */ + printf("\210\210%s \210", recognized_part); + break; + + default: /* overstrike both characters ^[ */ + printf("\210\210%s", recognized_part); + break; + } + flush(); +} + +/* + * Parse full path in file into 2 parts: directory and file names + * Should leave final slash (/) at end of dir. + */ +static +extract_dir_and_name(path, dir, name) + char *path, *dir, *name; +{ + register char *p; + + p = rindex(path, '/'); + if (p == NULL) { + copyn(name, path, MAXNAMLEN); + dir[0] = '\0'; + } else { + copyn(name, ++p, MAXNAMLEN); + copyn(dir, path, p - path); + } +} + +static char * +getentry(dir_fd, looking_for_lognames) + DIR *dir_fd; +{ + register struct passwd *pw; + register struct direct *dirp; + + if (looking_for_lognames) { + if ((pw = getpwent()) == NULL) + return (NULL); + return (pw->pw_name); + } + if (dirp = readdir(dir_fd)) + return (dirp->d_name); + return (NULL); +} + +static +free_items(items) + register char **items; +{ + register int i; + + for (i = 0; items[i]; i++) + free(items[i]); + free((char *)items); +} + +#define FREE_ITEMS(items) { \ + long omask;\ +\ + omask = sigblock(sigmask(SIGINT));\ + free_items(items);\ + items = NULL;\ + (void) sigsetmask(omask);\ +} + +/* + * Perform a RECOGNIZE or LIST command on string "word". + */ +static +search(word, command, max_word_length) + char *word; + COMMAND command; +{ + static char **items = NULL; + register DIR *dir_fd; + register numitems = 0, ignoring = TRUE, nignored = 0; + register name_length, looking_for_lognames; + char tilded_dir[MAXPATHLEN + 1], dir[MAXPATHLEN + 1]; + char name[MAXNAMLEN + 1], extended_name[MAXNAMLEN+1]; + char *entry; +#define MAXITEMS 1024 + + if (items != NULL) + FREE_ITEMS(items); + + looking_for_lognames = (*word == '~') && (index(word, '/') == NULL); + if (looking_for_lognames) { + (void) setpwent(); + copyn(name, &word[1], MAXNAMLEN); /* name sans ~ */ + } else { + extract_dir_and_name(word, dir, name); + if (tilde(tilded_dir, dir) == 0) + return (0); + dir_fd = opendir(*tilded_dir ? tilded_dir : "."); + if (dir_fd == NULL) + return (0); + } + +again: /* search for matches */ + name_length = strlen(name); + for (numitems = 0; entry = getentry(dir_fd, looking_for_lognames); ) { + if (!is_prefix(name, entry)) + continue; + /* Don't match . files on null prefix match */ + if (name_length == 0 && entry[0] == '.' && + !looking_for_lognames) + continue; + if (command == LIST) { + if (numitems >= MAXITEMS) { + printf ("\nYikes!! Too many %s!!\n", + looking_for_lognames ? + "names in password file":"files"); + break; + } + if (items == NULL) + items = (char **) calloc(sizeof (items[1]), + MAXITEMS); + items[numitems] = xalloc((unsigned)strlen(entry) + 1); + copyn(items[numitems], entry, MAXNAMLEN); + numitems++; + } else { /* RECOGNIZE command */ + if (ignoring && ignored(entry)) + nignored++; + else if (recognize(extended_name, + entry, name_length, ++numitems)) + break; + } + } + if (ignoring && numitems == 0 && nignored > 0) { + ignoring = FALSE; + nignored = 0; + if (looking_for_lognames) + (void) setpwent(); + else + rewinddir(dir_fd); + goto again; + } + + if (looking_for_lognames) + (void) endpwent(); + else + closedir(dir_fd); + if (numitems == 0) + return (0); + if (command == RECOGNIZE) { + if (looking_for_lognames) + copyn(word, "~", 1); + else + /* put back dir part */ + copyn(word, dir, max_word_length); + /* add extended name */ + catn(word, extended_name, max_word_length); + return (numitems); + } + else { /* LIST */ + qsort((char *)items, numitems, sizeof(items[1]), sortscmp); + print_by_column(looking_for_lognames ? NULL : tilded_dir, + items, numitems); + if (items != NULL) + FREE_ITEMS(items); + } + return (0); +} + +/* + * Object: extend what user typed up to an ambiguity. + * Algorithm: + * On first match, copy full entry (assume it'll be the only match) + * On subsequent matches, shorten extended_name to the first + * character mismatch between extended_name and entry. + * If we shorten it back to the prefix length, stop searching. + */ +static +recognize(extended_name, entry, name_length, numitems) + char *extended_name, *entry; +{ + + if (numitems == 1) /* 1st match */ + copyn(extended_name, entry, MAXNAMLEN); + else { /* 2nd & subsequent matches */ + register char *x, *ent; + register int len = 0; + + x = extended_name; + for (ent = entry; *x && *x == *ent++; x++, len++) + ; + *x = '\0'; /* Shorten at 1st char diff */ + if (len == name_length) /* Ambiguous to prefix? */ + return (-1); /* So stop now and save time */ + } + return (0); +} + +/* + * Return true if check matches initial chars in template. + * This differs from PWB imatch in that if check is null + * it matches anything. + */ +static +is_prefix(check, template) + register char *check, *template; +{ + + do + if (*check == 0) + return (TRUE); + while (*check++ == *template++); + return (FALSE); +} + +/* + * Return true if the chars in template appear at the + * end of check, I.e., are it's suffix. + */ +static +is_suffix(check, template) + char *check, *template; +{ + register char *c, *t; + + for (c = check; *c++;) + ; + for (t = template; *t++;) + ; + for (;;) { + if (t == template) + return 1; + if (c == check || *--t != *--c) + return 0; + } +} + +tenex(inputline, inputline_size) + char *inputline; + int inputline_size; +{ + register int numitems, num_read; + + setup_tty(ON); + while ((num_read = read(SHIN, inputline, inputline_size)) > 0) { + static char *delims = " '\"\t;&<>()|^%"; + register char *str_end, *word_start, last_char, should_retype; + register int space_left; + COMMAND command; + + last_char = inputline[num_read - 1] & 0177; + + if (last_char == '\n' || num_read == inputline_size) + break; + command = (last_char == ESC) ? RECOGNIZE : LIST; + if (command == LIST) + putchar('\n'); + str_end = &inputline[num_read]; + if (last_char == ESC) + --str_end; /* wipeout trailing cmd char */ + *str_end = '\0'; + /* + * Find LAST occurence of a delimiter in the inputline. + * The word start is one character past it. + */ + for (word_start = str_end; word_start > inputline; --word_start) + if (index(delims, word_start[-1])) + break; + space_left = inputline_size - (word_start - inputline) - 1; + numitems = search(word_start, command, space_left); + + if (command == RECOGNIZE) { + /* print from str_end on */ + print_recognized_stuff(str_end); + if (numitems != 1) /* Beep = No match/ambiguous */ + beep(); + } + + /* + * Tabs in the input line cause trouble after a pushback. + * tty driver won't backspace over them because column + * positions are now incorrect. This is solved by retyping + * over current line. + */ + should_retype = FALSE; + if (index(inputline, '\t')) { /* tab char in input line? */ + back_to_col_1(); + should_retype = TRUE; + } + if (command == LIST) /* Always retype after a LIST */ + should_retype = TRUE; + if (should_retype) + printprompt(); + pushback(inputline); + if (should_retype) + retype(); + } + setup_tty(OFF); + return (num_read); +} + +static +ignored(entry) + register char *entry; +{ + struct varent *vp; + register char **cp; + + if ((vp = adrof("fignore")) == NULL || (cp = vp->vec) == NULL) + return (FALSE); + for (; *cp != NULL; cp++) + if (is_suffix(entry, *cp)) + return (TRUE); + return (FALSE); +} +#endif FILEC diff --git a/bin/csh/sh.func.c b/bin/csh/sh.func.c new file mode 100644 index 0000000..fcb6c6a --- /dev/null +++ b/bin/csh/sh.func.c @@ -0,0 +1,1154 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley Software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if !defined(lint) && defined(DOSCCS) +static char *sccsid = "@(#)sh.func.c 5.3 (Berkeley) 5/13/86"; +#endif + +#include "sh.h" +#include + +/* + * C shell + */ + +struct biltins * +isbfunc(t) + struct command *t; +{ + register char *cp = t->t_dcom[0]; + register struct biltins *bp, *bp1, *bp2; + int dolabel(), dofg1(), dobg1(); + static struct biltins label = { "", dolabel, 0, 0 }; + static struct biltins foregnd = { "%job", dofg1, 0, 0 }; + static struct biltins backgnd = { "%job &", dobg1, 0, 0 }; + + if (lastchr(cp) == ':') { + label.bname = cp; + return (&label); + } + if (*cp == '%') { + if (t->t_dflg & FAND) { + t->t_dflg &= ~FAND; + backgnd.bname = cp; + return (&backgnd); + } + foregnd.bname = cp; + return (&foregnd); + } + /* + * Binary search + * Bp1 is the beginning of the current search range. + * Bp2 is one past the end. + */ + for (bp1 = bfunc, bp2 = bfunc + nbfunc; bp1 < bp2;) { + register i; + + bp = bp1 + (bp2 - bp1 >> 1); + if ((i = *cp - *bp->bname) == 0 && + (i = strcmp(cp, bp->bname)) == 0) + return bp; + if (i < 0) + bp2 = bp; + else + bp1 = bp + 1; + } + return (0); +} + +func(t, bp) + register struct command *t; + register struct biltins *bp; +{ + int i; + + xechoit(t->t_dcom); + setname(bp->bname); + i = blklen(t->t_dcom) - 1; + if (i < bp->minargs) + bferr("Too few arguments"); + if (i > bp->maxargs) + bferr("Too many arguments"); + (*bp->bfunct)(t->t_dcom, t); +} + +dolabel() +{ + +} + +doonintr(v) + char **v; +{ + register char *cp; + register char *vv = v[1]; + + if (parintr == SIG_IGN) + return; + if (setintr && intty) + bferr("Can't from terminal"); + cp = gointr, gointr = 0, xfree(cp); + if (vv == 0) { + if (setintr) + (void) sigblock(sigmask(SIGINT)); + else + (void) signal(SIGINT, SIG_DFL); + gointr = 0; + } else if (eq((vv = strip(vv)), "-")) { + (void) signal(SIGINT, SIG_IGN); + gointr = "-"; + } else { + gointr = savestr(vv); + (void) signal(SIGINT, pintr); + } +} + +donohup() +{ + + if (intty) + bferr("Can't from terminal"); + if (setintr == 0) { + (void) signal(SIGHUP, SIG_IGN); +#ifdef CC + submit(getpid()); +#endif + } +} + +dozip() +{ + + ; +} + +prvars() +{ + + plist(&shvhed); +} + +doalias(v) + register char **v; +{ + register struct varent *vp; + register char *p; + + v++; + p = *v++; + if (p == 0) + plist(&aliases); + else if (*v == 0) { + vp = adrof1(strip(p), &aliases); + if (vp) + blkpr(vp->vec), printf("\n"); + } else { + if (eq(p, "alias") || eq(p, "unalias")) { + setname(p); + bferr("Too dangerous to alias that"); + } + set1(strip(p), saveblk(v), &aliases); + } +} + +unalias(v) + char **v; +{ + + unset1(v, &aliases); +} + +dologout() +{ + + islogin(); + goodbye(); +} + +dologin(v) + char **v; +{ + + islogin(); + rechist(); + (void) signal(SIGTERM, parterm); + execl("/bin/login", "login", v[1], 0); + untty(); + exit(1); +} + +#ifdef NEWGRP +donewgrp(v) + char **v; +{ + + if (chkstop == 0 && setintr) + panystop(0); + (void) signal(SIGTERM, parterm); + execl("/bin/newgrp", "newgrp", v[1], 0); + execl("/usr/bin/newgrp", "newgrp", v[1], 0); + untty(); + exit(1); +} +#endif + +islogin() +{ + + if (chkstop == 0 && setintr) + panystop(0); + if (loginsh) + return; + error("Not login shell"); +} + +doif(v, kp) + char **v; + struct command *kp; +{ + register int i; + register char **vv; + + v++; + i = exp(&v); + vv = v; + if (*vv == NOSTR) + bferr("Empty if"); + if (eq(*vv, "then")) { + if (*++vv) + bferr("Improper then"); + setname("then"); + /* + * If expression was zero, then scan to else, + * otherwise just fall into following code. + */ + if (!i) + search(ZIF, 0); + return; + } + /* + * Simple command attached to this if. + * Left shift the node in this tree, munging it + * so we can reexecute it. + */ + if (i) { + lshift(kp->t_dcom, vv - kp->t_dcom); + reexecute(kp); + donefds(); + } +} + +/* + * Reexecute a command, being careful not + * to redo i/o redirection, which is already set up. + */ +reexecute(kp) + register struct command *kp; +{ + + kp->t_dflg &= FSAVE; + kp->t_dflg |= FREDO; + /* + * If tty is still ours to arbitrate, arbitrate it; + * otherwise dont even set pgrp's as the jobs would + * then have no way to get the tty (we can't give it + * to them, and our parent wouldn't know their pgrp, etc. + */ + execute(kp, tpgrp > 0 ? tpgrp : -1); +} + +doelse() +{ + + search(ZELSE, 0); +} + +dogoto(v) + char **v; +{ + register struct whyle *wp; + char *lp; + + /* + * While we still can, locate any unknown ends of existing loops. + * This obscure code is the WORST result of the fact that we + * don't really parse. + */ + for (wp = whyles; wp; wp = wp->w_next) + if (wp->w_end == 0) { + search(ZBREAK, 0); + wp->w_end = btell(); + } else + bseek(wp->w_end); + search(ZGOTO, 0, lp = globone(v[1])); + xfree(lp); + /* + * Eliminate loops which were exited. + */ + wfree(); +} + +doswitch(v) + register char **v; +{ + register char *cp, *lp; + + v++; + if (!*v || *(*v++) != '(') + goto syntax; + cp = **v == ')' ? "" : *v++; + if (*(*v++) != ')') + v--; + if (*v) +syntax: + error("Syntax error"); + search(ZSWITCH, 0, lp = globone(cp)); + xfree(lp); +} + +dobreak() +{ + + if (whyles) + toend(); + else + bferr("Not in while/foreach"); +} + +doexit(v) + char **v; +{ + + if (chkstop == 0) + panystop(0); + /* + * Don't DEMAND parentheses here either. + */ + v++; + if (*v) { + set("status", putn(exp(&v))); + if (*v) + bferr("Expression syntax"); + } + btoeof(); + if (intty) + (void) close(SHIN); +} + +doforeach(v) + register char **v; +{ + register char *cp; + register struct whyle *nwp; + + v++; + cp = strip(*v); + while (*cp && letter(*cp)) + cp++; + if (*cp || strlen(*v) >= 20) + bferr("Invalid variable"); + cp = *v++; + if (v[0][0] != '(' || v[blklen(v) - 1][0] != ')') + bferr("Words not ()'ed"); + v++; + gflag = 0, tglob(v); + v = glob(v); + if (v == 0) + bferr("No match"); + nwp = (struct whyle *) calloc(1, sizeof *nwp); + nwp->w_fe = nwp->w_fe0 = v; gargv = 0; + nwp->w_start = btell(); + nwp->w_fename = savestr(cp); + nwp->w_next = whyles; + whyles = nwp; + /* + * Pre-read the loop so as to be more + * comprehensible to a terminal user. + */ + if (intty) + preread(); + doagain(); +} + +dowhile(v) + char **v; +{ + register int status; + register bool again = whyles != 0 && whyles->w_start == lineloc && + whyles->w_fename == 0; + + v++; + /* + * Implement prereading here also, taking care not to + * evaluate the expression before the loop has been read up + * from a terminal. + */ + if (intty && !again) + status = !exp0(&v, 1); + else + status = !exp(&v); + if (*v) + bferr("Expression syntax"); + if (!again) { + register struct whyle *nwp = (struct whyle *) calloc(1, sizeof (*nwp)); + + nwp->w_start = lineloc; + nwp->w_end = 0; + nwp->w_next = whyles; + whyles = nwp; + if (intty) { + /* + * The tty preread + */ + preread(); + doagain(); + return; + } + } + if (status) + /* We ain't gonna loop no more, no more! */ + toend(); +} + +preread() +{ + + whyles->w_end = -1; + if (setintr) + (void) sigsetmask(sigblock(0L) & ~sigmask(SIGINT)); + search(ZBREAK, 0); + if (setintr) + (void) sigblock(sigmask(SIGINT)); + whyles->w_end = btell(); +} + +doend() +{ + + if (!whyles) + bferr("Not in while/foreach"); + whyles->w_end = btell(); + doagain(); +} + +docontin() +{ + + if (!whyles) + bferr("Not in while/foreach"); + doagain(); +} + +doagain() +{ + + /* Repeating a while is simple */ + if (whyles->w_fename == 0) { + bseek(whyles->w_start); + return; + } + /* + * The foreach variable list actually has a spurious word + * ")" at the end of the w_fe list. Thus we are at the + * of the list if one word beyond this is 0. + */ + if (!whyles->w_fe[1]) { + dobreak(); + return; + } + set(whyles->w_fename, savestr(*whyles->w_fe++)); + bseek(whyles->w_start); +} + +dorepeat(v, kp) + char **v; + struct command *kp; +{ + register int i; + register long omask; + + i = getn(v[1]); + if (setintr) + omask = sigblock(sigmask(SIGINT)) & ~sigmask(SIGINT); + lshift(v, 2); + while (i > 0) { + if (setintr) + (void) sigsetmask(omask); + reexecute(kp); + --i; + } + donefds(); + if (setintr) + (void) sigsetmask(omask); +} + +doswbrk() +{ + + search(ZBRKSW, 0); +} + +srchx(cp) + register char *cp; +{ + register struct srch *sp, *sp1, *sp2; + register i; + + /* + * Binary search + * Sp1 is the beginning of the current search range. + * Sp2 is one past the end. + */ + for (sp1 = srchn, sp2 = srchn + nsrchn; sp1 < sp2;) { + sp = sp1 + (sp2 - sp1 >> 1); + if ((i = *cp - *sp->s_name) == 0 && + (i = strcmp(cp, sp->s_name)) == 0) + return sp->s_value; + if (i < 0) + sp2 = sp; + else + sp1 = sp + 1; + } + return (-1); +} + +char Stype; +char *Sgoal; + +/*VARARGS2*/ +search(type, level, goal) + int type; + register int level; + char *goal; +{ + char wordbuf[BUFSIZ]; + register char *aword = wordbuf; + register char *cp; + + Stype = type; Sgoal = goal; + if (type == ZGOTO) + bseek((off_t)0); + do { + if (intty && fseekp == feobp) + printf("? "), flush(); + aword[0] = 0; + (void) getword(aword); + switch (srchx(aword)) { + + case ZELSE: + if (level == 0 && type == ZIF) + return; + break; + + case ZIF: + while (getword(aword)) + continue; + if ((type == ZIF || type == ZELSE) && eq(aword, "then")) + level++; + break; + + case ZENDIF: + if (type == ZIF || type == ZELSE) + level--; + break; + + case ZFOREACH: + case ZWHILE: + if (type == ZBREAK) + level++; + break; + + case ZEND: + if (type == ZBREAK) + level--; + break; + + case ZSWITCH: + if (type == ZSWITCH || type == ZBRKSW) + level++; + break; + + case ZENDSW: + if (type == ZSWITCH || type == ZBRKSW) + level--; + break; + + case ZLABEL: + if (type == ZGOTO && getword(aword) && eq(aword, goal)) + level = -1; + break; + + default: + if (type != ZGOTO && (type != ZSWITCH || level != 0)) + break; + if (lastchr(aword) != ':') + break; + aword[strlen(aword) - 1] = 0; + if (type == ZGOTO && eq(aword, goal) || type == ZSWITCH && eq(aword, "default")) + level = -1; + break; + + case ZCASE: + if (type != ZSWITCH || level != 0) + break; + (void) getword(aword); + if (lastchr(aword) == ':') + aword[strlen(aword) - 1] = 0; + cp = strip(Dfix1(aword)); + if (Gmatch(goal, cp)) + level = -1; + xfree(cp); + break; + + case ZDEFAULT: + if (type == ZSWITCH && level == 0) + level = -1; + break; + } + (void) getword(NOSTR); + } while (level >= 0); +} + +getword(wp) + register char *wp; +{ + register int found = 0; + register int c, d; + + c = readc(1); + d = 0; + do { + while (c == ' ' || c == '\t') + c = readc(1); + if (c == '#') + do + c = readc(1); + while (c >= 0 && c != '\n'); + if (c < 0) + goto past; + if (c == '\n') { + if (wp) + break; + return (0); + } + unreadc(c); + found = 1; + do { + c = readc(1); + if (c == '\\' && (c = readc(1)) == '\n') + c = ' '; + if (c == '\'' || c == '"') + if (d == 0) + d = c; + else if (d == c) + d = 0; + if (c < 0) + goto past; + if (wp) + *wp++ = c; + } while ((d || c != ' ' && c != '\t') && c != '\n'); + } while (wp == 0); + unreadc(c); + if (found) + *--wp = 0; + return (found); + +past: + switch (Stype) { + + case ZIF: + bferr("then/endif not found"); + + case ZELSE: + bferr("endif not found"); + + case ZBRKSW: + case ZSWITCH: + bferr("endsw not found"); + + case ZBREAK: + bferr("end not found"); + + case ZGOTO: + setname(Sgoal); + bferr("label not found"); + } + /*NOTREACHED*/ +} + +toend() +{ + + if (whyles->w_end == 0) { + search(ZBREAK, 0); + whyles->w_end = btell() - 1; + } else + bseek(whyles->w_end); + wfree(); +} + +wfree() +{ + long o = btell(); + + while (whyles) { + register struct whyle *wp = whyles; + register struct whyle *nwp = wp->w_next; + + if (o >= wp->w_start && (wp->w_end == 0 || o < wp->w_end)) + break; + if (wp->w_fe0) + blkfree(wp->w_fe0); + if (wp->w_fename) + xfree(wp->w_fename); + xfree((char *)wp); + whyles = nwp; + } +} + +doecho(v) + char **v; +{ + + echo(' ', v); +} + +doglob(v) + char **v; +{ + + echo(0, v); + flush(); +} + +echo(sep, v) + char sep; + register char **v; +{ + register char *cp; + int nonl = 0; + + if (setintr) + (void) sigsetmask(sigblock(0L) & ~sigmask(SIGINT)); + v++; + if (*v == 0) + return; + gflag = 0, tglob(v); + if (gflag) { + v = glob(v); + if (v == 0) + bferr("No match"); + } else + trim(v); + if (sep == ' ' && *v && !strcmp(*v, "-n")) + nonl++, v++; + while (cp = *v++) { + register int c; + + while (c = *cp++) + putchar(c | QUOTE); + if (*v) + putchar(sep | QUOTE); + } + if (sep && nonl == 0) + putchar('\n'); + else + flush(); + if (setintr) + (void) sigblock(sigmask(SIGINT)); + if (gargv) + blkfree(gargv), gargv = 0; +} + +char **environ; + +dosetenv(v) + register char **v; +{ + char *vp, *lp; + + v++; + if ((vp = *v++) == 0) { + register char **ep; + + if (setintr) + (void) sigsetmask(sigblock(0L) & ~ sigmask(SIGINT)); + for (ep = environ; *ep; ep++) + printf("%s\n", *ep); + return; + } + if ((lp = *v++) == 0) + lp = ""; + setenv(vp, lp = globone(lp)); + if (eq(vp, "PATH")) { + importpath(lp); + dohash(); + } + xfree(lp); +} + +dounsetenv(v) + register char **v; +{ + + v++; + do + unsetenv(*v++); + while (*v); +} + +setenv(name, val) + char *name, *val; +{ + register char **ep = environ; + register char *cp, *dp; + char *blk[2], **oep = ep; + + for (; *ep; ep++) { + for (cp = name, dp = *ep; *cp && *cp == *dp; cp++, dp++) + continue; + if (*cp != 0 || *dp != '=') + continue; + cp = strspl("=", val); + xfree(*ep); + *ep = strspl(name, cp); + xfree(cp); + trim(ep); + return; + } + blk[0] = strspl(name, "="); blk[1] = 0; + environ = blkspl(environ, blk); + xfree((char *)oep); + setenv(name, val); +} + +unsetenv(name) + char *name; +{ + register char **ep = environ; + register char *cp, *dp; + char **oep = ep; + + for (; *ep; ep++) { + for (cp = name, dp = *ep; *cp && *cp == *dp; cp++, dp++) + continue; + if (*cp != 0 || *dp != '=') + continue; + cp = *ep; + *ep = 0; + environ = blkspl(environ, ep+1); + *ep = cp; + xfree(cp); + xfree((char *)oep); + return; + } +} + +doumask(v) + register char **v; +{ + register char *cp = v[1]; + register int i; + + if (cp == 0) { + i = umask(0); + (void) umask(i); + printf("%o\n", i); + return; + } + i = 0; + while (digit(*cp) && *cp != '8' && *cp != '9') + i = i * 8 + *cp++ - '0'; + if (*cp || i < 0 || i > 0777) + bferr("Improper mask"); + (void) umask(i); +} + + +#ifndef NOLIMITS +struct limits { + int limconst; + char *limname; + int limdiv; + char *limscale; +} limits[] = { + RLIMIT_CPU, "cputime", 1, "seconds", + RLIMIT_FSIZE, "filesize", 1024, "kbytes", + RLIMIT_DATA, "datasize", 1024, "kbytes", + RLIMIT_STACK, "stacksize", 1024, "kbytes", + RLIMIT_CORE, "coredumpsize", 1024, "kbytes", + RLIMIT_RSS, "memoryuse", 1024, "kbytes", + -1, 0, +}; + +struct limits * +findlim(cp) + char *cp; +{ + register struct limits *lp, *res; + + res = 0; + for (lp = limits; lp->limconst >= 0; lp++) + if (prefix(cp, lp->limname)) { + if (res) + bferr("Ambiguous"); + res = lp; + } + if (res) + return (res); + bferr("No such limit"); + /*NOTREACHED*/ +} + +dolimit(v) + register char **v; +{ + register struct limits *lp; + register long limit; + long getval(); + char hard = 0; + + v++; + if (*v && eq(*v, "-h")) { + hard = 1; + v++; + } + if (*v == 0) { + for (lp = limits; lp->limconst >= 0; lp++) + plim(lp, hard); + return; + } + lp = findlim(v[0]); + if (v[1] == 0) { + plim(lp, hard); + return; + } + limit = getval(lp, v+1); + if (setlim(lp, hard, limit) < 0) + error(NOSTR); +} + +long +getval(lp, v) + register struct limits *lp; + char **v; +{ + register float f; + double atof(); + char *cp = *v++; + + f = atof(cp); + while (digit(*cp) || *cp == '.' || *cp == 'e' || *cp == 'E') + cp++; + if (*cp == 0) { + if (*v == 0) + return ((long)(f+0.5) * lp->limdiv); + cp = *v; + } + switch (*cp) { + + case ':': + if (lp->limconst != RLIMIT_CPU) + goto badscal; + return ((long)(f * 60.0 + atof(cp+1))); + + case 'h': + if (lp->limconst != RLIMIT_CPU) + goto badscal; + limtail(cp, "hours"); + f *= 3600.; + break; + + case 'm': + if (lp->limconst == RLIMIT_CPU) { + limtail(cp, "minutes"); + f *= 60.; + break; + } + case 'M': + if (lp->limconst == RLIMIT_CPU) + goto badscal; + *cp = 'm'; + limtail(cp, "megabytes"); + f *= 1024.*1024.; + break; + + case 's': + if (lp->limconst != RLIMIT_CPU) + goto badscal; + limtail(cp, "seconds"); + break; + + case 'k': + if (lp->limconst == RLIMIT_CPU) + goto badscal; + limtail(cp, "kbytes"); + f *= 1024; + break; + + case 'u': + limtail(cp, "unlimited"); + return (RLIM_INFINITY); + + default: +badscal: + bferr("Improper or unknown scale factor"); + } + return ((long)(f+0.5)); +} + +limtail(cp, str0) + char *cp, *str0; +{ + register char *str = str0; + + while (*cp && *cp == *str) + cp++, str++; + if (*cp) + error("Bad scaling; did you mean ``%s''?", str0); +} + +plim(lp, hard) + register struct limits *lp; + char hard; +{ + struct rlimit rlim; + long limit; + + printf("%s \t", lp->limname); + (void) getrlimit(lp->limconst, &rlim); + limit = hard ? rlim.rlim_max : rlim.rlim_cur; + if (limit == RLIM_INFINITY) + printf("unlimited"); + else if (lp->limconst == RLIMIT_CPU) + psecs((long)limit); + else + printf("%ld %s", limit / lp->limdiv, lp->limscale); + printf("\n"); +} + +dounlimit(v) + register char **v; +{ + register struct limits *lp; + int err = 0; + char hard = 0; + + v++; + if (*v && eq(*v, "-h")) { + hard = 1; + v++; + } + if (*v == 0) { + for (lp = limits; lp->limconst >= 0; lp++) + if (setlim(lp, hard, (long)RLIM_INFINITY) < 0) + err++; + if (err) + error(NOSTR); + return; + } + while (*v) { + lp = findlim(*v++); + if (setlim(lp, hard, (long)RLIM_INFINITY) < 0) + error(NOSTR); + } +} + +setlim(lp, hard, limit) + register struct limits *lp; + char hard; + long limit; +{ + struct rlimit rlim; + + (void) getrlimit(lp->limconst, &rlim); + if (hard) + rlim.rlim_max = limit; + else if (limit == RLIM_INFINITY && geteuid() != 0) + rlim.rlim_cur = rlim.rlim_max; + else + rlim.rlim_cur = limit; + if (setrlimit(lp->limconst, &rlim) < 0) { + printf("%s: %s: Can't %s%s limit\n", bname, lp->limname, + limit == RLIM_INFINITY ? "remove" : "set", + hard ? " hard" : ""); + return (-1); + } + return (0); +} +#endif !NOLIMITS + +dosuspend() +{ + int ldisc, ctpgrp; + int (*old)(); + + if (loginsh) + error("Can't suspend a login shell (yet)"); + untty(); + old = signal(SIGTSTP, SIG_DFL); + (void) kill(0, SIGTSTP); + /* the shell stops here */ + (void) signal(SIGTSTP, old); + if (tpgrp != -1) { +retry: + (void) ioctl(FSHTTY, TIOCGPGRP, (char *)&ctpgrp); + if (ctpgrp != opgrp) { + old = signal(SIGTTIN, SIG_DFL); + (void) kill(0, SIGTTIN); + (void) signal(SIGTTIN, old); + goto retry; + } + (void) ioctl(FSHTTY, TIOCSPGRP, (char *)&shpgrp); + (void) setpgrp(0, shpgrp); + } + (void) ioctl(FSHTTY, TIOCGETD, (char *)&oldisc); + if (oldisc != NTTYDISC) { + printf("Switching to new tty driver...\n"); + ldisc = NTTYDISC; + (void) ioctl(FSHTTY, TIOCSETD, (char *)&ldisc); + } +} + +doeval(v) + char **v; +{ + char **oevalvec = evalvec; + char *oevalp = evalp; + jmp_buf osetexit; + int reenter; + char **gv = 0; + + v++; + if (*v == 0) + return; + gflag = 0, tglob(v); + if (gflag) { + gv = v = glob(v); + gargv = 0; + if (v == 0) + error("No match"); + v = copyblk(v); + } else + trim(v); + getexit(osetexit); + reenter = 0; + setexit(); + reenter++; + if (reenter == 1) { + evalvec = v; + evalp = 0; + process(0); + } + evalvec = oevalvec; + evalp = oevalp; + doneinp = 0; + if (gv) + blkfree(gv); + resexit(osetexit); + if (reenter >= 2) + error(NOSTR); +} diff --git a/bin/csh/sh.glob.c b/bin/csh/sh.glob.c new file mode 100644 index 0000000..a0f6e6c --- /dev/null +++ b/bin/csh/sh.glob.c @@ -0,0 +1,750 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley Software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if !defined(lint) && defined(DOSCCS) +static char *sccsid = "@(#)sh.glob.c 5.4.1 (2.11BSD) 1996/9/20"; +#endif + +#include "sh.h" +#include + +/* + * C Shell + */ + +int globcnt; + +char *gpath, *gpathp, *lastgpathp; +int globbed; +bool noglob; +bool nonomatch; +char *entp; +char **sortbas; +int sortscmp(); + +#define sort() qsort((char *)sortbas, &gargv[gargc] - sortbas, \ + sizeof(*sortbas), sortscmp), sortbas = &gargv[gargc] + + +char ** +glob(v) + register char **v; +{ + char agpath[BUFSIZ]; + char *agargv[GAVSIZ]; + + gpath = agpath; gpathp = gpath; *gpathp = 0; + lastgpathp = &gpath[sizeof agpath - 2]; + ginit(agargv); globcnt = 0; +#ifdef GDEBUG + printf("glob entered: "); blkpr(v); printf("\n"); +#endif + noglob = adrof("noglob") != 0; + nonomatch = adrof("nonomatch") != 0; + globcnt = noglob | nonomatch; + while (*v) + collect(*v++); +#ifdef GDEBUG + printf("glob done, globcnt=%d, gflag=%d: ", globcnt, gflag); blkpr(gargv); printf("\n"); +#endif + if (globcnt == 0 && (gflag&1)) { + blkfree(gargv), gargv = 0; + return (0); + } else + return (gargv = copyblk(gargv)); +} + +ginit(agargv) + char **agargv; +{ + + agargv[0] = 0; gargv = agargv; sortbas = agargv; gargc = 0; + gnleft = NCARGS - 4; +} + +collect(as) + register char *as; +{ + register int i; + + if (any('`', as)) { +#ifdef GDEBUG + printf("doing backp of %s\n", as); +#endif + (void) dobackp(as, 0); +#ifdef GDEBUG + printf("backp done, acollect'ing\n"); +#endif + for (i = 0; i < pargc; i++) + if (noglob) { + Gcat(pargv[i], ""); + sortbas = &gargv[gargc]; + } else + acollect(pargv[i]); + if (pargv) + blkfree(pargv), pargv = 0; +#ifdef GDEBUG + printf("acollect done\n"); +#endif + } else if (noglob || eq(as, "{") || eq(as, "{}")) { + Gcat(as, ""); + sort(); + } else + acollect(as); +} + +acollect(as) + register char *as; +{ + register int ogargc = gargc; + + gpathp = gpath; *gpathp = 0; globbed = 0; + expand(as); + if (gargc == ogargc) { + if (nonomatch) { + Gcat(as, ""); + sort(); + } + } else + sort(); +} + +/* + * String compare for qsort. Also used by filec code in sh.file.c. + */ +sortscmp(a1, a2) + char **a1, **a2; +{ + + return (strcmp(*a1, *a2)); +} + +expand(as) + char *as; +{ + register char *cs; + register char *sgpathp, *oldcs; + struct stat stb; + + sgpathp = gpathp; + cs = as; + if (*cs == '~' && gpathp == gpath) { + addpath('~'); + for (cs++; letter(*cs) || digit(*cs) || *cs == '-';) + addpath(*cs++); + if (!*cs || *cs == '/') { + if (gpathp != gpath + 1) { + *gpathp = 0; + if (gethdir(gpath + 1)) + error("Unknown user: %s", gpath + 1); + (void) strcpy(gpath, gpath + 1); + } else + (void) strcpy(gpath, value("home")); + gpathp = strend(gpath); + } + } + while (!isglob(*cs)) { + if (*cs == 0) { + if (!globbed) + Gcat(gpath, ""); + else if (stat(gpath, &stb) >= 0) { + Gcat(gpath, ""); + globcnt++; + } + goto endit; + } + addpath(*cs++); + } + oldcs = cs; + while (cs > as && *cs != '/') + cs--, gpathp--; + if (*cs == '/') + cs++, gpathp++; + *gpathp = 0; + if (*oldcs == '{') { + (void) execbrc(cs, NOSTR); + return; + } + matchdir(cs); +endit: + gpathp = sgpathp; + *gpathp = 0; +} + +matchdir(pattern) + char *pattern; +{ + struct stat stb; + register struct direct *dp; + register DIR *dirp; + + dirp = opendir(gpath); + if (dirp == NULL) { + if (globbed) + return; + goto patherr2; + } + if (fstat(dirp->dd_fd, &stb) < 0) + goto patherr1; + if (!S_ISDIR(stb.st_mode)) { + errno = ENOTDIR; + goto patherr1; + } + while ((dp = readdir(dirp)) != NULL) { + if (dp->d_ino == 0) + continue; + if (match(dp->d_name, pattern)) { + Gcat(gpath, dp->d_name); + globcnt++; + } + } + closedir(dirp); + return; + +patherr1: + closedir(dirp); +patherr2: + Perror(gpath); +} + +execbrc(p, s) + char *p, *s; +{ + char restbuf[BUFSIZ + 2]; + register char *pe, *pm, *pl; + int brclev = 0; + char *lm, savec, *sgpathp; + + for (lm = restbuf; *p != '{'; *lm++ = *p++) + continue; + for (pe = ++p; *pe; pe++) + switch (*pe) { + + case '{': + brclev++; + continue; + + case '}': + if (brclev == 0) + goto pend; + brclev--; + continue; + + case '[': + for (pe++; *pe && *pe != ']'; pe++) + continue; + if (!*pe) + error("Missing ]"); + continue; + } +pend: + if (brclev || !*pe) + error("Missing }"); + for (pl = pm = p; pm <= pe; pm++) + switch (*pm & (QUOTE|TRIM)) { + + case '{': + brclev++; + continue; + + case '}': + if (brclev) { + brclev--; + continue; + } + goto doit; + + case ','|QUOTE: + case ',': + if (brclev) + continue; +doit: + savec = *pm; + *pm = 0; + (void) strcpy(lm, pl); + (void) strcat(restbuf, pe + 1); + *pm = savec; + if (s == 0) { + sgpathp = gpathp; + expand(restbuf); + gpathp = sgpathp; + *gpathp = 0; + } else if (amatch(s, restbuf)) + return (1); + sort(); + pl = pm + 1; + continue; + + case '[': + for (pm++; *pm && *pm != ']'; pm++) + continue; + if (!*pm) + error("Missing ]"); + continue; + } + return (0); +} + +match(s, p) + char *s, *p; +{ + register int c; + register char *sentp; + char sglobbed = globbed; + + if (*s == '.' && *p != '.') + return (0); + sentp = entp; + entp = s; + c = amatch(s, p); + entp = sentp; + globbed = sglobbed; + return (c); +} + +amatch(s, p) + register char *s, *p; +{ + register int scc; + int ok, lc; + char *sgpathp; + struct stat stb; + int c, cc; + + globbed = 1; + for (;;) { + scc = *s++ & TRIM; + switch (c = *p++) { + + case '{': + return (execbrc(p - 1, s - 1)); + + case '[': + ok = 0; + lc = 077777; + while (cc = *p++) { + if (cc == ']') { + if (ok) + break; + return (0); + } + if (cc == '-') { + if (lc <= scc && scc <= *p++) + ok++; + } else + if (scc == (lc = cc)) + ok++; + } + if (cc == 0) + error("Missing ]"); + continue; + + case '*': + if (!*p) + return (1); + if (*p == '/') { + p++; + goto slash; + } + for (s--; *s; s++) + if (amatch(s, p)) + return (1); + return (0); + + case 0: + return (scc == 0); + + default: + if ((c & TRIM) != scc) + return (0); + continue; + + case '?': + if (scc == 0) + return (0); + continue; + + case '/': + if (scc) + return (0); +slash: + s = entp; + sgpathp = gpathp; + while (*s) + addpath(*s++); + addpath('/'); + if (stat(gpath, &stb) == 0 && S_ISDIR(stb.st_mode)) + if (*p == 0) { + Gcat(gpath, ""); + globcnt++; + } else + expand(p); + gpathp = sgpathp; + *gpathp = 0; + return (0); + } + } +} + +Gmatch(s, p) + register char *s, *p; +{ + register int scc; + int ok, lc; + int c, cc; + + for (;;) { + scc = *s++ & TRIM; + switch (c = *p++) { + + case '[': + ok = 0; + lc = 077777; + while (cc = *p++) { + if (cc == ']') { + if (ok) + break; + return (0); + } + if (cc == '-') { + if (lc <= scc && scc <= *p++) + ok++; + } else + if (scc == (lc = cc)) + ok++; + } + if (cc == 0) + bferr("Missing ]"); + continue; + + case '*': + if (!*p) + return (1); + for (s--; *s; s++) + if (Gmatch(s, p)) + return (1); + return (0); + + case 0: + return (scc == 0); + + default: + if ((c & TRIM) != scc) + return (0); + continue; + + case '?': + if (scc == 0) + return (0); + continue; + + } + } +} + +Gcat(s1, s2) + char *s1, *s2; +{ + register char *p, *q; + int n; + + for (p = s1; *p++;) + ; + for (q = s2; *q++;) + ; + gnleft -= (n = (p - s1) + (q - s2) - 1); + if (gnleft <= 0 || ++gargc >= GAVSIZ) + error("Arguments too long"); + gargv[gargc] = 0; + p = gargv[gargc - 1] = xalloc((unsigned)n); + for (q = s1; *p++ = *q++;) + ; + for (p--, q = s2; *p++ = *q++;) + ; +} + +addpath(c) + char c; +{ + + if (gpathp >= lastgpathp) + error("Pathname too long"); + *gpathp++ = c & TRIM; + *gpathp = 0; +} + +rscan(t, f) + register char **t; + int (*f)(); +{ + register char *p; + + while (p = *t++) + while (*p) + (*f)(*p++); +} + +trim(t) + register char **t; +{ + register char *p; + + while (p = *t++) + while (*p) + *p++ &= TRIM; +} + +tglob(t) + register char **t; +{ + register char *p, c; + + while (p = *t++) { + if (*p == '~') + gflag |= 2; + else if (*p == '{' && (p[1] == '\0' || p[1] == '}' && p[2] == '\0')) + continue; + while (c = *p++) + if (isglob(c)) + gflag |= c == '{' ? 2 : 1; + } +} + +char * +globone(str) + register char *str; +{ + char *gv[2]; + register char **gvp; + register char *cp; + + gv[0] = str; + gv[1] = 0; + gflag = 0; + tglob(gv); + if (gflag) { + gvp = glob(gv); + if (gvp == 0) { + setname(str); + bferr("No match"); + } + cp = *gvp++; + if (cp == 0) + cp = ""; + else if (*gvp) { + setname(str); + bferr("Ambiguous"); + } else + cp = strip(cp); +/* + if (cp == 0 || *gvp) { + setname(str); + bferr(cp ? "Ambiguous" : "No output"); + } +*/ + xfree((char *)gargv); gargv = 0; + } else { + trim(gv); + cp = savestr(gv[0]); + } + return (cp); +} + +/* + * Command substitute cp. If literal, then this is + * a substitution from a << redirection, and so we should + * not crunch blanks and tabs, separating words only at newlines. + */ +char ** +dobackp(cp, literal) + char *cp; + bool literal; +{ + register char *lp, *rp; + char *ep; + char word[BUFSIZ]; + char *apargv[GAVSIZ + 2]; + + if (pargv) { + abort(); + blkfree(pargv); + } + pargv = apargv; + pargv[0] = NOSTR; + pargcp = pargs = word; + pargc = 0; + pnleft = BUFSIZ - 4; + for (;;) { + for (lp = cp; *lp != '`'; lp++) { + if (*lp == 0) { + if (pargcp != pargs) + pword(); +#ifdef GDEBUG + printf("leaving dobackp\n"); +#endif + return (pargv = copyblk(pargv)); + } + psave(*lp); + } + lp++; + for (rp = lp; *rp && *rp != '`'; rp++) + if (*rp == '\\') { + rp++; + if (!*rp) + goto oops; + } + if (!*rp) +oops: + error("Unmatched `"); + ep = savestr(lp); + ep[rp - lp] = 0; + backeval(ep, literal); +#ifdef GDEBUG + printf("back from backeval\n"); +#endif + cp = rp + 1; + } +} + +backeval(cp, literal) + char *cp; + bool literal; +{ + int pvec[2]; + int quoted = (literal || (cp[0] & QUOTE)) ? QUOTE : 0; + char ibuf[BUFSIZ]; + register int icnt = 0, c; + register char *ip; + bool hadnl = 0; + char *fakecom[2]; + struct command faket; + + faket.t_dtyp = TCOM; + faket.t_dflg = 0; + faket.t_dlef = 0; + faket.t_drit = 0; + faket.t_dspr = 0; + faket.t_dcom = fakecom; + fakecom[0] = "` ... `"; + fakecom[1] = 0; + /* + * We do the psave job to temporarily change the current job + * so that the following fork is considered a separate job. + * This is so that when backquotes are used in a + * builtin function that calls glob the "current job" is not corrupted. + * We only need one level of pushed jobs as long as we are sure to + * fork here. + */ + psavejob(); + /* + * It would be nicer if we could integrate this redirection more + * with the routines in sh.sem.c by doing a fake execute on a builtin + * function that was piped out. + */ + mypipe(pvec); + if (pfork(&faket, -1) == 0) { + struct wordent paraml; + struct command *t; + + (void) close(pvec[0]); + (void) dmove(pvec[1], 1); + (void) dmove(SHDIAG, 2); + initdesc(); + arginp = cp; + while (*cp) + *cp++ &= TRIM; + (void) lex(¶ml); + if (err) + error(err); + alias(¶ml); + t = syntax(paraml.next, ¶ml, 0); + if (err) + error(err); + if (t) + t->t_dflg |= FPAR; + (void) signal(SIGTSTP, SIG_IGN); + (void) signal(SIGTTIN, SIG_IGN); + (void) signal(SIGTTOU, SIG_IGN); + execute(t, -1); + exitstat(); + } + xfree(cp); + (void) close(pvec[1]); + do { + int cnt = 0; + for (;;) { + if (icnt == 0) { + ip = ibuf; + icnt = read(pvec[0], ip, BUFSIZ); + if (icnt <= 0) { + c = -1; + break; + } + } + if (hadnl) + break; + --icnt; + c = (*ip++ & TRIM); + if (c == 0) + break; + if (c == '\n') { + /* + * Continue around the loop one + * more time, so that we can eat + * the last newline without terminating + * this word. + */ + hadnl = 1; + continue; + } + if (!quoted && (c == ' ' || c == '\t')) + break; + cnt++; + psave(c | quoted); + } + /* + * Unless at end-of-file, we will form a new word + * here if there were characters in the word, or in + * any case when we take text literally. If + * we didn't make empty words here when literal was + * set then we would lose blank lines. + */ + if (c != -1 && (cnt || literal)) + pword(); + hadnl = 0; + } while (c >= 0); +#ifdef GDEBUG + printf("done in backeval, pvec: %d %d\n", pvec[0], pvec[1]); + printf("also c = %c <%o>\n", c, c); +#endif + (void) close(pvec[0]); + pwait(); + prestjob(); +} + +psave(c) + char c; +{ + + if (--pnleft <= 0) + error("Word too long"); + *pargcp++ = c; +} + +pword() +{ + + psave(0); + if (pargc == GAVSIZ) + error("Too many words from ``"); + pargv[pargc++] = savestr(pargs); + pargv[pargc] = NOSTR; +#ifdef GDEBUG + printf("got word %s\n", pargv[pargc-1]); +#endif + pargcp = pargs; + pnleft = BUFSIZ - 4; +} diff --git a/bin/csh/sh.h b/bin/csh/sh.h new file mode 100644 index 0000000..fb8b2bf --- /dev/null +++ b/bin/csh/sh.h @@ -0,0 +1,475 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley Software License Agreement + * specifies the terms and conditions for redistribution. + * + * @(#)sh.h 5.3.2 (2.11BSD GTE) 1996/9/20 + */ + +#include +#include +#include +#include +#include +#include +#include +#include "sh.local.h" +#include "sh.char.h" + +/* + * C shell + * + * Bill Joy, UC Berkeley + * October, 1978; May 1980 + * + * Jim Kulp, IIASA, Laxenburg Austria + * April, 1980 + */ + +typedef char bool; + +#define eq(a, b) (strcmp(a, b) == 0) + +/* + * Global flags + */ +bool chkstop; /* Warned of stopped jobs... allow exit */ +bool didfds; /* Have setup i/o fd's for child */ +bool doneinp; /* EOF indicator after reset from readc */ +bool exiterr; /* Exit if error or non-zero exit status */ +bool child; /* Child shell ... errors cause exit */ +bool haderr; /* Reset was because of an error */ +bool intty; /* Input is a tty */ +bool intact; /* We are interactive... therefore prompt */ +bool justpr; /* Just print because of :p hist mod */ +bool loginsh; /* We are a loginsh -> .login/.logout */ +bool neednote; /* Need to pnotify() */ +bool noexec; /* Don't execute, just syntax check */ +bool pjobs; /* want to print jobs if interrupted */ +bool setintr; /* Set interrupts on/off -> Wait intr... */ +bool timflg; /* Time the next waited for command */ +bool havhash; /* path hashing is available */ +#ifdef FILEC +bool filec; /* doing filename expansion */ +#endif + +/* + * Global i/o info + */ +char *arginp; /* Argument input for sh -c and internal `xx` */ +int onelflg; /* 2 -> need line for -t, 1 -> exit on read */ +char *file; /* Name of shell file for $0 */ + +char *err; /* Error message from scanner/parser */ +int errno; /* Error from C library routines */ +char *shtemp; /* Temp name for << shell files in /tmp */ +struct timeval time0; /* Time at which the shell started */ +struct rusage ru0; + +/* + * Miscellany + */ +char *doldol; /* Character pid for $$ */ +int uid; /* Invokers uid */ +time_t chktim; /* Time mail last checked */ +int shpgrp; /* Pgrp of shell */ +int tpgrp; /* Terminal process group */ +/* If tpgrp is -1, leave tty alone! */ +int opgrp; /* Initial pgrp and tty pgrp */ +int oldisc; /* Initial line discipline or -1 */ + +/* + * These are declared here because they want to be + * initialized in sh.init.c (to allow them to be made readonly) + */ + +struct biltins { + char *bname; + int (*bfunct)(); + short minargs, maxargs; +} bfunc[]; +extern int nbfunc; + +struct srch { + char *s_name; + short s_value; +} srchn[]; +extern int nsrchn; + +/* + * To be able to redirect i/o for builtins easily, the shell moves the i/o + * descriptors it uses away from 0,1,2. + * Ideally these should be in units which are closed across exec's + * (this saves work) but for version 6, this is not usually possible. + * The desired initial values for these descriptors are defined in + * sh.local.h. + */ +short SHIN; /* Current shell input (script) */ +short SHOUT; /* Shell output */ +short SHDIAG; /* Diagnostic output... shell errs go here */ +short OLDSTD; /* Old standard input (def for cmds) */ + +/* + * Error control + * + * Errors in scanning and parsing set up an error message to be printed + * at the end and complete. Other errors always cause a reset. + * Because of source commands and .cshrc we need nested error catches. + */ + +jmp_buf reslab; + +#define setexit() ((void) setjmp(reslab)) +#define reset() longjmp(reslab, 0) + /* Should use structure assignment here */ +#define getexit(a) copy((char *)(a), (char *)reslab, sizeof reslab) +#define resexit(a) copy((char *)reslab, ((char *)(a)), sizeof reslab) + +char *gointr; /* Label for an onintr transfer */ +int (*parintr)(); /* Parents interrupt catch */ +int (*parterm)(); /* Parents terminate catch */ + +/* + * Lexical definitions. + * + * All lexical space is allocated dynamically. + * The eighth bit of characters is used to prevent recognition, + * and eventually stripped. + */ +#define QUOTE 0200 /* Eighth char bit used internally for 'ing */ +#define TRIM 0177 /* Mask to strip quote bit */ + +/* + * Each level of input has a buffered input structure. + * There are one or more blocks of buffered input for each level, + * exactly one if the input is seekable and tell is available. + * In other cases, the shell buffers enough blocks to keep all loops + * in the buffer. + */ +struct Bin { + off_t Bfseekp; /* Seek pointer */ + off_t Bfbobp; /* Seekp of beginning of buffers */ + off_t Bfeobp; /* Seekp of end of buffers */ + short Bfblocks; /* Number of buffer blocks */ + char **Bfbuf; /* The array of buffer blocks */ +} B; + +#define fseekp B.Bfseekp +#define fbobp B.Bfbobp +#define feobp B.Bfeobp +#define fblocks B.Bfblocks +#define fbuf B.Bfbuf + +#define btell() fseekp + +#ifndef btell +off_t btell(); +#endif + +/* + * The shell finds commands in loops by reseeking the input + * For whiles, in particular, it reseeks to the beginning of the + * line the while was on; hence the while placement restrictions. + */ +off_t lineloc; + +#ifdef TELL +bool cantell; /* Is current source tellable ? */ +#endif + +/* + * Input lines are parsed into doubly linked circular + * lists of words of the following form. + */ +struct wordent { + char *word; + struct wordent *prev; + struct wordent *next; +}; + +/* + * During word building, both in the initial lexical phase and + * when expanding $ variable substitutions, expansion by `!' and `$' + * must be inhibited when reading ahead in routines which are themselves + * processing `!' and `$' expansion or after characters such as `\' or in + * quotations. The following flags are passed to the getC routines + * telling them which of these substitutions are appropriate for the + * next character to be returned. + */ +#define DODOL 1 +#define DOEXCL 2 +#define DOALL DODOL|DOEXCL + +/* + * Labuf implements a general buffer for lookahead during lexical operations. + * Text which is to be placed in the input stream can be stuck here. + * We stick parsed ahead $ constructs during initial input, + * process id's from `$$', and modified variable values (from qualifiers + * during expansion in sh.dol.c) here. + */ +char labuf[BUFSIZ]; + +char *lap; + +/* + * Parser structure + * + * Each command is parsed to a tree of command structures and + * flags are set bottom up during this process, to be propagated down + * as needed during the semantics/exeuction pass (sh.sem.c). + */ +struct command { + short t_dtyp; /* Type of node */ + short t_dflg; /* Flags, e.g. FAND|... */ + union { + char *T_dlef; /* Input redirect word */ + struct command *T_dcar; /* Left part of list/pipe */ + } L; + union { + char *T_drit; /* Output redirect word */ + struct command *T_dcdr; /* Right part of list/pipe */ + } R; +#define t_dlef L.T_dlef +#define t_dcar L.T_dcar +#define t_drit R.T_drit +#define t_dcdr R.T_dcdr + char **t_dcom; /* Command/argument vector */ + struct command *t_dspr; /* Pointer to ()'d subtree */ + short t_nice; +}; + +#define TCOM 1 /* t_dcom t_drit */ +#define TPAR 2 /* ( t_dspr ) t_drit */ +#define TFIL 3 /* t_dlef | t_drit */ +#define TLST 4 /* t_dlef ; t_drit */ +#define TOR 5 /* t_dlef || t_drit */ +#define TAND 6 /* t_dlef && t_drit */ + +#define FSAVE (FNICE|FTIME|FNOHUP) /* save these when re-doing */ + +#define FAND (1<<0) /* executes in background */ +#define FCAT (1<<1) /* output is redirected >> */ +#define FPIN (1<<2) /* input is a pipe */ +#define FPOU (1<<3) /* output is a pipe */ +#define FPAR (1<<4) /* don't fork, last ()ized cmd */ +#define FINT (1<<5) /* should be immune from intr's */ +/* spare */ +#define FDIAG (1<<7) /* redirect unit 2 with unit 1 */ +#define FANY (1<<8) /* output was ! */ +#define FHERE (1<<9) /* input redirection is << */ +#define FREDO (1<<10) /* reexec aft if, repeat,... */ +#define FNICE (1<<11) /* t_nice is meaningful */ +#define FNOHUP (1<<12) /* nohup this command */ +#define FTIME (1<<13) /* time this command */ + +/* + * The keywords for the parser + */ +#define ZBREAK 0 +#define ZBRKSW 1 +#define ZCASE 2 +#define ZDEFAULT 3 +#define ZELSE 4 +#define ZEND 5 +#define ZENDIF 6 +#define ZENDSW 7 +#define ZEXIT 8 +#define ZFOREACH 9 +#define ZGOTO 10 +#define ZIF 11 +#define ZLABEL 12 +#define ZLET 13 +#define ZSET 14 +#define ZSWITCH 15 +#define ZTEST 16 +#define ZTHEN 17 +#define ZWHILE 18 + +/* + * Structure defining the existing while/foreach loops at this + * source level. Loops are implemented by seeking back in the + * input. For foreach (fe), the word list is attached here. + */ +struct whyle { + off_t w_start; /* Point to restart loop */ + off_t w_end; /* End of loop (0 if unknown) */ + char **w_fe, **w_fe0; /* Current/initial wordlist for fe */ + char *w_fename; /* Name for fe */ + struct whyle *w_next; /* Next (more outer) loop */ +} *whyles; + +/* + * Variable structure + * + * Aliases and variables are stored in AVL balanced binary trees. + */ +struct varent { + char **vec; /* Array of words which is the value */ + char *v_name; /* Name of variable/alias */ + struct varent *v_link[3]; /* The links, see below */ + int v_bal; /* Balance factor */ +} shvhed, aliases; +#define v_left v_link[0] +#define v_right v_link[1] +#define v_parent v_link[2] + +struct varent *adrof1(); +#define adrof(v) adrof1(v, &shvhed) +#define value(v) value1(v, &shvhed) + +/* + * The following are for interfacing redo substitution in + * aliases to the lexical routines. + */ +struct wordent *alhistp; /* Argument list (first) */ +struct wordent *alhistt; /* Node after last in arg list */ +char **alvec; /* The (remnants of) alias vector */ + +/* + * Filename/command name expansion variables + */ +short gflag; /* After tglob -> is globbing needed? */ + +/* + * A reasonable limit on number of arguments would seem to be + * the maximum number of characters in an arg list / 6. + */ +#ifdef pdp11 +#define GAVSIZ NCARGS / 12 +#else +#define GAVSIZ NCARGS / 6 +#endif + +/* + * Variables for filename expansion + */ +char **gargv; /* Pointer to the (stack) arglist */ +short gargc; /* Number args in gargv */ +short gnleft; + +/* + * Variables for command expansion. + */ +char **pargv; /* Pointer to the argv list space */ +char *pargs; /* Pointer to start current word */ +short pargc; /* Count of arguments in pargv */ +short pnleft; /* Number of chars left in pargs */ +char *pargcp; /* Current index into pargs */ + +/* + * History list + * + * Each history list entry contains an embedded wordlist + * from the scanner, a number for the event, and a reference count + * to aid in discarding old entries. + * + * Essentially "invisible" entries are put on the history list + * when history substitution includes modifiers, and thrown away + * at the next discarding since their event numbers are very negative. + */ +struct Hist { + struct wordent Hlex; + int Hnum; + int Href; + struct Hist *Hnext; +} Histlist; + +struct wordent paraml; /* Current lexical word list */ +int eventno; /* Next events number */ +int lastev; /* Last event reference (default) */ + +char HIST; /* history invocation character */ +char HISTSUB; /* auto-substitute character */ + +/* + * In lines for frequently called functions + */ +#define XFREE(cp) { \ + extern char end[]; \ + char stack; \ + if ((cp) >= end && (cp) < &stack) \ + free(cp); \ +} +char *alloctmp; +#define xalloc(i) ((alloctmp = malloc(i)) ? alloctmp : (char *)nomem(i)) + +char *Dfix1(); +char **blkcat(); +char **blkcpy(); +char **blkend(); +char **blkspl(); +char *calloc(); +char *malloc(); +char *cname(); +char **copyblk(); +char **dobackp(); +char *domod(); +struct wordent *dosub(); +char *exp3(); +char *exp3a(); +char *exp4(); +char *exp5(); +char *exp6(); +struct Hist *enthist(); +struct Hist *findev(); +struct wordent *freenod(); +char *getenv(); +char *getinx(); +struct varent *getvx(); +struct passwd *getpwnam(); +struct wordent *gethent(); +struct wordent *getsub(); +char *getwd(); +char **glob(); +char *globone(); +char *index(); +struct biltins *isbfunc(); +off_t lseek(); +char *operate(); +int phup(); +int pintr(); +int pchild(); +char *putn(); +char *rindex(); +char **saveblk(); +char *savestr(); +char *strcat(); +char *strcpy(); +char *strend(); +char *strings(); +char *strip(); +char *strspl(); +char *subword(); +struct command *syntax(); +struct command *syn0(); +struct command *syn1(); +struct command *syn1a(); +struct command *syn1b(); +struct command *syn2(); +struct command *syn3(); +char *value1(); +char *xhome(); +char *xname(); +char *xset(); + +#define NOSTR ((char *) 0) + +/* + * setname is a macro to save space (see sh.err.c) + */ +char *bname; +#define setname(a) (bname = (a)) + +#ifdef VFORK +char *Vsav; +char **Vav; +char *Vdp; +#endif + +char **evalvec; +char *evalp; + +struct mesg { + char *iname; /* name from /usr/include */ + char *pname; /* print name */ +} mesg[]; diff --git a/bin/csh/sh.hist.c b/bin/csh/sh.hist.c new file mode 100644 index 0000000..e28606b --- /dev/null +++ b/bin/csh/sh.hist.c @@ -0,0 +1,142 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley Software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if !defined(lint) && defined(DOSCCS) +static char *sccsid = "@(#)sh.hist.c 5.2 (Berkeley) 6/6/85"; +#endif + +#include "sh.h" + +/* + * C shell + */ + +savehist(sp) + struct wordent *sp; +{ + register struct Hist *hp, *np; + register int histlen = 0; + char *cp; + + /* throw away null lines */ + if (sp->next->word[0] == '\n') + return; + cp = value("history"); + if (*cp) { + register char *p = cp; + + while (*p) { + if (!digit(*p)) { + histlen = 0; + break; + } + histlen = histlen * 10 + *p++ - '0'; + } + } + for (hp = &Histlist; np = hp->Hnext;) + if (eventno - np->Href >= histlen || histlen == 0) + hp->Hnext = np->Hnext, hfree(np); + else + hp = np; + (void) enthist(++eventno, sp, 1); +} + +struct Hist * +enthist(event, lp, docopy) + int event; + register struct wordent *lp; + bool docopy; +{ + register struct Hist *np; + + np = (struct Hist *) xalloc(sizeof *np); + np->Hnum = np->Href = event; + if (docopy) + copylex(&np->Hlex, lp); + else { + np->Hlex.next = lp->next; + lp->next->prev = &np->Hlex; + np->Hlex.prev = lp->prev; + lp->prev->next = &np->Hlex; + } + np->Hnext = Histlist.Hnext; + Histlist.Hnext = np; + return (np); +} + +hfree(hp) + register struct Hist *hp; +{ + + freelex(&hp->Hlex); + xfree((char *)hp); +} + +dohist(vp) + char **vp; +{ + int n, rflg = 0, hflg = 0; + if (getn(value("history")) == 0) + return; + if (setintr) + (void) sigsetmask(sigblock(0L) & ~sigmask(SIGINT)); + while (*++vp && **vp == '-') { + char *vp2 = *vp; + + while (*++vp2) + switch (*vp2) { + case 'h': + hflg++; + break; + case 'r': + rflg++; + break; + case '-': /* ignore multiple '-'s */ + break; + default: + printf("Unknown flag: -%c\n", *vp2); + error("Usage: history [-rh] [# number of events]"); + } + } + if (*vp) + n = getn(*vp); + else { + n = getn(value("history")); + } + dohist1(Histlist.Hnext, &n, rflg, hflg); +} + +dohist1(hp, np, rflg, hflg) + struct Hist *hp; + int *np, rflg, hflg; +{ + bool print = (*np) > 0; +top: + if (hp == 0) + return; + (*np)--; + hp->Href++; + if (rflg == 0) { + dohist1(hp->Hnext, np, rflg, hflg); + if (print) + phist(hp, hflg); + return; + } + if (*np >= 0) + phist(hp, hflg); + hp = hp->Hnext; + goto top; +} + +phist(hp, hflg) + register struct Hist *hp; + int hflg; +{ + + if (hflg == 0) + printf("%6d\t", hp->Hnum); + prlex(&hp->Hlex); +} diff --git a/bin/csh/sh.init.c b/bin/csh/sh.init.c new file mode 100644 index 0000000..8504c44 --- /dev/null +++ b/bin/csh/sh.init.c @@ -0,0 +1,249 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley Software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if !defined(lint) && defined(DOSCCS) +static char *sccsid = "@(#)sh.init.c 5.2.1 (2.11BSD) 1996/9/20"; +#endif + +#include "sh.local.h" + +/* + * C shell + */ + +extern int doalias(); +extern int dobg(); +extern int dobreak(); +extern int dochngd(); +extern int docontin(); +extern int dodirs(); +extern int doecho(); +extern int doelse(); +extern int doend(); +extern int doendif(); +extern int doendsw(); +extern int doeval(); +extern int doexit(); +extern int dofg(); +extern int doforeach(); +extern int doglob(); +extern int dogoto(); +extern int dohash(); +extern int dohist(); +extern int doif(); +extern int dojobs(); +extern int dokill(); +extern int dolet(); +#ifndef NOLIMITS +extern int dolimit(); +#endif +extern int dologin(); +extern int dologout(); +#ifdef NEWGRP +extern int donewgrp(); +#endif +extern int donice(); +extern int donotify(); +extern int donohup(); +extern int doonintr(); +extern int dopopd(); +extern int dopushd(); +extern int dorepeat(); +extern int doset(); +extern int dosetenv(); +extern int dosource(); +extern int dostop(); +extern int dosuspend(); +extern int doswbrk(); +extern int doswitch(); +extern int dotime(); +#ifndef NOLIMITS +extern int dounlimit(); +#endif +extern int doumask(); +extern int dowait(); +extern int dowhile(); +extern int dowhich(); +extern int dozip(); +extern int execash(); +extern int goodbye(); +#ifdef VFORK +extern int hashstat(); +#endif +extern int shift(); +extern int showall(); +extern int unalias(); +extern int dounhash(); +extern int unset(); +extern int dounsetenv(); + +#define INF 1000 + +struct biltins { + char *bname; + int (*bfunct)(); + short minargs, maxargs; +} bfunc[] = { + "@", dolet, 0, INF, + "alias", doalias, 0, INF, + "alloc", showall, 0, 1, + "bg", dobg, 0, INF, + "break", dobreak, 0, 0, + "breaksw", doswbrk, 0, 0, +#ifdef IIASA + "bye", goodbye, 0, 0, +#endif + "case", dozip, 0, 1, + "cd", dochngd, 0, 1, + "chdir", dochngd, 0, 1, + "continue", docontin, 0, 0, + "default", dozip, 0, 0, + "dirs", dodirs, 0, 1, + "echo", doecho, 0, INF, + "else", doelse, 0, INF, + "end", doend, 0, 0, + "endif", dozip, 0, 0, + "endsw", dozip, 0, 0, + "eval", doeval, 0, INF, + "exec", execash, 1, INF, + "exit", doexit, 0, INF, + "fg", dofg, 0, INF, + "foreach", doforeach, 3, INF, +#ifdef IIASA + "gd", dopushd, 0, 1, +#endif + "glob", doglob, 0, INF, + "goto", dogoto, 1, 1, +#ifdef VFORK + "hashstat", hashstat, 0, 0, +#endif + "history", dohist, 0, 2, + "if", doif, 1, INF, + "jobs", dojobs, 0, 1, + "kill", dokill, 1, INF, +#ifndef NOLIMITS + "limit", dolimit, 0, 3, +#endif + "login", dologin, 0, 1, + "logout", dologout, 0, 0, +#ifdef NEWGRP + "newgrp", donewgrp, 1, 1, +#endif + "nice", donice, 0, INF, + "nohup", donohup, 0, INF, + "notify", donotify, 0, INF, + "onintr", doonintr, 0, 2, + "popd", dopopd, 0, 1, + "pushd", dopushd, 0, 1, +#ifdef IIASA + "rd", dopopd, 0, 1, +#endif + "rehash", dohash, 0, 0, + "repeat", dorepeat, 2, INF, + "set", doset, 0, INF, + "setenv", dosetenv, 0, 2, + "shift", shift, 0, 1, + "source", dosource, 1, 2, + "stop", dostop, 1, INF, + "suspend", dosuspend, 0, 0, + "switch", doswitch, 1, INF, + "time", dotime, 0, INF, + "umask", doumask, 0, 1, + "unalias", unalias, 1, INF, + "unhash", dounhash, 0, 0, +#ifndef NOLIMITS + "unlimit", dounlimit, 0, INF, +#endif + "unset", unset, 1, INF, + "unsetenv", dounsetenv, 1, INF, + "wait", dowait, 0, 0, + "which", dowhich, 1, INF, + "while", dowhile, 1, INF, +}; +int nbfunc = sizeof bfunc / sizeof *bfunc; + +#define ZBREAK 0 +#define ZBRKSW 1 +#define ZCASE 2 +#define ZDEFAULT 3 +#define ZELSE 4 +#define ZEND 5 +#define ZENDIF 6 +#define ZENDSW 7 +#define ZEXIT 8 +#define ZFOREACH 9 +#define ZGOTO 10 +#define ZIF 11 +#define ZLABEL 12 +#define ZLET 13 +#define ZSET 14 +#define ZSWITCH 15 +#define ZTEST 16 +#define ZTHEN 17 +#define ZWHILE 18 + +struct srch { + char *s_name; + short s_value; +} srchn[] = { + "@", ZLET, + "break", ZBREAK, + "breaksw", ZBRKSW, + "case", ZCASE, + "default", ZDEFAULT, + "else", ZELSE, + "end", ZEND, + "endif", ZENDIF, + "endsw", ZENDSW, + "exit", ZEXIT, + "foreach", ZFOREACH, + "goto", ZGOTO, + "if", ZIF, + "label", ZLABEL, + "set", ZSET, + "switch", ZSWITCH, + "while", ZWHILE, +}; +int nsrchn = sizeof srchn / sizeof *srchn; + +struct mesg { + char *iname; + char *pname; +} mesg[] = { + 0, 0, + "HUP", "Hangup", + "INT", "Interrupt", + "QUIT", "Quit", + "ILL", "Illegal instruction", + "TRAP", "Trace/BPT trap", + "IOT", "IOT trap", + "EMT", "EMT trap", + "FPE", "Floating exception", + "KILL", "Killed", + "BUS", "Bus error", + "SEGV", "Segmentation fault", + "SYS", "Bad system call", + "PIPE", "Broken pipe", + "ALRM", "Alarm clock", + "TERM", "Terminated", + "URG", "Urgent I/O condition", + "STOP", "Stopped (signal)", + "TSTP", "Stopped", + "CONT", "Continued", + "CHLD", "Child exited", + "TTIN", "Stopped (tty input)", + "TTOU", "Stopped (tty output)", + "IO", "I/O possible", + "XCPU", "Cputime limit exceeded", + "XFSZ", "Filesize limit exceeded", + "VTALRM","Virtual timer expired", + "PROF", "Profiling timer expired", + "WINCH","Window size changed", + 0, "Signal 29", + "USR1", "User defined signal 1", + "USR2", "User defined signal 2", + 0, "Signal 32" +}; diff --git a/bin/csh/sh.lex.c b/bin/csh/sh.lex.c new file mode 100644 index 0000000..bd53c21 --- /dev/null +++ b/bin/csh/sh.lex.c @@ -0,0 +1,1337 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley Software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if !defined(lint) && defined(DOSCCS) +static char *sccsid = "@(#)sh.lex.c 5.4 (Berkeley) 3/29/86"; +#endif + +#include "sh.h" +#include + +/* + * C shell + */ + +/* + * These lexical routines read input and form lists of words. + * There is some involved processing here, because of the complications + * of input buffering, and especially because of history substitution. + */ + +char *word(); + +/* + * Peekc is a peek characer for getC, peekread for readc. + * There is a subtlety here in many places... history routines + * will read ahead and then insert stuff into the input stream. + * If they push back a character then they must push it behind + * the text substituted by the history substitution. On the other + * hand in several places we need 2 peek characters. To make this + * all work, the history routines read with getC, and make use both + * of ungetC and unreadc. The key observation is that the state + * of getC at the call of a history reference is such that calls + * to getC from the history routines will always yield calls of + * readc, unless this peeking is involved. That is to say that during + * getexcl the variables lap, exclp, and exclnxt are all zero. + * + * Getdol invokes history substitution, hence the extra peek, peekd, + * which it can ungetD to be before history substitutions. + */ +char peekc, peekd; +char peekread; + +char *exclp; /* (Tail of) current word from ! subst */ +struct wordent *exclnxt; /* The rest of the ! subst words */ +int exclc; /* Count of remainig words in ! subst */ +char *alvecp; /* "Globp" for alias resubstitution */ + +/* + * Lex returns to its caller not only a wordlist (as a "var" parameter) + * but also whether a history substitution occurred. This is used in + * the main (process) routine to determine whether to echo, and also + * when called by the alias routine to determine whether to keep the + * argument list. + */ +bool hadhist; + +char getCtmp; +#define getC(f) ((getCtmp = peekc) ? (peekc = 0, getCtmp) : getC1(f)) +#define ungetC(c) peekc = c +#define ungetD(c) peekd = c + +lex(hp) + register struct wordent *hp; +{ + register struct wordent *wdp; + int c; + + lineloc = btell(); + hp->next = hp->prev = hp; + hp->word = ""; + alvecp = 0, hadhist = 0; + do + c = readc(0); + while (c == ' ' || c == '\t'); + if (c == HISTSUB && intty) + /* ^lef^rit from tty is short !:s^lef^rit */ + getexcl(c); + else + unreadc(c); + wdp = hp; + /* + * The following loop is written so that the links needed + * by freelex will be ready and rarin to go even if it is + * interrupted. + */ + do { + register struct wordent *new = (struct wordent *) xalloc(sizeof *wdp); + + new->word = 0; + new->prev = wdp; + new->next = hp; + wdp->next = new; + wdp = new; + wdp->word = word(); + } while (wdp->word[0] != '\n'); + hp->prev = wdp; + return (hadhist); +} + +prlex(sp0) + struct wordent *sp0; +{ + register struct wordent *sp = sp0->next; + + for (;;) { + printf("%s", sp->word); + sp = sp->next; + if (sp == sp0) + break; + if (sp->word[0] != '\n') + putchar(' '); + } +} + +copylex(hp, fp) + register struct wordent *hp; + register struct wordent *fp; +{ + register struct wordent *wdp; + + wdp = hp; + fp = fp->next; + do { + register struct wordent *new = (struct wordent *) xalloc(sizeof *wdp); + + new->prev = wdp; + new->next = hp; + wdp->next = new; + wdp = new; + wdp->word = savestr(fp->word); + fp = fp->next; + } while (wdp->word[0] != '\n'); + hp->prev = wdp; +} + +freelex(vp) + register struct wordent *vp; +{ + register struct wordent *fp; + + while (vp->next != vp) { + fp = vp->next; + vp->next = fp->next; + XFREE(fp->word) + XFREE((char *)fp) + } + vp->prev = vp; +} + +char * +word() +{ + register char c, c1; + register char *wp; + char wbuf[BUFSIZ]; + register bool dolflg; + register int i; + + wp = wbuf; + i = BUFSIZ - 4; +loop: + while ((c = getC(DOALL)) == ' ' || c == '\t') + ; + if (cmap(c, _META|_ESC)) + switch (c) { + case '&': + case '|': + case '<': + case '>': + *wp++ = c; + c1 = getC(DOALL); + if (c1 == c) + *wp++ = c1; + else + ungetC(c1); + goto ret; + + case '#': + if (intty) + break; + c = 0; + do { + c1 = c; + c = getC(0); + } while (c != '\n'); + if (c1 == '\\') + goto loop; + /* fall into ... */ + + case ';': + case '(': + case ')': + case '\n': + *wp++ = c; + goto ret; + + case '\\': + c = getC(0); + if (c == '\n') { + if (onelflg == 1) + onelflg = 2; + goto loop; + } + if (c != HIST) + *wp++ = '\\', --i; + c |= QUOTE; + } + c1 = 0; + dolflg = DOALL; + for (;;) { + if (c1) { + if (c == c1) { + c1 = 0; + dolflg = DOALL; + } else if (c == '\\') { + c = getC(0); + if (c == HIST) + c |= QUOTE; + else { + if (c == '\n') + /* + if (c1 == '`') + c = ' '; + else + */ + c |= QUOTE; + ungetC(c); + c = '\\'; + } + } else if (c == '\n') { + seterrc("Unmatched ", c1); + ungetC(c); + break; + } + } else if (cmap(c, _META|_Q|_Q1|_ESC)) { + if (c == '\\') { + c = getC(0); + if (c == '\n') { + if (onelflg == 1) + onelflg = 2; + break; + } + if (c != HIST) + *wp++ = '\\', --i; + c |= QUOTE; + } else if (cmap(c, _Q|_Q1)) { /* '"` */ + c1 = c; + dolflg = c == '"' ? DOALL : DOEXCL; + } else if (c != '#' || !intty) { + ungetC(c); + break; + } + } + if (--i > 0) { + *wp++ = c; + c = getC(dolflg); + } else { + seterr("Word too long"); + wp = &wbuf[1]; + break; + } + } +ret: + *wp = 0; + return (savestr(wbuf)); +} + +getC1(flag) + register int flag; +{ + register char c; + +top: + if (c = peekc) { + peekc = 0; + return (c); + } + if (lap) { + if ((c = *lap++) == 0) + lap = 0; + else { + if (cmap(c, _META|_Q|_Q1)) + c |= QUOTE; + return (c); + } + } + if (c = peekd) { + peekd = 0; + return (c); + } + if (exclp) { + if (c = *exclp++) + return (c); + if (exclnxt && --exclc >= 0) { + exclnxt = exclnxt->next; + setexclp(exclnxt->word); + return (' '); + } + exclp = 0; + exclnxt = 0; + } + if (exclnxt) { + exclnxt = exclnxt->next; + if (--exclc < 0) + exclnxt = 0; + else + setexclp(exclnxt->word); + goto top; + } + c = readc(0); + if (c == '$' && (flag & DODOL)) { + getdol(); + goto top; + } + if (c == HIST && (flag & DOEXCL)) { + getexcl(0); + goto top; + } + return (c); +} + +getdol() +{ + register char *np; + char name[40]; + register int c; + int sc; + bool special = 0; + + np = name, *np++ = '$'; + c = sc = getC(DOEXCL); + if (any(c, "\t \n")) { + ungetD(c); + ungetC('$' | QUOTE); + return; + } + if (c == '{') + *np++ = c, c = getC(DOEXCL); + if (c == '#' || c == '?') + special++, *np++ = c, c = getC(DOEXCL); + *np++ = c; + switch (c) { + + case '<': + case '$': + if (special) + goto vsyn; + goto ret; + + case '\n': + ungetD(c); + np--; + goto vsyn; + + case '*': + if (special) + goto vsyn; + goto ret; + + default: + if (digit(c)) { +/* + * let $?0 pass for now + if (special) + goto vsyn; +*/ + while (digit(c = getC(DOEXCL))) { + if (np < &name[sizeof name / 2]) + *np++ = c; + } + } else if (letter(c)) + while (letter(c = getC(DOEXCL))) { + if (np < &name[sizeof name / 2]) + *np++ = c; + } + else + goto vsyn; + } + if (c == '[') { + *np++ = c; + do { + c = getC(DOEXCL); + if (c == '\n') { + ungetD(c); + np--; + goto vsyn; + } + if (np >= &name[sizeof name - 8]) + goto vsyn; + *np++ = c; + } while (c != ']'); + c = getC(DOEXCL); + } + if (c == ':') { + *np++ = c, c = getC(DOEXCL); + if (c == 'g') + *np++ = c, c = getC(DOEXCL); + *np++ = c; + if (!any(c, "htrqxe")) + goto vsyn; + } else + ungetD(c); + if (sc == '{') { + c = getC(DOEXCL); + if (c != '}') { + ungetC(c); + goto vsyn; + } + *np++ = c; + } +ret: + *np = 0; + addla(name); + return; + +vsyn: + seterr("Variable syntax"); + goto ret; +} + +addla(cp) + char *cp; +{ + char buf[BUFSIZ]; + + if (lap != 0 && strlen(cp) + strlen(lap) >= sizeof (labuf) - 4) { + seterr("Expansion buf ovflo"); + return; + } + if (lap) + (void) strcpy(buf, lap); + (void) strcpy(labuf, cp); + if (lap) + (void) strcat(labuf, buf); + lap = labuf; +} + +char lhsb[32]; +char slhs[32]; +char rhsb[64]; +int quesarg; + +getexcl(sc) + char sc; +{ + register struct wordent *hp, *ip; + int left, right, dol; + register int c; + + if (sc == 0) { + sc = getC(0); + if (sc != '{') { + ungetC(sc); + sc = 0; + } + } + quesarg = -1; + lastev = eventno; + hp = gethent(sc); + if (hp == 0) + return; + hadhist = 1; + dol = 0; + if (hp == alhistp) + for (ip = hp->next->next; ip != alhistt; ip = ip->next) + dol++; + else + for (ip = hp->next->next; ip != hp->prev; ip = ip->next) + dol++; + left = 0, right = dol; + if (sc == HISTSUB) { + ungetC('s'), unreadc(HISTSUB), c = ':'; + goto subst; + } + c = getC(0); + if (!any(c, ":^$*-%")) + goto subst; + left = right = -1; + if (c == ':') { + c = getC(0); + unreadc(c); + if (letter(c) || c == '&') { + c = ':'; + left = 0, right = dol; + goto subst; + } + } else + ungetC(c); + if (!getsel(&left, &right, dol)) + return; + c = getC(0); + if (c == '*') + ungetC(c), c = '-'; + if (c == '-') { + if (!getsel(&left, &right, dol)) + return; + c = getC(0); + } +subst: + exclc = right - left + 1; + while (--left >= 0) + hp = hp->next; + if (sc == HISTSUB || c == ':') { + do { + hp = getsub(hp); + c = getC(0); + } while (c == ':'); + } + unreadc(c); + if (sc == '{') { + c = getC(0); + if (c != '}') + seterr("Bad ! form"); + } + exclnxt = hp; +} + +struct wordent * +getsub(en) + struct wordent *en; +{ + register char *cp; + int delim; + register int c; + int sc; + bool global = 0; + char orhsb[sizeof rhsb]; + + exclnxt = 0; + sc = c = getC(0); + if (c == 'g') + global++, c = getC(0); + switch (c) { + + case 'p': + justpr++; + goto ret; + + case 'x': + case 'q': + global++; + /* fall into ... */ + + case 'h': + case 'r': + case 't': + case 'e': + break; + + case '&': + if (slhs[0] == 0) { + seterr("No prev sub"); + goto ret; + } + (void) strcpy(lhsb, slhs); + break; + +/* + case '~': + if (lhsb[0] == 0) + goto badlhs; + break; +*/ + + case 's': + delim = getC(0); + if (letter(delim) || digit(delim) || any(delim, " \t\n")) { + unreadc(delim); +bads: + lhsb[0] = 0; + seterr("Bad substitute"); + goto ret; + } + cp = lhsb; + for (;;) { + c = getC(0); + if (c == '\n') { + unreadc(c); + break; + } + if (c == delim) + break; + if (cp > &lhsb[sizeof lhsb - 2]) + goto bads; + if (c == '\\') { + c = getC(0); + if (c != delim && c != '\\') + *cp++ = '\\'; + } + *cp++ = c; + } + if (cp != lhsb) + *cp++ = 0; + else if (lhsb[0] == 0) { +/*badlhs:*/ + seterr("No prev lhs"); + goto ret; + } + cp = rhsb; + (void) strcpy(orhsb, cp); + for (;;) { + c = getC(0); + if (c == '\n') { + unreadc(c); + break; + } + if (c == delim) + break; +/* + if (c == '~') { + if (&cp[strlen(orhsb)] > &rhsb[sizeof rhsb - 2]) + goto toorhs; + (void) strcpy(cp, orhsb); + cp = strend(cp); + continue; + } +*/ + if (cp > &rhsb[sizeof rhsb - 2]) { +/*toorhs:*/ + seterr("Rhs too long"); + goto ret; + } + if (c == '\\') { + c = getC(0); + if (c != delim /* && c != '~' */) + *cp++ = '\\'; + } + *cp++ = c; + } + *cp++ = 0; + break; + + default: + if (c == '\n') + unreadc(c); + seterrc("Bad ! modifier: ", c); + goto ret; + } + (void) strcpy(slhs, lhsb); + if (exclc) + en = dosub(sc, en, global); +ret: + return (en); +} + +struct wordent * +dosub(sc, en, global) + int sc; + struct wordent *en; + bool global; +{ + struct wordent lex; + bool didsub = 0; + struct wordent *hp = &lex; + register struct wordent *wdp; + register int i = exclc; + + wdp = hp; + while (--i >= 0) { + register struct wordent *new = (struct wordent *) calloc(1, sizeof *wdp); + + new->prev = wdp; + new->next = hp; + wdp->next = new; + wdp = new; + en = en->next; + wdp->word = global || didsub == 0 ? + subword(en->word, sc, &didsub) : savestr(en->word); + } + if (didsub == 0) + seterr("Modifier failed"); + hp->prev = wdp; + return (&enthist(-1000, &lex, 0)->Hlex); +} + +char * +subword(cp, type, adid) + char *cp; + int type; + bool *adid; +{ + char wbuf[BUFSIZ]; + register char *wp, *mp, *np; + register int i; + + switch (type) { + + case 'r': + case 'e': + case 'h': + case 't': + case 'q': + case 'x': + wp = domod(cp, type); + if (wp == 0) + return (savestr(cp)); + *adid = 1; + return (wp); + + default: + wp = wbuf; + i = BUFSIZ - 4; + for (mp = cp; *mp; mp++) + if (matchs(mp, lhsb)) { + for (np = cp; np < mp;) + *wp++ = *np++, --i; + for (np = rhsb; *np; np++) switch (*np) { + + case '\\': + if (np[1] == '&') + np++; + /* fall into ... */ + + default: + if (--i < 0) + goto ovflo; + *wp++ = *np; + continue; + + case '&': + i -= strlen(lhsb); + if (i < 0) + goto ovflo; + *wp = 0; + (void) strcat(wp, lhsb); + wp = strend(wp); + continue; + } + mp += strlen(lhsb); + i -= strlen(mp); + if (i < 0) { +ovflo: + seterr("Subst buf ovflo"); + return (""); + } + *wp = 0; + (void) strcat(wp, mp); + *adid = 1; + return (savestr(wbuf)); + } + return (savestr(cp)); + } +} + +char * +domod(cp, type) + char *cp; + int type; +{ + register char *wp, *xp; + register int c; + + switch (type) { + + case 'x': + case 'q': + wp = savestr(cp); + for (xp = wp; c = *xp; xp++) + if ((c != ' ' && c != '\t') || type == 'q') + *xp |= QUOTE; + return (wp); + + case 'h': + case 't': + if (!any('/', cp)) + return (type == 't' ? savestr(cp) : 0); + wp = strend(cp); + while (*--wp != '/') + continue; + if (type == 'h') + xp = savestr(cp), xp[wp - cp] = 0; + else + xp = savestr(wp + 1); + return (xp); + + case 'e': + case 'r': + wp = strend(cp); + for (wp--; wp >= cp && *wp != '/'; wp--) + if (*wp == '.') { + if (type == 'e') + xp = savestr(wp + 1); + else + xp = savestr(cp), xp[wp - cp] = 0; + return (xp); + } + return (savestr(type == 'e' ? "" : cp)); + } + return (0); +} + +matchs(str, pat) + register char *str, *pat; +{ + + while (*str && *pat && *str == *pat) + str++, pat++; + return (*pat == 0); +} + +getsel(al, ar, dol) + register int *al, *ar; + int dol; +{ + register int c = getC(0); + register int i; + bool first = *al < 0; + + switch (c) { + + case '%': + if (quesarg == -1) + goto bad; + if (*al < 0) + *al = quesarg; + *ar = quesarg; + break; + + case '-': + if (*al < 0) { + *al = 0; + *ar = dol - 1; + unreadc(c); + } + return (1); + + case '^': + if (*al < 0) + *al = 1; + *ar = 1; + break; + + case '$': + if (*al < 0) + *al = dol; + *ar = dol; + break; + + case '*': + if (*al < 0) + *al = 1; + *ar = dol; + if (*ar < *al) { + *ar = 0; + *al = 1; + return (1); + } + break; + + default: + if (digit(c)) { + i = 0; + while (digit(c)) { + i = i * 10 + c - '0'; + c = getC(0); + } + if (i < 0) + i = dol + 1; + if (*al < 0) + *al = i; + *ar = i; + } else + if (*al < 0) + *al = 0, *ar = dol; + else + *ar = dol - 1; + unreadc(c); + break; + } + if (first) { + c = getC(0); + unreadc(c); + if (any(c, "-$*")) + return (1); + } + if (*al > *ar || *ar > dol) { +bad: + seterr("Bad ! arg selector"); + return (0); + } + return (1); + +} + +struct wordent * +gethent(sc) + int sc; +{ + register struct Hist *hp; + register char *np; + register int c; + int event; + bool back = 0; + + c = sc == HISTSUB ? HIST : getC(0); + if (c == HIST) { + if (alhistp) + return (alhistp); + event = eventno; + goto skip; + } + switch (c) { + + case ':': + case '^': + case '$': + case '*': + case '%': + ungetC(c); + if (lastev == eventno && alhistp) + return (alhistp); + event = lastev; + break; + + case '-': + back = 1; + c = getC(0); + goto number; + + case '#': /* !# is command being typed in (mrh) */ + return(¶ml); + + default: + if (any(c, "(=~")) { + unreadc(c); + ungetC(HIST); + return (0); + } + if (digit(c)) + goto number; + np = lhsb; + while (!any(c, ": \t\\\n}")) { + if (np < &lhsb[sizeof lhsb - 2]) + *np++ = c; + c = getC(0); + } + unreadc(c); + if (np == lhsb) { + ungetC(HIST); + return (0); + } + *np++ = 0; + hp = findev(lhsb, 0); + if (hp) + lastev = hp->Hnum; + return (&hp->Hlex); + + case '?': + np = lhsb; + for (;;) { + c = getC(0); + if (c == '\n') { + unreadc(c); + break; + } + if (c == '?') + break; + if (np < &lhsb[sizeof lhsb - 2]) + *np++ = c; + } + if (np == lhsb) { + if (lhsb[0] == 0) { + seterr("No prev search"); + return (0); + } + } else + *np++ = 0; + hp = findev(lhsb, 1); + if (hp) + lastev = hp->Hnum; + return (&hp->Hlex); + + number: + event = 0; + while (digit(c)) { + event = event * 10 + c - '0'; + c = getC(0); + } + if (back) + event = eventno + (alhistp == 0) - (event ? event : 0); + unreadc(c); + break; + } +skip: + for (hp = Histlist.Hnext; hp; hp = hp->Hnext) + if (hp->Hnum == event) { + hp->Href = eventno; + lastev = hp->Hnum; + return (&hp->Hlex); + } + np = putn(event); + noev(np); + return (0); +} + +struct Hist * +findev(cp, anyarg) + char *cp; + bool anyarg; +{ + register struct Hist *hp; + + for (hp = Histlist.Hnext; hp; hp = hp->Hnext) { + char *dp; + register char *p, *q; + register struct wordent *lp = hp->Hlex.next; + int argno = 0; + + if (lp->word[0] == '\n') + continue; + if (!anyarg) { + p = cp; + q = lp->word; + do + if (!*p) + return (hp); + while (*p++ == *q++); + continue; + } + do { + for (dp = lp->word; *dp; dp++) { + p = cp; + q = dp; + do + if (!*p) { + quesarg = argno; + return (hp); + } + while (*p++ == *q++); + } + lp = lp->next; + argno++; + } while (lp->word[0] != '\n'); + } + noev(cp); + return (0); +} + +noev(cp) + char *cp; +{ + + seterr2(cp, ": Event not found"); +} + +setexclp(cp) + register char *cp; +{ + + if (cp && cp[0] == '\n') + return; + exclp = cp; +} + +unreadc(c) + char c; +{ + + peekread = c; +} + +readc(wanteof) + bool wanteof; +{ + register int c; + static sincereal; + + if (c = peekread) { + peekread = 0; + return (c); + } +top: + if (alvecp) { + if (c = *alvecp++) + return (c); + if (*alvec) { + alvecp = *alvec++; + return (' '); + } + } + if (alvec) { + if (alvecp = *alvec) { + alvec++; + goto top; + } + /* Infinite source! */ + return ('\n'); + } + if (evalp) { + if (c = *evalp++) + return (c); + if (*evalvec) { + evalp = *evalvec++; + return (' '); + } + evalp = 0; + } + if (evalvec) { + if (evalvec == (char **)1) { + doneinp = 1; + reset(); + } + if (evalp = *evalvec) { + evalvec++; + goto top; + } + evalvec = (char **)1; + return ('\n'); + } + do { + if (arginp == (char *) 1 || onelflg == 1) { + if (wanteof) + return (-1); + exitstat(); + } + if (arginp) { + if ((c = *arginp++) == 0) { + arginp = (char *) 1; + return ('\n'); + } + return (c); + } +reread: + c = bgetc(); + if (c < 0) { + struct sgttyb tty; + + if (wanteof) + return (-1); + /* was isatty but raw with ignoreeof yields problems */ + if (ioctl(SHIN, TIOCGETP, (char *)&tty) == 0 && + (tty.sg_flags & RAW) == 0) { + /* was 'short' for FILEC */ + int ctpgrp; + + if (++sincereal > 25) + goto oops; + if (tpgrp != -1 && + ioctl(FSHTTY, TIOCGPGRP, (char *)&ctpgrp) == 0 && + tpgrp != ctpgrp) { + (void) ioctl(FSHTTY, TIOCSPGRP, + (char *)&tpgrp); + (void) killpg(ctpgrp, SIGHUP); +printf("Reset tty pgrp from %d to %d\n", ctpgrp, tpgrp); + goto reread; + } + if (adrof("ignoreeof")) { + if (loginsh) + printf("\nUse \"logout\" to logout.\n"); + else + printf("\nUse \"exit\" to leave csh.\n"); + reset(); + } + if (chkstop == 0) + panystop(1); + } +oops: + doneinp = 1; + reset(); + } + sincereal = 0; + if (c == '\n' && onelflg) + onelflg--; + } while (c == 0); + return (c); +} + +bgetc() +{ + register int buf, off, c; +#ifdef FILEC + char ttyline[BUFSIZ]; + register int numleft = 0, roomleft; +#endif + +#ifdef TELL + if (cantell) { + if (fseekp < fbobp || fseekp > feobp) { + fbobp = feobp = fseekp; + (void) lseek(SHIN, fseekp, 0); + } + if (fseekp == feobp) { + fbobp = feobp; + do + c = read(SHIN, fbuf[0], BUFSIZ); + while (c < 0 && errno == EINTR); + if (c <= 0) + return (-1); + feobp += c; + } + c = fbuf[0][fseekp - fbobp]; + fseekp++; + return (c & 0377); + } +#endif +again: + buf = (int) fseekp / BUFSIZ; + if (buf >= fblocks) { + register char **nfbuf = + (char **) calloc((unsigned) (fblocks + 2), + sizeof (char **)); + + if (fbuf) { + (void) blkcpy(nfbuf, fbuf); + xfree((char *)fbuf); + } + fbuf = nfbuf; + fbuf[fblocks] = calloc(BUFSIZ, sizeof (char)); + fblocks++; + goto again; + } + if (fseekp >= feobp) { + buf = (int) feobp / BUFSIZ; + off = (int) feobp % BUFSIZ; +#ifndef FILEC + for (;;) { + c = read(SHIN, fbuf[buf] + off, BUFSIZ - off); +#else + roomleft = BUFSIZ - off; + for (;;) { + if (filec && intty) { + c = numleft ? numleft : tenex(ttyline, BUFSIZ); + if (c > roomleft) { + /* start with fresh buffer */ + feobp = fseekp = fblocks * BUFSIZ; + numleft = c; + goto again; + } + if (c > 0) + copy(fbuf[buf] + off, ttyline, c); + numleft = 0; + } else + c = read(SHIN, fbuf[buf] + off, roomleft); +#endif + if (c >= 0) + break; + if (errno == EWOULDBLOCK) { + int off = 0; + + (void) ioctl(SHIN, FIONBIO, (char *)&off); + } else if (errno != EINTR) + break; + } + if (c <= 0) + return (-1); + feobp += c; +#ifndef FILEC + goto again; +#else + if (filec && !intty) + goto again; +#endif + } + c = fbuf[buf][(int) fseekp % BUFSIZ]; + fseekp++; + return (c & 0377); +} + +bfree() +{ + register int sb, i; + +#ifdef TELL + if (cantell) + return; +#endif + if (whyles) + return; + sb = (int) (fseekp - 1) / BUFSIZ; + if (sb > 0) { + for (i = 0; i < sb; i++) + xfree(fbuf[i]); + (void) blkcpy(fbuf, &fbuf[sb]); + fseekp -= BUFSIZ * sb; + feobp -= BUFSIZ * sb; + fblocks -= sb; + } +} + +bseek(l) + off_t l; +{ + register struct whyle *wp; + + fseekp = l; +#ifdef TELL + if (!cantell) { +#endif + if (!whyles) + return; + for (wp = whyles; wp->w_next; wp = wp->w_next) + continue; + if (wp->w_start > l) + l = wp->w_start; +#ifdef TELL + } +#endif +} + +/* any similarity to bell telephone is purely accidental */ +#ifndef btell +off_t +btell() +{ + + return (fseekp); +} +#endif + +btoeof() +{ + + (void) lseek(SHIN, (off_t)0, 2); + fseekp = feobp; + wfree(); + bfree(); +} + +#ifdef TELL +settell() +{ + + cantell = 0; + if (arginp || onelflg || intty) + return; + if (lseek(SHIN, (off_t)0, 1) < 0 || errno == ESPIPE) + return; + fbuf = (char **) calloc(2, sizeof (char **)); + fblocks = 1; + fbuf[0] = calloc(BUFSIZ, sizeof (char)); + fseekp = fbobp = feobp = lseek(SHIN, (off_t)0, 1); + cantell = 1; +} +#endif diff --git a/bin/csh/sh.local.h b/bin/csh/sh.local.h new file mode 100644 index 0000000..aca92a2 --- /dev/null +++ b/bin/csh/sh.local.h @@ -0,0 +1,51 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley Software License Agreement + * specifies the terms and conditions for redistribution. + * + * @(#)sh.local.h 5.2 (Berkeley) 6/6/85 + */ + +/* + * This file defines certain local parameters + * A symbol should be defined in Makefile for local conditional + * compilation, e.g. IIASA or ERNIE, to be tested here and elsewhere. + */ + +/* + * Fundamental definitions which may vary from system to system. + * + * BUFSIZ The i/o buffering size; also limits word size + * SHELLPATH Where the shell will live; initalizes $shell + * MAILINTVL How often to mailcheck; more often is more expensive + * OTHERSH Shell for scripts which don't start with # + */ + +#define BUFSIZ 1024 /* default buffer size */ +#define SHELLPATH "/bin/csh" +#define OTHERSH "/bin/sh" +#define FORKSLEEP 10 /* delay loop on non-interactive fork failure */ +#define MAILINTVL 600 /* 10 minutes */ + +/* + * The shell moves std in/out/diag and the old std input away from units + * 0, 1, and 2 so that it is easy to set up these standards for invoked + * commands. + */ +#define FSHTTY 15 /* /dev/tty when manip pgrps */ +#define FSHIN 16 /* Preferred desc for shell input */ +#define FSHOUT 17 /* ... shell output */ +#define FSHDIAG 18 /* ... shell diagnostics */ +#define FOLDSTD 19 /* ... old std input */ + +#ifdef IIASA +#undef OTHERSH +#endif + +#ifdef vax +#define copy(to, from, size) bcopy(from, to, size) +#endif + +#ifdef PROF +#define exit(n) done(n) +#endif diff --git a/bin/csh/sh.misc.c b/bin/csh/sh.misc.c new file mode 100644 index 0000000..a2c8631 --- /dev/null +++ b/bin/csh/sh.misc.c @@ -0,0 +1,383 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley Software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if !defined(lint) && defined(DOSCCS) +static char *sccsid = "@(#)sh.misc.c 5.3 (Berkeley) 3/29/86"; +#endif + +#include "sh.h" + +/* + * C Shell + */ + +any(c, s) + register int c; + register char *s; +{ + + while (*s) + if (*s++ == c) + return(1); + return(0); +} + +onlyread(cp) + char *cp; +{ + extern char end[]; + + return (cp < end); +} + +xfree(cp) + char *cp; +{ + extern char end[]; + + if (cp >= end && cp < (char *) &cp) + free(cp); +} + +char * +savestr(s) + register char *s; +{ + char *n; + register char *p; + + if (s == 0) + s = ""; + for (p = s; *p++;) + ; + n = p = xalloc((unsigned) (p - s)); + while (*p++ = *s++) + ; + return (n); +} + +char * +calloc(i, j) + register unsigned i; + unsigned j; +{ + char *cp; + + i *= j; + cp = xalloc(i); + bzero(cp, (int)i); + return (cp); +} + +nomem(i) + unsigned i; +{ +#ifdef debug + static char *av[2] = {0, 0}; +#endif + + child++; +#ifndef debug + error("Out of memory"); +#ifdef lint + i = i; +#endif +#else + showall(av); + printf("i=%d: Out of memory\n", i); + chdir("/usr/bill/cshcore"); + abort(); +#endif + return 0; /* fool lint */ +} + +char ** +blkend(up) + register char **up; +{ + + while (*up) + up++; + return (up); +} + +blkpr(av) + register char **av; +{ + + for (; *av; av++) { + printf("%s", *av); + if (av[1]) + printf(" "); + } +} + +blklen(av) + register char **av; +{ + register int i = 0; + + while (*av++) + i++; + return (i); +} + +char ** +blkcpy(oav, bv) + char **oav; + register char **bv; +{ + register char **av = oav; + + while (*av++ = *bv++) + continue; + return (oav); +} + +char ** +blkcat(up, vp) + char **up, **vp; +{ + + (void) blkcpy(blkend(up), vp); + return (up); +} + +blkfree(av0) + char **av0; +{ + register char **av = av0; + + for (; *av; av++) + XFREE(*av) + XFREE((char *)av0) +} + +char ** +saveblk(v) + register char **v; +{ + register char **newv = + (char **) calloc((unsigned) (blklen(v) + 1), sizeof (char **)); + char **onewv = newv; + + while (*v) + *newv++ = savestr(*v++); + return (onewv); +} + +char * +strspl(cp, dp) + char *cp, *dp; +{ + char *ep; + register char *p, *q; + + for (p = cp; *p++;) + ; + for (q = dp; *q++;) + ; + ep = xalloc((unsigned) ((p - cp) + (q - dp) - 1)); + for (p = ep, q = cp; *p++ = *q++;) + ; + for (p--, q = dp; *p++ = *q++;) + ; + return (ep); +} + +char ** +blkspl(up, vp) + register char **up, **vp; +{ + register char **wp = + (char **) calloc((unsigned) (blklen(up) + blklen(vp) + 1), + sizeof (char **)); + + (void) blkcpy(wp, up); + return (blkcat(wp, vp)); +} + +lastchr(cp) + register char *cp; +{ + + if (!*cp) + return (0); + while (cp[1]) + cp++; + return (*cp); +} + +/* + * This routine is called after an error to close up + * any units which may have been left open accidentally. + */ +closem() +{ + register int f; + + for (f = 0; f < NOFILE; f++) + if (f != SHIN && f != SHOUT && f != SHDIAG && f != OLDSTD && + f != FSHTTY) + (void) close(f); +} + +donefds() +{ + + (void) close(0); + (void) close(1); + (void) close(2); + didfds = 0; +} + +/* + * Move descriptor i to j. + * If j is -1 then we just want to get i to a safe place, + * i.e. to a unit > 2. This also happens in dcopy. + */ +dmove(i, j) + register int i, j; +{ + + if (i == j || i < 0) + return (i); + if (j >= 0) { + (void) dup2(i, j); + return (j); + } + j = dcopy(i, j); + if (j != i) + (void) close(i); + return (j); +} + +dcopy(i, j) + register int i, j; +{ + + if (i == j || i < 0 || j < 0 && i > 2) + return (i); + if (j >= 0) { + (void) dup2(i, j); + return (j); + } + (void) close(j); + return (renum(i, j)); +} + +renum(i, j) + register int i, j; +{ + register int k = dup(i); + + if (k < 0) + return (-1); + if (j == -1 && k > 2) + return (k); + if (k != j) { + j = renum(k, j); + (void) close(k); + return (j); + } + return (k); +} + +#ifndef copy +copy(to, from, size) + register char *to, *from; + register int size; +{ + + if (size) + do + *to++ = *from++; + while (--size != 0); +} +#endif + +/* + * Left shift a command argument list, discarding + * the first c arguments. Used in "shift" commands + * as well as by commands like "repeat". + */ +lshift(v, c) + register char **v; + register int c; +{ + register char **u = v; + + while (*u && --c >= 0) + xfree(*u++); + (void) blkcpy(v, u); +} + +number(cp) + char *cp; +{ + + if (*cp == '-') { + cp++; + if (!digit(*cp++)) + return (0); + } + while (*cp && digit(*cp)) + cp++; + return (*cp == 0); +} + +char ** +copyblk(v) + register char **v; +{ + register char **nv = + (char **) calloc((unsigned) (blklen(v) + 1), sizeof (char **)); + + return (blkcpy(nv, v)); +} + +char * +strend(cp) + register char *cp; +{ + + while (*cp) + cp++; + return (cp); +} + +char * +strip(cp) + char *cp; +{ + register char *dp = cp; + + while (*dp++ &= TRIM) + continue; + return (cp); +} + +udvar(name) + char *name; +{ + + setname(name); + bferr("Undefined variable"); +} + +prefix(sub, str) + register char *sub, *str; +{ + + for (;;) { + if (*sub == 0) + return (1); + if (*str == 0) + return (0); + if (*sub++ != *str++) + return (0); + } +} diff --git a/bin/csh/sh.parse.c b/bin/csh/sh.parse.c new file mode 100644 index 0000000..f512598 --- /dev/null +++ b/bin/csh/sh.parse.c @@ -0,0 +1,633 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley Software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if !defined(lint) && defined(DOSCCS) +static char *sccsid = "@(#)sh.parse.c 5.3 (Berkeley) 5/13/86"; +#endif + +#include "sh.h" + +/* + * C shell + */ + +/* + * Perform aliasing on the word list lex + * Do a (very rudimentary) parse to separate into commands. + * If word 0 of a command has an alias, do it. + * Repeat a maximum of 20 times. + */ +alias(lex) + register struct wordent *lex; +{ + int aleft = 21; + jmp_buf osetexit; + + getexit(osetexit); + setexit(); + if (haderr) { + resexit(osetexit); + reset(); + } + if (--aleft == 0) + error("Alias loop"); + asyntax(lex->next, lex); + resexit(osetexit); +} + +asyntax(p1, p2) + register struct wordent *p1, *p2; +{ + + while (p1 != p2) + if (any(p1->word[0], ";&\n")) + p1 = p1->next; + else { + asyn0(p1, p2); + return; + } +} + +asyn0(p1, p2) + struct wordent *p1; + register struct wordent *p2; +{ + register struct wordent *p; + register int l = 0; + + for (p = p1; p != p2; p = p->next) + switch (p->word[0]) { + + case '(': + l++; + continue; + + case ')': + l--; + if (l < 0) + error("Too many )'s"); + continue; + + case '>': + if (p->next != p2 && eq(p->next->word, "&")) + p = p->next; + continue; + + case '&': + case '|': + case ';': + case '\n': + if (l != 0) + continue; + asyn3(p1, p); + asyntax(p->next, p2); + return; + } + if (l == 0) + asyn3(p1, p2); +} + +asyn3(p1, p2) + struct wordent *p1; + register struct wordent *p2; +{ + register struct varent *ap; + struct wordent alout; + register bool redid; + + if (p1 == p2) + return; + if (p1->word[0] == '(') { + for (p2 = p2->prev; p2->word[0] != ')'; p2 = p2->prev) + if (p2 == p1) + return; + if (p2 == p1->next) + return; + asyn0(p1->next, p2); + return; + } + ap = adrof1(p1->word, &aliases); + if (ap == 0) + return; + alhistp = p1->prev; + alhistt = p2; + alvec = ap->vec; + redid = lex(&alout); + alhistp = alhistt = 0; + alvec = 0; + if (err) { + freelex(&alout); + error(err); + } + if (p1->word[0] && eq(p1->word, alout.next->word)) { + char *cp = alout.next->word; + + alout.next->word = strspl("\200", cp); + XFREE(cp) + } + p1 = freenod(p1, redid ? p2 : p1->next); + if (alout.next != &alout) { + p1->next->prev = alout.prev->prev; + alout.prev->prev->next = p1->next; + alout.next->prev = p1; + p1->next = alout.next; + XFREE(alout.prev->word) + XFREE((char *)alout.prev) + } + reset(); /* throw! */ +} + +struct wordent * +freenod(p1, p2) + register struct wordent *p1, *p2; +{ + register struct wordent *retp = p1->prev; + + while (p1 != p2) { + XFREE(p1->word) + p1 = p1->next; + XFREE((char *)p1->prev) + } + retp->next = p2; + p2->prev = retp; + return (retp); +} + +#define PHERE 1 +#define PIN 2 +#define POUT 4 +#define PDIAG 8 + +/* + * syntax + * empty + * syn0 + */ +struct command * +syntax(p1, p2, flags) + register struct wordent *p1, *p2; + int flags; +{ + + while (p1 != p2) + if (any(p1->word[0], ";&\n")) + p1 = p1->next; + else + return (syn0(p1, p2, flags)); + return (0); +} + +/* + * syn0 + * syn1 + * syn1 & syntax + */ +struct command * +syn0(p1, p2, flags) + struct wordent *p1, *p2; + int flags; +{ + register struct wordent *p; + register struct command *t, *t1; + int l; + + l = 0; + for (p = p1; p != p2; p = p->next) + switch (p->word[0]) { + + case '(': + l++; + continue; + + case ')': + l--; + if (l < 0) + seterr("Too many )'s"); + continue; + + case '|': + if (p->word[1] == '|') + continue; + /* fall into ... */ + + case '>': + if (p->next != p2 && eq(p->next->word, "&")) + p = p->next; + continue; + + case '&': + if (l != 0) + break; + if (p->word[1] == '&') + continue; + t1 = syn1(p1, p, flags); + if (t1->t_dtyp == TLST || + t1->t_dtyp == TAND || + t1->t_dtyp == TOR) { + t = (struct command *) calloc(1, sizeof (*t)); + t->t_dtyp = TPAR; + t->t_dflg = FAND|FINT; + t->t_dspr = t1; + t1 = t; + } else + t1->t_dflg |= FAND|FINT; + t = (struct command *) calloc(1, sizeof (*t)); + t->t_dtyp = TLST; + t->t_dflg = 0; + t->t_dcar = t1; + t->t_dcdr = syntax(p, p2, flags); + return(t); + } + if (l == 0) + return (syn1(p1, p2, flags)); + seterr("Too many ('s"); + return (0); +} + +/* + * syn1 + * syn1a + * syn1a ; syntax + */ +struct command * +syn1(p1, p2, flags) + struct wordent *p1, *p2; + int flags; +{ + register struct wordent *p; + register struct command *t; + int l; + + l = 0; + for (p = p1; p != p2; p = p->next) + switch (p->word[0]) { + + case '(': + l++; + continue; + + case ')': + l--; + continue; + + case ';': + case '\n': + if (l != 0) + break; + t = (struct command *) calloc(1, sizeof (*t)); + t->t_dtyp = TLST; + t->t_dcar = syn1a(p1, p, flags); + t->t_dcdr = syntax(p->next, p2, flags); + if (t->t_dcdr == 0) + t->t_dcdr = t->t_dcar, t->t_dcar = 0; + return (t); + } + return (syn1a(p1, p2, flags)); +} + +/* + * syn1a + * syn1b + * syn1b || syn1a + */ +struct command * +syn1a(p1, p2, flags) + struct wordent *p1, *p2; + int flags; +{ + register struct wordent *p; + register struct command *t; + register int l = 0; + + for (p = p1; p != p2; p = p->next) + switch (p->word[0]) { + + case '(': + l++; + continue; + + case ')': + l--; + continue; + + case '|': + if (p->word[1] != '|') + continue; + if (l == 0) { + t = (struct command *) calloc(1, sizeof (*t)); + t->t_dtyp = TOR; + t->t_dcar = syn1b(p1, p, flags); + t->t_dcdr = syn1a(p->next, p2, flags); + t->t_dflg = 0; + return (t); + } + continue; + } + return (syn1b(p1, p2, flags)); +} + +/* + * syn1b + * syn2 + * syn2 && syn1b + */ +struct command * +syn1b(p1, p2, flags) + struct wordent *p1, *p2; + int flags; +{ + register struct wordent *p; + register struct command *t; + register int l = 0; + + l = 0; + for (p = p1; p != p2; p = p->next) + switch (p->word[0]) { + + case '(': + l++; + continue; + + case ')': + l--; + continue; + + case '&': + if (p->word[1] == '&' && l == 0) { + t = (struct command *) calloc(1, sizeof (*t)); + t->t_dtyp = TAND; + t->t_dcar = syn2(p1, p, flags); + t->t_dcdr = syn1b(p->next, p2, flags); + t->t_dflg = 0; + return (t); + } + continue; + } + return (syn2(p1, p2, flags)); +} + +/* + * syn2 + * syn3 + * syn3 | syn2 + * syn3 |& syn2 + */ +struct command * +syn2(p1, p2, flags) + struct wordent *p1, *p2; + int flags; +{ + register struct wordent *p, *pn; + register struct command *t; + register int l = 0; + int f; + + for (p = p1; p != p2; p = p->next) + switch (p->word[0]) { + + case '(': + l++; + continue; + + case ')': + l--; + continue; + + case '|': + if (l != 0) + continue; + t = (struct command *) calloc(1, sizeof (*t)); + f = flags | POUT; + pn = p->next; + if (pn != p2 && pn->word[0] == '&') { + f |= PDIAG; + t->t_dflg |= FDIAG; + } + t->t_dtyp = TFIL; + t->t_dcar = syn3(p1, p, f); + if (pn != p2 && pn->word[0] == '&') + p = pn; + t->t_dcdr = syn2(p->next, p2, flags | PIN); + return (t); + } + return (syn3(p1, p2, flags)); +} + +char *RELPAR = "<>()"; + +/* + * syn3 + * ( syn0 ) [ < in ] [ > out ] + * word word* [ < in ] [ > out ] + * KEYWORD ( word* ) word* [ < in ] [ > out ] + * + * KEYWORD = (@ exit foreach if set switch test while) + */ +struct command * +syn3(p1, p2, flags) + struct wordent *p1, *p2; + int flags; +{ + register struct wordent *p; + struct wordent *lp, *rp; + register struct command *t; + register int l; + char **av; + int n, c; + bool specp = 0; + + if (p1 != p2) { + p = p1; +again: + switch (srchx(p->word)) { + + case ZELSE: + p = p->next; + if (p != p2) + goto again; + break; + + case ZEXIT: + case ZFOREACH: + case ZIF: + case ZLET: + case ZSET: + case ZSWITCH: + case ZWHILE: + specp = 1; + break; + } + } + n = 0; + l = 0; + for (p = p1; p != p2; p = p->next) + switch (p->word[0]) { + + case '(': + if (specp) + n++; + l++; + continue; + + case ')': + if (specp) + n++; + l--; + continue; + + case '>': + case '<': + if (l != 0) { + if (specp) + n++; + continue; + } + if (p->next == p2) + continue; + if (any(p->next->word[0], RELPAR)) + continue; + n--; + continue; + + default: + if (!specp && l != 0) + continue; + n++; + continue; + } + if (n < 0) + n = 0; + t = (struct command *) calloc(1, sizeof (*t)); + av = (char **) calloc((unsigned) (n + 1), sizeof (char **)); + t->t_dcom = av; + n = 0; + if (p2->word[0] == ')') + t->t_dflg = FPAR; + lp = 0; + rp = 0; + l = 0; + for (p = p1; p != p2; p = p->next) { + c = p->word[0]; + switch (c) { + + case '(': + if (l == 0) { + if (lp != 0 && !specp) + seterr("Badly placed ("); + lp = p->next; + } + l++; + goto savep; + + case ')': + l--; + if (l == 0) + rp = p; + goto savep; + + case '>': + if (l != 0) + goto savep; + if (p->word[1] == '>') + t->t_dflg |= FCAT; + if (p->next != p2 && eq(p->next->word, "&")) { + t->t_dflg |= FDIAG, p = p->next; + if (flags & (POUT|PDIAG)) + goto badout; + } + if (p->next != p2 && eq(p->next->word, "!")) + t->t_dflg |= FANY, p = p->next; + if (p->next == p2) { +missfile: + seterr("Missing name for redirect"); + continue; + } + p = p->next; + if (any(p->word[0], RELPAR)) + goto missfile; + if ((flags & POUT) && (flags & PDIAG) == 0 || t->t_drit) +badout: + seterr("Ambiguous output redirect"); + else + t->t_drit = savestr(p->word); + continue; + + case '<': + if (l != 0) + goto savep; + if (p->word[1] == '<') + t->t_dflg |= FHERE; + if (p->next == p2) + goto missfile; + p = p->next; + if (any(p->word[0], RELPAR)) + goto missfile; + if ((flags & PHERE) && (t->t_dflg & FHERE)) + seterr("Can't << within ()'s"); + else if ((flags & PIN) || t->t_dlef) + seterr("Ambiguous input redirect"); + else + t->t_dlef = savestr(p->word); + continue; + +savep: + if (!specp) + continue; + default: + if (l != 0 && !specp) + continue; + if (err == 0) + av[n] = savestr(p->word); + n++; + continue; + } + } + if (lp != 0 && !specp) { + if (n != 0) + seterr("Badly placed ()'s"); + t->t_dtyp = TPAR; + t->t_dspr = syn0(lp, rp, PHERE); + } else { + if (n == 0) + seterr("Invalid null command"); + t->t_dtyp = TCOM; + } + return (t); +} + +freesyn(t) + register struct command *t; +{ + register char **v; + + if (t == 0) + return; + switch (t->t_dtyp) { + + case TCOM: + for (v = t->t_dcom; *v; v++) + XFREE(*v) + XFREE((char *)t->t_dcom) + goto lr; + + case TPAR: + freesyn(t->t_dspr); + /* fall into ... */ + +lr: + XFREE(t->t_dlef) + XFREE(t->t_drit) + break; + + case TAND: + case TOR: + case TFIL: + case TLST: + freesyn(t->t_dcar), freesyn(t->t_dcdr); + break; + } + XFREE((char *)t) +} diff --git a/bin/csh/sh.print.c b/bin/csh/sh.print.c new file mode 100644 index 0000000..3f6b32c --- /dev/null +++ b/bin/csh/sh.print.c @@ -0,0 +1,92 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley Software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if !defined(lint) && defined(DOSCCS) +static char *sccsid = "@(#)sh.print.c 5.2 (Berkeley) 6/6/85"; +#endif + +#include "sh.h" +#include + +/* + * C Shell + */ + +psecs(l) + long l; +{ + register int i; + + i = l / 3600; + if (i) { + printf("%d:", i); + i = l % 3600; + p2dig(i / 60); + goto minsec; + } + i = l; + printf("%d", i / 60); +minsec: + i %= 60; + printf(":"); + p2dig(i); +} + +p2dig(i) + register int i; +{ + + printf("%d%d", i / 10, i % 10); +} + +char linbuf[128]; +char *linp = linbuf; + +putchar(c) + register int c; +{ + + if ((c & QUOTE) == 0 && (c == 0177 || c < ' ' && c != '\t' && c != '\n')) { + putchar('^'); + if (c == 0177) + c = '?'; + else + c |= 'A' - 1; + } + c &= TRIM; + *linp++ = c; + if (c == '\n' || linp >= &linbuf[sizeof linbuf - 2]) + flush(); +} + +draino() +{ + + linp = linbuf; +} + +flush() +{ + register int unit; + int lmode; + + if (linp == linbuf) + return; + if (haderr) + unit = didfds ? 2 : SHDIAG; + else + unit = didfds ? 1 : SHOUT; +#ifdef TIOCLGET + if (didfds == 0 && ioctl(unit, TIOCLGET, (char *)&lmode) == 0 && + lmode&LFLUSHO) { + lmode = LFLUSHO; + (void) ioctl(unit, TIOCLBIC, (char *)&lmode); + (void) write(unit, "\n", 1); + } +#endif + (void) write(unit, linbuf, linp - linbuf); + linp = linbuf; +} diff --git a/bin/csh/sh.proc.c b/bin/csh/sh.proc.c new file mode 100644 index 0000000..79c5d7f --- /dev/null +++ b/bin/csh/sh.proc.c @@ -0,0 +1,1101 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley Software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if !defined(lint) && defined(DOSCCS) +static char *sccsid = "@(#)sh.proc.c 5.5.1 (2.11BSD) 1996/3/20"; +#endif + +#include "sh.h" +#include "sh.dir.h" +#include "sh.proc.h" +#include +#include +#include + +/* + * C Shell - functions that manage processes, handling hanging, termination + */ + +#define BIGINDEX 9 /* largest desirable job index */ + +/* + * pchild - called at interrupt level by the SIGCHLD signal + * indicating that at least one child has terminated or stopped + * thus at least one wait system call will definitely return a + * childs status. Top level routines (like pwait) must be sure + * to mask interrupts when playing with the proclist data structures! + */ +pchild() +{ + register struct process *pp; + register struct process *fp; + register int pid; + union wait w; + int jobflags; + struct rusage ru; + +loop: + pid = wait3(&w, (setintr ? WNOHANG|WUNTRACED:WNOHANG), &ru); + if (pid <= 0) { + if (errno == EINTR) { + errno = 0; + goto loop; + } + pnoprocesses = pid == -1; + return; + } + for (pp = proclist.p_next; pp != PNULL; pp = pp->p_next) + if (pid == pp->p_pid) + goto found; + goto loop; +found: + if (pid == atoi(value("child"))) + unsetv("child"); + pp->p_flags &= ~(PRUNNING|PSTOPPED|PREPORTED); + if (WIFSTOPPED(w)) { + pp->p_flags |= PSTOPPED; + pp->p_reason = w.w_stopsig; + } else { + if (pp->p_flags & (PTIME|PPTIME) || adrof("time")) + (void) gettimeofday(&pp->p_etime, (struct timezone *)0); + pp->p_rusage = ru; + if (WIFSIGNALED(w)) { + if (w.w_termsig == SIGINT) + pp->p_flags |= PINTERRUPTED; + else + pp->p_flags |= PSIGNALED; + if (w.w_coredump) + pp->p_flags |= PDUMPED; + pp->p_reason = w.w_termsig; + } else { + pp->p_reason = w.w_retcode; + if (pp->p_reason != 0) + pp->p_flags |= PAEXITED; + else + pp->p_flags |= PNEXITED; + } + } + jobflags = 0; + fp = pp; + do { + if ((fp->p_flags & (PPTIME|PRUNNING|PSTOPPED)) == 0 && + !child && adrof("time") && + fp->p_rusage.ru_utime.tv_sec+fp->p_rusage.ru_stime.tv_sec >= + atoi(value("time"))) + fp->p_flags |= PTIME; + jobflags |= fp->p_flags; + } while ((fp = fp->p_friends) != pp); + pp->p_flags &= ~PFOREGND; + if (pp == pp->p_friends && (pp->p_flags & PPTIME)) { + pp->p_flags &= ~PPTIME; + pp->p_flags |= PTIME; + } + if ((jobflags & (PRUNNING|PREPORTED)) == 0) { + fp = pp; + do { + if (fp->p_flags&PSTOPPED) + fp->p_flags |= PREPORTED; + } while((fp = fp->p_friends) != pp); + while(fp->p_pid != fp->p_jobid) + fp = fp->p_friends; + if (jobflags&PSTOPPED) { + if (pcurrent && pcurrent != fp) + pprevious = pcurrent; + pcurrent = fp; + } else + pclrcurr(fp); + if (jobflags&PFOREGND) { + if (jobflags & (PSIGNALED|PSTOPPED|PPTIME) || +#ifdef IIASA + jobflags & PAEXITED || +#endif + !eq(dcwd->di_name, fp->p_cwd->di_name)) { + ; /* print in pjwait */ + } +/* + else if ((jobflags & (PTIME|PSTOPPED)) == PTIME) + ptprint(fp); +*/ + } else { + if (jobflags&PNOTIFY || adrof("notify")) { + printf("\215\n"); + (void) pprint(pp, NUMBER|NAME|REASON); + if ((jobflags&PSTOPPED) == 0) + pflush(pp); + } else { + fp->p_flags |= PNEEDNOTE; + neednote++; + } + } + } + goto loop; +} + +pnote() +{ + register struct process *pp; + int flags; + long omask; + + neednote = 0; + for (pp = proclist.p_next; pp != PNULL; pp = pp->p_next) { + if (pp->p_flags & PNEEDNOTE) { + omask = sigblock(sigmask(SIGCHLD)); + pp->p_flags &= ~PNEEDNOTE; + flags = pprint(pp, NUMBER|NAME|REASON); + if ((flags&(PRUNNING|PSTOPPED)) == 0) + pflush(pp); + (void) sigsetmask(omask); + } + } +} + +/* + * pwait - wait for current job to terminate, maintaining integrity + * of current and previous job indicators. + */ +pwait() +{ + register struct process *fp, *pp; + long omask; + + /* + * Here's where dead procs get flushed. + */ + omask = sigblock(sigmask(SIGCHLD)); + for (pp = (fp = &proclist)->p_next; pp != PNULL; pp = (fp = pp)->p_next) + if (pp->p_pid == 0) { + fp->p_next = pp->p_next; + xfree(pp->p_command); + if (pp->p_cwd && --pp->p_cwd->di_count == 0) + if (pp->p_cwd->di_next == 0) + dfree(pp->p_cwd); + xfree((char *)pp); + pp = fp; + } + (void) sigsetmask(omask); + pjwait(pcurrjob); +} + +/* + * pjwait - wait for a job to finish or become stopped + * It is assumed to be in the foreground state (PFOREGND) + */ +pjwait(pp) + register struct process *pp; +{ + register struct process *fp; + int jobflags, reason; + long omask; + + while (pp->p_pid != pp->p_jobid) + pp = pp->p_friends; + fp = pp; + do { + if ((fp->p_flags&(PFOREGND|PRUNNING)) == PRUNNING) + printf("BUG: waiting for background job!\n"); + } while ((fp = fp->p_friends) != pp); + /* + * Now keep pausing as long as we are not interrupted (SIGINT), + * and the target process, or any of its friends, are running + */ + fp = pp; + omask = sigblock(sigmask(SIGCHLD)); + for (;;) { + jobflags = 0; + do + jobflags |= fp->p_flags; + while ((fp = (fp->p_friends)) != pp); + if ((jobflags & PRUNNING) == 0) + break; + sigpause(sigblock(0L) &~ sigmask(SIGCHLD)); + } + (void) sigsetmask(omask); + if (tpgrp > 0) /* get tty back */ + (void) ioctl(FSHTTY, TIOCSPGRP, (char *)&tpgrp); + if ((jobflags&(PSIGNALED|PSTOPPED|PTIME)) || + !eq(dcwd->di_name, fp->p_cwd->di_name)) { + if (jobflags&PSTOPPED) + printf("\n"); + (void) pprint(pp, AREASON|SHELLDIR); + } + if ((jobflags&(PINTERRUPTED|PSTOPPED)) && setintr && + (!gointr || !eq(gointr, "-"))) { + if ((jobflags & PSTOPPED) == 0) + pflush(pp); + pintr1(0); + /*NOTREACHED*/ + } + reason = 0; + fp = pp; + do { + if (fp->p_reason) + reason = fp->p_flags & (PSIGNALED|PINTERRUPTED) ? + fp->p_reason | QUOTE : fp->p_reason; + } while ((fp = fp->p_friends) != pp); + set("status", putn(reason)); + if (reason && exiterr) + exitstat(); + pflush(pp); +} + +/* + * dowait - wait for all processes to finish + */ +dowait() +{ + register struct process *pp; + long omask; + + pjobs++; + omask = sigblock(sigmask(SIGCHLD)); +loop: + for (pp = proclist.p_next; pp; pp = pp->p_next) + if (pp->p_pid && /* pp->p_pid == pp->p_jobid && */ + pp->p_flags&PRUNNING) { + sigpause(0L); + goto loop; + } + (void) sigsetmask(omask); + pjobs = 0; +} + +/* + * pflushall - flush all jobs from list (e.g. at fork()) + */ +pflushall() +{ + register struct process *pp; + + for (pp = proclist.p_next; pp != PNULL; pp = pp->p_next) + if (pp->p_pid) + pflush(pp); +} + +/* + * pflush - flag all process structures in the same job as the + * the argument process for deletion. The actual free of the + * space is not done here since pflush is called at interrupt level. + */ +pflush(pp) + register struct process *pp; +{ + register struct process *np; + register int index; + + if (pp->p_pid == 0) { + printf("BUG: process flushed twice"); + return; + } + while (pp->p_pid != pp->p_jobid) + pp = pp->p_friends; + pclrcurr(pp); + if (pp == pcurrjob) + pcurrjob = 0; + index = pp->p_index; + np = pp; + do { + np->p_index = np->p_pid = 0; + np->p_flags &= ~PNEEDNOTE; + } while ((np = np->p_friends) != pp); + if (index == pmaxindex) { + for (np = proclist.p_next, index = 0; np; np = np->p_next) + if (np->p_index > index) + index = np->p_index; + pmaxindex = index; + } +} + +/* + * pclrcurr - make sure the given job is not the current or previous job; + * pp MUST be the job leader + */ +pclrcurr(pp) + register struct process *pp; +{ + + if (pp == pcurrent) + if (pprevious != PNULL) { + pcurrent = pprevious; + pprevious = pgetcurr(pp); + } else { + pcurrent = pgetcurr(pp); + pprevious = pgetcurr(pp); + } + else if (pp == pprevious) + pprevious = pgetcurr(pp); +} + +/* +4 here is 1 for '\0', 1 ea for << >& >> */ +char command[PMAXLEN+4]; +int cmdlen; +char *cmdp; +/* + * palloc - allocate a process structure and fill it up. + * an important assumption is made that the process is running. + */ +palloc(pid, t) + int pid; + register struct command *t; +{ + register struct process *pp; + int i; + + pp = (struct process *)calloc(1, sizeof(struct process)); + pp->p_pid = pid; + pp->p_flags = t->t_dflg & FAND ? PRUNNING : PRUNNING|PFOREGND; + if (t->t_dflg & FTIME) + pp->p_flags |= PPTIME; + cmdp = command; + cmdlen = 0; + padd(t); + *cmdp++ = 0; + if (t->t_dflg & FPOU) { + pp->p_flags |= PPOU; + if (t->t_dflg & FDIAG) + pp->p_flags |= PDIAG; + } + pp->p_command = savestr(command); + if (pcurrjob) { + struct process *fp; + /* careful here with interrupt level */ + pp->p_cwd = 0; + pp->p_index = pcurrjob->p_index; + pp->p_friends = pcurrjob; + pp->p_jobid = pcurrjob->p_pid; + for (fp = pcurrjob; fp->p_friends != pcurrjob; fp = fp->p_friends) + ; + fp->p_friends = pp; + } else { + pcurrjob = pp; + pp->p_jobid = pid; + pp->p_friends = pp; + pp->p_cwd = dcwd; + dcwd->di_count++; + if (pmaxindex < BIGINDEX) + pp->p_index = ++pmaxindex; + else { + struct process *np; + + for (i = 1; ; i++) { + for (np = proclist.p_next; np; np = np->p_next) + if (np->p_index == i) + goto tryagain; + pp->p_index = i; + if (i > pmaxindex) + pmaxindex = i; + break; + tryagain:; + } + } + if (pcurrent == PNULL) + pcurrent = pp; + else if (pprevious == PNULL) + pprevious = pp; + } + pp->p_next = proclist.p_next; + proclist.p_next = pp; + (void) gettimeofday(&pp->p_btime, (struct timezone *)0); +} + +padd(t) + register struct command *t; +{ + char **argp; + + if (t == 0) + return; + switch (t->t_dtyp) { + + case TPAR: + pads("( "); + padd(t->t_dspr); + pads(" )"); + break; + + case TCOM: + for (argp = t->t_dcom; *argp; argp++) { + pads(*argp); + if (argp[1]) + pads(" "); + } + break; + + case TOR: + case TAND: + case TFIL: + case TLST: + padd(t->t_dcar); + switch (t->t_dtyp) { + case TOR: + pads(" || "); + break; + case TAND: + pads(" && "); + break; + case TFIL: + pads(" | "); + break; + case TLST: + pads("; "); + break; + } + padd(t->t_dcdr); + return; + } + if ((t->t_dflg & FPIN) == 0 && t->t_dlef) { + pads((t->t_dflg & FHERE) ? " << " : " < "); + pads(t->t_dlef); + } + if ((t->t_dflg & FPOU) == 0 && t->t_drit) { + pads((t->t_dflg & FCAT) ? " >>" : " >"); + if (t->t_dflg & FDIAG) + pads("&"); + pads(" "); + pads(t->t_drit); + } +} + +pads(cp) + char *cp; +{ + register int i = strlen(cp); + + if (cmdlen >= PMAXLEN) + return; + if (cmdlen + i >= PMAXLEN) { + (void) strcpy(cmdp, " ..."); + cmdlen = PMAXLEN; + cmdp += 4; + return; + } + (void) strcpy(cmdp, cp); + cmdp += i; + cmdlen += i; +} + +/* + * psavejob - temporarily save the current job on a one level stack + * so another job can be created. Used for { } in exp6 + * and `` in globbing. + */ +psavejob() +{ + + pholdjob = pcurrjob; + pcurrjob = PNULL; +} + +/* + * prestjob - opposite of psavejob. This may be missed if we are interrupted + * somewhere, but pendjob cleans up anyway. + */ +prestjob() +{ + + pcurrjob = pholdjob; + pholdjob = PNULL; +} + +/* + * pendjob - indicate that a job (set of commands) has been completed + * or is about to begin. + */ +pendjob() +{ + register struct process *pp, *tp; + + if (pcurrjob && (pcurrjob->p_flags&(PFOREGND|PSTOPPED)) == 0) { + pp = pcurrjob; + while (pp->p_pid != pp->p_jobid) + pp = pp->p_friends; + printf("[%d]", pp->p_index); + tp = pp; + do { + printf(" %d", pp->p_pid); + pp = pp->p_friends; + } while (pp != tp); + printf("\n"); + } + pholdjob = pcurrjob = 0; +} + +/* + * pprint - print a job + */ +pprint(pp, flag) + register struct process *pp; +{ + register status, reason; + struct process *tp; + extern char *linp, linbuf[]; + int jobflags, pstatus; + char *format; + + while (pp->p_pid != pp->p_jobid) + pp = pp->p_friends; + if (pp == pp->p_friends && (pp->p_flags & PPTIME)) { + pp->p_flags &= ~PPTIME; + pp->p_flags |= PTIME; + } + tp = pp; + status = reason = -1; + jobflags = 0; + do { + jobflags |= pp->p_flags; + pstatus = pp->p_flags & PALLSTATES; + if (tp != pp && linp != linbuf && !(flag&FANCY) && + (pstatus == status && pp->p_reason == reason || + !(flag&REASON))) + printf(" "); + else { + if (tp != pp && linp != linbuf) + printf("\n"); + if(flag&NUMBER) + if (pp == tp) + printf("[%d]%s %c ", pp->p_index, + pp->p_index < 10 ? " " : "", + pp==pcurrent ? '+' : + (pp == pprevious ? '-' : ' ')); + else + printf(" "); + if (flag&FANCY) + printf("%5d ", pp->p_pid); + if (flag&(REASON|AREASON)) { + if (flag&NAME) + format = "%-21s"; + else + format = "%s"; + if (pstatus == status) + if (pp->p_reason == reason) { + printf(format, ""); + goto prcomd; + } else + reason = pp->p_reason; + else { + status = pstatus; + reason = pp->p_reason; + } + switch (status) { + + case PRUNNING: + printf(format, "Running "); + break; + + case PINTERRUPTED: + case PSTOPPED: + case PSIGNALED: + if ((flag&(REASON|AREASON)) + && reason != SIGINT + && reason != SIGPIPE) + printf(format, mesg[pp->p_reason].pname); + break; + + case PNEXITED: + case PAEXITED: + if (flag & REASON) + if (pp->p_reason) + printf("Exit %-16d", pp->p_reason); + else + printf(format, "Done"); + break; + + default: + printf("BUG: status=%-9o", status); + } + } + } +prcomd: + if (flag&NAME) { + printf("%s", pp->p_command); + if (pp->p_flags & PPOU) + printf(" |"); + if (pp->p_flags & PDIAG) + printf("&"); + } + if (flag&(REASON|AREASON) && pp->p_flags&PDUMPED) + printf(" (core dumped)"); + if (tp == pp->p_friends) { + if (flag&ERSAND) + printf(" &"); + if (flag&JOBDIR && + !eq(tp->p_cwd->di_name, dcwd->di_name)) { + printf(" (wd: "); + dtildepr(value("home"), tp->p_cwd->di_name); + printf(")"); + } + } + if (pp->p_flags&PPTIME && !(status&(PSTOPPED|PRUNNING))) { + if (linp != linbuf) + printf("\n\t"); + { static struct rusage zru; + prusage(&zru, &pp->p_rusage, &pp->p_etime, + &pp->p_btime); + } + } + if (tp == pp->p_friends) { + if (linp != linbuf) + printf("\n"); + if (flag&SHELLDIR && !eq(tp->p_cwd->di_name, dcwd->di_name)) { + printf("(wd now: "); + dtildepr(value("home"), dcwd->di_name); + printf(")\n"); + } + } + } while ((pp = pp->p_friends) != tp); + if (jobflags&PTIME && (jobflags&(PSTOPPED|PRUNNING)) == 0) { + if (jobflags & NUMBER) + printf(" "); + ptprint(tp); + } + return (jobflags); +} + +ptprint(tp) + register struct process *tp; +{ + struct timeval tetime, diff; + static struct timeval ztime; + struct rusage ru; + static struct rusage zru; + register struct process *pp = tp; + + ru = zru; + tetime = ztime; + do { + ruadd(&ru, &pp->p_rusage); + tvsub(&diff, &pp->p_etime, &pp->p_btime); + if (timercmp(&diff, &tetime, >)) + tetime = diff; + } while ((pp = pp->p_friends) != tp); + prusage(&zru, &ru, &tetime, &ztime); +} + +/* + * dojobs - print all jobs + */ +dojobs(v) + char **v; +{ + register struct process *pp; + register int flag = NUMBER|NAME|REASON; + int i; + + if (chkstop) + chkstop = 2; + if (*++v) { + if (v[1] || !eq(*v, "-l")) + error("Usage: jobs [ -l ]"); + flag |= FANCY|JOBDIR; + } + for (i = 1; i <= pmaxindex; i++) + for (pp = proclist.p_next; pp; pp = pp->p_next) + if (pp->p_index == i && pp->p_pid == pp->p_jobid) { + pp->p_flags &= ~PNEEDNOTE; + if (!(pprint(pp, flag) & (PRUNNING|PSTOPPED))) + pflush(pp); + break; + } +} + +/* + * dofg - builtin - put the job into the foreground + */ +dofg(v) + char **v; +{ + register struct process *pp; + + okpcntl(); + ++v; + do { + pp = pfind(*v); + pstart(pp, 1); + pjwait(pp); + } while (*v && *++v); +} + +/* + * %... - builtin - put the job into the foreground + */ +dofg1(v) + char **v; +{ + register struct process *pp; + + okpcntl(); + pp = pfind(v[0]); + pstart(pp, 1); + pjwait(pp); +} + +/* + * dobg - builtin - put the job into the background + */ +dobg(v) + char **v; +{ + register struct process *pp; + + okpcntl(); + ++v; + do { + pp = pfind(*v); + pstart(pp, 0); + } while (*v && *++v); +} + +/* + * %... & - builtin - put the job into the background + */ +dobg1(v) + char **v; +{ + register struct process *pp; + + pp = pfind(v[0]); + pstart(pp, 0); +} + +/* + * dostop - builtin - stop the job + */ +dostop(v) + char **v; +{ + + pkill(++v, SIGSTOP); +} + +/* + * dokill - builtin - superset of kill (1) + */ +dokill(v) + char **v; +{ + register int signum; + register char *name; + + v++; + if (v[0] && v[0][0] == '-') { + if (v[0][1] == 'l') { + for (signum = 1; signum <= NSIG; signum++) { + if (name = mesg[signum].iname) + printf("%s ", name); + if (signum == 16) + putchar('\n'); + } + putchar('\n'); + return; + } + if (digit(v[0][1])) { + signum = atoi(v[0]+1); + if (signum < 0 || signum > NSIG) + bferr("Bad signal number"); + } else { + name = &v[0][1]; + for (signum = 1; signum <= NSIG; signum++) + if (mesg[signum].iname && + eq(name, mesg[signum].iname)) + goto gotsig; + setname(name); + bferr("Unknown signal; kill -l lists signals"); + } +gotsig: + v++; + } else + signum = SIGTERM; + pkill(v, signum); +} + +pkill(v, signum) + char **v; + int signum; +{ + register struct process *pp, *np; + register int jobflags = 0; + int pid, err = 0; + long omask; + char *cp; + + omask = sigmask(SIGCHLD); + if (setintr) + omask |= sigmask(SIGINT); + omask = sigblock(omask) & ~omask; + while (*v) { + cp = globone(*v); + if (*cp == '%') { + np = pp = pfind(cp); + do + jobflags |= np->p_flags; + while ((np = np->p_friends) != pp); + switch (signum) { + + case SIGSTOP: + case SIGTSTP: + case SIGTTIN: + case SIGTTOU: + if ((jobflags & PRUNNING) == 0) { + printf("%s: Already stopped\n", cp); + err++; + goto cont; + } + } + if (killpg(pp->p_jobid, signum) < 0) { + printf("%s: ", cp); + printf("%s\n", syserrlst(errno)); + err++; + } + if (signum == SIGTERM || signum == SIGHUP) + (void) killpg(pp->p_jobid, SIGCONT); + } else if (!(digit(*cp) || *cp == '-')) + bferr("Arguments should be jobs or process id's"); + else { + pid = atoi(cp); + if (kill(pid, signum) < 0) { + printf("%d: ", pid); + printf("%s\n", syserrlst(errno)); + err++; + goto cont; + } + if (signum == SIGTERM || signum == SIGHUP) + (void) kill(pid, SIGCONT); + } +cont: + xfree(cp); + v++; + } + (void) sigsetmask(omask); + if (err) + error(NOSTR); +} + +/* + * pstart - start the job in foreground/background + */ +pstart(pp, foregnd) + register struct process *pp; + int foregnd; +{ + register struct process *np; + int jobflags = 0; + long omask; + + omask = sigblock(sigmask(SIGCHLD)); + np = pp; + do { + jobflags |= np->p_flags; + if (np->p_flags&(PRUNNING|PSTOPPED)) { + np->p_flags |= PRUNNING; + np->p_flags &= ~PSTOPPED; + if (foregnd) + np->p_flags |= PFOREGND; + else + np->p_flags &= ~PFOREGND; + } + } while((np = np->p_friends) != pp); + if (!foregnd) + pclrcurr(pp); + (void) pprint(pp, foregnd ? NAME|JOBDIR : NUMBER|NAME|AMPERSAND); + if (foregnd) + (void) ioctl(FSHTTY, TIOCSPGRP, (char *)&pp->p_jobid); + if (jobflags&PSTOPPED) + (void) killpg(pp->p_jobid, SIGCONT); + (void) sigsetmask(omask); +} + +panystop(neednl) +{ + register struct process *pp; + + chkstop = 2; + for (pp = proclist.p_next; pp; pp = pp->p_next) + if (pp->p_flags & PSTOPPED) + error("\nThere are stopped jobs" + 1 - neednl); +} + +struct process * +pfind(cp) + char *cp; +{ + register struct process *pp, *np; + + if (cp == 0 || cp[1] == 0 || eq(cp, "%%") || eq(cp, "%+")) { + if (pcurrent == PNULL) + bferr("No current job"); + return (pcurrent); + } + if (eq(cp, "%-") || eq(cp, "%#")) { + if (pprevious == PNULL) + bferr("No previous job"); + return (pprevious); + } + if (digit(cp[1])) { + int index = atoi(cp+1); + for (pp = proclist.p_next; pp; pp = pp->p_next) + if (pp->p_index == index && pp->p_pid == pp->p_jobid) + return (pp); + bferr("No such job"); + } + np = PNULL; + for (pp = proclist.p_next; pp; pp = pp->p_next) + if (pp->p_pid == pp->p_jobid) { + if (cp[1] == '?') { + register char *dp; + for (dp = pp->p_command; *dp; dp++) { + if (*dp != cp[2]) + continue; + if (prefix(cp+2, dp)) + goto match; + } + } else if (prefix(cp+1, pp->p_command)) { +match: + if (np) + bferr("Ambiguous"); + np = pp; + } + } + if (np) + return (np); + if (cp[1] == '?') + bferr("No job matches pattern"); + else + bferr("No such job"); + /*NOTREACHED*/ +} + +/* + * pgetcurr - find most recent job that is not pp, preferably stopped + */ +struct process * +pgetcurr(pp) + register struct process *pp; +{ + register struct process *np; + register struct process *xp = PNULL; + + for (np = proclist.p_next; np; np = np->p_next) + if (np != pcurrent && np != pp && np->p_pid && + np->p_pid == np->p_jobid) { + if (np->p_flags & PSTOPPED) + return (np); + if (xp == PNULL) + xp = np; + } + return (xp); +} + +/* + * donotify - flag the job so as to report termination asynchronously + */ +donotify(v) + char **v; +{ + register struct process *pp; + + pp = pfind(*++v); + pp->p_flags |= PNOTIFY; +} + +/* + * Do the fork and whatever should be done in the child side that + * should not be done if we are not forking at all (like for simple builtin's) + * Also do everything that needs any signals fiddled with in the parent side + * + * Wanttty tells whether process and/or tty pgrps are to be manipulated: + * -1: leave tty alone; inherit pgrp from parent + * 0: already have tty; manipulate process pgrps only + * 1: want to claim tty; manipulate process and tty pgrps + * It is usually just the value of tpgrp. + */ +pfork(t, wanttty) + struct command *t; /* command we are forking for */ + int wanttty; +{ + register int pid; + bool ignint = 0; + int pgrp; + long omask; + + /* + * A child will be uninterruptible only under very special + * conditions. Remember that the semantics of '&' is + * implemented by disconnecting the process from the tty so + * signals do not need to ignored just for '&'. + * Thus signals are set to default action for children unless: + * we have had an "onintr -" (then specifically ignored) + * we are not playing with signals (inherit action) + */ + if (setintr) + ignint = (tpgrp == -1 && (t->t_dflg&FINT)) + || (gointr && eq(gointr, "-")); + /* + * Hold SIGCHLD until we have the process installed in our table. + */ + omask = sigblock(sigmask(SIGCHLD)); + while ((pid = fork()) < 0) + if (setintr == 0) + sleep(FORKSLEEP); + else { + (void) sigsetmask(omask); + error("No more processes"); + } + if (pid == 0) { + settimes(); + pgrp = pcurrjob ? pcurrjob->p_jobid : getpid(); + pflushall(); + pcurrjob = PNULL; + child++; + if (setintr) { + setintr = 0; /* until I think otherwise */ + /* + * Children just get blown away on SIGINT, SIGQUIT + * unless "onintr -" seen. + */ + (void) signal(SIGINT, ignint ? SIG_IGN : SIG_DFL); + (void) signal(SIGQUIT, ignint ? SIG_IGN : SIG_DFL); + if (wanttty >= 0) { + /* make stoppable */ + (void) signal(SIGTSTP, SIG_DFL); + (void) signal(SIGTTIN, SIG_DFL); + (void) signal(SIGTTOU, SIG_DFL); + } + (void) signal(SIGTERM, parterm); + } else if (tpgrp == -1 && (t->t_dflg&FINT)) { + (void) signal(SIGINT, SIG_IGN); + (void) signal(SIGQUIT, SIG_IGN); + } + if (wanttty > 0) + (void) ioctl(FSHTTY, TIOCSPGRP, (char *)&pgrp); + if (wanttty >= 0 && tpgrp >= 0) + (void) setpgrp(0, pgrp); + if (tpgrp > 0) + tpgrp = 0; /* gave tty away */ + /* + * Nohup and nice apply only to TCOM's but it would be + * nice (?!?) if you could say "nohup (foo;bar)" + * Then the parser would have to know about nice/nohup/time + */ + if (t->t_dflg & FNOHUP) + (void) signal(SIGHUP, SIG_IGN); + if (t->t_dflg & FNICE) + (void) setpriority(PRIO_PROCESS, 0, t->t_nice); + } else { + palloc(pid, t); + (void) sigsetmask(omask); + } + + return (pid); +} + +okpcntl() +{ + + if (tpgrp == -1) + error("No job control in this shell"); + if (tpgrp == 0) + error("No job control in subshells"); +} diff --git a/bin/csh/sh.proc.h b/bin/csh/sh.proc.h new file mode 100644 index 0000000..48dc60c --- /dev/null +++ b/bin/csh/sh.proc.h @@ -0,0 +1,84 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley Software License Agreement + * specifies the terms and conditions for redistribution. + * + * @(#)sh.proc.h 5.2 (Berkeley) 6/6/85 + */ + +/* + * C shell - process structure declarations + */ + +/* + * Structure for each process the shell knows about: + * allocated and filled by pcreate. + * flushed by pflush; freeing always happens at top level + * so the interrupt level has less to worry about. + * processes are related to "friends" when in a pipeline; + * p_friends links makes a circular list of such jobs + */ +struct process { + struct process *p_next; /* next in global "proclist" */ + struct process *p_friends; /* next in job list (or self) */ + struct directory *p_cwd; /* cwd of the job (only in head) */ + short unsigned p_flags; /* various job status flags */ + char p_reason; /* reason for entering this state */ + char p_index; /* shorthand job index */ + int p_pid; + int p_jobid; /* pid of job leader */ + /* if a job is stopped/background p_jobid gives its pgrp */ + struct timeval p_btime; /* begin time */ + struct timeval p_etime; /* end time */ + struct rusage p_rusage; + char *p_command; /* first PMAXLEN chars of command */ +}; + +/* flag values for p_flags */ +#define PRUNNING (1<<0) /* running */ +#define PSTOPPED (1<<1) /* stopped */ +#define PNEXITED (1<<2) /* normally exited */ +#define PAEXITED (1<<3) /* abnormally exited */ +#define PSIGNALED (1<<4) /* terminated by a signal != SIGINT */ + +#define PALLSTATES (PRUNNING|PSTOPPED|PNEXITED|PAEXITED|PSIGNALED|PINTERRUPTED) +#define PNOTIFY (1<<5) /* notify async when done */ +#define PTIME (1<<6) /* job times should be printed */ +#define PAWAITED (1<<7) /* top level is waiting for it */ +#define PFOREGND (1<<8) /* started in shells pgrp */ +#define PDUMPED (1<<9) /* process dumped core */ +#define PDIAG (1<<10) /* diagnostic output also piped out */ +#define PPOU (1<<11) /* piped output */ +#define PREPORTED (1<<12) /* status has been reported */ +#define PINTERRUPTED (1<<13) /* job stopped via interrupt signal */ +#define PPTIME (1<<14) /* time individual process */ +#define PNEEDNOTE (1<<15) /* notify as soon as practical */ + +#define PNULL (struct process *)0 +#define PMAXLEN 80 + +/* defines for arguments to pprint */ +#define NUMBER 01 +#define NAME 02 +#define REASON 04 +#define AMPERSAND 010 +#define FANCY 020 +#define SHELLDIR 040 /* print shell's dir if not the same */ +#define JOBDIR 0100 /* print job's dir if not the same */ +#define AREASON 0200 + +struct process proclist; /* list head of all processes */ +bool pnoprocesses; /* pchild found nothing to wait for */ + +struct process *pholdjob; /* one level stack of current jobs */ + +struct process *pcurrjob; /* current job */ +struct process *pcurrent; /* current job in table */ +struct process *pprevious; /* previous job in table */ + +short pmaxindex; /* current maximum job index */ + +int psigint(); +struct process *pgetcurr(); +struct process *plookup(); +struct process *pfind(); diff --git a/bin/csh/sh.sem.c b/bin/csh/sh.sem.c new file mode 100644 index 0000000..7796e8c --- /dev/null +++ b/bin/csh/sh.sem.c @@ -0,0 +1,412 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley Software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if !defined(lint) && defined(DOSCCS) +static char *sccsid = "@(#)sh.sem.c 5.4.1 (2.11BSD GTE) 12/9/94"; +#endif + +#include "sh.h" +#include "sh.proc.h" +#include +#include + +/* + * C shell + */ + +/*VARARGS 1*/ +execute(t, wanttty, pipein, pipeout) + register struct command *t; + int wanttty, *pipein, *pipeout; +{ + bool forked = 0; + struct biltins *bifunc; + int pid = 0; + int pv[2]; + + if (t == 0) + return; + if ((t->t_dflg & FAND) && wanttty > 0) + wanttty = 0; + switch (t->t_dtyp) { + + case TCOM: + if ((t->t_dcom[0][0] & (QUOTE|TRIM)) == QUOTE) + (void) strcpy(t->t_dcom[0], t->t_dcom[0] + 1); + if ((t->t_dflg & FREDO) == 0) + Dfix(t); /* $ " ' \ */ + if (t->t_dcom[0] == 0) + return; + /* fall into... */ + + case TPAR: + if (t->t_dflg & FPOU) + mypipe(pipeout); + /* + * Must do << early so parent will know + * where input pointer should be. + * If noexec then this is all we do. + */ + if (t->t_dflg & FHERE) { + (void) close(0); + heredoc(t->t_dlef); + if (noexec) + (void) close(0); + } + if (noexec) + break; + + set("status", "0"); + + /* + * This mess is the necessary kludge to handle the prefix + * builtins: nice, nohup, time. These commands can also + * be used by themselves, and this is not handled here. + * This will also work when loops are parsed. + */ + while (t->t_dtyp == TCOM) + if (eq(t->t_dcom[0], "nice")) + if (t->t_dcom[1]) + if (any(t->t_dcom[1][0], "+-")) + if (t->t_dcom[2]) { + setname("nice"); + t->t_nice = getn(t->t_dcom[1]); + lshift(t->t_dcom, 2); + t->t_dflg |= FNICE; + } else + break; + else { + t->t_nice = 4; + lshift(t->t_dcom, 1); + t->t_dflg |= FNICE; + } + else + break; + else if (eq(t->t_dcom[0], "nohup")) + if (t->t_dcom[1]) { + t->t_dflg |= FNOHUP; + lshift(t->t_dcom, 1); + } else + break; + else if (eq(t->t_dcom[0], "time")) + if (t->t_dcom[1]) { + t->t_dflg |= FTIME; + lshift(t->t_dcom, 1); + } else + break; + else + break; + /* + * Check if we have a builtin function and remember which one. + */ + bifunc = t->t_dtyp == TCOM ? isbfunc(t) : (struct biltins *) 0; + + /* + * We fork only if we are timed, or are not the end of + * a parenthesized list and not a simple builtin function. + * Simple meaning one that is not pipedout, niced, nohupped, + * or &'d. + * It would be nice(?) to not fork in some of these cases. + */ + if (((t->t_dflg & FTIME) || (t->t_dflg & FPAR) == 0 && + (!bifunc || t->t_dflg & (FPOU|FAND|FNICE|FNOHUP)))) +#ifdef VFORK + if (t->t_dtyp == TPAR || t->t_dflg&(FREDO|FAND) || bifunc) +#endif + { forked++; pid = pfork(t, wanttty); } +#ifdef VFORK + else { + int vffree(); + int ochild, osetintr, ohaderr, odidfds; + int oSHIN, oSHOUT, oSHDIAG, oOLDSTD, otpgrp; + long omask; + + /* + * Prepare for the vfork by saving everything + * that the child corrupts before it exec's. + * Note that in some signal implementations + * which keep the signal info in user space + * (e.g. Sun's) it will also be necessary to + * save and restore the current sigvec's for + * the signals the child touches before it + * exec's. + */ + omask = sigblock(sigmask(SIGCHLD)); + ochild = child; osetintr = setintr; + ohaderr = haderr; odidfds = didfds; + oSHIN = SHIN; oSHOUT = SHOUT; + oSHDIAG = SHDIAG; oOLDSTD = OLDSTD; otpgrp = tpgrp; + Vsav = Vdp = 0; Vav = 0; + pid = vfork(); + if (pid < 0) { + (void) sigsetmask(omask); + error("No more processes"); + } + forked++; + if (pid) { /* parent */ + register char **v; + + child = ochild; setintr = osetintr; + haderr = ohaderr; didfds = odidfds; + SHIN = oSHIN; + SHOUT = oSHOUT; SHDIAG = oSHDIAG; + OLDSTD = oOLDSTD; tpgrp = otpgrp; + xfree(Vsav); Vsav = 0; + xfree(Vdp); Vdp = 0; + xfree((char *)Vav); Vav = 0; + if (v = gargv) + gargv = 0, blkfree(v); + if (v = pargv) + pargv = 0, blkfree(v); + /* this is from pfork() */ + palloc(pid, t); + (void) sigsetmask(omask); + } else { /* child */ + /* this is from pfork() */ + int pgrp; + bool ignint = 0; + + if (setintr) + ignint = + (tpgrp == -1 && (t->t_dflg&FINT)) + || gointr && eq(gointr, "-"); + pgrp = pcurrjob ? pcurrjob->p_jobid : getpid(); + child++; + if (setintr) { + setintr = 0; +#ifdef notdef + (void) signal(SIGCHLD, SIG_DFL); +#endif + (void) signal(SIGINT, ignint ? + SIG_IGN : vffree); + (void) signal(SIGQUIT, ignint ? + SIG_IGN : SIG_DFL); + if (wanttty >= 0) { + (void) signal(SIGTSTP, SIG_DFL); + (void) signal(SIGTTIN, SIG_DFL); + (void) signal(SIGTTOU, SIG_DFL); + } + (void) signal(SIGTERM, parterm); + } else if (tpgrp == -1 && (t->t_dflg&FINT)) { + (void) signal(SIGINT, SIG_IGN); + (void) signal(SIGQUIT, SIG_IGN); + } + if (wanttty > 0) + (void) ioctl(FSHTTY, TIOCSPGRP, + (char *)&pgrp); + if (wanttty >= 0 && tpgrp >= 0) + (void) setpgrp(0, pgrp); + if (tpgrp > 0) + tpgrp = 0; + if (t->t_dflg & FNOHUP) + (void) signal(SIGHUP, SIG_IGN); + if (t->t_dflg & FNICE) + (void) setpriority(PRIO_PROCESS, + 0, t->t_nice); + } + + } +#endif + if (pid != 0) { + /* + * It would be better if we could wait for the + * whole job when we knew the last process + * had been started. Pwait, in fact, does + * wait for the whole job anyway, but this test + * doesn't really express our intentions. + */ + if (didfds==0 && t->t_dflg&FPIN) { + (void) close(pipein[0]); + (void) close(pipein[1]); + } + if ((t->t_dflg & (FPOU|FAND)) == 0) + pwait(); + break; + } + doio(t, pipein, pipeout); + if (t->t_dflg & FPOU) { + (void) close(pipeout[0]); + (void) close(pipeout[1]); + } + + /* + * Perform a builtin function. + * If we are not forked, arrange for possible stopping + */ + if (bifunc) { + func(t, bifunc); + if (forked) + exitstat(); + break; + } + if (t->t_dtyp != TPAR) { + doexec(t); + /*NOTREACHED*/ + } + /* + * For () commands must put new 0,1,2 in FSH* and recurse + */ + OLDSTD = dcopy(0, FOLDSTD); + SHOUT = dcopy(1, FSHOUT); + SHDIAG = dcopy(2, FSHDIAG); + (void) close(SHIN); + SHIN = -1; + didfds = 0; + wanttty = -1; + t->t_dspr->t_dflg |= t->t_dflg & FINT; + execute(t->t_dspr, wanttty); + exitstat(); + + case TFIL: + t->t_dcar->t_dflg |= FPOU | + (t->t_dflg & (FPIN|FAND|FDIAG|FINT)); + execute(t->t_dcar, wanttty, pipein, pv); + t->t_dcdr->t_dflg |= FPIN | + (t->t_dflg & (FPOU|FAND|FPAR|FINT)); + if (wanttty > 0) + wanttty = 0; /* got tty already */ + execute(t->t_dcdr, wanttty, pv, pipeout); + break; + + case TLST: + if (t->t_dcar) { + t->t_dcar->t_dflg |= t->t_dflg & FINT; + execute(t->t_dcar, wanttty); + /* + * In strange case of A&B make a new job after A + */ + if (t->t_dcar->t_dflg&FAND && t->t_dcdr && + (t->t_dcdr->t_dflg&FAND) == 0) + pendjob(); + } + if (t->t_dcdr) { + t->t_dcdr->t_dflg |= t->t_dflg & (FPAR|FINT); + execute(t->t_dcdr, wanttty); + } + break; + + case TOR: + case TAND: + if (t->t_dcar) { + t->t_dcar->t_dflg |= t->t_dflg & FINT; + execute(t->t_dcar, wanttty); + if ((getn(value("status")) == 0) != (t->t_dtyp == TAND)) + return; + } + if (t->t_dcdr) { + t->t_dcdr->t_dflg |= t->t_dflg & (FPAR|FINT); + execute(t->t_dcdr, wanttty); + } + break; + } + /* + * Fall through for all breaks from switch + * + * If there will be no more executions of this + * command, flush all file descriptors. + * Places that turn on the FREDO bit are responsible + * for doing donefds after the last re-execution + */ + if (didfds && !(t->t_dflg & FREDO)) + donefds(); +} + +#ifdef VFORK +vffree() +{ + register char **v; + + if (v = gargv) + gargv = 0, blkfree(v); + if (v = pargv) + pargv = 0, blkfree(v); + _exit(1); +} +#endif + +/* + * Perform io redirection. + * We may or maynot be forked here. + */ +doio(t, pipein, pipeout) + register struct command *t; + int *pipein, *pipeout; +{ + register char *cp; + register int flags = t->t_dflg; + + if (didfds || (flags & FREDO)) + return; + if ((flags & FHERE) == 0) { /* FHERE already done */ + (void) close(0); + if (cp = t->t_dlef) { + cp = globone(Dfix1(cp)); + xfree(cp); + if (open(cp, 0) < 0) + Perror(cp); + } else if (flags & FPIN) { + (void) dup(pipein[0]); + (void) close(pipein[0]); + (void) close(pipein[1]); + } else if ((flags & FINT) && tpgrp == -1) { + (void) close(0); + (void) open("/dev/null", 0); + } else + (void) dup(OLDSTD); + } + (void) close(1); + if (cp = t->t_drit) { + cp = globone(Dfix1(cp)); + xfree(cp); + if ((flags & FCAT) && open(cp, O_WRONLY | O_APPEND) >= 0) + ; + else { + if (!(flags & FANY) && adrof("noclobber")) { + if (flags & FCAT) + Perror(cp); + chkclob(cp); + } + if (creat(cp, 0666) < 0) + Perror(cp); + } + } else if (flags & FPOU) + (void) dup(pipeout[1]); + else + (void) dup(SHOUT); + + (void) close(2); + if (flags & FDIAG) + (void) dup(1); + else + (void) dup(SHDIAG); + didfds = 1; +} + +mypipe(pv) + register int *pv; +{ + + if (pipe(pv) < 0) + goto oops; + pv[0] = dmove(pv[0], -1); + pv[1] = dmove(pv[1], -1); + if (pv[0] >= 0 && pv[1] >= 0) + return; +oops: + error("Can't make pipe"); +} + +chkclob(cp) + register char *cp; +{ + struct stat stb; + + if (stat(cp, &stb) < 0) + return; + if ((stb.st_mode & S_IFMT) == S_IFCHR) + return; + error("%s: File exists", cp); +} diff --git a/bin/csh/sh.set.c b/bin/csh/sh.set.c new file mode 100644 index 0000000..a0b8f51 --- /dev/null +++ b/bin/csh/sh.set.c @@ -0,0 +1,701 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley Software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if !defined(lint) && defined(DOSCCS) +static char *sccsid = "@(#)sh.set.c 5.2 (Berkeley) 6/6/85"; +#endif + +#include "sh.h" + +/* + * C Shell + */ + +doset(v) + register char **v; +{ + register char *p; + char *vp, op; + char **vecp; + bool hadsub; + int subscr; + + v++; + p = *v++; + if (p == 0) { + prvars(); + return; + } + do { + hadsub = 0; + for (vp = p; alnum(*p); p++) + continue; + if (vp == p || !letter(*vp)) + goto setsyn; + if (*p == '[') { + hadsub++; + p = getinx(p, &subscr); + } + if (op = *p) { + *p++ = 0; + if (*p == 0 && *v && **v == '(') + p = *v++; + } else if (*v && eq(*v, "=")) { + op = '=', v++; + if (*v) + p = *v++; + } + if (op && op != '=') +setsyn: + bferr("Syntax error"); + if (eq(p, "(")) { + register char **e = v; + + if (hadsub) + goto setsyn; + for (;;) { + if (!*e) + bferr("Missing )"); + if (**e == ')') + break; + e++; + } + p = *e; + *e = 0; + vecp = saveblk(v); + set1(vp, vecp, &shvhed); + *e = p; + v = e + 1; + } else if (hadsub) + asx(vp, subscr, savestr(p)); + else + set(vp, savestr(p)); + if (eq(vp, "path")) { + exportpath(adrof("path")->vec); + dohash(); + } else if (eq(vp, "histchars")) { + register char *p = value("histchars"); + + HIST = *p++; + HISTSUB = *p; + } else if (eq(vp, "user")) + setenv("USER", value(vp)); + else if (eq(vp, "term")) + setenv("TERM", value(vp)); + else if (eq(vp, "home")) + setenv("HOME", value(vp)); +#ifdef FILEC + else if (eq(vp, "filec")) + filec = 1; +#endif + } while (p = *v++); +} + +char * +getinx(cp, ip) + register char *cp; + register int *ip; +{ + + *ip = 0; + *cp++ = 0; + while (*cp && digit(*cp)) + *ip = *ip * 10 + *cp++ - '0'; + if (*cp++ != ']') + bferr("Subscript error"); + return (cp); +} + +asx(vp, subscr, p) + char *vp; + int subscr; + char *p; +{ + register struct varent *v = getvx(vp, subscr); + + xfree(v->vec[subscr - 1]); + v->vec[subscr - 1] = globone(p); +} + +struct varent * +getvx(vp, subscr) + char *vp; +{ + register struct varent *v = adrof(vp); + + if (v == 0) + udvar(vp); + if (subscr < 1 || subscr > blklen(v->vec)) + bferr("Subscript out of range"); + return (v); +} + +char plusplus[2] = { '1', 0 }; + +dolet(v) + char **v; +{ + register char *p; + char *vp, c, op; + bool hadsub; + int subscr; + + v++; + p = *v++; + if (p == 0) { + prvars(); + return; + } + do { + hadsub = 0; + for (vp = p; alnum(*p); p++) + continue; + if (vp == p || !letter(*vp)) + goto letsyn; + if (*p == '[') { + hadsub++; + p = getinx(p, &subscr); + } + if (*p == 0 && *v) + p = *v++; + if (op = *p) + *p++ = 0; + else + goto letsyn; + vp = savestr(vp); + if (op == '=') { + c = '='; + p = xset(p, &v); + } else { + c = *p++; + if (any(c, "+-")) { + if (c != op || *p) + goto letsyn; + p = plusplus; + } else { + if (any(op, "<>")) { + if (c != op) + goto letsyn; + c = *p++; +letsyn: + bferr("Syntax error"); + } + if (c != '=') + goto letsyn; + p = xset(p, &v); + } + } + if (op == '=') + if (hadsub) + asx(vp, subscr, p); + else + set(vp, p); + else + if (hadsub) +#ifndef V6 + /* avoid bug in vax CC */ + { + struct varent *gv = getvx(vp, subscr); + + asx(vp, subscr, operate(op, gv->vec[subscr - 1], p)); + } +#else + asx(vp, subscr, operate(op, getvx(vp, subscr)->vec[subscr - 1], p)); +#endif + else + set(vp, operate(op, value(vp), p)); + if (eq(vp, "path")) { + exportpath(adrof("path")->vec); + dohash(); + } + XFREE(vp) + if (c != '=') + XFREE(p) + } while (p = *v++); +} + +char * +xset(cp, vp) + char *cp, ***vp; +{ + register char *dp; + + if (*cp) { + dp = savestr(cp); + --(*vp); + xfree(**vp); + **vp = dp; + } + return (putn(exp(vp))); +} + +char * +operate(op, vp, p) + char op, *vp, *p; +{ + char opr[2]; + char *vec[5]; + register char **v = vec; + char **vecp = v; + register int i; + + if (op != '=') { + if (*vp) + *v++ = vp; + opr[0] = op; + opr[1] = 0; + *v++ = opr; + if (op == '<' || op == '>') + *v++ = opr; + } + *v++ = p; + *v++ = 0; + i = exp(&vecp); + if (*vecp) + bferr("Expression syntax"); + return (putn(i)); +} + +static char *putp; + +char * +putn(n) + register int n; +{ + static char number[15]; + + putp = number; + if (n < 0) { + n = -n; + *putp++ = '-'; + } + if (sizeof (int) == 2 && n == -32768) { + *putp++ = '3'; + n = 2768; +#ifdef pdp11 + } +#else + } else if (sizeof (int) == 4 && n == -2147483648) { + *putp++ = '2'; + n = 147483648; + } +#endif + putn1(n); + *putp = 0; + return (savestr(number)); +} + +putn1(n) + register int n; +{ + if (n > 9) + putn1(n / 10); + *putp++ = n % 10 + '0'; +} + +getn(cp) + register char *cp; +{ + register int n; + int sign; + + sign = 0; + if (cp[0] == '+' && cp[1]) + cp++; + if (*cp == '-') { + sign++; + cp++; + if (!digit(*cp)) + goto badnum; + } + n = 0; + while (digit(*cp)) + n = n * 10 + *cp++ - '0'; + if (*cp) + goto badnum; + return (sign ? -n : n); +badnum: + bferr("Badly formed number"); + return (0); +} + +char * +value1(var, head) + char *var; + struct varent *head; +{ + register struct varent *vp; + + vp = adrof1(var, head); + return (vp == 0 || vp->vec[0] == 0 ? "" : vp->vec[0]); +} + +struct varent * +madrof(pat, vp) + char *pat; + register struct varent *vp; +{ + register struct varent *vp1; + + for (; vp; vp = vp->v_right) { + if (vp->v_left && (vp1 = madrof(pat, vp->v_left))) + return vp1; + if (Gmatch(vp->v_name, pat)) + return vp; + } + return vp; +} + +struct varent * +adrof1(name, v) + register char *name; + register struct varent *v; +{ + register cmp; + + v = v->v_left; + while (v && ((cmp = *name - *v->v_name) || + (cmp = strcmp(name, v->v_name)))) + if (cmp < 0) + v = v->v_left; + else + v = v->v_right; + return v; +} + +/* + * The caller is responsible for putting value in a safe place + */ +set(var, val) + char *var, *val; +{ + register char **vec = (char **) xalloc(2 * sizeof (char **)); + + vec[0] = onlyread(val) ? savestr(val) : val; + vec[1] = 0; + set1(var, vec, &shvhed); +} + +set1(var, vec, head) + char *var, **vec; + struct varent *head; +{ + register char **oldv = vec; + + gflag = 0; tglob(oldv); + if (gflag) { + vec = glob(oldv); + if (vec == 0) { + bferr("No match"); + blkfree(oldv); + return; + } + blkfree(oldv); + gargv = 0; + } + setq(var, vec, head); +} + +setq(name, vec, p) + char *name, **vec; + register struct varent *p; +{ + register struct varent *c; + register f; + + f = 0; /* tree hangs off the header's left link */ + while (c = p->v_link[f]) { + if ((f = *name - *c->v_name) == 0 && + (f = strcmp(name, c->v_name)) == 0) { + blkfree(c->vec); + goto found; + } + p = c; + f = f > 0; + } + p->v_link[f] = c = (struct varent *)xalloc(sizeof (struct varent)); + c->v_name = savestr(name); + c->v_bal = 0; + c->v_left = c->v_right = 0; + c->v_parent = p; + balance(p, f, 0); +found: + trim(c->vec = vec); +} + +unset(v) + char *v[]; +{ + + unset1(v, &shvhed); + if (adrof("histchars") == 0) { + HIST = '!'; + HISTSUB = '^'; + } +#ifdef FILEC + if (adrof("filec") == 0) + filec = 0; +#endif +} + +unset1(v, head) + register char *v[]; + struct varent *head; +{ + register struct varent *vp; + register int cnt; + + while (*++v) { + cnt = 0; + while (vp = madrof(*v, head->v_left)) + unsetv1(vp), cnt++; + if (cnt == 0) + setname(*v); + } +} + +unsetv(var) + char *var; +{ + register struct varent *vp; + + if ((vp = adrof1(var, &shvhed)) == 0) + udvar(var); + unsetv1(vp); +} + +unsetv1(p) + register struct varent *p; +{ + register struct varent *c, *pp; + register f; + + /* + * Free associated memory first to avoid complications. + */ + blkfree(p->vec); + XFREE(p->v_name); + /* + * If p is missing one child, then we can move the other + * into where p is. Otherwise, we find the predecessor + * of p, which is guaranteed to have no right child, copy + * it into p, and move it's left child into it. + */ + if (p->v_right == 0) + c = p->v_left; + else if (p->v_left == 0) + c = p->v_right; + else { + for (c = p->v_left; c->v_right; c = c->v_right) + ; + p->v_name = c->v_name; + p->vec = c->vec; + p = c; + c = p->v_left; + } + /* + * Move c into where p is. + */ + pp = p->v_parent; + f = pp->v_right == p; + if (pp->v_link[f] = c) + c->v_parent = pp; + /* + * Free the deleted node, and rebalance. + */ + XFREE((char *)p); + balance(pp, f, 1); +} + +setNS(cp) + char *cp; +{ + + set(cp, ""); +} + +shift(v) + register char **v; +{ + register struct varent *argv; + register char *name; + + v++; + name = *v; + if (name == 0) + name = "argv"; + else + (void) strip(name); + argv = adrof(name); + if (argv == 0) + udvar(name); + if (argv->vec[0] == 0) + bferr("No more words"); + lshift(argv->vec, 1); +} + +exportpath(val) +char **val; +{ + char exppath[BUFSIZ]; + + exppath[0] = 0; + if (val) + while (*val) { + if (strlen(*val) + strlen(exppath) + 2 > BUFSIZ) { + printf("Warning: ridiculously long PATH truncated\n"); + break; + } + (void) strcat(exppath, *val++); + if (*val == 0 || eq(*val, ")")) + break; + (void) strcat(exppath, ":"); + } + setenv("PATH", exppath); +} + + /* macros to do single rotations on node p */ +#define rright(p) (\ + t = (p)->v_left,\ + (t)->v_parent = (p)->v_parent,\ + ((p)->v_left = t->v_right) ? (t->v_right->v_parent = (p)) : 0,\ + (t->v_right = (p))->v_parent = t,\ + (p) = t) +#define rleft(p) (\ + t = (p)->v_right,\ + (t)->v_parent = (p)->v_parent,\ + ((p)->v_right = t->v_left) ? (t->v_left->v_parent = (p)) : 0,\ + (t->v_left = (p))->v_parent = t,\ + (p) = t) + +/* + * Rebalance a tree, starting at p and up. + * F == 0 means we've come from p's left child. + * D == 1 means we've just done a delete, otherwise an insert. + */ +balance(p, f, d) + register struct varent *p; + register f; +{ + register struct varent *pp; + register struct varent *t; /* used by the rotate macros */ + register ff; + + /* + * Ok, from here on, p is the node we're operating on; + * pp is it's parent; f is the branch of p from which we have come; + * ff is the branch of pp which is p. + */ + for (; pp = p->v_parent; p = pp, f = ff) { + ff = pp->v_right == p; + if (f ^ d) { /* right heavy */ + switch (p->v_bal) { + case -1: /* was left heavy */ + p->v_bal = 0; + break; + case 0: /* was balanced */ + p->v_bal = 1; + break; + case 1: /* was already right heavy */ + switch (p->v_right->v_bal) { + case 1: /* sigle rotate */ + pp->v_link[ff] = rleft(p); + p->v_left->v_bal = 0; + p->v_bal = 0; + break; + case 0: /* single rotate */ + pp->v_link[ff] = rleft(p); + p->v_left->v_bal = 1; + p->v_bal = -1; + break; + case -1: /* double rotate */ + rright(p->v_right); + pp->v_link[ff] = rleft(p); + p->v_left->v_bal = + p->v_bal < 1 ? 0 : -1; + p->v_right->v_bal = + p->v_bal > -1 ? 0 : 1; + p->v_bal = 0; + break; + } + break; + } + } else { /* left heavy */ + switch (p->v_bal) { + case 1: /* was right heavy */ + p->v_bal = 0; + break; + case 0: /* was balanced */ + p->v_bal = -1; + break; + case -1: /* was already left heavy */ + switch (p->v_left->v_bal) { + case -1: /* single rotate */ + pp->v_link[ff] = rright(p); + p->v_right->v_bal = 0; + p->v_bal = 0; + break; + case 0: /* signle rotate */ + pp->v_link[ff] = rright(p); + p->v_right->v_bal = -1; + p->v_bal = 1; + break; + case 1: /* double rotate */ + rleft(p->v_left); + pp->v_link[ff] = rright(p); + p->v_left->v_bal = + p->v_bal < 1 ? 0 : -1; + p->v_right->v_bal = + p->v_bal > -1 ? 0 : 1; + p->v_bal = 0; + break; + } + break; + } + } + /* + * If from insert, then we terminate when p is balanced. + * If from delete, then we terminate when p is unbalanced. + */ + if ((p->v_bal == 0) ^ d) + break; + } +} + +plist(p) + register struct varent *p; +{ + register struct varent *c; + register len; + + if (setintr) + (void) sigsetmask(sigblock(0L) & ~ sigmask(SIGINT)); + for (;;) { + while (p->v_left) + p = p->v_left; + x: + if (p->v_parent == 0) /* is it the header? */ + return; + len = blklen(p->vec); + printf(p->v_name); + putchar('\t'); + if (len != 1) + putchar('('); + blkpr(p->vec); + if (len != 1) + putchar(')'); + putchar('\n'); + if (p->v_right) { + p = p->v_right; + continue; + } + do { + c = p; + p = p->v_parent; + } while (p->v_right == c); + goto x; + } +} diff --git a/bin/csh/sh.time.c b/bin/csh/sh.time.c new file mode 100644 index 0000000..e52d814 --- /dev/null +++ b/bin/csh/sh.time.c @@ -0,0 +1,196 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley Software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if !defined(lint) && defined(DOSCCS) +static char *sccsid = "@(#)sh.time.c 5.4.1 (2.11BSD GTE) 12/31/93"; +#endif + +#include "sh.h" + +/* + * C Shell - routines handling process timing and niceing + */ + +settimes() +{ + struct rusage ruch; + + (void) gettimeofday(&time0, (struct timezone *)0); + (void) getrusage(RUSAGE_SELF, &ru0); + (void) getrusage(RUSAGE_CHILDREN, &ruch); + ruadd(&ru0, &ruch); +} + +/* + * dotime is only called if it is truly a builtin function and not a + * prefix to another command + */ +dotime() +{ + struct timeval timedol; + struct rusage ru1, ruch; + + (void) getrusage(RUSAGE_SELF, &ru1); + (void) getrusage(RUSAGE_CHILDREN, &ruch); + ruadd(&ru1, &ruch); + (void) gettimeofday(&timedol, (struct timezone *)0); + prusage(&ru0, &ru1, &timedol, &time0); +} + +/* + * donice is only called when it on the line by itself or with a +- value + */ +donice(v) + register char **v; +{ + register char *cp; + int nval; + + v++, cp = *v++; + if (cp == 0) + nval = 4; + else if (*v == 0 && any(cp[0], "+-")) + nval = getn(cp); + (void) setpriority(PRIO_PROCESS, 0, nval); +} + +ruadd(ru, ru2) + register struct rusage *ru, *ru2; +{ + register long *lp, *lp2; + register int cnt; + + tvadd(&ru->ru_utime, &ru2->ru_utime); + tvadd(&ru->ru_stime, &ru2->ru_stime); + if (ru2->ru_maxrss > ru->ru_maxrss) + ru->ru_maxrss = ru2->ru_maxrss; + cnt = &ru->ru_last - &ru->ru_first + 1; + lp = &ru->ru_first; lp2 = &ru2->ru_first; + do + *lp++ += *lp2++; + while (--cnt > 0); +} + +prusage(r0, r1, e, b) + register struct rusage *r0, *r1; + struct timeval *e, *b; +{ + register time_t t = + (r1->ru_utime.tv_sec-r0->ru_utime.tv_sec)*100+ + (r1->ru_utime.tv_usec-r0->ru_utime.tv_usec)/10000+ + (r1->ru_stime.tv_sec-r0->ru_stime.tv_sec)*100+ + (r1->ru_stime.tv_usec-r0->ru_stime.tv_usec)/10000; + register char *cp; + register long i; + register struct varent *vp = adrof("time"); + long ms = + (e->tv_sec-b->tv_sec)*100 + (e->tv_usec-b->tv_usec)/10000; + +#ifdef pdp11 + cp = "%Uu %Ss %E %P %I+%Oio %Vov %Wsw"; +#else + cp = "%Uu %Ss %E %P %X+%Dk %I+%Oio %Fpf+%Ww"; +#endif + if (vp && vp->vec[0] && vp->vec[1]) + cp = vp->vec[1]; + for (; *cp; cp++) + if (*cp != '%') + putchar(*cp); + else if (cp[1]) switch(*++cp) { + + case 'U': + pdeltat(&r1->ru_utime, &r0->ru_utime); + break; + + case 'S': + pdeltat(&r1->ru_stime, &r0->ru_stime); + break; + + case 'E': + psecs(ms / 100); + break; + + case 'P': + printf("%d%%", (int) (t*100 / ((ms ? ms : 1)))); + break; + +#ifdef pdp11 + case 'V': + printf("%ld", r1->ru_ovly - r0->ru_ovly); + break; +#endif + + case 'W': + i = r1->ru_nswap - r0->ru_nswap; + printf("%ld", i); + break; + + case 'X': + printf("%ld", t == 0 ? 0L : (r1->ru_ixrss-r0->ru_ixrss)/t); + break; + + case 'D': + printf("%ld", t == 0 ? 0L : + (r1->ru_idrss+r1->ru_isrss-(r0->ru_idrss+r0->ru_isrss))/t); + break; + + case 'K': + printf("%ld", t == 0 ? 0L : + ((r1->ru_ixrss+r1->ru_isrss+r1->ru_idrss) - + (r0->ru_ixrss+r0->ru_idrss+r0->ru_isrss))/t); + break; + + case 'M': + printf("%ld", r1->ru_maxrss/2); + break; + + case 'F': + printf("%ld", r1->ru_majflt-r0->ru_majflt); + break; + + case 'R': + printf("%ld", r1->ru_minflt-r0->ru_minflt); + break; + + case 'I': + printf("%ld", r1->ru_inblock-r0->ru_inblock); + break; + + case 'O': + printf("%ld", r1->ru_oublock-r0->ru_oublock); + break; + } + putchar('\n'); +} + +pdeltat(t1, t0) + struct timeval *t1, *t0; +{ + struct timeval td; + + tvsub(&td, t1, t0); + printf("%ld.%01ld", td.tv_sec, td.tv_usec/100000); +} + +tvadd(tsum, t0) + struct timeval *tsum, *t0; +{ + + tsum->tv_sec += t0->tv_sec; + tsum->tv_usec += t0->tv_usec; + if (tsum->tv_usec > 1000000) + tsum->tv_sec++, tsum->tv_usec -= 1000000; +} + +tvsub(tdiff, t1, t0) + struct timeval *tdiff, *t1, *t0; +{ + + tdiff->tv_sec = t1->tv_sec - t0->tv_sec; + tdiff->tv_usec = t1->tv_usec - t0->tv_usec; + if (tdiff->tv_usec < 0) + tdiff->tv_sec--, tdiff->tv_usec += 1000000; +} diff --git a/bin/csh/tags b/bin/csh/tags new file mode 100644 index 0000000..8e3f872 --- /dev/null +++ b/bin/csh/tags @@ -0,0 +1,349 @@ +COMMAND sh.file.c 31 +Dfix sh.dol.c /^Dfix(t)$/ +Dfix1 sh.dol.c /^Dfix1(cp)$/ +Dfix2 sh.dol.c /^Dfix2(v)$/ +DgetC sh.dol.c /^DgetC(flag)$/ +Dgetdol sh.dol.c /^Dgetdol()$/ +Dredc sh.dol.c /^Dredc()$/ +Dtestq sh.dol.c /^Dtestq(c)$/ +Dword sh.dol.c /^Dword()$/ +FREE_ITEMS sh.file.c /^#define FREE_ITEMS(items) { \\$/ +Gcat sh.glob.c /^Gcat(s1, s2)$/ +Gmatch sh.glob.c /^Gmatch(s, p)$/ +Msh sh.c /^main(c, av)$/ +Perror sh.err.c /^Perror(s)$/ +XFREE sh.h /^#define XFREE(cp) { \\$/ +acollect sh.glob.c /^acollect(as)$/ +addla sh.lex.c /^addla(cp)$/ +addpath sh.glob.c /^addpath(c)$/ +adrof sh.h /^#define adrof(v) adrof1(v, &shvhed)$/ +adrof1 sh.set.c /^adrof1(name, v)$/ +alias sh.parse.c /^alias(lex)$/ +alnum sh.char.h /^#define alnum(c) (digit(c) || letter(c))$/ +amatch sh.glob.c /^amatch(s, p)$/ +any sh.misc.c /^any(c, s)$/ +asx sh.set.c /^asx(vp, subscr, p)$/ +asyn0 sh.parse.c /^asyn0(p1, p2)$/ +asyn3 sh.parse.c /^asyn3(p1, p2)$/ +asyntax sh.parse.c /^asyntax(p1, p2)$/ +back_to_col_1 sh.file.c /^back_to_col_1()$/ +backeval sh.glob.c /^backeval(cp, literal)$/ +balance sh.set.c /^balance(p, f, d)$/ +beep sh.file.c /^beep()$/ +bferr sh.err.c /^bferr(cp)$/ +bfree sh.lex.c /^bfree()$/ +bgetc sh.lex.c /^bgetc()$/ +bis sh.exec.h /^#define bis(h, b) ((h)[(b) >> 3] |= 1 << ((b) & 7)/ +bit sh.exec.h /^#define bit(h, b) ((h)[(b) >> 3] & 1 << ((b) & 7))/ +blkcat sh.misc.c /^blkcat(up, vp)$/ +blkcpy sh.misc.c /^blkcpy(oav, bv)$/ +blkend sh.misc.c /^blkend(up)$/ +blkfree sh.misc.c /^blkfree(av0)$/ +blklen sh.misc.c /^blklen(av)$/ +blkpr sh.misc.c /^blkpr(av)$/ +blkspl sh.misc.c /^blkspl(up, vp)$/ +bool sh.h 29 +bseek sh.lex.c /^bseek(l)$/ +btell sh.h /^#define btell() fseekp$/ +btoeof sh.lex.c /^btoeof()$/ +calloc sh.misc.c /^calloc(i, j)$/ +catn sh.file.c /^catn(des, src, count)$/ +chkclob sh.sem.c /^chkclob(cp)$/ +closem sh.misc.c /^closem()$/ +cmap sh.char.h /^#define cmap(c, bits) (_cmap[(unsigned char)(c)] &/ +collect sh.glob.c /^collect(as)$/ +copy sh.local.h /^#define copy(to, from, size) bcopy(from, to, size)/ +copyblk sh.misc.c /^copyblk(v)$/ +copylex sh.lex.c /^copylex(hp, fp)$/ +copyn sh.file.c /^copyn(des, src, count)$/ +dcanon sh.dir.c /^dcanon(cp, p)$/ +dcopy sh.misc.c /^dcopy(i, j)$/ +dfind sh.dir.c /^dfind(cp)$/ +dfollow sh.dir.c /^dfollow(cp)$/ +dfree sh.dir.c /^dfree(dp)$/ +digit sh.char.h /^#define digit(c) cmap(c, _DIG)$/ +dinit sh.dir.c /^dinit(hp)$/ +dmove sh.misc.c /^dmove(i, j)$/ +dnewcwd sh.dir.c /^dnewcwd(dp)$/ +doagain sh.func.c /^doagain()$/ +doalias sh.func.c /^doalias(v)$/ +dobackp sh.glob.c /^dobackp(cp, literal)$/ +dobg sh.proc.c /^dobg(v)$/ +dobg1 sh.proc.c /^dobg1(v)$/ +dobreak sh.func.c /^dobreak()$/ +dochngd sh.dir.c /^dochngd(v)$/ +docontin sh.func.c /^docontin()$/ +dodirs sh.dir.c /^dodirs(v)$/ +doecho sh.func.c /^doecho(v)$/ +doelse sh.func.c /^doelse()$/ +doend sh.func.c /^doend()$/ +doeval sh.func.c /^doeval(v)$/ +doexec sh.exec.c /^doexec(t)$/ +doexit sh.func.c /^doexit(v)$/ +dofg sh.proc.c /^dofg(v)$/ +dofg1 sh.proc.c /^dofg1(v)$/ +doforeach sh.func.c /^doforeach(v)$/ +doglob sh.func.c /^doglob(v)$/ +dogoto sh.func.c /^dogoto(v)$/ +dohash sh.exec.c /^dohash()$/ +dohist sh.hist.c /^dohist(vp)$/ +dohist1 sh.hist.c /^dohist1(hp, np, rflg, hflg)$/ +doif sh.func.c /^doif(v, kp)$/ +doio sh.sem.c /^doio(t, pipein, pipeout)$/ +dojobs sh.proc.c /^dojobs(v)$/ +dokill sh.proc.c /^dokill(v)$/ +dolabel sh.func.c /^dolabel()$/ +dolet sh.set.c /^dolet(v)$/ +dolimit sh.func.c /^dolimit(v)$/ +dologin sh.func.c /^dologin(v)$/ +dologout sh.func.c /^dologout()$/ +domod sh.lex.c /^domod(cp, type)$/ +done sh.c /^done(i)$/ +donefds sh.misc.c /^donefds()$/ +donewgrp sh.func.c /^donewgrp(v)$/ +donice sh.time.c /^donice(v)$/ +donohup sh.func.c /^donohup()$/ +donotify sh.proc.c /^donotify(v)$/ +doonintr sh.func.c /^doonintr(v)$/ +dopopd sh.dir.c /^dopopd(v)$/ +dopushd sh.dir.c /^dopushd(v)$/ +dorepeat sh.func.c /^dorepeat(v, kp)$/ +doset sh.set.c /^doset(v)$/ +dosetenv sh.func.c /^dosetenv(v)$/ +dosource sh.c /^dosource(t)$/ +dostop sh.proc.c /^dostop(v)$/ +dosub sh.lex.c /^dosub(sc, en, global)$/ +dosuspend sh.func.c /^dosuspend()$/ +doswbrk sh.func.c /^doswbrk()$/ +doswitch sh.func.c /^doswitch(v)$/ +dotime sh.time.c /^dotime()$/ +doumask sh.func.c /^doumask(v)$/ +dounhash sh.exec.c /^dounhash()$/ +dounlimit sh.func.c /^dounlimit(v)$/ +dounsetenv sh.func.c /^dounsetenv(v)$/ +dowait sh.proc.c /^dowait()$/ +dowhich sh.exec2.c /^dowhich(v, c)$/ +dowhile sh.func.c /^dowhile(v)$/ +dozip sh.func.c /^dozip()$/ +draino sh.print.c /^draino()$/ +dtildepr sh.dir.c /^dtildepr(home, dir)$/ +echo sh.func.c /^echo(sep, v)$/ +egetn sh.exp.c /^egetn(cp)$/ +enthist sh.hist.c /^enthist(event, lp, docopy)$/ +eq sh.h /^#define eq(a, b) (strcmp(a, b) == 0)$/ +error sh.err.c /^error(s, arg)$/ +etracc sh.exp.c /^etracc(str, cp, vp)$/ +etraci sh.exp.c /^etraci(str, i, vp)$/ +evalav sh.exp.c /^evalav(v)$/ +execash sh.exec.c /^execash(t, kp)$/ +execbrc sh.glob.c /^execbrc(p, s)$/ +executable sh.exec2.c /^executable(dir, name, dir_ok)$/ +execute sh.sem.c /^execute(t, wanttty, pipein, pipeout)$/ +exit sh.local.h /^#define exit(n) done(n)$/ +exitstat sh.c /^exitstat()$/ +exp sh.exp.c /^exp(vp)$/ +exp0 sh.exp.c /^exp0(vp, ignore)$/ +exp1 sh.exp.c /^exp1(vp, ignore)$/ +exp2 sh.exp.c /^exp2(vp, ignore)$/ +exp2a sh.exp.c /^exp2a(vp, ignore)$/ +exp2b sh.exp.c /^exp2b(vp, ignore)$/ +exp2c sh.exp.c /^exp2c(vp, ignore)$/ +exp3 sh.exp.c /^exp3(vp, ignore)$/ +exp3a sh.exp.c /^exp3a(vp, ignore)$/ +exp4 sh.exp.c /^exp4(vp, ignore)$/ +exp5 sh.exp.c /^exp5(vp, ignore)$/ +exp6 sh.exp.c /^exp6(vp, ignore)$/ +expand sh.glob.c /^expand(as)$/ +exportpath sh.set.c /^exportpath(val)$/ +extract_dir_and_name sh.file.c /^extract_dir_and_name(path, dir, name)$/ +filetype sh.file.c /^filetype(dir, file)$/ +findev sh.lex.c /^findev(cp, anyarg)$/ +findlim sh.func.c /^findlim(cp)$/ +flush sh.print.c /^flush()$/ +free_items sh.file.c /^free_items(items)$/ +freelex sh.lex.c /^freelex(vp)$/ +freenod sh.parse.c /^freenod(p1, p2)$/ +freesyn sh.parse.c /^freesyn(t)$/ +func sh.func.c /^func(t, bp)$/ +getC sh.lex.c /^#define getC(f) ((getCtmp = peekc) ? (peekc = 0, / +getC1 sh.lex.c /^getC1(flag)$/ +getdol sh.lex.c /^getdol()$/ +getentry sh.file.c /^getentry(dir_fd, looking_for_lognames)$/ +getexcl sh.lex.c /^getexcl(sc)$/ +getexit sh.h /^#define getexit(a) copy((char *)(a), (char *)resla/ +gethdir sh.c /^gethdir(home)$/ +gethent sh.lex.c /^gethent(sc)$/ +getinx sh.set.c /^getinx(cp, ip)$/ +getn sh.set.c /^getn(cp)$/ +getsel sh.lex.c /^getsel(al, ar, dol)$/ +getsub sh.lex.c /^getsub(en)$/ +getval sh.func.c /^getval(lp, v)$/ +getvx sh.set.c /^getvx(vp, subscr)$/ +getword sh.func.c /^getword(wp)$/ +ginit sh.glob.c /^ginit(agargv)$/ +glob sh.glob.c /^glob(v)$/ +globone sh.glob.c /^globone(str)$/ +goodbye sh.c /^goodbye()$/ +hash sh.exec.h /^#define hash(a, b) ((a) * HSHMUL + (b) & HSHMASK)$/ +hashname sh.exec.c /^hashname(cp)$/ +hashstat sh.exec.c /^hashstat()$/ +heredoc sh.dol.c /^heredoc(term)$/ +hfree sh.hist.c /^hfree(hp)$/ +if sh.set.c /^ } else if (sizeof (int) == 4 && n == -2147483648)/ +ignored sh.file.c /^ignored(entry)$/ +importpath sh.c /^importpath(cp)$/ +initdesc sh.c /^initdesc()$/ +is_prefix sh.file.c /^is_prefix(check, template)$/ +is_suffix sh.file.c /^is_suffix(check, template)$/ +isa sh.exp.c /^isa(cp, what)$/ +isbfunc sh.func.c /^isbfunc(t)$/ +iscommand sh.exec2.c /^iscommand(name)$/ +isglob sh.char.h /^#define isglob(c) cmap(c, _GLOB)$/ +islogin sh.func.c /^islogin()$/ +ismeta sh.char.h /^#define ismeta(c) cmap(c, _META)$/ +isspace sh.char.h /^#define isspace(c) cmap(c, _SP)$/ +isspnl sh.char.h /^#define isspnl(c) cmap(c, _SP|_NL)$/ +lastchr sh.misc.c /^lastchr(cp)$/ +letter sh.char.h /^#define letter(c) cmap(c, _LET)$/ +lex sh.lex.c /^lex(hp)$/ +limtail sh.func.c /^limtail(cp, str0)$/ +lshift sh.misc.c /^lshift(v, c)$/ +madrof sh.set.c /^madrof(pat, vp)$/ +mailchk sh.c /^mailchk()$/ +match sh.glob.c /^match(s, p)$/ +matchdir sh.glob.c /^matchdir(pattern)$/ +matchs sh.lex.c /^matchs(str, pat)$/ +mypipe sh.sem.c /^mypipe(pv)$/ +noev sh.lex.c /^noev(cp)$/ +nomem sh.misc.c /^nomem(i)$/ +number sh.misc.c /^number(cp)$/ +okpcntl sh.proc.c /^okpcntl()$/ +onlyread sh.misc.c /^onlyread(cp)$/ +operate sh.set.c /^operate(op, vp, p)$/ +p2dig sh.print.c /^p2dig(i)$/ +padd sh.proc.c /^padd(t)$/ +pads sh.proc.c /^pads(cp)$/ +palloc sh.proc.c /^palloc(pid, t)$/ +panystop sh.proc.c /^panystop(neednl)$/ +pchild sh.proc.c /^pchild()$/ +pclrcurr sh.proc.c /^pclrcurr(pp)$/ +pdeltat sh.time.c /^pdeltat(t1, t0)$/ +pendjob sh.proc.c /^pendjob()$/ +pexerr sh.exec.c /^pexerr()$/ +pfind sh.proc.c /^pfind(cp)$/ +pflush sh.proc.c /^pflush(pp)$/ +pflushall sh.proc.c /^pflushall()$/ +pfork sh.proc.c /^pfork(t, wanttty)$/ +pgetcurr sh.proc.c /^pgetcurr(pp)$/ +phist sh.hist.c /^phist(hp, hflg)$/ +phup sh.c /^phup()$/ +pintr sh.c /^pintr()$/ +pintr1 sh.c /^pintr1(wantnl)$/ +pjwait sh.proc.c /^pjwait(pp)$/ +pkill sh.proc.c /^pkill(v, signum)$/ +plim sh.func.c /^plim(lp, hard)$/ +plist sh.set.c /^plist(p)$/ +pnote sh.proc.c /^pnote()$/ +pprint sh.proc.c /^pprint(pp, flag)$/ +prefix sh.misc.c /^prefix(sub, str)$/ +preread sh.func.c /^preread()$/ +prestjob sh.proc.c /^prestjob()$/ +print_by_column sh.file.c /^print_by_column(dir, items, count)$/ +print_recognized_stuff sh.file.c /^print_recognized_stuff(recognized_part)$/ +printprompt sh.c /^printprompt()$/ +prlex sh.lex.c /^prlex(sp0)$/ +process sh.c /^process(catch)$/ +prusage sh.time.c /^prusage(r0, r1, e, b)$/ +prvars sh.func.c /^prvars()$/ +psave sh.glob.c /^psave(c)$/ +psavejob sh.proc.c /^psavejob()$/ +psecs sh.print.c /^psecs(l)$/ +pstart sh.proc.c /^pstart(pp, foregnd)$/ +ptprint sh.proc.c /^ptprint(tp)$/ +pushback sh.file.c /^pushback(string)$/ +putchar sh.print.c /^putchar(c)$/ +putn sh.set.c /^putn(n)$/ +putn1 sh.set.c /^putn1(n)$/ +pwait sh.proc.c /^pwait()$/ +pword sh.glob.c /^pword()$/ +readc sh.lex.c /^readc(wanteof)$/ +rechist sh.c /^rechist()$/ +recognize sh.file.c /^recognize(extended_name, entry, name_length, numit/ +reexecute sh.func.c /^reexecute(kp)$/ +renum sh.misc.c /^renum(i, j)$/ +reset sh.h /^#define reset() longjmp(reslab, 0)$/ +resexit sh.h /^#define resexit(a) copy((char *)reslab, ((char *)(/ +return sh.set.c /^ return (savestr(number));$/ +retype sh.file.c /^retype()$/ +rleft sh.set.c /^#define rleft(p) (\\$/ +rright sh.set.c /^#define rright(p) (\\$/ +rscan sh.glob.c /^rscan(t, f)$/ +ruadd sh.time.c /^ruadd(ru, ru2)$/ +saveblk sh.misc.c /^saveblk(v)$/ +savehist sh.hist.c /^savehist(sp)$/ +savestr sh.misc.c /^savestr(s)$/ +search sh.file.c /^search(word, command, max_word_length)$/ +set sh.set.c /^set(var, val)$/ +set1 sh.set.c /^set1(var, vec, head)$/ +setDolp sh.dol.c /^setDolp(cp)$/ +setNS sh.set.c /^setNS(cp)$/ +setenv sh.func.c /^setenv(name, val)$/ +seterr sh.err.c /^seterr(s)$/ +seterr2 sh.err.c /^seterr2(cp, dp)$/ +seterrc sh.err.c /^seterrc(cp, d)$/ +setexclp sh.lex.c /^setexclp(cp)$/ +setexit sh.h /^#define setexit() ((void) setjmp(reslab))$/ +setlim sh.func.c /^setlim(lp, hard, limit)$/ +setname sh.h /^#define setname(a) (bname = (a))$/ +setq sh.set.c /^setq(name, vec, p)$/ +settell sh.lex.c /^settell()$/ +settimes sh.time.c /^settimes()$/ +setup_tty sh.file.c /^setup_tty(on)$/ +shift sh.set.c /^shift(v)$/ +sort sh.glob.c /^#define sort() qsort((char *)sortbas, &gargv[gargc/ +sortscmp sh.glob.c /^sortscmp(a1, a2)$/ +srccat sh.c /^srccat(cp, dp)$/ +srchx sh.func.c /^srchx(cp)$/ +srcunit sh.c /^srcunit(unit, onlyown, hflg)$/ +strend sh.misc.c /^strend(cp)$/ +strip sh.misc.c /^strip(cp)$/ +strspl sh.misc.c /^strspl(cp, dp)$/ +subword sh.lex.c /^subword(cp, type, adid)$/ +syn0 sh.parse.c /^syn0(p1, p2, flags)$/ +syn1 sh.parse.c /^syn1(p1, p2, flags)$/ +syn1a sh.parse.c /^syn1a(p1, p2, flags)$/ +syn1b sh.parse.c /^syn1b(p1, p2, flags)$/ +syn2 sh.parse.c /^syn2(p1, p2, flags)$/ +syn3 sh.parse.c /^syn3(p1, p2, flags)$/ +syntax sh.parse.c /^syntax(p1, p2, flags)$/ +tellmewhat sh.exec2.c /^tellmewhat(lex)$/ +tenex sh.file.c /^tenex(inputline, inputline_size)$/ +texec sh.exec.c /^texec(f, t)$/ +tglob sh.glob.c /^tglob(t)$/ +tilde sh.file.c /^tilde(new, old)$/ +toend sh.func.c /^toend()$/ +trim sh.glob.c /^trim(t)$/ +tvadd sh.time.c /^tvadd(tsum, t0)$/ +tvsub sh.time.c /^tvsub(tdiff, t1, t0)$/ +udvar sh.misc.c /^udvar(name)$/ +unDgetC sh.dol.c /^#define unDgetC(c) Dpeekc = c$/ +unDredc sh.dol.c /^unDredc(c)$/ +unalias sh.func.c /^unalias(v)$/ +ungetC sh.lex.c /^#define ungetC(c) peekc = c$/ +ungetD sh.lex.c /^#define ungetD(c) peekd = c$/ +unreadc sh.lex.c /^unreadc(c)$/ +unset sh.set.c /^unset(v)$/ +unset1 sh.set.c /^unset1(v, head)$/ +unsetenv sh.func.c /^unsetenv(name)$/ +unsetv sh.set.c /^unsetv(var)$/ +unsetv1 sh.set.c /^unsetv1(p)$/ +untty sh.c /^untty()$/ +value sh.h /^#define value(v) value1(v, &shvhed)$/ +value1 sh.set.c /^value1(var, head)$/ +vffree sh.sem.c /^vffree()$/ +wfree sh.func.c /^wfree()$/ +word sh.lex.c /^word()$/ +xalloc sh.h /^#define xalloc(i) ((alloctmp = malloc(i)) ? alloct/ +xechoit sh.exec.c /^xechoit(t)$/ +xfree sh.misc.c /^xfree(cp)$/ +xset sh.set.c /^xset(cp, vp)$/ diff --git a/bin/date.c b/bin/date.c new file mode 100644 index 0000000..c73c985 --- /dev/null +++ b/bin/date.c @@ -0,0 +1,366 @@ +/* + * Copyright (c) 1985 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if !defined(LINT) && defined(DOSCCS) +char copyright[] = +"@(#) Copyright (c) 1985 Regents of the University of California.\n\ + All rights reserved.\n"; + +static char sccsid[] = "@(#)date.c 4.20.1 (2.11BSD) 96/7/10"; +#endif + +/* + * Date - print and set date + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define WTMP "/usr/adm/wtmp" +#define ATOI2(ar) (ar[0] - '0') * 10 + (ar[1] - '0'); ar += 2; + +static struct timeval tv; +static int retval; + +static int dmsize[] = + { -1, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; + +static struct utmp wtmp[2] = { + { "|", "", "", 0 }, + { "{", "", "", 0 } +}; + +main(argc,argv) + int argc; + char **argv; +{ + static char usage[] = "usage: date [-nu] [-d dst] [-t timezone] [yymmddhhmm[.ss]]\n"; + struct timezone tz; + char *ap, /* time string */ + *tzn; /* time zone */ + int ch, /* getopts char */ + uflag, /* do it in GMT */ + nflag, /* only set time locally */ + wf; /* wtmp file descriptor */ + char *username; + + nflag = uflag = 0; + tz.tz_dsttime = tz.tz_minuteswest = 0; + while ((ch = getopt(argc,argv,"d:nut:")) != EOF) + switch((char)ch) { + case 'd': + tz.tz_dsttime = atoi(optarg) ? 1 : 0; + break; + case 'n': + nflag = 1; + break; + case 't': + tz.tz_minuteswest = atoi(optarg); + break; + case 'u': + uflag = 1; + break; + default: + fputs(usage,stderr); + exit(1); + } + argc -= optind; + argv += optind; + + if (argc > 1) { + fputs(usage,stderr); + exit(1); + } + + if ((tz.tz_minuteswest || tz.tz_dsttime) && + settimeofday((struct timeval *)NULL,&tz)) { + perror("settimeofday"); + retval = 1; + goto display; + } + + if (gettimeofday(&tv,&tz)) { + perror("gettimeofday"); + exit(1); + } + + if (!argc) + goto display; + + wtmp[0].ut_time = tv.tv_sec; + if (gtime(*argv)) { + fputs(usage,stderr); + retval = 1; + goto display; + } + + if (!uflag) { /* convert to GMT assuming local time */ + tv.tv_sec += (long)tz.tz_minuteswest * SECS_PER_MIN; + /* now fix up local daylight time */ + if (localtime((time_t *)&tv.tv_sec)->tm_isdst) + tv.tv_sec -= SECS_PER_HOUR; + } + if (nflag || !netsettime(tv)) { + if (settimeofday(&tv,(struct timezone *)0)) { + perror("settimeofday"); + retval = 1; + goto display; + } + if ((wf = open(WTMP,O_WRONLY|O_APPEND)) < 0) + fputs("date: can't write wtmp file.\n",stderr); + else { + (void)time((time_t *)&wtmp[1].ut_time); + /*NOSTRICT*/ + (void)write(wf,(char *)wtmp,sizeof(wtmp)); + (void)close(wf); + } + } + + username = getlogin(); + if (!username || *username == '\0') /* single-user or no tty */ + username = "root"; + syslog(LOG_AUTH | LOG_NOTICE,"date set by %s",username); + +display: + if (gettimeofday(&tv,(struct timezone *)0)) { + perror("gettimeofday"); + exit(1); + } + if (uflag) { + ap = asctime(gmtime((time_t *)&tv.tv_sec)); + tzn = "GMT"; + } + else { + struct tm *tp; + + tp = localtime((time_t *)&tv.tv_sec); + ap = asctime(tp); + tzn = tp->tm_zone; + } + printf("%.20s%s%s",ap,tzn,ap + 19); + exit(retval); +} + +/* + * gtime -- + * convert user's time into number of seconds + */ +static +gtime(ap) + register char *ap; /* user argument */ +{ + register int year, month; + register char *C; /* pointer into time argument */ + struct tm *L; + int day, hour, mins, secs; + + for (secs = 0, C = ap;*C;++C) { + if (*C == '.') { /* seconds provided */ + if (strlen(C) != 3) + return(1); + *C = NULL; + secs = (C[1] - '0') * 10 + (C[2] - '0'); + break; + } + if (!isdigit(*C)) + return(-1); + } + + L = localtime((time_t *)&tv.tv_sec); + year = L->tm_year; /* defaults */ + month = L->tm_mon + 1; + day = L->tm_mday; + + switch ((int)(C - ap)) { /* length */ + case 10: /* yymmddhhmm */ + year = ATOI2(ap); + case 8: /* mmddhhmm */ + month = ATOI2(ap); + case 6: /* ddhhmm */ + day = ATOI2(ap); + case 4: /* hhmm */ + hour = ATOI2(ap); + mins = ATOI2(ap); + break; + default: + return(1); + } + + if (*ap || month < 1 || month > 12 || day < 1 || day > 31 || + mins < 0 || mins > 59 || secs < 0 || secs > 59) + return(1); + if (hour == 24) { + ++day; + hour = 0; + } + else if (hour < 0 || hour > 23) + return(1); + + tv.tv_sec = 0; + year += TM_YEAR_BASE; +/* If year < EPOCH_YEAR, assume it's in the next century and + the system has not yet been patched to move TM_YEAR_BASE up yet */ + if (year < EPOCH_YEAR) + year += 100; + if (isleap(year) && month > 2) + ++tv.tv_sec; + for (--year;year >= EPOCH_YEAR;--year) + tv.tv_sec += isleap(year) ? DAYS_PER_LYEAR : DAYS_PER_NYEAR; + while (--month) + tv.tv_sec += dmsize[month]; + tv.tv_sec += day - 1; + tv.tv_sec = HOURS_PER_DAY * tv.tv_sec + hour; + tv.tv_sec = MINS_PER_HOUR * tv.tv_sec + mins; + tv.tv_sec = SECS_PER_MIN * tv.tv_sec + secs; + return(0); +} + +#include +#include +#include +#define TSPTYPES +#include + +#define WAITACK 2 /* seconds */ +#define WAITDATEACK 5 /* seconds */ + +/* + * Set the date in the machines controlled by timedaemons + * by communicating the new date to the local timedaemon. + * If the timedaemon is in the master state, it performs the + * correction on all slaves. If it is in the slave state, it + * notifies the master that a correction is needed. + * Returns 1 on success, 0 on failure. + */ +static +netsettime(ntv) + struct timeval ntv; +{ + int s, length, port, timed_ack, found, err; + long waittime; + fd_set ready; + char hostname[MAXHOSTNAMELEN]; + struct timeval tout; + struct servent *sp; + struct tsp msg; + struct sockaddr_in sin, dest, from; + + sp = getservbyname("timed", "udp"); + if (sp == 0) { + fputs("udp/timed: unknown service\n",stderr); + retval = 2; + return (0); + } + dest.sin_port = sp->s_port; + dest.sin_family = AF_INET; + dest.sin_addr.s_addr = htonl((u_long)INADDR_ANY); + s = socket(AF_INET, SOCK_DGRAM, 0); + if (s < 0) { + if (errno == EPROTONOSUPPORT) + return(0); + perror("date: socket"); + goto bad; + } + bzero((char *)&sin, sizeof (sin)); + sin.sin_family = AF_INET; + for (port = IPPORT_RESERVED - 1; port > IPPORT_RESERVED / 2; port--) { + sin.sin_port = htons((u_short)port); + if (bind(s, (struct sockaddr *)&sin, sizeof (sin)) >= 0) + break; + if (errno != EADDRINUSE) { + if (errno != EADDRNOTAVAIL) + perror("date: bind"); + goto bad; + } + } + if (port == IPPORT_RESERVED / 2) { + fputs("date: All ports in use\n",stderr); + goto bad; + } + msg.tsp_type = TSP_SETDATE; + msg.tsp_vers = TSPVERSION; + if (gethostname(hostname, sizeof (hostname))) { + perror("gethostname"); + goto bad; + } + (void) strncpy(msg.tsp_name, hostname, sizeof (hostname)); + msg.tsp_seq = htons((u_short)0); + msg.tsp_time.tv_sec = htonl((u_long)ntv.tv_sec); + msg.tsp_time.tv_usec = htonl((u_long)ntv.tv_usec); + length = sizeof (struct sockaddr_in); + if (connect(s, &dest, length) < 0) { + perror("date: connect"); + goto bad; + } + if (send(s, (char *)&msg, sizeof (struct tsp), 0) < 0) { + if (errno != ECONNREFUSED) + perror("date: send"); + goto bad; + } + timed_ack = -1; + waittime = WAITACK; +loop: + tout.tv_sec = waittime; + tout.tv_usec = 0; + FD_ZERO(&ready); + FD_SET(s, &ready); + found = select(FD_SETSIZE, &ready, (fd_set *)0, (fd_set *)0, &tout); + length = sizeof(err); + if (getsockopt(s, SOL_SOCKET, SO_ERROR, (char *)&err, &length) == 0 + && err) { + errno = err; + if (errno != ECONNREFUSED) + perror("date: send (delayed error)"); + goto bad; + } + if (found > 0 && FD_ISSET(s, &ready)) { + length = sizeof (struct sockaddr_in); + if (recvfrom(s, (char *)&msg, sizeof (struct tsp), 0, &from, + &length) < 0) { + if (errno != ECONNREFUSED) + perror("date: recvfrom"); + goto bad; + } + msg.tsp_seq = ntohs(msg.tsp_seq); + msg.tsp_time.tv_sec = ntohl(msg.tsp_time.tv_sec); + msg.tsp_time.tv_usec = ntohl(msg.tsp_time.tv_usec); + switch (msg.tsp_type) { + + case TSP_ACK: + timed_ack = TSP_ACK; + waittime = WAITDATEACK; + goto loop; + + case TSP_DATEACK: + (void)close(s); + return (1); + + default: + fprintf(stderr, + "date: Wrong ack received from timed: %s\n", + tsptype[msg.tsp_type]); + timed_ack = -1; + break; + } + } + if (timed_ack == -1) + fputs("date: Can't reach time daemon, time set locally.\n", + stderr); +bad: + (void)close(s); + retval = 2; + return (0); +} diff --git a/bin/dd.c b/bin/dd.c new file mode 100644 index 0000000..5990b74 --- /dev/null +++ b/bin/dd.c @@ -0,0 +1,610 @@ +#ifndef lint +static char *sccsid = "@(#)dd.c 4.4 (Berkeley) 1/22/85"; +#endif + +#include +#include + +#define BIG 2147483647 +#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(), block(), unblock(); + int a; + + conv = null; + for(c=1; cibuf;) + *--ip = 0; + ibc = read(ibf, ibuf, ibs); + } + if(ibc == -1) { + perror("read"); + if((cflag&NERR) == 0) { + flsh(); + term(1); + } + ibc = 0; + for(c=0; c> 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(1); + } + 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; + } +} + +unblock(cc) +{ + register c; + + c = 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); +} + +block(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 &= 0377; + if(cbs == 0) { + null(c); + return; + } + if(cc == '\n') { + while(cbc < cbs) { + null(' '); + cbc++; + } + cbc = 0; + return; + } + if(cbc == cbs) + ntrunc++; + cbc++; + if(cbc <= cbs) + null(c); +} + +term(status) +int status; +{ + + stats(); + exit(status); +} + +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/bin/df.c b/bin/df.c new file mode 100644 index 0000000..9cbf730 --- /dev/null +++ b/bin/df.c @@ -0,0 +1,293 @@ +/* + * Copyright (c) 1980, 1990, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if !defined(lint) && defined(DOSCCS) +static char copyright[] = +"@(#) Copyright (c) 1980, 1990, 1993, 1994\n\ + The Regents of the University of California. All rights reserved.\n"; + +static char sccsid[] = "@(#)df.c 8.7.2 (2.11BSD) 1996/1/18"; +#endif + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +int bread(); +char *getmntpt(); +void prtstat(); +void ufs_df(); +void usage(); + +int iflag; + +int +main(argc, argv) + int argc; + register char *argv[]; +{ + struct stat stbuf; + struct statfs statfsbuf, *mntbuf; + int mntsize; + int ch, err, i, maxwidth, width; + char *mntpt; + + while ((ch = getopt(argc, argv, "i")) != EOF) + switch (ch) { + case 'i': + iflag = 1; + break; + case '?': + default: + usage(); + } + argc -= optind; + argv += optind; + + mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); + maxwidth = 0; + for (i = 0; i < mntsize; i++) { + width = strlen(mntbuf[i].f_mntfromname); + if (width > maxwidth) + maxwidth = width; + } + + if (!*argv) { + for (i = 0; i < mntsize; i++) + prtstat(&mntbuf[i], maxwidth); + exit(0); + } + + for (; *argv; argv++) { + if (stat(*argv, &stbuf) < 0) { + err = errno; + if ((mntpt = getmntpt(*argv)) == 0) { + warn("%s", *argv); + continue; + } + } else if ((stbuf.st_mode & S_IFMT) == S_IFCHR) { + ufs_df(*argv, maxwidth); + continue; + } else if ((stbuf.st_mode & S_IFMT) == S_IFBLK) { + if ((mntpt = getmntpt(*argv)) == 0) { + ufs_df(*argv, maxwidth); + continue; + } + } else + mntpt = *argv; + /* + * Statfs does not take a `wait' flag, so we cannot + * implement nflag here. + */ + if (statfs(mntpt, &statfsbuf) < 0) { + warn("%s", mntpt); + continue; + } + if (argc == 1) + maxwidth = strlen(statfsbuf.f_mntfromname) + 1; + prtstat(&statfsbuf, maxwidth); + } + return (0); +} + +char * +getmntpt(name) + char *name; +{ + register int i; + int mntsize; + struct statfs *mntbuf; + + mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); + for (i = 0; i < mntsize; i++) { + if (!strcmp(mntbuf[i].f_mntfromname, name)) + return (mntbuf[i].f_mntonname); + } + return (0); +} + +/* + * Convert statfs returned filesystem size into BLOCKSIZE units. + * Attempts to avoid overflow for large filesystems. + */ +long +fsbtoblk(num, fsbs, bs) + long num; + register int fsbs, bs; + { + return((fsbs != 0 && fsbs < bs) ? + num / (bs / fsbs) : (num) * (fsbs / bs)); + } + +/* + * Print out status about a filesystem. + */ +void +prtstat(sfsp, maxwidth) + register struct statfs *sfsp; + register int maxwidth; +{ + static int blocksize; + static int headerlen, timesthrough; + static char *header; + long used, availblks; + ino_t inodes, iused; + + if (maxwidth < 11) + maxwidth = 11; + if (++timesthrough == 1) { +/* header = getbsize(&headerlen, &blocksize); */ + header = "1K-blocks"; + blocksize = 1024; + headerlen = 9; + + (void)printf("%-*.*s %s Used Avail Capacity", + maxwidth, maxwidth, "Filesystem", header); + if (iflag) + (void)printf(" iused ifree %%iused"); + (void)printf(" Mounted on\n"); + } + (void)printf("%-*.*s", maxwidth, maxwidth, sfsp->f_mntfromname); + used = sfsp->f_blocks - sfsp->f_bfree; + availblks = sfsp->f_bavail + used; + (void)printf(" %*ld %8ld %8ld", headerlen, + fsbtoblk(sfsp->f_blocks, sfsp->f_bsize, blocksize), + fsbtoblk(used, sfsp->f_bsize, blocksize), + fsbtoblk(sfsp->f_bavail, sfsp->f_bsize, blocksize)); + (void)printf(" %5.0f%%", + availblks == 0 ? 100.0 : (double)used / (double)availblks * 100.0); + if (iflag) { + inodes = sfsp->f_files; + iused = inodes - sfsp->f_ffree; + (void)printf(" %7u %7u %5.0f%% ", iused, sfsp->f_ffree, + inodes == 0 ? 100.0 : (double)iused / (double)inodes * 100.0); + } else + (void)printf(" "); + (void)printf(" %s\n", sfsp->f_mntonname); +} + +/* + * This code constitutes the pre-system call Berkeley df code for extracting + * information from filesystem superblocks. + */ +#include +#include + +union { + struct fs fs; + char dummy[SBSIZE]; +} sb; +#define sblock sb.fs + +int rfd; + +void +ufs_df(file, maxwidth) + char *file; + int maxwidth; +{ + struct statfs statfsbuf; + register struct statfs *sfsp; + register char *mntpt; + static int synced; + + if (synced++ == 0) + sync(); + + if ((rfd = open(file, O_RDONLY)) < 0) { + warn("%s", file); + return; + } + if (bread((off_t)SBLOCK * DEV_BSIZE, &sblock, SBSIZE) == 0) { + (void)close(rfd); + return; + } + sfsp = &statfsbuf; + sfsp->f_type = MOUNT_UFS; + sfsp->f_flags = 0; + sfsp->f_bsize = MAXBSIZE; + sfsp->f_iosize = MAXBSIZE; + sfsp->f_blocks = sblock.fs_fsize - sblock.fs_isize; + sfsp->f_bfree = sblock.fs_tfree; + sfsp->f_bavail = sblock.fs_tfree; + if (sfsp->f_bavail < 0) + sfsp->f_bavail = 0; + sfsp->f_files = (sblock.fs_isize - 2) * INOPB; + sfsp->f_ffree = sblock.fs_tinode; + sfsp->f_fsid[0] = 0; + sfsp->f_fsid[1] = 0; + if ((mntpt = getmntpt(file)) == 0) + mntpt = ""; + bcopy(mntpt, &sfsp->f_mntonname[0], MNAMELEN); + bcopy(file, &sfsp->f_mntfromname[0], MNAMELEN); + prtstat(sfsp, maxwidth); + (void)close(rfd); +} + +int +bread(off, buf, cnt) + off_t off; + void *buf; + register int cnt; +{ + register int nr; + + (void)lseek(rfd, off, L_SET); + if ((nr = read(rfd, buf, cnt)) != cnt) { + /* Probably a dismounted disk if errno == EIO. */ + if (errno != EIO) + (void)fprintf(stderr, "\ndf: %ld: %s\n", + off, strerror(nr > 0 ? EIO : errno)); + return (0); + } + return (1); +} + +void +usage() +{ + (void)fprintf(stderr, "usage: df [-i] [file | file_system ...]\n"); + exit(1); +} diff --git a/bin/diff/Makefile b/bin/diff/Makefile new file mode 100644 index 0000000..7b27185 --- /dev/null +++ b/bin/diff/Makefile @@ -0,0 +1,27 @@ +# @(#)Makefile 4.1.1 1996/10/21 +# +DIFF= /bin/diff +DIFFH= /usr/libexec/diffh +PR= /bin/pr +CFLAGS= -O -DDIFF='"${DIFF}"' -DDIFFH='"${DIFFH}"' -DPR='"${PR}"' +SEPFLAG=-i +DESTDIR= + +SRCS= diff.c diffdir.c diffreg.c +HDRS= diff.h +OBJS= diff.o diffdir.o diffreg.o + +all: diff diffh + +diff: ${OBJS} + cc ${CFLAGS} -o diff ${OBJS} ${SEPFLAG} ${LDFLAGS} + +diffh: diffh.o + cc -o diffh diffh.o ${SEPFLAG} ${LDFLAGS} + +clean: + rm -f diff diffh ${OBJS} diffh.o + +install: all + install -s diff ${DESTDIR}/bin/diff + install -s diffh ${DESTDIR}/usr/libexec/diffh diff --git a/bin/diff/diff.c b/bin/diff/diff.c new file mode 100644 index 0000000..beb892c --- /dev/null +++ b/bin/diff/diff.c @@ -0,0 +1,212 @@ +#if !defined(lint) && defined(DOSCCS) +static char sccsid[] = "@(#)diff.c 4.6 4/3/86"; +#endif + +#include "diff.h" +/* + * diff - driver and subroutines + */ + +char diff[] = DIFF; +char diffh[] = DIFFH; +char pr[] = PR; + +main(argc, argv) + int argc; + char **argv; +{ + register char *argp; + + ifdef1 = "FILE1"; ifdef2 = "FILE2"; + status = 2; + diffargv = argv; + argc--, argv++; + while (argc > 2 && argv[0][0] == '-') { + argp = &argv[0][1]; + argv++, argc--; + while (*argp) switch(*argp++) { + +#ifdef notdef + case 'I': + opt = D_IFDEF; + wantelses = 0; + continue; + case 'E': + opt = D_IFDEF; + wantelses = 1; + continue; + case '1': + opt = D_IFDEF; + ifdef1 = argp; + *--argp = 0; + continue; +#endif + case 'D': + /* -Dfoo = -E -1 -2foo */ + wantelses = 1; + ifdef1 = ""; + /* fall through */ +#ifdef notdef + case '2': +#endif + opt = D_IFDEF; + ifdef2 = argp; + *--argp = 0; + continue; + case 'e': + opt = D_EDIT; + continue; + case 'f': + opt = D_REVERSE; + continue; + case 'n': + opt = D_NREVERSE; + continue; + case 'b': + bflag = 1; + continue; + case 'w': + wflag = 1; + continue; + case 'i': + iflag = 1; + continue; + case 't': + tflag = 1; + continue; + case 'c': + opt = D_CONTEXT; + if (isdigit(*argp)) { + context = atoi(argp); + while (isdigit(*argp)) + argp++; + if (*argp) { + fprintf(stderr, + "diff: -c: bad count\n"); + done(); + } + argp = ""; + } else + context = 3; + continue; + case 'h': + hflag++; + continue; + case 'S': + if (*argp == 0) { + fprintf(stderr, "diff: use -Sstart\n"); + done(); + } + start = argp; + *--argp = 0; /* don't pass it on */ + continue; + case 'r': + rflag++; + continue; + case 's': + sflag++; + continue; + case 'l': + lflag++; + continue; + default: + fprintf(stderr, "diff: -%s: unknown option\n", + --argp); + done(); + } + } + if (argc != 2) { + fprintf(stderr, "diff: two filename arguments required\n"); + done(); + } + file1 = argv[0]; + file2 = argv[1]; + if (hflag && opt) { + fprintf(stderr, + "diff: -h doesn't support -e, -f, -n, -c, or -I\n"); + done(); + } + if (!strcmp(file1, "-")) + stb1.st_mode = S_IFREG; + else if (stat(file1, &stb1) < 0) { + fprintf(stderr, "diff: "); + perror(file1); + done(); + } + if (!strcmp(file2, "-")) + stb2.st_mode = S_IFREG; + else if (stat(file2, &stb2) < 0) { + fprintf(stderr, "diff: "); + perror(file2); + done(); + } + if ((stb1.st_mode & S_IFMT) == S_IFDIR && + (stb2.st_mode & S_IFMT) == S_IFDIR) { + diffdir(argv); + } else + diffreg(); + done(); +} + +char * +savestr(cp) + register char *cp; +{ + register char *dp = malloc(strlen(cp)+1); + + if (dp == 0) { + fprintf(stderr, "diff: ran out of memory\n"); + done(); + } + strcpy(dp, cp); + return (dp); +} + +min(a,b) + int a,b; +{ + + return (a < b ? a : b); +} + +max(a,b) + int a,b; +{ + + return (a > b ? a : b); +} + +done() +{ + if (tempfile) + unlink(tempfile); + exit(status); +} + +char * +talloc(n) +{ + register char *p; + + if ((p = malloc((unsigned)n)) != NULL) + return(p); + noroom(); +} + +char * +ralloc(p,n) +char *p; +{ + register char *q; + char *realloc(); + + if ((q = realloc(p, (unsigned)n)) == NULL) + noroom(); + return(q); +} + +noroom() +{ + fprintf(stderr, "diff: files too big, try -h\n"); + done(); +} diff --git a/bin/diff/diff.h b/bin/diff/diff.h new file mode 100644 index 0000000..7c11a5f --- /dev/null +++ b/bin/diff/diff.h @@ -0,0 +1,85 @@ +/* diff.h 4.7 85/08/16 */ + +/* + * diff - common declarations + */ + +#include +#include +#include +#include +#include +#include + +/* + * Output format options + */ +int opt; + +#define D_NORMAL 0 /* Normal output */ +#define D_EDIT -1 /* Editor script out */ +#define D_REVERSE 1 /* Reverse editor script */ +#define D_CONTEXT 2 /* Diff with context */ +#define D_IFDEF 3 /* Diff with merged #ifdef's */ +#define D_NREVERSE 4 /* Reverse ed script with numbered + lines and no trailing . */ + +int tflag; /* expand tabs on output */ + +/* + * Algorithm related options + */ +int hflag; /* -h, use halfhearted DIFFH */ +int bflag; /* ignore blanks in comparisons */ +int wflag; /* totally ignore blanks in comparisons */ +int iflag; /* ignore case in comparisons */ + +/* + * Options on hierarchical diffs. + */ +int lflag; /* long output format with header */ +int rflag; /* recursively trace directories */ +int sflag; /* announce files which are same */ +char *start; /* do file only if name >= this */ + +/* + * Variables for -I D_IFDEF option. + */ +int wantelses; /* -E */ +char *ifdef1; /* String for -1 */ +char *ifdef2; /* String for -2 */ +char *endifname; /* What we will print on next #endif */ +int inifdef; + +/* + * Variables for -c context option. + */ +int context; /* lines of context to be printed */ + +/* + * State for exit status. + */ +int status; +int anychange; +char *tempfile; /* used when comparing against std input */ + +/* + * Variables for diffdir. + */ +char **diffargv; /* option list to pass to recursive diffs */ + +/* + * Input file names. + * With diffdir, file1 and file2 are allocated BUFSIZ space, + * and padded with a '/', and then efile0 and efile1 point after + * the '/'. + */ +char *file1, *file2, *efile1, *efile2; +struct stat stb1, stb2; + +char *malloc(), *talloc(), *ralloc(); +char *savestr(), *splice(), *splicen(); +char *mktemp(), *copytemp(), *rindex(); +int done(); + +extern char diffh[], diff[], pr[]; diff --git a/bin/diff/diffdir.c b/bin/diff/diffdir.c new file mode 100644 index 0000000..d360c50 --- /dev/null +++ b/bin/diff/diffdir.c @@ -0,0 +1,423 @@ +#if !defined(lint) && defined(DOSCCS) +static char *sccsid = "@(#)diffdir.c 4.9 (Berkeley) 8/28/84"; +#endif + +#include "diff.h" +/* + * diff - directory comparison + */ +#define d_flags d_ino + +#define ONLY 1 /* Only in this directory */ +#define SAME 2 /* Both places and same */ +#define DIFFER 4 /* Both places and different */ +#define DIRECT 8 /* Directory */ + +struct dir { + ino_t d_ino; + short d_reclen; + short d_namlen; + char *d_entry; +}; + +struct dir *setupdir(); +int header; +char title[2*BUFSIZ], *etitle; + +diffdir(argv) + char **argv; +{ + register struct dir *d1, *d2; + struct dir *dir1, *dir2; + register int i; + int cmp; + + if (opt == D_IFDEF) { + fprintf(stderr, "diff: can't specify -I with directories\n"); + done(); + } + if (opt == D_EDIT && (sflag || lflag)) + fprintf(stderr, + "diff: warning: shouldn't give -s or -l with -e\n"); + title[0] = 0; + strcpy(title, "diff "); + for (i = 1; diffargv[i+2]; i++) { + if (!strcmp(diffargv[i], "-")) + continue; /* was -S, dont look silly */ + strcat(title, diffargv[i]); + strcat(title, " "); + } + for (etitle = title; *etitle; etitle++) + ; + setfile(&file1, &efile1, file1); + setfile(&file2, &efile2, file2); + argv[0] = file1; + argv[1] = file2; + dir1 = setupdir(file1); + dir2 = setupdir(file2); + d1 = dir1; d2 = dir2; + while (d1->d_entry != 0 || d2->d_entry != 0) { + if (d1->d_entry && useless(d1->d_entry)) { + d1++; + continue; + } + if (d2->d_entry && useless(d2->d_entry)) { + d2++; + continue; + } + if (d1->d_entry == 0) + cmp = 1; + else if (d2->d_entry == 0) + cmp = -1; + else + cmp = strcmp(d1->d_entry, d2->d_entry); + if (cmp < 0) { + if (lflag) + d1->d_flags |= ONLY; + else if (opt == 0 || opt == 2) + only(d1, 1); + d1++; + } else if (cmp == 0) { + compare(d1); + d1++; + d2++; + } else { + if (lflag) + d2->d_flags |= ONLY; + else if (opt == 0 || opt == 2) + only(d2, 2); + d2++; + } + } + if (lflag) { + scanpr(dir1, ONLY, "Only in %.*s", file1, efile1, 0, 0); + scanpr(dir2, ONLY, "Only in %.*s", file2, efile2, 0, 0); + scanpr(dir1, SAME, "Common identical files in %.*s and %.*s", + file1, efile1, file2, efile2); + scanpr(dir1, DIFFER, "Binary files which differ in %.*s and %.*s", + file1, efile1, file2, efile2); + scanpr(dir1, DIRECT, "Common subdirectories of %.*s and %.*s", + file1, efile1, file2, efile2); + } + if (rflag) { + if (header && lflag) + printf("\f"); + for (d1 = dir1; d1->d_entry; d1++) { + if ((d1->d_flags & DIRECT) == 0) + continue; + strcpy(efile1, d1->d_entry); + strcpy(efile2, d1->d_entry); + calldiff(0); + } + } +} + +setfile(fpp, epp, file) + char **fpp, **epp; + char *file; +{ + register char *cp; + + *fpp = malloc(BUFSIZ); + if (*fpp == 0) { + fprintf(stderr, "diff: ran out of memory\n"); + exit(1); + } + strcpy(*fpp, file); + for (cp = *fpp; *cp; cp++) + continue; + *cp++ = '/'; + *epp = cp; +} + +scanpr(dp, test, title, file1, efile1, file2, efile2) + register struct dir *dp; + int test; + char *title, *file1, *efile1, *file2, *efile2; +{ + int titled = 0; + + for (; dp->d_entry; dp++) { + if ((dp->d_flags & test) == 0) + continue; + if (titled == 0) { + if (header == 0) + header = 1; + else + printf("\n"); + printf(title, + efile1 - file1 - 1, file1, + efile2 - file2 - 1, file2); + printf(":\n"); + titled = 1; + } + printf("\t%s\n", dp->d_entry); + } +} + +only(dp, which) + struct dir *dp; + int which; +{ + char *file = which == 1 ? file1 : file2; + char *efile = which == 1 ? efile1 : efile2; + + printf("Only in %.*s: %s\n", efile - file - 1, file, dp->d_entry); +} + +int entcmp(); + +struct dir * +setupdir(cp) + char *cp; +{ + register struct dir *dp = 0, *ep; + register struct direct *rp; + register int nitems, n; + DIR *dirp; + + dirp = opendir(cp); + if (dirp == NULL) { + fprintf(stderr, "diff: "); + perror(cp); + done(); + } + nitems = 0; +#ifdef pdp11 + while (readdir(dirp)) + nitems++; + rewinddir(dirp); + dp = (struct dir *)calloc(nitems+1, sizeof (struct dir)); + nitems = 0; +#else + dp = (struct dir *)malloc(sizeof (struct dir)); +#endif + if (dp == 0) { + fprintf(stderr, "diff: ran out of memory\n"); + done(); + } + while (rp = readdir(dirp)) { + ep = &dp[nitems++]; + ep->d_reclen = rp->d_reclen; + ep->d_namlen = rp->d_namlen; + ep->d_entry = 0; + ep->d_flags = 0; + if (ep->d_namlen > 0) { + ep->d_entry = malloc(ep->d_namlen + 1); + if (ep->d_entry == 0) { + fprintf(stderr, "diff: out of memory\n"); + done(); + } + strcpy(ep->d_entry, rp->d_name); + } +#ifndef pdp11 + dp = (struct dir *)realloc((char *)dp, + (nitems + 1) * sizeof (struct dir)); + if (dp == 0) { + fprintf(stderr, "diff: ran out of memory\n"); + done(); + } +#endif + } + dp[nitems].d_entry = 0; /* delimiter */ + closedir(dirp); + qsort(dp, nitems, sizeof (struct dir), entcmp); + return (dp); +} + +entcmp(d1, d2) + struct dir *d1, *d2; +{ + return (strcmp(d1->d_entry, d2->d_entry)); +} + +compare(dp) + register struct dir *dp; +{ + register int i, j; + int f1, f2, fmt1, fmt2; + struct stat stb1, stb2; + int flag = 0; + char buf1[BUFSIZ], buf2[BUFSIZ]; + + strcpy(efile1, dp->d_entry); + strcpy(efile2, dp->d_entry); + f1 = open(file1, 0); + if (f1 < 0) { + perror(file1); + return; + } + f2 = open(file2, 0); + if (f2 < 0) { + perror(file2); + close(f1); + return; + } + fstat(f1, &stb1); fstat(f2, &stb2); + fmt1 = stb1.st_mode & S_IFMT; + fmt2 = stb2.st_mode & S_IFMT; + if (fmt1 != S_IFREG || fmt2 != S_IFREG) { + if (fmt1 == fmt2) { + if (fmt1 != S_IFDIR && stb1.st_rdev == stb2.st_rdev) + goto same; + if (fmt1 == S_IFDIR) { + dp->d_flags = DIRECT; + if (lflag || opt == D_EDIT) + goto closem; + printf("Common subdirectories: %s and %s\n", + file1, file2); + goto closem; + } + } + goto notsame; + } + if (stb1.st_size != stb2.st_size) + goto notsame; + for (;;) { + i = read(f1, buf1, BUFSIZ); + j = read(f2, buf2, BUFSIZ); + if (i < 0 || j < 0 || i != j) + goto notsame; + if (i == 0 && j == 0) + goto same; + for (j = 0; j < i; j++) + if (buf1[j] != buf2[j]) + goto notsame; + } +same: + if (sflag == 0) + goto closem; + if (lflag) + dp->d_flags = SAME; + else + printf("Files %s and %s are identical\n", file1, file2); + goto closem; +notsame: + if (!ascii(f1) || !ascii(f2)) { + if (lflag) + dp->d_flags |= DIFFER; + else if (opt == D_NORMAL || opt == D_CONTEXT) + printf("Binary files %s and %s differ\n", + file1, file2); + goto closem; + } + close(f1); close(f2); + anychange = 1; + if (lflag) + calldiff(title); + else { + if (opt == D_EDIT) { + printf("ed - %s << '-*-END-*-'\n", dp->d_entry); + calldiff(0); + } else { + printf("%s%s %s\n", title, file1, file2); + calldiff(0); + } + if (opt == D_EDIT) + printf("w\nq\n-*-END-*-\n"); + } + return; +closem: + close(f1); close(f2); +} + +char *prargs[] = { "pr", "-h", 0, "-f", 0, 0 }; + +calldiff(wantpr) + char *wantpr; +{ + int pid, status, status2, pv[2]; + + prargs[2] = wantpr; + fflush(stdout); + if (wantpr) { + sprintf(etitle, "%s %s", file1, file2); + pipe(pv); + pid = fork(); + if (pid == -1) { + fprintf(stderr, "No more processes"); + done(); + } + if (pid == 0) { + close(0); + dup(pv[0]); + close(pv[0]); + close(pv[1]); + execv(pr+4, prargs); + execv(pr, prargs); + perror(pr); + done(); + } + } + pid = fork(); + if (pid == -1) { + fprintf(stderr, "diff: No more processes\n"); + done(); + } + if (pid == 0) { + if (wantpr) { + close(1); + dup(pv[1]); + close(pv[0]); + close(pv[1]); + } + execv(diff+4, diffargv); + execv(diff, diffargv); + perror(diff); + done(); + } + if (wantpr) { + close(pv[0]); + close(pv[1]); + } + while (wait(&status) != pid) + continue; + while (wait(&status2) != -1) + continue; +/* + if ((status >> 8) >= 2) + done(); +*/ +} + +#include + +ascii(f) + int f; +{ + char buf[BUFSIZ]; + register int cnt; + register char *cp; + + lseek(f, (long)0, 0); + cnt = read(f, buf, BUFSIZ); + if (cnt >= sizeof (struct exec)) { + struct exec hdr; + hdr = *(struct exec *)buf; + if (!N_BADMAG(hdr)) + return (0); + } + cp = buf; + while (--cnt >= 0) + if (*cp++ & 0200) + return (0); + return (1); +} + +/* + * THIS IS CRUDE. + */ +useless(cp) +register char *cp; +{ + + if (cp[0] == '.') { + if (cp[1] == '\0') + return (1); /* directory "." */ + if (cp[1] == '.' && cp[2] == '\0') + return (1); /* directory ".." */ + } + if (start && strcmp(start, cp) > 0) + return (1); + return (0); +} diff --git a/bin/diff/diffh.c b/bin/diff/diffh.c new file mode 100644 index 0000000..8abfc48 --- /dev/null +++ b/bin/diff/diffh.c @@ -0,0 +1,270 @@ +#if !defined(lint) && defined(DOSCCS) +static char sccsid[] = "@(#)diffh.c 4.4 11/27/85"; +#endif + +#include +#include +#include +#include + +#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(deltant) + 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=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(2); +} + + /*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/bin/diff/diffreg.c b/bin/diff/diffreg.c new file mode 100644 index 0000000..f54e363 --- /dev/null +++ b/bin/diff/diffreg.c @@ -0,0 +1,1052 @@ +#if !defined(lint) && defined(DOSCCS) +static char sccsid[] = "@(#)diffreg.c 4.16.1 (2.11BSD) 1/1/94"; +#endif + +#include "diff.h" +/* + * diff - compare two files. + */ + +/* + * 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''). In particular, this + * collects the equivalence classes in file1 together. + * Subroutine equiv 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 squeezes file1 into a single + * array member 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 are unsorted into + * array class according to the original order of file0. + * + * The cleverness lies in routine stone. This marches + * through the lines of file0, developing a vector klist + * 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 length 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) 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 + * + * With J in hand, the matches there recorded are + * check'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. + */ + +#define prints(s) fputs(s,stdout) + +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] */ +char *chrtran; /* translation table for case-folding */ + +/* chrtran points to one of 2 translation tables: + * cup2low if folding upper to lower case + * clow2low if not folding case + */ +char clow2low[256] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5a,0x5b,0x5c,0x5d,0x5e,0x5f, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7a,0x7b,0x7c,0x7d,0x7e,0x7f, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9a,0x9b,0x9c,0x9d,0x9e,0x9f, +0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf, +0xb0,0xb1,0xb2,0xb3,0xb4,0xb5,0xb6,0xb7,0xb8,0xb9,0xba,0xbb,0xbc,0xbd,0xbe,0xbf, +0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf, +0xd0,0xd1,0xd2,0xd3,0xd4,0xd5,0xd6,0xd7,0xd8,0xd9,0xda,0xdb,0xdc,0xdd,0xde,0xdf, +0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,0xe9,0xea,0xeb,0xec,0xed,0xee,0xef, +0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,0xf8,0xf9,0xfa,0xfb,0xfc,0xfd,0xfe,0xff +}; + +char cup2low[256] = { +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7a,0x7b,0x7c,0x7d,0x7e,0x7f, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7a,0x7b,0x7c,0x7d,0x7e,0x7f, +0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f, +0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9a,0x9b,0x9c,0x9d,0x9e,0x9f, +0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf, +0xb0,0xb1,0xb2,0xb3,0xb4,0xb5,0xb6,0xb7,0xb8,0xb9,0xba,0xbb,0xbc,0xbd,0xbe,0xbf, +0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf, +0xd0,0xd1,0xd2,0xd3,0xd4,0xd5,0xd6,0xd7,0xd8,0xd9,0xda,0xdb,0xdc,0xdd,0xde,0xdf, +0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,0xe9,0xea,0xeb,0xec,0xed,0xee,0xef, +0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,0xf8,0xf9,0xfa,0xfb,0xfc,0xfd,0xfe,0xff +}; + +diffreg() +{ + register int i, j; + FILE *f1, *f2; + char buf1[BUFSIZ], buf2[BUFSIZ]; + + if (hflag) { + diffargv[0] = "diffh"; + execv(diffh, diffargv); + fprintf(stderr, "diff: "); + perror(diffh); + done(); + } + chrtran = (iflag? cup2low : clow2low); + if ((stb1.st_mode & S_IFMT) == S_IFDIR) { + file1 = splice(file1, file2); + if (stat(file1, &stb1) < 0) { + fprintf(stderr, "diff: "); + perror(file1); + done(); + } + } else if ((stb2.st_mode & S_IFMT) == S_IFDIR) { + file2 = splice(file2, file1); + if (stat(file2, &stb2) < 0) { + fprintf(stderr, "diff: "); + perror(file2); + done(); + } + } else if (!strcmp(file1, "-")) { + if (!strcmp(file2, "-")) { + fprintf(stderr, "diff: can't specify - -\n"); + done(); + } + file1 = copytemp(); + if (stat(file1, &stb1) < 0) { + fprintf(stderr, "diff: "); + perror(file1); + done(); + } + } else if (!strcmp(file2, "-")) { + file2 = copytemp(); + if (stat(file2, &stb2) < 0) { + fprintf(stderr, "diff: "); + perror(file2); + done(); + } + } + if ((f1 = fopen(file1, "r")) == NULL) { + fprintf(stderr, "diff: "); + perror(file1); + done(); + } + if ((f2 = fopen(file2, "r")) == NULL) { + fprintf(stderr, "diff: "); + perror(file2); + fclose(f1); + done(); + } + if (stb1.st_size != stb2.st_size) + goto notsame; + for (;;) { + i = fread(buf1, 1, BUFSIZ, f1); + j = fread(buf2, 1, BUFSIZ, f2); + if (i < 0 || j < 0 || i != j) + goto notsame; + if (i == 0 && j == 0) { + fclose(f1); + fclose(f2); + status = 0; /* files don't differ */ + goto same; + } + for (j = 0; j < i; j++) + if (buf1[j] != buf2[j]) + goto notsame; + } +notsame: + /* + * Files certainly differ at this point; set status accordingly + */ + status = 1; + if (!asciifile(f1) || !asciifile(f2)) { + printf("Binary files %s and %s differ\n", file1, file2); + fclose(f1); + fclose(f2); + done(); + } + prepare(0, f1); + prepare(1, f2); + fclose(f1); + fclose(f2); + 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)); + i = stone(class, slen[0], member, klist); + free((char *)member); + free((char *)class); + + J = (int *)talloc((len[0]+2)*sizeof(int)); + unravel(klist[i]); + free((char *)clist); + free((char *)klist); + + ixold = (long *)talloc((len[0]+2)*sizeof(long)); + ixnew = (long *)talloc((len[1]+2)*sizeof(long)); + check(); + output(); + status = anychange; +same: + if (opt == D_CONTEXT && anychange == 0) + printf("No differences encountered\n"); + done(); +} + +char * +copytemp() +{ + char buf[BUFSIZ]; + register int i, f; + + signal(SIGHUP,done); + signal(SIGINT,done); + signal(SIGPIPE,done); + signal(SIGTERM,done); + tempfile = mktemp("/tmp/dXXXXX"); + f = creat(tempfile,0600); + if (f < 0) { + fprintf(stderr, "diff: "); + perror(tempfile); + done(); + } + while ((i = read(0,buf,BUFSIZ)) > 0) + if (write(f,buf,i) != i) { + fprintf(stderr, "diff: "); + perror(tempfile); + done(); + } + close(f); + return (tempfile); +} + +char * +splice(dir, file) + char *dir, *file; +{ + char *tail; + char buf[BUFSIZ]; + + if (!strcmp(file, "-")) { + fprintf(stderr, "diff: can't specify - with other arg directory\n"); + done(); + } + tail = rindex(file, '/'); + if (tail == 0) + tail = file; + else + tail++; + sprintf(buf, "%s/%s", dir, tail); + return (savestr(buf)); +} + +prepare(i, fd) + int i; + FILE *fd; +{ + register struct line *p; + register j,h; + + fseek(fd, (long)0, 0); + p = (struct line *)talloc(3*sizeof(line)); + for(j=0; h=readhash(fd);) { + p = (struct line *)ralloc((char *)p,(++j+3)*sizeof(line)); + p[j].value = h; + } + len[i] = j; + file[i] = p; +} + +prune() +{ + register i,j; + for(pref=0;pref 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>= 1) <= i) + break; + 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() +{ + register int i, j; + int jackpot; + long ctold, ctnew; + register int c,d; + + if ((input[0] = fopen(file1,"r")) == NULL) { + perror(file1); + done(); + } + if ((input[1] = fopen(file2,"r")) == NULL) { + perror(file2); + done(); + } + 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 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); +} + +skipline(f) +{ + register i, c; + + for(i=1;(c=getc(input[f]))!='\n';i++) + if (c < 0) + return(i); + return(i); +} + +output() +{ + int m; + register int i0, i1, j1; + int j0; + input[0] = fopen(file1,"r"); + input[1] = fopen(file2,"r"); + m = len[0]; + J[0] = 0; + J[m+1] = len[1]+1; + if(opt!=D_EDIT) 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=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]); + if (opt==D_IFDEF) { + for (;;) { +#define c i0 + c = getc(input[0]); + if (c < 0) + return; + putchar(c); + } +#undef c + } + if (anychange && opt == D_CONTEXT) + dump_context_vec(); +} + +/* + * The following struct is used to record change information when + * doing a "context" diff. (see routine "change" to understand the + * highly mneumonic field names) + */ +struct context_vec { + int a; /* start line in old file */ + int b; /* end line in old file */ + int c; /* start line in new file */ + int d; /* end line in new file */ +}; + +struct context_vec *context_vec_start, + *context_vec_end, + *context_vec_ptr; + +#define MAX_CONTEXT 128 + +/* indicate that there is a difference between lines a and b of the from file + to get to lines c to d of the to file. + If a is greater then b then there are no lines in the from file involved + and this means that there were lines appended (beginning at b). + If c is greater than d then there are lines missing from the to file. +*/ +change(a,b,c,d) +{ + int ch; + int lowa,upb,lowc,upd; + struct stat stbuf; + + if (opt != D_IFDEF && a>b && c>d) + return; + if (anychange == 0) { + anychange = 1; + if(opt == D_CONTEXT) { + printf("*** %s ", file1); + stat(file1, &stbuf); + printf("%s--- %s ", + ctime(&stbuf.st_mtime), file2); + stat(file2, &stbuf); + printf("%s", ctime(&stbuf.st_mtime)); + + context_vec_start = (struct context_vec *) + malloc(MAX_CONTEXT * + sizeof(struct context_vec)); + context_vec_end = context_vec_start + MAX_CONTEXT; + context_vec_ptr = context_vec_start - 1; + } + } + if (a <= b && c <= d) + ch = 'c'; + else + ch = (a <= b) ? 'd' : 'a'; + if(opt == D_CONTEXT) { + /* + * if this new change is within 'context' lines of + * the previous change, just add it to the change + * record. If the record is full or if this + * change is more than 'context' lines from the previous + * change, dump the record, reset it & add the new change. + */ + if ( context_vec_ptr >= context_vec_end || + ( context_vec_ptr >= context_vec_start && + a > (context_vec_ptr->b + 2*context) && + c > (context_vec_ptr->d + 2*context) ) ) + dump_context_vec(); + + context_vec_ptr++; + context_vec_ptr->a = a; + context_vec_ptr->b = b; + context_vec_ptr->c = c; + context_vec_ptr->d = d; + return; + } + switch (opt) { + + case D_NORMAL: + case D_EDIT: + range(a,b,","); + putchar(a>b?'a':c>d?'d':'c'); + if(opt==D_NORMAL) + range(c,d,","); + putchar('\n'); + break; + case D_REVERSE: + putchar(a>b?'a':c>d?'d':'c'); + range(a,b," "); + putchar('\n'); + break; + case D_NREVERSE: + if (a>b) + printf("a%d %d\n",b,d-c+1); + else { + printf("d%d %d\n",a,b-a+1); + if (!(c>d)) + /* add changed lines */ + printf("a%d %d\n",b, d-c+1); + } + break; + } + if(opt == D_NORMAL || opt == D_IFDEF) { + fetch(ixold,a,b,input[0],"< ", 1); + if(a<=b&&c<=d && opt == D_NORMAL) + prints("---\n"); + } + fetch(ixnew,c,d,input[1],opt==D_NORMAL?"> ":"", 0); + if ((opt ==D_EDIT || opt == D_REVERSE) && c<=d) + prints(".\n"); + if (inifdef) { + fprintf(stdout, "#endif %s\n", endifname); + inifdef = 0; + } +} + +range(a,b,separator) +char *separator; +{ + printf("%d", a>b?b:a); + if(ab), else to (nb: 0 vs 1 orig) */ + nc = f[a>b? b : a-1 ] - curpos; + for (i = 0; i < nc; i++) + putchar(getc(lb)); + } + if (a > b) + return; + if (opt == D_IFDEF) { + if (inifdef) + fprintf(stdout, "#else %s%s\n", oneflag && oldfile==1 ? "!" : "", ifdef2); + else { + if (oneflag) { + /* There was only one ifdef given */ + endifname = ifdef2; + if (oldfile) + fprintf(stdout, "#ifndef %s\n", endifname); + else + fprintf(stdout, "#ifdef %s\n", endifname); + } + else { + endifname = oldfile ? ifdef1 : ifdef2; + fprintf(stdout, "#ifdef %s\n", endifname); + } + } + inifdef = 1+oldfile; + } + + for(i=a;i<=b;i++) { + fseek(lb,f[i-1],0); + nc = f[i]-f[i-1]; + if (opt != D_IFDEF) + prints(s); + col = 0; + for(j=0;j>HALFLONG) + +/* + * hashing has the effect of + * arranging line in 7-bit bytes and then + * summing 1-s complement in 16-bit hunks + */ +readhash(f) +register FILE *f; +{ + register long sum; + register unsigned shift; + register t; + register space; + + sum = 1; + space = 0; + if(!bflag && !wflag) { + if(iflag) + for(shift=0;(t=getc(f))!='\n';shift+=7) { + if(t==-1) + return(0); + sum += (long)chrtran[t] << (shift +#ifdef POW2 + &= HALFLONG - 1); +#else + %= HALFLONG); +#endif + } + else + for(shift=0;(t=getc(f))!='\n';shift+=7) { + if(t==-1) + return(0); + sum += (long)t << (shift +#ifdef POW2 + &= HALFLONG - 1); +#else + %= HALFLONG); +#endif + } + } else { + for(shift=0;;) { + switch(t=getc(f)) { + case -1: + return(0); + case '\t': + case ' ': + space++; + continue; + default: + if(space && !wflag) { + shift += 7; + space = 0; + } + sum += (long)chrtran[t] << (shift +#ifdef POW2 + &= HALFLONG - 1); +#else + %= HALFLONG); +#endif + shift += 7; + continue; + case '\n': + break; + } + break; + } + } + sum = low(sum) + high(sum); + return((short)low(sum) + (short)high(sum)); +} + +#include + +asciifile(f) + FILE *f; +{ + char buf[BUFSIZ]; + register int cnt; + register char *cp; + + fseek(f, (long)0, 0); + cnt = fread(buf, 1, BUFSIZ, f); + if (cnt >= sizeof (struct exec)) { + struct exec hdr; + hdr = *(struct exec *)buf; + if (!N_BADMAG(hdr)) + return (0); + } + cp = buf; + while (--cnt >= 0) + if (*cp++ & 0200) + return (0); + return (1); +} + + +/* dump accumulated "context" diff changes */ +dump_context_vec() +{ + register int a, b, c, d; + register char ch; + register struct context_vec *cvp = context_vec_start; + register int lowa, upb, lowc, upd; + register int do_output; + + if ( cvp > context_vec_ptr ) + return; + + lowa = max(1, cvp->a - context); + upb = min(len[0], context_vec_ptr->b + context); + lowc = max(1, cvp->c - context); + upd = min(len[1], context_vec_ptr->d + context); + + printf("***************\n*** "); + range(lowa,upb,","); + printf(" ****\n"); + + /* + * output changes to the "old" file. The first loop suppresses + * output if there were no changes to the "old" file (we'll see + * the "old" lines as context in the "new" list). + */ + do_output = 0; + for ( ; cvp <= context_vec_ptr; cvp++) + if (cvp->a <= cvp->b) { + cvp = context_vec_start; + do_output++; + break; + } + + if ( do_output ) { + while (cvp <= context_vec_ptr) { + a = cvp->a; b = cvp->b; c = cvp->c; d = cvp->d; + + if (a <= b && c <= d) + ch = 'c'; + else + ch = (a <= b) ? 'd' : 'a'; + + if (ch == 'a') + fetch(ixold,lowa,b,input[0]," "); + else { + fetch(ixold,lowa,a-1,input[0]," "); + fetch(ixold,a,b,input[0],ch == 'c' ? "! " : "- "); + } + lowa = b + 1; + cvp++; + } + fetch(ixold, b+1, upb, input[0], " "); + } + + /* output changes to the "new" file */ + printf("--- "); + range(lowc,upd,","); + printf(" ----\n"); + + do_output = 0; + for (cvp = context_vec_start; cvp <= context_vec_ptr; cvp++) + if (cvp->c <= cvp->d) { + cvp = context_vec_start; + do_output++; + break; + } + + if (do_output) { + while (cvp <= context_vec_ptr) { + a = cvp->a; b = cvp->b; c = cvp->c; d = cvp->d; + + if (a <= b && c <= d) + ch = 'c'; + else + ch = (a <= b) ? 'd' : 'a'; + + if (ch == 'd') + fetch(ixnew,lowc,d,input[1]," "); + else { + fetch(ixnew,lowc,c-1,input[1]," "); + fetch(ixnew,c,d,input[1],ch == 'c' ? "! " : "+ "); + } + lowc = d + 1; + cvp++; + } + fetch(ixnew, d+1, upd, input[1], " "); + } + + context_vec_ptr = context_vec_start - 1; +} diff --git a/bin/disklabel/Makefile b/bin/disklabel/Makefile new file mode 100644 index 0000000..92f5298 --- /dev/null +++ b/bin/disklabel/Makefile @@ -0,0 +1,28 @@ +# @(#)Makefile 1.0 (2.11BSD) 1995/04/10 + +DESTDIR= +CFLAGS=-O +SEPFLAG=-i +MANDIR=/usr/man/cat + +all: disklabel disklabel.5.0 disklabel.0 + +disklabel: disklabel.o + cc ${CFLAGS} ${SEPFLAG} -o $@ $@.o -lutil + +install: all + install -s -c -o bin -g operator -m 2550 disklabel \ + ${DESTDIR}/bin/disklabel + install -c -o bin -g bin -m 444 disklabel.5.0 \ + ${DESTDIR}${MANDIR}5/disklabel.0 + install -c -o bin -g bin -m 444 disklabel.0 \ + ${DESTDIR}/${MANDIR}8/disklabel.0 + +clean: + rm -f *.o *.0 *.core disklabel + +disklabel.0: disklabel.8 + /usr/man/manroff disklabel.8 > disklabel.0 + +disklabel.5.0: disklabel.5.5 + /usr/man/manroff disklabel.5.5 > disklabel.5.0 diff --git a/bin/disklabel/disklabel.5.5 b/bin/disklabel/disklabel.5.5 new file mode 100644 index 0000000..d2da7e3 --- /dev/null +++ b/bin/disklabel/disklabel.5.5 @@ -0,0 +1,358 @@ +.\" Copyright (c) 1987, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Symmetric Computer Systems. +.\" +.\" 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. +.\" +.\" @(#)disklabel.5.5 8.1.1 (2.11BSD) 1995/04/21 +.\" +.TH DISKLABEL 5 "April 21, 1995" +.UC 2 +.SH NAME +disklabel \- disk pack label +.SH SYNOPSIS +.B #include +.SH DESCRIPTION +Each disk or disk pack on a system may contain a disk label +which provides detailed information +about the geometry of the disk and the partitions into which the disk +is divided. +It should be initialized when the disk is formatted, +and may be changed later with the +.IR disklabel (8) +program. +This information is used by the system disk driver and by the bootstrap +program to determine how to program the drive +and where to find the filesystems on the disk partitions. +Additional information is used by the filesystem in order +to use the disk most efficiently and to locate important filesystem information. +The description of each partition contains an identifier for the partition +type (standard filesystem, swap area, etc.). +The filesystem updates the in-core copy of the label if it contains +incomplete information about the filesystem. +.PP +The label is located in sector number +.B LABELSECTOR +of the drive, usually sector 0 where it may be found +without any information about the disk geometry. +It is at an offset +.B LABELOFFSET +from the beginning of the sector, to allow room for the initial bootstrap. +The disk sector containing the label is normally made read-only +so that it is not accidentally overwritten by pack-to-pack copies +or swap operations; +the +.B DIOCWLABEL +.IR ioctl (2), +which is done as needed by the +.IR disklabel (8) +program. +.PP +A copy of the in-core label for a disk can be obtained with the +.B DIOCGDINFO +.IR ioctl (2); +this works with a file descriptor for a block or character (``raw'') device +for any partition of the disk. +The in-core copy of the label is set by the +.B DIOCSDINFO +.IR ioctl (2). +The offset of a partition cannot generally be changed while it is open, +nor can it be made smaller while it is open. +One exception is that any change is allowed if no label was found +on the disk, and the driver was able to construct only a skeletal label +without partition information. +Finally, the +.B DIOCWDINFO +.IR ioctl (2) +operation sets the in-core label and then updates the on-disk label; +there must be an existing label on the disk for this operation to succeed. +Thus, the initial label for a disk or disk pack must be installed +by writing to the raw disk. +All of these operations are normally done using +.IR disklabel (8). +.PP +The format of the disk label, as specified in +.I \ , +is: +.PP +.nf +/* + * Disk description table, see disktab(5) + */ +#define _PATH_DISKTAB "/etc/disktab" + +/* + * Each disk has a label which includes information about the hardware + * disk geometry, filesystem partitions, and drive specific information. + * The label is in block 0 or 1, possibly offset from the beginning + * to leave room for a bootstrap, etc. + */ + +/* These should be defined per controller/drive elsewhere, not here! */ +#define LABELSECTOR 1 /* sector containing label */ +#define LABELOFFSET 0 /* offset of label in sector */ + +#define DISKMAGIC ((u_long) 0x82564557) /* The disk magic number */ +#define MAXPARTITIONS 8 + +/* + * 2.11BSD's disklabels are different than 4.4BSD for a couple reasons: + * + * 1) D space is precious in the 2.11 kernel. Many of the fields do + * not need to be 'long' (or even a 'short'), a 'short' (or 'char') + * is more than adequate. If anyone ever ports the FFS to a PDP11 + * changing the label format will be the least of the problems. + * + * 2) There is no need to support a bootblock more than 512 bytes long. + * The hardware (disk bootroms) only read the first sector, thus the + * label is always at sector 1 (the second half of the first file- + * system block). + * + * Almost all of the fields have been retained but with reduced sizes. + * This is for future expansion and to ease the porting of the various + * utilities which use the disklabel structure. The 2.11 kernel uses + * very little other than the partition tables. Indeed only the + * partition tables are resident in the kernel address space, the actual + * label block is allocated external to the kernel and mapped in as + * needed. +*/ + +struct disklabel { + u_long d_magic; /* the magic number */ + u_char d_type; /* drive type */ + u_char d_subtype; /* controller/d_type specific */ + char d_typename[16]; /* type name, e.g. "eagle" */ + /* + * d_packname contains the pack identifier and is returned when + * the disklabel is read off the disk or in-core copy. + * d_boot0 is the (optional) name of the primary (block 0) bootstrap + * as found in /mdec. This is returned when using + * getdiskbyname(3) to retrieve the values from /etc/disktab. + */ +#if defined(KERNEL) || defined(STANDALONE) + char d_packname[16]; /* pack identifier */ +#else + union { + char un_d_packname[16]; /* pack identifier */ + char *un_d_boot0; /* primary bootstrap name */ + } d_un; +#define d_packname d_un.un_d_packname +#define d_boot0 d_un.un_d_boot0 +#endif /* ! KERNEL or STANDALONE */ + /* disk geometry: */ + u_short d_secsize; /* # of bytes per sector */ + u_short d_nsectors; /* # of data sectors per track */ + u_short d_ntracks; /* # of tracks per cylinder */ + u_short d_ncylinders; /* # of data cylinders per unit */ + u_short d_secpercyl; /* # of data sectors per cylinder */ + u_long d_secperunit; /* # of data sectors per unit */ + /* + * Spares (bad sector replacements) below + * are not counted in d_nsectors or d_secpercyl. + * Spare sectors are assumed to be physical sectors + * which occupy space at the end of each track and/or cylinder. + */ + u_short d_sparespertrack; /* # of spare sectors per track */ + u_short d_sparespercyl; /* # of spare sectors per cylinder */ + /* + * Alternate cylinders include maintenance, replacement, + * configuration description areas, etc. + */ + u_short d_acylinders; /* # of alt. cylinders per unit */ + + /* hardware characteristics: */ + /* + * d_interleave, d_trackskew and d_cylskew describe perturbations + * in the media format used to compensate for a slow controller. + * Interleave is physical sector interleave, set up by the formatter + * or controller when formatting. When interleaving is in use, + * logically adjacent sectors are not physically contiguous, + * but instead are separated by some number of sectors. + * It is specified as the ratio of physical sectors traversed + * per logical sector. Thus an interleave of 1:1 implies contiguous + * layout, while 2:1 implies that logical sector 0 is separated + * by one sector from logical sector 1. + * d_trackskew is the offset of sector 0 on track N + * relative to sector 0 on track N-1 on the same cylinder. + * Finally, d_cylskew is the offset of sector 0 on cylinder N + * relative to sector 0 on cylinder N-1. + */ + u_short d_rpm; /* rotational speed */ + u_char d_interleave; /* hardware sector interleave */ + u_char d_trackskew; /* sector 0 skew, per track */ + u_char d_cylskew; /* sector 0 skew, per cylinder */ + u_char d_headswitch; /* head swith time, usec */ + u_short d_trkseek; /* track-to-track seek, msec */ + u_short d_flags; /* generic flags */ +#define NDDATA 5 + u_long d_drivedata[NDDATA]; /* drive-type specific information */ +#define NSPARE 5 + u_long d_spare[NSPARE]; /* reserved for future use */ + u_long d_magic2; /* the magic number (again) */ + u_short d_checksum; /* xor of data incl. partitions */ + + /* filesystem and partition information: */ + u_short d_npartitions; /* number of partitions in following */ + u_short d_bbsize; /* size of boot area at sn0, bytes */ + u_short d_sbsize; /* max size of fs superblock, bytes */ + struct partition { /* the partition table */ + u_long p_size; /* number of sectors in partition */ + u_long p_offset; /* starting sector */ + u_short p_fsize; /* filesystem basic fragment size */ + u_char p_fstype; /* filesystem type, see below */ + u_char p_frag; /* filesystem fragments per block */ + } d_partitions[MAXPARTITIONS]; /* actually may be more */ +}; + +/* d_type values: */ +#define DTYPE_SMD 1 /* SMD, XSMD; VAX hp/up */ +#define DTYPE_MSCP 2 /* MSCP */ +#define DTYPE_DEC 3 /* other DEC (rk, rl) */ +#define DTYPE_SCSI 4 /* SCSI */ +#define DTYPE_ESDI 5 /* ESDI interface */ +#define DTYPE_ST506 6 /* ST506 etc. */ +#define DTYPE_FLOPPY 7 /* floppy */ + +#ifdef DKTYPENAMES +static char *dktypenames[] = { + "unknown", + "SMD", + "MSCP", + "old DEC", + "SCSI", + "ESDI", + "ST506", + "floppy", + 0 +}; +#define DKMAXTYPES (sizeof(dktypenames) / sizeof(dktypenames[0]) - 1) +#endif + +/* + * Filesystem type and version. + * Used to interpret other filesystem-specific + * per-partition information. + */ +#define FS_UNUSED 0 /* unused */ +#define FS_SWAP 1 /* swap */ +#define FS_V6 2 /* Sixth Edition */ +#define FS_V7 3 /* Seventh Edition */ +#define FS_SYSV 4 /* System V */ +/* + * 2.11BSD uses type 5 filesystems even though block numbers are 4 bytes + * (rather than the packed 3 byte format) and the directory structure is + * that of 4.3BSD (long filenames). +*/ +#define FS_V71K 5 /* V7 with 1K blocks (4.1,2.9,2.11) */ +#define FS_V8 6 /* Eighth Edition, 4K blocks */ +#define FS_BSDFFS 7 /* 4.2BSD fast file system */ +#define FS_MSDOS 8 /* MSDOS file system */ +#define FS_BSDLFS 9 /* 4.4BSD log file system */ +#define FS_OTHER 10 /* in use, but unknown/unsupported */ +#define FS_HPFS 11 /* OS/2 high-performance filesystem */ +#define FS_ISO9660 12 /* ISO 9660, normally CD-ROM */ + +#ifdef DKTYPENAMES +static char *fstypenames[] = { + "unused", + "swap", + "Version 6", + "Version 7", + "System V", + "2.11BSD", + "Eighth Edition", + "4.2BSD", + "MSDOS", + "4.4LFS", + "unknown", + "HPFS", + "ISO9660", + 0 +}; +#define FSMAXTYPES (sizeof(fstypenames) / sizeof(fstypenames[0]) - 1) +#endif + +/* + * flags shared by various drives: + */ +#define D_REMOVABLE 0x01 /* removable media */ +#define D_ECC 0x02 /* supports ECC */ +#define D_BADSECT 0x04 /* supports bad sector forw. */ +#define D_RAMDISK 0x08 /* disk emulator */ + +/* + * Structure used to perform a format + * or other raw operation, returning data + * and/or register values. + * Register identification and format + * are device- and driver-dependent. + */ +struct format_op { + char *df_buf; + int df_count; /* value-result */ + daddr_t df_startblk; + int df_reg[8]; /* result */ +}; + +/* + * Structure used internally to retrieve + * information about a partition on a disk. + */ +struct partinfo { + struct disklabel *disklab; + struct partition *part; +}; + +/* + * Disk-specific ioctls. + */ + /* get and set disklabel; DIOCGPART used internally */ +#define DIOCGDINFO _IOR(d, 101, struct disklabel)/* get */ +#define DIOCSDINFO _IOW(d, 102, struct disklabel)/* set */ +#define DIOCWDINFO _IOW(d, 103, struct disklabel)/* set, update disk */ +#define DIOCGPART _IOW(d, 104, struct partinfo) /* get partition */ + +/* do format operation, read or write */ +#define DIOCRFORMAT _IOWR(d, 105, struct format_op) +#define DIOCWFORMAT _IOWR(d, 106, struct format_op) + +#define DIOCSSTEP _IOW(d, 107, int) /* set step rate */ +#define DIOCSRETRIES _IOW(d, 108, int) /* set # of retries */ +#define DIOCWLABEL _IOW(d, 109, int) /* write en/disable label */ + +#define DIOCSBAD _IOW(d, 110, struct dkbad) /* set kernel dkbad */ + +#ifndef KERNEL +struct disklabel *getdiskbyname(); +#endif +.fi +.SH SEE ALSO +.IR disklabel (8) diff --git a/bin/disklabel/disklabel.8 b/bin/disklabel/disklabel.8 new file mode 100644 index 0000000..77dade1 --- /dev/null +++ b/bin/disklabel/disklabel.8 @@ -0,0 +1,340 @@ +.\" Copyright (c) 1987, 1988, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Symmetric Computer Systems. +.\" +.\" 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. +.\" +.\" @(#)disklabel.8 8.2.1 (2.11BSD) 1995/04/21 +.\" +.TH DISKLABEL 8 "April 21, 1995" +.UC 2 +.SH NAME +disklabel \- read and write disk pack label +.SH SYNOPSIS +.B disklabel \-r +.IR disk +.br +.B disklabel \-w +[ +.B \-r +] +.IR disk +.IR disktype +[ +.IR packid +] +.br +.B disklabel \-e +[ +.B \-r +] +.IR disk +.br +.B disklabel \-R +[ +.B \-r +] +.IR disk +.IR protofile +.br +.B disklabel +[ +.B \-NW +] +.IR disk +.sp +.B disklabel \-B +[ +.B \-b +.IR boot +] +.IR disk +[ +.IR disktype +] +.br +.B disklabel \-w \-B +[ +.B \-b +.IR boot +] +.IR disk +.IR disktype +[ +.IR packid +] +.br +.B disklabel \-R \-B +[ +.B \-b +.IR boot +] +.IR disk +.IR protofile +[ +.IR disktype +] +.SH DESCRIPTION +.B Disklabel +can be used to install, examine or modify the label on a disk drive or pack. +When writing the label, it can be used +to change the drive identification, +the disk partitions on the drive, +or to replace a damaged label. +On some systems, +.B disklabel +can be used to install bootstrap code as well. +There are several forms of the command that read (display), install or edit +the label on a disk. +Each form has an additional option, +\fB\-r\fP, +which causes the label to be read from or written to the disk directly, +rather than going through the system's in-core copy of the label. +This option may allow a label to be installed on a disk +without kernel support for a label, such as when labels are first installed +on a system; it must be used when first installing a label on a disk. +The specific effect of +.B \-r +is described under each command. +The read and install forms also support the +.B \-B +option to install bootstrap code. +These variants are described later. +.PP +The first form of the command (read) is used to examine the label on the named +disk drive (e.g. ra0 or /dev/rra0a). +It will display all of the parameters associated with the drive +and its partition layout. +Unless the +.B \-r +flag is given, +the kernel's in-core copy of the label is displayed; +if the disk has no label, or the partition types on the disk are incorrect, +the kernel may have constructed or modified the label. +If the +.B \-r +flag is given, the label from the raw disk will be displayed rather +than the in-core label. +.PP +The second form of the command, with the +.B \-w +flag, is used to write a standard label on the designated drive. +The required arguments to +.B disklabel +are the drive to be labelled (e.g. sd0), and +the drive type as described in the +.IR disktab (5) +file. +The drive parameters and partitions are taken from that file. +If different disks of the same physical type are to have different +partitions, it will be necessary to have separate disktab entries +describing each, or to edit the label after installation as described below. +The optional argument is a pack identification string, +up to 16 characters long. +The pack id must be quoted if it contains blanks. +If the +.B \-r +flag is given, the disk sectors containing the label and bootstrap +will be written directly. +A side-effect of this is that any existing bootstrap code will be overwritten +and the disk rendered unbootable. +If +.B \-r +is not specified, +the existing label will be updated via the in-core copy and any bootstrap +code will be unaffected. +If the disk does not already have a label, the +.B \-r +flag must be used. +In either case, the kernel's in-core label is replaced. +.PP +An existing disk label may be edited by using the +.B \-e +flag. +The label is read from the in-core kernel copy, +or directly from the disk if the +.B \-r +flag is also given. +The label is formatted and then supplied to an editor for changes. +If no editor is specified in an +.B EDITOR +environment variable, +.IR vi (1) +is used. +When the editor terminates, the formatted label is reread +and used to rewrite the disk label. +Existing bootstrap code is unchanged regardless of whether +.B \-r +was specified. +.PP +With the +.B \-R +flag, +.B disklabel +is capable of restoring a disk label that was formatted +in a prior operation and saved in an ascii file. +The prototype file used to create the label should be in the same format +as that produced when reading or editing a label. +Comments are delimited by +.IR \&# +and newline. +As with +.B \-w , +any existing bootstrap code will be clobbered if +.B \-r +is specified and will be unaffected otherwise. +.PP +The +.B \-NW +flags for +.B disklabel +explicitly disallow and +allow, respectively, writing of the pack label area on the selected disk. +.PP +The final three forms of +.B disklabel +are used to install bootstrap code on machines where the bootstrap is part +of the label. +The bootstrap code is comprised of one or two boot programs depending on +the machine. +The +.B \-B +option is used to denote that bootstrap code is to be installed. +The +.B \-r +flag is implied by +.B \-B +and never needs to be specified. +The name of the boot program(s) to be installed can be selected in a +variety of ways. +First, the names can be specified explicitly via the +.B \-b +flag. +If the name is not explicitly given, standard boot blocks will be used. +The boot programs are located in +.IR /mdec . +The names of the program is taken from the ``b0'' parameter +of the +.IR disktab (5) +entry for the disk if +.I disktype +was given and its disktab entry exists and includes that parameter. +Otherwise, the boot program name is derived from the name of the disk. +These name is of the form +\fIbasename\fPuboot +; +for example, +.I /usr/mdec/rauboot +if the disk device is +.IR ra0 . +.PP +The first of the three boot-installation forms is used to install +bootstrap code without changing the existing label. +It is essentially a read command with respect to the disk label +itself and all options are related to the specification of the boot +program as described previously. +The final two forms are analogous to the basic write and restore versions +except that they will install bootstrap code in addition to a new label. +.SH FILES +/etc/disktab +.br +/mdec/\fIxx\fPuboot +.SH EXAMPLES +.in +0.5i +disklabel sd0 +.br +.in -0.5i +.PP +Display the in-core label for ra0 as obtained via +.IR /dev/rra0a . +.PP +.in +0.5i +disklabel \-w \-r /dev/rra0a ra81x foo +.br +.in -0.5i +.PP +Create a label for sd0 based on information for ``ra81x'' found in +.IR /etc/disktab . +Any existing bootstrap code will be clobbered. +.PP +.in +0.5i +disklabel -e -r ra0 +.in -0.5i +.PP +Read the on-disk label for ra0, edit it and reinstall in-core as well +as on-disk. +Existing bootstrap code is unaffected. +.PP +.in +0.5i +disklabel -R ra0 mylabel +.br +.in -0.5i +.PP +Restore the on-disk and in-core label for sd0 from information in +.IR mylabel . +Existing bootstrap code is unaffected. +.PP +.in +0.5i +disklabel -B ra0 +.br +.in -0.5i +.PP +Install a new bootstrap on ra0. +The boot code comes from +.IR /mdec/rauboot . +On-disk and in-core labels are unchanged. +.PP +.in +0.5i +disklabel -w -B /dev/rra0a -b newboot ra81x +.br +.in -0.5i +.PP +Install a new label and bootstrap. +The label is derived from disktab information for ``ra81x'' and +installed both in-core and on-disk. +The bootstrap code comes from the file +.IR /mdec/newboot . +.SH SEE ALSO +disktab(5), disklabel(5) +.SH DIAGNOSTICS +The kernel device drivers will not allow the size of a disk partition +to be decreased or the offset of a partition to be changed while it is open. +Some device drivers create a label containing only a single large partition +if a disk is unlabeled; thus, the label must be written to the ``a'' +partition of the disk while it is open. +This sometimes requires the desired label to be set in two steps, +the first one creating at least one other partition, +and the second setting the label on the new partition +while shrinking the ``a'' partition. +.SH BUGS +When a disk name is given without a full pathname, +the constructed device name uses the ``a'' partition on the tahoe and pdp\-11 +the ``c'' partition on all others. diff --git a/bin/disklabel/disklabel.c b/bin/disklabel/disklabel.c new file mode 100644 index 0000000..f2654ec --- /dev/null +++ b/bin/disklabel/disklabel.c @@ -0,0 +1,1143 @@ +/* + * Copyright (c) 1987, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Symmetric Computer Systems. + * + * 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. + */ + +#if !defined(lint) && defined(DOSCCS) +static char copyright[] = +"@(#) Copyright (c) 1987, 1993\n\ + The Regents of the University of California. All rights reserved.\n"; + +static char sccsid[] = "@(#)disklabel.c 8.1.3 (2.11BSD) 1999/10/25"; +/* from static char sccsid[] = "@(#)disklabel.c 1.2 (Symmetric) 11/28/85"; */ +#endif + +#include +#include +#include +#include +#include +#include +#define DKTYPENAMES +#include +#include +#include +#include +#include +#include +#include "pathnames.h" + +/* + * Disklabel: read and write disklabels. + * The label is usually placed on one of the first sectors of the disk. + * Many machines also place a bootstrap in the same area, + * in which case the label is embedded in the bootstrap. + * The bootstrap source must leave space at the proper offset + * for the label on such machines. + */ + +/* + * 2.11BSD has to do some things differently than other systems. BBSIZE + * may be 1024 bytes but the disk boot roms only read the 512 byte sector 0. + * The boot and label areas each occupy 1/2 of the 1kb 'filesystem block' + * which precedes the superblock. The bootblock is sector 0 and the label block + * is sector 1. Each is a disjoint and independent area. Thus the logic in + * this program which treated the label area as a subset or offset of the + * boot area had to change. + * + * The 'a' partition is used to access the raw device - as did the 'tahoe'. +*/ + +#define RAWPARTITION 'a' + +#define DEFEDITOR _PATH_VI +#define streq(a,b) (strcmp(a,b) == 0) + +char *dkname; +char *specname; +char tmpfil[] = _PATH_TMP; + +char namebuf[256], *np = namebuf; +struct disklabel lab; +struct disklabel *readlabel(), *makebootarea(); +char bootarea[BBSIZE]; /* 512 for bootblock, 512 for label */ + +int installboot; /* non-zero if we should install a boot program */ +char *xxboot; /* primary boot */ +char boot0[MAXPATHLEN]; + +enum { + UNSPEC, EDIT, NOWRITE, READ, RESTORE, WRITE, WRITEABLE, WRITEBOOT +} op = UNSPEC; + +int rflag; + +#ifdef DEBUG +int debug; +#define OPTIONS "BNRWb:derw" +#else +#define OPTIONS "BNRWb:erw" +#endif + +main(argc, argv) + int argc; + char *argv[]; +{ + register struct disklabel *lp; + FILE *t; + int ch, f, flag, error = 0; + char *name = 0; + + while ((ch = getopt(argc, argv, OPTIONS)) != EOF) + switch (ch) { + case 'B': + ++installboot; + break; + case 'b': + xxboot = optarg; + break; + case 'N': + if (op != UNSPEC) + usage(); + op = NOWRITE; + break; + case 'R': + if (op != UNSPEC) + usage(); + op = RESTORE; + break; + case 'W': + if (op != UNSPEC) + usage(); + op = WRITEABLE; + break; + case 'e': + if (op != UNSPEC) + usage(); + op = EDIT; + break; + case 'r': + ++rflag; + break; + case 'w': + if (op != UNSPEC) + usage(); + op = WRITE; + break; +#ifdef DEBUG + case 'd': + debug++; + break; +#endif + case '?': + default: + usage(); + } + argc -= optind; + argv += optind; + if (installboot) { + rflag++; + if (op == UNSPEC) + op = WRITEBOOT; + } else { + if (op == UNSPEC) + op = READ; + xxboot = 0; + } + + if (argc < 1) + usage(); + + dkname = argv[0]; + if (dkname[0] != '/') { + (void)sprintf(np, "%s/r%s%c", _PATH_DEV, dkname, RAWPARTITION); + specname = np; + np += strlen(specname) + 1; + } else + specname = dkname; + f = open(specname, op == READ ? O_RDONLY : O_RDWR); + if (f < 0 && errno == ENOENT && dkname[0] != '/') { + (void)sprintf(specname, "%s/r%s", _PATH_DEV, dkname); + np = namebuf + strlen(specname) + 1; + f = open(specname, op == READ ? O_RDONLY : O_RDWR); + } + if (f < 0) + Perror(specname); + + switch(op) { + + case EDIT: + if (argc != 1) + usage(); + lp = readlabel(f); + error = edit(lp, f); + break; + + case NOWRITE: + flag = 0; + if (ioctl(f, DIOCWLABEL, (char *)&flag) < 0) + Perror("ioctl DIOCWLABEL"); + break; + + case READ: + if (argc != 1) + usage(); + lp = readlabel(f); + display(stdout, lp); + error = checklabel(lp); + break; + + case RESTORE: + if (installboot && argc == 3) { + makelabel(argv[2], 0, &lab); + argc--; + } + if (argc != 2) + usage(); + lp = makebootarea(bootarea, &lab, f); + if (!(t = fopen(argv[1], "r"))) + Perror(argv[1]); + if (getasciilabel(t, lp)) + error = writelabel(f, bootarea, lp); + break; + + case WRITE: + if (argc == 3) { + name = argv[2]; + argc--; + } + if (argc != 2) + usage(); + makelabel(argv[1], name, &lab); + lp = makebootarea(bootarea, &lab, f); + *lp = lab; + if (checklabel(lp) == 0) + error = writelabel(f, bootarea, lp); + break; + + case WRITEABLE: + flag = 1; + if (ioctl(f, DIOCWLABEL, (char *)&flag) < 0) + Perror("ioctl DIOCWLABEL"); + break; + + case WRITEBOOT: + { + struct disklabel tlab; + + lp = readlabel(f); + tlab = *lp; + if (argc == 2) + makelabel(argv[1], 0, &lab); + lp = makebootarea(bootarea, &lab, f); + *lp = tlab; + if (checklabel(lp) == 0) + error = writelabel(f, bootarea, lp); + break; + } + } + exit(error); +} + +/* + * Construct a prototype disklabel from /etc/disktab. As a side + * effect, set the names of the primary and secondary boot files + * if specified. + */ +makelabel(type, name, lp) + char *type, *name; + register struct disklabel *lp; +{ + register struct disklabel *dp; + char *strcpy(); + + dp = getdiskbyname(type); + if (dp == NULL) { + fprintf(stderr, "%s: unknown disk type\n", type); + exit(1); + } + *lp = *dp; + + /* + * Set bootstrap name. + * 1. If set from command line, use it, + * 2. otherwise, check if disktab specifies it (b0), + * 3. otherwise, makebootarea() will choose one based on the name + * of the disk special file. E.g. /dev/ra0 -> rauboot + */ + if (!xxboot && lp->d_boot0) { + if (*lp->d_boot0 != '/') + (void)sprintf(boot0, "%s/%s", + _PATH_BOOTDIR, lp->d_boot0); + else + (void)strcpy(boot0, lp->d_boot0); + xxboot = boot0; + } + /* d_packname is union d_boot0, so zero */ + bzero(lp->d_packname, sizeof(lp->d_packname)); + if (name) + (void)strncpy(lp->d_packname, name, sizeof(lp->d_packname)); +} + +writelabel(f, boot, lp) + int f; + char *boot; + register struct disklabel *lp; +{ + register int i; + int flag; + + lp->d_magic = DISKMAGIC; + lp->d_magic2 = DISKMAGIC; + lp->d_checksum = 0; + lp->d_checksum = dkcksum(lp); + if (rflag) { + /* + * First set the kernel disk label, + * then write a label to the raw disk. + * If the SDINFO ioctl fails because it is unimplemented, + * keep going; otherwise, the kernel consistency checks + * may prevent us from changing the current (in-core) + * label. Normally EFAULT would not be here - but the ioctl + * maximum data length changed and old kernels would generate + * an error prematurely in the ioctl dispatch. + */ + if (ioctl(f, DIOCSDINFO, lp) < 0 && + errno != EFAULT && errno != ENODEV && errno != ENOTTY) { + l_perror("ioctl DIOCSDINFO"); + return (1); + } + (void)lseek(f, (off_t)0, L_SET); + /* + * write enable label sector before write (if necessary), + * disable after writing. + */ + flag = 1; + if (ioctl(f, DIOCWLABEL, &flag) < 0) + perror("ioctl DIOCWLABEL"); +/* + * Write the boot block sector (512 bytes) followed immediately by the + * label sector (512 bytes) = BBSIZE (1kb) total. +*/ + if (write(f, boot, BBSIZE) != BBSIZE) { + perror("write"); + return (1); + } + flag = 0; + (void) ioctl(f, DIOCWLABEL, &flag); + } else if (ioctl(f, DIOCWDINFO, lp) < 0) { + l_perror("ioctl DIOCWDINFO"); + return (1); + } + return (0); +} + +l_perror(s) + char *s; +{ + int saverrno = errno; + + fprintf(stderr, "disklabel: %s: ", s); + + switch (saverrno) { + + case ESRCH: + fprintf(stderr, "No disk label on disk;\n"); + fprintf(stderr, + "use \"disklabel -r\" to install initial label\n"); + break; + + case EINVAL: + fprintf(stderr, "Label magic number or checksum is wrong!\n"); + fprintf(stderr, "(disklabel or kernel is out of date?)\n"); + break; + + case EBUSY: + fprintf(stderr, "Open partition would move or shrink\n"); + break; + + case EXDEV: + fprintf(stderr, + "Labeled partition or 'a' partition must start at beginning of disk\n"); + break; + + default: + errno = saverrno; + perror((char *)NULL); + break; + } +} + +/* + * Fetch disklabel for disk. + * Use ioctl to get label unless -r flag is given. + * + * We use the search logic for the label even though the label will be + * in the second half of the bootarea. If there ever is a valid label + * residing in the boot sector things are going to get weird. + */ +struct disklabel * +readlabel(f) + int f; +{ + register struct disklabel *lp; +register struct disklabel *xx = (struct disklabel *)(bootarea + BBSIZE - sizeof (struct disklabel)); + + if (rflag) { + if (lseek(f, (daddr_t)0, L_SET) < 0) + Perror(specname); + if (read(f, bootarea, BBSIZE) < BBSIZE) + Perror(specname); + for (lp = (struct disklabel *)bootarea; + lp <= xx; + lp = (struct disklabel *)((char *)lp + 16)) + if (lp->d_magic == DISKMAGIC && + lp->d_magic2 == DISKMAGIC) + break; + if (lp > xx || + lp->d_magic != DISKMAGIC || lp->d_magic2 != DISKMAGIC || + dkcksum(lp) != 0) { + fprintf(stderr, + "Bad pack magic number (label is damaged, or pack is unlabeled)\n"); + exit (1); + } + } else { + lp = &lab; + if (ioctl(f, DIOCGDINFO, lp) < 0) + Perror("ioctl DIOCGDINFO"); + } + return (lp); +} + +/* + * Construct a bootarea (d_bbsize bytes) in the specified buffer ``boot'' + * Returns a pointer to the disklabel portion of the bootarea. + */ +struct disklabel * +makebootarea(boot, dp, f) + char *boot; + register struct disklabel *dp; + int f; +{ + struct disklabel *lp; + register char *p; + int b; + char *dkbasename; + struct stat sb; + + /* XXX */ + /* + * sectors are 512 bytes, filesystem blocks are DEV_BSIZE (1024) bytes. + * We override the sector size so that things like the RL02 work + * right. The RL drives use a hardware sector size of 256 bytes + * which would wreck havoc in the calculation below. Actually the + * disktab file should be "fixed" - all entries should omit 'se' and + * use the default of 512. + */ + dp->d_secsize = 512; + dp->d_bbsize = 512; + lp = (struct disklabel *) + (boot + (LABELSECTOR * dp->d_secsize) + LABELOFFSET); + bzero((char *)lp, sizeof *lp); + + /* + * If we are not installing a boot program but we are installing a + * label on disk then we must read the current bootarea so we don't + * clobber the existing boot. + */ + if (!installboot) { + if (rflag) { + if (lseek(f, (daddr_t)0, L_SET) < 0) + Perror(specname); + if (read(f, boot, BBSIZE) < BBSIZE) + Perror(specname); + bzero((char *)lp, sizeof *lp); + } + return (lp); + } + /* + * We are installing a boot program. Determine the name(s) and + * read them into the appropriate places in the boot area. + */ + if (!xxboot) { + dkbasename = np; + if ((p = rindex(dkname, '/')) == NULL) + p = dkname; + else + p++; + while (*p && !isdigit(*p)) + *np++ = *p++; + *np++ = '\0'; + + (void)sprintf(np, "%s/%suboot", + _PATH_BOOTDIR, dkbasename); + if (access(np, F_OK) < 0 && dkbasename[0] == 'r') + dkbasename++; + xxboot = np; + (void)sprintf(xxboot, "%s/%suboot", + _PATH_BOOTDIR, dkbasename); + np += strlen(xxboot) + 1; + } +#ifdef DEBUG + if (debug) + fprintf(stderr, "bootstrap: xxboot = %s\n", xxboot); +#endif + + /* + * Rule: + * 1. One-piece bootstrap up to 512 bytes is all that is supported. + */ + b = open(xxboot, O_RDONLY); + if (b < 0) + Perror(xxboot); + if (read(b, boot, 512) < 0) + Perror(xxboot); + (void)fstat(b, &sb); + if (sb.st_size > 512) + Warning("boot > 512 bytes - filesystem likely not bootable"); + (void)close(b); + return (lp); +} + +display(f, lp) + FILE *f; + register struct disklabel *lp; +{ + register int i, j; + register struct partition *pp; + + fprintf(f, "# %s:\n", specname); + if ((unsigned) lp->d_type < DKMAXTYPES) + fprintf(f, "type: %s\n", dktypenames[lp->d_type]); + else + fprintf(f, "type: %d\n", lp->d_type); + fprintf(f, "disk: %.*s\n", sizeof(lp->d_typename), lp->d_typename); + fprintf(f, "label: %.*s\n", sizeof(lp->d_packname), lp->d_packname); + fprintf(f, "flags:"); + if (lp->d_flags & D_REMOVABLE) + fprintf(f, " removeable"); + if (lp->d_flags & D_ECC) + fprintf(f, " ecc"); + if (lp->d_flags & D_BADSECT) + fprintf(f, " badsect"); + fprintf(f, "\n"); + fprintf(f, "bytes/sector: %d\n", lp->d_secsize); + fprintf(f, "sectors/track: %d\n", lp->d_nsectors); + fprintf(f, "tracks/cylinder: %d\n", lp->d_ntracks); + fprintf(f, "sectors/cylinder: %d\n", lp->d_secpercyl); + fprintf(f, "cylinders: %d\n", lp->d_ncylinders); + fprintf(f, "rpm: %d\n", lp->d_rpm); + fprintf(f, "interleave: %d\n", lp->d_interleave); + fprintf(f, "trackskew: %d\n", lp->d_trackskew); + fprintf(f, "cylinderskew: %d\n", lp->d_cylskew); + fprintf(f, "headswitch: %d\t\t# milliseconds\n", lp->d_headswitch); + fprintf(f, "track-to-track seek: %d\t# milliseconds\n", lp->d_trkseek); + fprintf(f, "drivedata: "); + for (i = NDDATA - 1; i >= 0; i--) + if (lp->d_drivedata[i]) + break; + if (i < 0) + i = 0; + for (j = 0; j <= i; j++) + fprintf(f, "%ld ", lp->d_drivedata[j]); + fprintf(f, "\n\n%d partitions:\n", lp->d_npartitions); + fprintf(f, + "# size offset fstype [fsize bsize]\n"); + pp = lp->d_partitions; + for (i = 0; i < lp->d_npartitions; i++, pp++) { + if (pp->p_size) { + fprintf(f, " %c: %8ld %8ld ", 'a' + i, + pp->p_size, pp->p_offset); + if ((unsigned) pp->p_fstype < FSMAXTYPES) + fprintf(f, "%8.8s", fstypenames[pp->p_fstype]); + else + fprintf(f, "%8d", pp->p_fstype); + switch (pp->p_fstype) { + + case FS_V71K: + case FS_UNUSED: /* XXX */ + fprintf(f, " %5d %5d ", + pp->p_fsize, pp->p_fsize * pp->p_frag); + break; + + default: + fprintf(f, "%20.20s", ""); + break; + } + fprintf(f, "\t# (Cyl. %4ld", + pp->p_offset / lp->d_secpercyl); + if (pp->p_offset % lp->d_secpercyl) + putc('*', f); + else + putc(' ', f); + fprintf(f, "- %ld", + (pp->p_offset + + pp->p_size + lp->d_secpercyl - 1) / + lp->d_secpercyl - 1); + if (pp->p_size % lp->d_secpercyl) + putc('*', f); + fprintf(f, ")\n"); + } + } + fflush(f); +} + +edit(lp, f) + struct disklabel *lp; + int f; +{ + register int c; + struct disklabel label; + FILE *fd; + char *mktemp(); + + (void) mktemp(tmpfil); + fd = fopen(tmpfil, "w"); + if (fd == NULL) { + fprintf(stderr, "%s: Can't create\n", tmpfil); + return (1); + } + (void)fchmod(fileno(fd), 0600); + display(fd, lp); + fclose(fd); + for (;;) { + if (!editit()) + break; + fd = fopen(tmpfil, "r"); + if (fd == NULL) { + fprintf(stderr, "%s: Can't reopen for reading\n", + tmpfil); + break; + } + bzero((char *)&label, sizeof(label)); + if (getasciilabel(fd, &label)) { + *lp = label; + if (writelabel(f, bootarea, lp) == 0) { + (void) unlink(tmpfil); + return (0); + } + } + printf("re-edit the label? [y]: "); fflush(stdout); + c = getchar(); + if (c != EOF && c != (int)'\n') + while (getchar() != (int)'\n') + ; + if (c == (int)'n') + break; + } + (void) unlink(tmpfil); + return (1); +} + +editit() +{ + register int pid, xpid; + int stat; + sigset_t set, oset; + + sigemptyset(&set); + sigaddset(&set, SIGINT); + sigaddset(&set, SIGHUP); + sigaddset(&set, SIGQUIT); + (void)sigprocmask(SIG_BLOCK, &set, &oset); + while ((pid = fork()) < 0) { + + if (errno == EPROCLIM) { + fprintf(stderr, "You have too many processes\n"); + return(0); + } + if (errno != EAGAIN) { + perror("fork"); + return(0); + } + sleep(1); + } + if (pid == 0) { + register char *ed; + + (void)sigprocmask(SIG_SETMASK, &oset, NULL); + setgid(getgid()); + setuid(getuid()); + if ((ed = getenv("EDITOR")) == (char *)0) + ed = DEFEDITOR; + execlp(ed, ed, tmpfil, 0); + perror(ed); + exit(1); + } + while ((xpid = wait(&stat)) >= 0) + if (xpid == pid) + break; + (void)sigprocmask(SIG_SETMASK, &oset, NULL); + return(!stat); +} + +char * +skip(cp) + register char *cp; +{ + + while (*cp != '\0' && isspace(*cp)) + cp++; + if (*cp == '\0' || *cp == '#') + return ((char *)NULL); + return (cp); +} + +char * +word(cp) + register char *cp; +{ + register char c; + + while (*cp != '\0' && !isspace(*cp) && *cp != '#') + cp++; + if ((c = *cp) != '\0') { + *cp++ = '\0'; + if (c != '#') + return (skip(cp)); + } + return ((char *)NULL); +} + +/* + * Read an ascii label in from fd f, + * in the same format as that put out by display(), + * and fill in lp. + */ +getasciilabel(f, lp) + FILE *f; + register struct disklabel *lp; +{ + register char **cpp, *cp; + register struct partition *pp; + char *tp, *s, line[BUFSIZ]; + int lineno = 0, errors = 0; + long v; + + lp->d_bbsize = 512; /* XXX */ + lp->d_sbsize = SBSIZE; + while (fgets(line, sizeof(line) - 1, f)) { + lineno++; + if (cp = index(line,'\n')) + *cp = '\0'; + cp = skip(line); + if (cp == NULL) + continue; + tp = index(cp, ':'); + if (tp == NULL) { + fprintf(stderr, "line %d: syntax error\n", lineno); + errors++; + continue; + } + *tp++ = '\0', tp = skip(tp); + if (streq(cp, "type")) { + if (tp == NULL) + tp = "unknown"; + cpp = dktypenames; + for (; cpp < &dktypenames[DKMAXTYPES]; cpp++) + if ((s = *cpp) && streq(s, tp)) { + lp->d_type = cpp - dktypenames; + goto next; + } + v = atoi(tp); + if ((unsigned)v >= DKMAXTYPES) + fprintf(stderr, "line %d:%s %d\n", lineno, + "Warning, unknown disk type", v); + lp->d_type = v; + continue; + } + if (streq(cp, "flags")) { + for (v = 0; (cp = tp) && *cp != '\0';) { + tp = word(cp); + if (streq(cp, "removeable")) + v |= D_REMOVABLE; + else if (streq(cp, "ecc")) + v |= D_ECC; + else if (streq(cp, "badsect")) + v |= D_BADSECT; + else { + fprintf(stderr, + "line %d: %s: bad flag\n", + lineno, cp); + errors++; + } + } + lp->d_flags = v; + continue; + } + if (streq(cp, "drivedata")) { + register int i; + + for (i = 0; (cp = tp) && *cp != '\0' && i < NDDATA;) { + lp->d_drivedata[i++] = atol(cp); + tp = word(cp); + } + continue; + } + if (sscanf(cp, "%ld partitions", &v) == 1) { + if (v == 0 || (unsigned)v > MAXPARTITIONS) { + fprintf(stderr, + "line %d: bad # of partitions\n", lineno); + lp->d_npartitions = MAXPARTITIONS; + errors++; + } else + lp->d_npartitions = v; + continue; + } + if (tp == NULL) + tp = ""; + if (streq(cp, "disk")) { + strncpy(lp->d_typename, tp, sizeof (lp->d_typename)); + continue; + } + if (streq(cp, "label")) { + strncpy(lp->d_packname, tp, sizeof (lp->d_packname)); + continue; + } +/* + * ARGH! Have to fix the 'se#256' entries in disktab after all or this + * check will cause errors. +*/ + if (streq(cp, "bytes/sector")) { + v = atoi(tp); + if (v <= 0 || (v % 512) != 0) { + fprintf(stderr, + "line %d: %s: bad sector size\n", + lineno, tp); + errors++; + } else + lp->d_secsize = v; + continue; + } + if (streq(cp, "sectors/track")) { + v = atoi(tp); + if (v <= 0) { + fprintf(stderr, "line %d: %s: bad %s\n", + lineno, tp, cp); + errors++; + } else + lp->d_nsectors = v; + continue; + } + if (streq(cp, "sectors/cylinder")) { + v = atoi(tp); + if (v <= 0) { + fprintf(stderr, "line %d: %s: bad %s\n", + lineno, tp, cp); + errors++; + } else + lp->d_secpercyl = v; + continue; + } + if (streq(cp, "tracks/cylinder")) { + v = atoi(tp); + if (v <= 0) { + fprintf(stderr, "line %d: %s: bad %s\n", + lineno, tp, cp); + errors++; + } else + lp->d_ntracks = v; + continue; + } + if (streq(cp, "cylinders")) { + v = atoi(tp); + if (v <= 0) { + fprintf(stderr, "line %d: %s: bad %s\n", + lineno, tp, cp); + errors++; + } else + lp->d_ncylinders = v; + continue; + } + if (streq(cp, "rpm")) { + v = atoi(tp); + if (v <= 0) { + fprintf(stderr, "line %d: %s: bad %s\n", + lineno, tp, cp); + errors++; + } else + lp->d_rpm = v; + continue; + } + if (streq(cp, "interleave")) { + v = atoi(tp); + if (v <= 0) { + fprintf(stderr, "line %d: %s: bad %s\n", + lineno, tp, cp); + errors++; + } else + lp->d_interleave = v; + continue; + } + if (streq(cp, "trackskew")) { + v = atoi(tp); + if (v < 0) { + fprintf(stderr, "line %d: %s: bad %s\n", + lineno, tp, cp); + errors++; + } else + lp->d_trackskew = v; + continue; + } + if (streq(cp, "cylinderskew")) { + v = atoi(tp); + if (v < 0) { + fprintf(stderr, "line %d: %s: bad %s\n", + lineno, tp, cp); + errors++; + } else + lp->d_cylskew = v; + continue; + } + if (streq(cp, "headswitch")) { + v = atoi(tp); + if (v < 0) { + fprintf(stderr, "line %d: %s: bad %s\n", + lineno, tp, cp); + errors++; + } else + lp->d_headswitch = v; + continue; + } + if (streq(cp, "track-to-track seek")) { + v = atoi(tp); + if (v < 0) { + fprintf(stderr, "line %d: %s: bad %s\n", + lineno, tp, cp); + errors++; + } else + lp->d_trkseek = v; + continue; + } + if ('a' <= *cp && *cp <= 'z' && cp[1] == '\0') { + unsigned part = *cp - 'a'; + + if (part > lp->d_npartitions) { + fprintf(stderr, + "line %d: bad partition name '%c' %d %d\n", + lineno, *cp, part, lp->d_npartitions); + errors++; + continue; + } + pp = &lp->d_partitions[part]; +#define NXTNUM(n) { \ + cp = tp, tp = word(cp); \ + if (tp == NULL) \ + tp = cp; \ + (n) = atol(cp); \ + } + + NXTNUM(v); + if (v < 0) { + fprintf(stderr, + "line %d: %s: bad partition size\n", + lineno, cp); + errors++; + } else + pp->p_size = v; + NXTNUM(v); + if (v < 0) { + fprintf(stderr, + "line %d: %s: bad partition offset\n", + lineno, cp); + errors++; + } else + pp->p_offset = v; + cp = tp, tp = word(cp); + cpp = fstypenames; + for (; cpp < &fstypenames[FSMAXTYPES]; cpp++) + if ((s = *cpp) && streq(s, cp)) { + pp->p_fstype = cpp - fstypenames; + goto gottype; + } + if (isdigit(*cp)) + v = atoi(cp); + else + v = FSMAXTYPES; + if ((unsigned)v >= FSMAXTYPES) { + fprintf(stderr, "line %d: %s %s\n", lineno, + "Warning, unknown filesystem type", cp); + v = FS_UNUSED; + } + pp->p_fstype = v; + gottype: + + switch (pp->p_fstype) { + + case FS_UNUSED: /* XXX */ + case FS_V71K: + NXTNUM(pp->p_fsize); + if (pp->p_fsize == 0) + break; + NXTNUM(v); + pp->p_frag = v / pp->p_fsize; + break; + + default: + break; + } + continue; + } + fprintf(stderr, "line %d: %s: Unknown disklabel field\n", + lineno, cp); + errors++; + next: + ; + } + errors += checklabel(lp); + return (errors == 0); +} + +/* + * Check disklabel for errors and fill in + * derived fields according to supplied values. + */ +checklabel(lp) + register struct disklabel *lp; +{ + register struct partition *pp; + int i, errors = 0; + char part; + + if (lp->d_secsize == 0) { + fprintf(stderr, "sector size %d\n", lp->d_secsize); + return (1); + } + if (lp->d_nsectors == 0) { + fprintf(stderr, "sectors/track %d\n", lp->d_nsectors); + return (1); + } + if (lp->d_ntracks == 0) { + fprintf(stderr, "tracks/cylinder %d\n", lp->d_ntracks); + return (1); + } + if (lp->d_ncylinders == 0) { + fprintf(stderr, "cylinders/unit %d\n", lp->d_ncylinders); + errors++; + } + if (lp->d_rpm == 0) + Warning("revolutions/minute %d", lp->d_rpm); + if (lp->d_secpercyl == 0) + lp->d_secpercyl = lp->d_nsectors * lp->d_ntracks; + if (lp->d_secperunit == 0) + lp->d_secperunit = (long) lp->d_secpercyl * lp->d_ncylinders; + if (lp->d_bbsize == 0) { + fprintf(stderr, "boot block size %d\n", lp->d_bbsize); + errors++; + } else if (lp->d_bbsize % lp->d_secsize) + Warning("boot block size %% sector-size != 0"); + if (lp->d_sbsize == 0) { + fprintf(stderr, "super block size %d\n", lp->d_sbsize); + errors++; + } else if (lp->d_sbsize % lp->d_secsize) + Warning("super block size %% sector-size != 0"); + if (lp->d_npartitions > MAXPARTITIONS) + Warning("number of partitions (%d) > MAXPARTITIONS (%d)", + lp->d_npartitions, MAXPARTITIONS); + for (i = 0; i < lp->d_npartitions; i++) { + part = 'a' + i; + pp = &lp->d_partitions[i]; + if (pp->p_size == 0 && pp->p_offset != 0) + Warning("partition %c: size 0, but offset %ld", + part, pp->p_offset); +#ifdef notdef + if (pp->p_size % lp->d_secpercyl) + Warning("partition %c: size %% cylinder-size != 0", + part); + if (pp->p_offset % lp->d_secpercyl) + Warning("partition %c: offset %% cylinder-size != 0", + part); +#endif + if (pp->p_offset > lp->d_secperunit) { + fprintf(stderr, + "partition %c: offset past end of unit %ld %ld\n", + part, pp->p_offset, lp->d_secperunit); + errors++; + } + if (pp->p_offset + pp->p_size > lp->d_secperunit) { + fprintf(stderr, + "partition %c: extends past end of unit %ld %ld %ld\n", + part, pp->p_offset, pp->p_size, lp->d_secperunit); + errors++; + } + } + for (; i < MAXPARTITIONS; i++) { + part = 'a' + i; + pp = &lp->d_partitions[i]; + if (pp->p_size || pp->p_offset) + Warning("unused partition %c: size %ld offset %ld", + 'a' + i, pp->p_size, pp->p_offset); + } + return (errors); +} + +/*VARARGS1*/ +Warning(fmt, a1, a2, a3, a4, a5) + char *fmt; +{ + + fprintf(stderr, "Warning, "); + fprintf(stderr, fmt, a1, a2, a3, a4, a5); + fprintf(stderr, "\n"); +} + +Perror(str) + char *str; +{ + fputs("disklabel: ", stderr); perror(str); + exit(4); +} + +usage() +{ + fprintf(stderr, +"%s\n\t%s\n%s\n\t%s\n%s\n\t%s\n%s\n\t%s\n%s\n\t%s\n%s\n\t%s\n%s\n\t%s\n%s\n\t%s\n", +"usage: disklabel [-r] disk", + "(to read label)", +"or disklabel -w [-r] disk type [ packid ]", + "(to write label with existing boot program)", +"or disklabel -e [-r] disk", + "(to edit label)", +"or disklabel -R [-r] disk protofile", + "(to restore label with existing boot program)", +"or disklabel -B [ -b bootprog ] disk [ type ]", + "(to install boot program with existing on-disk label)", +"or disklabel -w -B [ -b bootprog ] disk type [ packid ]", + "(to write label and install boot program)", +"or disklabel -R -B [ -b bootprog ] disk protofile [ type ]", + "(to restore label and install boot program)", +"or disklabel [-NW] disk", + "(to write disable/enable label)"); + exit(1); +} diff --git a/bin/disklabel/pathnames.h b/bin/disklabel/pathnames.h new file mode 100644 index 0000000..65b1cc4 --- /dev/null +++ b/bin/disklabel/pathnames.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. 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. + * + * @(#)pathnames.h 8.1.1 (2.11BSD) 4/10/95 + */ + +#include + +#define _PATH_BOOTDIR "/mdec" +#undef _PATH_TMP +#define _PATH_TMP "/tmp/EdDk.aXXXXXX" diff --git a/bin/du.c b/bin/du.c new file mode 100644 index 0000000..a333d49 --- /dev/null +++ b/bin/du.c @@ -0,0 +1,162 @@ +#ifndef lint +static char *sccsid = "@(#)du.c 4.11 (Berkeley) 7/1/83"; +#endif + +#include +#include +#include +#include + +char path[BUFSIZ], name[BUFSIZ]; +int aflg; +int sflg; +char *dot = "."; + +#define ML 1000 +struct { + int dev; + ino_t ino; +} ml[ML]; +int mlx; + +long descend(); +char *index(), *rindex(), *strcpy(), *sprintf(); + +#define kb(n) (howmany(dbtob(n), 1024)) + +main(argc, argv) + int argc; + char **argv; +{ + long blocks = 0; + register char *np; + int pid; + + argc--, argv++; +again: + if (argc && !strcmp(*argv, "-s")) { + sflg++; + argc--, argv++; + goto again; + } + if (argc && !strcmp(*argv, "-a")) { + aflg++; + argc--, argv++; + goto again; + } + if (argc == 0) { + argv = ˙ + argc = 1; + } + do { + if (argc > 1) { + pid = fork(); + if (pid == -1) { + fprintf(stderr, "No more processes.\n"); + exit(1); + } + if (pid != 0) + wait((int *)0); + } + if (argc == 1 || pid == 0) { + (void) strcpy(path, *argv); + (void) strcpy(name, *argv); + if (np = rindex(name, '/')) { + *np++ = '\0'; + if (chdir(*name ? name : "/") < 0) { + perror(*name ? name : "/"); + exit(1); + } + } else + np = path; + blocks = descend(path, *np ? np : "."); + if (sflg) + printf("%ld\t%s\n", kb(blocks), path); + if (argc > 1) + exit(1); + } + argc--, argv++; + } while (argc > 0); + exit(0); +} + +DIR *dirp = NULL; + +long +descend(base, name) + char *base, *name; +{ + char *ebase0, *ebase; + struct stat stb; + int i; + long blocks = 0; + long curoff = NULL; + register struct direct *dp; + + ebase0 = ebase = index(base, 0); + if (ebase > base && ebase[-1] == '/') + ebase--; + if (lstat(name, &stb) < 0) { + perror(base); + *ebase0 = 0; + return (0); + } + if (stb.st_nlink > 1 && (stb.st_mode&S_IFMT) != S_IFDIR) { + for (i = 0; i <= mlx; i++) + if (ml[i].ino == stb.st_ino && ml[i].dev == stb.st_dev) + return (0); + if (mlx < ML) { + ml[mlx].dev = stb.st_dev; + ml[mlx].ino = stb.st_ino; + mlx++; + } + } + blocks = stb.st_blocks; + if ((stb.st_mode&S_IFMT) != S_IFDIR) { + if (aflg) + printf("%ld\t%s\n", kb(blocks), base); + return (blocks); + } + if (dirp != NULL) + closedir(dirp); + dirp = opendir(name); + if (dirp == NULL) { + perror(base); + *ebase0 = 0; + return (0); + } + if (chdir(name) < 0) { + perror(base); + *ebase0 = 0; + closedir(dirp); + dirp = NULL; + return (0); + } + while (dp = readdir(dirp)) { + if (!strcmp(dp->d_name, ".") || !strcmp(dp->d_name, "..")) + continue; + (void) sprintf(ebase, "/%s", dp->d_name); + curoff = telldir(dirp); + blocks += descend(base, ebase+1); + *ebase = 0; + if (dirp == NULL) { + dirp = opendir("."); + if (dirp == NULL) { + perror("."); + return (0); + } + seekdir(dirp, curoff); + } + } + closedir(dirp); + dirp = NULL; + if (sflg == 0) + printf("%ld\t%s\n", kb(blocks), base); + if (chdir("..") < 0) { + (void) sprintf(index(base, 0), "/.."); + perror(base); + exit(1); + } + *ebase0 = 0; + return (blocks); +} diff --git a/bin/echo.c b/bin/echo.c new file mode 100644 index 0000000..d1f85b1 --- /dev/null +++ b/bin/echo.c @@ -0,0 +1,24 @@ +static char *sccsid = "@(#)echo.c 4.2 (Berkeley) 5/27/85"; +#include + +main(argc, argv) +int argc; +char *argv[]; +{ + register int i, nflg; + + nflg = 0; + if(argc > 1 && argv[1][0] == '-' && argv[1][1] == 'n' && !argv[1][2]) { + nflg++; + argc--; + argv++; + } + for(i=1; i +#include +#undef CEOF +#include +#define NULL 0 +#define FNSIZE 64 +#define LBSIZE 512 +#define ESIZE 128 +#define GBSIZE 256 +#define NBRA 5 +#define EOF -1 + +#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 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; + + } + argv++; + argc--; + } + + 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 '=': + 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 (a1dol) + 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) { + 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(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(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; + 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) { + blkio(iblock, ibuff, write); + } + ichanged = 0; + iblock = bno; + blkio(bno, ibuff, read); + return(ibuff+off); + } + if (oblock>=0) { + 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); + 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= &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= 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]=&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= 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; +} + diff --git a/bin/expr.y b/bin/expr.y new file mode 100644 index 0000000..4a080c5 --- /dev/null +++ b/bin/expr.y @@ -0,0 +1,670 @@ +/* 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 +#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; *operators[i]; ++i) + if(EQL(operators[i], p)) + return op[i]; + + yylval = p; + return A_STRING; +} + +char *rel(op, r1, r2) register char *r1, *r2; { + register long 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[ESIZE], 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); +} + +static char *sccsid = "@(#)expr.y 4.4 (Berkeley) 5/21/84"; +yyerror(s) + +{ + fprintf(stderr, "%s\n", s); + exit(2); +} diff --git a/bin/false.sh b/bin/false.sh new file mode 100644 index 0000000..379a4c9 --- /dev/null +++ b/bin/false.sh @@ -0,0 +1 @@ +exit 1 diff --git a/bin/grep.c b/bin/grep.c new file mode 100644 index 0000000..01d59e8 --- /dev/null +++ b/bin/grep.c @@ -0,0 +1,524 @@ +#ifndef lint +static char sccsid[] = "@(#)grep.c 4.6 (Berkeley) 5/14/84"; +#endif + +/* + * 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 +#include + +#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 CBRC 14 +#define CLET 15 +#define CBACK 18 + +#define STAR 01 + +#define LBSIZE BUFSIZ +#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 wflag; +int retcode = 0; +int circf; +int blkno; +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 'i': + case 'y': + yflag++; + continue; + + case 'w': + wflag++; + 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(retcode != 0 ? retcode : 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++; + } + if (wflag) + *ep++ = CBRC; + for (;;) { + if (ep >= &expbuf[ESIZE]) + goto cerror; + if ((c = *sp++) != '*') + lastep = ep; + switch (c) { + + case '\0': + if (wflag) + *ep++ = CLET; + *ep++ = CEOF; + return; + + case '.': + *ep++ = CDOT; + continue; + + case '*': + if (lastep==0 || *lastep==CBRA || *lastep==CKET || + *lastep == CBRC || *lastep == CLET) + 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++) == 0) + goto cerror; + if(c == '<') { + *ep++ = CBRC; + continue; + } + if(c == '>') { + *ep++ = CLET; + continue; + } + if(c == '(') { + 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) { + perror(file); + retcode = 2; + } + } + 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); + fflush(stdout); + } + 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); + + case CBRC: + if (lp == expbuf) + continue; +#define uletter(c) (isalpha(c) || (c) == '_') + if (uletter(*lp) || isdigit(*lp)) + if (!uletter(lp[-1]) && !isdigit(lp[-1])) + continue; + return (0); + + case CLET: + if (!uletter(*lp) && !isdigit(*lp)) + continue; + return (0); + + default: + errexit("grep RE botch\n", (char *)NULL); + } +} + +succeed(f) +char *f; +{ + nsucc = 1; + if (sflag) + return; + if (cflag) { + tln++; + return; + } + if (lflag) { + printf("%s\n", f); + fflush(stdout); + fseek(stdin, 0l, 2); + return; + } + if (nfile > 1 && hflag) + printf("%s:", f); + if (bflag) + printf("%u:", blkno); + if (nflag) + printf("%ld:", lnum); + printf("%s\n", linebuf); + fflush(stdout); +} + +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/bin/hostid.c b/bin/hostid.c new file mode 100644 index 0000000..dfe9058 --- /dev/null +++ b/bin/hostid.c @@ -0,0 +1,59 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if !defined(lint) && defined(DOSCCS) +char copyright[] = +"@(#) Copyright (c) 1983 Regents of the University of California.\n\ + All rights reserved.\n"; +static char sccsid[] = "@(#)hostid.c 1.3 (2.11BSD GTE) 96/7/10"; +#endif + +#include +#include +#include +#include +#include +#include +#include + +main(argc, argv) + int argc; + char **argv; +{ + register char *id; + u_long addr; + long hostid; + struct hostent *hp; + + if (argc < 2) { + printf("0x%lx\n", gethostid()); + exit(0); + } + + id = argv[1]; + if (hp = gethostbyname(id)) { + bcopy(hp->h_addr, &addr, sizeof(addr)); + hostid = addr; + } else if (index(id, '.')) { + if ((hostid = inet_addr(id)) == -1L) + usage(); + } else { + if (id[0] == '0' && (id[1] == 'x' || id[1] == 'X')) + id += 2; + if (sscanf(id, "%lx", &hostid) != 1) + usage(); + } + + if (sethostid(hostid) < 0) + err(1, "sethostid"); + exit(0); +} + +usage() + { + errx(1,"usage: [hexnum or internet name/address]"); +/* NOTREACHED */ + } diff --git a/bin/hostname/Makefile b/bin/hostname/Makefile new file mode 100644 index 0000000..3827f00 --- /dev/null +++ b/bin/hostname/Makefile @@ -0,0 +1,33 @@ +# +# Public Domain. 1995/03/13 - Steven Schultz +# +# @(#)Makefile 1.0 (2.11BSD GTE) 1995/03/13 +# +CFLAGS= -O +SEPFLAG= -i +SRCS= hostname.c +OBJS= hostname.o + +all: hostname hostname.0 + +hostname: ${OBJS} + ${CC} ${CFLAGS} ${SEPFLAG} -o $@ ${OBJS} + +hostname.0: hostname.1 + /usr/man/manroff hostname.1 > hostname.0 + +clean: + rm -f ${OBJS} tags hostname hostname.0 + +depend: ${SRCS} + mkdep ${CFLAGS} ${SRCS} + +install: all + install -s -o bin -g bin -m 755 hostname ${DESTDIR}/bin + install -c -o bin -g bin -m 444 hostname.0 ${DESTDIR}/usr/man/cat1 + +lint: ${SRCS} + lint -hax ${SRCS} + +tags: ${SRCS} + ctags ${SRCS} diff --git a/bin/hostname/hostname.1 b/bin/hostname/hostname.1 new file mode 100644 index 0000000..731d719 --- /dev/null +++ b/bin/hostname/hostname.1 @@ -0,0 +1,69 @@ +.\" Copyright (c) 1983, 1988, 1990, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)hostname.1 8.1 (Berkeley) 5/31/93 +.\" hostname.1,v 1.2 1994/09/24 02:55:40 davidg Exp +.\" hostname.1,v 1.2.1 29/1/95 Robin Birch +.\" +.TH HOSTNAME 1 "January 29, 1995" +.SH NAME +hostname \- set or print name of current host system +.SH SYNOPSIS +.B hostname +[ +.B \-s +] [ +.B nameofhost +] +.PP +.SH DESCRIPTION +.I Hostname +prints the name of the current host. The super-user can +set the hostname by supplying an argument; this is usually done in the +network initialization script +.I /etc/netstart , +normally run at boot +time. +.PP +Options: +.TP +.B \-\^s +Trims off any domain information from the printed +name. +.br +.sp +.SH SEE ALSO +gethostname(2), sethostname(2) +.SH HISTORY +The +.I hostname +command appeared in +BSD 4.2 . diff --git a/bin/hostname/hostname.c b/bin/hostname/hostname.c new file mode 100644 index 0000000..e02175c --- /dev/null +++ b/bin/hostname/hostname.c @@ -0,0 +1,86 @@ +/* + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. 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. + * + * hostname.c,v 1.2 1994/09/24 02:55:40 davidg Exp + */ + +#if defined(DOSCCS) & !defined(lint) +static char copyright[] = +"@(#) Copyright (c) 1988, 1993\n\ + The Regents of the University of California. All rights reserved.\n"; +#endif /* not lint */ + +#if defined(DOSCCS) & !defined(lint) +static char sccsid[] = "@(#)hostname.c 8.1.1 (R.Birch) 8/2/95"; +#endif /* not lint */ + +#include + +#include +#include + +int +main(argc,argv) + int argc; + char *argv[]; +{ + extern int optind; + int ch, sflag; + char *p, hostname[MAXHOSTNAMELEN]; + + sflag = 0; + while ((ch = getopt(argc, argv, "s")) != EOF) + switch (ch) { + case 's': + sflag = 1; + break; + case '?': + default: + (void)fprintf(stderr, + "usage: hostname [-s] [hostname]\n"); + exit(1); + } + argc -= optind; + argv += optind; + + if (*argv) { + if (sethostname(*argv, strlen(*argv))) + err(1, "sethostname"); + } else { + if (gethostname(hostname, sizeof(hostname))) + err(1, "gethostname"); + if (sflag && (p = strchr(hostname, '.'))) + *p = '\0'; + (void)printf("%s\n", hostname); + } + exit(0); +} diff --git a/bin/kill.c b/bin/kill.c new file mode 100644 index 0000000..10a72da --- /dev/null +++ b/bin/kill.c @@ -0,0 +1,74 @@ +static char *sccsid = "@(#)kill.c 4.4.1 (2.11BSD) 1996/3/21"; +/* + * kill - send signal to process + */ + +#include +#include + +char *signm[] = { 0, +"HUP", "INT", "QUIT", "ILL", "TRAP", "IOT", "EMT", "FPE", /* 1-8 */ +"KILL", "BUS", "SEGV", "SYS", "PIPE", "ALRM", "TERM", "URG", /* 9-16 */ +"STOP", "TSTP", "CONT", "CHLD", "TTIN", "TTOU", "IO", "XCPU", /* 17-24 */ +"XFSZ", "VTALRM", "PROF", "WINCH", 0, "USR1", "USR2", 0, /* 25-31 */ +}; + +main(argc, argv) +char **argv; +{ + register signo, pid, res; + int errlev; + extern errno; + + errlev = 0; + if (argc <= 1) { + usage: + printf("usage: kill [ -sig ] pid ...\n"); + printf("for a list of signals: kill -l\n"); + exit(2); + } + if (*argv[1] == '-') { + if (argv[1][1] == 'l') { + for (signo = 0; signo <= NSIG; signo++) { + if (signm[signo]) + printf("%s ", signm[signo]); + if (signo == 16) + printf("\n"); + } + printf("\n"); + exit(0); + } else if (isdigit(argv[1][1])) { + signo = atoi(argv[1]+1); + if (signo < 0 || signo > NSIG) { + printf("kill: %s: number out of range\n", + argv[1]); + exit(1); + } + } else { + char *name = argv[1]+1; + for (signo = 0; signo <= NSIG; signo++) + if (signm[signo] && !strcmp(signm[signo], name)) + goto foundsig; + printf("kill: %s: unknown signal; kill -l lists signals\n", name); + exit(1); +foundsig: + ; + } + argc--; + argv++; + } else + signo = SIGTERM; + argv++; + while (argc > 1) { + if (!(isdigit(**argv) || **argv == '-')) + goto usage; + res = kill(pid = atoi(*argv), signo); + if (res<0) { + printf("%u: %s\n", pid, strerror(errno)); + errlev = 1; + } + argc--; + argv++; + } + return(errlev); +} diff --git a/bin/ld/Makefile b/bin/ld/Makefile new file mode 100644 index 0000000..7e95042 --- /dev/null +++ b/bin/ld/Makefile @@ -0,0 +1,25 @@ +# Version 2.2 January 24, 1998 + +SRCS= ld.c +OBJS= ld.o +MAN= ld.0 +MANSRC= ld.1 +CFLAGS= -O -I../ar -DNUM_VM_PAGES=20 + +all: ld ld.0 + +ld: ${OBJS} + cc -i -o ld ${OBJS} -lvmf + +install: all + install -c -s -o bin -g bin -m 755 ld ${DESTDIR}/bin/ld + install -c -o bin -g bin -m 444 ${MAN} ${DESTDIR}/usr/man/cat1 + +lint: + lint -havx -I../ar ${SRCS} + +clean: + rm -f ${OBJS} ${MAN} ld + +${MAN}: ${MANSRC} + /usr/man/manroff ${MANSRC} > ${MAN} diff --git a/bin/ld/ld.1 b/bin/ld/ld.1 new file mode 100644 index 0000000..9535b38 --- /dev/null +++ b/bin/ld/ld.1 @@ -0,0 +1,334 @@ +.\" Copyright (c) 1980 Regents of the University of California. +.\" All rights reserved. The Berkeley software License Agreement +.\" specifies the terms and conditions for redistribution. +.\" +.\" @(#)ld.1 6.4 (2.11BSD GTE) 1995/05/08 +.\" +.TH LD 1 "May 08, 1995" +.UC 2 +.SH NAME +ld \- link editor (2BSD) +.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 (unless the \fB\-e\fP option is specified). +.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. +The first member of a library +should be a file named `\_\^\_.SYMDEF', +which is understood to be a dictionary for the library as produced by +.IR ranlib (1); +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 \-D +Take the next argument as a decimal number and pad the data segment +with zero bytes to the indicated length. +.TP +.B \-d +Force definition of common storage +even if the +.B \-r +flag is present. +.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 +.BI \-L dir +Add +.I dir +to the list of directories in which libraries are searched for. +Directories specified with +.B \-L +are searched before the standard directories. +.TP +.BI \-l x +This +option is an abbreviation for the library name +.RI `lib x .a', +where +.I x +is a string. +.I Ld +searches for libraries first in any directories +specified with +.B \-L +options, then in the standard directories `/lib', `/usr/lib', and +`/usr/local/lib'. +A library is searched when its name is encountered, +so the placement of a +.B \-l +is significant. +.TP +.B \-M +produce a primitive load map, listing the names of the files +which will be loaded. +.TP +.B \-n +Arrange (by giving the output file a 0410 "magic number") 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 8K byte boundary following the +end of the text. +This option creates a `pure executable' +format. +.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 text and data segments are in separate address spaces +and both start at location 0. +This option creates +a `separate executable' format. +.TP +.B \-z +This option is a synonym for the +.B \-i +option. On other systems (4.3BSD for example) the +.B \-z +option causes a demand paged executable to be built. This option +was added to 2.11BSD because some systems (those which use gcc) +do not safely ignore (with a warning) the +.B \-i +option. Adding the +.B \-z +option to 2.11BSD allows makefiles to be copied freely between multiple +platforms once again. +.TP +.B \-O +This is a text replacement overlay file; only the text segment +will be replaced by +.IR execve (2). +Shared data must have the same size as +the program overlaid, otherwise the +.IR execve (2) +will fail. +The entry point to the overlay may be defined with the +.B \-e +option. +This option allows the creation of a `replacement executable' +format. +.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 \-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. +(Note that this option cannot be used with overlays (\fB-Z\fP) +since they cannot be reloaded.) +.TP +.B \-s +`Strip' the output, that is, remove the symbol table +and relocation bits to save space (but impair the +usefulness of the debuggers). +This information can also be removed by +.IR strip (1). +.TP +.B \-q +("quiet") Suppress the reporting of undefined symbols. Normally only +used when building networked kernels \- the large number of undefined +symbols is normal (due to the three phase link proceedure) but can be +distracting none the less. +.TP +.B \-t +("trace") Print the name of each file as it is processed. +.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 +.B \-v +("verbose") Print the VM statistics. Printing out the number of +pages swapped to and from the VM tmp file is now optional and only +used when a problem is suspected (or if you are voyeuristic). +.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 \-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. +It also allows +temporary labels to be discarded to prevent redefinition in +sucessive \fBld\fP's. +Warning: \fIadb\fP uses these local symbols, +especially when debugging overlaid programs, +so some debugging information is necessarily lost if this option is used. +.TP +.B \-Z +Indicate the creation of an automatic-overlay format. In addition a +.B \-i +or +.B \-n +must be present as overlays only work with shared text objects. Repeated +instances of +.B -Z +bracket the modules that will be loaded into a given overlay. Modules before +the first +.B \-Z +or after the concluding +.B \-Y +will be loaded into the non-overlaid text (base) area. Note that there may be +a maximum of NOVL (currently 15) overlays. This option produces the `overlaid +pure executable' and the `overlaid separate executable' formats. The loader +creates a small entry interface in the base segment for each subroutine in an +overlay. This interface ("thunk") arranges for the correct overlay to be +present before the actual routine is entered. +.TP +.B \-Y +Terminate text overlays. This allows any remaining modules or libraries to be +loaded into the base area. Note that the +.B \-Y +option used to be +.IR \-L , +but had to be changed when the loader was brought up to date with the +.I 4.3BSD +loader which uses +.I -L +to indicate a directory to be searched for library references. +.SH "AUTOMATIC TEXT OVERLAY EXAMPLE" +To set up an automatic text overlay object with the loader, use a command of +the form: +.IP +.nf +\fBld \-n \-X\fP /lib/crt0.o base.o base2.o +\fB\-Z\fP ov1a.o ov1b.o ... +\fB\-Z\fP ov2a.o ov2b.o ... +... +\fB\-Y\fP base3.o ... \-lovc +.fi +.PP +Assembly source code must be compiled using the assembler overlay flags: +\*(lq\fIas \-V\fP prog.s\*(rq which causes the assembler to leave certain +symbols unresolved so that +.I ld +may rearrange them. The various system compilers automatically use this +option. +.PP +When arranging modules into overlays, the following rules control the maximum +sizes for an executable file. The magic numbers are due to the granularity of +PDP-11 segmentation registers (there are 8 registers, each controlling an +8192-byte segment). The program is made up of four areas: base text, overlay +text, data + bss, and stack sections. The size of the overlay section is +controlled by the size of the largest of the overlays. Each section starts at +an address that is a multiple of 8Kb, thus the size of each section is rounded +up to a multiple of 8Kb. +.PP +In the case of separate overlaid executable files, the text and overlays share +one 64Kb byte address space; and the data + bss and stack share the other. +Thus, the total of the base text size (rounded up to an 8Kb boundary) plus the +maximum overlay size (similarly rounded) must be less than or equal to 64Kb. +Or, put another way, since there are only 8 segmentation registers available, +the number of segmentation registers needed for an overlaid object must be +less than or equal to 8. As an example, if the base text segment has 36800 +bytes and the largest overlay takes 14144, the base will fit in 5 segments and +the overlays in 2 segments; leaving one to spare. The data and bss together +must fit in 7 segments (56K bytes), leaving one 8Kb segment for the stack. All +of the limits can be checked by using +.IR checkobj (1). +.PP +For pure overlaid programs, the rules are similar except that all four +sections share one 64K-byte address space. The number of segments required by +the text, overlay, data + bss and stack are calculated in the same way. The +sum of the segments required, including one for the stack, must be less than +or equal to 8. Example: a program has 8128 bytes of base text, the largest +overlay is 16248 bytes, and the data and bss total 19500. The text requires 1 +8Kb segment, the overlays 2, and data and bss use 4, leaving one for the stack. +.SH FILES +.ta \w'/usr/local/lib/lib*.a\ \ 'u +/lib/lib*.a libraries +.br +/usr/lib/lib*.a more libraries +.br +/usr/local/lib/lib*.a still more libraries +.br +a.out output file +.SH "SEE ALSO" +adb(1), ar(1), as(1), cc(1), checkobj(1), f77(1), file(1), ranlib(1), +size(1), a.out(5) +.SH BUGS +The text overlay scheme presented is unique to the PDP-11 and 2BSD. The +\-i, \-P, \-Z, \-Y options are specific to 2BSD. The \-q and \-v options +are new with 2.11BSD. diff --git a/bin/ld/ld.c b/bin/ld/ld.c new file mode 100644 index 0000000..ec98e5e --- /dev/null +++ b/bin/ld/ld.c @@ -0,0 +1,2135 @@ +#if defined(DOSCCS) && !defined(lint) +static char *sccsid = "@(#)ld.c 4.6 1998/01/19"; +#endif + +/* + * 4.6 1998/01/19 - Tim Shoppa (shoppa@triumf.ca) + * Minor bug fix: when tsize was being incremented by THUNKSZ, + * no check was being made for 16-bit overflow. Fix was to + * call add(). Same was done for the round up to the nearest + * 0100 on tsize. Modify add()'s error reporting to reduce memory + * usage - sms. + * + * 4.5 1997/10/31 - sms + * Minor cleanup. Use unistd.h and stdlib.h instead of local definitions. + * Correct comment about number of VM pages. + * + * 4.4 1995/05/08 - sms + * Add -q to turn off undefined symbol reporting. Used when building + * networking kernels and many undefineds are expected but look worrisome. + * Add -v to enable the VM statistics printout (now optional). + * + * 4.3 1/14/94 - sms + * Make the number of VM segments a compile time option in the Makefile. + * 4.2 1/2/94 - sms + * Fixed a couple serious bugs, one dealing with overlaid programs - the + * overlay header wasn't being written out, the second was a typographical + * error causing the relocation information to be wrong. + * + * 4.1 11/27/93 -sms + * Success at reading new style object files and libraries but the + * speed was abysmal. Logic added to attempt to hold string tables + * in memory when possible (less than 8kb) and to use a larger buffer + * when reading strings. Also, added a fifth i/o stream area for use + * by the library scanning routine 'ldrand' - this prevents the 'thrashing' + * between 'load1' and 'ldrand' (each of these was undoing the other's + * seek for a string). + * + * 4.0 11/1/93 - sms + * Previous versions not released. With 'ar' and 'ranlib' ported it + * is now 'ld's turn to be modified to support the new object file + * format. Major changes (and unfortunately another slip in speed). + * + * 3.0 9/15/93 - sms + * Implement a VM tmp file for the symbol table. + * + * 2.x 9/3/93 - sms@wlv.iipo.gtegsc.com + * Couple of major changes made in preparation for supporting long + * symbol names. 'ld' was approximately 1kb away from not running + * at all (due to data+bss exceeding 56kb). The first change + * made 'syshash' a bitmap saving 3.75kb. The next change involved + * modifying 'ldrand' so that the entire table of contents from a + * library did not have to fit in memory at once - this saved about + * 8kb. The last major change was a rewrite of the input subsystem + * making it faster and simpler. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "archive.h" + +/* + * Layout of standard part of a.out file header: + * u_int a_magic; magic number + * u_int a_text; text size ) + * u_int a_data; data size ) in bytes but even + * u_int a_bss; bss size ) + * u_int a_syms; symbol table size + * u_int a_entry; entry point + * u_int a_unused; (unused) + * u_int a_flag bit 0 set if no relocation + * + * Layout of overlaid part of a.out file header: + * int max_ovl; maximum overlay size + * u_int ov_siz[NOVL]; overlay sizes + * + * Non-overlaid offsets: + * header: 0 + * text: 16 + * data: 16 + a_text + * relocation: 16 + a_text + a_data + * + * If relocation info stripped: + * symbol table: 16 + a_text + a_data + * string table: 16 + a_text + a_data + a_syms + * else + * symbol table: 16 + 2 * (a_text + a_data) + * string table: 16 + 2 * (a_text + a_data) + a_syms + * + * Overlaid offsets: + * header: 0 + * overlay header: 16 + * text: 16 + 2 + 2*NOVL = 16 + 2 + 2*15 = 48 + * data: 48 + a_text + SUM(ov_siz) + * relocation: 48 + a_text + SUM(ov_siz) + a_data + * + * If relocation info stripped: + * symbol table: 48 + a_text + SUM(ov_siz) + a_data + * string table: symbol_table + a_syms + * else + * symbol table: 48 + 2 * (a_text + SUM(ov_siz) + a_data) + * string table: symbol_table + a_syms + * + * where SUM(ov_siz) is the sum of the overlays. + */ + +/* + * Do not set the following too high (normally set in the Makefile) or + * 'ld' will not be able to allocate room (currently 8kb) for string + * tables and performance will suffer badly. It is possible that this + * could be raised a bit higher but 20 gives 'adequate' performance on + * all but the largest ('tcsh' for example) programs, and even there it's + * not _too_ bad. +*/ +#ifndef NUM_VM_PAGES +#define NUM_VM_PAGES 20 +#endif +#define NNAMESIZE 32 /* Maximum symbol string length */ +#define SYMSPERSEG (BYTESPERSEG / sizeof (SYMBOL)) + +#define NSYM 2000 /* 1103 originally */ +#define NROUT 350 /* 256 originally */ +#define NSYMPR 800 /* 1000 originally */ + +#define N_COMM 05 /* internal use only; other values in a.out.h */ + +#define RABS 00 +#define RTEXT 02 +#define RDATA 04 +#define RBSS 06 +#define REXT 010 + +#define RELFLG 01 + +#define THUNKSIZ 8 + +/* + * one entry for each archive member referenced; + * set in first pass; needs restoring for overlays + */ +typedef struct { + long loc; + } LIBLIST; + + LIBLIST liblist[NROUT]; + LIBLIST *libp = liblist; + + typedef struct + { + union { + int *iptr; + char *cptr; + } ptr; + int bno; + int nibuf; + int nsize; + int nread; + int bsize; /* MUST be a power of 2 */ + int *buff; + } STREAM; +#define Iptr ptr.iptr +#define Cptr ptr.cptr + +#define TEXT 0 +#define RELOC 1 +#define SYMBOLS 2 +#define STRINGS 3 +#define STRINGS2 4 +#define NUM_IO_PLACES 5 + + STREAM Input[NUM_IO_PLACES]; + +/* + * Header from the a.out and the archive it is from (if any). + */ + struct xexec filhdr; + CHDR chdr; + +/* symbol management */ +typedef struct { + char n_name[NNAMESIZE]; + char n_type; + char n_ovly; + u_int n_value; + u_int sovalue; + } SYMBOL; + +#define SYMTAB ((VADDR)0) /* virtual base address of symbol table */ + u_short symhash[(NSYM+15)/16]; /* bitmap of hash table entries */ + short lastsym; /* index # of last symbol entered */ + short hshtab[NSYM+2]; /* hash table for symbols */ + short p_etext = -1, p_edata = -1, p_end = -1, entrypt = -1; + +struct xsymbol { + char n_name[NNAMESIZE]; + char n_type; + char n_ovly; + u_int n_value; + }; + + struct xsymbol cursym; /* current symbol */ + int nsym; /* pass2: number of local symbols */ + +struct local { + short locindex; /* index to symbol in file */ + short locsymbol; /* ptr to symbol table */ + }; + + struct local local[NSYMPR]; + short symindex; /* next available symbol table entry */ + +/* + * Options. + */ +int quiet; /* -q, suppress undefined error message */ +int trace; +int verbose; /* -v, emit VM statistics */ +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 Mflag; /* print rudimentary load map */ +int nflag; /* pure procedure */ +int Oflag; /* set magic # to 0405 (overlay) */ +int dflag; /* define common even with rflag */ +int iflag; /* I/D space separated */ + +/* + * These are the cumulative sizes, set in pass1, which + * appear in the a.out header when the loader is finished. + */ + u_int tsize, dsize, bsize; + long ssize, rnd8k(); + +/* + * Symbol relocation: + */ + u_int ctrel, cdrel, cbrel; + +/* + * The base addresses for the loaded text, data and bass from the + * current module during pass2 are given by torigin, dorigin and borigin. + */ + u_int torigin, dorigin, borigin; + +/* + * Errlev is nonzero when errors have occured. + * Delarg is an implicit argument to the routine delexit + * which is called on error. We do ``delarg = errlev'' before normal + * exits, and only if delarg is 0 (i.e. errlev was 0) do we make the + * result file executable. + */ + int errlev, delarg = 4; + + int ofilfnd; /* -o given; otherwise move l.out to a.out */ + char *ofilename = "l.out"; + int infil; /* current input file descriptor */ + char *filname; /* and its name */ + char tfname[] = "/tmp/ldaXXXXX"; + + FILE *toutb, *doutb, *troutb, *droutb, *soutb, *voutb; + + u_int torgwas; /* Saves torigin while doing overlays */ + u_int tsizwas; /* Saves tsize while doing overlays */ + int numov; /* Total number of overlays */ + int curov; /* Overlay being worked on just now */ + int inov; /* 1 if working on an overlay */ + +/* Kernel overlays have a special subroutine to do the switch */ + +struct xsymbol ovhndlr = + { "ovhndlr1", N_EXT+N_UNDF, 0, 0 }; +#define HNDLR_NUM 7 /* position of ov number in ovhndlr.n_name[] */ +u_int ovbase; /* The base address of the overlays */ + +#define NDIRS 25 +#define NDEFDIRS 3 /* number of default directories in dirs[] */ + char *dirs[NDIRS]; /* directories for library search */ + int ndir; /* number of directories */ + + struct vspace Vspace; /* The virtual address space for symbols */ + + short *lookup(), *slookup(), *lookloc(); + char *rstrtab; /* ranlib string table pointer */ + u_int add(); + int delexit(); + VADDR sym2va(); + off_t skip(); + +main(argc, argv) +char **argv; +{ + register int c, i; + int num; + register char *ap, **p; + char save; + +/* + * Initialize the hash table, indicating that all entries are unused. + * -1 is used as a "no symbol" flag. +*/ + memset(hshtab, -1, sizeof(hshtab)); + +/* + * Initialize the first three input buffers. The remaining two are + * left for later because it may be possible to hold the string table + * in memory and the input buffer won't be needed. +*/ + Input[TEXT].buff = (int *)malloc(512); + Input[TEXT].bsize = 512; + Input[RELOC].buff = (int *)malloc(512); + Input[RELOC].bsize = 512; + Input[SYMBOLS].buff = (int *)malloc(512); + Input[SYMBOLS].bsize = 512; + + if (signal(SIGINT, SIG_IGN) != SIG_IGN) { + signal(SIGINT, delexit); + signal(SIGTERM, delexit); + } + if (argc == 1) + exit(4); +/* + * Initialize the "VM" system with NUM_VM_PAGES memory segments (memory + * resident pages). Then "open the address space" - this creates the paging + * (tmp) file. +*/ + if (vminit(NUM_VM_PAGES) < 0) + error(1, "vminit failed"); + if (vmopen(&Vspace, (char *)NULL) < 0) + error(1, "vmopen failed"); + + /* + * Pull out search directories. + */ + for (c = 1; c < argc; c++) { + ap = argv[c]; + if (ap[0] == '-' && ap[1] == 'L') { + if (ap[2] == 0) + error(1, "-L: pathname missing"); + if (ndir >= NDIRS - NDEFDIRS) + error(1, "-L: too many directories"); + dirs[ndir++] = &ap[2]; + } + } + /* add default search directories */ + dirs[ndir++] = "/lib"; + dirs[ndir++] = "/usr/lib"; + dirs[ndir++] = "/usr/local/lib"; + + p = argv+1; + /* + * Scan files once to find where symbols are defined. + */ + for (c=1; c= argc) + error(1, "-o where?"); + ofilename = *p++; + ofilfnd++; + continue; + case 'u': + case 'e': + if (++c >= argc) + error(1, "-u or -c: arg missing"); + enter(slookup(*p++)); + if (ap[i]=='e') + entrypt = lastsym; + continue; + case 'D': + if (++c >= argc) + error(1, "-D: arg missing"); + num = atoi(*p++); + if (dsize>num) + error(1, "-D: too small"); + dsize = num; + continue; + case 'l': + save = ap[--i]; + ap[i]='-'; + load1arg(&ap[i], -1); + ap[i]=save; + goto next; + case 'M': + Mflag++; + continue; + 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': + case 'z': + iflag++; + continue; + case 't': + trace++; + continue; + case 'q': + quiet++; + continue; + case 'v': + verbose++; + continue; + case 'L': + goto next; + case 'O': + Oflag++; + continue; + case 'Y': + if (inov == 0) + error(1, "-Y: Not in overlay"); + filhdr.o.ov_siz[curov - 1] = tsize; + if (trace) + printf("overlay %d size %d\n", curov, + filhdr.o.ov_siz[curov - 1]); + curov = inov = 0; + tsize = tsizwas; + continue; + case 'Z': + if (!inov) { + tsizwas = tsize; + if (numov == 0) { + cursym = ovhndlr; + enter(lookup()); + } + } + else { + filhdr.o.ov_siz[curov - 1] = tsize; + if (trace) + printf("overlay %d size %d\n", curov, + filhdr.o.ov_siz[curov - 1]); + } + tsize = 0; + inov = 1; + numov++; + if (numov > NOVL) { + printf("ld:too many overlays, max is %d\n",NOVL); + error(1, (char *)NULL); + } + curov++; + continue; + case 'y': + case 'A': + case 'H': + case 'N': + case 'T': + default: + printf("ld:bad flag %c\n",ap[i]); + error(1, (char *)NULL); + } +next: + ; + } + endload(argc, argv); + exit(0); +} + +delexit() + { + + unlink("l.out"); + if (delarg==0) + chmod(ofilename, 0777 & ~umask(0)); + if (verbose) + printf("ld: nswaps: %ld, nmapsegs: %ld sbrk(0): %u\n", nswaps, + nmapsegs, sbrk(0)); + exit(delarg); + } + +endload(argc, argv) + int argc; + char **argv; +{ + register int c, i; + int dnum; + register char *ap, **p; + + if (numov) + rflag = 0; + filname = 0; + middle(); + setupout(); + p = argv+1; + libp = liblist; + for (c=1; cloc = -1; + libp++; + + if (rstrtab) + free(rstrtab); + if (Input[STRINGS2].buff) + { + free(Input[STRINGS2].buff); + Input[STRINGS2].buff = NULL; + } + break; + + /* + * Table of contents is out of date, so search + * as a normal library (but skip the __.SYMDEF file). + */ + case 3: + error(-1, +"warning: table of contents for archive is out of date; rerun ranlib(1)"); + nloc = SARMAG; + do + nloc += skip(); + while (step(nloc)); + break; + case -1: + return; + } + close(infil); +} + +/* + * Advance to the next archive member, which + * is at offset nloc in the archive. If the member + * is useful, record its location in the liblist structure + * for use in pass2. Mark the end of the archive in libilst with a -1. + */ +step(nloc) + off_t nloc; + { + + lseek(infil, nloc, L_SET); + if (get_arobj(infil) <= 0) + { + libp->loc = -1; + libp++; + return (0); + } + if (load1(1, nloc + sizeof (struct ar_hdr) + chdr.lname)) + { + libp->loc = nloc; + libp++; + if (Mflag) + printf("\t%s\n", chdr.name); + } + return (1); + } + +ldrand(totnum, sloc) + int totnum; + off_t sloc; + { + register int ntab; + SYMBOL *sp; + short *hp; + VADDR vsym; + LIBLIST *oldp = libp; + int amt, tnum = totnum; + off_t loc; +/* + * 'ar' header + member header + SYMDEF table.of.contents + long filename +*/ + off_t opos = (off_t)SARMAG + sizeof (struct ar_hdr) + sizeof (long) + + chdr.lname; +#define TABSZ 64 + char localname[NNAMESIZE]; + register struct ranlib *tp; + struct ranlib tab[TABSZ], *tplast; + + while (tnum) + { + if (tnum > TABSZ) + ntab = TABSZ; + else + ntab = tnum; + tplast = &tab[ntab - 1]; + (void)lseek(infil, opos, L_SET); + amt = ntab * sizeof (struct ranlib); + if (read(infil, tab, amt) != amt) + error(1, "EOF in ldrand"); + tnum -= ntab; + opos += amt; + + for (tp = tab; tp <= tplast; tp++) + { +/* + * This is slower and uglier than we would like, but it is not always + * possible to hold the entire string table in memory. Need to add + * an extra increment to skip over the string table size longword. +*/ + if (rstrtab) + strncpy(localname, (int)tp->ran_un.ran_strx + + rstrtab, NNAMESIZE); + else + { + dseek(STRINGS2, tp->ran_un.ran_strx + sloc + + sizeof (long), 07777); + mgets(localname, NNAMESIZE, STRINGS2); + } + hp = slookup(localname); + if (*hp == -1) + continue; + vsym = sym2va(*hp); + sp = (SYMBOL *)(vmmapseg(&Vspace, VSEG(vsym))->s_cinfo + + VOFF(vsym)); + if (sp->n_type != N_EXT+N_UNDF) + continue; + step(tp->ran_off); + loc = tp->ran_off; + while (tp < tplast && (tp+1)->ran_off == loc) + tp++; + } + } + return(oldp != libp); + } + +mgets(buf, maxlen, which) + register char *buf; + int maxlen, which; + { + register STREAM *sp; + register int n; + + sp = &Input[which]; + for (n = 0; n < maxlen; n++) + { + if (--sp->nibuf < 0) + { + dseek(which, (off_t)(sp->bno + 1) * sp->bsize, 077777); + sp->nibuf--; + } + if ((*buf++ = *sp->Cptr++) == 0) + break; + } + } + +/* + * Examine a single file or archive member on pass 1. + */ +load1(libflg, loc) + off_t loc; +{ + register SYMBOL *sp; + int savindex; + int ndef, type, mtype; + long nlocal; + VADDR vsym; + struct nlist objsym; + off_t strloc; + long strsize; + char *strtab; +register struct vseg *seg; + + readhdr(loc); + if (filhdr.e.a_syms == 0) { + if (filhdr.e.a_text+filhdr.e.a_data == 0) + return (0); + error(1, "no namelist"); + } + ctrel = tsize; cdrel += dsize; cbrel += bsize; + ndef = 0; + nlocal = sizeof (cursym); + savindex = symindex; + bzero(symhash, sizeof (symhash)); + if ((filhdr.e.a_flag&RELFLG)==1) { + error(1, "No relocation bits"); + return(0); + } + dseek(SYMBOLS, loc + N_SYMOFF(filhdr), filhdr.e.a_syms); + + strloc = loc + N_STROFF(filhdr); + lseek(infil, strloc, L_SET); + read(infil, &strsize, sizeof (long)); + strtab = NULL; + if (strsize <= 8192L) + { + strtab = (char *)malloc((int)strsize); + if (strtab) + read(infil, strtab, (int)strsize); + } + if (!strtab) + inistr(STRINGS); + + while (Input[SYMBOLS].nsize > 0) { + mget((int *)&objsym, sizeof objsym, SYMBOLS); + type = objsym.n_type; + if (Sflag) { + mtype = type&037; + if (mtype==1 || mtype>4) { + continue; + } + } +/* + * Now convert 'nlist' format symbol to 'fixed' (semi old style) format. + * This may look strange but it greatly simplifies things and avoids having + * to read the entire string table into virtual memory. + * + * Also, we access the symbols in order. The assembler was nice enough + * to place the strings in the same order as the symbols - so effectively + * we are doing a sequential read of the string table. +*/ + if (strtab) + strncpy(cursym.n_name, (int)objsym.n_un.n_strx + + strtab - sizeof (long), NNAMESIZE); + else + { + dseek(STRINGS, objsym.n_un.n_strx + strloc, 077777); + mgets(cursym.n_name, NNAMESIZE, STRINGS); + } + cursym.n_type = objsym.n_type; + cursym.n_value = objsym.n_value; + cursym.n_ovly = objsym.n_ovly; + if ((type&N_EXT)==0) { + if (Xflag==0 || cursym.n_name[0]!='L') + nlocal += sizeof (cursym); + continue; + } + + switch (cursym.n_type) { + case N_TEXT: + case N_EXT+N_TEXT: + cursym.n_value += ctrel; + break; + case N_DATA: + case N_EXT+N_DATA: + cursym.n_value += cdrel; + break; + case N_BSS: + case N_EXT+N_BSS: + cursym.n_value += cbrel; + break; + case N_EXT+N_UNDF: + break; + default: + if (cursym.n_type&N_EXT) + cursym.n_type = N_EXT+N_ABS; + break; + } + + if (enter(lookup())) + continue; + vsym = sym2va(lastsym); + seg = vmmapseg(&Vspace, VSEG(vsym)); + sp = (SYMBOL *)(seg->s_cinfo + VOFF(vsym)); + if (sp->n_type != N_EXT+N_UNDF) + continue; + if (cursym.n_type == N_EXT+N_UNDF) { + if (cursym.n_value > sp->n_value) { + sp->n_value = cursym.n_value; + vmmodify(seg); + } + continue; + } + if (sp->n_value != 0 && cursym.n_type == N_EXT+N_TEXT) + continue; + ndef++; + sp->n_type = cursym.n_type; + sp->n_value = cursym.n_value; + sp->n_ovly = ((sp->n_type &~ N_EXT) == N_TEXT) ? curov : 0; + VMMODIFY(seg); + if (trace) + printf("%.*s type 0%o in overlay %u at %u\n", NNAMESIZE, + sp->n_name, sp->n_type, sp->n_ovly, sp->n_value); + } + + if (strtab) + free(strtab); + if (Input[STRINGS].buff) + { + free(Input[STRINGS].buff); + Input[STRINGS].buff = NULL; + } + + if (libflg==0 || ndef) { + tsize = add(tsize,filhdr.e.a_text,"text"); + dsize = add(dsize,filhdr.e.a_data,"data"); + bsize = add(bsize,filhdr.e.a_bss,"bss"); + ssize += nlocal; + return (1); + } + /* + * No symbols defined by this library member. + * Rip out the hash table entries and reset the symbol table. + */ + hreset(); + symindex = savindex; + return(0); +} + +static +hreset() + { + register u_short *sp, i; + u_short j; + register u_short mask; + + sp = symhash; + for (i = 0; i < NSYM; sp++, i += 16) + { + if (*sp == 0) + continue; + for (mask = 1, j = i; *sp; j++) + { + if (*sp & mask) + { + hshtab[j] = -1; + *sp &= ~mask; + } + mask <<= 1; + } + } + } + +middle() +{ + VADDR vsym; + register SYMBOL *sp; + register int i; + register struct vseg *seg; + u_int csize; + u_int nund, corigin; + u_int ttsize; + + 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. + * (Unless we are overlaying.) + */ + if (rflag==0 && !numov) { + for (i=0, vsym=sym2va(0); i < symindex; i++, vsym=sym2va(i)) { + sp = (SYMBOL *)(vmmapseg(&Vspace,VSEG(vsym))->s_cinfo + + VOFF(vsym)); + if (sp->n_type==N_EXT+N_UNDF && sp->n_value==0 + && i != p_end && i != p_edata && i != 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, N_EXT+N_TEXT); + ldrsym(p_edata, dsize, N_EXT+N_DATA); + ldrsym(p_end, bsize, N_EXT+N_BSS); + for (i=0, vsym=sym2va(0); i < symindex; i++, vsym=sym2va(i)) { + register int t; + + seg = vmmapseg(&Vspace, VSEG(vsym)); + sp = (SYMBOL *)(seg->s_cinfo + VOFF(vsym)); + if (sp->n_type==N_EXT+N_UNDF && (t = sp->n_value)!=0) { + t = (t+1) & ~01; + sp->n_value = csize; + sp->n_type = N_EXT+N_COMM; + VMMODIFY(seg); + csize = add(csize, t, "bss"); + } + } + } + if (numov) { + for (i=0, vsym=sym2va(0); i < symindex; i++, vsym=sym2va(i)) { + seg = vmmapseg(&Vspace, VSEG(vsym)); + sp = (SYMBOL *)(seg->s_cinfo + VOFF(vsym)); + if (trace) + printf("%.*s n_type %o n_value %o sovalue %o ovly %d\n", + NNAMESIZE, sp->n_name, sp->n_type, + sp->n_value, sp->sovalue, sp->n_ovly); + if (sp->n_ovly && sp->n_type == N_EXT+N_TEXT) { + sp->sovalue = sp->n_value; + sp->n_value = tsize; + VMMODIFY(seg); + tsize = add(tsize, THUNKSIZ, "text"); + if (trace) + printf("relocating %.*s in overlay %d from %o to %o\n", + NNAMESIZE,sp->n_name,sp->n_ovly, + sp->sovalue, sp->n_value); + } + } + } + /* + * Now set symbols to their final value + */ + if (nflag || iflag) + tsize = add(tsize, 077, "text") & ~077; + ttsize = tsize; + if (numov) { + register int i; + + ovbase = (u_int)rnd8k(tsize); + if (trace) + printf("overlay base is %u.\n", ovbase); + for (i=0, vsym=sym2va(0); i < symindex; i++, vsym=sym2va(i)) { + seg = vmmapseg(&Vspace, VSEG(vsym)); + sp = (SYMBOL *)(seg->s_cinfo + VOFF(vsym)); + if (sp->n_ovly && sp->n_type == N_EXT+N_TEXT) { + sp->sovalue += ovbase; + VMMODIFY(seg); + if (trace) + printf("%.*s at %u overlay %d\n", + NNAMESIZE, sp->n_name, + sp->sovalue, sp->n_ovly); + } + } + for (i = 0; i < NOVL; i++) { + filhdr.o.ov_siz[i] = (filhdr.o.ov_siz[i] + 077) &~ 077; + if (filhdr.o.ov_siz[i] > filhdr.o.max_ovl) + filhdr.o.max_ovl = filhdr.o.ov_siz[i]; + } + if (trace) + printf("max overlay size is %u\n", filhdr.o.max_ovl); + ttsize = (u_int)rnd8k(ovbase + filhdr.o.max_ovl); + if (trace) + printf("overlays end before %u.\n", ttsize); + } + dorigin = ttsize; + if (nflag) + dorigin = (u_int)rnd8k(ttsize); + if (iflag) + dorigin = 0; + corigin = dorigin + dsize; + borigin = corigin + csize; + nund = 0; + for (i=0, vsym=sym2va(0); i < symindex; i++, vsym=sym2va(i)) { + seg = vmmapseg(&Vspace, VSEG(vsym)); + sp = (SYMBOL *)(seg->s_cinfo + VOFF(vsym)); + + switch (sp->n_type) { + + case N_EXT+N_UNDF: + if (arflag == 0) + errlev |= 01; + if ((arflag==0 || dflag) && sp->n_value==0) { + if (i == p_end || i == p_etext || i == p_edata) + continue; + if (quiet) + continue; + if (nund==0) + printf("Undefined:\n"); + nund++; + printf("%.*s\n", NNAMESIZE, sp->n_name); + } + continue; + case N_EXT+N_ABS: + default: + continue; + case N_EXT+N_TEXT: + sp->n_value += torigin; + VMMODIFY(seg); + continue; + case N_EXT+N_DATA: + sp->n_value += dorigin; + VMMODIFY(seg); + continue; + case N_EXT+N_BSS: + sp->n_value += borigin; + VMMODIFY(seg); + continue; + case N_EXT+N_COMM: + sp->n_type = N_EXT+N_BSS; + sp->n_value += corigin; + VMMODIFY(seg); + continue; + } + } + if (sflag || xflag) + ssize = 0; + bsize = add(bsize, csize, "bss"); + nsym = ssize / (sizeof cursym); +} + +ldrsym(ix, val, type) + short ix; + u_int val; + int type; +{ + VADDR vsym; + register struct vseg *seg; + register SYMBOL *sp; + + if (ix == -1) + return; + vsym = sym2va(ix); + seg = vmmapseg(&Vspace, VSEG(vsym)); + sp = (SYMBOL *)(seg->s_cinfo + VOFF(vsym)); + if (sp->n_type != N_EXT+N_UNDF || sp->n_value) { + printf("%.*s: n_value %o", NNAMESIZE, sp->n_name, sp->n_value); + error(0, "attempt to redefine loader-defined symbol"); + return; + } + sp->n_type = type; + sp->n_value = val; + VMMODIFY(seg); +} + +setupout() +{ + VADDR vsym; + register SYMBOL *sp; + + tcreat(&toutb, 0); + mktemp(tfname); + tcreat(&doutb, 1); + if (sflag==0 || xflag==0) + tcreat(&soutb, 1); + if (rflag) { + tcreat(&troutb, 1); + tcreat(&droutb, 1); + } + if (numov) + tcreat(&voutb, 1); + filhdr.e.a_magic = (Oflag ? A_MAGIC4 : (iflag ? A_MAGIC3 : (nflag ? A_MAGIC2 : A_MAGIC1))); + if (numov) { + if (filhdr.e.a_magic == A_MAGIC1) + error(1, "-n or -i must be used with overlays"); + filhdr.e.a_magic |= 020; + } + filhdr.e.a_text = tsize; + filhdr.e.a_data = dsize; + filhdr.e.a_bss = bsize; + ssize = sflag? 0 : (ssize + (sizeof (struct nlist)) * symindex); +/* + * This is an estimate, the real size is computed later and the + * a.out header rewritten with the correct value. +*/ + filhdr.e.a_syms = ssize&0177777; + if (entrypt != -1) { + vsym = sym2va(entrypt); + sp = (SYMBOL *)(vmmapseg(&Vspace,VSEG(vsym))->s_cinfo + + VOFF(vsym)); + if (sp->n_type!=N_EXT+N_TEXT) + error(0, "entry point not in text"); + else if (sp->n_ovly) + error(0, "entry point in overlay"); + else + filhdr.e.a_entry = sp->n_value | 01; + } else + filhdr.e.a_entry = 0; + filhdr.e.a_flag = (rflag==0); + fwrite(&filhdr.e, sizeof (filhdr.e), 1, toutb); + if (numov) + fwrite(&filhdr.o, sizeof (filhdr.o), 1, toutb); +} + +load2arg(acp, flag) + char *acp; + int flag; +{ + register char *cp; + register LIBLIST *lp; + + cp = acp; + switch (getfile(cp, flag, 2)) + { + case 0: + while (*cp) + cp++; + while (cp >= acp && *--cp != '/') + ; + mkfsym(++cp); + load2(0L); + break; + case -1: + return; + default: /* scan archive members referenced */ + for (lp = libp; lp->loc != -1; lp++) { + lseek(infil, lp->loc, L_SET); + get_arobj(infil); + mkfsym(chdr.name); + load2(lp->loc + sizeof (struct ar_hdr) + + chdr.lname); + } + libp = ++lp; + break; + } + close(infil); +} + +load2(loc) +long loc; +{ + register SYMBOL *sp; + register struct local *lp; + register int symno; + int type, mtype; + VADDR vsym; + short i; + struct nlist objsym; + off_t stroff; + char *strtab; + long strsize; + + 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; + dseek(SYMBOLS, loc + N_SYMOFF(filhdr), filhdr.e.a_syms); + stroff = loc + N_STROFF(filhdr); + + lseek(infil, stroff, L_SET); + read(infil, &strsize, sizeof (long)); + strtab = NULL; + if (strsize <= 8192L) + { + strtab = (char *)malloc((int)strsize); + if (strtab) + read(infil, strtab, (int)strsize); + } + if (!strtab) + inistr(STRINGS); + + while (Input[SYMBOLS].nsize > 0) { + symno++; + mget((int *)&objsym, sizeof objsym, SYMBOLS); + if (strtab) + strncpy(cursym.n_name, (int)objsym.n_un.n_strx + + strtab - sizeof (long), NNAMESIZE); + else + { + dseek(STRINGS, objsym.n_un.n_strx + stroff, 07777); + mgets(cursym.n_name, NNAMESIZE, STRINGS); + } + cursym.n_type = objsym.n_type; + cursym.n_value = objsym.n_value; + cursym.n_ovly = objsym.n_ovly; + + switch (cursym.n_type) { + case N_TEXT: + case N_EXT+N_TEXT: + cursym.n_value += ctrel; + break; + case N_DATA: + case N_EXT+N_DATA: + cursym.n_value += cdrel; + break; + case N_BSS: + case N_EXT+N_BSS: + cursym.n_value += cbrel; + break; + case N_EXT+N_UNDF: + break; + default: + if (cursym.n_type&N_EXT) + cursym.n_type = N_EXT+N_ABS; + break; + } + + type = cursym.n_type; + if (Sflag) { + mtype = type&037; + if (mtype==1 || mtype>4) continue; + } + if ((type&N_EXT) == 0) { + if (!sflag && !xflag && + (!Xflag || cursym.n_name[0] != 'L')) { + /* + * preserve overlay number for locals + * mostly for adb. mjk 7/81 + */ + if ((type == N_TEXT) && inov) + cursym.n_ovly = curov; + fwrite(&cursym, sizeof cursym, 1, soutb); + } + continue; + } + i = *lookup(); + if (i == -1) + error(1, "internal error: symbol not found"); + if (cursym.n_type == N_EXT+N_UNDF || + cursym.n_type == N_EXT+N_TEXT) { + if (lp >= &local[NSYMPR]) + error(2, "Local symbol overflow"); + lp->locindex = symno; + lp++->locsymbol = i; + continue; + } + vsym = sym2va(i); + sp = (SYMBOL *)(vmmapseg(&Vspace,VSEG(vsym))->s_cinfo + + VOFF(vsym)); + if (cursym.n_type != sp->n_type + || cursym.n_value != sp->n_value && !sp->n_ovly + || sp->n_ovly && cursym.n_value != sp->sovalue) { + printf("%.*s: ", NNAMESIZE, cursym.n_name); + if (trace) + printf(" ovly %d sovalue %o new %o hav %o ", + sp->n_ovly, sp->sovalue, + cursym.n_value, sp->n_value); + error(0, "multiply defined"); + } + } + if (strtab) + free(strtab); + if (Input[STRINGS].buff) + { + free(Input[STRINGS].buff); + Input[STRINGS].buff = NULL; + } + dseek(TEXT, loc + N_TXTOFF(filhdr.e), filhdr.e.a_text); + dseek(RELOC, loc + N_TRELOC(filhdr.e), filhdr.e.a_text); + load2td(lp, ctrel, inov ? voutb : toutb, troutb); + dseek(TEXT, loc + N_DATOFF(filhdr), filhdr.e.a_data); + dseek(RELOC, loc + N_DRELOC(filhdr), filhdr.e.a_data); + load2td(lp, cdrel, doutb, droutb); + torigin += filhdr.e.a_text; + dorigin += filhdr.e.a_data; + borigin += filhdr.e.a_bss; +} + +load2td(lp, creloc, b1, b2) + struct local *lp; + u_int creloc; + FILE *b1, *b2; +{ + register u_int r, t; + register SYMBOL *sp; + short i; + VADDR vsym; + + for (;;) { +/* + * Can't do this because of the word/byte count fakery that's used to + * prevrent erroneous EOF indications. Yuck. + + t = get(TEXT); + t = get(RELOC); +*/ + /* + * The pickup code is copied from "get" for speed. + */ + + /* next text or data word */ + if (--Input[TEXT].nsize <= 0) { + if (Input[TEXT].nsize < 0) + break; + Input[TEXT].nsize++; + t = get(TEXT); + } else if (--Input[TEXT].nibuf < 0) { + Input[TEXT].nibuf++; + Input[TEXT].nsize++; + t = get(TEXT); + } else + t = *Input[TEXT].Iptr++; + + /* next relocation word */ + if (--Input[RELOC].nsize <= 0) { + if (Input[RELOC].nsize < 0) + error(1, "relocation error"); + Input[RELOC].nsize++; + r = get(RELOC); + } else if (--Input[RELOC].nibuf < 0) { + Input[RELOC].nibuf++; + Input[RELOC].nsize++; + r = get(RELOC); + } else + r = *Input[RELOC].Iptr++; + + switch (r&016) { + + case RTEXT: + t += ctrel; + break; + case RDATA: + t += cdrel; + break; + case RBSS: + t += cbrel; + break; + case REXT: + i = *lookloc(lp, r); + vsym = sym2va(i); + sp = (SYMBOL *)(vmmapseg(&Vspace, VSEG(vsym))->s_cinfo + + VOFF(vsym)); + if (sp->n_type==N_EXT+N_UNDF) { + r = (r&01) + ((nsym + i)<<4) + REXT; + break; + } + t += sp->n_value; + r = (r&01) + ((sp->n_type-(N_EXT+N_ABS))<<1); + break; +#ifndef pdp11 + default: + error(1, "relocation format botch (symbol type))"); +#endif + } + if (r&01) + t -= creloc; + putw(t, b1); + if (rflag) + putw(r, b2); + } +} + +finishout() +{ + register u_int n; + register SYMBOL *sp; + struct nlist objsym; + VADDR vsym; + int type, len; + off_t stroff; + long dtotal, ovrnd; + int thunk[THUNKSIZ / sizeof (int)]; + + if (numov) { + int aovhndlr[NOVL+1]; + + for (n=1; n<=numov; n++) { + /* Note that NOVL can be up to 15 with this */ + ovhndlr.n_name[HNDLR_NUM] = "0123456789abcdef"[n]; + aovhndlr[n] = adrof(ovhndlr.n_name); + } + for (n=0,vsym=sym2va(0); n < symindex; n++,vsym=sym2va(n)) { + sp = (SYMBOL *)(vmmapseg(&Vspace, VSEG(vsym))->s_cinfo + + VOFF(vsym)); + if (sp->n_ovly && (sp->n_type & (N_EXT+N_TEXT))) { + thunk[0] = 012701; /* mov $~foo+4, r1 */ + thunk[1] = sp->sovalue + 4; + thunk[2] = 04537; /* jsr r5, ovhndlrx */ + thunk[3] = aovhndlr[sp->n_ovly]; + fwrite(thunk, THUNKSIZ, 1, toutb); + torigin += THUNKSIZ; + } + } + } + if (nflag||iflag) { + n = torigin; + while (n&077) { + n += 2; + putw(0, toutb); + if (rflag) + putw(0, troutb); + } + } + if (numov) + copy(voutb); + copy(doutb); + if (rflag) { + copy(troutb); + copy(droutb); + } + + if (sflag==0) + { +/* + * Now write the symbol table out, converting from the 'fixed' style + * symbol table used internally to the string table version used in + * object/executable files. First the "local" (non-global) symbols + * are written out, these are the symbols placed in the temporary file + * accessed via 'soutb'. + * + * 'voutb' (overlay temp file), 'troutb' (text relocation temp file), + * 'droutb' (data relocation temp file), and 'doutb' (data temp file) + * have all been finished with and closed by this point. We reuse one + * of these ('doutb') to build the string table. +*/ + + tcreat(&doutb, 1); + nsym = 0; + stroff = sizeof (long); /* string table size */ + if (xflag == 0) + { + fflush(soutb); /* flush local symbol file */ + rewind(soutb); + while (fread(&cursym, sizeof (cursym), 1, soutb) == 1) + { + if (feof(soutb)) + break; + objsym.n_value = cursym.n_value; + objsym.n_type = cursym.n_type; + objsym.n_ovly = cursym.n_ovly; + objsym.n_un.n_strx = stroff; + len = strlen(cursym.n_name); + if (len >= NNAMESIZE) + len = NNAMESIZE; + fwrite(cursym.n_name, 1, len, doutb); + fputc('\0', doutb); + stroff += (len + 1); + fwrite(&objsym, sizeof (objsym), 1, toutb); + nsym++; + } + fclose(soutb); + } +/* + * Now we dump the global/external symbol table by marching thru the + * 'vm' addresss space. +*/ + for (n = 0, vsym = sym2va(0); n < symindex; n++, + vsym = sym2va(n)) + { + sp = (SYMBOL *)(vmmapseg(&Vspace, VSEG(vsym))->s_cinfo + + VOFF(vsym)); + objsym.n_value = sp->n_value; + objsym.n_type = sp->n_type; + objsym.n_ovly = sp->n_ovly; + objsym.n_un.n_strx = stroff; + len = strlen(sp->n_name); + if (len > NNAMESIZE) + len = NNAMESIZE; + fwrite(sp->n_name, 1, len, doutb); + fputc('\0', doutb); + stroff += (len + 1); + fwrite(&objsym, sizeof (objsym), 1, toutb); + nsym++; + } +#ifdef whybother + if (stroff & 1) + { + fputc('\0', doutb); + stroff++; + } +#endif +/* + * Now write the length of the string table out. Then copy the temp + * file containing the strings to the image being built. +*/ + fwrite(&stroff, sizeof (stroff), 1, toutb); + copy(doutb); + } +/* + * Fix up the header with the correct symbol table size - we now know + * _exactly_ how many symbols were placed in the symbol table (the size + * used earlier was only an estimate +*/ + fflush(toutb); + rewind(toutb); + fread(&filhdr.e, sizeof (filhdr.e), 1, toutb); + filhdr.e.a_syms = nsym * sizeof (objsym); + rewind(toutb); + fwrite(&filhdr.e, sizeof (filhdr.e), 1, toutb); + fclose(toutb); + + if (!ofilfnd) { + if (rename("l.out", "a.out") < 0) + error(1, "cannot move l.out to a.out"); + ofilename = "a.out"; + } +/* + * we now do a sanity check on the total sizes of things. Previously the + * linker could produce a program marked as executable but which had bogus + * overlay+root sizes, etc. +*/ +#define K56 (56L * 1024L) +#define K64 (64L * 1024L) + + dtotal = (long)dsize + (long)bsize; + ovrnd = rnd8k(filhdr.o.max_ovl); /* 0 if not overlaid */ + type = 0; + if (nflag) { + if (rnd8k(tsize) + ovrnd + dtotal > K56) + type = filhdr.e.a_magic; + } + else if (iflag) { + if ((rnd8k(tsize) + ovrnd > K64) || (dtotal > K56)) + type = filhdr.e.a_magic; + } + else { + if ((long)tsize + dtotal > K56) + type = filhdr.e.a_magic; + } + if (type && !rflag) { + fprintf(stderr, "ld: too big for type %o\n", type); + errlev = 2; + } + delarg = errlev; + delexit(); +} + +long +rnd8k(siz) + u_int siz; + { + long l = siz; + + return((l + 017777) & ~017777L); + } + +mkfsym(s) + char *s; + { + + if (sflag || xflag) + return; + strncpy(cursym.n_name, s, NNAMESIZE); + cursym.n_type = N_FN; + cursym.n_value = torigin; + fwrite(&cursym, sizeof (cursym), 1, soutb); + } + +mget(loc, an, which) + register int *loc; + int an, which; +{ + register int n; + register STREAM *tp = &Input[which]; + + n = an >> 1; + if ((tp->nibuf -= n) >= 0) { + if ((tp->nsize -= n) > 0) { + bcopy(tp->ptr, loc, an); + tp->Iptr += n; + return; + } + tp->nsize += n; + } + tp->nibuf += n; + do { + *loc++ = get(which); + } while (--n); +} + +dseek(which, aloc, s) + int which; + off_t aloc; + int s; + { + register STREAM *sp = &Input[which]; + register u_int b, o; + int n; + + b = aloc / sp->bsize; + o = aloc & (sp->bsize - 1); + if (sp->bno != b) + { + (void)lseek(infil, (off_t)sp->bsize * b, L_SET); + if ((n = read(infil, (char *)sp->buff, sp->bsize)) < 0) + n = 0; + sp->bno = b; + sp->nread = n; + } + sp->nibuf = sp->nread - o; + sp->Cptr = (char *)sp->buff + o; + if (which != STRINGS) + sp->nibuf >>= 1; + if (s != -1) + sp->nsize = (s >> 1) & 077777; + if (sp->nibuf <= 0) + sp->nsize = 0; + } + +get(which) + int which; +{ + register STREAM *sp = &Input[which]; + + if (--sp->nibuf < 0) { + dseek(which, (off_t)(sp->bno + 1) * sp->bsize, -1); + --sp->nibuf; + } + if (--sp->nsize <= 0) { + if (sp->nsize < 0) + error(1, "premature EOF#1"); + } + return(*sp->Iptr++); +} + +getfile(acp, flag, phase) +char *acp; + int flag; /* 1 = fatal if file not found, -1 = not fatal */ +{ + char arcmag[SARMAG+1]; + struct stat stb; + + filname = acp; + chdr.name[0] = '\0'; /* not in archive for now */ + if (filname[0] == '-' && filname[1] == 'l') + infil = libopen(filname + 2, O_RDONLY); + else + infil = open(filname, O_RDONLY); + if (infil < 0) { + if (phase == 1) /* only complain once on phase 1 */ + error(flag, "cannot open"); + return(-1); + } + fstat(infil, &stb); + Input[TEXT].bno = -1; + Input[RELOC].bno = -1; + Input[SYMBOLS].bno = -1; + Input[STRINGS].bno = -1; + dseek(TEXT, 0L, SARMAG); + if (Input[TEXT].nsize <= 0) + error(1, "premature EOF#2"); + mget((char *)arcmag, SARMAG, TEXT); + arcmag[SARMAG] = 0; + if (strcmp(arcmag, ARMAG)) + return(0); + lseek(infil, (off_t)SARMAG, L_SET); + if (get_arobj(infil) <= 0) + return(1); + if (strcmp(chdr.name, RANLIBMAG)) + return(1); /* regular archive */ + return (stb.st_mtime > chdr.date ? 3 : 2); +} + +/* + * Search for a library with given name + * using the directory search array. + */ +libopen(name, oflags) + char *name; + int oflags; +{ + register char *p, *cp; + register int i; + static char buf[100]; + int fd; + + for (i = 0; i < ndir ; i++) { + p = buf; + for (cp = dirs[i]; *cp; *p++ = *cp++) + ; + *p++ = '/'; + *p++ = 'l'; + *p++ = 'i'; + *p++ = 'b'; + for (cp = name; *cp; *p++ = *cp++) + ; + *p++ = '.'; + *p++ = 'a'; + *p++ = '\0'; + fd = open(buf, oflags); + if (fd != -1) { + filname = buf; + return(fd); + } + } + return(-1); +} + +short * +lookup() + { + register short *hp; + register char *cp; + SYMBOL *sp; + union + { + long x; + short y[2]; + } sh; + VADDR vsym; + + sh.x = 0; + for (cp = cursym.n_name; cp < &cursym.n_name[NNAMESIZE] && *cp;) + sh.x = (sh.x<<1) + *cp++; + sh.y[1] += sh.y[0]; + hp = &hshtab[(sh.y[1]&077777)%NSYM+2]; + while (*hp != -1) + { + vsym = sym2va(*hp); + sp = (SYMBOL *)(vmmapseg(&Vspace,VSEG(vsym))->s_cinfo + + VOFF(vsym)); + if (!strncmp(sp->n_name, cursym.n_name, NNAMESIZE)) + break; + if (++hp >= &hshtab[NSYM+2]) + hp = hshtab; + } + return(hp); + } + +short * +slookup(s) + char *s; + { + + strncpy(cursym.n_name, s, NNAMESIZE); + cursym.n_type = N_EXT+N_UNDF; + cursym.n_value = 0; + return(lookup()); + } + +enter(hp) + short *hp; + { + register SYMBOL *sp; + u_int word, bit, hnum; + VADDR vsym; + register struct vseg *seg; + + if (*hp == -1) + { + if (symindex>=NSYM) + error(1, "symbol table overflow"); + hnum = hp - hshtab; + word = hnum / 16; + bit = hnum % 16; + symhash[word] |= (1 << bit); + vsym = sym2va(symindex); + *hp = lastsym = symindex; + symindex++; + seg = vmmapseg(&Vspace, VSEG(vsym)); + sp = (SYMBOL *)(seg->s_cinfo + VOFF(vsym)); + strncpy(sp->n_name, cursym.n_name, NNAMESIZE); + sp->n_type = cursym.n_type; + sp->n_value = cursym.n_value; + if (sp->n_type == N_EXT+N_TEXT) + { + sp->n_ovly = curov; + if (trace) + printf("found %.*s in overlay %d at %u\n", + NNAMESIZE, sp->n_name, sp->n_ovly, + sp->n_value); + } + VMMODIFY(seg); + return(1); + } + lastsym = *hp; + return(0); + } + +error(n, s) +char *s; +{ + if (!s) + delexit(); + if (errlev==0) + printf("ld:"); + if (filname) { + printf("%s", filname); + if (n != -1 && chdr.name[0]) + printf("(%s)", chdr.name); + printf(": "); + } + printf("%s\n", s); + if (n == -1) + return; + if (n) + delexit(); + errlev = 2; +} + +readhdr(loc) +off_t loc; +{ + dseek(TEXT, loc, sizeof filhdr); + mget((int *)&filhdr.e, sizeof filhdr.e, TEXT); + if (filhdr.e.a_magic != A_MAGIC1) + error(1, "bad magic number"); + if (filhdr.e.a_text&01) + ++filhdr.e.a_text; + if (filhdr.e.a_data&01) + ++filhdr.e.a_data; + if (filhdr.e.a_bss&01) + ++filhdr.e.a_bss; + cdrel = -filhdr.e.a_text; + cbrel = cdrel - filhdr.e.a_data; +} + +tcreat(fpp, tempflg) + FILE **fpp; + int tempflg; + { + register int ufd; + char *nam; + + nam = (tempflg ? tfname : ofilename); + if ((ufd = open(nam, O_RDWR|O_CREAT|O_TRUNC, 0666)) < 0) + error(2, tempflg?"cannot create temp":"cannot create output"); + if (tempflg) + unlink(tfname); + *fpp = fdopen(ufd, "r+"); + } + +adrof(s) + char *s; + { + register short *p; + register SYMBOL *sp; + VADDR vsym; + + p = slookup(s); + if (*p == -1) + { + printf("%.*s: ", NNAMESIZE, s); + error(1, "undefined"); + } + vsym = sym2va(*p); + sp = (SYMBOL *)(vmmapseg(&Vspace, VSEG(vsym))->s_cinfo + VOFF(vsym)); + return(sp->n_value); + } + +copy(fp) + register FILE *fp; + { + register int c; + + fflush(fp); + rewind(fp); + while ((c = getc(fp)) != EOF) + putc(c, toutb); + fclose(fp); + } + +short * +lookloc(alp, r) +struct local *alp; +{ + register struct local *clp, *lp; + register int sn; + + lp = alp; + sn = (r>>4) & 07777; + for (clp = local; clplocindex == sn) + return(&clp->locsymbol); + error(1, "local symbol botch"); + /*NOTREACHED*/ +} + +roundov() + { + + while (torigin & 077) + { + putw(0, voutb); + torigin += sizeof (int); + } + } + +u_int +add(a,b,s) +int a, b; +char *s; +{ + long r; + register char *ap; + + r = (long)(u_int)a + (u_int)b; + if (r >= 0200000) + { + ap = (char *)alloca(strlen(s) + 1 + sizeof (" overflow")); + strcpy(ap, s); + strcat(ap, " overflow"); + error(1, ap); + } + return(r); +} + +/* + * "borrowed" from 'ar' because we didn't want to drag in everything else + * from 'ar'. The error checking was also ripped out, basically if any + * of the criteria for being an archive are not met then a -1 is returned + * and the rest of 'ld' figures out what to do. +*/ + +typedef struct ar_hdr HDR; +static char hb[sizeof(HDR) + 1]; /* real header */ + +/* Convert ar header field to an integer. */ +#define AR_ATOI(from, to, len, base) { \ + bcopy(from, buf, len); \ + buf[len] = '\0'; \ + to = strtol(buf, (char **)NULL, base); \ +} + +/* + * get_arobj -- + * read the archive header for this member + */ +get_arobj(fd) + int fd; +{ + HDR *hdr; + register int len, nr; + register char *p; + char buf[20]; + + nr = read(fd, hb, sizeof(HDR)); + if (nr != sizeof(HDR)) + return(-1); + + hdr = (HDR *)hb; + if (strncmp(hdr->ar_fmag, ARFMAG, sizeof(ARFMAG) - 1)) + return(-1); + + /* Convert the header into the internal format. */ +#define DECIMAL 10 +#define OCTAL 8 + + AR_ATOI(hdr->ar_date, chdr.date, sizeof(hdr->ar_date), DECIMAL); + AR_ATOI(hdr->ar_uid, chdr.uid, sizeof(hdr->ar_uid), DECIMAL); + AR_ATOI(hdr->ar_gid, chdr.gid, sizeof(hdr->ar_gid), DECIMAL); + AR_ATOI(hdr->ar_mode, chdr.mode, sizeof(hdr->ar_mode), OCTAL); + AR_ATOI(hdr->ar_size, chdr.size, sizeof(hdr->ar_size), DECIMAL); + + /* Leading spaces should never happen. */ + if (hdr->ar_name[0] == ' ') + return(-1); + + /* + * Long name support. Set the "real" size of the file, and the + * long name flag/size. + */ + if (!bcmp(hdr->ar_name, AR_EFMT1, sizeof(AR_EFMT1) - 1)) { + chdr.lname = len = atoi(hdr->ar_name + sizeof(AR_EFMT1) - 1); + if (len <= 0 || len > MAXNAMLEN) + return(-1); + nr = read(fd, chdr.name, (size_t)len); + if (nr != len) + return(-1); + chdr.name[len] = 0; + chdr.size -= len; + } else { + chdr.lname = 0; + bcopy(hdr->ar_name, chdr.name, sizeof(hdr->ar_name)); + + /* Strip trailing spaces, null terminate. */ + for (p = chdr.name + sizeof(hdr->ar_name) - 1; *p == ' '; --p); + *++p = '\0'; + } + return(1); +} + +/* + * skip - where to seek for next archive member. + */ +off_t +skip() + { + off_t len; + + len = chdr.size + (chdr.size + chdr.lname & 1); + len += sizeof (HDR); + return(len); + } + +inistr(which) + int which; + { + register STREAM *sp = &Input[which]; + register int size = 4096; + + if (sp->buff == (int *)NULL) + { + while (size > 256) + { + sp->buff = (int *)malloc(size); + if (sp->buff) + { + sp->bsize = size; + return; + } + size >>= 1; + } + error(1, "No memory for strings"); + } + } diff --git a/bin/ln.c b/bin/ln.c new file mode 100644 index 0000000..8e0d6ba --- /dev/null +++ b/bin/ln.c @@ -0,0 +1,89 @@ +static char sccsid[] = "@(#)ln.c 4.6 11/15/85"; +/* + * ln + */ +#include +#include +#include +#include + +struct stat stb; +int fflag; /* force flag set? */ +int sflag; +char name[BUFSIZ]; +char *rindex(); +extern int errno; + +main(argc, argv) + int argc; + register char **argv; +{ + register int i, r; + + argc--, argv++; +again: + if (argc && strcmp(argv[0], "-f") == 0) { + fflag++; + argv++; + argc--; + } + if (argc && strcmp(argv[0], "-s") == 0) { + sflag++; + argv++; + argc--; + } + if (argc == 0) + goto usage; + else if (argc == 1) { + argv[argc] = "."; + argc++; + } + if (sflag == 0 && argc > 2) { + if (stat(argv[argc-1], &stb) < 0) + goto usage; + if ((stb.st_mode&S_IFMT) != S_IFDIR) + goto usage; + } + r = 0; + for(i = 0; i < argc-1; i++) + r |= linkit(argv[i], argv[argc-1]); + exit(r); +usage: + fprintf(stderr, "Usage: ln [ -s ] f1\nor: ln [ -s ] f1 f2\nln [ -s ] f1 ... fn d2\n"); + exit(1); +} + +int link(), symlink(); + +linkit(from, to) + char *from, *to; +{ + char *tail; + int (*linkf)() = sflag ? symlink : link; + + /* is target a directory? */ + if (sflag == 0 && fflag == 0 && stat(from, &stb) >= 0 + && (stb.st_mode&S_IFMT) == S_IFDIR) { + printf("%s is a directory\n", from); + return (1); + } + if (stat(to, &stb) >= 0 && (stb.st_mode&S_IFMT) == S_IFDIR) { + tail = rindex(from, '/'); + if (tail == 0) + tail = from; + else + tail++; + sprintf(name, "%s/%s", to, tail); + to = name; + } + if ((*linkf)(from, to) < 0) { + if (errno == EEXIST || sflag) + perror(to); + else if (access(from, 0) < 0) + perror(from); + else + perror(to); + return (1); + } + return (0); +} diff --git a/bin/login/Makefile b/bin/login/Makefile new file mode 100644 index 0000000..622f318 --- /dev/null +++ b/bin/login/Makefile @@ -0,0 +1,46 @@ +# +# Copyright (c) 1988 Regents of the University of California. +# All rights reserved. +# +# Redistribution and use in source and binary forms are permitted +# provided that the above copyright notice and this paragraph are +# duplicated in all such forms and that any documentation, advertising +# materials, and other materials related to such redistribution and +# use acknowledge that the software was developed by the University +# of California, Berkeley. The name of the University may not be +# used to endorse or promote products derived from this software +# without specific prior written permission. THIS SOFTWARE IS PROVIDED +# ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +# WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND +# FITNESS FOR A PARTICULAR PURPOSE. +# +# @(#)Makefile 5.3.2 (2.11BSD) 1996/12/1 +# + +CFLAGS= -O -i +SRCS= login.c +OBJS= login.o +MAN= + +all: login + +login: ${OBJS} + ${CC} -o $@ ${CFLAGS} ${OBJS} -lutil + +clean: + rm -f ${OBJS} core login + +cleandir: clean + rm -f ${MAN} tags .depend + +depend: ${SRCS} + mkdep ${CFLAGS} ${SRCS} + +install: login + install -s -o root -g bin -m 4755 login ${DESTDIR}/bin/login + +lint: ${SRCS} + lint ${CFLAGS} ${SRCS} + +tags: ${SRCS} + ctags ${SRCS} diff --git a/bin/login/login.c b/bin/login/login.c new file mode 100644 index 0000000..b84f31f --- /dev/null +++ b/bin/login/login.c @@ -0,0 +1,602 @@ +/* + * Copyright (c) 1980, 1987, 1988 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(DOSCCS) && !defined(lint) +char copyright[] = +"@(#) Copyright (c) 1980, 1987, 1988 The Regents of the University of California.\n\ + All rights reserved.\n"; + +static char sccsid[] = "@(#)login.c 5.40.2 (2.11BSD GTE) 1997/9/26"; +#endif + +/* + * login [ name ] + * login -h hostname (for telnetd, etc.) + * login -f name (for pre-authenticated login: datakit, xterm, etc.) + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "pathnames.h" + +#ifdef KERBEROS +#include +#include +char realm[REALM_SZ]; +int kerror = KSUCCESS, notickets = 1; +#endif + +#define TTYGRPNAME "tty" /* name of group to own ttys */ + +/* + * This bounds the time given to login. Not a define so it can + * be patched on machines where it's too small. + */ +int timeout = 300; + +struct passwd *pwd; +int failures; +char term[64], *hostname, *username, *tty; + +struct sgttyb sgttyb; +struct tchars tc = { + CINTR, CQUIT, CSTART, CSTOP, CEOT, CBRK +}; +struct ltchars ltc = { + CSUSP, CDSUSP, CRPRNT, CFLUSH, CWERASE, CLNEXT +}; + +char *months[] = + { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", + "Sep", "Oct", "Nov", "Dec" }; + +main(argc, argv) + int argc; + char **argv; +{ + extern int errno, optind; + extern char *optarg, **environ; + struct timeval tp; + struct tm *ttp; + struct group *gr; + register int ch; + register char *p; + int ask, fflag, hflag, pflag, cnt; + int quietlog, passwd_req, ioctlval, timedout(); + char *domain, *salt, *envinit[1], *ttyn, *pp; + char tbuf[MAXPATHLEN + 2], tname[sizeof(_PATH_TTY) + 10]; + char *ctime(), *ttyname(), *stypeof(), *crypt(), *getpass(); + time_t time(); + off_t lseek(); + + (void)signal(SIGALRM, timedout); + (void)alarm((u_int)timeout); + (void)signal(SIGQUIT, SIG_IGN); + (void)signal(SIGINT, SIG_IGN); + (void)setpriority(PRIO_PROCESS, 0, 0); + (void)quota(Q_SETUID, 0, 0, 0); + + /* + * -p is used by getty to tell login not to destroy the environment + * -f is used to skip a second login authentication + * -h is used by other servers to pass the name of the remote + * host to login so that it may be placed in utmp and wtmp + */ + (void)gethostname(tbuf, sizeof(tbuf)); + domain = index(tbuf, '.'); + + fflag = hflag = pflag = 0; + passwd_req = 1; + while ((ch = getopt(argc, argv, "fh:p")) != EOF) + switch (ch) { + case 'f': + fflag = 1; + break; + case 'h': + if (getuid()) { + (void)fprintf(stderr, + "login: -h for super-user only.\n"); + exit(1); + } + hflag = 1; + if (domain && (p = index(optarg, '.')) && + strcasecmp(p, domain) == 0) + *p = 0; + hostname = optarg; + break; + case 'p': + pflag = 1; + break; + case '?': + default: + (void)fprintf(stderr, + "usage: login [-fp] [username]\n"); + exit(1); + } + argc -= optind; + argv += optind; + if (*argv) { + username = *argv; + ask = 0; + } else + ask = 1; + + ioctlval = 0; + (void)ioctl(0, TIOCLSET, &ioctlval); + (void)ioctl(0, TIOCNXCL, 0); + (void)fcntl(0, F_SETFL, ioctlval); + (void)ioctl(0, TIOCGETP, &sgttyb); + sgttyb.sg_erase = CERASE; + sgttyb.sg_kill = CKILL; + (void)ioctl(0, TIOCSLTC, <c); + (void)ioctl(0, TIOCSETC, &tc); + (void)ioctl(0, TIOCSETP, &sgttyb); + + for (cnt = getdtablesize(); cnt > 2; cnt--) + close(cnt); + + ttyn = ttyname(0); + if (ttyn == NULL || *ttyn == '\0') { + (void)sprintf(tname, "%s??", _PATH_TTY); + ttyn = tname; + } + if (tty = rindex(ttyn, '/')) + ++tty; + else + tty = ttyn; + + openlog("login", LOG_ODELAY, LOG_AUTH); + + for (cnt = 0;; ask = 1) { + ioctlval = 0; + (void)ioctl(0, TIOCSETD, &ioctlval); + + if (ask) { + fflag = 0; + getloginname(); + } + /* + * Note if trying multiple user names; + * log failures for previous user name, + * but don't bother logging one failure + * for nonexistent name (mistyped username). + */ + if (failures && strcmp(tbuf, username)) { + if (failures > (pwd ? 0 : 1)) + badlogin(tbuf); + failures = 0; + } + (void)strcpy(tbuf, username); + if (pwd = getpwnam(username)) + salt = pwd->pw_passwd; + else + salt = "xx"; + + /* if user not super-user, check for disabled logins */ + if (pwd == NULL || pwd->pw_uid) + checknologin(); + + /* + * Disallow automatic login to root; if not invoked by + * root, disallow if the uid's differ. + */ + if (fflag && pwd) { + int uid = getuid(); + + passwd_req = pwd->pw_uid == 0 || + (uid && uid != pwd->pw_uid); + } + + /* + * If trying to log in as root, but with insecure terminal, + * refuse the login attempt. + */ + if (pwd->pw_uid == 0 && !rootterm(tty)) { + (void)fprintf(stderr, + "%s login refused on this terminal.\n", + pwd->pw_name); + if (hostname) + syslog(LOG_NOTICE, + "LOGIN %s REFUSED FROM %s ON TTY %s", + pwd->pw_name, hostname, tty); + else + syslog(LOG_NOTICE, + "LOGIN %s REFUSED ON TTY %s", + pwd->pw_name, tty); + continue; + } + + /* + * If no pre-authentication and a password exists + * for this user, prompt for one and verify it. + */ + if (!passwd_req || (pwd && !*pwd->pw_passwd)) + break; + + setpriority(PRIO_PROCESS, 0, -4); + pp = getpass("Password:"); + p = crypt(pp, salt); + setpriority(PRIO_PROCESS, 0, 0); + +#ifdef KERBEROS + + /* + * If not present in pw file, act as we normally would. + * If we aren't Kerberos-authenticated, try the normal + * pw file for a password. If that's ok, log the user + * in without issueing any tickets. + */ + + if (pwd && !krb_get_lrealm(realm,1)) { + /* + * get TGT for local realm; be careful about uid's + * here for ticket file ownership + */ + (void)setreuid(geteuid(),pwd->pw_uid); + kerror = krb_get_pw_in_tkt(pwd->pw_name, "", realm, + "krbtgt", realm, DEFAULT_TKT_LIFE, pp); + (void)setuid(0); + if (kerror == INTK_OK) { + bzero(pp, strlen(pp)); + notickets = 0; /* user got ticket */ + break; + } + } +#endif + (void) bzero(pp, strlen(pp)); + if (pwd && !strcmp(p, pwd->pw_passwd)) + break; + + (void)printf("Login incorrect\n"); + failures++; + /* we allow 10 tries, but after 3 we start backing off */ + if (++cnt > 3) { + if (cnt >= 10) { + badlogin(username); + (void)ioctl(0, TIOCHPCL, (struct sgttyb *)NULL); + sleepexit(1); + } + sleep((u_int)((cnt - 3) * 5)); + } + } + + /* committed to login -- turn off timeout */ + (void)alarm((u_int)0); + + /* paranoia... */ + endpwent(); + + if (quota(Q_SETUID, pwd->pw_uid, 0, 0) < 0 && errno != EINVAL) { + switch(errno) { + case EUSERS: + (void)fprintf(stderr, + "Too many users logged on already.\nTry again later.\n"); + break; + case EPROCLIM: + (void)fprintf(stderr, + "You have too many processes running.\n"); + break; + default: + perror("quota (Q_SETUID)"); + } + sleepexit(0); + } + + if (chdir(pwd->pw_dir) < 0) { + (void)printf("No directory %s!\n", pwd->pw_dir); + if (chdir("/")) + exit(0); + pwd->pw_dir = "/"; + (void)printf("Logging in with home = \"/\".\n"); + } + + quietlog = access(_PATH_HUSHLOGIN, F_OK) == 0; + +#ifdef KERBEROS + if (notickets && !quietlog) + (void)printf("Warning: no Kerberos tickets issued\n"); +#endif + +#define TWOWEEKS (14*24*60*60) + if (pwd->pw_change || pwd->pw_expire) + (void)gettimeofday(&tp, (struct timezone *)NULL); + if (pwd->pw_change) + if (tp.tv_sec >= pwd->pw_change) { + (void)printf("Sorry -- your password has expired.\n"); + sleepexit(1); + } + else if (pwd->pw_change - tp.tv_sec < TWOWEEKS && !quietlog) { + ttp = localtime(&pwd->pw_change); + (void)printf("Warning: your password expires on %s %d, %d\n", + months[ttp->tm_mon], ttp->tm_mday, TM_YEAR_BASE + ttp->tm_year); + } + if (pwd->pw_expire) + if (tp.tv_sec >= pwd->pw_expire) { + (void)printf("Sorry -- your account has expired.\n"); + sleepexit(1); + } + else if (pwd->pw_expire - tp.tv_sec < TWOWEEKS && !quietlog) { + ttp = localtime(&pwd->pw_expire); + (void)printf("Warning: your account expires on %s %d, %d\n", + months[ttp->tm_mon], ttp->tm_mday, TM_YEAR_BASE + ttp->tm_year); + } + + /* nothing else left to fail -- really log in */ + { + struct utmp utmp; + + bzero((char *)&utmp, sizeof(utmp)); + (void)time(&utmp.ut_time); + strncpy(utmp.ut_name, username, sizeof(utmp.ut_name)); + if (hostname) + strncpy(utmp.ut_host, hostname, sizeof(utmp.ut_host)); + strncpy(utmp.ut_line, tty, sizeof(utmp.ut_line)); + login(&utmp); + } + + dolastlog(quietlog); + + if (!hflag) { /* XXX */ + static struct winsize win = { 0, 0, 0, 0 }; + + (void)ioctl(0, TIOCSWINSZ, &win); + } + + (void)chown(ttyn, pwd->pw_uid, + (gr = getgrnam(TTYGRPNAME)) ? gr->gr_gid : pwd->pw_gid); + (void)chmod(ttyn, 0620); + (void)setgid(pwd->pw_gid); + + initgroups(username, pwd->pw_gid); + + quota(Q_DOWARN, pwd->pw_uid, (dev_t)-1, 0); + + if (*pwd->pw_shell == '\0') + pwd->pw_shell = _PATH_BSHELL; + /* turn on new line discipline for the csh */ + else if (!strcmp(pwd->pw_shell, _PATH_CSHELL)) { + ioctlval = NTTYDISC; + (void)ioctl(0, TIOCSETD, &ioctlval); + } + + /* destroy environment unless user has requested preservation */ + if (!pflag) + environ = envinit; + (void)setenv("HOME", pwd->pw_dir, 1); + (void)setenv("SHELL", pwd->pw_shell, 1); + if (term[0] == '\0') + strncpy(term, stypeof(tty), sizeof(term)); + (void)setenv("TERM", term, 0); + (void)setenv("USER", pwd->pw_name, 1); + (void)setenv("PATH", _PATH_DEFPATH, 0); + + if (tty[sizeof("tty")-1] == 'd') + syslog(LOG_INFO, "DIALUP %s, %s", tty, pwd->pw_name); + if (pwd->pw_uid == 0) + if (hostname) + syslog(LOG_NOTICE, "ROOT LOGIN ON %s FROM %s", + tty, hostname); + else + syslog(LOG_NOTICE, "ROOT LOGIN ON %s", tty); + + if (!quietlog) { + struct stat st; + + motd(); + (void)sprintf(tbuf, "%s/%s", _PATH_MAILDIR, pwd->pw_name); + if (stat(tbuf, &st) == 0 && st.st_size != 0) + (void)printf("You have %smail.\n", + (st.st_mtime > st.st_atime) ? "new " : ""); + } + + (void)signal(SIGALRM, SIG_DFL); + (void)signal(SIGQUIT, SIG_DFL); + (void)signal(SIGINT, SIG_DFL); + (void)signal(SIGTSTP, SIG_IGN); + + tbuf[0] = '-'; + strcpy(tbuf + 1, (p = rindex(pwd->pw_shell, '/')) ? + p + 1 : pwd->pw_shell); + + if (setlogin(pwd->pw_name) < 0) + fprintf(stderr, "login: setlogin(): %s\n", strerror(errno)); + + /* discard permissions last so can't get killed and drop core */ + (void)setuid(pwd->pw_uid); + + execlp(pwd->pw_shell, tbuf, 0); + (void)fprintf(stderr, "login: no shell: %s\n", strerror(errno)); + exit(0); +} + +getloginname() +{ + register int ch; + register char *p; + static char nbuf[UT_NAMESIZE + 1]; + + for (;;) { + (void)printf("login: "); + for (p = nbuf; (ch = getchar()) != '\n'; ) { + if (ch == EOF) { + badlogin(username); + exit(0); + } + if (p < nbuf + UT_NAMESIZE) + *p++ = ch; + } + if (p > nbuf) + if (nbuf[0] == '-') + (void)fprintf(stderr, + "login names may not start with '-'.\n"); + else { + *p = '\0'; + username = nbuf; + break; + } + } +} + +timedout() +{ + (void)fprintf(stderr, "Login timed out after %d seconds\n", timeout); + exit(0); +} + +rootterm(ttyn) + char *ttyn; +{ + struct ttyent *t; + + return((t = getttynam(ttyn)) && t->ty_status&TTY_SECURE); +} + +jmp_buf motdinterrupt; + +motd() +{ + register int fd, nchars; + int (*oldint)(), sigint(); + char tbuf[BUFSIZ]; + + if ((fd = open(_PATH_MOTDFILE, O_RDONLY, 0)) < 0) + return; + oldint = signal(SIGINT, sigint); + if (setjmp(motdinterrupt) == 0) + while ((nchars = read(fd, tbuf, sizeof(tbuf))) > 0) + (void)write(fileno(stdout), tbuf, nchars); + (void)signal(SIGINT, oldint); + (void)close(fd); +} + +sigint() +{ + longjmp(motdinterrupt, 1); +} + +checknologin() +{ + register int fd, nchars; + char tbuf[BUFSIZ]; + + if ((fd = open(_PATH_NOLOGIN, O_RDONLY, 0)) >= 0) { + while ((nchars = read(fd, tbuf, sizeof(tbuf))) > 0) + (void)write(fileno(stdout), tbuf, nchars); + sleepexit(0); + } +} + +dolastlog(quiet) + int quiet; +{ + struct lastlog ll; + int fd; + char *ctime(); + + if ((fd = open(_PATH_LASTLOG, O_RDWR, 0)) >= 0) { + (void)lseek(fd, (off_t)pwd->pw_uid * sizeof(ll), L_SET); + if (!quiet) { + if (read(fd, (char *)&ll, sizeof(ll)) == sizeof(ll) && + ll.ll_time != 0) { + (void)printf("Last login: %.*s ", + 24-5, (char *)ctime(&ll.ll_time)); + if (*ll.ll_host != '\0') + (void)printf("from %.*s\n", + sizeof(ll.ll_host), ll.ll_host); + else + (void)printf("on %.*s\n", + sizeof(ll.ll_line), ll.ll_line); + } + (void)lseek(fd, (off_t)pwd->pw_uid * sizeof(ll), L_SET); + } + bzero((char *)&ll, sizeof(ll)); + (void)time(&ll.ll_time); + strncpy(ll.ll_line, tty, sizeof(ll.ll_line)); + if (hostname) + strncpy(ll.ll_host, hostname, sizeof(ll.ll_host)); + (void)write(fd, (char *)&ll, sizeof(ll)); + (void)close(fd); + } +} + +badlogin(name) + char *name; +{ + if (failures == 0) + return; + if (hostname) + syslog(LOG_NOTICE, "%d LOGIN FAILURE%s FROM %s, %s", + failures, failures > 1 ? "S" : "", hostname, name); + else + syslog(LOG_NOTICE, "%d LOGIN FAILURE%s ON %s, %s", + failures, failures > 1 ? "S" : "", tty, name); +} + +#undef UNKNOWN +#define UNKNOWN "su" + +char * +stypeof(ttyid) + char *ttyid; +{ + struct ttyent *t; + + return(ttyid && (t = getttynam(ttyid)) ? t->ty_type : UNKNOWN); +} + +getstr(buf, cnt, err) + char *buf, *err; + int cnt; +{ + char ch; + + do { + if (read(0, &ch, sizeof(ch)) != sizeof(ch)) + exit(1); + if (--cnt < 0) { + (void)fprintf(stderr, "%s too long\r\n", err); + sleepexit(1); + } + *buf++ = ch; + } while (ch); +} + +sleepexit(eval) + int eval; +{ + sleep((u_int)5); + exit(eval); +} diff --git a/bin/login/pathnames.h b/bin/login/pathnames.h new file mode 100644 index 0000000..a75c5ce --- /dev/null +++ b/bin/login/pathnames.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 1989 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * @(#)pathnames.h 5.3 (Berkeley) 5/9/89 + */ + +#include + +#define _PATH_DEFPATH "/bin:/usr/ucb:/usr/bin:/usr/games:" +#define _PATH_HUSHLOGIN ".hushlogin" +#define _PATH_LASTLOG "/usr/adm/lastlog" +#define _PATH_MAILDIR "/usr/spool/mail" +#define _PATH_MOTDFILE "/etc/motd" +#define _PATH_NOLOGIN "/etc/nologin" diff --git a/bin/ls/Makefile b/bin/ls/Makefile new file mode 100644 index 0000000..3b98c2b --- /dev/null +++ b/bin/ls/Makefile @@ -0,0 +1,29 @@ +# +# Public Domain. 12/3/1994 - Steven Schultz +# +# @(#)Makefile 1.1 (2.11BSD GTE) 1996/1/12 +# +CFLAGS= -O +SEPFLAG= -i +SRCS= ls.c stat_flags.c +OBJS= ls.o stat_flags.o + +all: ls + +ls: ${OBJS} + ${CC} ${CFLAGS} ${SEPFLAG} -o $@ ${OBJS} + +clean: + rm -f ${OBJS} ls tags + +depend: ${SRCS} + mkdep ${CFLAGS} ${SRCS} + +install: ls + install -s -o root -g bin -m 755 ls ${DESTDIR}/bin/ls + +lint: ${SRCS} + lint -hax ${SRCS} + +tags: ${SRCS} + ctags ${SRCS} diff --git a/bin/ls/ls.c b/bin/ls/ls.c new file mode 100644 index 0000000..8380daf --- /dev/null +++ b/bin/ls/ls.c @@ -0,0 +1,698 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if !defined(lint) && defined(DOSCCS) +char copyright[] = +"@(#) Copyright (c) 1980 Regents of the University of California.\n\ + All rights reserved.\n"; + +static char sccsid[] = "@(#)ls.c 5.9.2 (2.11BSD GTE) 1996/12/23"; +#endif + +/* + * ls + * + * 4.2bsd version for symbolic links, variable length + * directory entries, block size in the inode, etc. + */ +#include +#include +#include +#include +#include +#include +#include + +#define kbytes(size) (((size) + 1023) / 1024) + +struct afile { + char ftype; /* file type, e.g. 'd', 'c', 'f' */ + ino_t fnum; /* inode number of file */ + short fmode; /* mode&~S_IFMT, perhaps ISARG */ + u_short fflags; /* st_flags (uappnd, uchg, schg, ...) */ + short fnl; /* number of links */ + uid_t fuid; /* owner id */ + gid_t fgid; /* group id */ + off_t fsize; /* file size */ + long fblks; /* number of blocks used */ + time_t fmtime; /* time (modify or access or create) */ + char *fname; /* file name */ + char *flinkto; /* symbolic link value */ +}; + +#define ISARG 0x8000 /* extra ``mode'' */ + +struct subdirs { + char *sd_name; + struct subdirs *sd_next; +} *subdirs; + +char aflg, dflg, gflg, lflg, sflg, tflg, uflg, iflg, fflg, cflg, rflg = 1; +char oflg, qflg, Aflg, Cflg, Fflg, Lflg, Rflg, usetabs; + +time_t now, sixmonthsago; + +char *dotp = "."; + +struct winsize win; +int twidth; + +struct afile *gstat(); +int fcmp(); +char *cat(), *savestr(); +char *fmtentry(); +char *getname(), *getgroup(); + +main(argc, argv) + int argc; + char *argv[]; +{ + extern int optind; + struct afile *fp0, *fplast; + register struct afile *fp; + struct sgttyb sgbuf; + int ch, i; + time_t time(); + + Aflg = !getuid(); + (void) time(&now); sixmonthsago = now - 6L*30L*24L*60L*60L; now += 60; + twidth = 80; + if (isatty(1)) { + qflg = Cflg = 1; + (void) gtty(1, &sgbuf); + if (ioctl(1, TIOCGWINSZ, &win) != -1) + twidth = (win.ws_col == 0 ? 80 : win.ws_col); + if ((sgbuf.sg_flags & XTABS) != XTABS) + usetabs = 1; + } else + usetabs = 1; + while ((ch = getopt(argc, argv, "1ACLFRacdfgiloqrstu")) != EOF) + switch((char)ch) { +/* + * The -1, -C, and -l options override each other so shell aliasing + * works right. +*/ + case '1': + lflg = 0; + Cflg = 0; break; + case 'C': + lflg = 0; + Cflg = 1; break; + case 'l': + Cflg = 0; + lflg++; break; + case 'A': + Aflg++; break; + case 'L': + Lflg++; break; + case 'F': + Fflg++; break; + case 'R': + Rflg++; break; + case 'a': + aflg++; break; + case 'c': + uflg = 0; /* -c overrides -u */ + cflg++; break; + case 'd': + Rflg = 0; /* -d overrides -R */ + dflg++; break; + case 'f': + fflg++; break; + case 'g': + gflg++; break; + case 'i': + iflg++; break; + case 'o': + oflg++; break; + case 'q': + qflg = 1; break; + case 'r': + rflg = -1; break; + case 's': + sflg++; break; + case 't': + tflg++; break; + case 'u': + cflg = 0; /* -u overrides -c */ + uflg++; break; + case '?': + default: + fputs("usage: ls [ -1ACLFRacdfgiloqrstu ] [ file ]\n", stderr); + exit(1); + } + if (!lflg) + oflg = 0; + if (fflg) { + Aflg++; + aflg++; lflg = 0; sflg = 0; tflg = 0; + } + if (lflg) + Cflg = 0; + argc -= optind; + argv += optind; + if (argc == 0) { + argc++; + argv = &dotp; + } + fp = (struct afile *)calloc((u_int)argc, sizeof (struct afile)); + if (fp == 0) { + fputs("ls: out of memory\n", stderr); + exit(1); + } + fp0 = fp; + for (i = 0; i < argc; i++) { + if (gstat(fp, *argv, 1, (int *)0)) { + fp->fname = *argv; + fp->fmode |= ISARG; + fp++; + } + argv++; + } + fplast = fp; + if (fflg == 0) + qsort(fp0, fplast - fp0, sizeof (struct afile), fcmp); + if (dflg) { + formatf(fp0, fplast); + exit(0); + } + + if (fflg) + fp = fp0; + else { + for (fp = fp0; fp < fplast && fp->ftype != 'd'; fp++) + continue; + formatf(fp0, fp); + } + + if (fp < fplast) { + if (fp > fp0) + putchar('\n'); + for (;;) { + formatd(fp->fname, argc > 1); + while (subdirs) { + struct subdirs *t; + + t = subdirs; subdirs = t->sd_next; + putchar('\n'); + formatd(t->sd_name, 1); + cfree(t->sd_name); + cfree((char *)t); + } + if (++fp == fplast) + break; + putchar('\n'); + } + } + exit(0); +} + +formatd(name, dotitle) + char *name; + int dotitle; +{ + register struct afile *fp; + register struct subdirs *dp; + struct afile *dfp0, *dfplast; + int isadir; + long nkb, getdir(); + + nkb = getdir(name, &dfp0, &dfplast, &isadir); + if (dfp0 == 0) + return; + if (fflg == 0) + qsort(dfp0, dfplast - dfp0, sizeof (struct afile), fcmp); + if (dotitle) + printf("%s%s\n", name, isadir ? ":" : ""); + if (lflg || sflg) + printf("total %ld\n", nkb); + formatf(dfp0, dfplast); + if (Rflg) + for (fp = dfplast - 1; fp >= dfp0; fp--) { + if (fp->ftype != 'd' || + !strcmp(fp->fname, ".") || + !strcmp(fp->fname, "..")) + continue; + dp = (struct subdirs *)malloc(sizeof (struct subdirs)); + dp->sd_name = savestr(cat(name, fp->fname)); + dp->sd_next = subdirs; subdirs = dp; + } + for (fp = dfp0; fp < dfplast; fp++) { + if ((fp->fmode&ISARG) == 0 && fp->fname) + cfree(fp->fname); + if (fp->flinkto) + cfree(fp->flinkto); + } + cfree((char *)dfp0); +} + +long +getdir(dir, pfp0, pfplast, isadir) + char *dir; + struct afile **pfp0, **pfplast; + int *isadir; +{ + register struct afile *fp; + DIR *dirp; + register struct direct *dp; + struct stat st; + long nb; + int nent = 20; + + dirp = opendir(dir); + if (dirp == NULL) { + *pfp0 = *pfplast = NULL; + printf("%s unreadable\n", dir); /* not stderr! */ + return (0); + } + fstat(dirfd(dirp), &st); + if (S_ISDIR(st.st_mode)) + *isadir = 1; + else + *isadir = 0; + fp = *pfp0 = (struct afile *)calloc(nent, sizeof (struct afile)); + *pfplast = *pfp0 + nent; + nb = 0; + while (dp = readdir(dirp)) { + if (dp->d_ino == 0) + continue; + if (aflg == 0 && dp->d_name[0]=='.' && + (Aflg == 0 || dp->d_name[1]==0 || + dp->d_name[1]=='.' && dp->d_name[2]==0)) + continue; + if (gstat(fp, cat(dir, dp->d_name), Fflg+Rflg, &nb) == 0) + continue; + fp->fnum = dp->d_ino; + fp->fname = savestr(dp->d_name); + fp++; + if (fp == *pfplast) { + *pfp0 = (struct afile *)realloc((char *)*pfp0, + 2 * nent * sizeof (struct afile)); + if (*pfp0 == 0) { + fputs("ls: out of memory\n", stderr); + exit(1); + } + fp = *pfp0 + nent; + *pfplast = fp + nent; + nent *= 2; + } + } + closedir(dirp); + *pfplast = fp; + return (kbytes(dbtob(nb))); +} + +int stat(), lstat(); + +struct afile * +gstat(fp, file, statarg, pnb) + register struct afile *fp; + char *file; + int statarg; + long *pnb; +{ + int (*statf)() = Lflg ? stat : lstat; + char buf[BUFSIZ]; int cc; + static struct afile azerofile; + + *fp = azerofile; + fp->fmode = 0; + fp->fnum = 0; + fp->ftype = '-'; + if (statarg || sflg || lflg || tflg) { + struct stat stb, stb1; + + if ((*statf)(file, &stb) < 0) { + if (statf == lstat || lstat(file, &stb) < 0) { + fprintf(stderr, "%s not found\n", file); + return (0); + } + } + fp->fblks = stb.st_blocks; + fp->fsize = stb.st_size; + switch (stb.st_mode & S_IFMT) { + + case S_IFDIR: + fp->ftype = 'd'; break; + case S_IFBLK: + fp->ftype = 'b'; fp->fsize = stb.st_rdev; break; + case S_IFCHR: + fp->ftype = 'c'; fp->fsize = stb.st_rdev; break; + case S_IFSOCK: + fp->ftype = 's'; fp->fsize = 0; break; + case S_IFLNK: + fp->ftype = 'l'; + if (lflg) { + cc = readlink(file, buf, BUFSIZ); + if (cc >= 0) { + buf[cc] = 0; + fp->flinkto = savestr(buf); + } + break; + } + if (stat(file, &stb1) < 0) + break; + if ((stb1.st_mode & S_IFMT) == S_IFDIR) { + stb = stb1; + fp->ftype = 'd'; + fp->fsize = stb.st_size; + fp->fblks = stb.st_blocks; + } + break; + } + fp->fnum = stb.st_ino; + fp->fmode = stb.st_mode & ~S_IFMT; + fp->fflags = stb.st_flags; + fp->fnl = stb.st_nlink; + fp->fuid = stb.st_uid; + fp->fgid = stb.st_gid; + if (uflg) + fp->fmtime = stb.st_atime; + else if (cflg) + fp->fmtime = stb.st_ctime; + else + fp->fmtime = stb.st_mtime; + if (pnb) + *pnb += stb.st_blocks; + } + return (fp); +} + +formatf(fp0, fplast) + struct afile *fp0, *fplast; +{ + register struct afile *fp; + register int i, j, w; + int width = 0, nentry = fplast - fp0; + int columns, lines, maxflags; + char *cp; + + if (fp0 == fplast) + return; + maxflags = 0; + if (oflg) { + for (fp = fp0; fp < fplast; fp++) + { + i = strlen(flags_to_string(fp->fflags, "-")); + if (i > maxflags) + maxflags = i; + } + } + if (lflg || Cflg == 0) + columns = 1; + else { + for (fp = fp0; fp < fplast; fp++) { + int len = strlen(fmtentry(fp, maxflags)); + + if (len > width) + width = len; + } + if (usetabs) + width = (width + 8) &~ 7; + else + width += 2; + columns = twidth / width; + if (columns == 0) + columns = 1; + } + lines = (nentry + columns - 1) / columns; + for (i = 0; i < lines; i++) { + for (j = 0; j < columns; j++) { + fp = fp0 + j * lines + i; + cp = fmtentry(fp, maxflags); + fputs(cp, stdout); + if (fp + lines >= fplast) { + putchar('\n'); + break; + } + w = strlen(cp); + while (w < width) + if (usetabs) { + w = (w + 8) &~ 7; + putchar('\t'); + } else { + w++; + putchar(' '); + } + } + } +} + +fcmp(f1, f2) + register struct afile *f1, *f2; +{ + + if (dflg == 0 && fflg == 0) { + if ((f1->fmode&ISARG) && f1->ftype == 'd') { + if ((f2->fmode&ISARG) == 0 || f2->ftype != 'd') + return (1); + } else { + if ((f2->fmode&ISARG) && f2->ftype == 'd') + return (-1); + } + } + if (tflg) { + if (f2->fmtime == f1->fmtime) + return (0); + if (f2->fmtime > f1->fmtime) + return (rflg); + return (-rflg); + } + return (rflg * strcmp(f1->fname, f2->fname)); +} + +char * +cat(dir, file) + char *dir, *file; +{ + static char dfile[BUFSIZ]; + register int dlen; + + if ((dlen = strlen(dir))+1+strlen(file)+1 > BUFSIZ) { + fputs("ls: filename too long\n", stderr); + exit(1); + } + if (!dir[0] || dir[0] == '.' && !dir[1]) + return(strcpy(dfile, file)); + (void) strcpy(dfile, dir); + if (dir[dlen - 1] != '/' && *file != '/') + dfile[dlen++] = '/'; + (void) strcpy(dfile + dlen, file); + return (dfile); +} + +char * +savestr(str) + char *str; +{ + register char *cp = strdup(str); + + if (cp == NULL) { + fputs("ls: out of memory\n", stderr); + exit(1); + } + return(cp); +} + +char *fmtinum(), *fmtsize(), *fmtlstuff(), *fmtmode(); + +char * +fmtentry(fp, maxflags) + register struct afile *fp; + int maxflags; +{ + static char fmtres[BUFSIZ]; + register char *cp, *dp; + + (void) sprintf(fmtres, "%s%s%s", + iflg ? fmtinum(fp) : "", + sflg ? fmtsize(fp) : "", + lflg ? fmtlstuff(fp, maxflags) : ""); + dp = &fmtres[strlen(fmtres)]; + for (cp = fp->fname; *cp; cp++) + if (qflg && (*cp < ' ' || *cp >= 0177)) + *dp++ = '?'; + else + *dp++ = *cp; + if (Fflg) { + if (fp->ftype == 'd') + *dp++ = '/'; + else if (fp->ftype == 'l') + *dp++ = '@'; + else if (fp->ftype == 's') + *dp++ = '='; + else if (fp->fmode & 0111) + *dp++ = '*'; + } + if (lflg && fp->flinkto) { + (void) strcpy(dp, " -> "); dp += 4; + for (cp = fp->flinkto; *cp; cp++) + if (qflg && (*cp < ' ' || *cp >= 0177)) + *dp++ = '?'; + else + *dp++ = *cp; + } + *dp++ = 0; + return (fmtres); +} + +char * +fmtinum(p) + register struct afile *p; +{ + static char inumbuf[8]; + + (void) sprintf(inumbuf, "%6u ", p->fnum); + return (inumbuf); +} + +char * +fmtsize(p) + register struct afile *p; +{ + static char sizebuf[16]; + + (void) sprintf(sizebuf, "%4ld ", kbytes(dbtob(p->fblks))); + return (sizebuf); +} + +char * +fmtlstuff(p, maxflags) + register struct afile *p; + int maxflags; +{ + static char lstuffbuf[256]; + char gname[32], uname[32], fsize[32], ftime[32], fflags[64]; + register char *lp = lstuffbuf; + + /* type mode uname gname fsize ftime */ +/* get uname */ + { char *cp = getname(p->fuid); + if (cp) + (void) sprintf(uname, "%-9.9s", cp); + else + (void) sprintf(uname, "%-9u", p->fuid); + } +/* get gname */ + if (gflg) { + char *cp = getgroup(p->fgid); + if (cp) + (void) sprintf(gname, "%-9.9s", cp); + else + (void) sprintf(gname, "%-9u", p->fgid); + } +/* get flags */ + if (oflg) + (void) sprintf(fflags, "%-*s ", maxflags, + flags_to_string(p->fflags, "-")); +/* get fsize */ + if (p->ftype == 'b' || p->ftype == 'c') + (void) sprintf(fsize, "%3d,%4d", + major(p->fsize), minor(p->fsize)); + else if (p->ftype == 's') + (void) sprintf(fsize, "%8ld", 0L); + else + (void) sprintf(fsize, "%8ld", p->fsize); +/* get ftime */ + { char *cp = ctime(&p->fmtime); + if ((p->fmtime < sixmonthsago) || (p->fmtime > now)) + (void) sprintf(ftime, " %-7.7s %-4.4s ", cp+4, cp+20); + else + (void) sprintf(ftime, " %-12.12s ", cp+4); + } +/* splat */ + *lp++ = p->ftype; + lp = fmtmode(lp, p->fmode); + (void) sprintf(lp, "%3d %s%s%s%s%s", + p->fnl, uname, gflg ? gname : "", oflg ? fflags : "", fsize, ftime); + return (lstuffbuf); +} + +int m1[] = { 1, S_IREAD>>0, 'r', '-' }; +int m2[] = { 1, S_IWRITE>>0, 'w', '-' }; +int m3[] = { 3, S_ISUID|(S_IEXEC>>0), 's', S_ISUID, 'S', S_IEXEC>>0, 'x', '-' }; +int m4[] = { 1, S_IREAD>>3, 'r', '-' }; +int m5[] = { 1, S_IWRITE>>3, 'w', '-' }; +int m6[] = { 3, S_ISGID|(S_IEXEC>>3), 's', S_ISGID, 'S', S_IEXEC>>3, 'x', '-' }; +int m7[] = { 1, S_IREAD>>6, 'r', '-' }; +int m8[] = { 1, S_IWRITE>>6, 'w', '-' }; +int m9[] = { 3, S_ISVTX|(S_IEXEC>>6), 't', S_ISVTX, 'T', S_IEXEC>>6, 'x', '-' }; + +int *m[] = { m1, m2, m3, m4, m5, m6, m7, m8, m9}; + +char * +fmtmode(lp, flags) + char *lp; + register int flags; +{ + int **mp; + + for (mp = &m[0]; mp < &m[sizeof(m)/sizeof(m[0])]; ) { + register int *pairp = *mp++; + register int n = *pairp++; + + while (--n >= 0 && (flags&*pairp) != *pairp) + pairp += 2; + *lp++ = pairp[n>=0]; + } + return (lp); +} + +/* rest should be done with nameserver or database */ + +#include +#include +#include + +struct utmp utmp; +#define NMAX (sizeof (utmp.ut_name)) +#define SCPYN(a, b) strncpy(a, b, NMAX) + +#define NCACHE 64 /* power of 2 */ +#define CAMASK NCACHE - 1 + +char * +getname(uid) + uid_t uid; +{ + static struct ncache { + uid_t uid; + char name[NMAX+1]; + } c_uid[NCACHE]; + register struct passwd *pw; + register struct ncache *cp; + + setpassent(1); + cp = c_uid + (uid & CAMASK); + if (cp->uid == uid && *cp->name) + return(cp->name); + if (!(pw = getpwuid(uid))) + return((char *)0); + cp->uid = uid; + SCPYN(cp->name, pw->pw_name); + return(cp->name); +} + +char * +getgroup(gid) + gid_t gid; +{ + static struct ncache { + gid_t gid; + char name[NMAX+1]; + } c_gid[NCACHE]; + register struct group *gr; + register struct ncache *cp; + + cp = c_gid + (gid & CAMASK); + if (cp->gid == gid && *cp->name) + return(cp->name); + if (!(gr = getgrgid(gid))) + return((char *)0); + cp->gid = gid; + SCPYN(cp->name, gr->gr_name); + return(cp->name); +} diff --git a/bin/ls/stat_flags.c b/bin/ls/stat_flags.c new file mode 100644 index 0000000..1d0fd48 --- /dev/null +++ b/bin/ls/stat_flags.c @@ -0,0 +1,154 @@ +/*- + * Copyright (c) 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. 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. + */ + +#if !defined(lint) && defined(DOSCCS) +static char sccsid[] = "@(#)stat_flags.c 8.1.1 (2.11BSD GTE) 12/3/94"; +#endif + +/* + * Modified from the 4.4-Lite version for 2.11BSD. Main change was to + * use 'u_short' instead of 'u_long' for the flags word. +*/ + +#include +#include +#include +#include + +#define SAPPEND(s) { \ + if (prefix != NULL) \ + (void)strcat(string, prefix); \ + (void)strcat(string, s); \ + prefix = ","; \ +} + +/* + * flags_to_string -- + * Convert stat flags to a comma-separated string. If no flags + * are set, return the default string. + */ +char * +flags_to_string(flags, def) + register u_short flags; + char *def; +{ + static char string[64]; + register char *prefix; + + string[0] = '\0'; + prefix = NULL; + if (flags & UF_APPEND) + SAPPEND("uappnd"); + if (flags & UF_IMMUTABLE) + SAPPEND("uchg"); + if (flags & UF_NODUMP) + SAPPEND("nodump"); + if (flags & SF_APPEND) + SAPPEND("sappnd"); + if (flags & SF_ARCHIVED) + SAPPEND("arch"); + if (flags & SF_IMMUTABLE) + SAPPEND("schg"); + return (prefix == NULL && def != NULL ? def : string); +} + +#define TEST(a, b, f) { \ + if (!memcmp(a, b, sizeof(b))) { \ + if (clear) { \ + if (clrp) \ + *clrp |= (f); \ + } else if (setp) \ + *setp |= (f); \ + break; \ + } \ +} + +/* + * string_to_flags -- + * Take string of arguments and return stat flags. Return 0 on + * success, 1 on failure. On failure, stringp is set to point + * to the offending token. + */ +u_short +string_to_flags(stringp, setp, clrp) + char **stringp; + register u_short *setp, *clrp; +{ + int clear; + char *string; + register char *p; + + if (setp) + *setp = 0; + if (clrp) + *clrp = 0; + string = *stringp; + while ((p = strsep(&string, "\t ,")) != NULL) { + *stringp = p; + if (*p == '\0') + continue; + if (p[0] == 'n' && p[1] == 'o') { + clear = 1; + p += 2; + } + else + clear = 0; /* This was done only once on entry! */ + switch (p[0]) { + case 'a': + TEST(p, "arch", SF_ARCHIVED); + TEST(p, "archived", SF_ARCHIVED); + return (1); + case 'd': + clear = !clear; + TEST(p, "dump", UF_NODUMP); + return (1); + case 's': + TEST(p, "sappnd", SF_APPEND); + TEST(p, "sappend", SF_APPEND); + TEST(p, "schg", SF_IMMUTABLE); + TEST(p, "schange", SF_IMMUTABLE); + TEST(p, "simmutable", SF_IMMUTABLE); + return (1); + case 'u': + TEST(p, "uappnd", UF_APPEND); + TEST(p, "uappend", UF_APPEND); + TEST(p, "uchg", UF_IMMUTABLE); + TEST(p, "uchange", UF_IMMUTABLE); + TEST(p, "uimmutable", UF_IMMUTABLE); + /* FALLTHROUGH */ + default: + return (1); + } + } + return (0); +} diff --git a/bin/mail.c b/bin/mail.c new file mode 100644 index 0000000..a25176c --- /dev/null +++ b/bin/mail.c @@ -0,0 +1,729 @@ +#if !defined(lint) && defined(DOSCCS) +static char sccsid[] = "@(#)mail.c 4.33.6 (2.11BSD) 1999/10/25"; +#endif + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + /* copylet flags */ +#define REMOTE 1 /* remote mail, add rmtmsg */ +#define ORDINARY 2 +#define ZAP 3 /* zap header and trailing empty line */ +#define FORWARD 4 + +#define LSIZE 256 +#define MAXLET 300 /* maximum number of letters */ +#define MAILMODE 0600 /* 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; +char lettmp[] = "/tmp/maXXXXX"; +char maildir[] = "/usr/spool/mail/"; +char mailfile[] = "/usr/spool/mail/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; +char dead[] = "dead.letter"; +char forwmsg[] = " forwarded\n"; +FILE *tmpf; +FILE *malf; +char my_name[60]; +int error; +int changed; +int forward; +char from[] = "From "; +int delex(); +int flgf; +int flgp; +int delflg = 1; +int hseqno; +jmp_buf sjbuf; +int rmail; + +main(argc, argv) +char **argv; +{ + register int i; + char *name; + struct passwd *pwent; + + if (!(name = getlogin()) || !*name || !(pwent = getpwnam(name)) || + getuid() != pwent->pw_uid) + pwent = getpwuid(getuid()); + strncpy(my_name, pwent ? pwent->pw_name : "???", sizeof(my_name)-1); + if (setjmp(sjbuf)) + done(); + for (i=SIGHUP; i<=SIGTERM; i++) + setsig(i, delex); + i = mkstemp(lettmp); + tmpf = fdopen(i, "r+w"); + if (i < 0 || tmpf == NULL) + panic("mail: %s: cannot open for writing", lettmp); + /* + * This protects against others reading mail from temp file and + * if we exit, the file will be deleted already. + */ + unlink(lettmp); + if (argv[0][0] == 'r') + rmail++; + if (argv[0][0] != 'r' && /* no favors for rmail*/ + (argc == 1 || argv[1][0] == '-' && !any(argv[1][1], "rhd"))) + printmail(argc, argv); + else + bulkmail(argc, argv); + done(); +} + +setsig(i, f) +int i; +sig_t f; +{ + if (signal(i, SIG_IGN) != SIG_IGN) + signal(i, f); +} + +any(c, str) + register int c; + register char *str; +{ + + while (*str) + if (c == *str++) + return(1); + return(0); +} + +printmail(argc, argv) + char **argv; +{ + int flg, i, j, print; + char *p, *getarg(); + struct stat statb; + + setuid(getuid()); + cat(mailfile, maildir, my_name); + for (; argc > 1; argv++, argc--) { + if (argv[1][0] != '-') + break; + switch (argv[1][1]) { + + case 'p': + flgp++; + /* fall thru... */ + case 'q': + delflg = 0; + break; + + case 'f': + if (argc >= 3) { + strcpy(mailfile, argv[2]); + argv++, argc--; + } + break; + + case 'b': + forward = 1; + break; + + default: + panic("unknown option %c", argv[1][1]); + /*NOTREACHED*/ + } + } + malf = fopen(mailfile, "r"); + if (malf == NULL) { + printf("No mail.\n"); + return; + } + flock(fileno(malf), LOCK_SH); + copymt(malf, tmpf); + fclose(malf); /* implicit unlock */ + fseek(tmpf, 0L, L_SET); + + 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); + fputs("? ", stdout); + fflush(stdout); + if (fgets(resp, LSIZE, stdin) == NULL) + break; + switch (resp[0]) { + + default: + printf("usage\n"); + case '?': + print = 0; + printf("q\tquit\n"); + printf("x\texit without changing mail\n"); + printf("p\tprint\n"); + printf("s[file]\tsave (default mbox)\n"); + printf("w[file]\tsame without header\n"); + printf("-\tprint previous\n"); + printf("d\tdelete\n"); + printf("+\tnext (no delete)\n"); + printf("m user\tmail to user\n"); + printf("! 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') { + p = getenv("HOME"); + if (p != 0) + cat(resp+1, p, "/mbox"); + else + cat(resp+1, "", "mbox"); + } + for (p = resp+1; (p = getarg(lfil, p)) != NULL; ) { + malf = fopen(lfil, "a"); + if (malf == NULL) { + printf("mail: %s: cannot append\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 (!sendmail(j, lfil, my_name)) + 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(); +} + +/* copy temp or whatever back to /usr/spool/mail */ +copyback() +{ + register int i, c; + sigset_t set; + int fd, new = 0; + struct stat stbuf; + + sigemptyset(&set); + sigaddset(&set, SIGINT); + sigaddset(&set, SIGHUP); + sigaddset(&set, SIGQUIT); + (void)sigprocmask(SIG_BLOCK, &set, NULL); + fd = open(mailfile, O_RDWR | O_CREAT, MAILMODE); + if (fd >= 0) { + flock(fd, LOCK_EX); + malf = fdopen(fd, "r+w"); + } + if (fd < 0 || malf == NULL) + panic("can't rewrite %s", lfil); + fstat(fd, &stbuf); + if (stbuf.st_size != let[nlet].adr) { /* new mail has arrived */ + fseek(malf, let[nlet].adr, L_SET); + fseek(tmpf, let[nlet].adr, L_SET); + while ((c = getc(malf)) != EOF) + putc(c, tmpf); + let[++nlet].adr = stbuf.st_size; + new = 1; + fseek(malf, 0L, L_SET); + } + ftruncate(fd, 0L); + for (i = 0; i < nlet; i++) + if (let[i].change != 'd') + copylet(i, malf, ORDINARY); + fclose(malf); /* implict unlock */ + if (new) + printf("New mail has arrived.\n"); + (void)sigprocmask(SIG_UNBLOCK, &set, NULL); +} + +/* copy mail (f1) to temp (f2) */ +copymt(f1, 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; + long k; + char hostname[MAXHOSTNAMELEN]; + + fseek(tmpf, let[n].adr, L_SET); + k = let[n+1].adr - let[n].adr; + while (k-- > 1 && (ch = getc(tmpf)) != '\n') + if (type != ZAP) + putc(ch, f); + switch (type) { + + case REMOTE: + gethostname(hostname, sizeof (hostname)); + fprintf(f, " remote from %s\n", hostname); + break; + + case FORWARD: + fprintf(f, forwmsg); + break; + + case ORDINARY: + putc(ch, f); + break; + + case ZAP: + break; + + default: + panic("Bad letter type %d to copylet.", type); + } + while (k-- > 1) { + ch = getc(tmpf); + putc(ch, f); + } + if (type != ZAP || ch != '\n') + putc(getc(tmpf), f); +} + +isfrom(lp) +register char *lp; +{ + register char *p; + + for (p = from; *p; ) + if (*lp++ != *p++) + return(0); + return(1); +} + +bulkmail(argc, argv) +char **argv; +{ + char *truename; + int first; + register char *cp; + char *newargv[1000]; + register char **ap; + register char **vp; + int dflag; + + dflag = 0; + delflg = 0; + if (argc < 1) { + fprintf(stderr, "puke\n"); + return; + } + for (vp = argv, ap = newargv + 1; (*ap = *vp++) != 0; ap++) + if (ap[0][0] == '-' && ap[0][1] == 'd') + dflag++; + if (!dflag) { + /* give it to sendmail, rah rah! */ + unlink(lettmp); + ap = newargv+1; + if (rmail) + *ap-- = "-s"; + *ap = "-sendmail"; + setuid(getuid()); + execv(_PATH_SENDMAIL, ap); + perror(_PATH_SENDMAIL); + exit(EX_UNAVAILABLE); + } + + truename = 0; + line[0] = '\0'; + + /* + * When we fall out of this, argv[1] should be first name, + * argc should be number of names + 1. + */ + + while (argc > 1 && *argv[1] == '-') { + cp = *++argv; + argc--; + switch (cp[1]) { + case 'r': + if (argc <= 1) + usage(); + truename = argv[1]; + fgets(line, LSIZE, stdin); + if (strncmp("From", line, 4) == 0) + line[0] = '\0'; + argv++; + argc--; + break; + + case 'h': + if (argc <= 1) + usage(); + hseqno = atoi(argv[1]); + argv++; + argc--; + break; + + case 'd': + break; + + default: + usage(); + } + } + if (argc <= 1) + usage(); + if (truename == 0) + truename = my_name; + time(&iop); + fprintf(tmpf, "%s%s %s", from, truename, ctime(&iop)); + iop = ftell(tmpf); + flgf = first = 1; + for (;;) { + if (first) { + first = 0; + if (*line == '\0' && fgets(line, LSIZE, stdin) == NULL) + break; + } else { + if (fgets(line, LSIZE, stdin) == NULL) + break; + } + if (*line == '.' && line[1] == '\n' && isatty(fileno(stdin))) + break; + if (isfrom(line)) + putc('>', tmpf); + fputs(line, tmpf); + flgf = 0; + } + putc('\n', tmpf); + nlet = 1; + let[0].adr = 0; + let[1].adr = ftell(tmpf); + if (flgf) + return; + while (--argc > 0) + if (!sendmail(0, *++argv, truename)) + error++; + if (error && safefile(dead)) { + setuid(getuid()); + malf = fopen(dead, "w"); + if (malf == NULL) { + printf("mail: cannot open %s\n", dead); + fclose(tmpf); + return; + } + copylet(0, malf, ZAP); + fclose(malf); + printf("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 pid; + int sts; + + for (p=rsys; *name!='!'; *p++ = *name++) + if (*name=='\0') + return(0); /* local address, no '!' */ + *p = '\0'; + if (name[1]=='\0') { + printf("null name\n"); + return(0); + } +skip: + 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 (any('!', name+1)) + (void)sprintf(cmd, "uux - %s!rmail \\(%s\\)", rsys, name+1); + else + (void)sprintf(cmd, "uux - %s!rmail %s", rsys, name+1); + if ((rmf=popen(cmd, "w")) == NULL) + exit(1); + copylet(n, rmf, REMOTE); + exit(pclose(rmf) != 0); +} + +usage() +{ + + fprintf(stderr, "Usage: mail [ -f ] people . . .\n"); + error = EX_USAGE; + done(); +} + +#include +#include +#include + +notifybiff(msg) + char *msg; +{ + static struct sockaddr_in addr; + static int f = -1; + + if (addr.sin_family == 0) { + struct hostent *hp = gethostbyname("localhost"); + struct servent *sp = getservbyname("biff", "udp"); + + if (hp && sp) { + addr.sin_family = hp->h_addrtype; + bcopy(hp->h_addr, &addr.sin_addr, hp->h_length); + addr.sin_port = sp->s_port; + } + } + if (addr.sin_family) { + if (f < 0) + f = socket(AF_INET, SOCK_DGRAM, 0); + if (f >= 0) + sendto(f, msg, strlen(msg)+1, 0, &addr, sizeof (addr)); + } +} + +sendmail(n, name, fromaddr) + int n; + char *name, *fromaddr; +{ + char file[256]; + int fd; + struct passwd *pw; + char buf[128]; + off_t oldsize; + + if (*name=='!') + name++; + if (any('!', name)) + return (sendrmt(n, name)); + if ((pw = getpwnam(name)) == NULL) { + printf("mail: can't send to %s\n", name); + return(0); + } + cat(file, maildir, name); + if (!safefile(file)) + return(0); + fd = open(file, O_WRONLY | O_CREAT | O_EXLOCK, MAILMODE); + if (fd >= 0) + malf = fdopen(fd, "a"); + if (fd < 0 || malf == NULL) { + close(fd); + printf("mail: %s: cannot append\n", file); + return(0); + } + fchown(fd, pw->pw_uid, pw->pw_gid); + oldsize = ftell(malf); + (void)sprintf(buf, "%s@%ld\n", name, oldsize); + + copylet(n, malf, ORDINARY); /* Try to deliver the message */ + + /* If there is any error during the delivery of the message, + * the mail file may be corrupted (incomplete last line) and + * any subsequent mail will be apparently lost, since the + * before the 'From ' won't be there. So, restore the + * file to the pre-delivery size and report an error. + * + * fflush does "_flag |= _IOERR" so we don't need to check both the + # return from fflush and the ferror status. + */ + (void)fflush(malf); + if (ferror(malf)) { + printf("mail: %s: cannot append\n", file); + ftruncate(fd, oldsize); + fclose(malf); + return(0); + } + fclose(malf); + notifybiff(buf); + return(1); +} + +delex(i) +{ + sigset_t sigt; + + if (i != SIGINT) { + setsig(i, SIG_DFL); + sigemptyset(&sigt); + sigaddset(&sigt, i); + sigprocmask(SIG_UNBLOCK, &sigt, NULL); + } + putc('\n', stderr); + if (delflg) + longjmp(sjbuf, 1); + if (error == 0) + error = i; + done(); +} + +done() +{ + + unlink(lettmp); + exit(error); +} + +cat(to, from1, from2) + char *to, *from1, *from2; +{ + register char *cp, *dp; + + cp = to; + for (dp = from1; *cp = *dp++; cp++) + ; + for (dp = from2; *cp++ = *dp++; ) + ; +} + +/* copy p... into s, update p */ +char * +getarg(s, 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); +} + +safefile(f) + char *f; +{ + struct stat statb; + + if (lstat(f, &statb) < 0) + return (1); + if (statb.st_nlink != 1 || (statb.st_mode & S_IFMT) == S_IFLNK) { + fprintf(stderr, + "mail: %s has more than one link or is a symbolic link\n", + f); + return (0); + } + return (1); +} + +panic(msg, a1, a2, a3) + char *msg; +{ + + fprintf(stderr, "mail: "); + fprintf(stderr, msg, a1, a2, a3); + fprintf(stderr, "\n"); + done(); +} diff --git a/bin/make/Makefile b/bin/make/Makefile new file mode 100644 index 0000000..1bb1e94 --- /dev/null +++ b/bin/make/Makefile @@ -0,0 +1,44 @@ +# Description file for the Make command +# Makefile 4.5 94/1/3 + +OBJECTS=ident.o main.o doname.o misc.o files.o dosys.o gram.o +LIBES= +LINT= lint -ps +XSTR= /usr/ucb/xstr +CFLAGS= -O -I. -I../ar +SEPFLAG= -i + +# Special massaging of C files for sharing of strings +.c.o: + ${CC} -E ${CFLAGS} $*.c | ${XSTR} -c - + ${CC} -c ${CFLAGS} x.c + mv -f x.o $*.o + rm -f x.c + +all: make + +make: ${OBJECTS} strings.o + ${CC} -o make ${CFLAGS} ${SEPFLAG} ${OBJECTS} strings.o ${LIBES} + +${OBJECTS}: defs + +clean: + -rm -f *.o gram.c make a.out errs x.c xs.c strings + +install: make + install -s make ${DESTDIR}/bin/make + +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 -f gram.c + +gram.c: gram.y + yacc gram.y + fgrep -v "static char yaccpar_sccsid" y.tab.c >gram.c + rm -f y.tab.c + +strings.o: strings + ${XSTR} + ${CC} -c xs.c + mv -f xs.o strings.o + rm -f xs.c diff --git a/bin/make/defs b/bin/make/defs new file mode 100644 index 0000000..d090c9b --- /dev/null +++ b/bin/make/defs @@ -0,0 +1,144 @@ +/* defs 4.10.1 1996/10/27 */ +#include +#include +#include +#include + +#define SHELLCOM "/bin/sh" + +typedef long int TIMETYPE; + +/* to install metering, add a statement like + * #define METERFILE "/usr/sif/make/Meter" + * to turn metering on, set external variable meteron to 1. + */ + +/* 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 +#ifdef pdp11 +#define HASHSIZE 541 +#define NLEFTS 80 +#define NCHARS 500 +#define NINTS 250 +#define INMAX 1350 +#define OUTMAX 2300 +#define MAXDIR 10 +#else !pdp11 +#define HASHSIZE 1021 +#define NLEFTS 512 +#define NCHARS 500 +#define NINTS 250 +#define INMAX 7000 +#define OUTMAX 7000 +#define MAXDIR 10 +#endif /* pdp11 */ +#define QBUFMAX 5000 + +#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 int nopdir; +extern char junkname[ ]; + + + +struct nameblock + { + struct nameblock *nxtnameblock; + char *namep; + char *alias; + 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 dirhdr + { + struct dirhdr *nxtopendir; + DIR *dirfc; + char *dirn; + }; +extern struct dirhdr *firstod; + + +struct chain + { + struct chain *nextp; + char *datap; + }; + +char *copys(), *concat(), *subst(); +int *ckalloc(); +struct nameblock *srchname(), *makename(); +TIMETYPE exists(); diff --git a/bin/make/doname.c b/bin/make/doname.c new file mode 100644 index 0000000..216a229 --- /dev/null +++ b/bin/make/doname.c @@ -0,0 +1,361 @@ +/* static char *sccsid = "@(#)doname.c 4.9.2 (2.11BSD) 2000/2/12"; */ +#include "defs" +#include +#include + +/* 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 +*/ + +extern char *sys_siglist[], arfile[], *arfname; + +doname(p, reclevel, tval) +register struct nameblock *p; +int reclevel; +TIMETYPE *tval; +{ +int errstat; +u_char okdel1; +u_char 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; +#ifdef pdp11 +/* temp and sourcename are mutually exclusive - save 254 bytes of stack by + * reusing sourcename's buffer +*/ +char sourcename[256], prefix[256], *temp = sourcename, concsuff[20]; +#else +char sourcename[BUFSIZ], prefix[BUFSIZ], temp[BUFSIZ], concsuff[20]; +#endif +char *pnamep, *p1namep, *cp, *savenamep = NULL; +char *mkqlist(); +struct chain *qchain, *appendq(); + +{ + /* + * VPATH= ${PATH1}:${PATH2} didn't work. This fix is so ugly I don't + * even want to think about it. Basically it grabs VPATH and + * explicitly does macro expansion before resolving names. Why + * VPATH didn't get handled correctly I have no idea; the symptom + * was that, while macro expansion got done, the .c files in the + * non-local directories wouldn't be found. + */ + static struct varblock *vpath_cp; + struct varblock *varptr(); + static char vpath_exp[256]; + + if (!vpath_cp) { + vpath_cp = varptr("VPATH"); + if (vpath_cp->varval) { + subst(vpath_cp->varval, vpath_exp); + setvar("VPATH", vpath_exp); + } + } +} + +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); +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( ptimedepp==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 */ + +if (index(p->namep, '(')) { + savenamep = p->namep; + p->namep = arfname; +} + +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)) + { + if (savenamep) + pnamep = ".a"; + + 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); + if (p2->alias) setvar("<", copys(p2->alias)); + else setvar("<", copys(p2->namep)); + for(lp2=p1->linep ; lp2 ; lp2 = lp2->nxtlineblock) + if(implcom = lp2->shp) break; + goto endloop; + } + } + cp = rindex(prefix, '/'); + if (cp++ == 0) + cp = prefix; + setvar("*", cp); + } + } + +endloop: + if (savenamep) + p->namep = savenamep; + + +if(errstat==0 && (ptime0 ? tdep : prestime() ); + setvar("@", savenamep ? arfile : 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")) + { + if (p->alias) setvar("<", p->alias); + else 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)) == 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); +} + +docom(q) +struct shblock *q; +{ +register char *s; +struct varblock *varptr(); +register int ign, nopr; +char string[OUTMAX]; +char string2[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,string2); + fixname(string2, 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) ) + { + unsigned sig = status & 0177; + if( sig ) { + if (sig < NSIG && sys_siglist[sig] != NULL && + *sys_siglist[sig] != '\0') + printf("*** %s", sys_siglist[sig]); + else + printf("*** Signal %d", sig); + if (status & 0200) + printf(" - core dumped"); + } else + printf("*** Exit %d", (status>>8) & 0xff); + + if(nohalt) printf(" (ignored)\n"); + else printf("\n"); + fflush(stdout); + } + +return(status); +} + + +/* + 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(); + +if (q->depname == NULL) + return; +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/bin/make/dosys.c b/bin/make/dosys.c new file mode 100644 index 0000000..2b31cf5 --- /dev/null +++ b/bin/make/dosys.c @@ -0,0 +1,187 @@ +/* static char *sccsid = "@(#)dosys.c 4.10 (Berkeley) 12/23/84"; */ +#include "defs" +#include + +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 ); +} + +doshell(comstring,nohalt) +char *comstring; +int nohalt; +{ +#ifdef SHELLENV +char *getenv(), *rindex(); +char *shellcom = getenv("SHELL"); +char *shellstr; +#endif +if((waitpid = vfork()) == 0) + { + enbint(SIG_DFL); + doclose(); + +#ifdef SHELLENV + if (shellcom == 0) shellcom = SHELLCOM; + shellstr = rindex(shellcom, '/') + 1; + execl(shellcom, shellstr, (nohalt ? "-c" : "-ce"), comstring, 0); +#else + execl(SHELLCOM, "sh", (nohalt ? "-c" : "-ce"), comstring, 0); +#endif + fatal("Couldn't load Shell"); + } + +return( await() ); +} + + + + +int intrupt(); + +await() +{ +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); +} + +/* + * Close open directory files before exec'ing + */ +doclose() +{ +register struct dirhdr *od; + +for (od = firstod; od; od = od->nxtopendir) + if (od->dirfc != NULL) + /* + * vfork kludge... + * we cannot call closedir since this will modify + * the parents data space; just call close directly. + */ + close(od->dirfc->dd_fd); +} + + + +#define MAXARGV 254 /* execvp can only handle 254 anyhow */ + +doexec(str) +register char *str; +{ +register char *t; +static char *argv[MAXARGV]; /* docom() ate most of the stack already */ +register char **p; + +while( *str==' ' || *str=='\t' ) + ++str; +if( *str == '\0' ) + return(-1); /* no command */ + +p = argv; +for(t = str ; *t ; ) + { + if (p >= argv + MAXARGV) + fatal1("%s: Too many arguments.", str); + *p++ = t; + while(*t!=' ' && *t!='\t' && *t!='\0') + ++t; + if(*t) + for( *t++ = '\0' ; *t==' ' || *t=='\t' ; ++t) + ; + } + +*p = NULL; + +if((waitpid = vfork()) == 0) + { + enbint(SIG_DFL); + doclose(); + enbint(intrupt); + execvp(str, argv); + fatal1("Cannot load %s",str); + } + +return( await() ); +} + +#include + +#include + + + +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/bin/make/files.c b/bin/make/files.c new file mode 100644 index 0000000..9bde046 --- /dev/null +++ b/bin/make/files.c @@ -0,0 +1,630 @@ +/* static char *sccsid = "@(#)files.c 4.16.1 (2.11BSD) 1/3/94"; */ +#include +#include + +/* UNIX DEPENDENT PROCEDURES */ + +/* DEFAULT RULES FOR UNIX */ + +char *builtin[] = + { +#ifdef pwb + ".SUFFIXES : .L .out .a .o .c .f .e .r .y .yr .ye .l .s .z .x .t .h .cl", +#else + ".SUFFIXES : .out .a .o .c .F .f .e .r .y .yr .ye .l .s .cl .p", +#endif + "YACC=yacc", + "YACCR=yacc -r", + "YACCE=yacc -e", + "YFLAGS=", + "LEX=lex", + "LFLAGS=", + "CC=cc", +#if defined(vax) || defined(sun) || defined(tahoe) + "AS=as", +#else + "AS=as -", +#endif + "PC=pc", + "PFLAGS=", + "CFLAGS=", + "RC=f77", + "RFLAGS=", + "FC=f77", + "EFLAGS=", + "FFLAGS=", + "LOADLIBES=", +#ifdef pwb + "SCOMP=scomp", + "SCFLAGS=", + "CMDICT=cmdict", + "CMFLAGS=", +#endif + + ".c.a :", + "\t$(CC) $(CFLAGS) -c $<", + "\tar r $@ $*.o", + "\trm -f $*.o", + + ".c.o :", + "\t$(CC) $(CFLAGS) -c $<", + + ".p.o :", + "\t$(PC) $(PFLAGS) -c $<", + + ".cl.o :", + "\tclass -c $<", + + ".e.o .r.o .F.o .f.o :", + "\t$(FC) $(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) $(LFLAGS) $<", + "\tmv lex.yy.c $@", + + ".yr.r:", + "\t$(YACCR) $(YFLAGS) $<", + "\tmv y.tab.r $@", + + ".ye.e :", + "\t$(YACCE) $(YFLAGS) $<", + "\tmv y.tab.e $@", + +#ifdef pwb + ".o.L .c.L .t.L:", + "\t$(SCOMP) $(SCFLAGS) $<", + + ".t.o:", + "\t$(SCOMP) $(SCFLAGS) -c $<", + + ".t.c:", + "\t$(SCOMP) $(SCFLAGS) -t $<", + + ".h.z .t.z:", + "\t$(CMDICT) $(CMFLAGS) $<", + + ".h.x .t.x:", + "\t$(CMDICT) $(CMFLAGS) -c $<", +#endif + + ".s.out .c.out .o.out :", + "\t$(CC) $(CFLAGS) $< $(LOADLIBES) -o $@", + + ".f.out .F.out .r.out .e.out :", + "\t$(FC) $(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) $(LFLAGS) $<", + "\t$(CC) $(CFLAGS) lex.yy.c $(LOADLIBES) -ll -o $@", + "\trm lex.yy.c", + + 0 }; + +#include "defs" +#include + + + +TIMETYPE +exists(pname) +struct nameblock *pname; +{ +struct stat buf; +register char *s, *filename; +TIMETYPE lookarch(); +extern char *findfl(); + +filename = pname->namep; + +for(s = filename ; *s!='\0' && *s!='(' ; ++s) + ; + +if(*s == '(') + return(lookarch(filename)); + +if (stat(filename, &buf) < 0) +{ + s = findfl(filename); + if(s != (char *)-1) + { + pname->alias = copys(s); + if(stat(pname->alias, &buf) == 0) + return(buf.st_mtime); + } + return(0); +} +else return(buf.st_mtime); +} + + +TIMETYPE prestime() +{ +TIMETYPE t; +time(&t); +return(t); +} + + + +FSTATIC char nbuf[MAXNAMLEN + 1]; +FSTATIC char *nbufend = &nbuf[MAXNAMLEN]; + + + +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 */ +{ +register DIR *dirf; +int cldir; +char *dirname, *dirpref, *endir, *filepat, *p, temp[MAXPATHLEN]; +char fullname[MAXPATHLEN], *p1, *p2; +struct nameblock *q; +struct depblock *thisdbl; +struct dirhdr *od; +struct pattern *patp; +struct varblock *cp, *varptr(); +char *path, pth[MAXPATHLEN], *strcpy(); +struct direct *dptr; + + +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) + { + dirpref = ""; + filepat = pat; + cp = varptr("VPATH"); + if (cp->varval == NULL) path = "."; + else { + path = pth; + *path = '\0'; + /* + * expand VPATH; this is almost surely not the place to do + * this, but I have no intention whatsoever of attempting + * to understand this code. + */ + if (strncmp(cp->varval, ".:", 2) != 0) { + strcpy(pth,".:"); + subst(cp->varval, pth + 2); + } + else + subst(cp->varval, pth); + } + } +else { + *endir = '\0'; + path = strcpy(pth, pat); + dirpref = concat(pat, "/", temp); + filepat = endir+1; + } + +while (*path) { /* Loop thru each VPATH directory */ + dirname = path; + for (; *path; path++) + if (*path == ':') { + *path++ = '\0'; + break; + } + +dirf = NULL; +cldir = NO; + +for(od = firstod; od; od = od->nxtopendir) + if(! unequal(dirname, od->dirn) ) + { + dirf = od->dirfc; + if (dirf != NULL) + rewinddir(dirf); /* start over at the beginning */ + break; + } + +if(dirf == NULL) + { + dirf = opendir(dirname); + if(nopdir >= MAXDIR) + cldir = YES; + else { + ++nopdir; + od = ALLOC(dirhdr); + od->nxtopendir = firstod; + firstod = od; + od->dirfc = dirf; + od->dirn = copys(dirname); + fcntl(dirf->dd_fd, F_SETFD, 1); + } + } + +if(dirf == NULL) + { + fprintf(stderr, "Directory %s: ", dirname); + fatal("Cannot open"); + } + +else for (dptr = readdir(dirf); dptr != NULL; dptr = readdir(dirf)) + { + p1 = dptr->d_name; + p2 = nbuf; + while( (p2nxtdepblock = nextdbl; + thisdbl->depname = q; + nextdbl = thisdbl; + } + } + } + +if(endir != 0) *endir = '/'; + +if(cldir) { + closedir(dirf); + dirf = NULL; +} +} /* End of VPATH loop */ +return(thisdbl); +} + +/* 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); +} + +#ifdef METERFILE +#include +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 + + +/* look inside archive for notation a(b) + a(b) is file member b in archive a +*/ + +#include +#include "archive.h" /* from 'ar's directory */ + + char arfile[MAXPATHLEN]; + CHDR chdr; + char *arfname = chdr.name; + FILE *arfd; + off_t arpos; + +TIMETYPE lookarch(filename) + char *filename; + { + char *p, *q, *send, s[MAXNAMLEN + 1]; + + for (p = filename; *p!= '(' ; ++p) + ; + *p = '\0'; + strcpy(arfile, filename); + openarch(filename); + *p++ = '('; + + send = s + sizeof(s); + + for( q = s; q < send && *p!='\0' && *p!=')' ; *q++ = *p++) + ; + *q++ = '\0'; + while (getarch()) + { + if (!strcmp(arfname, s)) + { + clarch(); + return(chdr.date); + } + arpos += (chdr.size + (chdr.size + chdr.lname & 1)); + arpos += sizeof (struct ar_hdr); + } + strcpy(chdr.name, s); + clarch(); + return(0L); + } + + +clarch() +{ +if (arfd) + fclose( arfd ); +} + + +openarch(f) +register char *f; + { + char magic[SARMAG]; + + arfd = fopen(f, "r"); + if (arfd == NULL) + return; + + fseek(arfd, 0L, 0); + fread(magic, SARMAG, 1, arfd); + arpos = SARMAG; + if (strncmp(magic, ARMAG, SARMAG)) + fatal1("%s is not an archive", f); + } + +/* + * "borrowed" from 'ld' because we didn't want to drag in everything + * from 'ar'. The error checking was also ripped out, basically if any + * of the criteria for being an archive are not met then a -1 is returned + * and the rest of 'make' figures out what to do (bails out). +*/ + +typedef struct ar_hdr HDR; +extern long strtol(); + +/* Convert ar header field to an integer. */ +#define AR_ATOI(from, to, len, base) { \ + bcopy(from, buf, len); \ + buf[len] = '\0'; \ + to = strtol(buf, (char **)NULL, base); \ +} + +getarch() +{ + char hb[sizeof(HDR) + 1]; /* real header */ + struct ar_hdr arhead; + register HDR *hdr; + register int len; + int nr; + register char *p; + char buf[20]; + + if (!arfd) + return(0); + fseek(arfd, arpos, 0); + + nr = fread(hb, 1, sizeof(HDR), arfd); + if (nr != sizeof(HDR)) + return(0); + + hdr = (HDR *)hb; + if (strncmp(hdr->ar_fmag, ARFMAG, sizeof(ARFMAG) - 1)) + return(0); + + /* Convert the header into the internal format. */ +#define DECIMAL 10 +#define OCTAL 8 + + AR_ATOI(hdr->ar_date, chdr.date, sizeof(hdr->ar_date), DECIMAL); + AR_ATOI(hdr->ar_uid, chdr.uid, sizeof(hdr->ar_uid), DECIMAL); + AR_ATOI(hdr->ar_gid, chdr.gid, sizeof(hdr->ar_gid), DECIMAL); + AR_ATOI(hdr->ar_mode, chdr.mode, sizeof(hdr->ar_mode), OCTAL); + AR_ATOI(hdr->ar_size, chdr.size, sizeof(hdr->ar_size), DECIMAL); + + /* Leading spaces should never happen. */ + if (hdr->ar_name[0] == ' ') + return(-1); + + /* + * Long name support. Set the "real" size of the file, and the + * long name flag/size. + */ + if (!bcmp(hdr->ar_name, AR_EFMT1, sizeof(AR_EFMT1) - 1)) { + chdr.lname = len = atoi(hdr->ar_name + sizeof(AR_EFMT1) - 1); + if (len <= 0 || len > MAXNAMLEN) + return(-1); + nr = fread(chdr.name, 1, (size_t)len, arfd); + if (nr != len) + return(0); + chdr.name[len] = 0; + chdr.size -= len; + } else { + chdr.lname = 0; + bcopy(hdr->ar_name, chdr.name, sizeof(hdr->ar_name)); + + /* Strip trailing spaces, null terminate. */ + for (p = chdr.name + sizeof(hdr->ar_name) - 1; *p == ' '; --p); + *++p = '\0'; + } + return(1); +} + +/* + * findfl(name) (like execvp, but does path search and finds files) + */ +static char fname[128]; + +char *execat(); + +char *findfl(name) +register char *name; +{ + register char *p; + struct varblock *cp, *varptr(); + struct stat buf; + + for (p = name; *p; p++) + if(*p == '/') return(name); + + cp = varptr("VPATH"); + if(cp->varval == NULL || *cp->varval == 0) + p = ":"; + else + p = cp->varval; + + do + { + p = execat(p, name, fname); + if(stat(fname,&buf) >= 0) + return(fname); + } while (p); + return((char *)-1); +} + +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); +} + + +/* copy s to d, changing file names to file aliases */ +fixname(s, d) +char *s, *d; +{ + register char *r, *q; + struct nameblock *pn; + char name[MAXPATHLEN]; + + while (*s) { + if (isspace(*s)) *d++ = *s++; + else { + r = name; + while (*s) { + if (isspace(*s)) break; + *r++ = *s++; + } + *r = '\0'; + + if (((pn = srchname(name)) != 0) && (pn->alias)) + q = pn->alias; + else q = name; + + while (*q) *d++ = *q++; + } + } + *d = '\0'; +} diff --git a/bin/make/gcos.c b/bin/make/gcos.c new file mode 100644 index 0000000..05d4864 --- /dev/null +++ b/bin/make/gcos.c @@ -0,0 +1,334 @@ +static char *sccsid = "@(#)gcos.c 4.3 (Berkeley) 85/08/30"; +/* GCOS DEPENDENT PROCEDURES */ + + +/* DEFAULT RULES FOR GCOS */ + +char *builtin[] + { + ".SUFFIXES : .d .c .y .lib", + ".d.c:", + "\t./dtgen $<", + ".y.c:", + "\t./yacc $<", + "\tcopy y.tab.c; /$@", + ".y.lib:", + "\t./yacc $<", + "\t./cc y.tab.c r=$@", + ".c.lib:", + "\t./cc $< r=$@", + 0 }; + +# define MAXCSIZE 500 +# define YZERO 60 + +int gtcalled 0; + +/* all kinds of static declarations that must be used.. */ + +static double day { 64*1000*60*60*24 }; /* length of day in clock ticks */ + +struct { int lhs:18, rhs:18; }; +struct catb { + int words[6], + name1, name2, + passw1, passw2, + word10, word11, + datcreat, datmod, datused, + stuff[6], + jjjj:18, tused:18; + }; +struct { int :3, slot:18; }; /* slot where time from cat. block fits */ + +struct catdesc { + int cat1, cat2, cpass1, cpass2, + file1, file2, filep1, filep2, + endmark; }; + +extern int _q_reg, _a_reg; + + +# define A10(x,y) 10*x + y + +/* interpret the mm/dd/yy format */ + +struct d9 { int :5, m1:4, :5, m2:4, :9, + :5, d1:4, :5, d2:4, :9, + :5, y1:4, :5, y2:4 ;}; + +struct d6 { int :2, m61:4, :2, m62:4, + :2, d61:4, :2, d62:4, + :2, y61:4, :2, y62:4; }; + +static day6( d6word ){ /* return the day number of a word in bci format */ + int m, y, d; + + y = A10( d6word.y61, d6word.y62 ); + m = A10( d6word.m61, d6word.m62 ); + d = A10( d6word.d61, d6word.d62 ); + + return( d + 31*( m + 12*(y-YZERO) ) ); + } + +static day9( p ) register int *p; { + + int m, y, d; + + y = A10( p->y1, p->y2 ); + m = A10( p->m1, p->m2 ); + d = A10( p->d1, p->d2 ); + + return( d + 31*( m + 12*(y-YZERO) ) ); + } + + +static int dfold( dayno, timeno ){ + int kk; + kk = ( day*dayno + timeno) / 32768.; + } + +int prestime(){ + int date[2]; + drldrl( 021, date ); + return( dfold( day9(date), _q_reg ) ); + } + + + +# define DODRL ar[0] = status; ar[1] = &b.cat1; drldrl(30,sp1,sp2); p=ar[0]<<18; + +static struct { int fn1, fn2; int ftm; } fbb[MAXCSIZE]; +static int catsiz; + +getcat() { + + register i, *p, j; + int asname[4]; + struct catdesc b; + int sp1, sp2, temp; + int ar[2], status[2]; + int filbuf[380]; + + gtcalled = 1; + + sp1 = ar; + sp1 =>> 18; + sp2 = filbuf; + sp2 =>>18; + sp2.lhs = 19; + + b.cat1 = b.cat2 = b.file1 = -1; + b.cpass1 = b.cpass2 = 0202020202020; + + DODRL + sp2.lhs++; + for( i=0; p!=0 && iname1; + fbb[i].fn2 = b.file2 = p->name2; + b.filep1 = p->passw1; + b.filep2 = p->passw2; + b.endmark = -1; + temp = 0; + temp.slot = p->tused; + fbb[i].ftm = dfold( day6(p->datmod), temp ); + DODRL + } + catsiz = i; + } + + exists( p ) + struct nameblock *p; { + char *s, *cp, name[13]; + int i, *p, bcd[2]; + +/* + cheat about names with slashes -- try opening; + if it is openable, it exists, and assume it was made + at t=1 (long time ago); otherwise, assume it + does not exist +*/ + +cp = p->namep; + +for(s=cp ; *s ; ++s) + if(*s == '/') + if(i = copen(cp,'r') < 0) + return(0); + else { + cclose(i); + return(1); + } + +if(gtcalled == 0) getcat(); + + p = name; + for( i=0; *cp; ++i ) name[i] = *cp++; + while( i<12 ) name[i++] = ' '; + f9to6( *p, bcd[0], 12 ); + for ( i=0; inxtpattern) + 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 { +fatal("File name has an embedded slash"); + dirname = pat; + *endir = '\0'; + dirpref = concat(dirname, "/", temp); + filepat = endir+1; + } + +for(i=0;inextp = nextdbl; + thisdbl->depname = q; + nextdbl = thisdbl; + } + } + } + +if(endir != 0) *endir = '/'; + +return(thisdbl); +} + +/* stolen from glob through find */ + +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); +} + +umatch(s, p) +char *s, *p; +{ + if(*p==0) return(1); + while(*s) + if (amatch(s++,p)) return(1); + return(0); +} + + + +dosys(comstring,nohalt) +char *comstring; +int nohalt; +{ +char *p; + +for(p=comstring ; *p!='\0' ; ++p); +if( p-comstring > 80) + fatal("Command string longer than 80 characters"); + +system(comstring); + +return(0); +} + + +touch(s) +char *s; +{ +fprintf(stderr, "touch not yet implemented on GCOS\n"); +cexit(2); +} diff --git a/bin/make/gram.y b/bin/make/gram.y new file mode 100644 index 0000000..b639536 --- /dev/null +++ b/bin/make/gram.y @@ -0,0 +1,307 @@ +%{#include "defs" +/* static char *sccsid = "@(#)gram.y 4.1 (Berkeley) 81/02/28"; */ +%} + +%term NAME SHELLINE START MACRODEF COLON DOUBLECOLON GREATER +%union + { + struct shblock *yshblock; + struct depblock *ydepblock; + struct nameblock *ynameblock; + } + +%type SHELLINE, shlist, shellist +%type NAME, namelist +%type 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; + } + ; + +%% + +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); +} + +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 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 . 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. +2.59 Changed references to sprintf to accomodate new function definition + Also fixed extern declarations. +2.60 Limited the number of open directories. +2.61 Added code to handle archives with ascii headers. +*/ diff --git a/bin/make/main.c b/bin/make/main.c new file mode 100644 index 0000000..0c4494f --- /dev/null +++ b/bin/make/main.c @@ -0,0 +1,429 @@ +/* static char *sccsid = "@(#)main.c 4.10 (2.11BSD) 98/9/15"; */ + +#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 + 'e' environment variables have precedence over makefiles +*/ + +struct nameblock *mainname = NULL; +struct nameblock *firstname = NULL; +struct lineblock *sufflist = NULL; +struct varblock *firstvar = NULL; +struct pattern *firstpat = NULL; +struct dirhdr *firstod = NULL; + +#include +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 doenvlast = NO; +int inarglist; +#ifdef pwb +char *prompt = ">"; /* other systems -- pick what you want */ +#else +char *prompt = ""; /* other systems -- pick what you want */ +#endif +int nopdir = 0; +char junkname[20]; +char funny[128]; +char options[26 + 1] = { '-' }; + +main(argc,argv) +int argc; +char *argv[]; +{ +register struct nameblock *p; +register int i, j; +int descset, nfargs; +TIMETYPE tjunk; +char c, *s; +static char onechar[2] = 'X'; +#ifdef unix +int intrupt(); +#endif +char *op = options + 1; + + +#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-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; + + case 'e': + doenvlast = YES; + break; + + default: + onechar[0] = c; /* to make lint happy */ + fatal1("Unknown flag argument %s", onechar); + } + } + argv[i] = 0; + } + +*op++ = '\0'; +if (strcmp(options, "-") == 0) + *options = '\0'; +setvar("MFLAGS", options); /* MFLAGS=options to make */ + +setmachine(); + +if( !descset ) +#ifdef unix + if( rddescf("makefile") ) rddescf("Makefile"); +#endif +#ifdef gcos + rddescf("makefile"); +#endif + +if (doenvlast == YES) + readenv(); + +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 + +#ifdef unix +intrupt() +{ +struct varblock *varptr(); +char *p; +TIMETYPE exists(); +struct stat sbuf; + +if(okdel && !noexflag && !touchflag && + (p = varptr("@")->varval) && + (stat(p, &sbuf) >= 0 && (sbuf.st_mode&S_IFMT) == S_IFREG) && + !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 + +extern char *builtin[]; + +char **linesptr = builtin; + +FILE * fin; +int firstrd = 0; + + +rddescf(descfile) +char *descfile; +{ +FILE * k; + +/* read and parse description */ + +if( !firstrd++ ) + { + if( !noruleflag ) + rdd1( (FILE *) NULL); + + if (doenvlast == NO) + readenv(); + +#ifdef pwb + { + char *nlog, s[BUFSIZ]; + 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; +{ +extern int yylineno; +extern char *zznextc; + +fin = k; +yylineno = 0; +zznextc = 0; + +if( yyparse() ) + fatal("Description file error"); + +if(fin != NULL && fin != stdin) + fclose(fin); + +return(0); +} + +printdesc(prntflag) +int prntflag; +{ +struct nameblock *p; +struct depblock *dp; +struct varblock *vp; +struct dirhdr *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", od->dirfc->dd_fd, 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); +} + +readenv() +{ + register char **ep, *p; + extern char **environ; + + for(ep = environ ; *ep ; ++ep) { + for (p = *ep; *p; p++) { + if (isalnum(*p)) + continue; + if (*p == '=') { + eqsign(*ep); + } + break; + } + } +} + +#include + +/* + * This is done in a function by itself because 'uname()' uses a 640 + * structure which we do not want permanently allocated on main()'s stack. +*/ +setmachine() + { + struct utsname foo; + + if (uname(&foo) < 0) + strcpy(foo.machine, "?"); + setvar("MACHINE", foo.machine); + } diff --git a/bin/make/misc.c b/bin/make/misc.c new file mode 100644 index 0000000..286cc53 --- /dev/null +++ b/bin/make/misc.c @@ -0,0 +1,342 @@ +/* static char *sccsid = "@(#)misc.c 4.4 (Berkeley) 87/05/21"; */ +#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); +} + + + +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 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, c; + +while(*a == ' ') ++a; +for(s=a ; *s!='\0' && *s!=':' ; ++s) + if(*s == '=') + { + for(t = a ; *t!='=' && *t!=' ' && *t!='\t' ; ++t ); + c = *t; + *t = '\0'; + + for(++s; *s==' ' || *s=='\t' ; ++s); + setvar(a, copys(s)); + *t = c; + 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[BUFSIZ]; +sprintf(buf, s, t); +fatal(buf); +} + + + +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; + +sprintf(buf, "line %d: %s", yylineno, s); +fatal(buf); +} + + + +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/bin/mkdir.c b/bin/mkdir.c new file mode 100644 index 0000000..75d85f3 --- /dev/null +++ b/bin/mkdir.c @@ -0,0 +1,116 @@ +/* + * Copyright (c) 1983 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. + */ + +#if !defined(lint) && defined(DOSCCS) +char copyright[] = +"@(#) Copyright (c) 1983 Regents of the University of California.\n\ + All rights reserved.\n"; + +static char sccsid[] = "@(#)mkdir.c 5.7 (Berkeley) 5/31/90"; +#endif /* not lint */ + +#include +#include +#include +#include +#include + +extern int errno; + +main(argc, argv) + int argc; + char **argv; +{ + extern int optind; + int ch, exitval, pflag; + + pflag = 0; + while ((ch = getopt(argc, argv, "p")) != EOF) + switch(ch) { + case 'p': + pflag = 1; + break; + case '?': + default: + usage(); + } + + if (!*(argv += optind)) + usage(); + + for (exitval = 0; *argv; ++argv) + if (pflag) + exitval |= build(*argv); + else if (mkdir(*argv, 0777) < 0) { + (void)fprintf(stderr, "mkdir: %s: %s\n", + *argv, strerror(errno)); + exitval = 1; + } + exit(exitval); +} + +build(path) + char *path; +{ + register char *p; + struct stat sb; + int create, ch; + + for (create = 0, p = path;; ++p) + if (!*p || *p == '/') { + ch = *p; + *p = '\0'; + if (stat(path, &sb)) { + if (errno != ENOENT || mkdir(path, 0777) < 0) { + (void)fprintf(stderr, "mkdir: %s: %s\n", + path, strerror(errno)); + return(1); + } + create = 1; + } + if (!(*p = ch)) + break; + } + if (!create) { + (void)fprintf(stderr, "mkdir: %s: %s\n", path, + strerror(EEXIST)); + return(1); + } + return(0); +} + +usage() +{ + (void)fprintf(stderr, "usage: mkdir [-p] dirname ...\n"); + exit(1); +} diff --git a/bin/mt.c b/bin/mt.c new file mode 100644 index 0000000..ded668b --- /dev/null +++ b/bin/mt.c @@ -0,0 +1,207 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + * + * Modified to handle pdp11 930707 /BQT + */ + +#if !defined(lint) && defined(DOSCCS) +char copyright[] = +"@(#) Copyright (c) 1980 Regents of the University of California.\n\ + All rights reserved.\n"; + +static char sccsid[] = "@(#)mt.c 2.2 (2.11BSD) 1999/3/20"; +#endif not lint + +/* + * mt -- + * magnetic tape manipulation program + */ +#include +#include +#include +#include +#include + +#define equal(s1,s2) (strcmp(s1, s2) == 0) + +struct commands { + char *c_name; + int c_code; + int c_ronly; +} com[] = { + { "weof", MTWEOF, 0 }, + { "eof", MTWEOF, 0 }, + { "fsf", MTFSF, 1 }, + { "bsf", MTBSF, 1 }, + { "fsr", MTFSR, 1 }, + { "bsr", MTBSR, 1 }, + { "rewind", MTREW, 1 }, + { "offline", MTOFFL, 1 }, + { "rewoffl", MTOFFL, 1 }, + { "status", MTNOP, 1 }, + { "cacheon", MTCACHE, 1 }, + { "cacheoff", MTNOCACHE, 1 }, + { 0 } +}; + +int mtfd; +struct mtop mt_com; +struct mtget mt_status; +char *tape; + +main(argc, argv) + char **argv; +{ + char line[80], *getenv(); + register char *cp; + register struct commands *comp; + + if (argc > 2 && (equal(argv[1], "-t") || equal(argv[1], "-f"))) { + argc -= 2; + tape = argv[2]; + argv += 2; + } else + if ((tape = getenv("TAPE")) == NULL) + tape = MT_DEF; + if (argc < 2) { + fprintf(stderr, "usage: mt [ -f device ] command [ count ]\n"); + exit(1); + } + cp = argv[1]; + for (comp = com; comp->c_name != NULL; comp++) + if (strncmp(cp, comp->c_name, strlen(cp)) == 0) + break; + if (comp->c_name == NULL) { + fprintf(stderr, "mt: don't grok \"%s\"\n", cp); + exit(1); + } + if ((mtfd = open(tape, comp->c_ronly ? 0 : 2)) < 0) { + perror(tape); + exit(1); + } + if (comp->c_code != MTNOP) { + mt_com.mt_op = comp->c_code; + mt_com.mt_count = (argc > 2 ? atoi(argv[2]) : 1); + if (mt_com.mt_count < 0) { + fprintf(stderr, "mt: negative repeat count\n"); + exit(1); + } + if (ioctl(mtfd, MTIOCTOP, &mt_com) < 0) { + fprintf(stderr, "%s %s %ld ", tape, comp->c_name, + mt_com.mt_count); + perror("failed"); + exit(2); + } + } else { + if (ioctl(mtfd, MTIOCGET, (char *)&mt_status) < 0) { + perror("mt"); + exit(2); + } + status(&mt_status); + } +} + +#ifdef vax +#include +#include + +#include +#include +#undef b_repcnt /* argh */ +#include +#endif + +#ifdef sun +#include +#include +#endif + +#ifdef pdp11 +#include +#include +#undef b_repcnt /* argh */ +#include +#include +#endif + +struct tape_desc { + short t_type; /* type of magtape device */ + char *t_name; /* printing name */ + char *t_dsbits; /* "drive status" register */ + char *t_erbits; /* "error" register */ +} tapes[] = { +#ifdef vax + { MT_ISTS, "ts11", 0, TSXS0_BITS }, + { MT_ISHT, "tm03", HTDS_BITS, HTER_BITS }, + { MT_ISTM, "tm11", 0, TMER_BITS }, + { MT_ISMT, "tu78", MTDS_BITS, 0 }, + { MT_ISUT, "tu45", UTDS_BITS, UTER_BITS }, +#endif +#ifdef sun + { MT_ISCPC, "TapeMaster", TMS_BITS, 0 }, + { MT_ISAR, "Archive", ARCH_CTRL_BITS, ARCH_BITS }, +#endif +#ifdef pdp11 + { MT_ISTS, "ts11", 0, TSXS0_BITS }, + { MT_ISHT, "tm03", HTFS_BITS, HTER_BITS }, + { MT_ISTM, "tm11", 0, TMER_BITS }, + { MT_ISTMSCP, "tmscp", 0, 0 }, +#endif + { 0 } +}; + +/* + * Interpret the status buffer returned + */ +status(bp) + register struct mtget *bp; +{ + register struct tape_desc *mt; + + for (mt = tapes; mt->t_type; mt++) + if (mt->t_type == bp->mt_type) + break; + if (mt->t_type == 0) { + printf("unknown tape drive type (%d)\n", bp->mt_type); + return; + } + printf("%s tape drive, residual=%d\n", mt->t_name, bp->mt_resid); + printreg("ds", bp->mt_dsreg, mt->t_dsbits); + printreg("\ner", bp->mt_erreg, mt->t_erbits); + putchar('\n'); +} + +/* + * Print a register a la the %b format of the kernel's printf + */ +printreg(s, v, bits) + char *s; + register char *bits; + register unsigned short v; +{ + register int i, any = 0; + register char c; + + if (bits && *bits == 8) + printf("%s=%o", s, v); + else + printf("%s=%x", s, v); + bits++; + if (v && bits) { + putchar('<'); + while (i = *bits++) { + if (v & (1 << (i-1))) { + if (any) + putchar(','); + any = 1; + for (; (c = *bits) > 32; bits++) + putchar(c); + } else + for (; *bits > 32; bits++) + ; + } + putchar('>'); + } +} diff --git a/bin/mv.c b/bin/mv.c new file mode 100644 index 0000000..fd25b36 --- /dev/null +++ b/bin/mv.c @@ -0,0 +1,303 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if !defined(lint) && defined(DOSCCS) +char copyright[] = +"@(#) Copyright (c) 1980 Regents of the University of California.\n\ + All rights reserved.\n"; + +static char sccsid[] = "@(#)mv.c 5.3.1 (2.11BSD) 1996/1/5"; +#endif not lint + +/* + * mv file1 file2 + */ +#include +#include +#include + +#include +#include +#include +#include + +#define DELIM '/' +#define MODEBITS 07777 + +#define ISDIR(st) (((st).st_mode&S_IFMT) == S_IFDIR) +#define ISLNK(st) (((st).st_mode&S_IFMT) == S_IFLNK) +#define ISREG(st) (((st).st_mode&S_IFMT) == S_IFREG) +#define ISDEV(st) \ + (((st).st_mode&S_IFMT) == S_IFCHR || ((st).st_mode&S_IFMT) == S_IFBLK) + +char *sprintf(); +char *dname(); +struct stat s1, s2; +int iflag = 0; /* interactive mode */ +int fflag = 0; /* force overwriting */ + +main(argc, argv) + register char *argv[]; +{ + register i, r; + register char *arg; + char *dest; + + if (argc < 2) + goto usage; + while (argc > 1 && *argv[1] == '-') { + argc--; + arg = *++argv; + + /* + * all files following a null option + * are considered file names + */ + if (*(arg+1) == '\0') + break; + while (*++arg != '\0') switch (*arg) { + + case 'i': + iflag++; + break; + + case 'f': + fflag++; + break; + + default: + goto usage; + } + } + if (argc < 3) + goto usage; + dest = argv[argc-1]; + if (stat(dest, &s2) >= 0 && ISDIR(s2)) { + r = 0; + for (i = 1; i < argc-1; i++) + r |= movewithshortname(argv[i], dest); + exit(r); + } + if (argc > 3) + goto usage; + r = move(argv[1], argv[2]); + exit(r); + /*NOTREACHED*/ +usage: + fprintf(stderr, +"usage: mv [-if] f1 f2 or mv [-if] f1 ... fn d1 (`fn' is a file or directory)\n"); + return (1); +} + +movewithshortname(src, dest) + char *src, *dest; +{ + register char *shortname; + char target[MAXPATHLEN + 1]; + + shortname = dname(src); + if (strlen(dest) + strlen(shortname) > MAXPATHLEN - 1) { + error("%s/%s: pathname too long", dest, + shortname); + return (1); + } + sprintf(target, "%s/%s", dest, shortname); + return (move(src, target)); +} + +move(source, target) + char *source, *target; +{ + int targetexists; + + if (lstat(source, &s1) < 0) { + Perror2(source, "Cannot access"); + return (1); + } + /* + * First, try to rename source to destination. + * The only reason we continue on failure is if + * the move is on a nondirectory and not across + * file systems. + */ + targetexists = lstat(target, &s2) >= 0; + if (targetexists) { + if (s1.st_dev == s2.st_dev && s1.st_ino == s2.st_ino) { + error("%s and %s are identical", source, target); + return (1); + } + if (iflag && !fflag && isatty(fileno(stdin)) && + query("remove %s? ", target) == 0) + return (1); + if (access(target, 2) < 0 && !fflag && isatty(fileno(stdin))) { + if (query("override protection %o for %s? ", + s2.st_mode & MODEBITS, target) == 0) + return (1); + } + } + if (rename(source, target) >= 0) + return (0); + if (errno != EXDEV) { + Perror2(errno == ENOENT && targetexists == 0 ? target : source, + "rename"); + return (1); + } + if (ISDIR(s1)) { + error("can't mv directories across file systems"); + return (1); + } + if (targetexists && unlink(target) < 0) { + Perror2(target, "Cannot unlink"); + return (1); + } + /* + * File can't be renamed, try to recreate the symbolic + * link or special device, or copy the file wholesale + * between file systems. + */ + if (ISLNK(s1)) { + register m; + char symln[MAXPATHLEN + 1]; + + m = readlink(source, symln, sizeof (symln) - 1); + if (m < 0) { + Perror(source); + return (1); + } + symln[m] = '\0'; + + m = umask(~(s1.st_mode & MODEBITS)); + if (symlink(symln, target) < 0) { + Perror(target); + return (1); + } + (void) umask(m); + goto cleanup; + } + if (ISDEV(s1)) { + struct timeval tv[2]; + + if (mknod(target, s1.st_mode, s1.st_rdev) < 0) { + Perror(target); + return (1); + } + + tv[0].tv_sec = s1.st_atime; + tv[0].tv_usec = 0; + tv[1].tv_sec = s1.st_mtime; + tv[1].tv_usec = 0; + (void) utimes(target, tv); + goto cleanup; + } + if (ISREG(s1)) { + register int fi, fo, n; + struct timeval tv[2]; + char buf[MAXBSIZE]; + + fi = open(source, 0); + if (fi < 0) { + Perror(source); + return (1); + } + + fo = creat(target, s1.st_mode & MODEBITS); + if (fo < 0) { + Perror(target); + close(fi); + return (1); + } + + for (;;) { + n = read(fi, buf, sizeof buf); + if (n == 0) { + break; + } else if (n < 0) { + Perror2(source, "read"); + close(fi); + close(fo); + return (1); + } else if (write(fo, buf, n) != n) { + Perror2(target, "write"); + close(fi); + close(fo); + return (1); + } + } + + close(fi); + close(fo); + + tv[0].tv_sec = s1.st_atime; + tv[0].tv_usec = 0; + tv[1].tv_sec = s1.st_mtime; + tv[1].tv_usec = 0; + (void) utimes(target, tv); + goto cleanup; + } + error("%s: unknown file type %o", source, s1.st_mode); + return (1); + +cleanup: + if (unlink(source) < 0) { + Perror2(source, "Cannot unlink"); + return (1); + } + return (0); +} + +/*VARARGS*/ +query(prompt, a1, a2) + char *a1; +{ + register int i, c; + + fprintf(stderr, prompt, a1, a2); + i = c = getchar(); + while (c != '\n' && c != EOF) + c = getchar(); + return (i == 'y'); +} + +char * +dname(name) + register char *name; +{ + register char *p; + + p = name; + while (*p) + if (*p++ == DELIM && *p) + name = p; + return name; +} + +/*VARARGS*/ +error(fmt, a1, a2) + char *fmt; +{ + + fprintf(stderr, "mv: "); + fprintf(stderr, fmt, a1, a2); + fprintf(stderr, "\n"); +} + +Perror(s) + char *s; +{ + char buf[MAXPATHLEN + 10]; + + sprintf(buf, "mv: %s", s); + perror(buf); +} + +Perror2(s1, s2) + char *s1, *s2; +{ + char buf[MAXPATHLEN + 20]; + + sprintf(buf, "mv: %s: %s", s1, s2); + perror(buf); +} diff --git a/bin/nice.c b/bin/nice.c new file mode 100644 index 0000000..f34b6a1 --- /dev/null +++ b/bin/nice.c @@ -0,0 +1,44 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#ifndef lint +char copyright[] = +"@(#) Copyright (c) 1980 Regents of the University of California.\n\ + All rights reserved.\n"; +#endif not lint + +#ifndef lint +static char sccsid[] = "@(#)nice.c 5.2 (Berkeley) 1/12/86"; +#endif not lint + +#include + +#include +#include + +main(argc, argv) + int argc; + char *argv[]; +{ + int nicarg = 10; + + 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); + } + if (setpriority(PRIO_PROCESS, 0, + getpriority(PRIO_PROCESS, 0) + nicarg) < 0) { + perror("setpriority"); + exit(1); + } + execvp(argv[1], &argv[1]); + perror(argv[1]); + exit(1); +} diff --git a/bin/nm.c.use.disk b/bin/nm.c.use.disk new file mode 100644 index 0000000..e4ff63a --- /dev/null +++ b/bin/nm.c.use.disk @@ -0,0 +1,434 @@ +/* + * This version of nm will use a disk file, rather than trying to store + * the entire symbol table in memory. Useful for some sites. + * + * 11/25/90 - The ASCII version of archives has been implemented, but this + * program was NOT updated. the normal version of 'nm' not only handles + * .a files correctly but can even process /unix. so this program is of even + * less value than before, this program is extremely slow even for cases + * which the regular 'nm' works well. + */ + +/* + * print symbol tables for + * object or archive files + * + * nm [-fgoprun] [name ...] +*/ + +#include +#include +#include +#include +#include +#include +#include +#include + +struct nnlist { /* symbol table entry */ + char n_name[8]; /* symbol name */ + char nn_type; /* type flag */ + char nn_ovno; + unsigned int n_value; /* value */ +}; +#define SYMFILE "/tmp/nm.sym.XXXXXX" +#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; +int file_flg; +struct ar_hdr arp; +struct exec exp; +FILE *fi; +long off; +long ftell(); +char *malloc(); +char *realloc(); +char *mktemp(); +int symfile = -1; +char *symfname; +long lseek(); +long save_sym(); +struct nnlist *get_sym(); +int cleanup(); + +main(argc, argv) +char **argv; +{ + int narg; + int compare(); + int fcompare(); + + signal(SIGINT,cleanup); + signal(SIGHUP,cleanup); + signal(SIGTERM,cleanup); + signal(SIGQUIT,cleanup); + + 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; + + case 'f': /* use a file insted of memory - slow */ + file_flg++; + continue; + + default: /* oops */ + fprintf(stderr, "nm: invalid argument -%c\n", *argv[0]); + cleanup(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(exp.a_magic), fi); /* get magic no. */ + if (exp.a_magic == ARMAG) + arch_flg++; + else if (N_BADMAG(exp)) { + fprintf(stderr, "nm: %s-- bad format\n", *argv); + continue; + } + fseek(fi, 0L, L_SET); + if (arch_flg) { + (void) nextel(fi); + if (narg > 1) + printf("\n%s:\n", *argv); + } + do { + long o; + register i, n, c; + struct nnlist sym; + struct nnlist *symp = NULL; + long *idxsymfile = NULL; + unsigned ovsizes[1 + NOVL]; + + fread((char *)&exp, 1, sizeof(struct exec), fi); + if (N_BADMAG(exp)) /* archive element not in */ + continue; /* proper format - skip it */ + if (exp.a_magic == A_MAGIC5 || exp.a_magic == A_MAGIC6) { + fread((char *)ovsizes, 1, sizeof ovsizes, fi); + o = 0L; + for (i = 1; i <= NOVL; i++) + o += (long) ovsizes[i]; + fseek(fi, o, L_INCR); + } + o = (long)exp.a_text + exp.a_data; + if ((exp.a_flag & 01) == 0) + o *= 2; + fseek(fi, o, L_INCR); + if (file_flg) + set_sym(); + i = 0; + while (fread((char *)&sym, sizeof(sym), 1, fi) == 1) { + if (globl_flg && (sym.nn_type&N_EXT)==0) + continue; + switch (sym.nn_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.nn_type&N_EXT) + c = toupper(c); + sym.nn_type = c; + if (file_flg) { + if (idxsymfile==NULL) + idxsymfile = (long *)malloc(sizeof(long)); + else + idxsymfile = (long *)realloc(idxsymfile, (i+1)*sizeof(long)); + } else { + if (symp==NULL) + symp = (struct nnlist *)malloc(sizeof(struct nnlist)); + else + symp = (struct nnlist *)realloc(symp, (i+1)*sizeof(struct nnlist)); + } + if (file_flg) { + if (idxsymfile == NULL) { + fprintf(stderr, "nm: out of memory on %s\n", *argv); + cleanup(2); + } + } else { + if (symp == NULL) { + fprintf(stderr, "nm: try using the '-f' option.\n"); + cleanup(2); + } + } + if (file_flg) + idxsymfile[i++] = save_sym(&sym); + else + symp[i++] = sym; + } + if (i == 0) { + fprintf(stderr, "nm: %s-- no name list\n", SELECT); + continue; + } + if (nosort_flg==0) + if (file_flg) + qsort(idxsymfile, i, sizeof(long), fcompare); + else + qsort(symp, i, sizeof(struct nnlist), compare); + if ((arch_flg || narg>1) && prep_flg==0) + printf("\n%s:\n", SELECT); + for (n=0; nnn_type; + } else + c = symp[n].nn_type; + if (!undef_flg) { + if (c=='u' || c=='U') + printf(" "); + else { + if (file_flg) + printf(N_FORMAT, tt->n_value); + else + printf(N_FORMAT, symp[n].n_value); + } + printf(" %c ", c); + } + if (file_flg) { + if (tt->nn_ovno) + printf("%-8.8s %d", tt->n_name, + tt->nn_ovno); + else + printf("%.8s", tt->n_name); + } else { + if (symp[n].nn_ovno) + printf("%-8.8s %d", symp[n].n_name, + symp[n].nn_ovno); + else + printf("%.8s", symp[n].n_name); + } + printf("\n"); + if (file_flg) + free(tt); + } + if (file_flg) + if (idxsymfile) + free((char *)idxsymfile); + else + if (symp) + free((char *)symp); + } while(arch_flg && nextel(fi)); + fclose(fi); + } + cleanup(0); +} + +compare(p1, p2) +register struct nnlist *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; in_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) +register FILE *af; +{ + register r; + + fseek(af, off, L_SET); + 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); +} + +fcompare(fi1, fi2) +register long *fi1, *fi2; +{ + register i; + register struct nnlist *p1, *p2; + + p1 = get_sym(*fi1); + p2 = get_sym(*fi2); + if (numsort_flg) { + if (p1->n_value > p2->n_value) { + free((char *)p1); + free((char *)p2); + return(revsort_flg); + } + if (p1->n_value < p2->n_value) { + free((char *)p1); + free((char *)p2); + return(-revsort_flg); + } + } + for(i=0; in_name); i++) + if (p1->n_name[i] != p2->n_name[i]) { + if (p1->n_name[i] > p2->n_name[i]) { + free((char *)p1); + free((char *)p2); + return(revsort_flg); + } else { + free((char *)p1); + free((char *)p2); + return(-revsort_flg); + } + } + free((char *)p1); + free((char *)p2); + return(0); +} + +/* + * Save a symbol in symfile + */ + +long +save_sym(sym) +struct nlist *sym; +{ + long ret_val; + + if ((ret_val = lseek(symfile,0L,L_INCR)) < 0) { + perror("lseek:save_sym"); + cleanup(1); + } + + if (write(symfile,sym,sizeof(struct nlist)) < 0) { + perror("write:save_sym"); + cleanup(1); + } + return(ret_val); +} + +/* + * Retrieve a symbol from symfile + */ + +struct nnlist * +get_sym(offset) +long offset; +{ + struct nnlist *temp; + + if(lseek(symfile,offset,L_SET) < 0) { + perror("lseek:get_sym"); + cleanup(1); + } + + temp = (struct nnlist *) malloc(sizeof(struct nnlist)); + if(read(symfile,temp,sizeof(struct nnlist)) != sizeof (struct nnlist)) { + perror("read:get_sym"); + cleanup(1); + } + + return(temp); +} + +/* + * Open The symfile + */ + +set_sym() +{ + if (symfile != -1) + close(symfile); + else + symfname = mktemp(SYMFILE); + if ((symfile = open(symfname,O_CREAT|O_RDWR|O_TRUNC,0666)) < 0) { + perror("open:symfile"); + cleanup(1); + } +} + +/* + * Cleanup Routine + */ + +int +cleanup(n) +int n; +{ + if (file_flg) + unlink(symfname); + exit(n); +} diff --git a/bin/nm/Makefile b/bin/nm/Makefile new file mode 100644 index 0000000..d497478 --- /dev/null +++ b/bin/nm/Makefile @@ -0,0 +1,17 @@ +SRCS= nm.c +OBJS= nm.o +CFLAGS= -O -I../ar + +all: nm + +nm: ${OBJS} + cc -z -o nm ${OBJS} + +install: + install -c -s -o bin -g bin -m 755 nm ${DESTDIR}/bin/nm + +lint: + lint -havx -I../ar ${SRCS} + +clean: + rm -f *.o *.0 nm diff --git a/bin/nm/nm.c b/bin/nm/nm.c new file mode 100644 index 0000000..62343ab --- /dev/null +++ b/bin/nm/nm.c @@ -0,0 +1,364 @@ +#if !defined(lint) && !defined(DOSCCS) +static char sccsid[] = "@(#)nm.c 2.11BSD 1/22/94"; +#endif +/* + * nm - print name list. string table version + */ +#include +#include +#include +#include +#include +#include +#include +#include "archive.h" +#include + + CHDR chdr; + +#define SELECT archive ? chdr.name : *xargv + + char aflg, gflg, nflg, oflg, pflg, uflg, rflg = 1, archive; + char **xargv; + char *strp; + union { + char mag_armag[SARMAG+1]; + struct xexec mag_exp; + } mag_un; + + off_t off, skip(); +extern off_t ftell(); +extern char *malloc(); +extern long strtol(); + int compare(), narg, errs; + +main(argc, argv) + int argc; + char **argv; +{ + + if (--argc>0 && argv[1][0]=='-' && argv[1][1]!=0) { + argv++; + while (*++*argv) switch (**argv) { + + case 'n': + nflg++; + continue; + case 'g': + gflg++; + continue; + case 'u': + uflg++; + continue; + case 'r': + rflg = -1; + continue; + case 'p': + pflg++; + continue; + case 'o': + oflg++; + continue; + case 'a': + aflg++; + continue; + default: + fprintf(stderr, "nm: invalid argument -%c\n", + *argv[0]); + exit(2); + } + argc--; + } + if (argc == 0) { + argc = 1; + argv[1] = "a.out"; + } + narg = argc; + xargv = argv; + while (argc--) { + ++xargv; + namelist(); + } + exit(errs); +} + +namelist() +{ + char ibuf[BUFSIZ]; + register FILE *fi; + + archive = 0; + fi = fopen(*xargv, "r"); + if (fi == NULL) { + error(0, "cannot open"); + return; + } + setbuf(fi, ibuf); + + off = 0; + fread((char *)&mag_un, 1, sizeof(mag_un), fi); + if (strncmp(mag_un.mag_armag, ARMAG, SARMAG)==0) { + archive++; + off = SARMAG; + } + else if (N_BADMAG(mag_un.mag_exp.e)) { + error(0, "bad format"); + goto out; + } + rewind(fi); + + if (archive) { + nextel(fi); + if (narg > 1) + printf("\n%s:\n", *xargv); + } + do { + off_t o, curpos, stroff; + long strsiz; + register i, n; + struct nlist *symp = NULL; + struct nlist sym; + + curpos = ftell(fi); + fread((char *)&mag_un.mag_exp, 1, sizeof(struct xexec), fi); + if (N_BADMAG(mag_un.mag_exp.e)) + continue; + + o = N_SYMOFF(mag_un.mag_exp); + fseek(fi, curpos + o, L_SET); + n = mag_un.mag_exp.e.a_syms / sizeof(struct nlist); + if (n == 0) { + error(0, "no name list"); + continue; + } + + i = 0; + if (strp) + free(strp), strp = 0; + while (--n >= 0) { + fread((char *)&sym, 1, sizeof(sym), fi); + if (sym.n_un.n_strx == 0) + continue; + if (gflg && (sym.n_type & N_EXT) == 0) + continue; + if (uflg && (sym.n_type & N_TYPE) == N_UNDF && sym.n_value) + continue; + i++; + } + + fseek(fi, curpos + o, L_SET); + symp = (struct nlist *)malloc(i * sizeof (struct nlist)); + if (symp == 0) + error(1, "out of memory"); + i = 0; + n = mag_un.mag_exp.e.a_syms / sizeof(struct nlist); + while (--n >= 0) { + fread((char *)&sym, 1, sizeof(sym), fi); + if (sym.n_un.n_strx == 0) + continue; + if (gflg && (sym.n_type & N_EXT) == 0) + continue; + if (uflg && (sym.n_type & N_TYPE) == N_UNDF && sym.n_value) + continue; + symp[i++] = sym; + } + stroff = curpos + N_STROFF(mag_un.mag_exp); + fseek(fi, stroff, L_SET); + if (fread(&strsiz, sizeof (long), 1, fi) != 1) + error(1, "no string table"); + strp = (char *)malloc((int)strsiz); + if (strp == NULL || strsiz > 48 * 1024L) + error(1, "ran out of memory"); + if (fread(strp+sizeof(strsiz),(int)strsiz-sizeof(strsiz),1,fi) != 1) + error(1, "error reading strings"); + for (n = 0; n < i; n++) + symp[n].n_un.n_name = strp + (int)symp[n].n_un.n_strx; + + if (pflg==0) + qsort(symp, i, sizeof(struct nlist), compare); + if ((archive || narg>1) && oflg==0) + printf("\n%s:\n", SELECT); + psyms(symp, i); + if (symp) + free((char *)symp), symp = NULL; + if (strp) + free((char *)strp), strp = NULL; + } while(archive && nextel(fi)); +out: + fclose(fi); +} + +psyms(symp, nsyms) + register struct nlist *symp; + int nsyms; +{ + register int n, c; + + for (n=0; nn_value > p2->n_value) + return(rflg); + if (p1->n_value < p2->n_value) + return(-rflg); + } + return (rflg * strcmp(p1->n_un.n_name, p2->n_un.n_name)); +} + +nextel(af) +FILE *af; +{ + + fseek(af, off, L_SET); + if (get_arobj(af) < 0) + return(0); + off += (sizeof (struct ar_hdr) + chdr.size + + (chdr.size + chdr.lname & 1)); + return(1); +} + +error(n, s) +char *s; +{ + fprintf(stderr, "nm: %s:", *xargv); + if (archive) { + fprintf(stderr, "(%s)", chdr.name); + fprintf(stderr, ": "); + } else + fprintf(stderr, " "); + fprintf(stderr, "%s\n", s); + if (n) + exit(2); + errs = 1; +} + +/* + * "borrowed" from 'ar' because we didn't want to drag in everything else + * from 'ar'. The error checking was also ripped out, basically if any + * of the criteria for being an archive are not met then a -1 is returned + * and the rest of 'ld' figures out what to do. +*/ + +typedef struct ar_hdr HDR; +static char hb[sizeof(HDR) + 1]; /* real header */ + +/* Convert ar header field to an integer. */ +#define AR_ATOI(from, to, len, base) { \ + bcopy(from, buf, len); \ + buf[len] = '\0'; \ + to = strtol(buf, (char **)NULL, base); \ +} + +/* + * read the archive header for this member. Use a file pointer + * rather than a file descriptor. + */ +get_arobj(fp) + FILE *fp; +{ + HDR *hdr; + register int len, nr; + register char *p; + char buf[20]; + + nr = fread(hb, 1, sizeof(HDR), fp); + if (nr != sizeof(HDR)) + return(-1); + + hdr = (HDR *)hb; + if (strncmp(hdr->ar_fmag, ARFMAG, sizeof(ARFMAG) - 1)) + return(-1); + + /* Convert the header into the internal format. */ +#define DECIMAL 10 +#define OCTAL 8 + + AR_ATOI(hdr->ar_date, chdr.date, sizeof(hdr->ar_date), DECIMAL); + AR_ATOI(hdr->ar_uid, chdr.uid, sizeof(hdr->ar_uid), DECIMAL); + AR_ATOI(hdr->ar_gid, chdr.gid, sizeof(hdr->ar_gid), DECIMAL); + AR_ATOI(hdr->ar_mode, chdr.mode, sizeof(hdr->ar_mode), OCTAL); + AR_ATOI(hdr->ar_size, chdr.size, sizeof(hdr->ar_size), DECIMAL); + + /* Leading spaces should never happen. */ + if (hdr->ar_name[0] == ' ') + return(-1); + + /* + * Long name support. Set the "real" size of the file, and the + * long name flag/size. + */ + if (!bcmp(hdr->ar_name, AR_EFMT1, sizeof(AR_EFMT1) - 1)) { + chdr.lname = len = atoi(hdr->ar_name + sizeof(AR_EFMT1) - 1); + if (len <= 0 || len > MAXNAMLEN) + return(-1); + nr = fread(chdr.name, 1, (size_t)len, fp); + if (nr != len) + return(-1); + chdr.name[len] = 0; + chdr.size -= len; + } else { + chdr.lname = 0; + bcopy(hdr->ar_name, chdr.name, sizeof(hdr->ar_name)); + + /* Strip trailing spaces, null terminate. */ + for (p = chdr.name + sizeof(hdr->ar_name) - 1; *p == ' '; --p); + *++p = '\0'; + } + return(1); +} diff --git a/bin/od.c b/bin/od.c new file mode 100644 index 0000000..b8e1d02 --- /dev/null +++ b/bin/od.c @@ -0,0 +1,883 @@ +static char *sccsid = "@(#)od.c 5.12 (Berkeley) 5/14/84"; +/* + * od -- octal, hex, decimal, character dump of data in a file. + * + * usage: od [-abBcdDefFhHiIlLopPs[n]vw[n]xX] [file] [[+]offset[.][b] [label]] + * + * where the option flags have the following meaning: + * character object radix signed? + * a byte (10) (n.a.) ASCII named byte stream + * b byte 8 no byte octal + * c byte (8) (no) character with octal non-graphic bytes + * d short 10 no + * D long 10 no + * e,F double (10) double precision floating pt. + * f float (10) single precision floating pt. + * h,x short 16 no + * H,X long 16 no + * i short 10 yes + * I,l,L long 10 yes + * o,B short 8 no (default conversion) + * O long 8 no + * s[n] string (8) ASCII graphic strings + * + * p indicate EVEN parity on 'a' conversion + * P indicate ODD parity on 'a' conversion + * v show all data - don't skip like lines. + * w[n] bytes per display line + * + * More than one format character may be given. + * If {file} is not specified, standard input is read. + * If {file} is not specified, then {offset} must start with '+'. + * {Offset} may be HEX (0xnnn), OCTAL (0nn), or decimal (nnn.). + * The default is octal. The same radix will be used to display the address. + */ + +#include + +#define DBUF_SIZE BUFSIZ +#define BIG_DBUF 32 +#define NO 0 +#define YES 1 +#define EVEN -1 +#define ODD 1 +#define UNSIGNED 0 +#define SIGNED 1 +#define PADDR 1 +#define MIN_SLEN 3 + +int a_put(); +int b_put(); +int c_put(); +int s_put(); +int us_put(); +int l_put(); +int f_put(); +int d_put(); +int st_put(); + +struct dfmt { + int df_field; /* external field required for object */ + int df_size; /* size (bytes) of object */ + int df_radix; /* conversion radix */ + int df_signed; /* signed? flag */ + int df_paddr; /* "put address on each line?" flag */ + int (*df_put)(); /* function to output object */ + char *df_fmt; /* output string format */ +} *conv_vec[32]; /* vector of conversions to be done */ + +struct dfmt ascii = { 3, sizeof (char), 10, 0, PADDR, a_put, 0}; +struct dfmt byte = { 3, sizeof (char), 8, UNSIGNED, PADDR, b_put, 0}; +struct dfmt cchar = { 3, sizeof (char), 8, UNSIGNED, PADDR, c_put, 0}; +struct dfmt u_s_oct = { 6, sizeof (short), 8, UNSIGNED, PADDR, us_put, 0}; +struct dfmt u_s_dec = { 5, sizeof (short), 10, UNSIGNED, PADDR, us_put, 0}; +struct dfmt u_s_hex = { 4, sizeof (short), 16, UNSIGNED, PADDR, us_put, 0}; +struct dfmt u_l_oct = {11, sizeof (long), 8, UNSIGNED, PADDR, l_put, 0}; +struct dfmt u_l_dec = {10, sizeof (long), 10, UNSIGNED, PADDR, l_put, 0}; +struct dfmt u_l_hex = { 8, sizeof (long), 16, UNSIGNED, PADDR, l_put, 0}; +struct dfmt s_s_dec = { 6, sizeof (short), 10, SIGNED, PADDR, s_put, 0}; +struct dfmt s_l_dec = {11, sizeof (long), 10, SIGNED, PADDR, l_put, 0}; +struct dfmt flt = {14, sizeof (float), 10, SIGNED, PADDR, f_put, 0}; +struct dfmt dble = {21, sizeof (double), 10, SIGNED, PADDR, d_put, 0}; +struct dfmt string = { 0, 0, 8, 0, NO, st_put, 0}; + + +char usage[] ="usage: od [-abcdfhilopswvx] [file] [[+]offset[.][b] [label]]"; +char dbuf[DBUF_SIZE]; +char lastdbuf[DBUF_SIZE]; +int addr_base = 8; /* default address base is OCTAL */ +long addr = 0L; /* current file offset */ +long label = -1L; /* current label; -1 is "off" */ +int dbuf_size = 16; /* file bytes / display line */ +int _parity = NO; /* show parity on ascii bytes */ +char fmt[] = " %s"; /* 12 blanks */ +char *icvt(); +char *scvt(); +char *underline(); +long get_addr(); + + +/* + * special form of _ctype + */ + +#define A 01 +#define G 02 +#define D 04 +#define P 010 +#define X 020 +#define isdigit(c) (_ctype[c] & D) +#define isascii(c) (_ctype[c] & A) +#define isgraphic(c) (_ctype[c] & G) +#define isprint(c) (_ctype[c] & P) +#define ishex(c) (_ctype[c] & (X|D)) + +char _ctype[256] = { +/* 000 */ 0, 0, 0, 0, 0, 0, 0, 0, +/* 010 */ A, A, A, 0, A, A, 0, 0, +/* 020 */ 0, 0, 0, 0, 0, 0, 0, 0, +/* 030 */ 0, 0, 0, 0, 0, 0, 0, 0, +/* 040 */ P|A, P|G|A, P|G|A, P|G|A, P|G|A, P|G|A, P|G|A, P|G|A, +/* 050 */ P|G|A, P|G|A, P|G|A, P|G|A, P|G|A, P|G|A, P|G|A, P|G|A, +/* 060 */ P|G|D|A,P|G|D|A,P|G|D|A,P|G|D|A,P|G|D|A,P|G|D|A,P|G|D|A,P|G|D|A, +/* 070 */ P|G|D|A,P|G|D|A, P|G|A, P|G|A, P|G|A, P|G|A, P|G|A, P|G|A, +/* 100 */ P|G|A, P|G|A, P|G|A, P|G|A, P|G|A, P|G|A, P|G|A, P|G|A, +/* 110 */ P|G|A, P|G|A, P|G|A, P|G|A, P|G|A, P|G|A, P|G|A, P|G|A, +/* 120 */ P|G|A, P|G|A, P|G|A, P|G|A, P|G|A, P|G|A, P|G|A, P|G|A, +/* 130 */ P|G|A, P|G|A, P|G|A, P|G|A, P|G|A, P|G|A, P|G|A, P|G|A, +/* 140 */ P|G|A,X|P|G|A,X|P|G|A,X|P|G|A,X|P|G|A,X|P|G|A,X|P|G|A, P|G|A, +/* 150 */ P|G|A, P|G|A, P|G|A, P|G|A, P|G|A, P|G|A, P|G|A, P|G|A, +/* 160 */ P|G|A, P|G|A, P|G|A, P|G|A, P|G|A, P|G|A, P|G|A, P|G|A, +/* 170 */ P|G|A, P|G|A, P|G|A, P|G|A, P|G|A, P|G|A, P|G|A, 0, +/* 200 */ 0, 0, 0, 0, 0, 0, 0, 0, +/* 210 */ 0, 0, 0, 0, 0, 0, 0, 0, +/* 220 */ 0, 0, 0, 0, 0, 0, 0, 0, +/* 230 */ 0, 0, 0, 0, 0, 0, 0, 0, +/* 240 */ 0, 0, 0, 0, 0, 0, 0, 0, +/* 250 */ 0, 0, 0, 0, 0, 0, 0, 0, +/* 260 */ 0, 0, 0, 0, 0, 0, 0, 0, +/* 270 */ 0, 0, 0, 0, 0, 0, 0, 0, +/* 300 */ 0, 0, 0, 0, 0, 0, 0, 0, +/* 310 */ 0, 0, 0, 0, 0, 0, 0, 0, +/* 320 */ 0, 0, 0, 0, 0, 0, 0, 0, +/* 330 */ 0, 0, 0, 0, 0, 0, 0, 0, +/* 340 */ 0, 0, 0, 0, 0, 0, 0, 0, +/* 350 */ 0, 0, 0, 0, 0, 0, 0, 0, +/* 360 */ 0, 0, 0, 0, 0, 0, 0, 0, +/* 370 */ 0, 0, 0, 0, 0, 0, 0, 0, +}; + + +main(argc, argv) +int argc; +char **argv; +{ + register char *p; + register char *l; + register n, same; + struct dfmt *d; + struct dfmt **cv = conv_vec; + int showall = NO; + int field, llen, nelm; + int max_llen = 0; + + argv++; + argc--; + + if(argc > 0) + { + p = *argv; + if(*p == '-') + { + while(*++p != '\0') + { + switch(*p) + { + case 'a': + d = &ascii; + break; + case 'b': + d = &byte; + break; + case 'c': + d = &cchar; + break; + case 'd': + d = &u_s_dec; + break; + case 'D': + d = &u_l_dec; + break; + case 'e': + case 'F': + d = &dble; + break; + case 'f': + d = &flt; + break; + case 'h': + case 'x': + d = &u_s_hex; + break; + case 'H': + case 'X': + d = &u_l_hex; + break; + case 'i': + d = &s_s_dec; + break; + case 'I': + case 'l': + case 'L': + d = &s_l_dec; + break; + case 'o': + case 'B': + d = &u_s_oct; + break; + case 'O': + d = &u_l_oct; + break; + case 'p': + _parity = EVEN; + continue; + case 'P': + _parity = ODD; + continue; + case 's': + d = &string; + *(cv++) = d; + while (isdigit(p[1])) + d->df_size = (10 * d->df_size) + (*++p - '0'); + if (d->df_size <= 0) + d->df_size = MIN_SLEN; + showall = YES; + continue; + case 'w': + dbuf_size = 0; + while (isdigit(p[1])) + dbuf_size = (10 * dbuf_size) + (*++p - '0'); + if (dbuf_size == 0) + dbuf_size = BIG_DBUF; + continue; + case 'v': + showall = YES; + continue; + default: + printf("od: bad flag -%c\n", *p); + puts(usage); + exit(1); + } + *(cv++) = d; + } + argc--; + argv++; + } + } + + /* + * if nothing spec'd, setup default conversion. + */ + if(cv == conv_vec) + *(cv++) = &u_s_oct; + + *cv = (struct dfmt *)0; + + /* + * calculate display parameters + */ + for (cv = conv_vec; d = *cv; cv++) + { + nelm = (dbuf_size + d->df_size - 1) / d->df_size; + llen = nelm * (d->df_field + 1); + if (llen > max_llen) + max_llen = llen; + } + + /* + * setup df_fmt to point to uniform output fields. + */ + for (cv = conv_vec; d = *cv; cv++) + { + if (d->df_field) /* only if external field is known */ + { + nelm = (dbuf_size + d->df_size - 1) / d->df_size; + field = max_llen / nelm; + d->df_fmt = fmt + 12 - (field - d->df_field); + } + } + + /* + * input file specified ? + */ + if(argc > 0 && **argv != '+') + { + if (freopen(*argv, "r", stdin) == NULL) + { + perror(*argv); + exit(1); + } + argv++; + argc--; + } + + /* + * check for possible offset [label] + */ + if (argc > 0) + { + addr = get_addr(*argv); + offset(addr); + argv++; + argc--; + + if (argc > 0) + label = get_addr(*argv); + } + + /* + * main dump loop + */ + same = -1; + while ((n = fread(dbuf, 1, dbuf_size, stdin)) > 0) + { + if (same>=0 && bcmp(dbuf, lastdbuf, dbuf_size) == 0 && !showall) + { + if (same==0) + { + printf("*\n"); + same = 1; + } + } + else + { + line(n); + same = 0; + p = dbuf; + l = lastdbuf; + for (nelm = 0; nelm < dbuf_size; nelm++) + { + *l++ = *p; + *p++ = '\0'; + } + } + addr += n; + if (label >= 0) + label += n; + } + + /* + * Some conversions require "flushing". + */ + n = 0; + for (cv = conv_vec; *cv; cv++) + { + if ((*cv)->df_paddr) + { + if (n++ == 0) + put_addr(addr, label, '\n'); + } + else + (*((*cv)->df_put))(0, *cv); + } +} + +put_addr(a, l, c) +long a; +long l; +char c; +{ + fputs(icvt(a, addr_base, UNSIGNED, 7), stdout); + if (l >= 0) + printf(" (%s)", icvt(l, addr_base, UNSIGNED, 7)); + putchar(c); +} + +line(n) +int n; +{ + register i, first; + register struct dfmt *c; + register struct dfmt **cv = conv_vec; + + first = YES; + while (c = *cv++) + { + if (c->df_paddr) + { + if (first) + { + put_addr(addr, label, ' '); + first = NO; + } + else + { + putchar('\t'); + if (label >= 0) + fputs("\t ", stdout); + } + } + i = 0; + while (i < n) + i += (*(c->df_put))(dbuf+i, c); + if (c->df_paddr) + putchar('\n'); + } +} + +s_put(n, d) +short *n; +struct dfmt *d; +{ + printf(d->df_fmt, icvt((long)*n, d->df_radix, d->df_signed, d->df_field)); + return(d->df_size); +} + +us_put(n, d) +unsigned short *n; +struct dfmt *d; +{ + printf(d->df_fmt, icvt((long)*n, d->df_radix, d->df_signed, d->df_field)); + return(d->df_size); +} + +l_put(n, d) +long *n; +struct dfmt *d; +{ + printf(d->df_fmt, icvt(*n, d->df_radix, d->df_signed, d->df_field)); + return(d->df_size); +} + +d_put(f, d) +double *f; +struct dfmt *d; +{ + char fbuf[24]; + struct l { long n[2]; }; + +#if vax + if ((((struct l *)f)->n[0] & 0xff00) == 0x8000) /* Vax illegal f.p. */ + sprintf(fbuf, " %08x %08x", + ((struct l *)f)->n[0], ((struct l *)f)->n[1]); + else +#endif + + sprintf(fbuf, "%21.14e", *f); + printf(d->df_fmt, fbuf); + return(d->df_size); +} + +f_put(f, d) +float *f; +struct dfmt *d; +{ + char fbuf[16]; + +#if vax + if ((*(long *)f & 0xff00) == 0x8000) /* Vax illegal f.p. form */ + sprintf(fbuf, " %08x", *(long *)f); + else +#endif + sprintf(fbuf, "%14.7e", *f); + printf(d->df_fmt, fbuf); + return(d->df_size); +} + + +char asc_name[34][4] = { +/* 000 */ "nul", "soh", "stx", "etx", "eot", "enq", "ack", "bel", +/* 010 */ " bs", " ht", " nl", " vt", " ff", " cr", " so", " si", +/* 020 */ "dle", "dc1", "dc2", "dc3", "dc4", "nak", "syn", "etb", +/* 030 */ "can", " em", "sub", "esc", " fs", " gs", " rs", " us", +/* 040 */ " sp", "del" +}; + +a_put(cc, d) +char *cc; +struct dfmt *d; +{ + int c = *cc; + register char *s = " "; + register pbit = parity((int)c & 0377); + + c &= 0177; + if (isgraphic(c)) + { + s[2] = c; + if (pbit == _parity) + printf(d->df_fmt, underline(s)); + else + printf(d->df_fmt, s); + } + else + { + if (c == 0177) + c = ' ' + 1; + if (pbit == _parity) + printf(d->df_fmt, underline(asc_name[c])); + else + printf(d->df_fmt, asc_name[c]); + } + return(1); +} + +parity(word) +int word; +{ + register int p = 0; + register int w = word; + + if (w) + do + { + p ^= 1; + } while(w &= (~(-w))); + return (p? ODD:EVEN); +} + +char * +underline(s) +char *s; +{ + static char ulbuf[16]; + register char *u = ulbuf; + + while (*s) + { + if (*s != ' ') + { + *u++ = '_'; + *u++ = '\b'; + } + *u++ = *s++; + } + *u = '\0'; + return(ulbuf); +} + +b_put(b, d) +char *b; +struct dfmt *d; +{ + printf(d->df_fmt, icvt((long)*b & 0377, d->df_radix, d->df_signed, d->df_field)); + return(1); +} + +c_put(cc, d) +char *cc; +struct dfmt *d; +{ + register char *s; + register int n; + register int c = *cc & 0377; + + s = scvt(c, d); + for (n = d->df_field - strlen(s); n > 0; n--) + putchar(' '); + printf(d->df_fmt, s); + return(1); +} + +char *scvt(c, d) +int c; +struct dfmt *d; +{ + static char s[2]; + + switch(c) + { + case '\0': + return("\\0"); + + case '\b': + return("\\b"); + + case '\f': + return("\\f"); + + case '\n': + return("\\n"); + + case '\r': + return("\\r"); + + case '\t': + return("\\t"); + + default: + if (isprint(c)) + { + s[0] = c; + return(s); + } + return(icvt((long)c, d->df_radix, d->df_signed, d->df_field)); + } +} + +/* + * Look for strings. + * A string contains bytes > 037 && < 177, and ends with a null. + * The minimum length is given in the dfmt structure. + */ + +#define CNULL '\0' +#define S_EMPTY 0 +#define S_FILL 1 +#define S_CONT 2 +#define SBUFSIZE 1024 + +static char str_buf[SBUFSIZE]; +static int str_mode = S_EMPTY; +static char *str_ptr; +static long str_addr; +static long str_label; + +st_put(cc, d) +char *cc; +struct dfmt *d; +{ + register int c; + + if (cc == 0) + { + pr_sbuf(d, YES); + return(1); + } + + c = (*cc & 0377); + + if (str_mode & S_FILL) + { + if (isascii(c)) + put_sbuf(c, d); + else + { + *str_ptr = CNULL; + if (c == NULL) + pr_sbuf(d, YES); + str_mode = S_EMPTY; + } + } + else if (isascii(c)) + { + str_mode = S_FILL; + str_addr = addr + (cc - dbuf); /* ugly */ + if ((str_label = label) >= 0) + str_label += (cc - dbuf); /* '' */ + str_ptr = str_buf; + put_sbuf(c, d); + } + + return(1); +} + +put_sbuf(c, d) +int c; +struct dfmt *d; +{ + *str_ptr++ = c; + if (str_ptr >= (str_buf + SBUFSIZE)) + { + pr_sbuf(d, NO); + str_ptr = str_buf; + str_mode |= S_CONT; + } +} + +pr_sbuf(d, end) +struct dfmt *d; +int end; +{ + register char *p = str_buf; + + if (str_mode == S_EMPTY + || (!(str_mode & S_CONT) && (str_ptr - str_buf) < d->df_size)) + return; + + if (!(str_mode & S_CONT)) + put_addr(str_addr, str_label, ' '); + + while (p < str_ptr) + fputs(scvt(*p++, d), stdout); + + if (end) + putchar('\n'); +} + +/* + * integer to ascii conversion + * + * This code has been rearranged to produce optimized runtime code. + */ + +#define MAXINTLENGTH 32 +static char _digit[] = "0123456789abcdef"; +static char _icv_buf[MAXINTLENGTH+1]; +static long _mask = 0x7fffffff; + +char * +icvt (value, radix, signed, ndigits) +long value; +int radix; +int signed; +int ndigits; +{ + register long val = value; + register long rad = radix; + register char *b = &_icv_buf[MAXINTLENGTH]; + register char *d = _digit; + register long tmp1; + register long tmp2; + long rem; + long kludge; + int sign; + + if (val == 0) + { + *--b = '0'; + sign = 0; + goto done; /*return(b);*/ + } + + if (signed && (sign = (val < 0))) /* signed conversion */ + { + /* + * It is necessary to do the first divide + * before the absolute value, for the case -2^31 + * + * This is actually what is being done... + * tmp1 = (int)(val % rad); + * val /= rad; + * val = -val + * *--b = d[-tmp1]; + */ + tmp1 = val / rad; + *--b = d[(tmp1 * rad) - val]; + val = -tmp1; + } + else /* unsigned conversion */ + { + sign = 0; + if (val < 0) + { /* ALL THIS IS TO SIMULATE UNSIGNED LONG MOD & DIV */ + kludge = _mask - (rad - 1); + val &= _mask; + /* + * This is really what's being done... + * rem = (kludge % rad) + (val % rad); + * val = (kludge / rad) + (val / rad) + (rem / rad) + 1; + * *--b = d[rem % rad]; + */ + tmp1 = kludge / rad; + tmp2 = val / rad; + rem = (kludge - (tmp1 * rad)) + (val - (tmp2 * rad)); + val = ++tmp1 + tmp2; + tmp1 = rem / rad; + val += tmp1; + *--b = d[rem - (tmp1 * rad)]; + } + } + + while (val) + { + /* + * This is really what's being done ... + * *--b = d[val % rad]; + * val /= rad; + */ + tmp1 = val / rad; + *--b = d[val - (tmp1 * rad)]; + val = tmp1; + } + +done: + if (sign) + *--b = '-'; + + tmp1 = ndigits - (&_icv_buf[MAXINTLENGTH] - b); + tmp2 = signed? ' ':'0'; + while (tmp1 > 0) + { + *--b = tmp2; + tmp1--; + } + + return(b); +} + +long get_addr(s) +register char *s; +{ + register char *p; + register long a; + register int d; + + if (*s=='+') + s++; + if (*s=='x') + { + s++; + addr_base = 16; + } + else if (*s=='0' && s[1]=='x') + { + s += 2; + addr_base = 16; + } + else if (*s == '0') + addr_base = 8; + p = s; + while(*p) + { + if (*p++=='.') + addr_base = 10; + } + for (a=0; *s; s++) + { + d = *s; + if(isdigit(d)) + a = a*addr_base + d - '0'; + else if (ishex(d) && addr_base==16) + a = a*addr_base + d + 10 - 'a'; + else + break; + } + + if (*s == '.') + s++; + if(*s=='b') + a *= 512; + if(*s=='B') + a *= 1024; + + return(a); +} + +offset(a) +long a; +{ + if (canseek(stdin)) + { + /* + * in case we're accessing a raw disk, + * we have to seek in multiples of a physical block. + */ + fseek(stdin, a & 0xfffffe00L, 0); + a &= 0x1ffL; + } + dumbseek(stdin, a); +} + +dumbseek(s, offset) +FILE *s; +long offset; +{ + char buf[BUFSIZ]; + int n; + int nr; + + while (offset > 0) + { + nr = (offset > BUFSIZ) ? BUFSIZ : (int)offset; + if ((n = fread(buf, 1, nr, s)) != nr) + { + fprintf(stderr, "EOF\n"); + exit(1); + } + offset -= n; + } +} + +#include +#include + +canseek(f) +FILE *f; +{ + struct stat statb; + + return( (fstat(fileno(f),&statb)==0) && + (statb.st_nlink > 0) && /*!pipe*/ + (!isatty(fileno(f))) ); +} diff --git a/bin/pagesize.c b/bin/pagesize.c new file mode 100644 index 0000000..f4105d7 --- /dev/null +++ b/bin/pagesize.c @@ -0,0 +1,21 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#ifndef lint +char copyright[] = +"@(#) Copyright (c) 1983 Regents of the University of California.\n\ + All rights reserved.\n"; +#endif not lint + +#ifndef lint +static char sccsid[] = "@(#)pagesize.c 5.1 (Berkeley) 4/30/85"; +#endif not lint + +main() +{ + + printf("%d\n", getpagesize()); +} diff --git a/bin/passwd/Makefile b/bin/passwd/Makefile new file mode 100644 index 0000000..208480c --- /dev/null +++ b/bin/passwd/Makefile @@ -0,0 +1,51 @@ +# +# Copyright (c) 1988 The Regents of the University of California. +# All rights reserved. +# +# Redistribution and use in source and binary forms are permitted +# provided that the above copyright notice and this paragraph are +# duplicated in all such forms and that any documentation, +# advertising materials, and other materials related to such +# distribution and use acknowledge that the software was developed +# by the University of California, Berkeley. The name of the +# University may not be used to endorse or promote products derived +# from this software without specific prior written permission. +# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# @(#)Makefile 5.4.2 (2.11BSD) 1996/12/1 +# +CFLAGS= -I. -O +SEPFLAG= -i +SRCS= passwd.c +OBJS= passwd.o +MAN= passwd.0 +MANSRC= passwd.1 + +all: passwd ${MAN} + +passwd: ${OBJS} + ${CC} ${CFLAGS} ${SEPFLAG} -o $@ ${OBJS} + +${MAN}: ${MANSRC} + /usr/man/manroff ${MANSRC} > ${MAN} + +clean: + rm -f ${OBJS} ${MAN} core passwd + +cleandir: clean + rm -f tags .depend + +depend: ${SRCS} + mkdep ${CFLAGS} ${SRCS} + +install: ${MAN} passwd + install -s -o root -g bin -m 4755 passwd ${DESTDIR}/bin/passwd + install -c -o bin -g bin -m 444 ${MAN} ${DESTDIR}/usr/man/cat1 + +lint: ${SRCS} + lint ${CFLAGS} ${SRCS} + +tags: ${SRCS} + ctags ${SRCS} diff --git a/bin/passwd/passwd.1 b/bin/passwd/passwd.1 new file mode 100644 index 0000000..d2c6471 --- /dev/null +++ b/bin/passwd/passwd.1 @@ -0,0 +1,48 @@ +.\" Copyright (c) 1988 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms are permitted +.\" provided that the above copyright notice and this paragraph are +.\" duplicated in all such forms and that any documentation, +.\" advertising materials, and other materials related to such +.\" distribution and use acknowledge that the software was developed +.\" by the University of California, Berkeley. The name of the +.\" University may not be used to endorse or promote products derived +.\" from this software without specific prior written permission. +.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" @(#)passwd.1 6.5 (Berkeley) 2/22/89 +.\" +.TH PASSWD 1 "February 22, 1989" +.UC 4 +.SH NAME +passwd \- change password file information +.SH SYNOPSIS +.B passwd +[ user ] +.SH DESCRIPTION +.I Passwd +changes the user's password. First, the user is prompted for their old +password, and then, if that is correct, for the new password. The new +password must be entered twice to forestall any typing errors. The +super-user is not prompted for the old password. +.PP +Once the password has been verified, +.I passwd +uses +.IR mkpasswd (8) +to update the user database. This is run in the background, and, +at very large sites could take several minutes. Until this update +is completed, the password file is unavailable for other updates +and the new password will not be available to programs. +.SH FILES +.DT +/etc/master.passwd the user database +.RE +.SH "SEE ALSO" +chpass(1), login(1), passwd(5), mkpasswd(8), vipw(8) +.br +Robert Morris and Ken Thompson, +.I UNIX password security diff --git a/bin/passwd/passwd.c b/bin/passwd/passwd.c new file mode 100644 index 0000000..36934f9 --- /dev/null +++ b/bin/passwd/passwd.c @@ -0,0 +1,265 @@ +/* + * Copyright (c) 1988 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#ifndef lint +char copyright[] = +"@(#) Copyright (c) 1988 The Regents of the University of California.\n\ + All rights reserved.\n"; +#endif /* not lint */ + +#ifndef lint +static char sccsid[] = "@(#)passwd.c 4.35 (Berkeley) 3/16/89"; +#endif /* not lint */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +uid_t uid; + +main(argc, argv) + int argc; + char **argv; +{ + extern int errno; + struct passwd *pw; + struct rlimit rlim; + FILE *temp_fp; + int fd; + char *fend, *np, *passwd, *temp, *tend; + char from[MAXPATHLEN], to[MAXPATHLEN]; + char *getnewpasswd(); + + uid = getuid(); + switch(--argc) { + case 0: + if (!(pw = getpwuid(uid))) { + fprintf(stderr, "passwd: unknown user: uid %u\n", uid); + exit(1); + } + break; + case 1: + if (!(pw = getpwnam(argv[1]))) { + fprintf(stderr, "passwd: unknown user %s.\n", argv[1]); + exit(1); + } + if (uid && uid != pw->pw_uid) { + fprintf(stderr, "passwd: %s\n", strerror(EACCES)); + exit(1); + } + break; + default: + fprintf(stderr, "usage: passwd [user]\n"); + exit(1); + } + + (void)signal(SIGHUP, SIG_IGN); + (void)signal(SIGINT, SIG_IGN); + (void)signal(SIGQUIT, SIG_IGN); + (void)signal(SIGTSTP, SIG_IGN); + + rlim.rlim_cur = rlim.rlim_max = RLIM_INFINITY; + (void)setrlimit(RLIMIT_CPU, &rlim); + (void)setrlimit(RLIMIT_FSIZE, &rlim); + + (void)umask(0); + + temp = _PATH_PTMP; + if ((fd = open(temp, O_WRONLY|O_CREAT|O_EXCL, 0600)) < 0) { + if (errno == EEXIST) { + fprintf(stderr, + "passwd: password file busy -- try again later.\n"); + exit(0); + } + fprintf(stderr, "passwd: %s: %s", temp, strerror(errno)); + goto bad; + } + if (!(temp_fp = fdopen(fd, "w"))) { + fprintf(stderr, "passwd: can't write %s\n", temp); + goto bad; + } + passwd = _PATH_MASTERPASSWD; + if (!freopen(passwd, "r", stdin)) { + fprintf(stderr, "passwd: can't read %s\n", passwd); + goto bad; + } + + printf("Changing password for %s.\n", pw->pw_name); + np = getnewpasswd(pw, temp); + + if (!copy(pw->pw_name, np, temp_fp, pw)) + goto bad; + + (void)fclose(temp_fp); + (void)fclose(stdin); + + switch(fork()) { + case 0: + break; + case -1: + fprintf(stderr, "passwd: can't fork"); + goto bad; + /* NOTREACHED */ + default: + exit(0); + /* NOTREACHED */ + } + + if (makedb(temp)) { + fprintf(stderr, "passwd: mkpasswd failed"); +bad: fprintf(stderr, "; password unchanged.\n"); + (void)unlink(temp); + exit(1); + } + + /* + * possible race; have to rename four files, and someone could slip + * in between them. LOCK_EX and rename the ``passwd.dir'' file first + * so that getpwent(3) can't slip in; the lock should never fail and + * it's unclear what to do if it does. Rename ``ptmp'' last so that + * passwd/vipw/chpass can't slip in. + */ + (void)setpriority(PRIO_PROCESS, 0, -20); + fend = strcpy(from, temp) + strlen(temp); + tend = strcpy(to, _PATH_PASSWD) + strlen(_PATH_PASSWD); + bcopy(".dir", fend, 5); + bcopy(".dir", tend, 5); + if ((fd = open(from, O_RDONLY, 0)) >= 0) + (void)flock(fd, LOCK_EX); + /* here we go... */ + (void)rename(from, to); + bcopy(".pag", fend, 5); + bcopy(".pag", tend, 5); + (void)rename(from, to); + bcopy(".orig", fend, 6); + (void)rename(from, _PATH_PASSWD); + (void)rename(temp, passwd); + /* done! */ + exit(0); +} + +copy(name, np, fp, pw) + char *name, *np; + FILE *fp; + struct passwd *pw; +{ + register int done; + register char *p; + char buf[256]; + + for (done = 0; fgets(buf, sizeof(buf), stdin);) { + /* skip lines that are too big */ + if (!index(buf, '\n')) { + fprintf(stderr, "passwd: line too long.\n"); + return(0); + } + if (done) { + fprintf(fp, "%s", buf); + continue; + } + if (!(p = index(buf, ':'))) { + fprintf(stderr, "passwd: corrupted entry.\n"); + return(0); + } + *p = '\0'; + if (strcmp(buf, name)) { + *p = ':'; + fprintf(fp, "%s", buf); + continue; + } + if (!(p = index(++p, ':'))) { + fprintf(stderr, "passwd: corrupted entry.\n"); + return(0); + } + /* + * reset change time to zero; when classes are implemented, + * go and get the "offset" value for this class and reset + * the timer. + */ + fprintf(fp, "%s:%s:%d:%d:%s:%ld:%ld:%s:%s:%s\n", + pw->pw_name, np, pw->pw_uid, pw->pw_gid, + pw->pw_class, 0L, pw->pw_expire, pw->pw_gecos, + pw->pw_dir, pw->pw_shell); + done = 1; + } + return(1); +} + +char * +getnewpasswd(pw, temp) + register struct passwd *pw; + char *temp; +{ + register char *p, *t; + char buf[10], salt[2], *crypt(), *getpass(); + time_t time(); + + if (uid && pw->pw_passwd && + strcmp(crypt(getpass("Old password:"), pw->pw_passwd), + pw->pw_passwd)) { + (void)printf("passwd: %s.\n", strerror(EACCES)); + (void)unlink(temp); + exit(1); + } + + for (buf[0] = '\0';;) { + p = getpass("New password:"); + if (!*p) { + (void)printf("Password unchanged.\n"); + (void)unlink(temp); + exit(0); + } + if (strlen(p) <= 5) { + printf("Please enter a longer password.\n"); + continue; + } + for (t = p; *t && islower(*t); ++t); + if (!*t) { + printf("Please don't use an all-lower case password.\nUnusual capitalization, control characters or digits are suggested.\n"); + continue; + } + (void)strcpy(buf, p); + if (!strcmp(buf, getpass("Retype new password:"))) + break; + printf("Mismatch; try again, EOF to quit.\n"); + } + /* grab a random printable character that isn't a colon */ + (void)srandom((int)time((time_t *)NULL)); + while ((salt[0] = random() % 93 + 33) == ':'); + while ((salt[1] = random() % 93 + 33) == ':'); + return(crypt(buf, salt)); +} + +makedb(file) + char *file; +{ + int status, pid, w; + + if (!(pid = vfork())) { + execl(_PATH_MKPASSWD, "mkpasswd", "-p", file, NULL); + _exit(127); + } + while ((w = wait(&status)) != pid && w != -1); + return(w == -1 || status); +} diff --git a/bin/pathnames.h b/bin/pathnames.h new file mode 100644 index 0000000..6fb4ae2 --- /dev/null +++ b/bin/pathnames.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) 1989 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * @(#)pathnames.h 5.2 (Berkeley) 5/10/89 + */ + +#define _PATH_BSHELL "/bin/sh" +#define _PATH_CP "/bin/cp" +#define _PATH_RSH "/usr/ucb/rsh" diff --git a/bin/ping/Makefile b/bin/ping/Makefile new file mode 100644 index 0000000..98fa0b0 --- /dev/null +++ b/bin/ping/Makefile @@ -0,0 +1,37 @@ +# +# @(#)Makefile 1.1 (2.11BSD) 1996/1/28 +# + +CFLAGS= -O +SEPFLAG= -i +SRCS= ping.c +OBJS= ping.o +MAN= ping.0 +MANSRC= ping.8 + +all: ping ${MAN} + +ping: ${OBJS} + ${CC} ${SEPFLAG} -o $@ ${CFLAGS} ${OBJS} + +ping.0: ${MANSRC} + /usr/man/manroff ${MANSRC} > ${MAN} + +clean: + rm -f ${OBJS} ${MAN} ping + +cleandir: clean + rm -f tags .depend + +depend: ${SRCS} + mkdep ${CFLAGS} ${SRCS} + +install: ${MAN} ping + install -s -o root -g bin -m 4751 ping ${DESTDIR}/bin + install -c -o bin -g bin -m 444 ${MAN} ${DESTDIR}/usr/man/cat8 + +lint: ${SRCS} + lint -haxc ${SRCS} + +tags: ${SRCS} + ctags ${SRCS} diff --git a/bin/ping/ping.8 b/bin/ping/ping.8 new file mode 100644 index 0000000..43face6 --- /dev/null +++ b/bin/ping/ping.8 @@ -0,0 +1,330 @@ +.\" Copyright (c) 1985, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)ping.8 8.2.1 (2.11BSD) 1995/12/22 +.\" +.TH PING 8 "December 22, 1995" +.AT 3 +.SH NAME +\fBping\fP \- send ICMP ECHO_REQUEST packets to network hosts +.SH SYNOPSIS +.B ping [-dfnqrvR] +[\fB-c\fP \fIcount\fP] +[\fB-i\fP \fIwait\fP] +[\fB-l\fP \fIpreload\fP] +[\fB-p\fP \fIpattern\fP] +[\fB-s\fP \fIpacketsize\fP] +.SH DESCRIPTION +.B Ping +uses the +ICMP +protocol's mandatory +ECHO_REQUEST +datagram to elicit an +ICMP ECHO_RESPONSE +from a host or gateway. +ECHO_REQUEST +datagrams (``pings'') have an IP and +ICMP +header, +followed by a +``struct timeval'' +and then an arbitrary number of ``pad'' bytes used to fill out the +packet. +The options are as follows: +.TP 15 +\fB-c\fP \fIcount\fP +Stop after sending (and receiving) +.I count +ECHO_RESPONSE +packets. +.TP 15 +\fB-d\fP +Set the +SO_DEBUG +option on the socket being used. +.TP 15 +\fB-f\fP +Flood ping. +Outputs packets as fast as they come back or one hundred times per second, +whichever is more. +For every +ECHO_REQUEST +sent a period ``.'' is printed, while for every +ECHO_REPLY +received a backspace is printed. +This provides a rapid display of how many packets are being dropped. +Only the super-user may use this option. +.B This can be very hard on a network and should be used with caution. +.TP 15 +\fB-i\fP \fIwait\fP +Wait +.I wait +seconds +between sending each packet. +The default is to wait for one second between each packet. +This option is incompatible with the +\fB-f\fP +option. +.TP 15 +\fB-l\fP \fIpreload\fP +If +.I preload +is specified, +.B ping +sends that many packets as fast as possible before falling into its normal +mode of behavior. +.TP 15 +\fB-n\fP +Numeric output only. +No attempt will be made to lookup symbolic names for host addresses. +.TP 15 +\fB-p\fP \fIpattern\fP +You may specify up to 16 ``pad'' bytes to fill out the packet you send. +This is useful for diagnosing data-dependent problems in a network. +For example, +`` \-p ff'' +will cause the sent packet to be filled with all +ones. +.TP 15 +\fB-q\fP +Quiet output. +Nothing is displayed except the summary lines at startup time and +when finished. +.TP 15 +\fB-R\fP +Record route. +Includes the +RECORD_ROUTE +option in the +ECHO_REQUEST +packet and displays +the route buffer on returned packets. +Note that the IP header is only large enough for nine such routes. +Many hosts ignore or discard this option. +.TP 15 +\fB-r\fP +Bypass the normal routing tables and send directly to a host on an attached +network. +If the host is not on a directly-attached network, an error is returned. +This option can be used to ping a local host through an interface +that has no route through it (e.g., after the interface was dropped by +.BR routed (8). +.TP 15 +\fB-s\fP \fIpacketsize\fP +Specifies the number of data bytes to be sent. +The default is 56, which translates into 64 +ICMP +data bytes when combined +with the 8 bytes of +ICMP +header data. +.TP 15 +\fB-v\fP +Verbose output. +ICMP +packets other than +ECHO_RESPONSE +that are received are listed. +.PP +When using +.B ping +for fault isolation, it should first be run on the local host, to verify +that the local network interface is up and running. +Then, hosts and gateways further and further away should be ``pinged''. +Round-trip times and packet loss statistics are computed. +If duplicate packets are received, they are not included in the packet +loss calculation, although the round trip time of these packets is used +in calculating the minimum/average/maximum round-trip time numbers. +When the specified number of packets have been sent (and received) or +if the program is terminated with a +SIGINT, +a brief summary is displayed. +.PP +This program is intended for use in network testing, measurement and +management. +Because of the load it can impose on the network, it is unwise to use +.B ping +during normal operations or from automated scripts. +.SH ICMP PACKET DETAILS +An IP header without options is 20 bytes. +An +ICMP +ECHO_REQUEST +packet contains an additional 8 bytes worth +of +ICMP +header followed by an arbitrary amount of data. +When a +.I packetsize +is given, this indicated the size of this extra piece of data (the +default is 56). +Thus the amount of data received inside of an IP packet of type +ICMP +ECHO_REPLY +will always be 8 bytes more than the requested data space +(the +ICMP +header). +.PP +If the data space is at least eight bytes large, +.B ping +uses the first eight bytes of this space to include a timestamp which +it uses in the computation of round trip times. +If less than eight bytes of pad are specified, no round trip times are +given. +.SH DUPLICATE AND DAMAGED PACKETS +.B Ping +will report duplicate and damaged packets. +Duplicate packets should never occur, and seem to be caused by +inappropriate link-level retransmissions. +Duplicates may occur in many situations and are rarely (if ever) a +good sign, although the presence of low levels of duplicates may not +always be cause for alarm. +.PP +Damaged packets are obviously serious cause for alarm and often +indicate broken hardware somewhere in the +.B ping +packet's path (in the network or in the hosts). +.SH TRYING DIFFERENT DATA PATTERNS +The (inter)network layer should never treat packets differently depending +on the data contained in the data portion. +Unfortunately, data-dependent problems have been known to sneak into +networks and remain undetected for long periods of time. +In many cases the particular pattern that will have problems is something +that doesn't have sufficient ``transitions'', such as all ones or all +zeros, or a pattern right at the edge, such as almost all zeros. +It isn't necessarily enough to specify a data pattern of all zeros (for +example) on the command line because the pattern that is of interest is +at the data link level, and the relationship between what you type and +what the controllers transmit can be complicated. +.PP +This means that if you have a data-dependent problem you will probably +have to do a lot of testing to find it. +If you are lucky, you may manage to find a file that either can't be sent +across your network or that takes much longer to transfer than other +similar length files. +You can then examine this file for repeated patterns that you can test +using the +\fB-p\fP +option of +.BR ping . +.SH TTL DETAILS +The +TTL +value of an IP packet represents the maximum number of IP routers +that the packet can go through before being thrown away. +In current practice you can expect each router in the Internet to decrement +the +TTL +field by exactly one. +.PP +The +TCP/IP +specification states that the +TTL +field for +TCP +packets should +be set to 60, but many systems use smaller values (4.3BSD +uses 30, 4.2 used +15). +.PP +The maximum possible value of this field is 255, and most Unix systems set +the +TTL +field of +ICMP ECHO_REQUEST +packets to 255. +This is why you will find you can ``ping'' some hosts, but not reach them +with +.BR telnet (1) +or +.BR ftp (1) . +.PP +In normal operation ping prints the ttl value from the packet it receives. +When a remote system receives a ping packet, it can do one of three things +with the +TTL +field in its response: +.TP 5 +\(bu +Not change it; this is what Berkeley Unix systems did before the +4.3BSD-tahoe +release. +In this case the +TTL +value in the received packet will be 255 minus the +number of routers in the round-trip path. +.TP 5 +\(bu +Set it to 255; this is what current Berkeley Unix systems do. +In this case the +TTL +value in the received packet will be 255 minus the +number of routers in the path +.B from +the remote system +.I to +the +\fBping\fP'ing +host. +.TP 5 +\(bu +Set it to some other value. +Some machines use the same value for +ICMP +packets that they use for +TCP +packets, for example either 30 or 60. +Others may use completely wild values. +.SH BUGS +Many Hosts and Gateways ignore the +RECORD_ROUTE +option. +.PP +The maximum IP header length is too small for options like +RECORD_ROUTE +to +be completely useful. +There's not much that that can be done about this, however. +.PP +Flood pinging is not recommended in general, and flood pinging the +broadcast address should only be done under very controlled conditions. +.SH SEE ALSO +.BR netstat (1), +.BR ifconfig (8), +.BR routed (8) +.SH HISTORY +The +.B ping +command appeared in +4.3BSD. diff --git a/bin/ping/ping.c b/bin/ping/ping.c new file mode 100644 index 0000000..cfc3a59 --- /dev/null +++ b/bin/ping/ping.c @@ -0,0 +1,984 @@ +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Mike Muuss. + * + * 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. + */ + +#if !defined(lint) && defined(DOSCCS) +static char copyright[] = +"@(#) Copyright (c) 1989, 1993\n\ + The Regents of the University of California. All rights reserved.\n"; + +static char sccsid[] = "@(#)ping.c 8.1.2 (2.11BSD) 1996/1/18"; +#endif /* not lint */ + +/* + * P I N G . C + * + * Using the InterNet Control Message Protocol (ICMP) "ECHO" facility, + * measure round-trip-delays and packet loss across network paths. + * + * Author - + * Mike Muuss + * U. S. Army Ballistic Research Laboratory + * December, 1983 + * + * Status - + * Public Domain. Distribution Unlimited. + * Bugs - + * More statistics could always be gathered. + * This program has to run SUID to ROOT to access the ICMP socket. + */ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define DEFDATALEN (64 - 8) /* default data length */ +#define MAXIPLEN 60 +#define MAXICMPLEN 76 +#define MAXPACKET (4096 - 60 - 8) /* max packet size */ +#define MAXWAIT 10 /* max seconds to wait for response */ +#define NROUTES 9 /* number of record route slots */ + +#define A(bit) rcvd_tbl[(bit)>>3] /* identify byte in array */ +#define B(bit) (1 << ((bit) & 0x07)) /* identify bit in byte */ +#define SET(bit) (A(bit) |= B(bit)) +#define CLR(bit) (A(bit) &= (~B(bit))) +#define TST(bit) (A(bit) & B(bit)) + +/* various options */ +int options; +#define F_FLOOD 0x001 +#define F_INTERVAL 0x002 +#define F_NUMERIC 0x004 +#define F_PINGFILLED 0x008 +#define F_QUIET 0x010 +#define F_RROUTE 0x020 +#define F_SO_DEBUG 0x040 +#define F_SO_DONTROUTE 0x080 +#define F_VERBOSE 0x100 + +/* + * MAX_DUP_CHK is the number of bits in received table, i.e. the maximum + * number of received sequence numbers we can keep track of. Change 512 + * to 8192 for complete accuracy... + */ +#define MAX_DUP_CHK (8 * 512) +int mx_dup_ck = MAX_DUP_CHK; +char rcvd_tbl[MAX_DUP_CHK / 8]; + +struct sockaddr whereto; /* who to ping */ +int datalen = DEFDATALEN; +int s; /* socket file descriptor */ +u_char outpack[MAXPACKET]; +char BSPACE = '\b'; /* characters written for flood */ +char DOT = '.'; +char *hostname; +int ident; /* process id to identify our packets */ + +/* counters */ +long npackets; /* max packets to transmit */ +long nreceived; /* # of packets we got back */ +long nrepeats; /* number of duplicates */ +long ntransmitted; /* sequence # for outbound packets = #sent */ +int interval = 1; /* interval between packets */ + +/* timing */ +int timing; /* flag to do timing */ +double tmin = 999999999.0; /* minimum round trip time */ +double tmax = 0.0; /* maximum round trip time */ +double tsum = 0.0; /* sum of all times, for doing average */ + +char *pr_addr(); +void catcher(), finish(); + +main(argc, argv) + int argc; + char **argv; +{ + extern int errno, optind; + extern char *optarg; + struct timeval timeout; + struct hostent *hp; + struct sockaddr_in *to; + struct protoent *proto; + register int i; + int ch, fdmask, hold, packlen, preload; + u_char *datap, *packet; + char *target, hnamebuf[MAXHOSTNAMELEN], *malloc(); +#ifdef IP_OPTIONS + char rspace[3 + 4 * NROUTES + 1]; /* record route space */ +#endif + + preload = 0; + datap = &outpack[8 + sizeof(struct timeval)]; + while ((ch = getopt(argc, argv, "Rc:dfh:i:l:np:qrs:v")) != EOF) + switch(ch) { + case 'c': + npackets = atoi(optarg); + if (npackets <= 0) { + (void)fprintf(stderr, + "ping: bad number of packets to transmit.\n"); + exit(1); + } + break; + case 'd': + options |= F_SO_DEBUG; + break; + case 'f': + if (getuid()) { + (void)fprintf(stderr, + "ping: %s\n", strerror(EPERM)); + exit(1); + } + options |= F_FLOOD; + setbuf(stdout, (char *)NULL); + break; + case 'i': /* wait between sending packets */ + interval = atoi(optarg); + if (interval <= 0) { + (void)fprintf(stderr, + "ping: bad timing interval.\n"); + exit(1); + } + options |= F_INTERVAL; + break; + case 'l': + preload = atoi(optarg); + if (preload < 0) { + (void)fprintf(stderr, + "ping: bad preload value.\n"); + exit(1); + } + break; + case 'n': + options |= F_NUMERIC; + break; + case 'p': /* fill buffer with user pattern */ + options |= F_PINGFILLED; + fill((char *)datap, optarg); + break; + case 'q': + options |= F_QUIET; + break; + case 'R': + options |= F_RROUTE; + break; + case 'r': + options |= F_SO_DONTROUTE; + break; + case 's': /* size of packet to send */ + datalen = atoi(optarg); + if (datalen > MAXPACKET) { + (void)fprintf(stderr, + "ping: packet size too large.\n"); + exit(1); + } + if (datalen <= 0) { + (void)fprintf(stderr, + "ping: illegal packet size.\n"); + exit(1); + } + break; + case 'v': + options |= F_VERBOSE; + break; + default: + usage(); + } + argc -= optind; + argv += optind; + + if (argc != 1) + usage(); + target = *argv; + + bzero((char *)&whereto, sizeof(struct sockaddr)); + to = (struct sockaddr_in *)&whereto; + to->sin_family = AF_INET; + to->sin_addr.s_addr = inet_addr(target); + if (to->sin_addr.s_addr != -1L) + hostname = target; + else { + hp = gethostbyname(target); + if (!hp) { + (void)fprintf(stderr, + "ping: unknown host %s\n", target); + exit(1); + } + to->sin_family = hp->h_addrtype; + bcopy(hp->h_addr, (caddr_t)&to->sin_addr, hp->h_length); + (void)strncpy(hnamebuf, hp->h_name, sizeof(hnamebuf) - 1); + hostname = hnamebuf; + } + + if (options & F_FLOOD && options & F_INTERVAL) { + (void)fprintf(stderr, + "ping: -f and -i incompatible options.\n"); + exit(1); + } + + if (datalen >= sizeof(struct timeval)) /* can we time transfer */ + timing = 1; + packlen = datalen + MAXIPLEN + MAXICMPLEN; + if (!(packet = (u_char *)malloc((u_int)packlen))) { + (void)fprintf(stderr, "ping: out of memory.\n"); + exit(1); + } + if (!(options & F_PINGFILLED)) + for (i = 8; i < datalen; ++i) + *datap++ = i; + + ident = getpid() & 0xFFFF; + + if (!(proto = getprotobyname("icmp"))) { + (void)fprintf(stderr, "ping: unknown protocol icmp.\n"); + exit(1); + } + if ((s = socket(AF_INET, SOCK_RAW, proto->p_proto)) < 0) { + perror("ping: socket"); + exit(1); + } + hold = 1; + if (options & F_SO_DEBUG) + (void)setsockopt(s, SOL_SOCKET, SO_DEBUG, (char *)&hold, + sizeof(hold)); + if (options & F_SO_DONTROUTE) + (void)setsockopt(s, SOL_SOCKET, SO_DONTROUTE, (char *)&hold, + sizeof(hold)); + + /* record route option */ + if (options & F_RROUTE) { +#ifdef IP_OPTIONS + rspace[IPOPT_OPTVAL] = IPOPT_RR; + rspace[IPOPT_OLEN] = sizeof(rspace)-1; + rspace[IPOPT_OFFSET] = IPOPT_MINOFF; + if (setsockopt(s, IPPROTO_IP, IP_OPTIONS, rspace, + sizeof(rspace)) < 0) { + perror("ping: record route"); + exit(1); + } +#else + (void)fprintf(stderr, + "ping: record route not available in this implementation.\n"); + exit(1); +#endif /* IP_OPTIONS */ + } + + /* + * When pinging the broadcast address, you can get a lot of answers. + * Doing something so evil is useful if you are trying to stress the + * ethernet, or just want to fill the arp cache to get some stuff for + * /etc/ethers. + */ + hold = 48 * 1024; + (void)setsockopt(s, SOL_SOCKET, SO_RCVBUF, (char *)&hold, + sizeof(hold)); + + if (to->sin_family == AF_INET) + (void)printf("PING %s (%s): %d data bytes\n", hostname, + inet_ntoa(*(struct in_addr *)&to->sin_addr.s_addr), + datalen); + else + (void)printf("PING %s: %d data bytes\n", hostname, datalen); + + (void)signal(SIGINT, finish); + (void)signal(SIGALRM, catcher); + + while (preload--) /* fire off them quickies */ + pinger(); + + if ((options & F_FLOOD) == 0) + catcher(); /* start things going */ + + for (;;) { + struct sockaddr_in from; + register int cc; + int fromlen; + + if (options & F_FLOOD) { + pinger(); + timeout.tv_sec = 0; + timeout.tv_usec = 10000; + fdmask = 1 << s; + if (select(s + 1, (fd_set *)&fdmask, (fd_set *)NULL, + (fd_set *)NULL, &timeout) < 1) + continue; + } + fromlen = sizeof(from); + if ((cc = recvfrom(s, (char *)packet, packlen, 0, + (struct sockaddr *)&from, &fromlen)) < 0) { + if (errno == EINTR) + continue; + perror("ping: recvfrom"); + continue; + } + pr_pack((char *)packet, cc, &from); + if (npackets && nreceived >= npackets) + break; + } + finish(); + /* NOTREACHED */ +} + +/* + * catcher -- + * This routine causes another PING to be transmitted, and then + * schedules another SIGALRM for 1 second from now. + * + * bug -- + * Our sense of time will slowly skew (i.e., packets will not be + * launched exactly at 1-second intervals). This does not affect the + * quality of the delay and loss statistics. + */ +void +catcher() +{ + int waittime; + + pinger(); + (void)signal(SIGALRM, catcher); + if (!npackets || ntransmitted < npackets) + alarm((u_int)interval); + else { + if (nreceived) { + waittime = 2 * tmax / 1000; + if (!waittime) + waittime = 1; + } else + waittime = MAXWAIT; + (void)signal(SIGALRM, finish); + (void)alarm((u_int)waittime); + } +} + +/* + * pinger -- + * Compose and transmit an ICMP ECHO REQUEST packet. The IP packet + * will be added on by the kernel. The ID field is our UNIX process ID, + * and the sequence number is an ascending integer. The first 8 bytes + * of the data portion are used to hold a UNIX "timeval" struct in VAX + * byte-order, to compute the round-trip time. + */ +pinger() +{ + register struct icmp *icp; + register int cc; + int i; + + icp = (struct icmp *)outpack; + icp->icmp_type = ICMP_ECHO; + icp->icmp_code = 0; + icp->icmp_cksum = 0; + icp->icmp_seq = ntransmitted++; + icp->icmp_id = ident; /* ID */ + + CLR(icp->icmp_seq % mx_dup_ck); + + if (timing) + (void)gettimeofday((struct timeval *)&outpack[8], + (struct timezone *)NULL); + + cc = datalen + 8; /* skips ICMP portion */ + + /* compute ICMP checksum here */ + icp->icmp_cksum = in_cksum((u_short *)icp, cc); + + i = sendto(s, (char *)outpack, cc, 0, &whereto, + sizeof(struct sockaddr)); + + if (i < 0 || i != cc) { + if (i < 0) + perror("ping: sendto"); + (void)printf("ping: wrote %s %d chars, ret=%d\n", + hostname, cc, i); + } + if (!(options & F_QUIET) && options & F_FLOOD) + (void)write(fileno(stdout), &DOT, 1); +} + +/* + * pr_pack -- + * Print out the packet, if it came from us. This logic is necessary + * because ALL readers of the ICMP socket get a copy of ALL ICMP packets + * which arrive ('tis only fair). This permits multiple copies of this + * program to be run without having intermingled output (or statistics!). + */ +pr_pack(buf, cc, from) + char *buf; + int cc; + struct sockaddr_in *from; +{ + register struct icmp *icp; + register u_long l; + register int i, j; + register u_char *cp,*dp; + static int old_rrlen; + static char old_rr[MAX_IPOPTLEN]; + struct ip *ip; + struct timeval tv, *tp; + double triptime; + int hlen, dupflag; + + (void)gettimeofday(&tv, (struct timezone *)NULL); + + /* Check the IP header */ + ip = (struct ip *)buf; + hlen = ip->ip_hl << 2; + if (cc < hlen + ICMP_MINLEN) { + if (options & F_VERBOSE) + (void)fprintf(stderr, + "ping: packet too short (%d bytes) from %s\n", cc, + inet_ntoa(*(struct in_addr *)&from->sin_addr.s_addr)); + return; + } + + /* Now the ICMP part */ + cc -= hlen; + icp = (struct icmp *)(buf + hlen); + if (icp->icmp_type == ICMP_ECHOREPLY) { + if (icp->icmp_id != ident) + return; /* 'Twas not our ECHO */ + ++nreceived; + if (timing) { +#ifndef icmp_data + tp = (struct timeval *)&icp->icmp_ip; +#else + tp = (struct timeval *)icp->icmp_data; +#endif + tvsub(&tv, tp); + triptime = ((double)tv.tv_sec) * 1000.0 + + ((double)tv.tv_usec) / 1000.0; + tsum += triptime; + if (triptime < tmin) + tmin = triptime; + if (triptime > tmax) + tmax = triptime; + } + + if (TST(icp->icmp_seq % mx_dup_ck)) { + ++nrepeats; + --nreceived; + dupflag = 1; + } else { + SET(icp->icmp_seq % mx_dup_ck); + dupflag = 0; + } + + if (options & F_QUIET) + return; + + if (options & F_FLOOD) + (void)write(fileno(stdout), &BSPACE, 1); + else { + (void)printf("%d bytes from %s: icmp_seq=%u", cc, + inet_ntoa(*(struct in_addr *)&from->sin_addr.s_addr), + icp->icmp_seq); + (void)printf(" ttl=%d", ip->ip_ttl); + if (timing) + (void)printf(" time=%g ms", triptime); + if (dupflag) + (void)printf(" (DUP!)"); + /* check the data */ + cp = (u_char*)&icp->icmp_data[8]; + dp = &outpack[8 + sizeof(struct timeval)]; + for (i = 8; i < datalen; ++i, ++cp, ++dp) { + if (*cp != *dp) { + (void)printf("\nwrong data byte #%d should be 0x%x but was 0x%x", + i, *dp, *cp); + cp = (u_char*)&icp->icmp_data[0]; + for (i = 8; i < datalen; ++i, ++cp) { + if ((i % 32) == 8) + (void)printf("\n\t"); + (void)printf("%x ", *cp); + } + break; + } + } + } + } else { + /* We've got something other than an ECHOREPLY */ + if (!(options & F_VERBOSE)) + return; + (void)printf("%d bytes from %s: ", cc, + pr_addr(from->sin_addr.s_addr)); + pr_icmph(icp); + } + + /* Display any IP options */ + cp = (u_char *)buf + sizeof(struct ip); + + for (; hlen > (int)sizeof(struct ip); --hlen, ++cp) + switch (*cp) { + case IPOPT_EOL: + hlen = 0; + break; + case IPOPT_LSRR: + (void)printf("\nLSRR: "); + hlen -= 2; + j = *++cp; + ++cp; + if (j > IPOPT_MINOFF) + for (;;) { + l = *++cp; + l = (l<<8) + *++cp; + l = (l<<8) + *++cp; + l = (l<<8) + *++cp; + if (l == 0) + (void)printf("\t0.0.0.0"); + else + (void)printf("\t%s", pr_addr(ntohl(l))); + hlen -= 4; + j -= 4; + if (j <= IPOPT_MINOFF) + break; + (void)putchar('\n'); + } + break; + case IPOPT_RR: + j = *++cp; /* get length */ + i = *++cp; /* and pointer */ + hlen -= 2; + if (i > j) + i = j; + i -= IPOPT_MINOFF; + if (i <= 0) + continue; + if (i == old_rrlen + && cp == (u_char *)buf + sizeof(struct ip) + 2 + && !bcmp((char *)cp, old_rr, i) + && !(options & F_FLOOD)) { + (void)printf("\t(same route)"); + i = ((i + 3) / 4) * 4; + hlen -= i; + cp += i; + break; + } + old_rrlen = i; + bcopy((char *)cp, old_rr, i); + (void)printf("\nRR: "); + for (;;) { + l = *++cp; + l = (l<<8) + *++cp; + l = (l<<8) + *++cp; + l = (l<<8) + *++cp; + if (l == 0) + (void)printf("\t0.0.0.0"); + else + (void)printf("\t%s", pr_addr(ntohl(l))); + hlen -= 4; + i -= 4; + if (i <= 0) + break; + (void)putchar('\n'); + } + break; + case IPOPT_NOP: + (void)printf("\nNOP"); + break; + default: + (void)printf("\nunknown option %x", *cp); + break; + } + if (!(options & F_FLOOD)) { + (void)putchar('\n'); + (void)fflush(stdout); + } +} + +/* + * in_cksum -- + * Checksum routine for Internet Protocol family headers (C Version) + */ +in_cksum(addr, len) + u_short *addr; + int len; +{ + register int nleft = len; + register u_short *w = addr; + u_short answer = 0; + long sum = 0; + + /* + * Our algorithm is simple, using a 32 bit accumulator (sum), we add + * sequential 16 bit words to it, and at the end, fold back all the + * carry bits from the top 16 bits into the lower 16 bits. + */ + while (nleft > 1) { + sum += *w++; + nleft -= 2; + } + + /* mop up an odd byte, if necessary */ + if (nleft == 1) { + *(u_char *)(&answer) = *(u_char *)w ; + sum += answer; + } + + /* add back carry outs from top 16 bits to low 16 bits */ + sum = (sum >> 16) + (sum & 0xffffL); /* add hi 16 to low 16 */ + sum += (sum >> 16); /* add carry */ + answer = ~sum; /* truncate to 16 bits */ + return(answer); +} + +/* + * tvsub -- + * Subtract 2 timeval structs: out = out - in. Out is assumed to + * be >= in. + */ +tvsub(out, in) + register struct timeval *out, *in; +{ + if ((out->tv_usec -= in->tv_usec) < 0) { + --out->tv_sec; + out->tv_usec += 1000000; + } + out->tv_sec -= in->tv_sec; +} + +/* + * finish -- + * Print out statistics, and give up. + */ +void +finish() +{ + register int i; + + (void)signal(SIGINT, SIG_IGN); + (void)putchar('\n'); + (void)fflush(stdout); + (void)printf("--- %s ping statistics ---\n", hostname); + (void)printf("%ld packets transmitted, ", ntransmitted); + (void)printf("%ld packets received, ", nreceived); + if (nrepeats) + (void)printf("+%ld duplicates, ", nrepeats); + if (ntransmitted) + if (nreceived > ntransmitted) + (void)printf("-- somebody's printing up packets!"); + else + (void)printf("%d%% packet loss", + (int) (((ntransmitted - nreceived) * 100) / + ntransmitted)); + (void)putchar('\n'); + if (nreceived && timing) { + /* Only display average to microseconds */ + i = 1000.0 * tsum / (nreceived + nrepeats); + (void)printf("round-trip min/avg/max = %g/%g/%g ms\n", + tmin, ((double)i) / 1000.0, tmax); + } + exit(0); +} + +#ifdef notdef +static char *ttab[] = { + "Echo Reply", /* ip + seq + udata */ + "Dest Unreachable", /* net, host, proto, port, frag, sr + IP */ + "Source Quench", /* IP */ + "Redirect", /* redirect type, gateway, + IP */ + "Echo", + "Time Exceeded", /* transit, frag reassem + IP */ + "Parameter Problem", /* pointer + IP */ + "Timestamp", /* id + seq + three timestamps */ + "Timestamp Reply", /* " */ + "Info Request", /* id + sq */ + "Info Reply" /* " */ +}; +#endif + +/* + * pr_icmph -- + * Print a descriptive string about an ICMP header. + */ +pr_icmph(icp) + struct icmp *icp; +{ + switch(icp->icmp_type) { + case ICMP_ECHOREPLY: + (void)printf("Echo Reply\n"); + /* XXX ID + Seq + Data */ + break; + case ICMP_UNREACH: + switch(icp->icmp_code) { + case ICMP_UNREACH_NET: + (void)printf("Destination Net Unreachable\n"); + break; + case ICMP_UNREACH_HOST: + (void)printf("Destination Host Unreachable\n"); + break; + case ICMP_UNREACH_PROTOCOL: + (void)printf("Destination Protocol Unreachable\n"); + break; + case ICMP_UNREACH_PORT: + (void)printf("Destination Port Unreachable\n"); + break; + case ICMP_UNREACH_NEEDFRAG: + (void)printf("frag needed and DF set\n"); + break; + case ICMP_UNREACH_SRCFAIL: + (void)printf("Source Route Failed\n"); + break; + default: + (void)printf("Dest Unreachable, Bad Code: %d\n", + icp->icmp_code); + break; + } + /* Print returned IP header information */ +#ifndef icmp_data + pr_retip(&icp->icmp_ip); +#else + pr_retip((struct ip *)icp->icmp_data); +#endif + break; + case ICMP_SOURCEQUENCH: + (void)printf("Source Quench\n"); +#ifndef icmp_data + pr_retip(&icp->icmp_ip); +#else + pr_retip((struct ip *)icp->icmp_data); +#endif + break; + case ICMP_REDIRECT: + switch(icp->icmp_code) { + case ICMP_REDIRECT_NET: + (void)printf("Redirect Network"); + break; + case ICMP_REDIRECT_HOST: + (void)printf("Redirect Host"); + break; + case ICMP_REDIRECT_TOSNET: + (void)printf("Redirect Type of Service and Network"); + break; + case ICMP_REDIRECT_TOSHOST: + (void)printf("Redirect Type of Service and Host"); + break; + default: + (void)printf("Redirect, Bad Code: %d", icp->icmp_code); + break; + } + (void)printf("(New addr: 0x%08lx)\n", icp->icmp_gwaddr.s_addr); +#ifndef icmp_data + pr_retip(&icp->icmp_ip); +#else + pr_retip((struct ip *)icp->icmp_data); +#endif + break; + case ICMP_ECHO: + (void)printf("Echo Request\n"); + /* XXX ID + Seq + Data */ + break; + case ICMP_TIMXCEED: + switch(icp->icmp_code) { + case ICMP_TIMXCEED_INTRANS: + (void)printf("Time to live exceeded\n"); + break; + case ICMP_TIMXCEED_REASS: + (void)printf("Frag reassembly time exceeded\n"); + break; + default: + (void)printf("Time exceeded, Bad Code: %d\n", + icp->icmp_code); + break; + } +#ifndef icmp_data + pr_retip(&icp->icmp_ip); +#else + pr_retip((struct ip *)icp->icmp_data); +#endif + break; + case ICMP_PARAMPROB: + (void)printf("Parameter problem: pointer = 0x%02x\n", + icp->icmp_hun.ih_pptr); +#ifndef icmp_data + pr_retip(&icp->icmp_ip); +#else + pr_retip((struct ip *)icp->icmp_data); +#endif + break; + case ICMP_TSTAMP: + (void)printf("Timestamp\n"); + /* XXX ID + Seq + 3 timestamps */ + break; + case ICMP_TSTAMPREPLY: + (void)printf("Timestamp Reply\n"); + /* XXX ID + Seq + 3 timestamps */ + break; + case ICMP_IREQ: + (void)printf("Information Request\n"); + /* XXX ID + Seq */ + break; + case ICMP_IREQREPLY: + (void)printf("Information Reply\n"); + /* XXX ID + Seq */ + break; +#ifdef ICMP_MASKREQ + case ICMP_MASKREQ: + (void)printf("Address Mask Request\n"); + break; +#endif +#ifdef ICMP_MASKREPLY + case ICMP_MASKREPLY: + (void)printf("Address Mask Reply\n"); + break; +#endif + default: + (void)printf("Bad ICMP type: %d\n", icp->icmp_type); + } +} + +/* + * pr_iph -- + * Print an IP header with options. + */ +pr_iph(ip) + struct ip *ip; +{ + int hlen; + u_char *cp; + + hlen = ip->ip_hl << 2; + cp = (u_char *)ip + 20; /* point to options */ + + (void)printf("Vr HL TOS Len ID Flg off TTL Pro cks Src Dst Data\n"); + (void)printf(" %1x %1x %02x %04x %04x", + ip->ip_v, ip->ip_hl, ip->ip_tos, ip->ip_len, ip->ip_id); + (void)printf(" %1x %04x", ((ip->ip_off) & 0xe000) >> 13, + (ip->ip_off) & 0x1fff); + (void)printf(" %02x %02x %04x", ip->ip_ttl, ip->ip_p, ip->ip_sum); + (void)printf(" %s ", inet_ntoa(*(struct in_addr *)&ip->ip_src.s_addr)); + (void)printf(" %s ", inet_ntoa(*(struct in_addr *)&ip->ip_dst.s_addr)); + /* dump and option bytes */ + while (hlen-- > 20) { + (void)printf("%02x", *cp++); + } + (void)putchar('\n'); +} + +/* + * pr_addr -- + * Return an ascii host address as a dotted quad and optionally with + * a hostname. + */ +char * +pr_addr(l) + u_long l; +{ + struct hostent *hp; + static char buf[80]; + + if ((options & F_NUMERIC) || + !(hp = gethostbyaddr((char *)&l, 4, AF_INET))) + (void)sprintf(buf, "%s", inet_ntoa(*(struct in_addr *)&l)); + else + (void)sprintf(buf, "%s (%s)", hp->h_name, + inet_ntoa(*(struct in_addr *)&l)); + return(buf); +} + +/* + * pr_retip -- + * Dump some info on a returned (via ICMP) IP packet. + */ +pr_retip(ip) + struct ip *ip; +{ + int hlen; + u_char *cp; + + pr_iph(ip); + hlen = ip->ip_hl << 2; + cp = (u_char *)ip + hlen; + + if (ip->ip_p == 6) + (void)printf("TCP: from port %u, to port %u (decimal)\n", + (*cp * 256 + *(cp + 1)), (*(cp + 2) * 256 + *(cp + 3))); + else if (ip->ip_p == 17) + (void)printf("UDP: from port %u, to port %u (decimal)\n", + (*cp * 256 + *(cp + 1)), (*(cp + 2) * 256 + *(cp + 3))); +} + +fill(bp, patp) + char *bp, *patp; +{ + register int ii, jj, kk; + int pat[16]; + char *cp; + + for (cp = patp; *cp; cp++) + if (!isxdigit(*cp)) { + (void)fprintf(stderr, + "ping: patterns must be specified as hex digits.\n"); + exit(1); + } + ii = sscanf(patp, + "%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x", + &pat[0], &pat[1], &pat[2], &pat[3], &pat[4], &pat[5], &pat[6], + &pat[7], &pat[8], &pat[9], &pat[10], &pat[11], &pat[12], + &pat[13], &pat[14], &pat[15]); + + if (ii > 0) + for (kk = 0; + kk <= MAXPACKET - (8 + sizeof(struct timeval) + ii); + kk += ii) + for (jj = 0; jj < ii; ++jj) + bp[jj + kk] = pat[jj]; + if (!(options & F_QUIET)) { + (void)printf("PATTERN: 0x"); + for (jj = 0; jj < ii; ++jj) + (void)printf("%02x", bp[jj] & 0xFF); + (void)printf("\n"); + } +} + +usage() +{ + (void)fprintf(stderr, + "usage: ping [-Rdfnqrv] [-c count] [-i wait] [-l preload]\n\t[-p pattern] [-s packetsize] host\n"); + exit(1); +} diff --git a/bin/pr.c b/bin/pr.c new file mode 100644 index 0000000..654718f --- /dev/null +++ b/bin/pr.c @@ -0,0 +1,459 @@ +static char *sccsid = "@(#)pr.c 4.5 (Berkeley) 12/12/84"; + +/* + * print file with headings + * 2+head+2+page[56]+5 + */ + +#include +#include +#include +#include + +/* Making putcp a macro sped things up by 14%. */ +#define putcp(c) if (page >= fpage) putchar(c) + +int ncol = 1; +char *header; +int col; +int icol; +FILE *file; +char *bufp; +#define BUFS 9000 /* at least 66 * 132 */ +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 fflg; +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': /* define page header */ + if (argc>=2) { + header = *++argv; + argc--; + } + continue; + + case 't': /* don't print page headers */ + ntflg++; + continue; + + case 'f': /* use form feeds */ + fflg++; + plength = 60; + continue; + + case 'l': /* length of page */ + length = atoi(++*argv); + continue; + + case 'w': /* width of page */ + width = atoi(++*argv); + continue; + + case 's': /* col separator */ + if (*++*argv) + tabc = **argv; + else + tabc = '\t'; + continue; + + case 'm': /* all files at once */ + mflg++; + continue; + + default: + if (numeric(*argv)) { /* # of cols */ + if ((ncol = atoi(*argv)) == 0) { + fprintf(stderr, "can't print 0 cols, using 1 instead.\n"); + ncol = 1; + } + } else { + fprintf(stderr, "pr: bad key %s\n", *argv); + exit(1); + } + continue; + } + } else if (**argv == '+') { /* start at page ++*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); +} + +/* numeric -- returns 1 if str is numeric, elsewise 0 */ +numeric(str) + char *str; +{ + for (; *str ; str++) { + if (*str > '9' || *str < '0') { + return(0); + } + } + return(1); +} + +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 -- print file */ +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==0? 1 : 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) + perror(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) { + if (fflg) { + /* Assume a ff takes two blank lines at the + top of the page. */ + line = 2; + sprintf(linebuf, "%s %s %s Page %d\n\n\n", + cbuf+4, cbuf+20, header, page); + } else + 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) { + if (fflg) + put('\f'); + else + while(line=10) { + fprintf(stderr, "pr: Too many args\n"); + done(); + } + } +} + +putpage() +{ + register int lastcol, i, c; + int j; + + if (ncol==0) { + while (line512) + n = 512; + if((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); +} diff --git a/bin/ps.c b/bin/ps.c new file mode 100644 index 0000000..78e91cc --- /dev/null +++ b/bin/ps.c @@ -0,0 +1,995 @@ +/* + * 1999/8/11 - Remove reference to SDETACH. It was removed from the kernel + * (finally) because it was not needed. + * + * 1997/12/16 - Fix coredump when processing -U. + * + * 1996/11/16 - Move 'psdatabase' in /var/run. + * + * 12/20/94 - Missing casts caused errors in reporting on swapped + * processes - sms + * 1/7/93 - Heavily revised when the symbol table format changed - sms + * + * ps - process status + * Usage: ps [ acgklnrtuwxU# ] [ corefile [ swapfile [ system ] ] ] + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define within(x,y,z) (((unsigned)(x) >= (y)) && ((unsigned)(x) < (z))) +#define round(x,y) ((long) ((((long) (x) + (long) (y) - 1L) / (long) (y)) * (long) (y))) + + struct nlist nl[4]; +#define X_PROC 0 +#define X_NPROC 1 +#define X_HZ 2 + +/* + * This is no longer the size of a symbol's name, symbols can be much + * larger now. This define says how many characters of a symbol's name + * to save in the wait channel name. A new define has been created to + * limit the size of symbol string read from the string table. +*/ +#define NNAMESIZ 8 +#define MAXSYMLEN 32 + + struct proc *mproc, proc[8]; + struct user u; + int hz; + int chkpid = 0; + char aflg; /* -a: all processes, not just mine */ + char cflg; /* -c: not complete listing of args, just comm. */ + char gflg; /* -g: complete listing including group headers, etc */ + char kflg; /* -k: read from core file instead of real memory */ + char lflg; /* -l: long listing form */ + char nflg; /* -n: numeric wchans */ + char rflg; /* -r: raw output in style */ + char uflg; /* -u: user name */ + char wflg; /* -w[w]: wide terminal */ + char xflg; /* -x: ALL processes, even those without ttys */ + char Uflg; /* -U: update the private list */ + char *tptr, *mytty; + char *uname; + int file; + int nproc; + int nchans; + int nttys; + char *psdb = "/var/run/psdatabase"; + int npr; /* number of processes found so far */ + int twidth; /* terminal width */ + int cmdstart; /* start position for command field */ + char *memf; /* name of kernel memory file */ + char *kmemf = "/dev/kmem"; /* name of physical memory file */ + char *swapf; /* name of swap file to use */ + char *nlistf; /* name of symbol table file to use */ + int kmem, mem, swap; + +/* + * Structure for the unix wchan table + */ +typedef struct wchan { + char cname[NNAMESIZ]; + unsigned caddr; + } WCHAN; + + WCHAN *wchand; + +extern char *calloc(), *malloc(), *realloc(), *ttyname(); + char *gettty(), *getptr(), *getchan(); + int pscomp(), wchancomp(); +extern off_t lseek(); + +/* + * 256 terminals was not only wasteful but unrealistic. For one thing + * 2.11BSD uses bit 7 of the minor device (for almost all terminal interfaces) + * to indicate direct/modem status - this means that 128 terminals is + * a better maximum number of terminals, for another thing the system can't + * support 256 terminals - other resources (memory, files, processes) will + * have been exhausted long ago. If 'ps' complains about too many terminals + * it is time to clean up /dev! + */ +#define MAXTTYS 160 /* 128 plus a few extra */ + +struct ttys { + char name[14]; /* MAXNAMLEN uses too much memory, besides */ + /* device names tend to be very short */ + dev_t ttyd; + } allttys[MAXTTYS]; + +struct map { + off_t b1, e1; off_t f1; + off_t b2, e2; off_t f2; + }; + + struct winsize ws; + struct map datmap; + struct psout *outargs; /* info for first npr processes */ + +main (argc, argv) +char **argv; +{ + int uid, euid, puid, nread; + register int i, j; + char *ap; + register struct proc *procp; + +/* + * Can't initialize unions and we need the macros from a.out.h, so the + * namelist is set up at run time. +*/ + nl[X_PROC].n_un.n_name = "_proc"; + nl[X_NPROC].n_un.n_name = "_nproc"; + nl[X_HZ].n_un.n_name = "_hz"; + + if ((ioctl(fileno(stdout), TIOCGWINSZ, &ws) != -1 && + ioctl(fileno(stderr), TIOCGWINSZ, &ws) != -1 && + ioctl(fileno(stdin), TIOCGWINSZ, &ws) != -1) || + ws.ws_col == 0) + twidth = 80; + else + twidth = ws.ws_col; + + argc--, argv++; + if (argc > 0) { + ap = argv [0]; + while (*ap) switch (*ap++) { + case '-': + break; + + case 'a': + aflg++; + break; + + case 'c': + cflg++; + break; + + case 'g': + gflg++; + break; + + case 'k': + kflg++; + break; + + case 'l': + lflg = 1; + break; + + case 'n': + nflg++; + lflg = 1; + break; + + case 'r': + rflg++; + break; + + case 't': + if (*ap) + tptr = ap; + else if ((tptr = ttyname(0)) != 0) { + tptr = strcpy(mytty, tptr); + if (strncmp(tptr, "/dev/", 5) == 0) + tptr += 5; + } + if (strncmp(tptr, "tty", 3) == 0) + tptr += 3; + aflg++; + gflg++; + if (tptr && *tptr == '?') + xflg++; + while (*ap) + ap++; + break; + + case 'u': + uflg = 1; + break; + + case 'U': + Uflg++; + break; + + case 'w': + if (wflg) + twidth = BUFSIZ; + else if (twidth < 132) + twidth = 132; + wflg++; + break; + + case 'x': + xflg++; + break; + + default: + if (!isdigit(ap[-1])) + break; + chkpid = atoi(--ap); + *ap = '\0'; + aflg++; + xflg++; + break; + } + } + + openfiles(argc, argv); + getkvars(argc, argv); + lseek(kmem,(off_t)nl[X_PROC].n_value,0); + uid = getuid(); + euid = geteuid(); + mytty = ttyname(0); + if (!strncmp(mytty,"/dev/",5)) mytty += 5; + if (!strncmp(mytty,"tty",3)) mytty += 3; + printhdr(); + for (i = 0; i < nproc; i += 8) { + j = nproc - i; + if (j > 8) + j = 8; + j *= sizeof (struct proc); + if ((nread = read(kmem, (char *) proc, j)) != j) { + cantread("proc table", kmemf); + if (nread == -1) + break; + } + for (j = nread / sizeof (struct proc) - 1; j >= 0; j--) { + mproc = &proc[j]; + procp = mproc; + /* skip processes that don't exist */ + if (procp->p_stat == 0) + continue; + /* skip those without a tty unless -x */ + if (procp->p_pgrp == 0 && xflg == 0) + continue; + /* skip group leaders on a tty unless -g, -x, or -t.. */ + if (!tptr && !gflg && !xflg && procp->p_ppid == 1) + continue; + /* -g also skips those where **argv is "-" - see savcom */ + puid = procp->p_uid; + /* skip other peoples processes unless -a or a specific pid */ + if ((uid != puid && euid != puid && aflg == 0) || + (chkpid != 0 && chkpid != procp->p_pid)) + continue; + if (savcom(puid)) + npr++; + } + } + fixup(npr); + for (i = 0; i < npr; i++) { + register int cmdwidth = twidth - cmdstart - 2; + register struct psout *a = &outargs[i]; + + if (rflg) { + if (write(1, (char *) a, sizeof (*a)) != sizeof (*a)) + perror("write"); + continue; + } + else if (lflg) + lpr(a); + else if (uflg) + upr(a); + else + spr(a); + if (cmdwidth < 0) + cmdwidth = 80 - cmdstart - 2; + if (a->o_stat == SZOMB) + printf("%.*s", cmdwidth, " "); + else if (a->o_pid == 0) + printf("%.*s", cmdwidth, " swapper"); + else + printf(" %.*s", twidth - cmdstart - 2, cflg ? a->o_comm : a->o_args); + putchar('\n'); + } + exit(!npr); +} + +getdev() +{ + register DIR *df; + register struct direct *dbuf; + + if (chdir("/dev") < 0) { + perror("/dev"); + exit(1); + } + if ((df = opendir(".")) == NULL) { + fprintf(stderr, "Can't open . in /dev\n"); + exit(1); + } + while (dbuf = readdir(df)) + maybetty(dbuf->d_name); + closedir(df); +} + +/* + * Attempt to avoid stats by guessing minor device + * numbers from tty names. Console is known, + * know that r(hp|up|mt) are unlikely as are different mem's, + * floppy, null, tty, etc. + */ +maybetty(cp) + register char *cp; +{ + register struct ttys *dp; + struct stat stb; + + switch (cp[0]) { + + case 'c': + if (!strcmp(cp, "console")) + break; + /* cu[la]? are possible!?! don't rule them out */ + break; + + case 'd': + if (!strcmp(cp, "drum")) + return; + break; + + case 'f': + if (!strcmp(cp, "floppy")) + return; + break; + + case 'k': + if (!strcmp(cp, "kUmem") || !strcmp(cp, "kmem")) + return; + if (!strcmp(cp, "klog")) + return; + break; + + case 'r': +#define is(a,b) cp[1] == 'a' && cp[2] == 'b' + if (is(h,p) || is(r,a) || is(u,p) || is(h,k) || is(x,p) + || is(r,b) || is(r,l) || is(m,t)) { + if (isdigit(cp[3])) + return; + } + break; + + case 'm': + if (!strcmp("mem", cp)) + return; + if (cp[1] == 't') + return; + break; + + case 'n': + if (!strcmp(cp, "null")) + return; + if (!strncmp(cp, "nrmt", 4)) + return; + break; + + case 'p': + if (cp[1] == 't' && cp[2] == 'y') + return; + break; + } + if (nttys >= MAXTTYS) { + fprintf(stderr, "ps: tty table overflow\n"); + exit(1); + } + dp = &allttys[nttys++]; + (void)strcpy(dp->name, cp); + if (Uflg) { + if (stat(dp->name, &stb) == 0 && + (stb.st_mode&S_IFMT)==S_IFCHR) + dp->ttyd = stb.st_rdev; + else { + nttys--; + return; + } + } else + dp->ttyd = -1; +} + +savcom(puid) +{ + char *tp; + off_t addr; + off_t daddr, saddr; + register struct psout *a; + register struct proc *procp = mproc; + register struct user *up = &u; + long txtsiz, datsiz, stksiz; + int septxt; + + if (procp->p_flag & SLOAD) { + addr = ctob((off_t) procp->p_addr); + daddr = ctob((off_t) procp->p_daddr); + saddr = ctob((off_t) procp->p_saddr); + file = mem; + } + else { + addr = (off_t)procp->p_addr << 9; + daddr = (off_t)procp->p_daddr << 9; + saddr = (off_t)procp->p_saddr << 9; + file = swap; + } + lseek(file, addr, 0); + if (read(file, (char *) up, sizeof (u)) != sizeof (u)) + return(0); + + txtsiz = ctob(up->u_tsize); /* set up address maps for user pcs */ + datsiz = ctob(up->u_dsize); + stksiz = ctob(up->u_ssize); + septxt = up->u_sep; + datmap.b1 = (septxt ? 0 : round(txtsiz, TXTRNDSIZ)); + datmap.e1 = datmap.b1 + datsiz; + datmap.f1 = daddr; + datmap.f2 = saddr; + datmap.b2 = stackbas(stksiz); + datmap.e2 = stacktop(stksiz); + tp = gettty(); + if ((tptr && strncmp(tptr,tp,2)) || (strncmp(mytty, tp, 2) && !aflg)) + return(0); + a = &outargs[npr]; /* saving com starts here */ + a->o_uid = puid; + a->o_pid = procp->p_pid; + a->o_flag = procp->p_flag; + a->o_ppid = procp->p_ppid; + a->o_cpu = procp->p_cpu; + a->o_pri = procp->p_pri; + a->o_nice = procp->p_nice; + a->o_addr0 = procp->p_addr; + a->o_size = ctod(procp->p_dsize + procp->p_ssize + USIZE); + a->o_wchan = procp->p_wchan; + a->o_pgrp = procp->p_pgrp; + strncpy(a->o_tty, tp, sizeof (a->o_tty)); + a->o_ttyd = tp[0] == '?' ? -1 : up->u_ttyd; + a->o_stat = procp->p_stat; + a->o_flag = procp->p_flag; + + if (a->o_stat == SZOMB) + return(1); + a->o_utime = up->u_ru.ru_utime; + a->o_stime = up->u_ru.ru_stime; + a->o_cutime = up->u_cru.ru_utime; + a->o_cstime = up->u_cru.ru_stime; + a->o_sigs = (int)up->u_signal[SIGINT] + (int)up->u_signal[SIGQUIT]; + a->o_uname[0] = 0; + strncpy(a->o_comm, up->u_comm, MAXCOMLEN); + + if (cflg) + return (1); + else + return(getcmd(a,saddr)); +} + +char * +gettty() +{ + register int tty_step; + register char *p; + + if (u.u_ttyp) + for (tty_step = 0;tty_step < nttys;++tty_step) + if (allttys[tty_step].ttyd == u.u_ttyd) { + p = allttys[tty_step].name; + if (!strncmp(p,"tty",3)) + p += 3; + return(p); + } + return("?"); +} + +/* + * fixup figures out everybodys name and sorts into a nice order. + */ +fixup(np) +register int np; +{ + register int i; + register struct passwd *pw; + + if (uflg) { + /* + * If we want names, traverse the password file. For each + * passwd entry, look for it in the processes. + * In case of multiple entries in the password file we believe + * the first one (same thing ls does). + */ + while ((pw = getpwent()) != (struct passwd *) NULL) { + for (i = 0; i < np; i++) + if (outargs[i].o_uid == pw->pw_uid) { + if (outargs[i].o_uname[0] == 0) + strcpy(outargs[i].o_uname, pw->pw_name); + } + } + } + qsort(outargs, np, sizeof (outargs[0]), pscomp); +} + +pscomp(x1, x2) +register struct psout *x1, *x2; +{ + register int c; + + c = (x1)->o_ttyd - (x2)->o_ttyd; + if (c == 0) + c = (x1)->o_pid - (x2)->o_pid; + return(c); +} + +wchancomp(x1, x2) +register WCHAN *x1, *x2; +{ + if (x1->caddr > x2->caddr) + return(1); + else if (x1->caddr == x2->caddr) + return(0); + else + return(-1); +} + +char * +getptr(adr) +char **adr; +{ + char *ptr = 0; + register char *p, *pa; + register int i; + + pa = (char *)adr; + p = (char *)&ptr; + for (i = 0; i < sizeof (ptr); i++) + *p++ = getbyte(pa++); + return(ptr); +} + +getbyte(adr) +register char *adr; +{ + register struct map *amap = &datmap; + char b; + off_t 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) == (off_t) -1 || read (file, &b, 1) < 1) + return(0); + return((unsigned) b); +} + +addchan(name, caddr) + char *name; + unsigned caddr; + { + static int left = 0; + register WCHAN *wp; + + if (left == 0) + { + if (wchand) + { + left = 50; + wchand = (WCHAN *)realloc(wchand, (nchans + left) * + sizeof (struct wchan)); + } + else + { + left = 300; + wchand = (WCHAN *)malloc(left * sizeof (struct wchan)); + } + if (!wchand) + { + fprintf(stderr, "ps: out of wait channel memory\n"); + nflg++; + return; + } + } + wp = &wchand[nchans++]; + left--; + strncpy(wp->cname, name, NNAMESIZ - 1); + wp->cname[NNAMESIZ-1] = '\0'; + wp->caddr = caddr; + } + +char * +getchan(chan) +register unsigned int chan; +{ + register int i; + register char *prevsym; + + prevsym = ""; + if (chan) + for (i = 0; i < nchans; i++) { + if (wchand[i].caddr > chan) + return (prevsym); + prevsym = wchand[i].cname; + } + return(prevsym); +} + +nlist() + { + register FILE *nlistf_fp; + FILE *strfp; + register struct nlist *nnn; + int flag, nsyms; + struct nlist nbuf; + struct xexec hbuf; + char name[MAXSYMLEN + 2]; + int nllen; + off_t sa, stroff; + + bzero(name, sizeof (name)); + nllen = sizeof(nl) / sizeof(struct nlist); + if (!(nlistf_fp = fopen(nlistf,"r"))) + perrexit(nlistf); + strfp = fopen(nlistf, "r"); + if (fread(&hbuf,sizeof(hbuf),1,nlistf_fp) != 1) + { + fputs("Invalid symbol table\n",stderr); + exit(1); + } + if (N_BADMAG(hbuf.e)) + { + fprintf(stderr,"%s: bad magic number\n",nlistf); + exit(1); + } + nsyms = hbuf.e.a_syms / sizeof (struct nlist); + if (nsyms == 0) + { + fprintf(stderr,"%s: no symbols\n",nlistf); + exit(1); + } + sa = N_SYMOFF(hbuf); + stroff = N_STROFF(hbuf); + fseek(nlistf_fp, sa, L_SET); + + addchan("u", 0140000); /* XXX - see comment below */ + while (nsyms--) + { + fread(&nbuf,sizeof(nbuf),1,nlistf_fp); + if ((nbuf.n_type & N_EXT) == 0) + continue; + flag = nbuf.n_type & N_TYPE; +/* + * Now read the symbol string. Can't rely on having enough memory to + * hold the entire string table, so we do a seek+read for each name. Luckily + * this is only done for global symbols, which cuts down the work done. +*/ + fseek(strfp, nbuf.n_un.n_strx + stroff, L_SET); + fread(name, MAXSYMLEN, 1, strfp); + +/* + * Skip over anything which isn't an external data or bss symbol. + * Advantage was taken of the facts that 1) 'ps' is highly machine + * dependent and 2) _u on a pdp-11 is not likely to change _ever_. + * The reason behind this is to avoid matching on absolute symbols created + * during the unix/netnix cross binding. +*/ + if (!(flag == N_DATA || flag == N_BSS)) + continue; + if (!nflg) + addchan(name + 1, nbuf.n_value); + if (nllen) + { + for (nnn = nl; nnn->n_un.n_name; nnn++) + { + if (!strcmp(nnn->n_un.n_name, name)) + { + nnn->n_value = nbuf.n_value; + nnn->n_type = nbuf.n_type; + nnn->n_ovly = nbuf.n_ovly; + --nllen; + break; + } + } + } + } + fclose(nlistf_fp); + fclose(strfp); + if (!nflg) + qsort(wchand,nchans,sizeof(WCHAN),wchancomp); + } + +perrexit(msg) +char *msg; +{ + perror(msg); + exit(1); +} + +writepsdb() +{ + register FILE *fp; + int nllen; + + setuid(getuid()); + if (!(fp = fopen (psdb, "w"))) + perrexit(psdb); + else + fchmod(fileno(fp),0644); + nllen = sizeof(nl) / sizeof(struct nlist); + fwrite(nlistf,strlen(nlistf) + 1,1,fp); + fwrite((char *)&nllen,sizeof(nllen),1,fp); + fwrite((char *)&nttys,sizeof(nttys),1,fp); + fwrite((char *)&nchans,sizeof(nchans),1,fp); + fwrite((char *)nl,sizeof(struct nlist),nllen,fp); + fwrite((char *)allttys,sizeof(struct ttys),nttys,fp); + fwrite((char *)wchand,sizeof(WCHAN),nchans,fp); + fclose(fp); +} + +char * +readpsdb() +{ + register int i; + register FILE *fp; + register WCHAN *ccc; + static char unamebuf[MAXPATHLEN + 1]; + char *p = unamebuf; + int nllen; + + if ((fp = fopen(psdb, "r")) == NULL) + perrexit(psdb); + + while ((*p= getc(fp)) != '\0') + p++; + fread(&nllen, sizeof nllen, 1, fp); + fread(&nttys, sizeof nttys, 1, fp); + fread(&nchans, sizeof nchans, 1, fp); + fread(nl, sizeof (struct nlist), nllen, fp); + fread(allttys, sizeof (struct ttys), nttys, fp); + if (!nflg) + if (!(wchand = (WCHAN *)calloc(nchans, sizeof(WCHAN)))) { + fputs("Too many symbols\n",stderr); + exit(1); + } + else for (i = 0, ccc = wchand; i < nchans; i++) { + fread((char *) ccc, sizeof(WCHAN), 1, fp); + ccc++; + } + return(unamebuf); +} + +openfiles(argc, argv) +char **argv; +{ + if (kflg) + kmemf = argc > 1 ? argv[1] : "/usr/sys/core"; + kmem = open(kmemf, 0); + if (kmem < 0) + perrexit(kmemf); + if (!kflg) + memf = "/dev/mem"; + else + memf = kmemf; + mem = open(memf, 0); + if (mem < 0) + perrexit(memf); + swapf = argc > 2 ? argv[2] : "/dev/swap"; + swap = open(swapf, 0); + if (swap < 0) + perrexit(swapf); +} + +getkvars(argc,argv) +int argc; +char **argv; +{ + struct stat st; + + nlistf = argc > 3 ? argv[3] : "/unix"; + if (Uflg) { + nlist(); + getdev(); + writepsdb(); + exit(0); + } + else if (stat(psdb, &st) == 0) { + uname = readpsdb(); + if (strcmp(uname,nlistf)) { + /* + * Let addchan() do the work. + */ + nchans = 0; + free((char *)wchand); + nlist(); + } + } + else { + nlist(); + getdev(); + } + + /* find number of procs */ + if (nl[X_NPROC].n_value) { + lseek(kmem,(off_t)nl[X_NPROC].n_value,0); + if (read(kmem,(char *)&nproc,sizeof(nproc)) != sizeof(nproc)) { + perror(kmemf); + exit(1); + } + } + else { + fputs("nproc not in namelist\n",stderr); + exit(1); + } + outargs = (struct psout *)calloc(nproc, sizeof(struct psout)); + if (!outargs) { + fputs("ps: not enough memory for saving info\n",stderr); + exit(1); + } + + /* find value of hz */ + lseek(kmem,(off_t)nl[X_HZ].n_value,0); + read(kmem,(char *)&hz,sizeof(hz)); +} + + +char *uhdr = "USER PID NICE SZ TTY TIME"; +upr(a) +register struct psout *a; +{ + printf("%-8.8s%6u%4d%4d %-2.2s",a->o_uname,a->o_pid,a->o_nice,a->o_size,a->o_tty); + ptime(a); +} + +char *shdr = " PID TTY TIME"; +spr (a) +register struct psout *a; +{ + printf("%6u %-2.2s",a->o_pid,a->o_tty); + ptime(a); +} + +char *lhdr = " F S UID PID PPID CPU PRI NICE ADDR SZ WCHAN TTY TIME"; +lpr(a) +register struct psout *a; +{ + static char clist[] = "0SWRIZT"; + + printf("%3o %c%6u%6u%6u%4d%4d%4d%7o%4d", +0377 & a->o_flag,clist[a->o_stat],a->o_uid,a->o_pid, +a->o_ppid,a->o_cpu & 0377,a->o_pri,a->o_nice,a->o_addr0,a->o_size); + if (nflg) + if (a->o_wchan) + printf("%*.*o",NNAMESIZ, NNAMESIZ, a->o_wchan); + else + fputs(" ",stdout); + else + printf(" %-*.*s",NNAMESIZ, NNAMESIZ, getchan(a->o_wchan)); + printf(" %-2.2s",a->o_tty); + ptime(a); +} + +ptime(a) +struct psout *a; +{ + time_t tm; + + tm = (a->o_utime + a->o_stime + 30) / hz; + printf("%3ld:",tm / 60); + tm %= 60; + printf(tm < 10 ? "0%ld" : "%ld",tm); +} + +getcmd(a,addr) +off_t addr; +register struct psout *a; +{ + /* amount of top of stack to examine for args */ +#define ARGLIST (1024/sizeof(int)) + register int *ip; + register char *cp, *cp1; + char c, **ap; + int cc, nbad, abuf [ARGLIST]; + + a->o_args[0] = 0; /* in case of early return */ + addr += ctob((off_t) mproc->p_ssize) - ARGLIST*sizeof(int); + + /* look for sh special */ + lseek(file, addr + ARGLIST*sizeof(int) - 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+sizeof (a->o_args)) ) { + nbad = 0; + while ((c = getbyte(cp++)) && (bp < b+sizeof (a->o_args))) { + if (c<' ' || c > '~') { + if (nbad++ > 3) + break; + continue; + } + *bp++ = c; + } + *bp++ = ' '; + } + *bp++ = 0; + (void)strcpy(a->o_args, b); + return(1); + } + + lseek(file, addr, 0); + if (read(file, (char *) abuf, sizeof (abuf)) != sizeof (abuf)) + return (1); + abuf[ARGLIST-1] = 0; + for (ip = &abuf[ARGLIST-2]; ip > abuf;) { + if (*--ip == -1 || *ip == 0) { + cp = (char *) (ip + 1); + if (*cp == '\0') + cp++; + nbad = 0; + for (cp1 = cp; cp1 < (char *) &abuf[ARGLIST]; cp1++) { + cc = *cp1 & 0177; + if (cc == 0) + *cp1 = ' '; + else if (cc < ' ' || cc > 0176) { + if (++nbad >= 5) { + *cp1++ = ' '; + break; + } + *cp1 = '?'; + } else if (cc == '=') { + *cp1 = '\0'; + while (cp1 > cp && *--cp1 != ' ') + *cp1 = '\0'; + break; + } + } + while (*--cp1 == ' ') + *cp1 = 0; + (void)strcpy(a->o_args, cp); +garbage: + cp = a->o_args; + if (cp[0] == '-' && cp[1] <= ' ' || cp[0] == '?' || cp[0] <= ' ') { + strcat(cp, " ("); + strcat(cp, u.u_comm); + strcat(cp, ")"); + } + cp[63] = 0; /* max room in psout is 64 chars */ + if (xflg || gflg || tptr || cp[0] != '-') + return(1); + return(0); + } + } + goto garbage; +} + +printhdr() +{ + register char *hdr, *cmdstr = " COMMAND"; + + if (rflg) + return; + if (lflg && uflg) { + fputs("ps: specify only one of l and u.\n",stderr); + exit(1); + } + hdr = lflg ? lhdr : (uflg ? uhdr : shdr); + fputs(hdr,stdout); + cmdstart = strlen(hdr); + if (cmdstart + strlen(cmdstr) >= twidth) + cmdstr = " CMD"; + printf("%s\n", cmdstr); + fflush(stdout); +} + +cantread(what, fromwhat) + char *what, *fromwhat; +{ + + fprintf(stderr, "ps: error reading %s from %s\n", what, fromwhat); +} diff --git a/bin/pwd.c b/bin/pwd.c new file mode 100644 index 0000000..44008c2 --- /dev/null +++ b/bin/pwd.c @@ -0,0 +1,35 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#ifndef lint +char copyright[] = +"@(#) Copyright (c) 1980 Regents of the University of California.\n\ + All rights reserved.\n"; +#endif not lint + +#ifndef lint +static char sccsid[] = "@(#)pwd.c 5.1 (Berkeley) 4/30/85"; +#endif not lint + +/* + * Print working (current) directory + */ +#include +#include + +char *getwd(); + +main() +{ + char pathname[MAXPATHLEN + 1]; + + if (getwd(pathname) == NULL) { + fprintf(stderr, "pwd: %s\n", pathname); + exit(1); + } + printf("%s\n", pathname); + exit(0); +} diff --git a/bin/rcp.c b/bin/rcp.c new file mode 100644 index 0000000..05385f2 --- /dev/null +++ b/bin/rcp.c @@ -0,0 +1,874 @@ +/* + * Copyright (c) 1983 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if !defined(lint) && defined(DOSCCS) +char copyright[] = +"@(#) Copyright (c) 1983 The Regents of the University of California.\n\ + All rights reserved.\n"; + +static char sccsid[] = "@(#)rcp.c 5.20.1 (2.11BSD) 1996/3/21"; +#endif /* not lint */ + +/* + * rcp + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "pathnames.h" + +#ifdef KERBEROS +#include + +char krb_realm[REALM_SZ]; +int use_kerberos = 1, encrypt = 0; +CREDENTIALS cred; +Key_schedule schedule; +#endif + +extern int errno; +struct passwd *pwd; +int errs, pflag, port, rem, userid; +int iamremote, iamrecursive, targetshouldbedirectory; + +#define CMDNEEDS 20 +char cmd[CMDNEEDS]; /* must hold "rcp -r -p -d\0" */ + +typedef struct _buf { + int cnt; + char *buf; +} BUF; + +main(argc, argv) + int argc; + char **argv; +{ + extern int optind; + struct servent *sp; + int ch, fflag, tflag; + char *targ, *colon(); + struct passwd *getpwuid(); + int lostconn(); + +#ifdef KERBEROS + sp = getservbyname("kshell", "tcp"); + if (sp == NULL) { + use_kerberos = 0; + old_warning("kshell service unknown"); + sp = getservbyname("kshell", "tcp"); + } +#else + sp = getservbyname("shell", "tcp"); +#endif + if (!sp) { + (void)fprintf(stderr, "rcp: shell/tcp: unknown service\n"); + exit(1); + } + port = sp->s_port; + + if (!(pwd = getpwuid(userid = getuid()))) { + (void)fprintf(stderr, "rcp: unknown user %d.\n", userid); + exit(1); + } + + fflag = tflag = 0; + while ((ch = getopt(argc, argv, "dfkprtx")) != EOF) + switch(ch) { + case 'd': + targetshouldbedirectory = 1; + break; + case 'f': /* "from" */ + fflag = 1; + break; +#ifdef KERBEROS + case 'k': + strncpy(krb_realm, ++argv, REALM_SZ); + break; +#endif + case 'p': /* preserve access/mod times */ + ++pflag; + break; + case 'r': + ++iamrecursive; + break; + case 't': /* "to" */ + tflag = 1; + break; +#ifdef KERBEROS + case 'x': + encrypt = 1; + des_set_key(cred.session, schedule); + break; +#endif + case '?': + default: + usage(); + } + argc -= optind; + argv += optind; + + if (fflag) { + iamremote = 1; + (void)response(); + (void)setuid(userid); + source(argc, argv); + exit(errs); + } + + if (tflag) { + iamremote = 1; + (void)setuid(userid); + sink(argc, argv); + exit(errs); + } + + if (argc < 2) + usage(); + if (argc > 2) + targetshouldbedirectory = 1; + + rem = -1; + (void)sprintf(cmd, "rcp%s%s%s", iamrecursive ? " -r" : "", + pflag ? " -p" : "", targetshouldbedirectory ? " -d" : ""); + + (void)signal(SIGPIPE, lostconn); + + if (targ = colon(argv[argc - 1])) + toremote(targ, argc, argv); + else { + tolocal(argc, argv); + if (targetshouldbedirectory) + verifydir(argv[argc - 1]); + } + exit(errs); +} + +toremote(targ, argc, argv) + char *targ; + int argc; + char **argv; +{ + int i; + char *bp, *host, *src, *suser, *thost, *tuser; + char *colon(), *malloc(); + + *targ++ = 0; + if (*targ == 0) + targ = "."; + + if (thost = index(argv[argc - 1], '@')) { + *thost++ = 0; + tuser = argv[argc - 1]; + if (*tuser == '\0') + tuser = NULL; + else if (!okname(tuser)) + exit(1); + } else { + thost = argv[argc - 1]; + tuser = NULL; + } + + for (i = 0; i < argc - 1; i++) { + src = colon(argv[i]); + if (src) { /* remote to remote */ + *src++ = 0; + if (*src == 0) + src = "."; + host = index(argv[i], '@'); + if (!(bp = malloc((u_int)(strlen(_PATH_RSH) + + strlen(argv[i]) + strlen(src) + + strlen(tuser) + strlen(thost) + + strlen(targ)) + CMDNEEDS + 20))) + nospace(); + if (host) { + *host++ = 0; + suser = argv[i]; + if (*suser == '\0') + suser = pwd->pw_name; + else if (!okname(suser)) + continue; + (void)sprintf(bp, + "%s %s -l %s -n %s %s '%s%s%s:%s'", + _PATH_RSH, host, suser, cmd, src, + tuser ? tuser : "", tuser ? "@" : "", + thost, targ); + } else + (void)sprintf(bp, "%s %s -n %s %s '%s%s%s:%s'", + _PATH_RSH, argv[i], cmd, src, + tuser ? tuser : "", tuser ? "@" : "", + thost, targ); + (void)susystem(bp); + (void)free(bp); + } else { /* local to remote */ + if (rem == -1) { + if (!(bp = malloc((u_int)strlen(targ) + + CMDNEEDS + 20))) + nospace(); + (void)sprintf(bp, "%s -t %s", cmd, targ); + host = thost; +#ifdef KERBEROS + if (use_kerberos) + kerberos(bp, + tuser ? tuser : pwd->pw_name); + else +#endif + rem = rcmd(&host, port, pwd->pw_name, + tuser ? tuser : pwd->pw_name, + bp, 0); + if (rem < 0) + exit(1); + if (response() < 0) + exit(1); + (void)free(bp); + (void)setuid(userid); + } + source(1, argv+i); + } + } +} + +tolocal(argc, argv) + int argc; + char **argv; +{ + int i; + char *bp, *host, *src, *suser; + char *colon(), *malloc(); + + for (i = 0; i < argc - 1; i++) { + if (!(src = colon(argv[i]))) { /* local to local */ + if (!(bp = malloc((u_int)(strlen(_PATH_CP) + + strlen(argv[i]) + strlen(argv[argc - 1])) + 20))) + nospace(); + (void)sprintf(bp, "%s%s%s %s %s", _PATH_CP, + iamrecursive ? " -r" : "", pflag ? " -p" : "", + argv[i], argv[argc - 1]); + (void)susystem(bp); + (void)free(bp); + continue; + } + *src++ = 0; + if (*src == 0) + src = "."; + host = index(argv[i], '@'); + if (host) { + *host++ = 0; + suser = argv[i]; + if (*suser == '\0') + suser = pwd->pw_name; + else if (!okname(suser)) + continue; + } else { + host = argv[i]; + suser = pwd->pw_name; + } + if (!(bp = malloc((u_int)(strlen(src)) + CMDNEEDS + 20))) + nospace(); + (void)sprintf(bp, "%s -f %s", cmd, src); +#ifdef KERBEROS + if (use_kerberos) + kerberos(bp, suser); + else +#endif + rem = rcmd(&host, port, pwd->pw_name, suser, bp, 0); + (void)free(bp); + if (rem < 0) + continue; + (void)setreuid(0, userid); + sink(1, argv + argc - 1); + (void)setreuid(userid, 0); + (void)close(rem); + rem = -1; + } +} + +#ifdef KERBEROS +kerberos(bp, user) + char *bp, *user; +{ + struct servent *sp; + char *host; + +again: rem = KSUCCESS; + if (krb_realm[0] == '\0') + rem = krb_get_lrealm(krb_realm, 1); + if (rem == KSUCCESS) { + if (encrypt) + rem = krcmd_mutual(&host, port, user, bp, 0, + krb_realm, &cred, schedule); + else + rem = krcmd(&host, port, user, bp, 0, krb_realm); + } else { + (void)fprintf(stderr, + "rcp: error getting local realm %s\n", krb_err_txt[rem]); + exit(1); + } + if (rem < 0 && errno == ECONNREFUSED) { + use_kerberos = 0; + old_warning("remote host doesn't support Kerberos"); + sp = getservbyname("shell", "tcp"); + if (sp == NULL) { + (void)fprintf(stderr, + "rcp: unknown service shell/tcp\n"); + exit(1); + } + port = sp->s_port; + goto again; + } +} +#endif /* KERBEROS */ + +verifydir(cp) + char *cp; +{ + struct stat stb; + + if (stat(cp, &stb) >= 0) { + if ((stb.st_mode & S_IFMT) == S_IFDIR) + return; + errno = ENOTDIR; + } + error("rcp: %s: %s.\n", cp, strerror(errno)); + exit(1); +} + +char * +colon(cp) + register char *cp; +{ + for (; *cp; ++cp) { + if (*cp == ':') + return(cp); + if (*cp == '/') + return(0); + } + return(0); +} + +okname(cp0) + char *cp0; +{ + register char *cp = cp0; + register int c; + + do { + c = *cp; + if (c & 0200) + goto bad; + if (!isalpha(c) && !isdigit(c) && c != '_' && c != '-') + goto bad; + } while (*++cp); + return(1); +bad: + (void)fprintf(stderr, "rcp: invalid user name %s\n", cp0); + return(0); +} + +susystem(s) + char *s; +{ + int status, pid, w; + register int (*istat)(), (*qstat)(); + + if ((pid = vfork()) == 0) { + (void)setuid(userid); + execl(_PATH_BSHELL, "sh", "-c", s, (char *)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; + (void)signal(SIGINT, istat); + (void)signal(SIGQUIT, qstat); + return(status); +} + +source(argc, argv) + int argc; + char **argv; +{ + struct stat stb; + static BUF buffer; + BUF *bp; + off_t i; + int x, readerr, f, amt; + char *last, *name, buf[BUFSIZ]; + BUF *allocbuf(); + + for (x = 0; x < argc; x++) { + name = argv[x]; + if ((f = open(name, O_RDONLY, 0)) < 0) { + error("rcp: %s: %s\n", name, strerror(errno)); + continue; + } + if (fstat(f, &stb) < 0) + goto notreg; + switch (stb.st_mode&S_IFMT) { + + case S_IFREG: + break; + + case S_IFDIR: + if (iamrecursive) { + (void)close(f); + rsource(name, &stb); + continue; + } + /* FALLTHROUGH */ + default: +notreg: (void)close(f); + error("rcp: %s: not a plain file\n", name); + continue; + } + last = rindex(name, '/'); + if (last == 0) + last = name; + else + last++; + if (pflag) { + /* + * Make it compatible with possible future + * versions expecting microseconds. + */ + (void)sprintf(buf, "T%ld 0 %ld 0\n", stb.st_mtime, + stb.st_atime); + (void)write(rem, buf, strlen(buf)); + if (response() < 0) { + (void)close(f); + continue; + } + } + (void)sprintf(buf, "C%04o %ld %s\n", stb.st_mode&07777, + stb.st_size, last); + (void)write(rem, buf, strlen(buf)); + if (response() < 0) { + (void)close(f); + continue; + } + if ((bp = allocbuf(&buffer, f, BUFSIZ)) == 0) { + (void)close(f); + continue; + } + readerr = 0; + for (i = 0; i < stb.st_size; i += bp->cnt) { + amt = bp->cnt; + if (i + amt > stb.st_size) + amt = stb.st_size - i; + if (readerr == 0 && read(f, bp->buf, amt) != amt) + readerr = errno; + (void)write(rem, bp->buf, amt); + } + (void)close(f); + if (readerr == 0) + (void)write(rem, "", 1); + else + error("rcp: %s: %s\n", name, strerror(readerr)); + (void)response(); + } +} + +rsource(name, statp) + char *name; + struct stat *statp; +{ + DIR *d; + struct direct *dp; + char *last, *vect[1], path[MAXPATHLEN]; + + if (!(d = opendir(name))) { + error("rcp: %s: %s\n", name, strerror(errno)); + return; + } + last = rindex(name, '/'); + if (last == 0) + last = name; + else + last++; + if (pflag) { + (void)sprintf(path, "T%ld 0 %ld 0\n", statp->st_mtime, + statp->st_atime); + (void)write(rem, path, strlen(path)); + if (response() < 0) { + closedir(d); + return; + } + } + (void)sprintf(path, "D%04o %d %s\n", statp->st_mode&07777, 0, last); + (void)write(rem, path, strlen(path)); + if (response() < 0) { + closedir(d); + return; + } + while (dp = readdir(d)) { + if (dp->d_ino == 0) + continue; + if (!strcmp(dp->d_name, ".") || !strcmp(dp->d_name, "..")) + continue; + if (strlen(name) + 1 + strlen(dp->d_name) >= MAXPATHLEN - 1) { + error("%s/%s: name too long.\n", name, dp->d_name); + continue; + } + (void)sprintf(path, "%s/%s", name, dp->d_name); + vect[0] = path; + source(1, vect); + } + closedir(d); + (void)write(rem, "E\n", 2); + (void)response(); +} + +response() +{ + register char *cp; + char ch, resp, rbuf[BUFSIZ]; + + if (read(rem, &resp, sizeof(resp)) != sizeof(resp)) + lostconn(); + + cp = rbuf; + switch(resp) { + case 0: /* ok */ + return(0); + default: + *cp++ = resp; + /* FALLTHROUGH */ + case 1: /* error, followed by err msg */ + case 2: /* fatal error, "" */ + do { + if (read(rem, &ch, sizeof(ch)) != sizeof(ch)) + lostconn(); + *cp++ = ch; + } while (cp < &rbuf[BUFSIZ] && ch != '\n'); + + if (!iamremote) + (void)write(2, rbuf, cp - rbuf); + ++errs; + if (resp == 1) + return(-1); + exit(1); + } + /*NOTREACHED*/ +} + +lostconn() +{ + if (!iamremote) + (void)fprintf(stderr, "rcp: lost connection\n"); + exit(1); +} + +sink(argc, argv) + int argc; + char **argv; +{ + register char *cp; + static BUF buffer; + struct stat stb; + struct timeval tv[2]; + BUF *bp, *allocbuf(); + off_t i, j; + char ch, *targ, *why; + int amt, count, exists, first, mask, mode; + int ofd, setimes, targisdir, wrerr, cursize = 0; + off_t size; + char *np, *vect[1], buf[BUFSIZ], *malloc(), *namebuf = NULL; + +#define atime tv[0] +#define mtime tv[1] +#define SCREWUP(str) { why = str; goto screwup; } + + setimes = targisdir = 0; + mask = umask(0); + if (!pflag) + (void)umask(mask); + if (argc != 1) { + error("rcp: ambiguous target\n"); + exit(1); + } + targ = *argv; + if (targetshouldbedirectory) + verifydir(targ); + (void)write(rem, "", 1); + if (stat(targ, &stb) == 0 && (stb.st_mode & S_IFMT) == S_IFDIR) + targisdir = 1; + for (first = 1;; first = 0) { + cp = buf; + if (read(rem, cp, 1) <= 0) { + if (namebuf) + free(namebuf); + return; + } + if (*cp++ == '\n') + SCREWUP("unexpected "); + do { + if (read(rem, &ch, sizeof(ch)) != sizeof(ch)) + SCREWUP("lost connection"); + *cp++ = ch; + } while (cp < &buf[BUFSIZ - 1] && ch != '\n'); + *cp = 0; + + if (buf[0] == '\01' || buf[0] == '\02') { + if (iamremote == 0) + (void)write(2, buf + 1, strlen(buf + 1)); + if (buf[0] == '\02') + exit(1); + errs++; + continue; + } + if (buf[0] == 'E') { + (void)write(rem, "", 1); + if (namebuf) + free(namebuf); + return; + } + + if (ch == '\n') + *--cp = 0; + +#define getnum(t) (t) = 0; while (isdigit(*cp)) (t) = (t) * 10 + (*cp++ - '0'); + cp = buf; + if (*cp == 'T') { + setimes++; + cp++; + getnum(mtime.tv_sec); + if (*cp++ != ' ') + SCREWUP("mtime.sec not delimited"); + getnum(mtime.tv_usec); + if (*cp++ != ' ') + SCREWUP("mtime.usec not delimited"); + getnum(atime.tv_sec); + if (*cp++ != ' ') + SCREWUP("atime.sec not delimited"); + getnum(atime.tv_usec); + if (*cp++ != '\0') + SCREWUP("atime.usec not delimited"); + (void)write(rem, "", 1); + continue; + } + if (*cp != 'C' && *cp != 'D') { + /* + * Check for the case "rcp remote:foo\* local:bar". + * In this case, the line "No match." can be returned + * by the shell before the rcp command on the remote is + * executed so the ^Aerror_message convention isn't + * followed. + */ + if (first) { + error("%s\n", cp); + exit(1); + } + SCREWUP("expected control record"); + } + mode = 0; + for (++cp; cp < buf + 5; cp++) { + if (*cp < '0' || *cp > '7') + SCREWUP("bad mode"); + mode = (mode << 3) | (*cp - '0'); + } + if (*cp++ != ' ') + SCREWUP("mode not delimited"); + size = 0; + while (isdigit(*cp)) + size = size * 10 + (*cp++ - '0'); + if (*cp++ != ' ') + SCREWUP("size not delimited"); + if (targisdir) { + int need; + + need = strlen(targ) + strlen(cp) + 250; + if (need > cursize) { + if (namebuf) + free(namebuf); + if (!(namebuf = malloc((u_int)need))) + error("out of memory\n"); + cursize = need; + } + (void)sprintf(namebuf, "%s%s%s", targ, + *targ ? "/" : "", cp); + np = namebuf; + } + else + np = targ; + exists = stat(np, &stb) == 0; + if (buf[0] == 'D') { + if (exists) { + if ((stb.st_mode&S_IFMT) != S_IFDIR) { + errno = ENOTDIR; + goto bad; + } + if (pflag) + (void)chmod(np, mode); + } else if (mkdir(np, mode) < 0) + goto bad; + vect[0] = np; + sink(1, vect); + if (setimes) { + setimes = 0; + if (utimes(np, tv) < 0) + error("rcp: can't set times on %s: %s\n", + np, strerror(errno)); + } + continue; + } + if ((ofd = open(np, O_WRONLY|O_CREAT, mode)) < 0) { +bad: error("rcp: %s: %s\n", np, strerror(errno)); + continue; + } + if (exists && pflag) + (void)fchmod(ofd, mode); + (void)write(rem, "", 1); + if ((bp = allocbuf(&buffer, ofd, BUFSIZ)) == 0) { + (void)close(ofd); + continue; + } + cp = bp->buf; + count = 0; + wrerr = 0; + for (i = 0; i < size; i += BUFSIZ) { + amt = BUFSIZ; + if (i + amt > size) + amt = size - i; + count += amt; + do { + j = read(rem, cp, amt); + if (j <= 0) { + error("rcp: %s\n", + j ? strerror(errno) : + "dropped connection"); + exit(1); + } + amt -= j; + cp += j; + } while (amt > 0); + if (count == bp->cnt) { + if (wrerr == 0 && + write(ofd, bp->buf, count) != count) + wrerr++; + count = 0; + cp = bp->buf; + } + } + if (count != 0 && wrerr == 0 && + write(ofd, bp->buf, count) != count) + wrerr++; + if (ftruncate(ofd, size)) + error("rcp: can't truncate %s: %s\n", np, + strerror(errno)); + (void)close(ofd); + (void)response(); + if (setimes) { + setimes = 0; + if (utimes(np, tv) < 0) + error("rcp: can't set times on %s: %s\n", + np, strerror(errno)); + } + if (wrerr) + error("rcp: %s: %s\n", np, strerror(errno)); + else + (void)write(rem, "", 1); + } +screwup: + error("rcp: protocol screwup: %s\n", why); + exit(1); +} + +BUF * +allocbuf(bp, fd, blksize) + BUF *bp; + int fd, blksize; +{ + struct stat stb; + int size; + char *malloc(); + + if (fstat(fd, &stb) < 0) { + error("rcp: fstat: %s\n", strerror(errno)); + return(0); + } + size = roundup(stb.st_blksize, blksize); + if (size == 0) + size = blksize; + if (bp->cnt < size) { + if (bp->buf != 0) + free(bp->buf); + bp->buf = (char *)malloc((u_int)size); + if (!bp->buf) { + error("rcp: malloc: out of memory\n"); + return(0); + } + } + bp->cnt = size; + return(bp); +} + +/* VARARGS1 */ +error(fmt, a1, a2, a3) + char *fmt; + int a1, a2, a3; +{ + static FILE *fp; + + ++errs; + if (!fp && !(fp = fdopen(rem, "w"))) + return; + (void)fprintf(fp, "%c", 0x01); + (void)fprintf(fp, fmt, a1, a2, a3); + (void)fflush(fp); + if (!iamremote) + (void)fprintf(stderr, fmt, a1, a2, a3); +} + +nospace() +{ + (void)fprintf(stderr, "rcp: out of memory.\n"); + exit(1); +} + +#ifdef KERBEROS +old_warning(str) + char *str; +{ + (void)fprintf(stderr, "rcp: warning: %s, using standard rcp\n", str); +} +#endif + +usage() +{ +#ifdef KERBEROS + (void)fprintf(stderr, "%s\n\t%s\n", + "usage: rcp [-k realm] [-px] f1 f2", + "or: rcp [-k realm] [-rpx] f1 ... fn directory"); +#else + (void)fprintf(stderr, + "usage: rcp [-p] f1 f2; or: rcp [-rp] f1 ... fn directory\n"); +#endif + exit(1); +} diff --git a/bin/rm.c b/bin/rm.c new file mode 100644 index 0000000..509bd03 --- /dev/null +++ b/bin/rm.c @@ -0,0 +1,262 @@ +static char *sccsid = "@(#)rm.c 4.18 (Berkeley) 1/6/86"; + +/* + * rm - for ReMoving files, directories & trees. + */ + +#include +#include +#include +#include +#include + +int fflg; /* -f force - supress error messages */ +int iflg; /* -i interrogate user on each file */ +int rflg; /* -r recurse */ + +int errcode; /* true if errors occured */ + +char *strcpy(), *malloc(), *realloc(); + +main(argc, argv) + char *argv[]; +{ + register char *arg; + + fflg = !isatty(0); + iflg = 0; + rflg = 0; + while (argc > 1 && argv[1][0] == '-') { + arg = *++argv; + argc--; + + /* + * all files following a null option are considered file names + */ + if (arg[1] == '\0') + break; + + while (*++arg != '\0') + switch(*arg) { + case 'f': + fflg++; + break; + + case 'i': + iflg++; + break; + + case 'R': + case 'r': + rflg++; + break; + + default: + fprintf(stderr, "usage: rm [-rif] file ...\n"); + exit(1); + } + } + + if (argc < 2 && !fflg) { + fprintf(stderr, "usage: rm [-rif] file ...\n"); + exit(1); + } + + while (--argc > 0) + (void) rm(*++argv, 0); + + exit(errcode != 0); +} + +char *path; /* pointer to malloc'ed buffer for path */ +char *pathp; /* current pointer to end of path */ +int pathsz; /* size of path */ + +/* + * Return TRUE if sucessful. Recursive with -r (rflg) + */ +rm(arg, level) + char arg[]; +{ + int ok; /* true if recursive rm succeeded */ + struct stat buf; /* for finding out what a file is */ + struct direct *dp; /* for reading a directory */ + DIR *dirp; /* for reading a directory */ + char prevname[MAXNAMLEN + 1]; /* previous name for -r */ + char *cp; + + if (dotname(arg)) { + fprintf(stderr, "rm: cannot remove `.' or `..'\n"); + return (0); + } + if (lstat(arg, &buf)) { + if (!fflg) { + fprintf(stderr, "rm: %s nonexistent\n", arg); + errcode++; + } + return (0); /* error */ + } + if ((buf.st_mode&S_IFMT) == S_IFDIR) { + if (!rflg) { + if (!fflg) { + fprintf(stderr, "rm: %s directory\n", arg); + errcode++; + } + return (0); + } + if (iflg && level != 0) { + printf("rm: remove directory %s? ", arg); + if (!yes()) + return (0); /* didn't remove everything */ + } + if (access(arg, R_OK|W_OK|X_OK) != 0) { + if (rmdir(arg) == 0) + return (1); /* salvaged: removed empty dir */ + if (!fflg) { + fprintf(stderr, "rm: %s not changed\n", arg); + errcode++; + } + return (0); /* error */ + } + if ((dirp = opendir(arg)) == NULL) { + if (!fflg) { + fprintf(stderr, "rm: cannot read %s?\n", arg); + errcode++; + } + return (0); + } + if (level == 0) + append(arg); + prevname[0] = '\0'; + while ((dp = readdir(dirp)) != NULL) { + if (dotname(dp->d_name)) { + strcpy(prevname, dp->d_name); + continue; + } + append(dp->d_name); + closedir(dirp); + ok = rm(path, level + 1); + for (cp = pathp; *--cp != '/' && cp > path; ) + ; + pathp = cp; + *cp++ = '\0'; + if ((dirp = opendir(arg)) == NULL) { + if (!fflg) { + fprintf(stderr, "rm: cannot read %s?\n", arg); + errcode++; + } + break; + } + /* pick up where we left off */ + if (prevname[0] != '\0') { + while ((dp = readdir(dirp)) != NULL && + strcmp(prevname, dp->d_name) != 0) + ; + } + /* skip the one we just failed to delete */ + if (!ok) { + dp = readdir(dirp); + if (dp != NULL && strcmp(cp, dp->d_name)) { + fprintf(stderr, + "rm: internal synchronization error: %s, %s, %s\n", + arg, cp, dp->d_name); + } + strcpy(prevname, dp->d_name); + } + } + closedir(dirp); + if (level == 0) { + pathp = path; + *pathp = '\0'; + } + if (iflg) { + printf("rm: remove %s? ", arg); + if (!yes()) + return (0); + } + if (rmdir(arg) < 0) { + if (!fflg || iflg) { + fprintf(stderr, "rm: %s not removed\n", arg); + errcode++; + } + return (0); + } + return (1); + } + + if (iflg) { + printf("rm: remove %s? ", arg); + if (!yes()) + return (0); + } else if (!fflg) { + if ((buf.st_mode&S_IFMT) != S_IFLNK && access(arg, W_OK) < 0) { + printf("rm: override protection %o for %s? ", + buf.st_mode&0777, arg); + if (!yes()) + return (0); + } + } + if (unlink(arg) < 0) { + if (!fflg || iflg) { + fprintf(stderr, "rm: %s not removed\n", arg); + errcode++; + } + return (0); + } + return (1); +} + +/* + * boolean: is it "." or ".." ? + */ +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); +} + +/* + * Get a yes/no answer from the user. + */ +yes() +{ + int i, b; + + i = b = getchar(); + while (b != '\n' && b != EOF) + b = getchar(); + return (i == 'y'); +} + +/* + * Append 'name' to 'path'. + */ +append(name) + char *name; +{ + register int n; + + n = strlen(name); + if (path == NULL) { + pathsz = MAXNAMLEN + MAXPATHLEN + 2; + if ((path = malloc(pathsz)) == NULL) { + fprintf(stderr, "rm: ran out of memory\n"); + exit(1); + } + pathp = path; + } else if (pathp + n + 2 > path + pathsz) { + fprintf(stderr, "rm: path name too long: %s\n", path); + exit(1); + } else if (pathp != path && pathp[-1] != '/') + *pathp++ = '/'; + strcpy(pathp, name); + pathp += n; +} diff --git a/bin/rmail.c b/bin/rmail.c new file mode 100644 index 0000000..786cea8 --- /dev/null +++ b/bin/rmail.c @@ -0,0 +1,124 @@ +#if !defined(lint) && defined(DOSCCS) +static char sccsid[] = "@(#)rmail.c 4.8.1 (2.11BSD) 1996/10/21"; +#endif + +/* +** RMAIL -- UUCP mail server. +** +** This program reads the >From ... remote from ... lines that +** UUCP is so fond of and turns them into something reasonable. +** It calls sendmail giving it a -f option built from these +** lines. +*/ + +#include +#include +#include +#include + +typedef char bool; +#define TRUE 1 +#define FALSE 0 + +bool Debug; + +main(argc, argv) + char **argv; +{ + FILE *out; /* output to sendmail */ + char lbuf[1024]; /* one line of the message */ + char from[512]; /* accumulated path of sender */ + char ufrom[512]; /* user on remote system */ + char sys[512]; /* a system in path */ + char junk[1024]; /* scratchpad */ + char cmd[2000]; + register char *cp; + register char *uf = ufrom; /* ptr into ufrom */ + int i; + +# ifdef DEBUG + if (argc > 1 && strcmp(argv[1], "-T") == 0) + { + Debug = TRUE; + argc--; + argv++; + } +# endif DEBUG + + if (argc < 2) + { + fprintf(stderr, "Usage: rmail user ...\n"); + exit(EX_USAGE); + } + + (void) strcpy(from, ""); + (void) strcpy(ufrom, "/dev/null"); + + for (;;) + { + (void) fgets(lbuf, sizeof lbuf, stdin); + if (strncmp(lbuf, "From ", 5) != 0 && strncmp(lbuf, ">From ", 6) != 0) + break; + (void) sscanf(lbuf, "%s %s", junk, ufrom); + cp = lbuf; + for (;;) + { + cp = index(cp+1, 'r'); + if (cp == NULL) + { + register char *p = rindex(uf, '!'); + + if (p != NULL) + { + *p = '\0'; + (void) strcpy(sys, uf); + uf = p + 1; + break; + } + cp = "remote from somewhere"; + } +#ifdef DEBUG + if (Debug) + printf("cp='%s'\n", cp); +#endif + if (strncmp(cp, "remote from ", 12)==0) + break; + } + if (cp != NULL) + (void) sscanf(cp, "remote from %s", sys); + (void) strcat(from, sys); + (void) strcat(from, "!"); +#ifdef DEBUG + if (Debug) + printf("ufrom='%s', sys='%s', from now '%s'\n", uf, sys, from); +#endif + } + (void) strcat(from, uf); + + (void) sprintf(cmd, "%s -ee -f%s -i", _PATH_SENDMAIL, from); + while (*++argv != NULL) + { + (void) strcat(cmd, " '"); + if (**argv == '(') + (void) strncat(cmd, *argv + 1, strlen(*argv) - 2); + else + (void) strcat(cmd, *argv); + (void) strcat(cmd, "'"); + } +#ifdef DEBUG + if (Debug) + printf("cmd='%s'\n", cmd); +#endif + out = popen(cmd, "w"); + fputs(lbuf, out); + while (fgets(lbuf, sizeof lbuf, stdin)) + fputs(lbuf, out); + i = pclose(out); + if ((i & 0377) != 0) + { + fprintf(stderr, "pclose: status 0%o\n", i); + exit(EX_OSERR); + } + + exit((i >> 8) & 0377); +} diff --git a/bin/rmdir.c b/bin/rmdir.c new file mode 100644 index 0000000..dd84de3 --- /dev/null +++ b/bin/rmdir.c @@ -0,0 +1,39 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#ifndef lint +char copyright[] = +"@(#) Copyright (c) 1983 Regents of the University of California.\n\ + All rights reserved.\n"; +#endif not lint + +#ifndef lint +static char sccsid[] = "@(#)rmdir.c 5.1 (Berkeley) 4/30/85"; +#endif not lint + +/* + * Remove directory + */ +#include + +main(argc,argv) + int argc; + char **argv; +{ + int errors = 0; + + if (argc < 2) { + fprintf(stderr, "usage: %s directory ...\n", argv[0]); + exit(1); + } + while (--argc) + if (rmdir(*++argv) < 0) { + fprintf(stderr, "rmdir: "); + perror(*argv);; + errors++; + } + exit(errors != 0); +} diff --git a/bin/sed/Makefile b/bin/sed/Makefile new file mode 100644 index 0000000..ce1cf1e --- /dev/null +++ b/bin/sed/Makefile @@ -0,0 +1,15 @@ +# Makefile 4.1 85/04/05 +# +CFLAGS=-O -w +SEPFLAG=-i + +sed: sed0.o sed1.o + cc ${SEPFLAG} -o sed *.o + +sed0.o: sed0.c sed.h +sed1.o: sed1.c sed.h + +install: sed + install -s sed $(DESTDIR)/bin +clean: + rm -f *.o sed diff --git a/bin/sed/sed.h b/bin/sed/sed.h new file mode 100644 index 0000000..7680258 --- /dev/null +++ b/bin/sed/sed.h @@ -0,0 +1,163 @@ +/* sed.h 4.1 85/04/05 */ + +/* + * 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 200 +#define RESIZE 10000 +#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[BUFSIZ]; +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; + } A; + struct reptr2 { + char *ad1; + char *ad2; + union reptr *lb1; + char *rhs; + FILE *fcode; + char command; + char gfl; + char pfl; + char inar; + char negfl; + } B; +} 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/bin/sed/sed0.c b/bin/sed/sed0.c new file mode 100644 index 0000000..46dbc49 --- /dev/null +++ b/bin/sed/sed0.c @@ -0,0 +1,976 @@ +/* sed0.c 4.2 85/06/19 */ + +#include +#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) { + if(op) + rep->re1 = op; + else { + fprintf(stderr, + "First RE may not be null\n"); + exit(2); + } + } 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/bin/sed/sed1.c b/bin/sed/sed1.c new file mode 100644 index 0000000..27b04ba --- /dev/null +++ b/bin/sed/sed1.c @@ -0,0 +1,720 @@ +/* sed1.c 4.2 85/04/05 */ + +#include +#include "sed.h" + +char *trans[040] = { + "\\01", + "\\02", + "\\03", + "\\04", + "\\05", + "\\06", + "\\07", + "<-", + ">-", + "\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); + fflush(ipc->fcode); + 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, BUFSIZ)) <= 0) { + return(badp); + } + p2 = ibuf; + ebp = ibuf+c; + } + if ((c = *p2++) == '\n') { + if(p2 >= ebp) { + if((c = read(f, ibuf, BUFSIZ)) <= 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/bin/sh/Makefile b/bin/sh/Makefile new file mode 100644 index 0000000..74b4185 --- /dev/null +++ b/bin/sh/Makefile @@ -0,0 +1,34 @@ +# Makefile 4.5 83/07/01 +# +CFLAGS = -O -w +SEPFLAG= -i + +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 ${SEPFLAG} -o sh *.o + +install: all + install -s sh $(DESTDIR)/bin +clean: + rm -f sh *.o diff --git a/bin/sh/args.c b/bin/sh/args.c new file mode 100644 index 0000000..c75a958 --- /dev/null +++ b/bin/sh/args.c @@ -0,0 +1,139 @@ +#ifndef lint +static char sccsid[] = "@(#)args.c 4.4 7/31/85"; +#endif + +# +/* + * 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/bin/sh/blok.c b/bin/sh/blok.c new file mode 100644 index 0000000..52b4ff0 --- /dev/null +++ b/bin/sh/blok.c @@ -0,0 +1,115 @@ +#ifndef lint +static char sccsid[] = "@(#)blok.c 4.2 8/11/83"; +#endif + +# +/* + * 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 pword) &= ~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 qbloktop 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/bin/sh/brkincr.h b/bin/sh/brkincr.h new file mode 100644 index 0000000..897bfa9 --- /dev/null +++ b/bin/sh/brkincr.h @@ -0,0 +1,4 @@ +/* brkincr.h 4.1 82/05/07 */ + +#define BRKINCR 01000 +#define BRKMAX 04000 diff --git a/bin/sh/builtin.c b/bin/sh/builtin.c new file mode 100644 index 0000000..92b0569 --- /dev/null +++ b/bin/sh/builtin.c @@ -0,0 +1,6 @@ +#ifndef lint +static char sccsid[] = "@(#)builtin.c 4.2 8/11/83"; +#endif + +builtin() +{return(0);} diff --git a/bin/sh/cmd.c b/bin/sh/cmd.c new file mode 100644 index 0000000..f6e1b19 --- /dev/null +++ b/bin/sh/cmd.c @@ -0,0 +1,410 @@ +#ifndef lint +static char sccsid[] = "@(#)cmd.c 4.2 8/11/83"; +#endif + +# +/* + * 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/bin/sh/ctype.c b/bin/sh/ctype.c new file mode 100644 index 0000000..604e037 --- /dev/null +++ b/bin/sh/ctype.c @@ -0,0 +1,112 @@ +#ifndef lint +static char sccsid[] = "@(#)ctype.c 4.2 8/11/83"; +#endif + +# +/* + * 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/bin/sh/ctype.h b/bin/sh/ctype.h new file mode 100644 index 0000000..19ffa66 --- /dev/null +++ b/bin/sh/ctype.h @@ -0,0 +1,92 @@ +/* ctype.h 4.1 82/05/07 */ + +# +/* + * 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)"E)==0 ANDF _ctype1[c]&(T_SPC)) +#define eofmeta(c) (((c)"E)==0 ANDF _ctype1[c]&(_META|T_EOF)) +#define qotchar(c) (((c)"E)==0 ANDF _ctype1[c]&(T_QOT)) +#define eolchar(c) (((c)"E)==0 ANDF _ctype1[c]&(T_EOR|T_EOF)) +#define dipchar(c) (((c)"E)==0 ANDF _ctype1[c]&(T_DIP)) +#define subchar(c) (((c)"E)==0 ANDF _ctype1[c]&(T_SUB|T_QOT)) +#define escchar(c) (((c)"E)==0 ANDF _ctype1[c]&(T_ESC)) + +char _ctype2[]; + +#define digit(c) (((c)"E)==0 ANDF _ctype2[c]&(T_DIG)) +#define fngchar(c) (((c)"E)==0 ANDF _ctype2[c]&(T_FNG)) +#define dolchar(c) (((c)"E)==0 ANDF _ctype2[c]&(T_AST|T_BRC|T_DIG|T_IDC|T_SHN)) +#define defchar(c) (((c)"E)==0 ANDF _ctype2[c]&(T_DEF)) +#define setchar(c) (((c)"E)==0 ANDF _ctype2[c]&(T_SET)) +#define digchar(c) (((c)"E)==0 ANDF _ctype2[c]&(T_AST|T_DIG)) +#define letter(c) (((c)"E)==0 ANDF _ctype2[c]&(T_IDC)) +#define alphanum(c) (((c)"E)==0 ANDF _ctype2[c]&(_IDCH)) +#define astchar(c) (((c)"E)==0 ANDF _ctype2[c]&(T_AST)) diff --git a/bin/sh/defs.h b/bin/sh/defs.h new file mode 100644 index 0000000..7148aa1 --- /dev/null +++ b/bin/sh/defs.h @@ -0,0 +1,292 @@ +/* defs.h 4.4 85/03/19 */ + +# +/* + * 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 setupenv(); +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 +#define batchflg 040000 +INT flags; + +/* error exits from various parts of shell */ +#include +jmp_buf subshell; +jmp_buf errshell; +jmp_buf INTbuf; + +/* fault handling */ +#include "brkincr.h" +POS brkincr; + +#define MINTRAP 0 +#define MAXTRAP 32 + +#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[]; +BOOL trapjmp[]; + +/* 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/bin/sh/dup.h b/bin/sh/dup.h new file mode 100644 index 0000000..a0049f4 --- /dev/null +++ b/bin/sh/dup.h @@ -0,0 +1,12 @@ +/* dup.h 4.1 82/05/07 */ + +# +/* + * UNIX shell + * + * S. R. Bourne + * Bell Telephone Laboratories + * + */ + +#define DUPFLG 0100 diff --git a/bin/sh/error.c b/bin/sh/error.c new file mode 100644 index 0000000..358b23a --- /dev/null +++ b/bin/sh/error.c @@ -0,0 +1,87 @@ +#ifndef lint +static char sccsid[] = "@(#)error.c 4.2 8/11/83"; +#endif + +# +/* + * 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/bin/sh/expand.c b/bin/sh/expand.c new file mode 100644 index 0000000..38ce8d3 --- /dev/null +++ b/bin/sh/expand.c @@ -0,0 +1,194 @@ +#ifndef lint +static char sccsid[] = "@(#)expand.c 4.5 8/11/83"; +#endif + +# +/* + * UNIX shell + * + * S. R. Bourne + * Bell Telephone Laboratories + * + */ + +#include "defs.h" +#include +#include +#include + + + +/* 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; + DIR *dirf; + BOOL dir=0; + STRING rescan = 0; + REG STRING s, cs; + ARGPTR schain = gchain; + struct direct *dp; + STATBUF statb; + + IF trapnote&SIGSET THEN return(0); FI + + s=cs=as; + + /* 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=opendir(s)) != NULL + 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 + + IF setjmp(INTbuf) == 0 THEN trapjmp[INTR] = 1; FI + WHILE (trapnote&SIGSET) == 0 ANDF (dp = readdir(dirf)) != NULL + DO IF (*dp->d_name=='.' ANDF *cs!='.') + THEN continue; + FI + IF gmatch(dp->d_name, cs) + THEN addg(s,dp->d_name,rescan); count++; + FI + OD + closedir(dirf); trapjmp[INTR] = 0; + + 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/bin/sh/fault.c b/bin/sh/fault.c new file mode 100644 index 0000000..8207b74 --- /dev/null +++ b/bin/sh/fault.c @@ -0,0 +1,118 @@ +#ifndef lint +static char sccsid[] = "@(#)fault.c 4.3 8/11/83"; +#endif + +# +/* + * UNIX shell + * + * S. R. Bourne + * Bell Telephone Laboratories + * + */ + +#include "defs.h" + + +STRING trapcom[MAXTRAP]; +BOOL trapflg[MAXTRAP]; +BOOL trapjmp[MAXTRAP]; + +/* ======== fault handling routines ======== */ + + +VOID fault(sig) + REG INT sig; +{ + REG INT flag; + + 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 + IF trapjmp[sig] ANDF sig==INTR + THEN + trapjmp[sig] = 0; + longjmp(INTbuf, 1); + 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/bin/sh/io.c b/bin/sh/io.c new file mode 100644 index 0000000..ca8bad5 --- /dev/null +++ b/bin/sh/io.c @@ -0,0 +1,136 @@ +#ifndef lint +static char sccsid[] = "@(#)io.c 4.3 3/19/85"; +#endif + +# +/* + * UNIX shell + * + * S. R. Bourne + * Bell Telephone Laboratories + * + */ + +#include "defs.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 dup2(f1, 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/bin/sh/mac.h b/bin/sh/mac.h new file mode 100644 index 0000000..1b85fc5 --- /dev/null +++ b/bin/sh/mac.h @@ -0,0 +1,61 @@ +/* mac.h 4.2 82/12/24 */ + +# +/* + * 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( +#undef DONE +#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 ':' diff --git a/bin/sh/macro.c b/bin/sh/macro.c new file mode 100644 index 0000000..eb60e4b --- /dev/null +++ b/bin/sh/macro.c @@ -0,0 +1,237 @@ +#ifndef lint +static char sccsid[] = "@(#)macro.c 4.3 8/11/83"; +#endif + +# +/* + * 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 locstak(); 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/bin/sh/main.c b/bin/sh/main.c new file mode 100644 index 0000000..439bba9 --- /dev/null +++ b/bin/sh/main.c @@ -0,0 +1,189 @@ +#ifndef lint +static char sccsid[] = "@(#)main.c 4.3 3/19/85"; +#endif + +# +/* + * UNIX shell + * + * S. R. Bourne + * Bell Telephone Laboratories + * + */ + +#include "defs.h" +#include "sym.h" +#include "timeout.h" +#include +#include +#include +#include + +UFD output = 2; +LOCAL BOOL beenhere = FALSE; +CHAR tmpout[20] = "/tmp/sh-"; +FILEBLK stdfile; +FILE standin = &stdfile; +#ifdef stupid +#include +#endif + +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 */ + setupenv(); + + /* 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 +#ifdef stupid + ELSE *execargs=dolv; /* for `ps' cmd */ +#endif + 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); +/* + { + #include + signal(SIGTTIN, SIG_IGN); + signal(SIGTTOU, SIG_IGN); + signal(SIGTSTP, SIG_IGN); + } +*/ + 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); + FI + + trapnote=0; peekc=readc(); + IF eof + THEN return; + FI + 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; +{ + dup2(fa, fb); + close(fa); + ioctl(fb, FIOCLEX, 0); +} diff --git a/bin/sh/mode.h b/bin/sh/mode.h new file mode 100644 index 0000000..1da216d --- /dev/null +++ b/bin/sh/mode.h @@ -0,0 +1,209 @@ +/* mode.h 4.1 82/05/07 */ + +# +/* + * 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/bin/sh/msg.c b/bin/sh/msg.c new file mode 100644 index 0000000..6a9a5b9 --- /dev/null +++ b/bin/sh/msg.c @@ -0,0 +1,156 @@ +#ifndef lint +static char sccsid[] = "@(#)msg.c 4.4 5/22/85"; +#endif + +# +/* + * 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", + "Urgent condition", + "Stopped", + "Stopped from terminal", + "Continued", + "Child terminated", + "Stopped on terminal input", + "Stopped on terminal output", + "Asynchronous I/O", + "Exceeded cpu time limit", + "Exceeded file size limit", + "Virtual time alarm", + "Profiling time alarm", + "Window changed", + "Signal 29", + "User defined signal 1", + "User defined signal 2", + "Signal 32", +}; +INT num_sysmsg = (sizeof sysmsg / sizeof sysmsg[0]); + +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}, + {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/bin/sh/name.c b/bin/sh/name.c new file mode 100644 index 0000000..2bc361f --- /dev/null +++ b/bin/sh/name.c @@ -0,0 +1,336 @@ +#ifndef lint +static char sccsid[] = "@(#)name.c 4.4 10/31/85"; +#endif + +# +/* + * 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 + /* + * Importing IFS can be very dangerous + */ + IF !bcmp(argi, "IFS=", sizeof("IFS=") - 1) + THEN + int uid; + IF (uid = getuid())!=geteuid() ORF !uid + THEN + return; + FI + FI + 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 setupenv() +{ + 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/bin/sh/name.h b/bin/sh/name.h new file mode 100644 index 0000000..67109d4 --- /dev/null +++ b/bin/sh/name.h @@ -0,0 +1,27 @@ +/* name.h 4.1 82/05/07 */ + +# +/* + * 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/bin/sh/print.c b/bin/sh/print.c new file mode 100644 index 0000000..ee7ccac --- /dev/null +++ b/bin/sh/print.c @@ -0,0 +1,101 @@ +#ifndef lint +static char sccsid[] = "@(#)print.c 4.2 8/11/83"; +#endif + +# +/* + * 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/bin/sh/service.c b/bin/sh/service.c new file mode 100644 index 0000000..a5bc7f0 --- /dev/null +++ b/bin/sh/service.c @@ -0,0 +1,402 @@ +#if !defined(lint) && defined(DOSCCS) +static char sccsid[] = "@(#)service.c 4.4.1 12/9/94"; +#endif + +# +/* + * UNIX shell + * + * S. R. Bourne + * Bell Telephone Laboratories + * + */ + +#include "defs.h" +#include + +PROC VOID gsort(); + +#define ARGMK 01 + +INT errno; +STRING sysmsg[]; +INT num_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,O_WRONLY|O_APPEND))>=0 + THEN ; + 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(), O_RDONLY))<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); + + /* band aid to get csh... 2/26/79 */ + { + char c; + if (!isatty(input)) { + read(input, &c, 1); + if (c == '#') + gocsh(t, p, xecenv); + lseek(input, (long) 0, 0); + } + } + + /* 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 +} + +gocsh(t, cp, xecenv) + register char **t, *cp, **xecenv; +{ + char **newt[1000]; + register char **p; + register int i; + + for (i = 0; t[i]; i++) + newt[i+1] = t[i]; + newt[i+1] = 0; + newt[0] = "/bin/csh"; + newt[1] = cp; + execve("/bin/csh", newt, xecenv); +} + +/* 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; + IF setjmp(INTbuf) == 0 + THEN trapjmp[INTR] = 1; p=wait(&w); + ELSE p = -1; + FI + trapjmp[INTR] = 0; + 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 sig < num_sysmsg ANDF 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"E; +} + +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=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/bin/sh/setbrk.c b/bin/sh/setbrk.c new file mode 100644 index 0000000..0451687 --- /dev/null +++ b/bin/sh/setbrk.c @@ -0,0 +1,21 @@ +#ifndef lint +static char sccsid[] = "@(#)setbrk.c 4.2 8/11/83"; +#endif + +# +/* + * 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/bin/sh/stak.c b/bin/sh/stak.c new file mode 100644 index 0000000..c627dc5 --- /dev/null +++ b/bin/sh/stak.c @@ -0,0 +1,85 @@ +#ifndef lint +static char sccsid[] = "@(#)stak.c 4.2 8/11/83"; +#endif + +# +/* + * 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-stakbotADR(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/bin/sh/stak.h b/bin/sh/stak.h new file mode 100644 index 0000000..7cda327 --- /dev/null +++ b/bin/sh/stak.h @@ -0,0 +1,78 @@ +/* stak.h 4.1 82/05/07 */ + +# +/* + * 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/bin/sh/string.c b/bin/sh/string.c new file mode 100644 index 0000000..9bded58 --- /dev/null +++ b/bin/sh/string.c @@ -0,0 +1,59 @@ +#ifndef lint +static char sccsid[] = "@(#)string.c 4.2 8/11/83"; +#endif + +# +/* + * 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/bin/sh/sym.h b/bin/sh/sym.h new file mode 100644 index 0000000..217e842 --- /dev/null +++ b/bin/sh/sym.h @@ -0,0 +1,48 @@ +/* sym.h 4.1 82/05/07 */ + +# +/* + * 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/bin/sh/timeout.h b/bin/sh/timeout.h new file mode 100644 index 0000000..fde1e20 --- /dev/null +++ b/bin/sh/timeout.h @@ -0,0 +1,12 @@ +/* timeout.h 4.1 82/05/07 */ + +# +/* + * UNIX shell + * + * S. R. Bourne + * Bell Telephone Laboratories + * + */ + +#define TIMEOUT 2400 diff --git a/bin/sh/word.c b/bin/sh/word.c new file mode 100644 index 0000000..c378f43 --- /dev/null +++ b/bin/sh/word.c @@ -0,0 +1,137 @@ +#ifndef lint +static char sccsid[] = "@(#)word.c 4.6 10/31/85"; +#endif + +# +/* + * 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 c=='#' ANDF ((flags&prompt)==0 ORF ((flags&ttyflg) ANDF + standin->fstak!=0)) + THEN WHILE (c=readc()) ANDF c!=NL DONE + FI + + 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; + + IF setjmp(INTbuf) == 0 THEN trapjmp[INTR] = 1; FI + REP IF trapnote&SIGSET THEN newline(); sigchk() FI + PER (len=read(f->fdes,f->fbuf,f->fsiz))<0 ANDF trapnote DONE + trapjmp[INTR] = 0; + return(len); +} diff --git a/bin/sh/xec.c b/bin/sh/xec.c new file mode 100644 index 0000000..0a53b55 --- /dev/null +++ b/bin/sh/xec.c @@ -0,0 +1,425 @@ +#ifndef lint +static char sccsid[] = "@(#)xec.c 4.3 8/11/83"; +#endif + +# +/* + * 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 argn==0 ORF (internal=syslook(com[0],commands)) + 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 i1 + 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/bin/size.c b/bin/size.c new file mode 100644 index 0000000..1330c8f --- /dev/null +++ b/bin/size.c @@ -0,0 +1,81 @@ +#if defined(DOSCCS) && !defined(lint) +static char *sccsid = "@(#)size.c 4.4.1 (2.11BSD GTE) 1/1/94"; +#endif + +/* + * size + */ + +#include +#include + +int header; + +main(argc, argv) +char **argv; +{ + struct exec buf; + long sum; + int gorp,i; + int err = 0; + FILE *f; +#ifdef pdp11 + struct ovlhdr ovlbuf; /* overlay structure */ + long coresize; /* total text size */ + short skip; /* skip over overlay sizes of 0 */ +#endif + + 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); + err++; + continue; + } + if (fread((char *)&buf, sizeof(buf), 1, f) != 1 || + N_BADMAG(buf)) { + printf("size: %s not an object file\n", *argv); + fclose(f); + err++; + continue; + } + if (header == 0) { + printf("text\tdata\tbss\tdec\thex\n"); + header = 1; + } + printf("%u\t%u\t%u\t", buf.a_text,buf.a_data,buf.a_bss); + sum = (long) buf.a_text + (long) buf.a_data + (long) buf.a_bss; + printf("%ld\t%lx", sum, sum); + if (gorp>2) + printf("\t%s", *argv); +#ifdef pdp11 + if (buf.a_magic == A_MAGIC5 || buf.a_magic == A_MAGIC6) { + fread(&ovlbuf,sizeof(ovlbuf),1,f); + coresize = buf.a_text; + for (i = 0; i < NOVL; i++) + coresize += ovlbuf.ov_siz[i]; + printf("\ttotal text: %ld\n\toverlays: ", coresize); + for (i = 0,skip = 0; i < NOVL; i++) { + if (!ovlbuf.ov_siz[i]) { + ++skip; + continue; + } + for (;skip;--skip) + fputs(",0",stdout); + if (i > 0) + putchar(','); + printf("%u", ovlbuf.ov_siz[i]); + } + } +#endif + printf("\n"); + fclose(f); + } + exit(err); +} diff --git a/bin/strip.c b/bin/strip.c new file mode 100644 index 0000000..c472ebe --- /dev/null +++ b/bin/strip.c @@ -0,0 +1,71 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(DOSCCS) && !defined(lint) +char copyright[] = +"@(#) Copyright (c) 1983 Regents of the University of California.\n\ + All rights reserved.\n"; + +static char sccsid[] = "@(#)strip.c 5.1.1 (2.11BSD GTE) 1/1/94"; +#endif + +#include +#include +#include +#include + +struct xexec head; +int status; + +main(argc, argv) + char *argv[]; +{ + register i; + + signal(SIGHUP, SIG_IGN); + signal(SIGINT, SIG_IGN); + signal(SIGQUIT, SIG_IGN); + for (i = 1; i < argc; i++) { + strip(argv[i]); + if (status > 1) + break; + } + exit(status); +} + +strip(name) + char *name; +{ + register f; + long size; + + f = open(name, O_RDWR); + if (f < 0) { + fprintf(stderr, "strip: "); perror(name); + status = 1; + goto out; + } + if (read(f, (char *)&head, sizeof (head)) < 0 || N_BADMAG(head.e)) { + printf("strip: %s not in a.out format\n", name); + status = 1; + goto out; + } + if ((head.e.a_syms == 0) && ((head.e.a_flag & 1) != 0)) + goto out; + + size = N_DATOFF(head) + head.e.a_data; + head.e.a_syms = 0; + head.e.a_flag |= 1; + if (ftruncate(f, size) < 0) { + fprintf("strip: "); perror(name); + status = 1; + goto out; + } + (void) lseek(f, (long)0, L_SET); + (void) write(f, (char *)&head.e, sizeof (head.e)); +out: + close(f); +} diff --git a/bin/stty/Makefile b/bin/stty/Makefile new file mode 100644 index 0000000..dc1f1f9 --- /dev/null +++ b/bin/stty/Makefile @@ -0,0 +1,37 @@ +# +# Public Domain. 1997/3/27 - Steven Schultz +# +# @(#)Makefile 1.0 (2.11BSD) 1997/3/27 +# +CFLAGS= -O +SEPFLAG= -i +SRCS= stty.c +OBJS= stty.o +MAN= stty.0 +MANSRC= stty.1 + +all: stty stty.0 + +stty: ${OBJS} + ${CC} ${CFLAGS} ${SEPFLAG} -o $@ ${OBJS} + +stty.0: ${MANSRC} + /usr/man/manroff ${MANSRC} > ${MAN} + +clean: + rm -f ${OBJS} ${MAN} stty tags + +depend: ${SRCS} + mkdep ${CFLAGS} ${SRCS} + +install: stty + install -c -o bin -g bin -m 444 ${MAN} ${DESTDIR}/usr/man/cat1 + install -s -o root -g bin -m 755 stty ${DESTDIR}/bin/stty + +lint: ${SRCS} + lint -hax ${SRCS} + +tags: ${SRCS} + ctags ${SRCS} +# DO NOT DELETE THIS LINE -- mkdep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. diff --git a/bin/stty/stty.1 b/bin/stty/stty.1 new file mode 100644 index 0000000..d92eec6 --- /dev/null +++ b/bin/stty/stty.1 @@ -0,0 +1,409 @@ +.\" Copyright (c) 1983 Regents of the University of California. +.\" All rights reserved. The Berkeley software License Agreement +.\" specifies the terms and conditions for redistribution. +.\" +.\" @(#)stty.1 6.4.1 (2.11BSD) 1997/5/2 +.\" +.TH STTY 1 "March 27, 1997" +.UC 4 +.SH NAME +stty \- set terminal options +.SH SYNOPSIS +.B stty +[\fB\-a | \-e\fP] +[\fB-f\fP \fIfile\fP] +[operands] +.SH DESCRIPTION +.I Stty +sets certain I/O options on the current output terminal, +placing its output on the diagnostic output. +With no argument, it reports the speed of the terminal and the +settings of the options which are different from their defaults. +.PP +The following options are available: +.TP 10 +\fB\-a\fP +Display everything \fIstty\fP knows. This has the same effect +as using the operand \fBall\fP or \fBeverything\fP. The distinction between +\fBall\fP and \fBeverything\fP has been removed. +.TP 10 +\fB\-e\fP +Same a \fB\-a\fP above. +.TP 10 +\fB\-f\fP +Open and use the terminal named by \fIfile\fP rather than using standard +output. The file is opened using the O_NONBLOCK flag of \fBopen\fP(), +making it possible to set or display settings on a terminal that might +otherwise block on the open. +.PP +The following operands are special: +.TP 12 +.B all +Everything +.I stty +knows about is printed. +.TP 12 +.B everything +Same as \fBall\fP above. +.TP 12 +.B flushout +Flush the queues for the device. This is most useful when an exiting +process is stuck waiting for terminal output to drain. +.TP 12 +.B speed +The terminal speed alone is printed on the standard output. +.TP 12 +.B size +The terminal (window) sizes are printed on the standard output, +first rows and then columns. +.PP +\fIOperands\fP are selected from the following: +.TP 10 +.B even +allow even parity input +.br +.ns +.TP 10 +.B \-even +disallow even parity input +.TP 10 +.B odd +allow odd parity input +.br +.ns +.TP 10 +.B \-odd +disallow odd parity input +.TP 10 +.B raw +raw mode input +(\fBno\fR input processing (erase, kill, interrupt, ...); parity bit passed back) +.br +.ns +.TP 10 +.B \-raw +negate raw mode +.TP 10 +.B cooked +same as `\-raw' +.TP 10 +.B cbreak +make each character available to +.IR read (2) +as received; no erase and kill processing, +but all other processing (interrupt, suspend, ...) is performed +.br +.ns +.TP 10 +.B \-cbreak +make characters available to +.I read +only when newline is received +.TP 10 +.B \-nl +allow carriage return for new-line, +and output CR-LF for carriage return or new-line +.br +.ns +.TP 10 +.B nl +accept only new-line to end lines +.TP 10 +.B echo +echo back every character typed +.br +.ns +.TP 10 +.B \-echo +do not echo characters +.TP 10 +.B tandem +enable inbound software (xon/xoff) flow control, so that the system sends +out the stop character when +its internal queue is in danger of overflowing on input, and sends the +start character when it is ready to accept further input +.br +.ns +.TP 10 +.B \-tandem +disable inbound software (xon/xoff) flow control +.TP 10 +.B \-tabs +replace tabs by spaces when printing +.br +.ns +.TP 10 +.B tabs +preserve tabs +.br +.PP +For the following commands which take a character argument \fIc\fR, +you may also specify \fIc\fR as ``undef'', to set the value +to be undefined. A value of ``^x'', a 2 character sequence, is also +interpreted as a control character, with ``^?'' representing delete. +.TP 10 +.BI erase \ c\fR +set erase character to +.I c +(default `#', but often reset to ^H.) +.br +.ns +.TP 10 +.BI kill \ c\fR +set kill character to +.I c +(default `@', but often reset to ^U.) +.br +.ns +.TP 10 +.BI intr \ c\fR +set interrupt character to +.I c +(default DEL or ^? (delete), but often reset to ^C.) +.br +.ns +.TP 10 +.BI quit \ c\fR +set quit character to +.I c +(default control \e.) +.br +.ns +.TP 10 +.BI start \ c\fR +set start character to +.I c +(default control Q.) +.br +.ns +.TP 10 +.BI stop \ c\fR +set stop character to +.I c +(default control S.) +.br +.ns +.TP 10 +.BI eof \ c\fR +set end of file character to +.I c +(default control D.) +.br +.ns +.TP 10 +.BI brk \ c\fR +set break character to +.I c +(default undefined.) +This character is an additional character causing wakeup. +.br +.ns +.TP 10 +.B dec +set all modes suitable for Digital Equipment Corp. operating systems +users; (erase, kill, and interrupt characters to ^?, ^U, and ^C, +decctlq and ``newcrt''.) +.ns +.TP 10 +.B 0 +hang up phone line immediately +.br +.ns +.TP 10 +.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). +.TP 10 +.BI rows \ n\fR +The terminal size is recorded as having +.I n +rows. +.TP 10 +.BI columns \ n\fR +The terminal size is recorded as having +.I n +columns. +.TP 10 +.BI cols \ n\fR +is an alias for +.IR columns . +.PP +A teletype driver which supports the job control processing of +.IR csh (1) +and more functionality than the basic driver is fully described in +.IR tty (4). +The following options apply only to it. +.TP 10 +.B new +Use new driver (switching flushes typeahead). +.br +.ns +.TP 10 +.B crt +Set options for a CRT (crtbs, ctlecho and, if >= 1200 baud, +crterase and crtkill.) +.TP 10 +.B crtbs +Echo backspaces on erase characters. +.TP 10 +.B prterase +For printing terminal echo erased characters backwards within ``\e'' and ``/''. +.TP 10 +.B crterase +Wipe out erased characters with ``backspace-space-backspace.'' +.br +.ns +.TP 10 +.B \-crterase +Leave erased characters visible; just backspace. +.TP 10 +.B crtkill +Wipe out input on like kill ala \fBcrterase\fP. +.br +.ns +.TP 10 +.B \-crtkill +Just echo line kill character and a newline on line kill. +.TP 10 +.B ctlecho +Echo control characters as ``^\fIx\fR'' (and delete as ``^?''.) +Print two backspaces following the EOT character (control D). +.br +.ns +.TP 10 +.B \-ctlecho +Control characters echo as themselves; in cooked mode EOT (control-D) +is not echoed. +.TP 10 +.B decctlq +After output is suspended (normally by ^S), only a start character +(normally ^Q) will restart it. This is compatible with DEC's vendor +supplied systems. +.br +.ns +.TP 10 +.B \-decctlq +After output is suspended, any character typed will restart it; +the start character will restart output without providing any input. +(This is the default.) +.TP 10 +.B tostop +Background jobs stop if they attempt terminal output. +.br +.ns +.TP 10 +.B \-tostop +Output from background jobs to the terminal is allowed. +.TP 10 +.B flusho +Output is being discarded usually because user hit control O (internal state bit). +.br +.ns +.TP 10 +.B \-flusho +Output is not being discarded. +.TP 10 +.B pendin +Input is pending after a switch from cbreak to cooked +and will be re-input when a read becomes pending or more input arrives +(internal state bit). +.br +.ns +.TP 10 +.B \-pendin +Input is not pending. +.TP 10 +.B pass8 +Passes all 8 bits through on input, in any mode. +.br +.ns +.TP 10 +.B \-pass8 +Strips the 0200 bit on input except in raw mode. +.TP 10 +.B mdmbuf +Start/stop output on carrier transitions (not implemented). +.br +.ns +.TP 10 +.B \-mdmbuf +Return error if write attempted after carrier drops. +.TP 10 +.B litout +Send output characters without any processing. +.br +.ns +.TP 10 +.B \-litout +Do normal output processing, inserting delays, etc. +.TP 10 +.B nohang +Don't send hangup signal if carrier drops. +.br +.ns +.TP 10 +.B \-nohang +Send hangup signal to control process group when carrier drops. +.PP +The following special characters are applicable only to the new +teletype driver +and are not normally changed. +.TP 10 +.BI susp \ c\fR +set suspend process character to \fIc\fR (default control Z). +.br +.ns +.TP 10 +.BI dsusp \ c\fR +set delayed suspend process character to \fIc\fR (default control Y). +.br +.ns +.TP 10 +.BI rprnt \ c\fR +set reprint line character to \fIc\fR (default control R). +.br +.ns +.TP 10 +.BI flush \ c\fR +set flush output character to \fIc\fR (default control O). +.br +.ns +.TP 10 +.BI werase \ c\fR +set word erase character to \fIc\fR (default control W). +.br +.ns +.TP 10 +.BI lnext \ c\fR +set literal next character to \fIc\fR (default control V). +.PP +.B Modem Control Status: +.sp +These display the current state of modem control. +They are only displayed for actual tty lines and not for pseudo tty +lines (more precisely, it is only displayed for lines which support +the TIOCMGET ioctl. See tty(4). +.br +.ns +While it is possible to change the state of the modem control lines, +the hardware or other software may prevent the change from actually +taking place, +or may cause the state to immediately revert to the original state. +.TP 15 +\fBdcd\fP (\fB\-dcd\fP) +State of Data Carrier Detect. +.TP 15 +\fBdsr\fP (\fB\-dsr\fP) +State of Data Set Ready. +.TP 15 +\fBdtr\fP (\fB\-dtr\fP) +State of Data Terminal Ready. +.TP 15 +\fBcts\fP (\fB\-cts\fP) +State of Clear To Send. +.TP 15 +\fBrts\fP (\fB\-rts\fP) +State of Request To Send. +.SH "SEE ALSO" +ioctl(2), tabs(1), tset(1), tty(4) diff --git a/bin/stty/stty.c b/bin/stty/stty.c new file mode 100644 index 0000000..07f7edf --- /dev/null +++ b/bin/stty/stty.c @@ -0,0 +1,529 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if !defined(lint) && defined(DOSCCS) +char copyright[] = +"@(#) Copyright (c) 1980 Regents of the University of California.\n\ + All rights reserved.\n"; + +static char sccsid[] = "@(#)stty.c 5.4.3 (2.11BSD GTE) 1997/5/7"; +#endif + +/* + * set teletype modes + */ + +#include +#include +#include +#include +#include + +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, + "19200", EXTA, + "extb", EXTB, + "38400", EXTB, + 0, +}; + +unsigned speed[] = { + 0,50,75,110,134,150,200,300,600,1200,1800,2400,4800,9600,19200,38400 +}; + +struct MODES + { + char *string; + int set; + int reset; + }; + +struct MODES 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, + "-tabs", XTABS, 0, + "tabs", 0, XTABS, + "tandem", TANDEM, 0, + "-tandem", 0, TANDEM, + "cbreak", CBREAK, 0, + "-cbreak", 0, CBREAK, + 0 + }; + +struct MODES lmodes[] = { + "rtscts", LRTSCTS, 0, + "-rtscts", 0, LRTSCTS, + "crtbs", LCRTBS, LPRTERA, + "-crtbs", 0, LCRTBS, + "prterase", LPRTERA, LCRTBS+LCRTKIL+LCRTERA, + "-prterase", 0, LPRTERA, + "crterase", LCRTERA, LPRTERA, + "-crterase", 0, LCRTERA, + "crtkill", LCRTKIL, LPRTERA, + "-crtkill", 0, LCRTKIL, + "mdmbuf", LMDMBUF, 0, + "-mdmbuf", 0, LMDMBUF, + "litout", LLITOUT, 0, + "-litout", 0, LLITOUT, + "pass8", LPASS8, 0, + "-pass8", 0, LPASS8, + "tostop", LTOSTOP, 0, + "-tostop", 0, LTOSTOP, + "flusho", LFLUSHO, 0, + "-flusho", 0, LFLUSHO, + "nohang", LNOHANG, 0, + "-nohang", 0, LNOHANG, + "ctlecho", LCTLECH, 0, + "-ctlecho", 0, LCTLECH, + "pendin", LPENDIN, 0, + "-pendin", 0, LPENDIN, + "decctlq", LDECCTQ, 0, + "-decctlq", 0, LDECCTQ, + "noflsh", LNOFLSH, 0, + "-noflsh", 0, LNOFLSH, + 0 + }; + +struct MODES mmodes[] = { + "dcd", TIOCM_CD, 0, + "-dcd", 0, TIOCM_CD, + "dsr", TIOCM_DSR, 0, + "-dsr", 0, TIOCM_DSR, + "dtr", TIOCM_DTR, 0, + "-dtr", 0, TIOCM_DTR, + "cts", TIOCM_CTS, 0, + "-cts", 0, TIOCM_CTS, + "rts", TIOCM_RTS, 0, + "-rts", 0, TIOCM_RTS, + 0, +}; + +struct tchars tc; +struct ltchars ltc; +struct sgttyb mode; +struct winsize win; +int lmode; +int ldisc; +int mstate, nmstate; + +struct special { + char *name; + char *cp; + char def; +} special[] = { + "erase", &mode.sg_erase, CERASE, + "kill", &mode.sg_kill, CKILL, + "intr", &tc.t_intrc, CINTR, + "quit", &tc.t_quitc, CQUIT, + "start", &tc.t_startc, CSTART, + "stop", &tc.t_stopc, CSTOP, + "eof", &tc.t_eofc, CEOF, + "brk", &tc.t_brkc, CBRK, + "susp", <c.t_suspc, CSUSP, + "dsusp", <c.t_dsuspc, CDSUSP, + "rprnt", <c.t_rprntc, CRPRNT, + "flush", <c.t_flushc, CFLUSH, + "werase", <c.t_werasc, CWERASE, + "lnext", <c.t_lnextc, CLNEXT, + 0 +}; + +char *arg; + char *Nfmt = "%-8s"; + +main(argc, argv) + int argc; + register char **argv; +{ + int i, fmt = 0, ch, zero = 0; + register struct special *sp; + char obuf[BUFSIZ]; + char *arg2; + + setbuf(stderr, obuf); + + opterr = 0; + while (optind < argc && strspn(argv[optind], "-aef") == strlen(argv[optind]) && + (ch = getopt(argc, argv, "aef:")) != EOF) + { + switch (ch) + { + case 'e': + case 'a': + fmt = 2; + break; + case 'f': + i = open(optarg, O_RDONLY|O_NONBLOCK); + if (i < 0) + err(1, "%s", optarg); + if (dup2(i, 1) < 0) + err(1, "dup2(%d,1)", i); + break; + case '?': + default: + goto args; + } + } +args: + argc -= optind; + argv += optind; + + ioctl(1, TIOCGETP, &mode); + ioctl(1, TIOCGETD, &ldisc); + ioctl(1, TIOCGETC, &tc); + ioctl(1, TIOCLGET, &lmode); + ioctl(1, TIOCGLTC, <c); + ioctl(1, TIOCGWINSZ, &win); + if (ioctl(1, TIOCMGET, &mstate) < 0) + { + if (errno == ENOTTY) + mstate = -1; + else + warn("TIOCMGET"); + } + nmstate = mstate; + + if (argc == 0) { + prmodes(fmt); + exit(0); + } + arg = argv[1]; + if (argc == 1 && (!strcmp(arg, "everything") || !strcmp(arg, "all"))) { + prmodes(2); + exit(0); + } + + while (argc-- > 0) { + arg = *argv++; + if (eq("new")){ + ldisc = NTTYDISC; + if (ioctl(1, TIOCSETD, &ldisc)<0) + perror("ioctl"); + continue; + } + if (eq("newcrt")){ + ldisc = NTTYDISC; + lmode &= ~LPRTERA; + lmode |= LCRTBS|LCTLECH; + if (mode.sg_ospeed >= B1200) + lmode |= LCRTERA|LCRTKIL; + if (ioctl(1, TIOCSETD, &ldisc)<0) + perror("ioctl"); + continue; + } + if (eq("crt")){ + lmode &= ~LPRTERA; + lmode |= LCRTBS|LCTLECH; + if (mode.sg_ospeed >= B1200) + lmode |= LCRTERA|LCRTKIL; + continue; + } + if (eq("old")){ + ldisc = 0; + if (ioctl(1, TIOCSETD, &ldisc)<0) + perror("ioctl"); + continue; + } + if (eq("dec")){ + mode.sg_erase = 0177; + mode.sg_kill = CTRL(u); + tc.t_intrc = CTRL(c); + ldisc = NTTYDISC; + lmode &= ~LPRTERA; + lmode |= LCRTBS|LCTLECH|LDECCTQ; + if (mode.sg_ospeed >= B1200) + lmode |= LCRTERA|LCRTKIL; + if (ioctl(1, TIOCSETD, &ldisc)<0) + perror("ioctl"); + continue; + } + for (sp = special; sp->name; sp++) + if (eq(sp->name)) { + if (argc-- == 0) + goto done; + arg2 = *argv++; + if (strcmp(arg2, "undef") == 0) + *sp->cp = 0377; + else if (*arg2 == '^') + { + arg2++; + *sp->cp = (*arg2 == '?') ? + 0177 : *arg2 & 037; + } + else + *sp->cp = *arg2; + goto cont; + } + if (eq("flushout")) + { + ioctl(1, TIOCFLUSH, &zero); + continue; + } + if (eq("hup")) { + ioctl(1, TIOCHPCL, NULL); + continue; + } + if (eq("rows")) { + if (argc-- == 0) + goto done; + win.ws_row = atoi(*argv++); + } + if (eq("cols") || eq("columns")) { + if (argc-- == 0) + goto done; + win.ws_col = atoi(*argv++); + } + if (eq("size")) { + printf("%d %d\n", win.ws_row, win.ws_col); + exit(0); + } + for(i=0; speeds[i].string; i++) + if(eq(speeds[i].string)) { + mode.sg_ispeed = mode.sg_ospeed = speeds[i].speed; + goto cont; + } + if (eq("speed")) { + for(i=0; speeds[i].string; i++) + if (mode.sg_ospeed == speeds[i].speed) { + printf("%s\n", speeds[i].string); + exit(0); + } + printf("unknown\n"); + exit(1); + } + for (i = 0; modes[i].string; i++) + { + if (eq(modes[i].string)) + { + mode.sg_flags &= ~modes[i].reset; + mode.sg_flags |= modes[i].set; + goto cont; + } + } + for (i = 0; lmodes[i].string; i++) + { + if (eq(lmodes[i].string)) + { + lmode &= ~lmodes[i].reset; + lmode |= lmodes[i].set; + goto cont; + } + } + for (i = 0; mmodes[i].string; i++) + { + if (eq(mmodes[i].string)) + { + nmstate &= ~mmodes[i].reset; + nmstate |= mmodes[i].set; + goto cont; + } + } + if(arg) + fprintf(stderr,"unknown mode: %s\n", arg); +cont: + ; + } +done: + ioctl(1, TIOCSETN, &mode); + ioctl(1, TIOCSETC, &tc); + ioctl(1, TIOCSLTC, <c); + ioctl(1, TIOCLSET, &lmode); + ioctl(1, TIOCSWINSZ, &win); + if (mstate != -1 && nmstate != mstate) + { + if (ioctl(1, TIOCMSET, &nmstate) < 0) + warn("TIOCMSET"); + } +} + +eq(string) +char *string; +{ + + if (!arg) + return(0); + if (strcmp(arg, string)) + return(0); + arg = 0; + return(1); +} + +#define lpit(what,str) \ + if (all || (lmode&what)) { \ + fprintf(stderr,str+((lmode&what)!=0)); any++; \ + } + +prmodes(all) + int all; /* 0 for short display, !0 for long display */ +{ + register m; + int any, i; + register struct special *sp; + + if(ldisc==NETLDISC) + fprintf(stderr, "net discipline, "); + else if (ldisc==NTTYDISC) + fprintf(stderr, "new tty, "); + else if (ldisc == 0) + fprintf(stderr, "old tty, "); + else + fprintf(stderr, "discipline %d, "); + if(mode.sg_ispeed != mode.sg_ospeed) { + fprintf(stderr,"input speed %u baud", speed[mode.sg_ispeed]); + fprintf(stderr,"output speed %u baud", speed[mode.sg_ospeed]); + } else + fprintf(stderr,"speed %u baud", speed[mode.sg_ispeed]); + if (all) + fprintf(stderr, ", %d rows, %d columns", win.ws_row, win.ws_col); + fprintf(stderr, all ? "\n" : "; "); + m = mode.sg_flags; + if (all) { + if(m & EVENP) fprintf(stderr,"even "); + if(m & ODDP) fprintf(stderr,"odd "); + } + if (all || m&RAW) + fprintf(stderr,"-raw "+((m&RAW)!=0)); + if (all || (m&CRMOD)==0) + fprintf(stderr,"-nl "+((m&CRMOD)==0)); + if (all || (m&ECHO)==0) + fprintf(stderr,"-echo "+((m&ECHO)!=0)); + if (all || (m&TANDEM)) + fprintf(stderr,"-tandem "+((m&TANDEM)!=0)); + fprintf(stderr,"-tabs "+((m&XTABS)!=XTABS)); + if (all || (m&CBREAK)) + fprintf(stderr,"-cbreak "+((m&CBREAK)!=0)); + lpit(LRTSCTS, "-rtscts "); + if (all) + { + fputc('\n', stderr); + if (mstate != -1) + { + fprintf(stderr, "modem control: "); + fprintf(stderr,"-dcd "+((mstate & TIOCM_CD)!=0)); + fprintf(stderr,"-dsr "+((mstate & TIOCM_DSR)!=0)); + fprintf(stderr,"-dtr "+((mstate & TIOCM_DTR)!=0)); + fprintf(stderr,"-cts "+((mstate & TIOCM_CTS)!=0)); + fprintf(stderr,"-rts "+((mstate & TIOCM_RTS)!=0)); + fputc('\n', stderr); + } + } + if (ldisc == NTTYDISC) { + int newcrt = (lmode&(LCTLECH|LCRTBS)) == (LCTLECH|LCRTBS) && + (lmode&(LCRTERA|LCRTKIL)) == + ((mode.sg_ospeed > B300) ? LCRTERA|LCRTKIL : 0); + int nothing = 1; + if (newcrt) { + if (all) + fprintf(stderr, "crt: (crtbs crterase crtkill ctlecho) "); + else + fprintf(stderr, "crt "); + any++; + } else { + lpit(LCRTBS, "-crtbs "); + lpit(LCRTERA, "-crterase "); + lpit(LCRTKIL, "-crtkill "); + lpit(LCTLECH, "-ctlecho "); + lpit(LPRTERA, "-prterase "); + } + lpit(LTOSTOP, "-tostop "); + if (all) { + fputc('\n', stderr); + any = 0; + nothing = 0; + } + lpit(LFLUSHO, "-flusho "); + lpit(LMDMBUF, "-mdmbuf "); + lpit(LLITOUT, "-litout "); + lpit(LPASS8, "-pass8 "); + lpit(LNOHANG, "-nohang "); + if (any) { + fputc('\n', stderr); + any = 0; + nothing = 0; + } + lpit(LPENDIN, "-pendin "); + lpit(LDECCTQ, "-decctlq "); + lpit(LNOFLSH, "-noflsh "); + if (any || nothing) + fputc('\n', stderr); + } else if (!all) + fputc('\n', stderr); + + if (all) { + for (i = 0, sp = special; i < 9; i++, sp++) + fprintf(stderr, Nfmt, sp->name); + fputc('\n', stderr); + for (i = 0, sp = special; i < 9; i++, sp++) + pit(sp); + fputc('\n', stderr); + for (i = 9, sp = &special[9]; sp->name; i++, sp++) + fprintf(stderr, Nfmt, sp->name); + fputc('\n', stderr); + for (i = 9, sp = &special[9]; sp->name; i++, sp++) + pit(sp); + fputc('\n', stderr); + } +} + +pit(sp) + struct special *sp; + { + register int c = *sp->cp & 0xff; + char junk[6]; + register char *p = junk; + + if (c == 0xff) + { + fprintf(stderr, Nfmt, ""); + return; + } + if (c & 0200) + { + *p++ = 'M'; + *p++ = '-'; + c &= ~ 0200; + } + if (c == 0177) + { + *p++ = '^'; + *p++ = '?'; + } + else if (c < ' ') + { + *p++ = '^'; + *p++ = c += '@'; + } + *p++ = '\0'; + fprintf(stderr, Nfmt, junk); + } diff --git a/bin/su.c b/bin/su.c new file mode 100644 index 0000000..30e043c --- /dev/null +++ b/bin/su.c @@ -0,0 +1,183 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if !defined(lint) && defined(DOSCCS) +char copyright[] = +"@(#) Copyright (c) 1980 Regents of the University of California.\n\ + All rights reserved.\n"; + +static char sccsid[] = "@(#)su.c 5.4.1 (2.11BSD) 1997/10/2"; +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +char userbuf[64] = "USER="; +char homebuf[128] = "HOME="; +char shellbuf[128] = "SHELL="; +char pathbuf[128] = "PATH=:/usr/ucb:/bin:/usr/bin"; +char *cleanenv[] = { userbuf, homebuf, shellbuf, pathbuf, 0, 0 }; +char *user = "root"; +char *shell = "/bin/sh"; +int fulllogin; +int fastlogin; + +extern char **environ; +struct passwd *pwd; + +main(argc,argv) + int argc; + char *argv[]; +{ + char *password; + char buf[1000]; + FILE *fp; + register char *p; + + openlog("su", LOG_ODELAY, LOG_AUTH); + +again: + if (argc > 1 && strcmp(argv[1], "-f") == 0) { + fastlogin++; + argc--, argv++; + goto again; + } + if (argc > 1 && strcmp(argv[1], "-") == 0) { + fulllogin++; + argc--, argv++; + goto again; + } + if (argc > 1 && argv[1][0] != '-') { + user = argv[1]; + argc--, argv++; + } + if ((pwd = getpwuid(getuid())) == NULL) { + fprintf(stderr, "Who are you?\n"); + exit(1); + } + strcpy(buf, pwd->pw_name); + if ((pwd = getpwnam(user)) == NULL) { + fprintf(stderr, "Unknown login: %s\n", user); + exit(1); + } + /* + * Only allow those in group zero to su to root. + */ + if (pwd->pw_uid == 0) { + struct group *gr; + int i; + + if ((gr = getgrgid(0)) != NULL) { + for (i = 0; gr->gr_mem[i] != NULL; i++) + if (strcmp(buf, gr->gr_mem[i]) == 0) + goto userok; + fprintf(stderr, "You do not have permission to su %s\n", + user); + exit(1); + } + userok: + setpriority(PRIO_PROCESS, 0, -2); + } + +#define Getlogin() (((p = getlogin()) && *p) ? p : buf) + if (pwd->pw_passwd[0] == '\0' || getuid() == 0) + goto ok; + password = getpass("Password:"); + if (strcmp(pwd->pw_passwd, crypt(password, pwd->pw_passwd)) != 0) { + fprintf(stderr, "Sorry\n"); + if (pwd->pw_uid == 0) { + syslog(LOG_CRIT, "BAD SU %s on %s", + Getlogin(), ttyname(2)); + } + exit(2); + } +ok: + endpwent(); + if (pwd->pw_uid == 0) { + syslog(LOG_NOTICE, "%s on %s", Getlogin(), ttyname(2)); + closelog(); + } + if (setgid(pwd->pw_gid) < 0) { + perror("su: setgid"); + exit(3); + } + if (initgroups(user, pwd->pw_gid)) { + fprintf(stderr, "su: initgroups failed\n"); + exit(4); + } + if (setuid(pwd->pw_uid) < 0) { + perror("su: setuid"); + exit(5); + } + if (pwd->pw_shell && *pwd->pw_shell) + shell = pwd->pw_shell; + if (fulllogin) { + cleanenv[4] = getenv("TERM"); + environ = cleanenv; + } + if (strcmp(user, "root")) + setenv("USER", pwd->pw_name, userbuf); + setenv("SHELL", shell, shellbuf); + setenv("HOME", pwd->pw_dir, homebuf); + setpriority(PRIO_PROCESS, 0, 0); + if (fastlogin) { + *argv-- = "-f"; + *argv = "su"; + } else if (fulllogin) { + if (chdir(pwd->pw_dir) < 0) { + fprintf(stderr, "No directory\n"); + exit(6); + } + *argv = "-su"; + } else + *argv = "su"; + execv(shell, argv); + fprintf(stderr, "No shell\n"); + exit(7); +} + +setenv(ename, eval, buf) + char *ename, *eval, *buf; +{ + register char *cp, *dp; + register char **ep = environ; + + /* + * this assumes an environment variable "ename" already exists + */ + while (dp = *ep++) { + for (cp = ename; *cp == *dp && *cp; cp++, dp++) + continue; + if (*cp == 0 && (*dp == '=' || *dp == 0)) { + strcat(buf, eval); + *--ep = buf; + return; + } + } +} + +char * +getenv(ename) + char *ename; +{ + register char *cp, *dp; + register char **ep = environ; + + while (dp = *ep++) { + for (cp = ename; *cp == *dp && *cp; cp++, dp++) + continue; + if (*cp == 0 && (*dp == '=' || *dp == 0)) + return (*--ep); + } + return ((char *)0); +} diff --git a/bin/sync.c b/bin/sync.c new file mode 100644 index 0000000..a38100f --- /dev/null +++ b/bin/sync.c @@ -0,0 +1,6 @@ +static char *sccsid = "@(#)sync.c 4.1 (Berkeley) 10/1/80"; +main() +{ + + sync(); +} diff --git a/bin/sysctl/Makefile b/bin/sysctl/Makefile new file mode 100644 index 0000000..6bb20e2 --- /dev/null +++ b/bin/sysctl/Makefile @@ -0,0 +1,37 @@ +# +# Public Domain. 1/15/1995 - Steven Schultz +# +# @(#)Makefile 1.2 (2.11BSD GTE) 1996/1/12 +# +CFLAGS= -O +SEPFLAG= -i +SRCS= sysctl.c +OBJS= sysctl.o +MAN= sysctl.0 +MANSRC= sysctl.8 + +all: sysctl sysctl.0 + +sysctl: ${OBJS} + ${CC} ${CFLAGS} ${SEPFLAG} -o $@ ${OBJS} + +sysctl.0: ${MANSRC} + /usr/man/manroff ${MANSRC} > ${MAN} + +clean: + rm -f ${OBJS} ${MAN} sysctl tags + +depend: ${SRCS} + mkdep ${CFLAGS} ${SRCS} + +install: all + install -c -o bin -g bin -m 444 ${MAN} ${DESTDIR}/usr/man/cat8 + install -s -o root -g bin -m 755 sysctl ${DESTDIR}/bin/sysctl + +lint: ${SRCS} + lint -hax ${SRCS} + +tags: ${SRCS} + ctags ${SRCS} +# DO NOT DELETE THIS LINE -- mkdep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. diff --git a/bin/sysctl/sysctl.8 b/bin/sysctl/sysctl.8 new file mode 100644 index 0000000..a91f2da --- /dev/null +++ b/bin/sysctl/sysctl.8 @@ -0,0 +1,238 @@ +.\" Copyright (c) 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. 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. +.\" +.\" @(#)sysctl.8 8.1.5 (2.11BSD) 1999/4/29 +.\" +.TH SYSCTL 8 "April 24, 1999" +.UC 4 +.SH NAME +sysctl \- get or set kernel state +.SH SYNOPSIS +.B sysctl +[ +.B \-n +] +.I name ... +.br +.B sysctl +[ +.B \-n +] +.B \-w +.I name=value ... +.br +.B sysctl +[ +.B \-n +] +.B \-aA +.SH DESCRIPTION +The +.B sysctl +utility retrieves kernel state and allows processes with +appropriate privilege to set kernel state. +The state to be retrieved or set is described using a +``Management Information Base'' (``MIB'') style name, +described as a dotted set of components. +The +.B \-a +flag can be used to list all the currently available string or integer values. +The +.B \-A +flag will list all the known MIB names including tables. +Those with string or integer values will be printed as with the +.B \-a +flag; for the table values, +the name of the utility to retrieve them is given. +.PP +The +.B \-n +flag specifies that the printing of the field name should be +suppressed and that only its value should be output. +This flag is useful for setting shell variables. +For example, to save the pagesize in variable psize, use: +.sp +.in +1.0 +set psize=`sysctl -n hw.pagesize` +.in -1.0 +.PP +If just a MIB style name is given, +the corresponding value is retrieved. +If a value is to be set, the +.B \-w +flag must be specified and the MIB name followed +by an equal sign and the new value to be used. +.PP +The information available from +.B sysctl +consists of integers, strings, and tables. +The tabular information can only be retrieved by special +purpose programs such as +\fBps\fP, +\fBsystat\fP, +and +\fBnetstat\fP. +The string and integer information is summaried below. +For a detailed description of these variable see +\fBsysctl(3)\fP. +The changeable column indicates whether a process with appropriate +privilege can change the value. +.sp +.ta 0.5i 3.0i 4.0i +.nf + Name Type Changeable + kern.acctthresh int yes + kern.ostype string no + kern.osrelease string no + kern.osrevision long no + kern.version string no + kern.maxinodes integer no + kern.maxproc integer no + kern.maxfiles integer no + kern.maxtext integer no + kern.argmax integer no + kern.securelevel integer raise only + kern.hostname string yes + kern.hostid long yes + kern.clockrate struct no + kern.posix1version integer no + kern.ngroups integer no + kern.job_control integer no + kern.saved_ids integer no +.\" kern.link_max integer no +.\" kern.max_canon integer no +.\" kern.max_input integer no +.\" kern.name_max integer no +.\" kern.path_max integer no +.\" kern.pipe_buf integer no +.\" kern.chown_restricted integer no +.\" kern.no_trunc integer no +.\" kern.vdisable integer no + kern.boottime struct no + vm.loadavg struct no + machdep.console_device dev_t no + machdep.mscp.printf integer yes + machdep.tmscp.cache integer yes + machdep.tmscp.printf integer yes + net.inet.ip.forwarding integer yes + net.inet.ip.redirect integer yes + net.inet.ip.ttl integer yes + net.inet.icmp.maskrepl integer yes + net.inet.udp.checksum integer yes + hw.machine string no + hw.model string no + hw.ncpu integer no + hw.byteorder integer no + hw.physmem long no + hw.usermem long no + hw.pagesize integer no + user.cs_path string no + user.bc_base_max integer no + user.bc_dim_max integer no + user.bc_scale_max integer no + user.bc_string_max integer no + user.coll_weights_max integer no + user.expr_nest_max integer no + user.line_max integer no + user.re_dup_max integer no + user.posix2_version integer no + user.posix2_c_bind integer no + user.posix2_c_dev integer no + user.posix2_char_term integer no + user.posix2_fort_dev integer no + user.posix2_fort_run integer no + user.posix2_localedef integer no + user.posix2_sw_dev integer no + user.posix2_upe integer no +.fi +.SH EXAMPLES +.PP +For example, to retrieve the maximum number of processes allowed +in the system, one would use the follow request: +.sp +.in +1.0i +sysctl kern.maxproc +.br +.in -1.0i +.PP +To set the hostname of the system +to foo.bar.com, one would use the follow request: +.sp +.in +1.0i +sysctl -w kern.hostname=foo.bar.com +.in -1.0i +.br +.PP +Information about the system clock rate may be obtained with: +.sp +.in +1.0i +sysctl kern.clockrate +.br +.in -1.0i +.PP +Information about the load average history may be obtained with +.sp +.in +1.0i +sysctl vm.loadavg +.br +.in -1.0i +.SH FILES +.TP 15 + +definitions for top level identifiers, second level kernel and hardware +identifiers, and user level identifiers +.TP 15 + +definitions for second level network identifiers +.TP 15 + +definitions for third level profiling identifiers +.TP 15 + +definitions for second and third level machine dependent identifiers +.TP 15 + +definitions for second level virtual memory identifiers +.TP 15 + +definitions for third level Internet identifiers and +fourth level IP identifiers +.TP 15 + +definitions for fourth level ICMP identifiers +.TP 15 + +definitions for fourth level UDP identifiers +.SH SEE ALSO +sysctl(3) +.SH HISTORY +.B sysctl +first appeared in 4.4BSD. diff --git a/bin/sysctl/sysctl.c b/bin/sysctl/sysctl.c new file mode 100644 index 0000000..83252ff --- /dev/null +++ b/bin/sysctl/sysctl.c @@ -0,0 +1,621 @@ +/* + * Copyright (c) 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. 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. + */ + +#if !defined(lint) && defined(DOSCCS) +static char copyright[] = +"@(#) Copyright (c) 1993\n\ + The Regents of the University of California. All rights reserved.\n"; + +static char sccsid[] = "@(#)sysctl.c 8.1.4 (2.11BSD GTE) 1998/4/3"; +#endif /* not lint */ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +struct ctlname topname[] = CTL_NAMES; +struct ctlname kernname[] = CTL_KERN_NAMES; +struct ctlname vmname[] = CTL_VM_NAMES; +#ifdef CTL_NET_NAMES +struct ctlname netname[] = CTL_NET_NAMES; +#endif +struct ctlname hwname[] = CTL_HW_NAMES; +struct ctlname username[] = CTL_USER_NAMES; +struct ctlname debugname[CTL_DEBUG_MAXID]; +struct ctlname machdepname[] = CTL_MACHDEP_NAMES; +char names[BUFSIZ]; + +struct list { + struct ctlname *list; + int size; +}; +struct list toplist = { topname, CTL_MAXID }; +struct list secondlevel[] = { + { 0, 0 }, /* CTL_UNSPEC */ + { kernname, KERN_MAXID }, /* CTL_KERN */ + { vmname, VM_MAXID }, /* CTL_VM */ + { 0, 0 }, /* CTL_FS */ +#ifdef CTL_NET_NAMES + { netname, NET_MAXID }, /* CTL_NET */ +#else + { 0, 0 }, +#endif + { 0, CTL_DEBUG_MAXID }, /* CTL_DEBUG */ + { hwname, HW_MAXID }, /* CTL_HW */ + { machdepname, CPU_MAXID }, /* CTL_MACHDEP */ + { username, USER_MAXID }, /* CTL_USER_NAMES */ +}; + +int Aflag, aflag, nflag, wflag; + +extern char *optarg; +extern int optind, errno; + +/* + * Variables requiring special processing. + */ +#define CLOCK 0x0001 +#define BOOTTIME 0x0002 +#define CONSDEV 0x0004 + +int +main(argc, argv) + int argc; + char *argv[]; +{ + int ch, lvl1; + + while ((ch = getopt(argc, argv, "Aanw")) != EOF) { + switch (ch) { + + case 'A': + Aflag = 1; + break; + + case 'a': + aflag = 1; + break; + + case 'n': + nflag = 1; + break; + + case 'w': + wflag = 1; + break; + + default: + usage(); + } + } + argc -= optind; + argv += optind; + + if (Aflag || aflag) { + debuginit(); + for (lvl1 = 1; lvl1 < CTL_MAXID; lvl1++) + listall(topname[lvl1].ctl_name, &secondlevel[lvl1]); + exit(0); + } + if (argc == 0) + usage(); + while (argc-- > 0) + parse(*argv, 1); + exit(0); +} + +/* + * List all variables known to the system. + */ +listall(prefix, lp) + char *prefix; + struct list *lp; +{ + int lvl2; + char *cp, name[BUFSIZ]; + + if (lp->list == 0) + return; + strcpy(name, prefix); + cp = &name[strlen(name)]; + *cp++ = '.'; + for (lvl2 = 0; lvl2 < lp->size; lvl2++) { + if (lp->list[lvl2].ctl_name == 0) + continue; + strcpy(cp, lp->list[lvl2].ctl_name); + parse(name, Aflag); + } +} + +/* + * Parse a name into a MIB entry. + * Lookup and print out the MIB entry if it exists. + * Set a new value if requested. + */ +parse(string, flags) + char *string; + int flags; +{ + int indx, type, state, size, len; + int special = 0; + void *newval = (void *)0; + int intval, newsize = 0; + long longval; + struct list *lp; + int mib[CTL_MAXNAME]; + char *cp, *bufp, buf[BUFSIZ], strval[BUFSIZ]; + + bufp = buf; + strcpy(buf, string); + if ((cp = strchr(string, '=')) != NULL) { + if (!wflag) { + fprintf(stderr, "Must specify -w to set variables\n"); + exit(2); + } + *strchr(buf, '=') = '\0'; + *cp++ = '\0'; + while (isspace(*cp)) + cp++; + newval = (void *)cp; + newsize = strlen(cp); + } + if ((indx = findname(string, "top", &bufp, &toplist)) == -1) + return; + mib[0] = indx; + if (indx == CTL_DEBUG) + debuginit(); + lp = &secondlevel[indx]; + if (lp->list == 0) { + fprintf(stderr, "%s: class is not implemented\n", + topname[indx]); + return; + } + if (bufp == NULL) { + listall(topname[indx].ctl_name, lp); + return; + } + if ((indx = findname(string, "second", &bufp, lp)) == -1) + return; + mib[1] = indx; + type = lp->list[indx].ctl_type; + len = 2; + switch (mib[0]) { + + case CTL_KERN: + switch (mib[1]) { + case KERN_PROF: + fprintf(stderr, + "kern.prof = not supported in 2.11BSD\n"); + return; + case KERN_INODE: + case KERN_FILE: + case KERN_TEXT: + if (flags == 0) + return; + fprintf(stderr, + "Use pstat to view %s information\n", string); + return; + case KERN_PROC: + if (flags == 0) + return; + fprintf(stderr, + "Use ps to view %s information\n", string); + return; + case KERN_CLOCKRATE: + special |= CLOCK; + break; + case KERN_BOOTTIME: + special |= BOOTTIME; + break; + } + break; + + case CTL_HW: + break; + + case CTL_VM: + if (mib[1] == VM_LOADAVG) { + double loads[3]; + + getloadavg(loads, 3); + if (!nflag) + fprintf(stdout, "%s: ", string); + fprintf(stdout, "%.2f %.2f %.2f\n", + loads[0], loads[1], loads[2]); + return; + } + if (flags == 0) + return; + fprintf(stderr, + "Use vmstat or pstat to view %s information\n", string); + return; + + case CTL_NET: + if (mib[1] == PF_INET) { + len = sysctl_inet(string, &bufp, mib, flags, &type); + if (len >= 0) + break; + return; + } + if (flags == 0) + return; + fprintf(stderr, "Use netstat to view %s information\n", string); + return; + + case CTL_DEBUG: + mib[2] = CTL_DEBUG_VALUE; + len = 3; + break; + + case CTL_MACHDEP: + if (mib[1] == CPU_CONSDEV) + special |= CONSDEV; + if (mib[1] == CPU_TMSCP) { + len = sysctl_tmscp(string, &bufp, mib, flags, &type); + if (len >= 0) + goto doit; + return; + } + if (mib[1] == CPU_MSCP) { + len = sysctl_mscp(string, &bufp, mib, flags, &type); + if (len >= 0) + goto doit; + return; + } + break; + + case CTL_FS: + case CTL_USER: + break; + + default: + fprintf(stderr, "Illegal top level value: %d\n", mib[0]); + return; + + } +doit: + if (bufp) { + fprintf(stderr, "name %s in %s is unknown\n", *bufp, string); + return; + } + if (newsize > 0) { + switch (type) { + case CTLTYPE_INT: + intval = atoi(newval); + newval = (void *)&intval; + newsize = sizeof intval; + break; + + case CTLTYPE_LONG: + sscanf(newval, "%ld", &longval); + newval = (void *)&longval; + newsize = sizeof longval; + break; + } + } + size = BUFSIZ; + if (sysctl(mib, len, buf, &size, newsize ? newval : (void *)0, newsize) == -1) { + if (flags == 0) + return; + switch (errno) { + case EOPNOTSUPP: + fprintf(stderr, "%s: value is not available\n", string); + return; + case ENOTDIR: + fprintf(stderr, "%s: specification is incomplete\n", + string); + return; + case ENOMEM: + fprintf(stderr, "%s: type is unknown to this program\n", + string); + return; + default: + perror(string); + return; + } + } + if (special & CLOCK) { + struct clockinfo *clkp = (struct clockinfo *)buf; + + if (!nflag) + fprintf(stdout, "%s: ", string); + fprintf(stdout, + "hz = %d, tick = %d, profhz = %d, stathz = %d\n", + clkp->hz, clkp->tick, clkp->profhz, clkp->stathz); + return; + } + if (special & BOOTTIME) { + struct timeval *btp = (struct timeval *)buf; + + if (!nflag) + fprintf(stdout, "%s = %s", string, + ctime(&btp->tv_sec)); + else + fprintf(stdout, "%d\n", btp->tv_sec); + return; + } + if (special & CONSDEV) { + dev_t dev = *(dev_t *)buf; + + if (!nflag) + fprintf(stdout, "%s = %s\n", string, + devname(dev, S_IFCHR)); + else + fprintf(stdout, "0x%x\n", dev); + return; + } + switch (type) { + case CTLTYPE_INT: + if (newsize == 0) { + if (!nflag) + fprintf(stdout, "%s = ", string); + fprintf(stdout, "%d\n", *(int *)buf); + } else { + if (!nflag) + fprintf(stdout, "%s: %d -> ", string, + *(int *)buf); + fprintf(stdout, "%d\n", *(int *)newval); + } + return; + + case CTLTYPE_STRING: + if (newsize == 0) { + if (!nflag) + fprintf(stdout, "%s = ", string); + fprintf(stdout, "%s\n", buf); + } else { + if (!nflag) + fprintf(stdout, "%s: %s -> ", string, buf); + fprintf(stdout, "%s\n", newval); + } + return; + + case CTLTYPE_LONG: + if (newsize == 0) { + if (!nflag) + fprintf(stdout, "%s = ", string); + fprintf(stdout, "%ld\n", *(long *)buf); + } else { + if (!nflag) + fprintf(stdout, "%s: %ld -> ", string, + *(long *)buf); + fprintf(stdout, "%ld\n", *(long *)newval); + } + return; + + case CTLTYPE_STRUCT: + fprintf(stderr, "%s: unknown structure returned\n", + string); + return; + + default: + case CTLTYPE_NODE: + fprintf(stderr, "%s: unknown type returned\n", + string); + return; + } +} + +struct ctlname tmscpname[] = TMSCP_NAMES; +struct list tmscplist = { tmscpname, TMSCP_MAXID }; + +struct ctlname mscpname[] = MSCP_NAMES; +struct list mscplist = { mscpname, MSCP_MAXID }; + +/* + * Handle machdep.tmscp.x +*/ +sysctl_tmscp(string, bufpp, mib, flags, typep) + char *string; + char **bufpp; + int mib[]; + int flags; + int *typep; +{ + int indx; + + if (*bufpp == NULL) { + listall(string, &tmscplist); + return (-1); + } + if ((indx = findname(string, "third", bufpp, &tmscplist)) == -1) + return (-1); + mib[2] = indx; + *typep = tmscpname[indx].ctl_type; + return (3); +} + +/* + * Handle machdep.mscp.x +*/ +sysctl_mscp(string, bufpp, mib, flags, typep) + char *string; + char **bufpp; + int mib[]; + int flags; + int *typep; +{ + int indx; + + if (*bufpp == NULL) { + listall(string, &mscplist); + return (-1); + } + if ((indx = findname(string, "third", bufpp, &mscplist)) == -1) + return (-1); + mib[2] = indx; + *typep = mscpname[indx].ctl_type; + return (3); +} + +/* + * Initialize the set of debugging names + */ +debuginit() +{ + int mib[3], size, loc, i; + + if (secondlevel[CTL_DEBUG].list != 0) + return; + secondlevel[CTL_DEBUG].list = debugname; + mib[0] = CTL_DEBUG; + mib[2] = CTL_DEBUG_NAME; + for (loc = 0, i = 0; i < CTL_DEBUG_MAXID; i++) { + mib[1] = i; + size = BUFSIZ - loc; + if (sysctl(mib, 3, &names[loc], &size, NULL, 0) == -1) + continue; + debugname[i].ctl_name = &names[loc]; + debugname[i].ctl_type = CTLTYPE_INT; + loc += size; + } +} + +struct ctlname inetname[] = CTL_IPPROTO_NAMES; +struct ctlname ipname[] = IPCTL_NAMES; +struct ctlname icmpname[] = ICMPCTL_NAMES; +struct ctlname udpname[] = UDPCTL_NAMES; +struct list inetlist = { inetname, IPPROTO_MAXID }; +struct list inetvars[] = { + { ipname, IPCTL_MAXID }, /* ip */ + { icmpname, ICMPCTL_MAXID }, /* icmp */ + { 0, 0 }, /* igmp */ + { 0, 0 }, /* ggmp */ + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, /* tcp */ + { 0, 0 }, + { 0, 0 }, /* egp */ + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, /* pup */ + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { udpname, UDPCTL_MAXID }, /* udp */ +}; + +/* + * handle internet requests + */ +sysctl_inet(string, bufpp, mib, flags, typep) + char *string; + char **bufpp; + int mib[]; + int flags; + int *typep; +{ + struct list *lp; + int indx; + + if (*bufpp == NULL) { + listall(string, &inetlist); + return (-1); + } + if ((indx = findname(string, "third", bufpp, &inetlist)) == -1) + return (-1); + mib[2] = indx; + if (indx <= IPPROTO_UDP && inetvars[indx].list != NULL) + lp = &inetvars[indx]; + else if (!flags) + return (-1); + else { + fprintf(stderr, "%s: no variables defined for this protocol\n", + string); + return (-1); + } + if (*bufpp == NULL) { + listall(string, lp); + return (-1); + } + if ((indx = findname(string, "fourth", bufpp, lp)) == -1) + return (-1); + mib[3] = indx; + *typep = lp->list[indx].ctl_type; + return (4); +} + +/* + * Scan a list of names searching for a particular name. + */ +findname(string, level, bufp, namelist) + char *string; + char *level; + char **bufp; + struct list *namelist; +{ + char *name; + int i; + + if (namelist->list == 0 || (name = strsep(bufp, ".")) == NULL) { + fprintf(stderr, "%s: incomplete specification\n", string); + return (-1); + } + for (i = 0; i < namelist->size; i++) + if (namelist->list[i].ctl_name != NULL && + strcmp(name, namelist->list[i].ctl_name) == 0) + break; + if (i == namelist->size) { + fprintf(stderr, "%s level name %s in %s is invalid\n", + level, name, string); + return (-1); + } + return (i); +} + +usage() +{ + + (void)fprintf(stderr, "usage:\t%s\n\t%s\n\t%s\n\t%s\n", + "sysctl [-n] variable ...", "sysctl [-n] -w variable=value ...", + "sysctl [-n] -a", "sysctl [-n] -A"); + exit(1); +} diff --git a/bin/tar.c b/bin/tar.c new file mode 100644 index 0000000..7ddbfbf --- /dev/null +++ b/bin/tar.c @@ -0,0 +1,1424 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#ifndef lint +char copyright[] = +"@(#) Copyright (c) 1980 Regents of the University of California.\n\ + All rights reserved.\n"; +#endif not lint + +#ifndef lint +static char sccsid[] = "@(#)tar.c 5.7 (Berkeley) 4/26/86"; +#endif not lint + +/* + * Tape Archival Program + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define TBLOCK 512 +#define NBLOCK 20 +#define NAMSIZ 100 + +#define writetape(b) writetbuf(b, 1) +#define min(a,b) ((a) < (b) ? (a) : (b)) +#define max(a,b) ((a) > (b) ? (a) : (b)) + +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; +}; + +struct linkbuf { + ino_t inum; + dev_t devnum; + int count; + char pathname[NAMSIZ]; + struct linkbuf *nextp; +}; + +union hblock dblock; +union hblock *tbuf; +struct linkbuf *ihead; +struct stat stbuf; + +int rflag; +int xflag; +int vflag; +int tflag; +int cflag; +int mflag; +int fflag; +int iflag; +int oflag; +int pflag; +int wflag; +int hflag; +int Bflag; +int Fflag; + +int mt; +int term; +int chksum; +int recno; +int first; +int prtlinkerr; +int freemem = 1; +int nblock = 0; +int onintr(); +int onquit(); +int onhup(); +#ifdef notdef +int onterm(); +#endif + +daddr_t low; +daddr_t high; +daddr_t bsrch(); + +FILE *vfile = stdout; +FILE *tfile; +char tname[] = "/tmp/tarXXXXXX"; +char *usefile; +char magtape[] = "/dev/rmt8"; +char *malloc(); +long time(); +off_t lseek(); +char *mktemp(); +char *sprintf(); +char *strcat(); +char *strcpy(); +char *rindex(); +char *getcwd(); +char *getwd(); +char *getmem(); + +main(argc, argv) +int argc; +char *argv[]; +{ + char *cp; + + if (argc < 2) + usage(); + + tfile = NULL; + usefile = magtape; + argv[argc] = 0; + argv++; + for (cp = *argv++; *cp; cp++) + switch(*cp) { + + case 'f': + if (*argv == 0) { + fprintf(stderr, + "tar: tapefile must be specified with 'f' option\n"); + usage(); + } + usefile = *argv++; + fflag++; + break; + + case 'c': + cflag++; + rflag++; + break; + + case 'o': + oflag++; + break; + + case 'p': + pflag++; + 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 THRU*/ + + case 'r': + rflag++; + 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': + case '4': + case '5': + case '7': + case '8': + magtape[8] = *cp; + usefile = magtape; + break; + + case 'b': + if (*argv == 0) { + fprintf(stderr, + "tar: blocksize must be specified with 'b' option\n"); + usage(); + } + nblock = atoi(*argv); + if (nblock <= 0) { + fprintf(stderr, + "tar: invalid blocksize \"%s\"\n", *argv); + done(1); + } + argv++; + break; + + case 'l': + prtlinkerr++; + break; + + case 'h': + hflag++; + break; + + case 'i': + iflag++; + break; + + case 'B': + Bflag++; + break; + + case 'F': + Fflag++; + break; + + default: + fprintf(stderr, "tar: %c: unknown option\n", *cp); + usage(); + } + + if (!rflag && !xflag && !tflag) + usage(); + if (rflag) { + if (cflag && tfile != NULL) + usage(); + if (signal(SIGINT, SIG_IGN) != SIG_IGN) + (void) signal(SIGINT, onintr); + if (signal(SIGHUP, SIG_IGN) != SIG_IGN) + (void) signal(SIGHUP, onhup); + if (signal(SIGQUIT, SIG_IGN) != SIG_IGN) + (void) signal(SIGQUIT, onquit); +#ifdef notdef + if (signal(SIGTERM, SIG_IGN) != SIG_IGN) + (void) signal(SIGTERM, onterm); +#endif + mt = openmt(usefile, 1); + dorep(argv); + done(0); + } + mt = openmt(usefile, 0); + if (xflag) + doxtract(argv); + else + dotable(argv); + done(0); +} + +usage() +{ + fprintf(stderr, +"tar: usage: tar -{txru}[cvfblmhopwBi] [tapefile] [blocksize] file1 file2...\n"); + done(1); +} + +int +openmt(tape, writing) + char *tape; + int writing; +{ + + if (strcmp(tape, "-") == 0) { + /* + * Read from standard input or write to standard output. + */ + if (writing) { + if (cflag == 0) { + fprintf(stderr, + "tar: can only create standard output archives\n"); + done(1); + } + vfile = stderr; + setlinebuf(vfile); + mt = dup(1); + } else { + mt = dup(0); + Bflag++; + } + } else { + /* + * Use file or tape on local machine. + */ + if (writing) { + if (cflag) + mt = open(tape, O_RDWR|O_CREAT|O_TRUNC, 0666); + else + mt = open(tape, O_RDWR); + } else + mt = open(tape, O_RDONLY); + if (mt < 0) { + fprintf(stderr, "tar: "); + perror(tape); + done(1); + } + } + return(mt); +} + +dorep(argv) + char *argv[]; +{ + register char *cp, *cp2; + char wdir[MAXPATHLEN], tempdir[MAXPATHLEN], *parent; + + if (!cflag) { + getdir(); + do { + passtape(); + if (term) + done(0); + getdir(); + } while (!endtape()); + backtape(); + if (tfile != NULL) { + char buf[200]; + + 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; + } + } + + (void) getcwd(wdir); + while (*argv && ! term) { + cp2 = *argv; + if (!strcmp(cp2, "-C") && argv[1]) { + argv++; + if (chdir(*argv) < 0) { + fprintf(stderr, "tar: can't change directories to "); + perror(*argv); + } else + (void) getcwd(wdir); + argv++; + continue; + } + + if (*argv[0] == '/'){ + parent = ""; + } else { + parent = wdir; + } + + for (cp = *argv; *cp; cp++) + if (*cp == '/') + cp2 = cp; + if (cp2 != *argv) { + *cp2 = '\0'; + if (chdir(*argv) < 0) { + fprintf(stderr, "tar: can't change directories to "); + perror(*argv); + continue; + } + parent = getcwd(tempdir); + *cp2 = '/'; + cp2++; + } + putfile(*argv++, cp2, parent); + if (chdir(wdir) < 0) { + fprintf(stderr, "tar: cannot change back?: "); + perror(wdir); + } + } + putempty(); + putempty(); + flushtape(); + if (prtlinkerr == 0) + return; + for (; ihead != NULL; ihead = ihead->nextp) { + if (ihead->count == 0) + continue; + fprintf(stderr, "tar: missing links to %s\n", ihead->pathname); + } +} + +endtape() +{ + return (dblock.dbuf.name[0] == '\0'); +} + +getdir() +{ + register struct stat *sp; + int i; + +top: + 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 != (i = checksum())) { + fprintf(stderr, "tar: directory checksum error (%d != %d)\n", + chksum, i); + if (iflag) + goto top; + done(2); + } + if (tfile != NULL) + fprintf(tfile, "%s %s\n", dblock.dbuf.name, dblock.dbuf.mtime); +} + +passtape() +{ + long blocks; + char *bufp; + + if (dblock.dbuf.linkflag == '1') + return; + blocks = stbuf.st_size; + blocks += TBLOCK-1; + blocks /= TBLOCK; + + while (blocks-- > 0) + (void) readtbuf(&bufp, TBLOCK); +} + +putfile(longname, shortname, parent) + char *longname; + char *shortname; + char *parent; +{ + int infile = 0; + long blocks; + char buf[TBLOCK]; + char *bigbuf; + register char *cp; + struct direct *dp; + DIR *dirp; + register int i; + long l; + char newparent[NAMSIZ+64]; + extern int errno; + int maxread; + int hint; /* amount to write to get "in sync" */ + + if (!hflag) + i = lstat(shortname, &stbuf); + else + i = stat(shortname, &stbuf); + if (i < 0) { + fprintf(stderr, "tar: "); + perror(longname); + return; + } + if (tfile != NULL && checkupdate(longname) == 0) + return; + if (checkw('r', longname) == 0) + return; + if (Fflag && checkf(shortname, stbuf.st_mode, Fflag) == 0) + return; + + switch (stbuf.st_mode & S_IFMT) { + case S_IFDIR: + for (i = 0, cp = buf; *cp++ = longname[i++];) + ; + *--cp = '/'; + *++cp = 0 ; + if (!oflag) { + if ((cp - buf) >= NAMSIZ) { + fprintf(stderr, "tar: %s: file name too long\n", + longname); + return; + } + stbuf.st_size = 0; + tomodes(&stbuf); + strcpy(dblock.dbuf.name,buf); + sprintf(dblock.dbuf.chksum, "%6o", checksum()); + (void) writetape((char *)&dblock); + } + sprintf(newparent, "%s/%s", parent, shortname); + if (chdir(shortname) < 0) { + perror(shortname); + return; + } + if ((dirp = opendir(".")) == NULL) { + fprintf(stderr, "tar: %s: directory read error\n", + longname); + if (chdir(parent) < 0) { + fprintf(stderr, "tar: cannot change back?: "); + perror(parent); + } + return; + } + while ((dp = readdir(dirp)) != NULL && !term) { + if (dp->d_ino == 0) + continue; + if (!strcmp(".", dp->d_name) || + !strcmp("..", dp->d_name)) + continue; + strcpy(cp, dp->d_name); + l = telldir(dirp); + closedir(dirp); + putfile(buf, cp, newparent); + dirp = opendir("."); + seekdir(dirp, l); + } + closedir(dirp); + if (chdir(parent) < 0) { + fprintf(stderr, "tar: cannot change back?: "); + perror(parent); + } + break; + + case S_IFLNK: + tomodes(&stbuf); + if (strlen(longname) >= NAMSIZ) { + fprintf(stderr, "tar: %s: file name too long\n", + longname); + return; + } + strcpy(dblock.dbuf.name, longname); + if (stbuf.st_size + 1 >= NAMSIZ) { + fprintf(stderr, "tar: %s: symbolic link too long\n", + longname); + return; + } + i = readlink(shortname, dblock.dbuf.linkname, NAMSIZ - 1); + if (i < 0) { + fprintf(stderr, "tar: can't read symbolic link "); + perror(longname); + return; + } + dblock.dbuf.linkname[i] = '\0'; + dblock.dbuf.linkflag = '2'; + if (vflag) + fprintf(vfile, "a %s symbolic link to %s\n", + longname, dblock.dbuf.linkname); + sprintf(dblock.dbuf.size, "%11lo", 0L); + sprintf(dblock.dbuf.chksum, "%6o", checksum()); + (void) writetape((char *)&dblock); + break; + + case S_IFREG: + if ((infile = open(shortname, 0)) < 0) { + fprintf(stderr, "tar: "); + perror(longname); + return; + } + tomodes(&stbuf); + if (strlen(longname) >= NAMSIZ) { + fprintf(stderr, "tar: %s: file name too long\n", + longname); + close(infile); + return; + } + strcpy(dblock.dbuf.name, longname); + 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()); + (void) writetape( (char *) &dblock); + if (vflag) + fprintf(vfile, "a %s link to %s\n", + longname, lp->pathname); + lp->count--; + close(infile); + return; + } + lp = (struct linkbuf *) getmem(sizeof(*lp)); + if (lp != NULL) { + 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(vfile, "a %s %ld blocks\n", longname, blocks); + sprintf(dblock.dbuf.chksum, "%6o", checksum()); + hint = writetape((char *)&dblock); + maxread = max(stbuf.st_blksize, (nblock * TBLOCK)); + if ((bigbuf = malloc((unsigned)maxread)) == 0) { + maxread = TBLOCK; + bigbuf = buf; + } + + while ((i = read(infile, bigbuf, min((hint*TBLOCK), maxread))) > 0 + && blocks > 0) { + register int nblks; + + nblks = ((i-1)/TBLOCK)+1; + if (nblks > blocks) + nblks = blocks; + hint = writetbuf(bigbuf, nblks); + blocks -= nblks; + } + close(infile); + if (bigbuf != buf) + free(bigbuf); + if (i < 0) { + fprintf(stderr, "tar: Read error on "); + perror(longname); + } else if (blocks != 0 || i != 0) + fprintf(stderr, "tar: %s: file changed size\n", + longname); + while (--blocks >= 0) + putempty(); + break; + + default: + fprintf(stderr, "tar: %s is not a file. Not dumped\n", + longname); + break; + } +} + +doxtract(argv) + char *argv[]; +{ + long blocks, bytes; + int ofile, i; + extern int errno; + + for (;;) { + if ((i = wantit(argv)) == 0) + continue; + if (i == -1) + break; /* end of tape */ + if (checkw('x', dblock.dbuf.name) == 0) { + passtape(); + continue; + } + if (Fflag) { + char *s; + + if ((s = rindex(dblock.dbuf.name, '/')) == 0) + s = dblock.dbuf.name; + else + s++; + if (checkf(s, stbuf.st_mode, Fflag) == 0) { + passtape(); + continue; + } + } + if (checkdir(dblock.dbuf.name)) { /* have a directory */ + if (mflag == 0) + dodirtimes(&dblock); + continue; + } + if (dblock.dbuf.linkflag == '2') { /* symlink */ + /* + * only unlink non directories or empty + * directories + */ + if (rmdir(dblock.dbuf.name) < 0) { + if (errno == ENOTDIR) + unlink(dblock.dbuf.name); + } + if (symlink(dblock.dbuf.linkname, dblock.dbuf.name)<0) { + fprintf(stderr, "tar: %s: symbolic link failed: ", + dblock.dbuf.name); + perror(""); + continue; + } + if (vflag) + fprintf(vfile, "x %s symbolic link to %s\n", + dblock.dbuf.name, dblock.dbuf.linkname); +#ifdef notdef + /* ignore alien orders */ + chown(dblock.dbuf.name, stbuf.st_uid, stbuf.st_gid); + if (mflag == 0) + setimes(dblock.dbuf.name, stbuf.st_mtime); + if (pflag) + chmod(dblock.dbuf.name, stbuf.st_mode & 07777); +#endif + continue; + } + if (dblock.dbuf.linkflag == '1') { /* regular link */ + /* + * only unlink non directories or empty + * directories + */ + if (rmdir(dblock.dbuf.name) < 0) { + if (errno == ENOTDIR) + unlink(dblock.dbuf.name); + } + if (link(dblock.dbuf.linkname, dblock.dbuf.name) < 0) { + fprintf(stderr, "tar: can't link %s to %s: ", + dblock.dbuf.name, dblock.dbuf.linkname); + perror(""); + continue; + } + if (vflag) + fprintf(vfile, "%s linked to %s\n", + dblock.dbuf.name, dblock.dbuf.linkname); + continue; + } + if ((ofile = creat(dblock.dbuf.name,stbuf.st_mode&0xfff)) < 0) { + fprintf(stderr, "tar: can't create %s: ", + dblock.dbuf.name); + perror(""); + passtape(); + continue; + } + chown(dblock.dbuf.name, stbuf.st_uid, stbuf.st_gid); + blocks = ((bytes = stbuf.st_size) + TBLOCK-1)/TBLOCK; + if (vflag) + fprintf(vfile, "x %s, %ld bytes, %ld tape blocks\n", + dblock.dbuf.name, bytes, blocks); + for (; blocks > 0;) { + register int nread; + char *bufp; + register int nwant; + + nwant = NBLOCK*TBLOCK; + if (nwant > (blocks*TBLOCK)) + nwant = (blocks*TBLOCK); + nread = readtbuf(&bufp, nwant); + if (write(ofile, bufp, (int)min(nread, bytes)) < 0) { + fprintf(stderr, + "tar: %s: HELP - extract write error", + dblock.dbuf.name); + perror(""); + done(2); + } + bytes -= nread; + blocks -= (((nread-1)/TBLOCK)+1); + } + close(ofile); + if (mflag == 0) + setimes(dblock.dbuf.name, stbuf.st_mtime); + if (pflag) + chmod(dblock.dbuf.name, stbuf.st_mode & 07777); + } + if (mflag == 0) { + dblock.dbuf.name[0] = '\0'; /* process the whole stack */ + dodirtimes(&dblock); + } +} + +dotable(argv) + char *argv[]; +{ + register int i; + + for (;;) { + if ((i = wantit(argv)) == 0) + continue; + if (i == -1) + break; /* end of tape */ + if (vflag) + longt(&stbuf); + printf("%s", dblock.dbuf.name); + if (dblock.dbuf.linkflag == '1') + printf(" linked to %s", dblock.dbuf.linkname); + if (dblock.dbuf.linkflag == '2') + printf(" symbolic link to %s", dblock.dbuf.linkname); + printf("\n"); + passtape(); + } +} + +putempty() +{ + char buf[TBLOCK]; + + bzero(buf, sizeof (buf)); + (void) 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("%7ld", 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];) + selectbits(*mp++, st); +} + +selectbits(pairp, st) + int *pairp; + struct stat *st; +{ + register int n, *ap; + + ap = pairp; + n = *ap++; + while (--n>=0 && (st->st_mode&*ap++)==0) + ap++; + putchar(*ap); +} + +/* + * Make all directories needed by `name'. If `name' is itself + * a directory on the tar tape (indicated by a trailing '/'), + * return 1; else 0. + */ +checkdir(name) + register char *name; +{ + register char *cp; + + /* + * Quick check for existence of directory. + */ + if ((cp = rindex(name, '/')) == 0) + return (0); + *cp = '\0'; + if (access(name, 0) == 0) { /* already exists */ + *cp = '/'; + return (cp[1] == '\0'); /* return (lastchar == '/') */ + } + *cp = '/'; + + /* + * No luck, try to make all directories in path. + */ + for (cp = name; *cp; cp++) { + if (*cp != '/') + continue; + *cp = '\0'; + if (access(name, 0) < 0) { + if (mkdir(name, 0777) < 0) { + perror(name); + *cp = '/'; + return (0); + } + chown(name, stbuf.st_uid, stbuf.st_gid); + if (pflag && cp[1] == '\0') /* dir on the tape */ + chmod(name, stbuf.st_mode & 07777); + } + *cp = '/'; + } + return (cp[-1]=='/'); +} + +onintr() +{ + (void) signal(SIGINT, SIG_IGN); + term++; +} + +onquit() +{ + (void) signal(SIGQUIT, SIG_IGN); + term++; +} + +onhup() +{ + (void) signal(SIGHUP, SIG_IGN); + term++; +} + +#ifdef notdef +onterm() +{ + (void) signal(SIGTERM, SIG_IGN); + term++; +} +#endif + +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) + return (1); + printf("%c ", c); + if (vflag) + longt(&stbuf); + printf("%s: ", name); + return (response() == 'y'); +} + +response() +{ + char c; + + c = getchar(); + if (c != '\n') + while (getchar() != '\n') + ; + else + c = 'n'; + return (c); +} + +checkf(name, mode, howmuch) + char *name; + int mode, howmuch; +{ + int l; + + if ((mode & S_IFMT) == S_IFDIR){ + if ((strcmp(name, "SCCS")==0) || (strcmp(name, "RCS")==0)) + return(0); + return(1); + } + if ((l = strlen(name)) < 3) + return (1); + if (howmuch > 1 && name[l-2] == '.' && name[l-1] == 'o') + return (0); + if (strcmp(name, "core") == 0 || + strcmp(name, "errs") == 0 || + (howmuch > 1 && strcmp(name, "a.out") == 0)) + return (0); + /* SHOULD CHECK IF IT IS EXECUTABLE */ + return (1); +} + +/* Is the current file a new file, or the newest one of the same name? */ +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); + return (stbuf.st_mtime > mtime); + } +} + +done(n) +{ + unlink(tname); + exit(n); +} + +/* + * Do we want the next entry on the tape, i.e. is it selected? If + * not, skip over the entire entry. Return -1 if reached end of tape. + */ +wantit(argv) + char *argv[]; +{ + register char **cp; + + getdir(); + if (endtape()) + return (-1); + if (*argv == 0) + return (1); + for (cp = argv; *cp; cp++) + if (prefix(*cp, dblock.dbuf.name)) + return (1); + passtape(); + return (0); +} + +/* + * Does s2 begin with the string s1, on a directory boundary? + */ +prefix(s1, s2) + register char *s1, *s2; +{ + while (*s1) + if (*s1++ != *s2++) + return (0); + if (*s2) + return (*s2 == '/'); + return (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 ((daddr_t) -1); + 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= h) + return ((daddr_t) -1); + m1 = m; + j = i; + for(i++; 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 s[i]) + return (-1); + if (b[i+1] < s[i]) + return (1); + } + return (b[i+1] == ' '? 0 : -1); +} + +readtape(buffer) + char *buffer; +{ + char *bufp; + + if (first == 0) + getbuf(); + (void) readtbuf(&bufp, TBLOCK); + bcopy(bufp, buffer, TBLOCK); + return(TBLOCK); +} + +readtbuf(bufpp, size) + char **bufpp; + int size; +{ + register int i; + + if (recno >= nblock || first == 0) { + if ((i = bread(mt, (char *)tbuf, TBLOCK*nblock)) < 0) + mterr("read", i, 3); + if (first == 0) { + if ((i % TBLOCK) != 0) { + fprintf(stderr, "tar: tape blocksize error\n"); + done(3); + } + i /= TBLOCK; + if (i != nblock) { + fprintf(stderr, "tar: blocksize = %d\n", i); + nblock = i; + } + first = 1; + } + recno = 0; + } + if (size > ((nblock-recno)*TBLOCK)) + size = (nblock-recno)*TBLOCK; + *bufpp = (char *)&tbuf[recno]; + recno += (size/TBLOCK); + return (size); +} + +writetbuf(buffer, n) + register char *buffer; + register int n; +{ + int i; + + if (first == 0) { + getbuf(); + first = 1; + } + if (recno >= nblock) { + i = write(mt, (char *)tbuf, TBLOCK*nblock); + if (i != TBLOCK*nblock) + mterr("write", i, 2); + recno = 0; + } + + /* + * Special case: We have an empty tape buffer, and the + * users data size is >= the tape block size: Avoid + * the bcopy and dma direct to tape. BIG WIN. Add the + * residual to the tape buffer. + */ + while (recno == 0 && n >= nblock) { + i = write(mt, buffer, TBLOCK*nblock); + if (i != TBLOCK*nblock) + mterr("write", i, 2); + n -= nblock; + buffer += (nblock * TBLOCK); + } + + while (n-- > 0) { + bcopy(buffer, (char *)&tbuf[recno++], TBLOCK); + buffer += TBLOCK; + if (recno >= nblock) { + i = write(mt, (char *)tbuf, TBLOCK*nblock); + if (i != TBLOCK*nblock) + mterr("write", i, 2); + recno = 0; + } + } + + /* Tell the user how much to write to get in sync */ + return (nblock - recno); +} + +backtape() +{ + static int mtdev = 1; + static struct mtop mtop = {MTBSR, 1}; + struct mtget mtget; + + if (mtdev == 1) + mtdev = ioctl(mt, MTIOCGET, (char *)&mtget); + if (mtdev == 0) { + if (ioctl(mt, MTIOCTOP, (char *)&mtop) < 0) { + fprintf(stderr, "tar: tape backspace error: "); + perror(""); + done(4); + } + } else + lseek(mt, (daddr_t) -TBLOCK*nblock, 1); + recno--; +} + +flushtape() +{ + int i; + + i = write(mt, (char *)tbuf, TBLOCK*nblock); + if (i != TBLOCK*nblock) + mterr("write", i, 2); +} + +mterr(operation, i, exitcode) + char *operation; + int i; +{ + fprintf(stderr, "tar: tape %s error: ", operation); + if (i < 0) + perror(""); + else + fprintf(stderr, "unexpected EOF\n"); + done(exitcode); +} + +bread(fd, buf, size) + int fd; + char *buf; + int size; +{ + int count; + static int lastread = 0; + + if (!Bflag) + return (read(fd, buf, size)); + + for (count = 0; count < size; count += lastread) { + lastread = read(fd, buf, size - count); + if (lastread <= 0) { + if (count > 0) + return (count); + return (lastread); + } + buf += lastread; + } + return (count); +} + +char * +getcwd(buf) + char *buf; +{ + if (getwd(buf) == NULL) { + fprintf(stderr, "tar: %s\n", buf); + exit(1); + } + return (buf); +} + +getbuf() +{ + + if (nblock == 0) { + fstat(mt, &stbuf); + if ((stbuf.st_mode & S_IFMT) == S_IFCHR) + nblock = NBLOCK; + else { + nblock = stbuf.st_blksize / TBLOCK; + if (nblock == 0) + nblock = NBLOCK; + } + } + tbuf = (union hblock *)malloc((unsigned)nblock*TBLOCK); + if (tbuf == NULL) { + fprintf(stderr, "tar: blocksize %d too big, can't get memory\n", + nblock); + done(1); + } +} + +/* + * Save this directory and its mtime on the stack, popping and setting + * the mtimes of any stacked dirs which aren't parents of this one. + * A null directory causes the entire stack to be unwound and set. + * + * Since all the elements of the directory "stack" share a common + * prefix, we can make do with one string. We keep only the current + * directory path, with an associated array of mtime's, one for each + * '/' in the path. A negative mtime means no mtime. The mtime's are + * offset by one (first index 1, not 0) because calling this with a null + * directory causes mtime[0] to be set. + * + * This stack algorithm is not guaranteed to work for tapes created + * with the 'r' option, but the vast majority of tapes with + * directories are not. This avoids saving every directory record on + * the tape and setting all the times at the end. + */ +char dirstack[NAMSIZ]; +#define NTIM (NAMSIZ/2+1) /* a/b/c/d/... */ +time_t mtime[NTIM]; + +dodirtimes(hp) + union hblock *hp; +{ + register char *p = dirstack; + register char *q = hp->dbuf.name; + register int ndir = 0; + char *savp; + int savndir; + + /* Find common prefix */ + while (*p == *q) { + if (*p++ == '/') + ++ndir; + q++; + } + + savp = p; + savndir = ndir; + while (*p) { + /* + * Not a child: unwind the stack, setting the times. + * The order we do this doesn't matter, so we go "forward." + */ + if (*p++ == '/') + if (mtime[++ndir] >= 0) { + *--p = '\0'; /* zap the slash */ + setimes(dirstack, mtime[ndir]); + *p++ = '/'; + } + } + p = savp; + ndir = savndir; + + /* Push this one on the "stack" */ + while (*p = *q++) /* append the rest of the new dir */ + if (*p++ == '/') + mtime[++ndir] = -1; + mtime[ndir] = stbuf.st_mtime; /* overwrite the last one */ +} + +setimes(path, mt) + char *path; + time_t mt; +{ + struct timeval tv[2]; + + tv[0].tv_sec = time((time_t *) 0); + tv[1].tv_sec = mt; + tv[0].tv_usec = tv[1].tv_usec = 0; + if (utimes(path, tv) < 0) { + fprintf(stderr, "tar: can't set time on %s: ", path); + perror(""); + } +} + +char * +getmem(size) +{ + char *p = malloc((unsigned) size); + + if (p == NULL && freemem) { + fprintf(stderr, + "tar: out of memory, link and directory modtime info lost\n"); + freemem = 0; + } + return (p); +} diff --git a/bin/tcsh/FAQ b/bin/tcsh/FAQ new file mode 100644 index 0000000..70c52b1 --- /dev/null +++ b/bin/tcsh/FAQ @@ -0,0 +1,87 @@ + +Last Updated: Wed Feb 27 17:06:15 EST 1991 + +This is for people that do not read the manual! + +So far people who don't read manuals don't read this either... +I may call it README.*PLEASE* in the future, but then people won't +be able to get it... :-) + +1. Why is the meta key broken in tcsh-5.20? + + On some machines the tty is not set up to pass 8 bit characters by default. + Tcsh 5.19 used to try to determine if pass8 should be set by looking at + the terminal's meta key. Unfortunately there is no good way of determining + if the terminal can really pass 8 characters or not. Consider if you are + logged in through a modem line with 7 bits and parity and your terminal + has a meta key. Then tcsh 5.19 would set wrongly set pass8. + + If you did like the prevous behavior you can add in /etc/Login, or + in .login: + + if ( $?prompt ) then + if ( "`echotc meta`" == "yes" ) then + stty pass8 + endif + endif + + If you don't have pass8, maybe something like + + stty -parity -evenp -oddp cs8 -istrip (rs6000) + or + stty -parenb -istrip cs8 + + would work.. + +2. I ran 'dbxtool &' and 'shelltool &' from tcsh, and they end up in cbreak + and no echo mode? + + These programs are broken. Background jobs should not try to look at the + tty. What happens is that dbxtool looks in stderr to inherit the tty + setups, but tcsh sets up the tty in cbreak and -echo modes, so that it + can do line editing. This cannot be fixed because tcsh cannot give away + the tty. A work-around is: + + dbxtool < /dev/null >& /dev/null & + +3. I tried to compile tcsh and it cannot find ? + + Your system does not support NLS. Undefine NLS in config_f.h and it + should work fine. + +4. Where can I get csh sources? + + Csh sources are not public domain. If you do not have an AT&T V3.2 source + licence or better, you are stuck. + +5. I just made tcsh my login shell, and I cannot ftp any more? + + Newer versions of the ftp daemon check for the validity of the + user's shell before they allow logins. The list of valid login + shells is either hardcoded or it is usually in a file called + /etc/shells. If it is hard-coded, then you are out of luck and + your best bet is to get a newer version of ftpd. Otherwise add + tcsh to the list of shells. Remember that the full path is required. + If there is no /etc/shells, and you are creating one, remember to + add /bin/csh, /bin/sh, and any other valid shells for your system, + so that other people can ftp too :-) + +6. I am using SunView and editing is screwed up. In particular my + arrow keys and backspace don't work right. What am I doing wrong? + + Well, cmdtool tries to do its own command line editing and the + effect you get is one of using an editor inside an editor. Both + try to interpret the arrow key sequences and cmdtool wins since + it gets them first. The solutions are in my order of preference: + + 1 Don't use suntools + 2 Use shelltool instead of cmdtool. + 3 Unset edit in tcsh. + +7. I rlogin to another machine, and then no matter what I tell 'stty' + I cannot get it to pass 8 bit characters? + + Maybe you need to use 'rlogin -8' to tell rlogin to pass 8 + bit characters. + +Everything else is a bug :-( diff --git a/bin/tcsh/Fixes b/bin/tcsh/Fixes new file mode 100644 index 0000000..c25e301 --- /dev/null +++ b/bin/tcsh/Fixes @@ -0,0 +1,320 @@ +V6.00.00, 07/04/91 +45. Fixed quoting of VSTART/VSTOP on termios +44. Memory leak every time you pipe in or out. +43. echo {foo bar.[ch]}. Did not check for end of word. +42. ANSI prototypes +41. dmove() would leave the source descriptor open when using dup2() + e.g. + while (1) + echo foo >>! bar + end + runs out of file descriptors +40. recursive `` expanded via aliases would abort. +39. set home=../relative-path-name was broken. + e.g. + set home=../..; cd ..; + +38. Incorrect error when changing to directory: + e.g. + mkdir not-in-cd-path; chmod -x not-in-cd-path; cd not-in-cd-path; + echoed: + not-in-cd-path: No such file or directory. + it should have said + not-in-cd-path: Permission denied. +37. if ( \! =~ [\!] ) echo ok, did not echo ok. Quoting inside [] pattern. +36. More than 127 jobs caused job # to go negative +35. unsetenv ... Added support for more than one pattern. +34. More background process status report fixes. +33. Apollo builtin support. +32. Glob fix. echo '*' * was not handled properly. +31. Glob fix. setenv FOO `sleep 1` would either cause a segmentation fault. + or print ambiguous. +30. Glob fix. Quoted characters inside [] were not handled properly. +29. Removed TELL and VMUNIX defines. I think we cannot compile on V6 anyway +28. Overflow check for expansions. +27. Added matchbeep, regular expression history searching. +26. Added code to handle /dev/std{in,out,err} +25. Fixed POSIX speed handling in raw mode. +24. Fixed a flushing bug in the filec code in sh.file.c +23. Compiled and added hp9000s700 to the list of hosts. +22. Fixed horrible bug in gmatch() + switch (4) + case [a-z]: + echo bug; + breaksw; + case 4: + echo ok; + breaksw; + endsw +21. Fixes for _SEQUENT_ ut_host. +20. FLUSHO added +19. mkdir foo\`bar; cd foo\`bar; was broken +18. EWOULDBLOCK == EAGAIN on RENO check for that too. +17. Dword() simplified and removed the gotos. +16. Hpux now compiles with POSIX. Moved the local chars modes in ed.init.c + after the tty modes. +15. Process group fixes for POSIX +14. We need on the suns for FIOCLEX!!! We did not close + our file descriptors before... +13. A/UX fixes. +12. History events that start with a number are not necessarily numeric: + > !3d + 3d: Event not fount +11. History loop detection added. + > alias a \!# + > b; a +10. Alias loop detection code was ineffective on eager optimizers. + 9. All errors should now go through our table. Next step we should + add nls error messages. + 8. Unsetenv now globs its arguments! Before it did not... + 7. Added tilde cache and -l flag. + 6. Added autocorrect + 5. Fixed for so that background jobs in scripts get process groups + 4. Fixed amazing memory leak in setenv()... + 3. Added short2qstr() so that we can form quoted strings to be used with glob() + 2. str2short and short2str allocate space dynamically. + 1. Fixed bug related to the is*() routines called with shorts. + [only if NLS and SHORT_STRINGS are defined]. + (The _ctype_ was getting indexed with shorts...) + 0. Complete overhaul. Brought in the 4.4 csh stuff. Separated most + tcsh and csh code except where I would have to add more global + variables. Compiled correctly with both lint and gcc -Wall on + a sparc running 4.1 + +V5.20.03, 03/20/91. - Never released +25. Kanji, SXA additions. +24. (exec foo) should not fail if they are suspended jobs. +23. Support kernel paging stuff on aix 370. +22. Now we handle correctly the environment variables LINES, COLUMNS, + TERMCAP for window size changes... +21. Tcsh 5.18c+ had broken NULL chars on scripts. + > cat > foo + #!/usr/local/bin/tcsh -f + echo "foo" + echo "^V^@" + echo "bar" + ^D + > chmod +x foo; foo + foo +20. Posix has EAGAIN and not EWOULDBLOCK +19. Don't set ECHOK; makes kill ^U ugly. +18. $shell is SHELLPATH and not $SHELL any more. +17. Added -n flag to cd, pushd, popd and dirs. Documented -l and -v + flags. +16. Documented and fixed chase_symlinks and ignore_symlinks. +15. Call endpwent() when you get interrupted... + cd ~chri^C + cd ~christos/ + +14. Exec when you have suspended jobs asks for verification. +13. Variable length fixes: + >set abcdefghijklmnopqrstuvwxyz=1 + >echo $abcdefghijklmnopqrstuvwxyz + abcdefghijklmnopqrs: Undefined variable + Now we have better messages too... +12. Icon fixes... +11. Quote expanded glob and history chars too. +10. If someone sets SHIN to O_NDELAY we died... Now we set it back... + 9. unset path; unsetenv PATH; ls-F; (poof) fixed... + 8. Patches for masscomp, and ${var123} lexical analysis fix... + 7. Patch for sunview bug: A partially covered suntool sends SIGWINCH every + time the text is scrolled, causing annoying redraw effects. Now tcsh + checks if the size really changed before doing anything. + 6. Interrupt in the middle of cwdcmd, and periodic does not remove the + aliases. + 5. prompt2 and prompt3 fixes: + Prompt2 now prints the status of the parser by default. + Prompt3 can now have the standard prompt escape sequences. + 4. eval file descriptor re-direction fix. + >set p='w | tail +3' + >eval $p + (originally | tail +3 was ignored) + 3. $edit != emacs anymore; it was misleading, 'set edit' enables editing + 'unset edit' disables it. + 2. PERROR define fix. + 1. irix3.3.1 line discipline fix. + +V5.20.02, 12/15/90. +32. /etc/Logout added and merged with /etc/Login flag. +31. Fixed tty chars in ed.init.c. Some of them were not handled correctly. +30. Command execution does not leak memory any more, and doing + ~ four times does not core-dump. +29. Fixed the notorious csh 'if(' bug (part of the convex fixes) +28. Intelligent getwd() on startup, and canonicalization. +27. Intelligent directory stack. Gets updated when $HOME changes. +26. Directory stack/save-restore additions +25. Convex Fixes. +24. Fixed onlret, and echonl getting stuck on svid. +23. Shouldn't leave tty in raw mode at auto-logout (e.g. when su'ing from a + csh, this is annoying). +22. Some users had environment EMACS set to something, and with my bad fix + at pl 1 found that they didn't have echo... (of course, even before my + "fix", they didn't have editing...). Anyway, refined the check to be + for EMACS=t, which is what emacs sets when running a subshell. +21. kill -CONT %job, would not update the status of the job, but it would + just restart it. +20. Sequent fixes. +19. AIX370 signal and TCF fixes. +18. fixed ls-F -l, SIGINT problem. +17. aix on the ps2 does not have strcoll() either. +16. Bind [A - [D and OA to OD in vi mode to the arrow key functions + so that they work from insert mode. +15. %~ was not working correctly for /home/news and /home/newsbin... +14. Removed $Log$ from sources; it was getting too large... +13. ISC unix fixes. +12. sunos3.x wants not +11. Remove precmd's, cwdcmd's and periodic cmds that had errors. +10. Compile sunos4.1 using termio. + 9. Rs6000 line discipline fixes. + 8. T_Tabs was wrong for termio machines. + 7. Don't bind single keystroke arrow keys, when they are already bound! + 6. Test for newline and tab before deciding not to send shell scripts + to the bourne shell. + 5. Added LITERAL prompt stuff. + 4. Fixed gethostname() in sh.rest.c to return the nodename. + 3. Do not quote spell checked stuff. This is not very intelligent but + works better than before. + 2. Fixes for relative path components. (paths that start with a .) + 1. Fixed so that Rawmode() is not called when we are not editing + (breaks running under emacs) + +V5.20.01, 11/15/90. +12. Recognize environment variables too. +11. Always start in Rawmode() +10. don't try to execute binary files using the bourne shell. + 9. Vi change to end of line updates correctly now. + 8. Prompt in continuation lines. + 7. Prompt in if statements fix. + 6. System V ^C works right now. + 5. ^Z works correctly in bindings + 4. Better error messages for variables. + 3. dinit() now is more robust. + 2. Added aux2.0 patches. + 1. Fixed bug with arrow key bindings in ed.screen.c. All the keys + were bound to up-history! + +V5.20.00, 11/10/90. +26. Fixed system V and POSIX time reporting. +25. Fixed ed.screen.c so that it does not use malloc(). +24. Fixed SIGWINCH on the iris +23. Fixed ed.screen.c, so that settc works correcly. It used to set + the termcap with a string that was allocated from the stack! +22. Fixed listing of commands, where the last command was not checked. +21. Fixed which command. It did not work for + \, if command was aliased. +20. Eliminated CSH4.3 define. You've had enough time to upgrade from 4.2 +19. Fixed GotTermCaps to be called only once. +18. Added bindkey -r +17. Attributes were not getting reset correctly. +16. history -t does not print the time-stamp. +15. AddXkey, works now for single character xkeys. +14. filetype() knows better about symlinks. +13. ls-F works with filenames that have metachars +12. Completion/spelling works with quoted things. +11. Fixed refresh bug. Repeat by: + On an intelligent terminal that has insert and delete chars (xterm) + > orphan + > vi orphan.c + > ^P^P +10. Fixed so that if we don't have a tty on stdin editing is disabled. + 9. Check for nested process forking, to avoid loops such as: + > alias foo 'set bar=`foo`' + > foo + 8. Fix setting of AsciiOnly (Per) + 7. tw.spell.c, defined F_OK for systems that don't have it. + 6. ourwait.h had typo in ifdef. + 5. BSD compilers need a cast to int for enums used in + switches (Matthew Day) + 4. Found the cause for the core-dump in long backquote + expansions (Mark Davies) + 3. Some externs in ed.h needed to be truly externs... + reported by Mark Davies, bug appeared only on hp9000s800. + 2. Changed $tcsh, and $version strings. + 1. Added internal sprintf function, renamed putchar to CSHputchar, + printf to CSHprintf, sprintf to CSHsprintf. + +V5.19.02, 10/23/90. +36. Added /etc/cshrc for the SGI irises. +35. Added expand-variables function. +34. Documented $time in tcsh.man +33. Shell variables are now 'recognized' when expanding/listing things. +32. ls-F does not eat the last slash on the / directory! +31. Strings bound to keys are printed inside double quotes. +30. History now remembers the exact line, not just an unparsed version of + the tokens. +29. Renamed itoa to Itoa(), so things in libc that use itoa() don't break. +28. Ported to IBM aix/ps2. +27. Fixed eval so that it forks when the output is piped + Repeat by: + > who | grep $user + > eval who | grep $user +26. Fixed so that 'nice ' does not + nice or fork. + Consider doing: + nice cd /tmp && rm *.c (don't try it!!!) + [what actually happens is that nice has to fork, then the child executes + chdir, and the parent stays where it was] +25. Added Dan's patches (nls, builtin bindkey, fixes to the editor). +24. Added aix370, migrate, getspath, getspath, getxvers, setxvers +23. Added builtin echotc, removed sl and el. +22. Ported to 4.4 BSD. This involved changing the way lots of flags worked, + cleanup of the SVID stuff, and addition of more compilation flags. + Now POSIX can work whed BSD is defined... +21. Fixed so that el, sl work. Actually they are to be removed soon and + be replaced with echotc. +20. Avoid the Quoted Space hack for alias when printing jobs! + [aliases to the same name avoid further alias expansion, by + inserting a quoted space in front of the command. In SHORT_STRINGS + QUOTE is the 15th bit so print ignores it thinking it is the + end of the string. So we just skip the Quoted Space....] + Repeat by: + > set notify + > alias ls ls -F + > (ls) & + Prints Exit 0 ( + Should print: Exit 0 ( ls -F ) +19. Fixed so that "", '', ``, all produce ': Command not found', + and not the spurious messages. + Repeat by: + > set path = (/bin /usr/bin .... .) + > "" + /some/path/name/: Command not found +18. Enable the use of macros if they exist and NLS is defined. + NLS code is not ready yet. +17. Fixed rmstar and continue_jobs code, so that they are not compile + options, but shell variables. Now you need to 'set rmstar' to get + enable rmstar. +16. Fixed SIGWINCH, SIGWINDOW, and setting of li, co, that broke + suntools, and others. + Repeat by: + Start a shelltool of size other than 80x34 + > telltc + > stty -a + do not report the same number of lines and columns. +15. More fixes to tw.parse.c, and tw.spell.c. +14. More fixes to sh.char.c. +13. Fixed coredump caused by ``. +12. Fixed spell-line code.. +11. Trapped SIGCHLD in sh.sem.c, while forking. Still there is a small + race, but the probability of happening is smaller! +10. Fixed sh.char.c to be ISO compliant. + 9. Added expand-glob + 8. Fixed ourwait.h for little endians. + 7. Fixed that foreach i (^D expands correctly. + 6. Fixed so that listmax is ignored in ls-F. + 5. Fixed spelling correction so that single letter words and words that + contain globbing chars do not get spell checked. + 4. Changed NeXT HOSTTYPE to next, since all HOSTTYPE's are lower case. + 3. Fixed symmetry, and changed symmetry HOSTTYPE from sequent to symmetry. + 2. Added boldfacing, underlining chars. + 1. Added IRIX3.3.1 support. + +V5.19.01, 9/26/90. +7. Brought the README file up-to-date, and changed the bug report + address to point to me. +6. sh.lex.c. In addla(), overflow computation was wrong. +5. Fixed SHELLPATH, to be set correctly when $SHELL is not set. +4. Fixed print statement in sh.proc.c that contained \215. +3. Fixed the Makefile and MAKEDIFFS so that a tahoe diff can be made. +2. RS6000: hacked around execv bug, and ed.init.c warning. +1. Editor should not be enabled when we don't have a tty. diff --git a/bin/tcsh/MAKEDIFFS b/bin/tcsh/MAKEDIFFS new file mode 100755 index 0000000..3b87683 --- /dev/null +++ b/bin/tcsh/MAKEDIFFS @@ -0,0 +1,41 @@ +#!/bin/sh +# +# MAKEDIFFS.sh: Make context diffs for the csh sources +# +# $Id: MAKEDIFFS,v 3.0 1991/07/04 21:57:47 christos Exp $ +XINUDIR=/usr/share/src/mtXinu/bin/csh +BSDDIR=/usr/share/src/mtXinu/BSD/bin/csh +TAHOEDIR=/usr/share/src/mtXinu/TAHOE/bin/csh +RENODIR=/usr/share/src/mtXinu/RENO/bin/csh +TCSHDIR=`pwd` +case "x$1" in +xxinu) + CSHDIR=$XINUDIR;; +xbsd) + CSHDIR=$BSDDIR;; +xtahoe) + CSHDIR=$TAHOEDIR;; +xreno) + CSHDIR=$RENODIR;; +x*) + echo "Usage: `basename $0` [bsd|tahoe|xinu|reno]";exit 1;; +esac +DIFF1='sh.c sh.char.c sh.dir.c sh.dol.c sh.err.c sh.exec.c sh.exp.c sh.file.c' +DIFF2='sh.func.c sh.glob.c sh.hist.c sh.init.c sh.lex.c sh.misc.c sh.parse.c sh.print.c' +DIFF3='sh.proc.c sh.sem.c sh.set.c sh.time.c sh.char.h sh.dir.h sh.h sh.local.h sh.proc.h' + +for i in $DIFF1 +do + diff -c $CSHDIR/$i $TCSHDIR/$i +done > DIFFS.1 + +for i in $DIFF2 +do + diff -c $CSHDIR/$i $TCSHDIR/$i +done > DIFFS.2 + +for i in $DIFF3 +do + diff -c $CSHDIR/$i $TCSHDIR/$i +done > DIFFS.3 +exit 0 diff --git a/bin/tcsh/Makefile b/bin/tcsh/Makefile new file mode 100644 index 0000000..aded732 --- /dev/null +++ b/bin/tcsh/Makefile @@ -0,0 +1,457 @@ +# Makefile 4.3.2 1997/12/27 +# +# C Shell with process control; VM/UNIX VAX Makefile +# Bill Joy UC Berkeley; Jim Kulp IIASA, Austria +# +# With an input editor, command completion, etc. and ported to all sorts of +# things; Paul Placeway, CIS Dept., Ohio State University +# +SHELL=/bin/sh +VERSION=6.00 +BUILD=tcsh + +################################################################ +## CLAGS. For various -D things, see config.h +################################################################ +# +# These are the default suffixes from .c to .o and -c to get there +# but to use the global optimizer on the mips boxes, see below +# +SUF=o +CF=-c + +LFLAGS=-I. +#LFLAGS=-Zn10000 # hpux lint + +SYSDEFINE=pdp11 +CFLAGS= -I. -O -D${SYSDEFINE} +#CFLAGS= -I. -g + +#CFLAGS= -g -pg -I. -DPROF +#CFLAGS= -O -pg -I. -DPROF + +# gcc 1.37- +#CFLAGS=-O -I. -finline-functions -fstrength-reduce + +# gcc 1.37+ +#CFLAGS=-O -I. -fcombine-regs -finline-functions -fstrength-reduce #-msoft-float + +#CFLAGS= -O -I. -fvolatile + +# for silicon graphics (and other mips compilers) -- use the +# global optimizer! (-O3). +#CFLAGS= -O3 -I. +#CF=-j +#SUF=u +#.SUFFIXES: .u ## Ultrix needs that + +# for at&t machines +#CFLAGS= -O -Ksd -I. + +# for convexen +#CFLAGS= -I. -ext -tm c1 + +# Stardent Titan +#CFLAGS = -I. -O -43 + +################################################################ +## LDLAGS. Define something here if you need to +################################################################ +LDFLAGS=-i -X + +################################################################ +## LIBES. Pick one, or roll your own. +################################################################ +LIBES= -ltermcap ## BSD style things +#LIBES= -ltermcap -lcs ## Mach +#LIBES= -lcurses ## Sys V3 w/o networking +#LIBES= -lcurses -lnet ## Sys V3 with networking +#LIBES= -lcurses -ldir ## Sys V2 w/o networking [needs directory lib] +#LIBES= -lcurses -ldir -lnet ## Sys V2 with networking [needs directory lib] +#LIBES= -lcurses -lbsd ## For Irix3.1 on SGI-IRIS4D +#LIBES= -lcurses -lsun -lbsd -lc_s ## For Irix3.3 on SGI-IRIS4D (w/ yp) +#LIBES= -lcurses -lbsd -lc_s ## For Irix3.3 on SGI-IRIS4D (wo/ yp) +#LIBES= -lcurses -lbsd ## or for aix on an IBM 370 or rs6000 or ps2 +#LIBES= -lcurses -lcposix ## ISC 2.2 +#LIBES= -lposix -ltermcap ## A/UX 2.0 +#LIBES= -ltermcap -lseq ## Sequent's Dynix +#LIBES= -lcurses -lsocket ## Intel's hypercube + +# The difficult choice of a c-compiler... +# First, you should try your own c-compiler. +# Gcc -traditional is also a safe choice. +# If you think that you have good include files try gcc -Wall... +# If you want to take out -traditional, make sure that your sys/ioctl.h +# is fixed correctly, otherwise you'll be stopped for tty input! +#CC= gcc -Wall +CC= cc +#CC= occ +ED= -ed +AS= -as +RM= -rm +CXREF= /usr/ucb/cxref +VGRIND= csh /usr/ucb/vgrind +CTAGS= /usr/ucb/ctags +XSTR= /usr/ucb/xstr +#MKSTR= /usr/ucb/mkstr +MKSTR= ./mkprstr +SCCS= /usr/local/sccs +PARALLEL=12 # Make the multi-max run fast. +#P=& # Use Sequent's parallel make +P= +DESTDIR= +BINDIR=/bin +CATSECT=0 +MANSECT=1 +DESTMAN=/usr/man/man${MANSECT} +DESTCAT=/usr/man/cat${MANSECT} +FTPAREA=/usr/spool/ftp + +ASSRCS= sh.c sh.dir.c sh.dol.c sh.err.c sh.exec.c sh.char.c \ + sh.exp.c sh.file.c sh.func.c sh.glob.c sh.hist.c sh.init.c \ + sh.lex.c sh.misc.c sh.parse.c sh.print.c sh.proc.c sh.sem.c \ + sh.set.c sh.time.c sh.char.h sh.dir.h sh.proc.h sh.h +PSSRCS= sh.decls.h glob.c glob.h +SHSRCS= ${ASSRCS} ${PSSRCS} +SHOBJS= sh.${SUF} sh.dir.${SUF} sh.dol.${SUF} sh.err.${SUF} sh.exec.${SUF} \ + sh.char.${SUF} sh.exp.${SUF} sh.func.${SUF} sh.glob.${SUF} \ + sh.hist.${SUF} sh.init.${SUF} sh.lex.${SUF} sh.misc.${SUF} \ + sh.parse.${SUF} sh.print.${SUF} sh.proc.${SUF} sh.sem.${SUF} \ + sh.set.${SUF} sh.time.${SUF} glob.${SUF} + +TWSRCS= tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c +TWOBJS= tw.help.${SUF} tw.init.${SUF} tw.parse.${SUF} tw.spell.${SUF} + +EDSRCS= ed.chared.c ed.decls.h ed.defns.c ed.h ed.init.c ed.inputl.c \ + ed.refresh.c ed.screen.c ed.xmap.c +EDOBJS= ed.chared.${SUF} ed.refresh.${SUF} ed.screen.${SUF} ed.init.${SUF} \ + ed.inputl.${SUF} ed.defns.${SUF} ed.xmap.${SUF} + +TCSRCS= tc.alloc.c tc.bind.c tc.const.c tc.decls.h tc.disc.c \ + tc.func.c tc.os.c tc.os.h tc.printf.c tc.prompt.c \ + tc.sched.c tc.sig.c tc.sig.h tc.str.c sh.types.h tc.vers.c tc.wait.h \ + tc.who.c tc.h +TCOBJS= tc.alloc.${SUF} tc.bind.${SUF} tc.const.${SUF} tc.disc.${SUF} \ + tc.func.${SUF} tc.os.${SUF} tc.printf.${SUF} \ + tc.prompt.${SUF} tc.sched.${SUF} tc.sig.${SUF} tc.str.${SUF} \ + tc.vers.${SUF} tc.who.${SUF} + +PVSRCS= Makefile +AVSRCS= Fixes MAKEDIFFS NewThings README FAQ WishList \ + config_f.h eight-bit.me glob.3 patchlevel.h \ + pathnames.h tcsh.man +VHSRCS=${PVSRCS} ${AVSRCS} + +CONFSRCS=config/config.* + +ALLSRCS= ${SHSRCS} ${TWSRCS} ${EDSRCS} ${TCSRCS} ${VHSRCS} +DISTSRCS= ${PSSRCS} ${TWSRCS} ${EDSRCS} ${TCSRCS} ${AVSRCS} + + +OBJS= ${SHOBJS} ${TWOBJS} ${EDOBJS} ${TCOBJS} ${ALLOC} ${ERROBJ} ${STRINGS} +################################################################ +## ERROBJS. File for mkstr error processing +################################################################ +#ERROBJ=jpnerror.o errlst.o +ERROBJ=jpnerror.o +STRINGDIR=/etc +STRINGFILE=tcsh${VERSION}strgs +STRINGS=strings.o +# +#all: ${BUILD} +# +#tcsh:$(P) ${OBJS} +# rm -f tcsh core +# ${CC} ${LDFLAGS} ${CFLAGS} ${OBJS} -o tcsh ${LIBES} +# +#tcsh.ps: tcsh.1 +# rm -f tcsh.ps +# -ptroff -man tcsh.1 > tcsh.ps +# +# +# STRINGS must be last, to keep in sync with mkstr and xstr ouput +#OBJS= ${SHOBJS} ${TWOBJS} ${EDOBJS} ${ALLOC} ${PRINT} ${DIROBJS} \ +# ${ERROBJ} ${STRINGS} +#ALLOC=tc.alloc.o +ALLOC=tc.alloc.o alloc11.o + +all: mkprstr tcsh tcsh.${CATSECT} + +mkprstr: mkprstr.c + ${CC} -O -o mkprstr mkprstr.c + +BASE= \ + ${ALLOC} \ + ${ERROBJ} \ + ${STRINGS} \ + ed.defns.o \ + ed.init.o \ + ed.inputl.o \ + ed.xmap.o \ + glob.o \ + sh.char.o \ + sh.exp.o \ + sh.hist.o \ + sh.init.o \ + sh.misc.o \ + sh.print.o \ + sh.time.o \ + tc.const.o \ + tc.disc.o \ + tc.os.o \ + tc.printf.o \ + tc.sched.o \ + tc.sig.o \ + tc.str.o \ + tc.who.o \ + tc.vers.o \ + tw.help.o \ + tw.init.o \ + tw.spell.o + +OV1= \ + ed.chared.o \ + ed.refresh.o \ + sh.err.o \ + sh.dol.o + +OV2= \ + ed.screen.o \ + sh.dir.o \ + sh.exec.o \ + sh.parse.o + +OV3= \ + sh.func.o \ + tw.parse.o + +OV4= \ + sh.lex.o \ + sh.o + +OV5= \ + sh.proc.o \ + sh.sem.o \ + sh.set.o \ + tc.prompt.o + +OV6= \ + sh.glob.o \ + tc.bind.o \ + tc.func.o + +OV7= + +tcsh: $(OBJS) + rm -f $@ + /bin/ld -i -X -o tcsh /lib/crt0.o \ + $(BASE) \ + -Z $(OV1) -Z $(OV2) -Z $(OV3) -Z $(OV4) \ + -Z $(OV5) -Z $(OV6) -Z $(OV7) \ + -Y -ltermcap -lc + @-size $@ + +#.c.${SUF}: +# ${CC} ${CF} ${CFLAGS} $< + +#.c.${SUF}: +# ${MKSTR} - ${STRINGFILE} x $*.c +# mv -f x$*.c x.c +# ${CC} ${CFLAGS} ${CF} x.c +# mv x.o $*.o +# rm -f x.c + +.c.${SUF}: ${MKSTR} + ${MKSTR} - ${STRINGFILE} x $*.c + ${CC} -E ${CFLAGS} x$*.c | ${XSTR} ${CF} - + rm -f x$*.c + ${CC} ${CFLAGS} ${CF} x.c + mv x.o $*.o + rm -f x.c + +# Don't do any special massaging of C files for sharing of strings!! +# it causes weird segmentation faults on some systems. +#.c.o: +# ${CC} -E ${CFLAGS} $*.c | ${XSTR} ${CF} - +# ${CC} ${CF} ${CFLAGS} x.c +# mv -f x.o $*.o +# rm -f x.c + +strings.o: strings + ${XSTR} + ${CC} ${CF} xs.c + mv -f xs.o strings.o + rm -f xs.c + +ed.init.o: ed.init.c + ${CC} -E ${CFLAGS} $*.c | ${XSTR} ${CF} - + ${CC} -R ${CF} ${CF} x.c + mv -f x.o $*.o + rm -f x.c + +##.DEFAULT: +## ${SCCS} get $< + +##.DEFAULT: +## co $< + +ed.defns.h: ed.defns.c + @rm -f $@ + @echo '/* Do not edit this file, make creates it. */' > $@ + @echo '#ifndef _h_ed_defns' >> $@ + @echo '#define _h_ed_defns' >> $@ + egrep '[FV]_' ed.defns.c | egrep '^#define' >> $@ + @echo '#endif /* _h_ed_defns */' >> $@ + +sh.err.h: sh.err.c + @rm -f $@ + @echo '/* Do not edit this file, make creates it. */' > $@ + @echo '#ifndef _h_sh_err' >> $@ + @echo '#define _h_sh_err' >> $@ + -unifdef -D${SYSDEFINE} sh.err.c | egrep 'ERR_' | egrep '^#define' >> $@ + @echo '#endif /* _h_sh_err */' >> $@ + +tc.const.h: tc.const.c sh.char.h config.h config_f.h sh.types.h sh.err.h + @rm -f $@ + @echo '/* Do not edit this file, make creates it. */' > $@ + ${CC} -E -I. tc.const.c | egrep 'Char STR' | \ + sed -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' | \ + sort >> $@ + +csh.prof: ${OBJS} sh.prof.${SUF} mcrt0.${SUF} + rm -f csh.prof + ld -X mcrt0.${SUF} ${OBJS} -o csh.prof ${LIBES} -lc + +sh.prof.${SUF}: + cp sh.c sh.prof.c + ${CC} ${CF} ${CFLAGS} -DPROF sh.prof.c + +lint: tc.const.h ed.defns.h + lint ${LFLAGS} sh*.c tw*.c ed*.c tc.*.c ${LIBES} + +print: + @pr READ_ME + @pr makefile makefile.* + @(size -l a.out; size *.${SUF}) | pr -h SIZES + @${CXREF} sh*.c | pr -h XREF + @ls -l | pr + @pr sh*.h [a-rt-z]*.h sh*.c alloc.c + +vprint: + @pr -l84 READ_ME TODO + @pr -l84 makefile makefile.* + @(size -l a.out; size *.${SUF}) | pr -l84 -h SIZES + @${CXREF} sh*.c | pr -l84 -h XREF + @ls -l | pr -l84 + @${CXREF} sh*.c | pr -l84 -h XREF + @pr -l84 sh*.h [a-rt-z]*.h sh*.c alloc.c + +vgrind: + @cp /dev/null index + @for i in *.h; do vgrind -t -h "C Shell" $$i >/crp/bill/csh/$$i.t; done + @for i in *.c; do vgrind -t -h "C Shell" $$i >/crp/bill/csh/$$i.t; done + @vgrind -t -x -h Index index >/crp/bill/csh/index.t + +install: tcsh tcsh.${CATSECT} + -mv -f ${DESTDIR}${BINDIR}/tcsh ${DESTDIR}${BINDIR}/tcsh.old + install -s -m 555 -o bin -g bin tcsh ${DESTDIR}${BINDIR}/tcsh + install -c -m 444 -o bin -g bin ${STRINGFILE} ${DESTDIR}${STRINGDIR} + install -c -m 444 -o bin -g bin tcsh.${CATSECT} ${DESTDIR}${DESTCAT} + +tcsh.${CATSECT}: tcsh.man + /usr/man/manroff tcsh.man > tcsh.${CATSECT} + +clean: + ${RM} -f a.out strings x.c xs.c tcsh _MAKE_LOG core ./mkprstr + ${RM} -f *.${SUF} sh.prof.c ed.defns.h tc.const.h sh.err.h + ${RM} -f ${STRINGFILE} tcsh.${CATSECT} + +veryclean: clean + ${RM} -f *~ #* + +tags: /tmp + ${CTAGS} sh*.c + +tar: + rm -f tcsh.tar.Z + rm -rf tcsh-${VERSION} + mkdir tcsh-${VERSION} tcsh-${VERSION}/config + cp ${ALLSRCS} tcsh-${VERSION} + cp ${CONFSRCS} tcsh-${VERSION}/config + tar cvf - tcsh-${VERSION} | compress > tcsh-${VERSION}.tar.Z + rm -rf tcsh-${VERSION} + +tcsh-${VERSION}.tar.Z: + rm -rf tcsh-${VERSION} + rm -f tcsh-${VERSION}.tar tcsh-${VERSION}.tar.Z DIFFS.[123] + mkdir tcsh-${VERSION} + ./MAKEDIFFS bsd + mv DIFFS.1 DIFFS.2 DIFFS.3 tcsh-${VERSION} + cp ${DISTSRCS} tcsh-${VERSION} + mkdir tcsh-${VERSION}/config + cp ${CONFSRCS} tcsh-${VERSION}/config + cp Makefile tcsh-${VERSION}/Makefile.new + tar cvf - tcsh-${VERSION} | compress > tcsh-${VERSION}.tar.Z + rm -rf tcsh-${VERSION} + +tcsh.tahoe-${VERSION}.tar.Z: + rm -rf tcsh.tahoe-${VERSION} + rm -f tcsh.tahoe-${VERSION}.tar tcsh.tahoe-${VERSION}.tar.Z DIFFS.[123] + mkdir tcsh.tahoe-${VERSION} + ./MAKEDIFFS tahoe + mv DIFFS.1 DIFFS.2 DIFFS.3 tcsh.tahoe-${VERSION} + cp ${DISTSRCS} tcsh.tahoe-${VERSION} + mkdir tcsh.tahoe-${VERSION}/config + cp ${CONFSRCS} tcsh.tahoe-${VERSION}/config + cp Makefile tcsh.tahoe-${VERSION}/Makefile.new + tar cvf - tcsh.tahoe-${VERSION} | compress > tcsh.tahoe-${VERSION}.tar.Z + rm -rf tcsh.tahoe-${VERSION} + +tcsh.reno-${VERSION}.tar.Z: + rm -rf tcsh.reno-${VERSION} + rm -f tcsh.reno-${VERSION}.tar tcsh.reno-${VERSION}.tar.Z DIFFS.[123] + mkdir tcsh.reno-${VERSION} + ./MAKEDIFFS reno + mv DIFFS.1 DIFFS.2 DIFFS.3 tcsh.reno-${VERSION} + cp ${DISTSRCS} tcsh.reno-${VERSION} + mkdir tcsh.reno-${VERSION}/config + cp ${CONFSRCS} tcsh.reno-${VERSION}/config + cp Makefile tcsh.reno-${VERSION}/Makefile.new + tar cvf - tcsh.reno-${VERSION} | compress > tcsh.reno-${VERSION}.tar.Z + rm -rf tcsh.reno-${VERSION} + +ftp: tcsh-${VERSION}.tar.Z tcsh.tahoe-${VERSION}.tar.Z + cp tcsh-${VERSION}.tar.Z tcsh.tahoe-${VERSION}.tar.Z ${FTPAREA} + cp tcsh.man ${FTPAREA} + +# +# Dependencies +# +config.h: config_f.h + +tc.h: tc.const.h tc.decls.h tc.os.h tc.sig.h +sh.h: sh.types.h sh.char.h sh.err.h sh.dir.h sh.proc.h pathnames.h \ + sh.decls.h tc.h +tw.h: tw.decls.h +ed.h: ed.decls.h + +# ed.h +EDINC=sh.${SUF} sh.func.${SUF} sh.lex.${SUF} sh.print.${SUF} sh.proc.${SUF} \ + sh.set.${SUF} tc.bind.${SUF} tc.os.${SUF} tc.prompt.${SUF} \ + tc.sched.${SUF} tw.parse.${SUF} +${EDOBJS} ${EDINC} : ed.h + +# sh.h +${OBJS}: config.h sh.h + +# tw.h: +TWINC=ed.chared.${SUF} ed.inputl.${SUF} sh.exec.${SUF} sh.func.${SUF} \ + sh.set.${SUF} tc.func.${SUF} +${TWOBJS} ${TWINC}: tw.h + +# glob.h +glob.${SUF} sh.glob.${SUF}: glob.h + +# ed.defns.h +EDDINC=tc.bind.${SUF} tc.func.${SUF} tc.os.${SUF} +${EDOBJS} ${EDDINC}: ed.defns.h diff --git a/bin/tcsh/NewThings b/bin/tcsh/NewThings new file mode 100644 index 0000000..21ed21f --- /dev/null +++ b/bin/tcsh/NewThings @@ -0,0 +1,53 @@ +This file contains visible (incompatible) changes to the users. +This version of tcsh has the following new things: + +6.00 +* History searching searches using regular expressions too. +* The autolist values that controlled beeping are not supported any more; + used matchbeep instead. +* /etc/Login and /etc/Logout were renamed to /etc/csh.login /etc/csh.logout + and /etc/csh.cshrc was added +* prompt2 and prompt3 can have prompt escapes. +* eval pipes work +* ignore_symlinks works + +5.20 PL2 +* %{..%} escapes in prompt + +5.20 PL0 +* bindkey -r +* history -t +* shell variables in paths expand correctly. +* variable expansion +* quoted expansions now work. +* new version and tcsh variable format + +5.19 PL2 +* NLS support +* New bindkey and echotc builtins +* Underline and Bold in the prompt; additions and changes to the prompt and + who syntax (%u is now %n, so that %u can be used to turn undeline off, + and %n is now \n). +* rmstar needs to be set to protect from accidental removal +* Fixed editor, and spell line. +* Glob-expand, on arguments. +* Added process migration builtins for aix370 + +5.19 PL1 +* Maintainance release for mainly the rs6000 + +5.19 PL0 +* 8 bit clean code, by using 16 bit strings. +* Mostly shared strings (a side-effect) +* Highlights everywhere (and in ls-F) filenames that contain characters + with the eighth bit set (or passes them unchanged depending on the + variable 'nometa') +* Newline in the prompt via %n. +* dirs takes also a -v flag for `vertical display' +* There is a new variable `listjobs' which controls if and how jobs + are displayed when a new job is suspended. [Idea from the mtXinu + code, very useful for novice users who hit control-Z 10 times on + the same job!] + set listjobs=long, jobs -l is executed every time a job is suspended. + set listjobs=short, jobs is executed every time a job is suspended. +* Passes lint... At least on a sun. diff --git a/bin/tcsh/README b/bin/tcsh/README new file mode 100644 index 0000000..3bcb772 --- /dev/null +++ b/bin/tcsh/README @@ -0,0 +1,143 @@ +This is tcsh version tcsh 6.00. Tcsh is a version of the Berkeley +C-Shell, with the addition of: a command line editor, command and file +name completion, listing, etc. and a bunch of small additions to the +shell itself. + +Tcsh runs on BSD 4.2 and 4.3 Unix, Mach, Sun Unix (tested on 3.0, 3.2, +3.4, 4.0, 4.1), Pyramid OS/X (in the bsd universe), Encore UMAX 4.2, +Apple A/UX 2.0, AT&T 3b machines under SysV.2 and V.3, HP/UX +6.2 on series 300 and 800 machines and all HP machines under HP/UX +6.5 and 7.0, and will probably work with a bit of tinkering on anything +else either BSD or SysV-ish. Note that the above list is incomplete, +and the place to look is the config directory to find a configuration +file appropriate for your machine. + +Feel free to use it. These changes to csh may only be included in a +commercial product if the inclusion or exclusion does not change the +purchase price, level of support, etc. Please respect the individual +authors by giving credit where credit is due (in other words, don't +claim that you wrote portions that you haven't, and don't delete the +names of the authors from the source code or documentation). + +To install tcsh: + +1) Look at the Makefile and make sure that you are using the right + compilation flags. + + NOTES: + On a vax using the good ol' BSD compiler 'typedef void sigret_t;' + fails in sh.os.h replace with '#define sigret_t void'. No I will not + change sh.sig.h. (Both ultrix and 4.3BSD) + +2) Copy the appropriate for your machine and OS config file from the + config subdirectory into config.h. If you are trying to compile + tcsh on a machine for which there is no config file yet, you will + need to create a config file using as a template one of the + supplied ones. If you get tcsh working on a new machine, I'd + appreciate a copy of the config file plus additional information + about the architecture/OS. If you are creating a new config file, + look very hard at BSDJOBS, BSDSIGS, and BSDTIMES if you are running + a non-BSD machine. For vanila SysV, these would all be #undef-ed, + but others may vary (such as A/UX or HPUX). On a pyramid, compile + in the UCB universe even if you are running under the ATT universe + usually; it will work anyway, and you get job control for free. + +3) Look at config_f.h, and enable or disable any features you want. + It is configured the way I like it, but you may disagree. + If you do not have NLS, then locale.h will not be found. Undefine it + and things should work ok. On the other hand, if you have NLS you + might as well use it... + +4) Look at sh.c to make sure that you have the right #ifdefs to set + the environment variable "HOSTTYPE" correctly. If you need to make + changes, PLEASE SEND THEM BACK TO ME. + +5) You may want to adjust the DESTDIR and DESTMAN entries in the + Makefile. These are the directories that tcsh, and the tcsh.1 man + entry will be placed in when you do a "make install". If you decide + to install tcsh somewhere other than in /usr/local/bin/tcsh, you should + #define _PATH_TCSH "/your/installation/directory/tcsh" in pathnames.h. + +6) make + +7) Read the documentation while you are waiting. The file tcsh.man + is in standard [nt]roff -man format. + +8) Test tcsh to see that it has compiled correctly. The history + command should give a time stamp on every entry. Typing normal + characters should echo each exactly once. Control-A should put the + cursor at the beginning of the input line, but after the prompt. + Typing characters after that should insert them into the line. + If you have job control make sure that stopping and restarting + jobs works. Make sure you can ^C in the middle of the input line. + Also make sure that pipelines work correctly and there + are no races. Try 'echo | cat | cat | cat | cat | more' a couple + of times. Also make sure that the ioctl() modes are preserved. + Get into vi, enter and exit input mode and suspend it, background + it and foreground it again. After all that, lastly make sure that + the tty process group manipulation is happening correctly. Try + ftp to some host. If your passwd appears on the screen, you have + lost /dev/tty. Otherwise everything is fine. + +9) Enjoy. + +10) PLEASE send any bug reports (and fixes), code for new features, + comments, questions, etc. (even flames) to: + + -- Christos Zoulas + christos@ee.cornell.edu + + SNail: 389 Engineering/Theory Center + Cornell University, + Ithaca, NY 14853. + Phone: (607) 255-0302 + Fax: (607) 255-9072 + + +Various: + +On sysv versions < 3.0 (not hpux) the public domain directory +manipulation library has to be installed. +If the network is not installed, then there is a gethostname() +routine is tc.os.c. + +Note: + +On the rs6000, tcsh might not compile cause +does not define struct tm; ask your support people for an upgrade, +or apply the following patch: +[You can apply the patch locally, if you don't have root privs. by: + mkdir sys; cp /usr/include/sys/time.h sys; cd sys; chmod u+w time.h + apply the patch] +[a version of patch is available from prep.ai.mit.edu in /pub/gnu] + +This is fixed in the third update of 3.01. To find out what level of +software the kernel is on a RS/6000, run 'lslpp -h bos.obj'. The +bottom line of output should be of the form '.... 03.01.XXXX.YYYY'. +The XXXX value is the level of update, eg 0001, 0002, 0003. + + +*** /usr/include/sys/time.h Sat May 19 19:48:53 1990 +--- time.h Wed Oct 31 18:01:08 1990 +*************** +*** 1,4 **** +! /* @(#)time.h 1.24 com/inc/sys,3.1,9021 2/16/90 10:02:16 */ + #ifndef _H_SYS_TIME + #define _H_SYS_TIME + +--- 1,4 ---- +! /* @(#)time.h 1.25 com/inc/sys,3.1,9030ct 7/12/90 15:11:35 */ + #ifndef _H_SYS_TIME + #define _H_SYS_TIME + +*************** +*** 245,249 **** +--- 245,252 ---- + #define DST_EET 5 /* Eastern European dst */ + #define DST_CAN 6 /* Canada */ + ++ #ifdef _BSD_INCLUDES ++ #include ++ #endif /* _BSD_INCLUDES */ + + #endif /* _H_SYS_TIME */ diff --git a/bin/tcsh/WishList b/bin/tcsh/WishList new file mode 100644 index 0000000..ddcd62d --- /dev/null +++ b/bin/tcsh/WishList @@ -0,0 +1,42 @@ +* Fix memory leak related to aliasrun(). Precmd, Cwdcmd etc. leak memory. + +* Fix migrate -site $$... Seems to hang... (aix370) + +* Fix history in loops. + +* Fix loops so that they work inside aliases. + +* Fix variable substitutions so that can behave recursively; i.e. I want + to be able to say echo $foo:t:e + +* New idea. + Lots of people seem to like the idea to be able to do sed type + operations on shell variables. Maybe we can extend the syntax + of the variable editing to understand string operations. + So I would like to be able to use: + > set a="this is a STRING" + > echo $a:[3-] + is is a STRING + > echo $a:[#] + 16 + > echo $a:[6-7] + is + > echo $a:[-2] + ng + > echo $a:[-20] + Subscript out of bounds. + > echo $a:[2-20] + Subscript out of bounds. + > echo $a:l + this is a string + > echo $a:u + THIS IS A STRING + > echo $a:[1-1]:u$a:[2-]. + This is a string. + +* Fix pipelines that contain builtins so that they behave correctly. + I tried to fix that (most of the code is in sh.sem.c, but it works + only for non POSIX machines cause otherwise the setpgid() I added + fails). + +* Fix the correct code... How to do that involves A.I.... diff --git a/bin/tcsh/alloc11.c b/bin/tcsh/alloc11.c new file mode 100644 index 0000000..8c99fc7 --- /dev/null +++ b/bin/tcsh/alloc11.c @@ -0,0 +1,246 @@ +#if !defined(lint) && !defined(NOSCCS) +static char *sccsid = "@(#)alloc.c 4.1.1 1996/4/4"; +#endif + +#include "config.h" +#include +#include +#include + +#define debug +#ifdef debug +#define ASSERT(p) if(!(p))botch("p");else + +/* + * Can't use 'printf' below because that can call malloc(). If the malloc + * arena is corrupt the result is a recursive loop which underflows the stack + * and obfuscates the initial problem. +*/ +botch(s) +char *s; +{ + struct iovec iov[3]; + register struct iovec *v = iov; + char *ab = "assertion botched: "; + + v->iov_base = ab; + v->iov_len = strlen(ab); + v++; + v->iov_base = s; + v->iov_len = strlen(s); + v++; + v->iov_base = "\n"; + v->iov_len = 1; + + writev(STDOUT_FILENO, iov, 3); + 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 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&&qptr = 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=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 + +showall(s) + char **s; +{ + register union store *p, *q; + int used = 0, free = 0, i; + + if (s[1]) + printf("Memory allocation statistics %s\n", s[1]); + for (p = clearbusy(allocs[1].ptr); p != alloct; p = q) { + q = clearbusy(p->ptr); + i = ((unsigned) q - (unsigned) p); + if (testbusy(p->ptr)) { + if (s[1]) { + printf(" addr %06o, len %5d BUSY\n", + p, i); + printf(" content is: %s\n", p+1); + } + used += i; + } else { + if (s[1]) + printf(" addr %06o, len %5d FREE\n", + p, i); + free += i; + } + } + printf("%u used, %u free, %u end\n", used, free, clearbusy(alloct)); +} diff --git a/bin/tcsh/config.h b/bin/tcsh/config.h new file mode 100644 index 0000000..60bb88b --- /dev/null +++ b/bin/tcsh/config.h @@ -0,0 +1,110 @@ +/* + * config.h -- configure various defines for tcsh + * + * All source files should #include this FIRST. + * + * Edit this to match your system type. + */ + +/****************** System dependant compilation flags ****************/ +/* + * POSIX This system supports IEEE Std 1003.1-1988 (POSIX). + */ +#undef POSIX + +/* + * POSIXJOBS This system supports the optional IEEE Std 1003.1-1988 (POSIX) + * job control facilities. + */ +#undef POSIXJOBS + +/* + * VFORK This machine has a vfork(). + * It used to be that for job control to work, this define + * was mandatory. This is not the case any more. + * If you think you still need it, but you don't have vfork, + * define this anyway and then do #define vfork fork. + * I do this anyway on a Sun because of yellow pages brain damage, + * [should not be needed under 4.1] + * and on the iris4d cause SGI's fork is sufficiently "virtual" + * that vfork isn't necessary. (Besides, SGI's vfork is weird). + * Note that some machines eg. rs6000 have a vfork, but not + * with the berkeley semantics, so we cannot use it there either. + */ +#define VFORK + +/* + * BSDJOBS You have BSD-style job control (both process groups and + * a tty that deals correctly + */ +#define BSDJOBS + +/* + * BSDSIGS You have 4.2-style signals, rather than USG style. + * Note: POSIX systems should not define this unless they + * have sigvec() and friends (ie: 4.3BSD-RENO, HP-UX). + */ +#define BSDSIGS + +/* + * BSDTIMES You have BSD-style process time stuff (like rusage) + * This may or may not be true. For example, Apple Unix + * (OREO) has BSDJOBS and BSDSIGS but not BSDTIMES. + */ +#define BSDTIMES + +/* + * BSDNICE Your system uses setpriority() instead of nice, to + * change a processes scheduling priority + */ +#define BSDNICE + +/* + * TERMIO You have struct termio instead of struct sgttyb. + * This is usually the case for SVID systems, where + * BSD uses sgttyb. POSIX systems should define this + * anyway, even though they use struct termios. + */ +#undef TERMIO + +/* + * SVID Your machine is SVID complient (Sys V, HPUX, A/UX) + * NOTE: don't do this if you are on a Pyramid -- tcsh is + * built in a BSD universe. + * Set SVID to 1, 2, or 3, depending the version of System V + * you are running. Or set it to 0 if you are not SVID based + */ +#define SVID 0 + +/* + * YPBUGS Work around Sun YP bugs that cause expansion of ~username + * to send command output to /dev/null + */ +#undef YPBUGS + +/* + * SIGVOID Define this if your signal handlers return void. On older + * systems, signal returns int, but on newer ones, it returns void. + */ +#undef SIGVOID + +/* + * DUP2 Define this if your system supports dup2(). + */ +#define DUP2 + +/* + * UTHOST Does the utmp file have a host field? + */ +#define UTHOST + +/* + * DIRENT Your system has instead of + */ +#undef DIRENT +/****************** local defines *********************/ +/****************** configurable hacks ****************/ +/* have been moved to config_f.h */ +#include "config_f.h" + +#undef NLS diff --git a/bin/tcsh/config_f.h b/bin/tcsh/config_f.h new file mode 100644 index 0000000..97f7afe --- /dev/null +++ b/bin/tcsh/config_f.h @@ -0,0 +1,132 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/config_f.h,v 3.0 1991/07/04 21:54:11 christos Exp $ */ +/* + * config_f.h -- configure various defines for tcsh + * + * This is included by config.h. + * + * Edit this to match your particular feelings; this is set up to the + * way I like it. + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#ifndef _h_config_f +#define _h_config_f + +/* + * SHORT_STRINGS Use 16 bit characters instead of 8 bit chars + * This fixes up quoting problems and eases implementation + * of nls... + * + */ +#undef SHORT_STRINGS + +/* + * NLS: Use Native Language System + * Routines like setlocale() are needed + * if you don't have , you don't want + * to define this. + */ +#undef NLS + +/* + * LOGINFIRST Source ~/.login before ~/.cshrc + */ +#undef LOGINFIRST + +/* + * VIDEFAULT Make the VI mode editor the default + */ +#undef VIDEFAULT + +/* + * KAI use "bye" command and rename "log" to "watchlog" + */ +#undef KAI + +/* + * CSHDIRS save a history like stack of directories + */ +#define CSHDIRS + +/* + * TESLA drops DTR on logout. Historical note: + * tesla.ee.cornell.edu was a vax11/780 with a develcon + * switch that sometimes would not hang up. + */ +#undef TESLA + +/* + * DOTLAST put "." last in the default path, for security reasons + */ +#define DOTLAST + +/* + * AUTOLOGOUT tries to determine if it should set autologout depending + * on the name of the tty, and environment. + * Does not make sense in the modern window systems! + */ +#undef AUTOLOGOUT + +/* + * SUSPENDED Newer shells say 'Suspended' instead of 'Stopped'. + * Define to get the same type of messages. + */ +#define SUSPENDED + +/* + * KANJI Ignore meta-next, and the ISO character set. Should + * be used with SHORT_STRINGS + * + */ +#undef KANJI + +/* + * SYSMALLOC Use the system provided version of malloc and friends. + * This can be much slower and no memory statistics will be + * provided. + */ +#define SYSMALLOC + +/* + * TCLONGNAME print descriptive strings as well t_c_ names + * Don't define this for BSD2: limited data space + */ +#undef TCLONGNAME + +/* + * LONGFUNCS print descriptive strings as well function names + * Don't define this for BSD2: limited data space + */ +#undef LONGFUNCS + +#endif /* _h_config_f */ diff --git a/bin/tcsh/ed.chared.c b/bin/tcsh/ed.chared.c new file mode 100644 index 0000000..0a52a85 --- /dev/null +++ b/bin/tcsh/ed.chared.c @@ -0,0 +1,2020 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/ed.chared.c,v 3.0 1991/07/04 21:49:28 christos Exp $ */ +/* + * ed.chared.c: Character editing functions. + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#include "config.h" +#if !defined(lint) && !defined(pdp11) +static char *rcsid() + { return "$Id: ed.chared.c,v 3.0 1991/07/04 21:49:28 christos Exp $"; } +#endif + +#include "sh.h" +#include "ed.h" +#include "tw.h" +#include "ed.defns.h" + +/* all routines that start with c_ are private to this set of routines */ +static void c_alternativ_key_map __P((int)); +static void c_insert __P((int)); +static void c_delafter __P((int)); +static void c_delbefore __P((int)); +static Char *c_prev_word __P((Char *, Char *, int)); +static Char *c_next_word __P((Char *, Char *, int)); +static Char *c_beg_next_word __P((Char *, Char *, int)); +static void c_copy __P((Char *, Char *, int)); +static Char *c_number __P((Char *, int *, int)); +static Char *c_expand __P((Char *)); +static void c_excl __P((Char *)); +static void c_substitute __P((void)); +static int c_hmatch __P((Char *)); +static void c_hsetpat __P((void)); +#ifdef COMMENT +static void c_get_word __P((Char **, Char **)); +#endif + +static void +c_alternativ_key_map(state) + int state; +{ + AltKeyMap = state; + if (state) + Cur_KeyMap = CcAltMap; + else + Cur_KeyMap = CcKeyMap; +} + +static void +c_insert(num) + register int num; +{ + register Char *cp; + + if (LastChar + num >= InputLim) + return; /* can't go past end of buffer */ + + if (Cursor < LastChar) { /* if I must move chars */ + for (cp = LastChar; cp >= Cursor; cp--) + cp[num] = *cp; + } + LastChar += num; +} + +static void +c_delafter(num) /* delete after dot, with bounds checking */ + register int num; +{ + register Char *cp; + + if (Cursor + num > LastChar) + num = LastChar - Cursor;/* bounds check */ + + if (num > 0) { /* if I can delete anything */ + for (cp = Cursor; cp <= LastChar; cp++) + *cp = cp[num]; + LastChar -= num; + } + else + replacemode = 0; +} + +static void +c_delbefore(num) /* delete before dot, with bounds checking */ + register int num; +{ + register Char *cp; + + if (Cursor - num < InputBuf) + num = Cursor - InputBuf;/* bounds check */ + + if (num > 0) { /* if I can delete anything */ + for (cp = Cursor - num; cp <= LastChar; cp++) + *cp = cp[num]; + LastChar -= num; + } +} + +static Char * +c_prev_word(p, low, n) + register Char *p, *low; + register int n; +{ + /* to the beginning of the PREVIOUS word, not this one */ + p--; + + while (n--) { + while ((p >= low) && (!(isword(*p)))) + p--; + while ((p >= low) && (isword(*p))) + p--; + } + /* cp now points to one character before the word */ + p++; + if (p < low) + p = low; + /* cp now points where we want it */ + return (p); +} + +static Char * +c_next_word(p, high, n) + register Char *p, *high; + register int n; +{ + while (n--) { + while ((p < high) && (!(isword(*p)))) + p++; + while ((p < high) && (isword(*p))) + p++; + } + if (p > high) + p = high; + /* p now points where we want it */ + return (p); +} + +static Char * +c_beg_next_word(p, high, n) + register Char *p, *high; + register int n; +{ + while (n--) { + while ((p < high) && (isword(*p))) + p++; + while ((p < high) && (!(isword(*p)))) + p++; + } + if (p > high) + p = high; + /* p now points where we want it */ + return (p); +} + +/* + * Expand-History (originally "Magic-Space") code added by + * Ray Moody + * this is a neat, but odd, addition. + */ + +/* + * c_copy is sorta like bcopy() except that we handle overlap between + * source and destination memory + */ + +static void +c_copy(src, dst, length) + register Char *src, *dst; + register int length; +{ + if (src > dst) { + while (length--) { + *dst++ = *src++; + } + } + else { + src += length; + dst += length; + while (length--) { + *--dst = *--src; + } + } +} + +/* + * c_number: Ignore character p points to, return number appearing after that. + * A '$' by itself means a big number; "$-" is for negative; '^' means 1. + * Return p pointing to last char used. + */ + +/* + * dval is the number to subtract from for things like $-3 + */ + +static Char * +c_number(p, num, dval) + register Char *p; + register int *num; + register int dval; +{ + register int i; + register int sign = 1; + + if (*++p == '^') { + *num = 1; + return (p); + } + if (*p == '$') { + if (*++p != '-') { + *num = NCARGS; /* Handle $ */ + return (--p); + } + sign = -1; /* Handle $- */ + ++p; + } + for (i = 0; *p >= '0' && *p <= '9'; i = 10 * i + *p++ - '0'); + *num = (sign < 0 ? dval - i : i); + return (--p); +} + +/* + * excl_expand: There is an excl to be expanded to p -- do the right thing + * with it and return a version of p advanced over the expanded stuff. Also, + * update tsh_cur and related things as appropriate... + */ + +static Char * +c_expand(p) + register Char *p; +{ + register Char *q; + register struct Hist *h = Histlist.Hnext; + register struct wordent *l; + int i, from, to, dval; + bool all_dig; + bool been_once = 0; + Char *op = p; + Char buf[INBUFSIZ]; + Char *bend = buf; + Char *modbuf, *omodbuf; + + if (!h) + goto excl_err; +excl_sw: + switch (*(q = p + 1)) { + + case '^': + bend = expand_lex(buf, INBUFSIZ, &h->Hlex, 1, 1); + break; + + case '$': + if ((l = (h->Hlex).prev)) + bend = expand_lex(buf, INBUFSIZ, l->prev->prev, 0, 0); + break; + + case '*': + bend = expand_lex(buf, INBUFSIZ, &h->Hlex, 1, NCARGS); + break; + + default: + if (been_once) { /* unknown argument */ + /* assume it's a modifier, e.g. !foo:h, and get whole cmd */ + bend = expand_lex(buf, INBUFSIZ, &h->Hlex, 0, NCARGS); + q -= 2; + break; + } + been_once = 1; + + if (*q == ':') /* short form: !:arg */ + --q; + + if (*q != HIST) { + /* + * Search for a space, tab, or colon. See if we have a number (as + * in !1234:xyz). Remember the number. + */ + for (i = 0, all_dig = 1; + *q != ' ' && *q != '\t' && *q != ':' && q < Cursor; q++) { + /* + * PWP: !-4 is a valid history argument too, therefore the test + * is if not a digit, or not a - as the first character. + */ + if ((*q < '0' || *q > '9') && (*q != '-' || q != p + 1)) + all_dig = 0; + else if (*q == '-') + all_dig = 2;/* we are sneeky about this */ + else + i = 10 * i + *q - '0'; + } + --q; + + /* + * If we have a number, search for event i. Otherwise, search for + * a named event (as in !foo). (In this case, I is the length of + * the named event). + */ + if (all_dig) { + if (all_dig == 2) + i = -i; /* make it negitive */ + if (i < 0) /* if !-4 (for example) */ + i = eventno + 1 + i; /* remember: i is < 0 */ + for (; h; h = h->Hnext) { + if (h->Hnum == i) + break; + } + } + else { + for (i = q - p; h; h = h->Hnext) { + if ((l = &h->Hlex)) { + if (!Strncmp(p + 1, l->next->word, i)) + break; + } + } + } + } + if (!h) + goto excl_err; + if (q[1] == ':' || q[1] == '-' || q[1] == '*' || + q[1] == '$' || q[1] == '^') { /* get some args */ + p = q[1] == ':' ? ++q : q; + /* + * Go handle !foo:* + */ + if ((q[1] < '0' || q[1] > '9') && + q[1] != '-' && q[1] != '$' && q[1] != '^') + goto excl_sw; + /* + * Go handle !foo:$ + */ + if (q[1] == '$' && (q[2] != '-' || q[3] < '0' || q[3] > '9')) + goto excl_sw; + /* + * Count up the number of words in this event. Store it in dval. + * Dval will be fed to number. + */ + dval = 0; + if ((l = h->Hlex.prev)) { + for (l = l->prev; l != h->Hlex.next; l = l->prev, dval++); + } + if (!dval) + goto excl_err; + if (q[1] == '-') + from = 0; + else + q = c_number(q, &from, dval); + if (q[1] == '-') { + ++q; + if ((q[1] < '0' || q[1] > '9') && q[1] != '$') + to = dval - 1; + else + q = c_number(q, &to, dval); + } + else if (q[1] == '*') { + ++q; + to = NCARGS; + } + else { + to = from; + } + if (from < 0 || to < from) + goto excl_err; + bend = expand_lex(buf, INBUFSIZ, &h->Hlex, from, to); + } + else { /* get whole cmd */ + bend = expand_lex(buf, INBUFSIZ, &h->Hlex, 0, NCARGS); + } + break; + } + + /* + * Apply modifiers, if any. + */ + if (q[1] == ':') { + *bend = '\0'; + omodbuf = buf; + while (q[1] == ':' && (modbuf = domod(omodbuf, (int) q[2])) != NOSTR) { + if (omodbuf != buf) + xfree((ptr_t) omodbuf); + omodbuf = modbuf; + q += 2; + } + if (omodbuf != buf) { + (void) Strcpy(buf, omodbuf); + xfree((ptr_t) omodbuf); + bend = Strend(buf); + } + } + + /* + * Now replace the text from op to q inclusive with the text from buf to + * bend. + */ + q++; + + /* + * Now replace text non-inclusively like a real CS major! + */ + if (LastChar + (bend - buf) - (q - op) >= InputLim) + goto excl_err; + c_copy(q, q + (bend - buf) - (q - op), LastChar - q); + LastChar += (bend - buf) - (q - op); + Cursor += (bend - buf) - (q - op); + c_copy(buf, op, (bend - buf)); + return (op + (bend - buf)); +excl_err: + Beep(); + return (op + 1); +} + +/* + * c_excl: An excl has been found at point p -- back up and find some white + * space (or the beginning of the buffer) and properly expand all the excl's + * from there up to the current cursor position. We also avoid (trying to) + * expanding '>!' + */ + +static void +c_excl(p) + register Char *p; +{ + register int i; + register Char *q; + + /* + * if />[SPC TAB]*![SPC TAB]/, back up p to just after the >. otherwise, + * back p up to just before the current word. + */ + if ((p[1] == ' ' || p[1] == '\t') && + (p[-1] == ' ' || p[-1] == '\t' || p[-1] == '>')) { + for (q = p - 1; q > InputBuf && (*q == ' ' || *q == '\t'); --q); + if (*q == '>') + ++p; + } + else { + while (*p != ' ' && *p != '\t' && p > InputBuf) + --p; + } + + /* + * Forever: Look for history char. (Stop looking when we find the cursor.) + * Count backslashes. Of odd, skip history char. Return if all done. + * Expand if even number of backslashes. + */ + for (;;) { + while (*p != HIST && p < Cursor) + ++p; + for (i = 1; (p - i) >= InputBuf && p[-i] == '\\'; i++); + if (i % 2 == 0) + ++p; + if (p >= Cursor) + return; + if (i % 2 == 1) + p = c_expand(p); + } +} + + +static void +c_substitute() +{ + register Char *p; + + /* + * Start p out one character before the cursor. Move it backwards looking + * for white space, the beginning of the line, or a history character. + */ + for (p = Cursor - 1; + p > InputBuf && *p != ' ' && *p != '\t' && *p != HIST; --p); + + /* + * If we found a history character, go expand it. + */ + if (*p == HIST) + c_excl(p); + Refresh(); +} + +/* + * demi-PUBLIC routines. Any routine that is of type CCRETVAL is an + * entry point, called from the CcKeyMap indirected into the + * CcFuncTbl array. + */ + +/*VARARGS*/ +CCRETVAL +v_cmd_mode() +{ + replacemode = 0; + c_alternativ_key_map(1); + if (Cursor > InputBuf) + Cursor--; + RefCursor(); + return (CC_NORM); +} + +/*VARARGS*/ +CCRETVAL +e_unassigned() +{ /* bound to keys that arn't really assigned */ + Beep(); + flush(); + return (CC_NORM); +} + +/*VARARGS*/ +CCRETVAL +e_insert(c) + register Char c; +{ +#ifndef SHORT_STRINGS + c &= ASCII; /* no meta chars ever */ +#endif + + if (!c) + return (CC_ERROR); /* no NULs in the input ever!! */ + + if (LastChar + Argument >= InputLim) + return (CC_ERROR); /* end of buffer space */ + + if (Argument == 1) { /* optimize */ + if (replacemode == 1) + c_delafter(1); + else if (replacemode == 2) + c_delafter(1); + c_insert(1); + *Cursor++ = c; + DoingArg = 0; /* just in case */ + RefPlusOne(); /* fast refresh for one char. */ + if (replacemode == 2) + (void) v_cmd_mode(); + } + else { + if (replacemode == 1) + c_delafter(Argument); + else if (replacemode == 2) + c_delafter(Argument); + c_insert(Argument); + while (Argument--) + *Cursor++ = c; + Refresh(); + if (replacemode == 2) + (void) v_cmd_mode(); + } + return (CC_NORM); +} + +int +InsertStr(s) /* insert ASCIZ s at cursor (for complete) */ + Char *s; +{ + register int len; + + if ((len = Strlen(s)) <= 0) + return -1; + if (LastChar + len >= InputLim) + return -1; /* end of buffer space */ + + c_insert(len); + while (len--) + *Cursor++ = *s++; + return 0; +} + +void +DeleteBack(n) /* delete the n characters before . */ + int n; +{ + if (n <= 0) + return; + if (Cursor >= &InputBuf[n]) { + c_delbefore(n); /* delete before dot */ + Cursor -= n; + if (Cursor < InputBuf) + Cursor = InputBuf; /* bounds check */ + } +} + +/*VARARGS*/ +CCRETVAL +e_digit(c) /* gray magic here */ + register Char c; +{ + if (!Isdigit(c)) + return (CC_ERROR); /* no NULs in the input ever!! */ + + if (DoingArg) { /* if doing an arg, add this in... */ + if (LastCmd == F_ARGFOUR) /* if last command was ^U */ + Argument = c - '0'; + else { + if (Argument > 1000000) + return CC_ERROR; + Argument = (Argument * 10) + (c - '0'); + } + return (CC_ARGHACK); + } + else { + if (LastChar + 1 >= InputLim) + return CC_ERROR; /* end of buffer space */ + + c_insert(1); + *Cursor++ = c; + DoingArg = 0; /* just in case */ + RefPlusOne(); /* fast refresh for one char. */ + } + return (CC_NORM); +} + +/*VARARGS*/ +CCRETVAL +e_argdigit(c) /* for ESC-n */ + register Char c; +{ + c &= ASCII; + + if (!Isdigit(c)) + return (CC_ERROR); /* no NULs in the input ever!! */ + + if (DoingArg) { /* if doing an arg, add this in... */ + if (Argument > 1000000) + return CC_ERROR; + Argument = (Argument * 10) + (c - '0'); + } + else { /* else starting an argument */ + Argument = c - '0'; + DoingArg = 1; + } + return (CC_ARGHACK); +} + +/*VARARGS*/ +CCRETVAL +v_zero(c) /* command mode 0 for vi */ + register Char c; +{ + if (DoingArg) { /* if doing an arg, add this in... */ + if (Argument > 1000000) + return CC_ERROR; + Argument = (Argument * 10) + (c - '0'); + return (CC_ARGHACK); + } + else { /* else starting an argument */ + Cursor = InputBuf; + RefCursor(); /* move the cursor */ + return (CC_NORM); + } +} + +/*VARARGS*/ +CCRETVAL +e_newline() +{ /* always ignore argument */ + PastBottom(); + *LastChar++ = '\n'; /* for the benifit of CSH */ + *LastChar = '\0'; /* just in case */ + return (CC_NEWLINE); /* we must do a ResetInLine later */ +} + +/*VARARGS*/ +CCRETVAL +e_send_eof() +{ /* for when ^D is ONLY send-eof */ + PastBottom(); + *LastChar = '\0'; /* just in case */ +#ifdef notdef + ResetInLine(); /* reset the input pointers */ +#endif + return (CC_EOF); +} + +/*VARARGS*/ +CCRETVAL +e_complete() +{ + *LastChar = '\0'; /* just in case */ + return (CC_COMPLETE); +} + +/*VARARGS*/ +CCRETVAL +v_cm_complete() +{ + if (Cursor < LastChar) + Cursor++; + *LastChar = '\0'; /* just in case */ + return (CC_COMPLETE); +} + +/*VARARGS*/ +CCRETVAL +e_toggle_hist() +{ + struct Hist *hp; + int h; + + *LastChar = '\0'; /* just in case */ + + if (Hist_num <= 0) { + return CC_ERROR; + } + + hp = Histlist.Hnext; + if (hp == NULL) { /* this is only if no history */ + return (CC_ERROR); + } + + for (h = 1; h < Hist_num; h++) + hp = hp->Hnext; + + if (!Cur_HistLit) { + if (hp->histline) { + copyn(InputBuf, hp->histline, INBUFSIZ); + Cur_HistLit = 1; + } + else { + return CC_ERROR; + } + } + else { + (void) sprlex(InputBuf, &hp->Hlex); + Cur_HistLit = 0; + } + LastChar = InputBuf + Strlen(InputBuf); + if (LastChar > InputBuf) { + if (LastChar[-1] == '\n') + LastChar--; + if (LastChar[-1] == ' ') + LastChar--; + if (LastChar < InputBuf) + LastChar = InputBuf; + } + Cursor = LastChar; + + return (CC_REFRESH); +} + +/*VARARGS*/ +CCRETVAL +e_up_hist() +{ + struct Hist *hp; + int hnumcntr; + Char beep = 0; + + *LastChar = '\0'; /* just in case */ + + if (Hist_num == 0) { /* save the current buffer away */ + copyn(HistBuf, InputBuf, INBUFSIZ); + LastHist = HistBuf + (LastChar - InputBuf); + } + + hp = Histlist.Hnext; + if (hp == NULL) { /* this is only if no history */ + return (CC_ERROR); + } + + Hist_num += Argument; + for (hnumcntr = 1; hnumcntr < Hist_num; hnumcntr++) { + if ((hp->Hnext) == NULL) { + Hist_num = hnumcntr; + beep = 1; + break; + } + hp = hp->Hnext; + } + + if (HistLit && hp->histline) { + copyn(InputBuf, hp->histline, INBUFSIZ); + Cur_HistLit = 1; + } + else { + (void) sprlex(InputBuf, &hp->Hlex); + Cur_HistLit = 0; + } + LastChar = InputBuf + Strlen(InputBuf); + if (LastChar > InputBuf) { + if (LastChar[-1] == '\n') + LastChar--; + if (LastChar[-1] == ' ') + LastChar--; + if (LastChar < InputBuf) + LastChar = InputBuf; + } + Cursor = LastChar; + + Refresh(); + if (beep) + return (CC_ERROR); + else + return (CC_NORM); /* was CC_UP_HIST */ +} + +/*VARARGS*/ +CCRETVAL +e_d_hist() +{ + struct Hist *hp; + int hnumcntr; + + *LastChar = '\0'; /* just in case */ + + Hist_num -= Argument; + + if (Hist_num < 0) { + Hist_num = 0; + return (CC_ERROR); /* make it beep */ + } + + if (Hist_num == 0) { /* if really the current line */ + copyn(InputBuf, HistBuf, INBUFSIZ); + LastChar = InputBuf + (LastHist - HistBuf); + Cursor = LastChar; + return (CC_REFRESH); + } + + hp = Histlist.Hnext; + if (hp == NULL) + return (CC_ERROR); + + for (hnumcntr = 1; hnumcntr < Hist_num; hnumcntr++) { + if ((hp->Hnext) == NULL) { + Hist_num = hnumcntr; + return (CC_ERROR); + } + hp = hp->Hnext; + } + + if (HistLit && hp->histline) { + copyn(InputBuf, hp->histline, INBUFSIZ); + Cur_HistLit = 1; + } + else { + (void) sprlex(InputBuf, &hp->Hlex); + Cur_HistLit = 0; + } + LastChar = InputBuf + Strlen(InputBuf); + if (LastChar > InputBuf) { + if (LastChar[-1] == '\n') + LastChar--; + if (LastChar[-1] == ' ') + LastChar--; + if (LastChar < InputBuf) + LastChar = InputBuf; + } + Cursor = LastChar; + + return (CC_REFRESH); +} + + + +static Char patbuf[INBUFSIZ]; +static int patlen = 0; +/* + * c_hmatch() return True if the pattern matches the prefix + */ +static int +c_hmatch(str) +Char *str; +{ + if (Strncmp(patbuf, str, patlen) == 0) + return 1; + return Gmatch(str, patbuf); +} + +/* + * c_hsetpat(): Set the history seatch pattern + */ +static void +c_hsetpat() +{ + if (LastCmd != F_UP_SEARCH_HIST && LastCmd != F_DOWN_SEARCH_HIST) { + patlen = Cursor - InputBuf; + if (patlen >= INBUFSIZ) patlen = INBUFSIZ -1; + (void) Strncpy(patbuf, InputBuf, patlen); + patbuf[patlen] = '\0'; + } +#ifdef SDEBUG + xprintf("\nHist_num = %d\n", Hist_num); + xprintf("patlen = %d\n", patlen); + xprintf("patbuf = \"%s\"\n", short2str(patbuf)); +#endif +} + +/*VARARGS*/ +CCRETVAL +e_up_search_hist() +{ + struct Hist *hp; + int h; + bool found = 0; + + *LastChar = '\0'; /* just in case */ + if (Hist_num < 0) { + xprintf("tcsh: e_up_search_hist(): Hist_num < 0; resetting.\n"); + Hist_num = 0; + return (CC_ERROR); + } + + if (Hist_num == 0) { + copyn(HistBuf, InputBuf, INBUFSIZ); + LastHist = HistBuf + (LastChar - InputBuf); + } + + hp = Histlist.Hnext; + if (hp == NULL) + return (CC_ERROR); + + c_hsetpat(); + for (h = 1; h <= Hist_num; h++) + hp = hp->Hnext; + + while (hp != NULL) { + if (hp->histline == NULL) { + Char sbuf[BUFSIZ]; + hp->histline = Strsave(sprlex(sbuf, &hp->Hlex)); + } +#ifdef SDEBUG + xprintf("Comparing with \"%s\"\n", short2str(hp->histline)); +#endif + if (c_hmatch(hp->histline)) { + found++; + break; + } + h++; + hp = hp->Hnext; + } + if (!found) + return (CC_ERROR); + + Hist_num = h; + + if (HistLit && hp->histline) { + copyn(InputBuf, hp->histline, INBUFSIZ); + Cur_HistLit = 1; + } + else { + (void) sprlex(InputBuf, &hp->Hlex); + Cur_HistLit = 0; + } + LastChar = InputBuf + Strlen(InputBuf); + if (LastChar > InputBuf) { + if (LastChar[-1] == '\n') + LastChar--; + if (LastChar[-1] == ' ') + LastChar--; + if (LastChar < InputBuf) + LastChar = InputBuf; + } + Cursor = LastChar; + return (CC_REFRESH); +} + +/*VARARGS*/ +CCRETVAL +e_d_search_hist() +{ + struct Hist *hp, *hpt = NULL; + int h; + bool found = 0; + + *LastChar = '\0'; /* just in case */ + + if (Hist_num == 0) + return (CC_ERROR); + + hp = Histlist.Hnext; + if (hp == 0) + return (CC_ERROR); + + c_hsetpat(); + + for (h = 1; h < Hist_num && hp; h++) { + if (hp->histline == NULL) { + Char sbuf[BUFSIZ]; + hp->histline = Strsave(sprlex(sbuf, &hp->Hlex)); + } +#ifdef SDEBUG + xprintf("Comparing with \"%s\"\n", short2str(hp->histline)); +#endif + if (c_hmatch(hp->histline)) { + found = h; + hpt = hp; + } + hp = hp->Hnext; + } + if (!found) { /* is it the current history number? */ + if (c_hmatch(HistBuf)) { + copyn(InputBuf, HistBuf, INBUFSIZ); + LastChar = InputBuf + (LastHist - HistBuf); + Hist_num = 0; + Cursor = LastChar; + return (CC_REFRESH); + } + else { + return (CC_ERROR); + } + } + + Hist_num = found; + hp = hpt; + + if (HistLit && hp->histline) { + copyn(InputBuf, hp->histline, INBUFSIZ); + Cur_HistLit = 1; + } + else { + (void) sprlex(InputBuf, &hp->Hlex); + Cur_HistLit = 0; + } + LastChar = InputBuf + Strlen(InputBuf); + if (LastChar > InputBuf) { + if (LastChar[-1] == '\n') + LastChar--; + if (LastChar[-1] == ' ') + LastChar--; + if (LastChar < InputBuf) + LastChar = InputBuf; + } + Cursor = LastChar; + + return (CC_REFRESH); +} + +/*VARARGS*/ +CCRETVAL +e_helpme() +{ + PastBottom(); + *LastChar = '\0'; /* just in case */ + return (CC_HELPME); +} + +/*VARARGS*/ +CCRETVAL +e_corr() +{ + *LastChar = '\0'; /* just in case */ + return (CC_CORRECT); +} + +/*VARARGS*/ +CCRETVAL +e_corrl() +{ + *LastChar = '\0'; /* just in case */ + return (CC_CORRECT_L); +} + +/*VARARGS*/ +CCRETVAL +e_run_fg_editor() +{ + register struct process *pp; + extern bool tellwhat; + + if ((pp = find_stop_ed()) != PNULL) { + /* save our editor state so we can restore it */ + tellwhat = 1; + copyn(WhichBuf, InputBuf, INBUFSIZ); + LastWhich = WhichBuf + (LastChar - InputBuf); + CursWhich = WhichBuf + (Cursor - InputBuf); + HistWhich = Hist_num; + Hist_num = 0; /* for the history commands */ + + /* put the tty in a sane mode */ + PastBottom(); + (void) Cookedmode(); /* make sure the tty is set up correctly */ + + /* do it! */ + fg_proc_entry(pp); + + (void) Rawmode(); /* go on */ + Refresh(); + tellwhat = 0; + } + return (CC_NORM); +} + +/*VARARGS*/ +CCRETVAL +e_l_choices() +{ + PastBottom(); + *LastChar = '\0'; /* just in case */ + return (CC_LIST_CHOICES); +} + +/*VARARGS*/ +CCRETVAL +e_l_glob() +{ + PastBottom(); + *LastChar = '\0'; /* just in case */ + return (CC_LIST_GLOB); +} + +/*VARARGS*/ +CCRETVAL +e_ex_glob() +{ + *LastChar = '\0'; /* just in case */ + return (CC_EXPAND_GLOB); +} + +/*VARARGS*/ +CCRETVAL +e_ex_vars() +{ + *LastChar = '\0'; /* just in case */ + return (CC_EXPAND_VARS); +} + +/*VARARGS*/ +CCRETVAL +e_which() +{ /* do a fast command line which(1) */ + PastBottom(); + *LastChar = '\0'; /* just in case */ + return (CC_WHICH); +} + +/*VARARGS*/ +CCRETVAL +e_last_item() +{ /* insert the last element of the prev. cmd */ + register Char *cp; + register struct Hist *hp; + register struct wordent *wp, *firstp; + register int i; + + if (Argument <= 0) + return (CC_ERROR); + + hp = Histlist.Hnext; + if (hp == NULL) { /* this is only if no history */ + return (CC_ERROR); + } + + wp = (hp->Hlex).prev; + + if (wp->prev == (struct wordent *) NULL) + return (CC_ERROR); /* an empty history entry */ + + firstp = (hp->Hlex).next; + + for (i = 0; i < Argument; i++) { /* back up arg words in lex */ + wp = wp->prev; + if (wp == firstp) + break; + } + + while (i > 0) { + cp = wp->word; + + if (!cp) + return (CC_ERROR); + + if (InsertStr(cp)) + return (CC_ERROR); + + wp = wp->next; + i--; + } + + return (CC_REFRESH); +} + +/*VARARGS*/ +CCRETVAL +e_yank_kill() +{ /* almost like GnuEmacs */ + register Char *kp, *cp; + + if (LastKill == KillBuf) /* if zero content */ + return (CC_ERROR); + + if (LastChar + (LastKill - KillBuf) >= InputLim) + return (CC_ERROR); /* end of buffer space */ + + /* else */ + Mark = Cursor; /* set the mark */ + cp = Cursor; /* for speed */ + + c_insert(LastKill - KillBuf); /* open the space, */ + for (kp = KillBuf; kp < LastKill; kp++) /* copy the chars */ + *cp++ = *kp; + + if (Argument == 1) /* if an arg, cursor at beginning */ + Cursor = cp; /* else cursor at end */ + + return (CC_REFRESH); +} + +/*VARARGS*/ +CCRETVAL +e_delprev() +{ + if (Cursor > InputBuf) { + c_delbefore(Argument); /* delete before dot */ + Cursor -= Argument; + if (Cursor < InputBuf) + Cursor = InputBuf; /* bounds check */ + return (CC_REFRESH); + } + else { + return (CC_ERROR); + } +} + +/*VARARGS*/ +CCRETVAL +e_dwrdprev() +{ + register Char *cp, *p, *kp; + + if (Cursor == InputBuf) + return (CC_ERROR); + /* else */ + + cp = c_prev_word(Cursor, InputBuf, Argument); + + for (p = cp, kp = KillBuf; p < Cursor; p++) /* save the text */ + *kp++ = *p; + LastKill = kp; + + c_delbefore(Cursor - cp); /* delete before dot */ + Cursor = cp; + if (Cursor < InputBuf) + Cursor = InputBuf; /* bounds check */ + return (CC_REFRESH); +} + +/*VARARGS*/ +CCRETVAL +e_delnext() +{ + if (Cursor == LastChar) { /* if I'm at the end */ + if (Cursor == InputBuf && !VImode) { + /* if I'm also at the beginning */ + so_write(STReof, 4);/* then do a EOF */ + flush(); + return (CC_EOF); + } + else { + return (CC_ERROR); + } + } + else { + c_delafter(Argument); /* delete after dot */ + if (Cursor > LastChar) + Cursor = LastChar; /* bounds check */ + return (CC_REFRESH); + } +} + +/*VARARGS*/ +CCRETVAL +e_l_delnext() +{ + if (Cursor == LastChar) { /* if I'm at the end */ + if (Cursor == InputBuf) { /* if I'm also at the beginning */ + so_write(STReof, 4);/* then do a EOF */ + flush(); + return (CC_EOF); + } + else { + PastBottom(); + *LastChar = '\0'; /* just in case */ + return (CC_LIST_CHOICES); + } + } + else { + c_delafter(Argument); /* delete after dot */ + if (Cursor > LastChar) + Cursor = LastChar; /* bounds check */ + return (CC_REFRESH); + } +} + +CCRETVAL +e_l_eof() +{ + if (Cursor == LastChar && Cursor == InputBuf) { + so_write(STReof, 4); /* then do a EOF */ + flush(); + return (CC_EOF); + } + else { + PastBottom(); + *LastChar = '\0'; /* just in case */ + return (CC_LIST_CHOICES); + } +} + +/*VARARGS*/ +CCRETVAL +e_dwrdnext() +{ + register Char *cp, *p, *kp; + + if (Cursor == LastChar) + return (CC_ERROR); + /* else */ + + cp = c_next_word(Cursor, LastChar, Argument); + + for (p = Cursor, kp = KillBuf; p < cp; p++) /* save the text */ + *kp++ = *p; + LastKill = kp; + + c_delafter(cp - Cursor); /* delete after dot */ + /* Cursor = Cursor; */ + if (Cursor > LastChar) + Cursor = LastChar; /* bounds check */ + return (CC_REFRESH); +} + +/*VARARGS*/ +CCRETVAL +e_toend() +{ + Cursor = LastChar; + RefCursor(); /* move the cursor */ + return (CC_NORM); +} + +/*VARARGS*/ +CCRETVAL +e_tobeg() +{ + Cursor = InputBuf; + RefCursor(); /* move the cursor */ + return (CC_NORM); +} + +/*VARARGS*/ +CCRETVAL +e_killend() +{ + register Char *kp, *cp; + + cp = Cursor; + kp = KillBuf; + while (cp < LastChar) + *kp++ = *cp++; /* copy it */ + LastKill = kp; + LastChar = Cursor; /* zap! -- delete to end */ + return (CC_REFRESH); +} + + +/*VARARGS*/ +CCRETVAL +e_killbeg() +{ + register Char *kp, *cp; + + cp = InputBuf; + kp = KillBuf; + while (cp < Cursor) + *kp++ = *cp++; /* copy it */ + LastKill = kp; + c_delbefore(Cursor - InputBuf); + Cursor = InputBuf; /* zap! */ + return (CC_REFRESH); +} + +/*VARARGS*/ +CCRETVAL +e_killall() +{ + register Char *kp, *cp; + + cp = InputBuf; + kp = KillBuf; + while (cp < LastChar) + *kp++ = *cp++; /* copy it */ + LastKill = kp; + LastChar = InputBuf; /* zap! -- delete all of it */ + Cursor = InputBuf; + return (CC_REFRESH); +} + +/*VARARGS*/ +CCRETVAL +e_killregion() +{ + register Char *kp, *cp; + + if (!Mark) + return (CC_ERROR); + + if (Mark > Cursor) { + cp = Cursor; + kp = KillBuf; + while (cp < Mark) + *kp++ = *cp++; /* copy it */ + LastKill = kp; + c_delafter(cp - Cursor);/* delete it */ + } + else { /* mark is before cursor */ + cp = Mark; + kp = KillBuf; + while (cp < Cursor) + *kp++ = *cp++; /* copy it */ + LastKill = kp; + c_delbefore(cp - Mark); + Cursor = Mark; + } + return (CC_REFRESH); +} + +/*VARARGS*/ +CCRETVAL +e_copyregion() +{ + register Char *kp, *cp; + + if (!Mark) + return (CC_ERROR); + + if (Mark > Cursor) { + cp = Cursor; + kp = KillBuf; + while (cp < Mark) + *kp++ = *cp++; /* copy it */ + LastKill = kp; + } + else { /* mark is before cursor */ + cp = Mark; + kp = KillBuf; + while (cp < Cursor) + *kp++ = *cp++; /* copy it */ + LastKill = kp; + } + return (CC_NORM); /* don't even need to Refresh() */ +} + +/*VARARGS*/ +CCRETVAL +e_charswitch() +{ + register Char c; + + if (Cursor < LastChar) { + if (LastChar <= &InputBuf[1]) { + return (CC_ERROR); + } + else { + Cursor++; + } + } + if (Cursor > &InputBuf[1]) {/* must have at least two chars entered */ + c = Cursor[-2]; + Cursor[-2] = Cursor[-1]; + Cursor[-1] = c; + return (CC_REFRESH); + } + else { + return (CC_ERROR); + } +} + +/*VARARGS*/ +CCRETVAL +e_gcharswitch() +{ /* gosmacs style ^T */ + register Char c; + + if (Cursor > &InputBuf[1]) {/* must have at least two chars entered */ + c = Cursor[-2]; + Cursor[-2] = Cursor[-1]; + Cursor[-1] = c; + return (CC_REFRESH); + } + else { + return (CC_ERROR); + } +} + +/*VARARGS*/ +CCRETVAL +e_charback() +{ + if (Cursor > InputBuf) { + Cursor -= Argument; + if (Cursor < InputBuf) + Cursor = InputBuf; + RefCursor(); + return (CC_NORM); + } + else { + return (CC_ERROR); + } +} + +/*VARARGS*/ +CCRETVAL +e_wordback() +{ + if (Cursor == InputBuf) + return (CC_ERROR); + /* else */ + + Cursor = c_prev_word(Cursor, InputBuf, Argument); /* does a bounds check */ + + RefCursor(); + return (CC_NORM); +} + +/*VARARGS*/ +CCRETVAL +e_charfwd() +{ + if (Cursor < LastChar) { + Cursor += Argument; + if (Cursor > LastChar) + Cursor = LastChar; + RefCursor(); + return (CC_NORM); + } + else { + return (CC_ERROR); + } +} + +/*VARARGS*/ +CCRETVAL +e_wordfwd() +{ + if (Cursor == LastChar) + return (CC_ERROR); + /* else */ + + Cursor = c_next_word(Cursor, LastChar, Argument); + + RefCursor(); + return (CC_NORM); +} + +/*VARARGS*/ +CCRETVAL +v_wordbegnext() +{ + if (Cursor == LastChar) + return (CC_ERROR); + /* else */ + + Cursor = c_beg_next_word(Cursor, LastChar, Argument); + + RefCursor(); + return (CC_NORM); +} + +#ifdef COMMENT +/* by: Brian Allison */ +static void +c_get_word(begin, end) + Char **begin; + Char **end; +{ + Char *cp; + + cp = &Cursor[0]; + while (Argument--) { + while ((cp <= LastChar) && (isword(*cp))) + cp++; + *end = --cp; + while ((cp >= InputBuf) && (isword(*cp))) + cp--; + *begin = ++cp; + } +} +#endif /* COMMENT */ + +/*VARARGS*/ +CCRETVAL +e_uppercase() +{ + Char *cp, *end; + + end = c_next_word(Cursor, LastChar, Argument); + + for (cp = Cursor; cp < end; cp++) /* PWP: was cp=begin */ + if (Islower(*cp)) + *cp = Toupper(*cp); + + Cursor = end; + if (Cursor > LastChar) + Cursor = LastChar; + return (CC_REFRESH); +} + + +/*VARARGS*/ +CCRETVAL +e_capitolcase() +{ + Char *cp, *end; + + end = c_next_word(Cursor, LastChar, Argument); + + cp = Cursor; + for (; cp < end; cp++) { + if (Isalpha(*cp)) { + if (Islower(*cp)) + *cp = Toupper(*cp); + cp++; + break; + } + } + for (; cp < end; cp++) + if (Isupper(*cp)) + *cp = Tolower(*cp); + + Cursor = end; + if (Cursor > LastChar) + Cursor = LastChar; + return (CC_REFRESH); +} + +/*VARARGS*/ +CCRETVAL +e_lowercase() +{ + Char *cp, *end; + + end = c_next_word(Cursor, LastChar, Argument); + + for (cp = Cursor; cp < end; cp++) + if (Isupper(*cp)) + *cp = Tolower(*cp); + + Cursor = end; + if (Cursor > LastChar) + Cursor = LastChar; + return (CC_REFRESH); +} + + +/*VARARGS*/ +CCRETVAL +e_set_mark() +{ + Mark = Cursor; + return (CC_NORM); +} + +/*VARARGS*/ +CCRETVAL +e_exchange_mark() +{ + register Char *cp; + + cp = Cursor; + Cursor = Mark; + Mark = cp; + RefCursor(); + return (CC_NORM); +} + +/*VARARGS*/ +CCRETVAL +e_argfour() +{ /* multiply current argument by 4 */ + if (Argument > 1000000) + return CC_ERROR; + DoingArg = 1; + Argument *= 4; + return (CC_ARGHACK); +} + +/*VARARGS*/ +CCRETVAL +e_quote() +{ + Char ch; + int num; + + QModeOn(); + num = G_N_Char(&ch); + QModeOff(); + if (num == 1) + return e_insert(ch); + else + return e_send_eof(); +} + +/*VARARGS*/ +CCRETVAL +e_metanext() +{ + MetaNext = 1; + return (CC_ARGHACK); /* preserve argument */ +} + +#ifdef notdef +/*VARARGS*/ +CCRETVAL +e_extendnext() +{ + Cur_KeyMap = CcAltMap; + return (CC_ARGHACK); /* preserve argument */ +} + +#endif + +/*VARARGS*/ +CCRETVAL +v_insbeg() +{ /* move to beginning of line and start vi + * insert mode */ + Cursor = InputBuf; + RefCursor(); /* move the cursor */ + c_alternativ_key_map(0); + return (CC_NORM); +} + +/*VARARGS*/ +CCRETVAL +v_replone() +{ /* vi mode overwrite one character */ + c_alternativ_key_map(0); + replacemode = 2; + return (CC_NORM); +} + +/*VARARGS*/ +CCRETVAL +v_replmode() +{ /* vi mode start overwriting */ + c_alternativ_key_map(0); + replacemode = 1; + return (CC_NORM); +} + +/*VARARGS*/ +CCRETVAL +v_s_char() +{ /* vi mode substitute for one char */ + c_delafter(Argument); + c_alternativ_key_map(0); + return (CC_REFRESH); +} + +/*VARARGS*/ +CCRETVAL +v_s_line() +{ /* vi mode replace whole line */ + (void) e_killall(); + c_alternativ_key_map(0); + return (CC_NORM); +} + +/*VARARGS*/ +CCRETVAL +v_chgtoend() +{ /* vi mode change to end of line */ + (void) e_killend(); + c_alternativ_key_map(0); + return (CC_REFRESH); +} + +/*VARARGS*/ +CCRETVAL +v_insert() +{ /* vi mode start inserting */ + c_alternativ_key_map(0); + return (CC_NORM); +} + +/*VARARGS*/ +CCRETVAL +v_add() +{ /* vi mode start adding */ + c_alternativ_key_map(0); + if (Cursor < LastChar) { + Cursor++; + if (Cursor > LastChar) + Cursor = LastChar; + RefCursor(); + } + return (CC_NORM); +} + +/*VARARGS*/ +CCRETVAL +v_addend() +{ /* vi mode to add at end of line */ + c_alternativ_key_map(0); + Cursor = LastChar; + RefCursor(); + return (CC_NORM); +} + +/*VARARGS*/ +CCRETVAL +v_change_case() +{ + char c; + + if (Cursor < LastChar) { + c = *Cursor; + if (Isupper(c)) + *Cursor++ = Tolower(c); + else if (Islower(c)) + *Cursor++ = Toupper(c); + else + Cursor++; + RefPlusOne(); /* fast refresh for one char */ + return (CC_NORM); + } + return (CC_ERROR); +} + +/*VARARGS*/ +CCRETVAL +e_expand() +{ + register Char *p; + extern bool justpr; + + for (p = InputBuf; Isspace(*p); p++); + if (p == LastChar) + return (CC_ERROR); + + justpr++; + Expand++; + return (e_newline()); +} + +/*VARARGS*/ +CCRETVAL +e_startover() +{ /* erase all of current line, start again */ + ResetInLine(); /* reset the input pointers */ + return (CC_REFRESH); +} + +/*VARARGS*/ +CCRETVAL +e_redisp() +{ + ClearLines(); + ClearDisp(); + return (CC_REFRESH); +} + +/*VARARGS*/ +CCRETVAL +e_cleardisp() +{ + ClearScreen(); /* clear the whole real screen */ + ClearDisp(); /* reset everything */ + return (CC_REFRESH); +} + +/*VARARGS*/ +CCRETVAL +e_t_int() +{ + /* do no editing */ + return (CC_NORM); +} + +/*VARARGS*/ +CCRETVAL +e_insovr() +{ + replacemode = !replacemode; + return (CC_NORM); +} + +/*VARARGS*/ +CCRETVAL +e_t_dsusp() +{ + /* do no editing */ + return (CC_NORM); +} + +/*VARARGS*/ +CCRETVAL +e_t_flusho() +{ + /* do no editing */ + return (CC_NORM); +} + +/*VARARGS*/ +CCRETVAL +e_t_quit() +{ + /* do no editing */ + return (CC_NORM); +} + +/*VARARGS*/ +CCRETVAL +e_t_tsusp() +{ + /* do no editing */ + return (CC_NORM); +} + +/*VARARGS*/ +CCRETVAL +e_t_stopo() +{ + /* do no editing */ + return (CC_NORM); +} + +/*VARARGS*/ +CCRETVAL +e_ex_history() +{ + *LastChar = '\0'; /* just in case */ + c_substitute(); + return (CC_NORM); +} + +/*VARARGS*/ +CCRETVAL +e_magic_space() +{ + *LastChar = '\0'; /* just in case */ + c_substitute(); + return (e_insert(' ')); +} + +/*VARARGS*/ +CCRETVAL +e_copyprev() +{ + register Char *cp, *oldc, *dp; + + if (Cursor == InputBuf) + return (CC_ERROR); + /* else */ + + oldc = Cursor; + /* does a bounds check */ + cp = c_prev_word(Cursor, InputBuf, Argument); + + c_insert(oldc - cp); + for (dp = oldc; cp < oldc && dp < LastChar; cp++) + *dp++ = *cp; + + Cursor = dp; /* put cursor at end */ + + return (CC_REFRESH); +} + +/*VARARGS*/ +CCRETVAL +e_t_starto() +{ + /* do no editing */ + return (CC_NORM); +} + +#ifdef notdef +void +MoveCursor(n) /* move cursor + right - left char */ + int n; +{ + Cursor = Cursor + n; + if (Cursor < InputBuf) + Cursor = InputBuf; + if (Cursor > LastChar) + Cursor = LastChar; + return; +} + +Char * +GetCursor() +{ + return (Cursor); +} + +int +PutCursor(p) + Char *p; +{ + if (p < InputBuf || p > LastChar) + return 1; /* Error */ + Cursor = p; + return 0; +} +#endif diff --git a/bin/tcsh/ed.decls.h b/bin/tcsh/ed.decls.h new file mode 100644 index 0000000..1a3e1c8 --- /dev/null +++ b/bin/tcsh/ed.decls.h @@ -0,0 +1,124 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/ed.decls.h,v 3.0 1991/07/04 21:49:28 christos Exp $ */ +/* + * ed.decls.h: Editor external definitions + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#ifndef _h_ed_decls +#define _h_ed_decls + +/* + * ed.chared.c + */ +extern int InsertStr __P((Char *)); +extern void DeleteBack __P((int)); + +/* + * ed.init.c + */ +extern void check_window_size __P((int)); +#ifdef SIG_WINDOW +extern sigret_t window_change __P((int)); +#endif +extern void ed_I __P((void)); +extern int Cookedmode __P((void)); +extern int Rawmode __P((void)); +extern void ed_set_tty_eight_bit __P((void)); + +extern void QModeOn __P((void)); +extern void QModeOff __P((void)); +extern void ResetInLine __P((void)); +extern int Load_input_line __P((void)); + +/* + * ed.screen.c + */ +extern void SetAttributes __P((int)); +extern void so_write __P((Char *, int)); +extern void ClearScreen __P((void)); +extern void MoveToLine __P((int)); +extern void MoveToChar __P((int)); +extern void ClearEOL __P((int)); +extern void Insert_write __P((Char *, int)); +extern void DeleteChars __P((int)); +extern void TellTC __P((char *)); +extern void SetTC __P((char *, char *)); +extern void EchoTC __P((Char **)); +extern void BindArrowKeys __P((void)); +extern void Beep __P((void)); +extern int CanWeTab __P((void)); +extern void ChangeSize __P((int, int)); +extern int GetSize __P((int *, int *)); +extern void ClearToBottom __P((void)); +extern void GetTermCaps __P((void)); + +/* + * ed.defns.c + */ +extern void ed_INLSMaps __P((void)); +#ifdef DEBUG_EDIT +extern void CheckMaps __P((void)); +#endif +extern void ed_IMaps __P((void)); +extern void ed_IEmacsMaps __P((void)); +extern void ed_IVIMaps __P((void)); + +/* + * ed.inputl.c + */ +extern int Inputl __P((void)); +extern int G_N_Char __P((Char *)); +extern void PushMacro __P((Char *)); + +/* + * ed.refresh.c + */ +extern void ClearLines __P((void)); +extern void ClearDisp __P((void)); +extern void Refresh __P((void)); +extern void RefCursor __P((void)); +extern void RefPlusOne __P((void)); +extern void PastBottom __P((void)); + +/* + * ed.xmap.c + */ +extern void AddXKeyCmd __P((Char *, int)); +extern void AddXkey __P((Char *, Char *)); +extern void ClearXkey __P((KEYCMD *, Char *)); +extern int GetXkey __P((Char *, Char **)); +extern void ResetXmap __P((int)); +extern int DeleteXkey __P((Char *)); +extern void PrintXkey __P((Char *)); + +#endif /* _h_ed_decls */ diff --git a/bin/tcsh/ed.defns.c b/bin/tcsh/ed.defns.c new file mode 100644 index 0000000..8ccf905 --- /dev/null +++ b/bin/tcsh/ed.defns.c @@ -0,0 +1,1567 @@ +/* + * ed.defns.c: Editor function definitions and initialization + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#include "config.h" +#if !defined(lint) && !defined(pdp11) +static char *rcsid() + { return "$Id: ed.defns.c,v 3.0.1 1996/04/04 21:49:28 sms Exp $"; } +#endif + +#include "sh.h" +#include "ed.h" + +extern CCRETVAL e_unassigned __P((void)); +extern CCRETVAL e_insert __P((void)); +extern CCRETVAL e_newline __P((void)); +extern CCRETVAL e_delprev __P((void)); +extern CCRETVAL e_delnext __P((void)); +extern CCRETVAL e_l_delnext __P((void)); /* for ^D */ +extern CCRETVAL e_toend __P((void)); +extern CCRETVAL e_tobeg __P((void)); +extern CCRETVAL e_charback __P((void)); +extern CCRETVAL e_charfwd __P((void)); +extern CCRETVAL e_quote __P((void)); +extern CCRETVAL e_startover __P((void)); +extern CCRETVAL e_redisp __P((void)); +extern CCRETVAL e_wordback __P((void)); +extern CCRETVAL e_wordfwd __P((void)); +extern CCRETVAL v_wordbegnext __P((void)); +extern CCRETVAL e_uppercase __P((void)); +extern CCRETVAL e_lowercase __P((void)); +extern CCRETVAL e_capitolcase __P((void)); +extern CCRETVAL e_cleardisp __P((void)); +extern CCRETVAL e_complete __P((void)); +extern CCRETVAL e_corr __P((void)); +extern CCRETVAL e_corrl __P((void)); +extern CCRETVAL e_up_hist __P((void)); +extern CCRETVAL e_d_hist __P((void)); +extern CCRETVAL e_up_search_hist __P((void)); +extern CCRETVAL e_d_search_hist __P((void)); +extern CCRETVAL e_helpme __P((void)); +extern CCRETVAL e_l_choices __P((void)); +extern CCRETVAL e_dwrdprev __P((void)); +extern CCRETVAL e_dwrdnext __P((void)); +extern CCRETVAL e_digit __P((void)); +extern CCRETVAL e_argdigit __P((void)); +extern CCRETVAL v_zero __P((void)); +extern CCRETVAL e_killend __P((void)); +extern CCRETVAL e_killbeg __P((void)); +extern CCRETVAL e_metanext __P((void)); +#ifdef notdef +extern CCRETVAL e_extendnext __P((void)); +#endif +extern CCRETVAL e_send_eof __P((void)); +extern CCRETVAL e_charswitch __P((void)); +extern CCRETVAL e_gcharswitch __P((void)); +extern CCRETVAL e_which __P((void)); +extern CCRETVAL e_yank_kill __P((void)); +extern CCRETVAL e_t_dsusp __P((void)); +extern CCRETVAL e_t_flusho __P((void)); +extern CCRETVAL e_t_quit __P((void)); +extern CCRETVAL e_t_tsusp __P((void)); +extern CCRETVAL e_t_stopo __P((void)); +extern CCRETVAL e_t_starto __P((void)); +extern CCRETVAL e_argfour __P((void)); +extern CCRETVAL e_set_mark __P((void)); +extern CCRETVAL e_exchange_mark __P((void)); +extern CCRETVAL e_last_item __P((void)); +extern CCRETVAL v_cmd_mode __P((void)); +extern CCRETVAL v_insert __P((void)); +extern CCRETVAL v_replmode __P((void)); +extern CCRETVAL v_replone __P((void)); +extern CCRETVAL v_s_line __P((void)); +extern CCRETVAL v_s_char __P((void)); +extern CCRETVAL v_add __P((void)); +extern CCRETVAL v_addend __P((void)); +extern CCRETVAL v_insbeg __P((void)); +extern CCRETVAL v_chgtoend __P((void)); +extern CCRETVAL e_killregion __P((void)); +extern CCRETVAL e_killall __P((void)); +extern CCRETVAL e_copyregion __P((void)); +extern CCRETVAL e_t_int __P((void)); +extern CCRETVAL e_run_fg_editor __P((void)); +extern CCRETVAL e_l_eof __P((void)); +extern CCRETVAL e_ex_history __P((void)); +extern CCRETVAL e_magic_space __P((void)); +extern CCRETVAL e_l_glob __P((void)); +extern CCRETVAL e_ex_glob __P((void)); +extern CCRETVAL e_insovr __P((void)); +extern CCRETVAL v_cm_complete __P((void)); +extern CCRETVAL e_copyprev __P((void)); +extern CCRETVAL v_change_case __P((void)); +extern CCRETVAL e_expand __P((void)); +extern CCRETVAL e_ex_vars __P((void)); +extern CCRETVAL e_toggle_hist __P((void)); + + +static void ed_IMetaBindings __P((void)); + +PFCmd CcFuncTbl[] = { /* table of available commands */ + e_unassigned, +/* no #define here -- this is a dummy to detect initing of the key map */ + e_unassigned, +#define F_UNASSIGNED 1 + e_insert, +#define F_INSERT 2 + e_newline, +#define F_NEWLINE 3 + e_delprev, +#define F_DELPREV 4 + e_delnext, +#define F_DELNEXT 5 + e_toend, +#define F_TOEND 6 + e_tobeg, +#define F_TOBEG 7 + e_charback, +#define F_CHARBACK 8 + e_charfwd, +#define F_CHARFWD 9 + e_quote, +#define F_QUOTE 10 + e_startover, +#define F_STARTOVER 11 + e_redisp, +#define F_REDISP 12 + e_t_int, +#define F_TTY_INT 13 + e_wordback, +#define F_WORDBACK 14 + e_wordfwd, +#define F_WORDFWD 15 + e_cleardisp, +#define F_CLEARDISP 16 + e_complete, +#define F_COMPLETE 17 + e_corr, +#define F_CORRECT 18 + e_up_hist, +#define F_UP_HIST 19 + e_d_hist, +#define F_DOWN_HIST 20 + e_up_search_hist, +#define F_UP_SEARCH_HIST 21 + e_d_search_hist, +#define F_DOWN_SEARCH_HIST 22 + e_helpme, +#define F_HELPME 23 + e_l_choices, +#define F_LIST_CHOICES 24 + e_dwrdprev, +#define F_DELWORDPREV 25 + e_dwrdnext, +#define F_DELWORDNEXT 26 + e_digit, +#define F_DIGIT 27 + e_killend, +#define F_KILLEND 28 + e_killbeg, +#define F_KILLBEG 29 + e_metanext, +#define F_METANEXT 30 + e_send_eof, +#define F_SEND_EOF 31 + e_charswitch, +#define F_CHARSWITCH 32 + e_which, +#define F_WHICH 33 + e_yank_kill, +#define F_YANK_KILL 34 + e_t_dsusp, +#define F_TTY_DSUSP 35 + e_t_flusho, +#define F_TTY_FLUSHO 36 + e_t_quit, +#define F_TTY_QUIT 37 + e_t_tsusp, +#define F_TTY_TSUSP 38 + e_t_stopo, +#define F_TTY_STOPO 39 + e_t_starto, +#define F_TTY_STARTO 40 + e_argfour, +#define F_ARGFOUR 41 + e_set_mark, +#define F_SET_MARK 42 + e_exchange_mark, +#define F_EXCHANGE_MARK 43 + e_last_item, +#define F_LAST_ITEM 44 + e_l_delnext, +#define F_LIST_DELNEXT 45 + v_cmd_mode, +#define V_CMD_MODE 46 + v_insert, +#define V_INSERT 47 + e_argdigit, +#define F_ARGDIGIT 48 + e_killregion, +#define F_KILLREGION 49 + e_copyregion, +#define F_COPYREGION 50 + e_gcharswitch, +#define F_GCHARSWITCH 51 + e_run_fg_editor, +#define F_RUN_FG_EDITOR 52 + e_unassigned, /* place holder for sequence lead in character */ +#define F_XKEY 53 + e_uppercase, +#define F_CASEUPPER 54 + e_lowercase, +#define F_CASELOWER 55 + e_capitolcase, +#define F_CASECAPITAL 56 + v_zero, +#define V_ZERO 57 + v_add, +#define V_ADD 58 + v_addend, +#define V_ADDEND 59 + v_wordbegnext, +#define V_WORDBEGNEXT 60 + e_killall, +#define F_KILLALL 61 + e_unassigned, +/* F_EXTENDNEXT removed */ + v_insbeg, +#define V_INSBEG 63 + v_replmode, +#define V_REPLMODE 64 + v_replone, +#define V_REPLONE 65 + v_s_line, +#define V_SUBSTLINE 66 + v_s_char, +#define V_SUBSTCHAR 67 + v_chgtoend, +#define V_CHGTOEND 68 + e_l_eof, +#define F_LIST_EOF 69 + e_l_glob, +#define F_LIST_GLOB 70 + e_ex_history, +#define F_EXPAND_HISTORY 71 + e_magic_space, +#define F_MAGIC_SPACE 72 + e_insovr, +#define F_INSOVR 73 + v_cm_complete, +#define V_CM_COMPLETE 74 + e_copyprev, +#define F_COPYPREV 75 + e_corrl, +#define F_CORRECT_L 76 + e_ex_glob, +#define F_EXPAND_GLOB 77 + e_ex_vars, +#define F_EXPAND_VARS 78 + e_toggle_hist, +#define F_TOGGLE_HIST 79 + v_change_case, +#define V_CHGCASE 80 + e_expand, +#define F_EXPAND 81 + 0 /* DUMMY VALUE */ +#define F_NUM_FNS 82 +}; + +KEYCMD NumFuns = F_NUM_FNS; + +KEYCMD CcKeyMap[256]; /* the real key map */ +KEYCMD CcAltMap[256]; /* the alternative key map */ + +KEYCMD CcEmacsMap[] = { +/* keymap table, each index into above tbl; should be 256*sizeof(KEYCMD) + bytes long */ + + F_SET_MARK, /* ^@ */ + F_TOBEG, /* ^A */ + F_CHARBACK, /* ^B */ + F_TTY_INT, /* ^C */ + F_LIST_DELNEXT, /* ^D */ + F_TOEND, /* ^E */ + F_CHARFWD, /* ^F */ + F_UNASSIGNED, /* ^G */ + F_DELPREV, /* ^H */ + F_COMPLETE, /* ^I */ + F_NEWLINE, /* ^J */ + F_KILLEND, /* ^K */ + F_CLEARDISP, /* ^L */ + F_NEWLINE, /* ^M */ + F_DOWN_HIST, /* ^N */ + F_TTY_FLUSHO, /* ^O */ + F_UP_HIST, /* ^P */ + F_TTY_STARTO, /* ^Q */ + F_REDISP, /* ^R */ + F_TTY_STOPO, /* ^S */ + F_CHARSWITCH, /* ^T */ + F_KILLALL, /* ^U */ + F_QUOTE, /* ^V */ + F_KILLREGION, /* ^W */ + F_XKEY, /* ^X */ + F_YANK_KILL, /* ^Y */ + F_TTY_TSUSP, /* ^Z */ + F_METANEXT, /* ^[ */ + F_TTY_QUIT, /* ^\ */ + F_TTY_DSUSP, /* ^] */ + F_UNASSIGNED, /* ^^ */ + F_UNASSIGNED, /* ^_ */ + F_INSERT, /* SPACE */ + F_INSERT, /* ! */ + F_INSERT, /* " */ + F_INSERT, /* # */ + F_INSERT, /* $ */ + F_INSERT, /* % */ + F_INSERT, /* & */ + F_INSERT, /* ' */ + F_INSERT, /* ( */ + F_INSERT, /* ) */ + F_INSERT, /* * */ + F_INSERT, /* + */ + F_INSERT, /* , */ + F_INSERT, /* - */ + F_INSERT, /* . */ + F_INSERT, /* / */ + F_DIGIT, /* 0 */ + F_DIGIT, /* 1 */ + F_DIGIT, /* 2 */ + F_DIGIT, /* 3 */ + F_DIGIT, /* 4 */ + F_DIGIT, /* 5 */ + F_DIGIT, /* 6 */ + F_DIGIT, /* 7 */ + F_DIGIT, /* 8 */ + F_DIGIT, /* 9 */ + F_INSERT, /* : */ + F_INSERT, /* ; */ + F_INSERT, /* < */ + F_INSERT, /* = */ + F_INSERT, /* > */ + F_INSERT, /* ? */ + F_INSERT, /* @ */ + F_INSERT, /* A */ + F_INSERT, /* B */ + F_INSERT, /* C */ + F_INSERT, /* D */ + F_INSERT, /* E */ + F_INSERT, /* F */ + F_INSERT, /* G */ + F_INSERT, /* H */ + F_INSERT, /* I */ + F_INSERT, /* J */ + F_INSERT, /* K */ + F_INSERT, /* L */ + F_INSERT, /* M */ + F_INSERT, /* N */ + F_INSERT, /* O */ + F_INSERT, /* P */ + F_INSERT, /* Q */ + F_INSERT, /* R */ + F_INSERT, /* S */ + F_INSERT, /* T */ + F_INSERT, /* U */ + F_INSERT, /* V */ + F_INSERT, /* W */ + F_INSERT, /* X */ + F_INSERT, /* Y */ + F_INSERT, /* Z */ + F_INSERT, /* [ */ + F_INSERT, /* \ */ + F_INSERT, /* ] */ + F_INSERT, /* ^ */ + F_INSERT, /* _ */ + F_INSERT, /* ` */ + F_INSERT, /* a */ + F_INSERT, /* b */ + F_INSERT, /* c */ + F_INSERT, /* d */ + F_INSERT, /* e */ + F_INSERT, /* f */ + F_INSERT, /* g */ + F_INSERT, /* h */ + F_INSERT, /* i */ + F_INSERT, /* j */ + F_INSERT, /* k */ + F_INSERT, /* l */ + F_INSERT, /* m */ + F_INSERT, /* n */ + F_INSERT, /* o */ + F_INSERT, /* p */ + F_INSERT, /* q */ + F_INSERT, /* r */ + F_INSERT, /* s */ + F_INSERT, /* t */ + F_INSERT, /* u */ + F_INSERT, /* v */ + F_INSERT, /* w */ + F_INSERT, /* x */ + F_INSERT, /* y */ + F_INSERT, /* z */ + F_INSERT, /* { */ + F_INSERT, /* | */ + F_INSERT, /* } */ + F_INSERT, /* ~ */ + F_DELPREV, /* ^? */ + F_UNASSIGNED, /* M-^@ */ + F_UNASSIGNED, /* M-^A */ + F_UNASSIGNED, /* M-^B */ + F_UNASSIGNED, /* M-^C */ + F_LIST_CHOICES, /* M-^D */ + F_UNASSIGNED, /* M-^E */ + F_UNASSIGNED, /* M-^F */ + F_UNASSIGNED, /* M-^G */ + F_DELWORDPREV, /* M-^H */ + F_COMPLETE, /* M-^I */ + F_UNASSIGNED, /* M-^J */ + F_UNASSIGNED, /* M-^K */ + F_CLEARDISP, /* M-^L */ + F_UNASSIGNED, /* M-^M */ + F_UNASSIGNED, /* M-^N */ + F_UNASSIGNED, /* M-^O */ + F_UNASSIGNED, /* M-^P */ + F_UNASSIGNED, /* M-^Q */ + F_UNASSIGNED, /* M-^R */ + F_UNASSIGNED, /* M-^S */ + F_UNASSIGNED, /* M-^T */ + F_UNASSIGNED, /* M-^U */ + F_UNASSIGNED, /* M-^V */ + F_UNASSIGNED, /* M-^W */ + F_UNASSIGNED, /* M-^X */ + F_UNASSIGNED, /* M-^Y */ + F_RUN_FG_EDITOR, /* M-^Z */ + F_COMPLETE, /* M-^[ */ + F_UNASSIGNED, /* M-^\ */ + F_UNASSIGNED, /* M-^] */ + F_UNASSIGNED, /* M-^^ */ + F_COPYPREV, /* M-^_ */ + F_EXPAND_HISTORY, /* M-SPACE */ + F_EXPAND_HISTORY, /* M-! */ + F_UNASSIGNED, /* M-" */ + F_UNASSIGNED, /* M-# */ + F_CORRECT_L, /* M-$ */ + F_UNASSIGNED, /* M-% */ + F_UNASSIGNED, /* M-& */ + F_UNASSIGNED, /* M-' */ + F_UNASSIGNED, /* M-( */ + F_UNASSIGNED, /* M-) */ + F_UNASSIGNED, /* M-* */ + F_UNASSIGNED, /* M-+ */ + F_UNASSIGNED, /* M-, */ + F_UNASSIGNED, /* M-- */ + F_UNASSIGNED, /* M-. */ + F_UNASSIGNED, /* M-/ */ + F_ARGDIGIT, /* M-0 */ + F_ARGDIGIT, /* M-1 */ + F_ARGDIGIT, /* M-2 */ + F_ARGDIGIT, /* M-3 */ + F_ARGDIGIT, /* M-4 */ + F_ARGDIGIT, /* M-5 */ + F_ARGDIGIT, /* M-6 */ + F_ARGDIGIT, /* M-7 */ + F_ARGDIGIT, /* M-8 */ + F_ARGDIGIT, /* M-9 */ + F_UNASSIGNED, /* M-: */ + F_UNASSIGNED, /* M-; */ + F_UNASSIGNED, /* M-< */ + F_UNASSIGNED, /* M-= */ + F_UNASSIGNED, /* M-> */ + F_WHICH, /* M-? */ + F_UNASSIGNED, /* M-@ */ + F_UNASSIGNED, /* M-A */ + F_WORDBACK, /* M-B */ + F_CASECAPITAL, /* M-C */ + F_DELWORDNEXT, /* M-D */ + F_UNASSIGNED, /* M-E */ + F_WORDFWD, /* M-F */ + F_UNASSIGNED, /* M-G */ + F_HELPME, /* M-H */ + F_UNASSIGNED, /* M-I */ + F_UNASSIGNED, /* M-J */ + F_UNASSIGNED, /* M-K */ + F_CASELOWER, /* M-L */ + F_UNASSIGNED, /* M-M */ + F_DOWN_SEARCH_HIST, /* M-N */ + F_XKEY, /* M-O *//* extended key esc PWP Mar 88 */ + F_UP_SEARCH_HIST, /* M-P */ + F_UNASSIGNED, /* M-Q */ + F_TOGGLE_HIST, /* M-R */ + F_CORRECT, /* M-S */ + F_UNASSIGNED, /* M-T */ + F_CASEUPPER, /* M-U */ + F_UNASSIGNED, /* M-V */ + F_COPYREGION, /* M-W */ + F_UNASSIGNED, /* M-X */ + F_UNASSIGNED, /* M-Y */ + F_UNASSIGNED, /* M-Z */ + F_XKEY, /* M-[ *//* extended key esc -mf Oct 87 */ + F_UNASSIGNED, /* M-\ */ + F_UNASSIGNED, /* M-] */ + F_UNASSIGNED, /* M-^ */ + F_LAST_ITEM, /* M-_ */ + F_UNASSIGNED, /* M-` */ + F_UNASSIGNED, /* M-a */ + F_WORDBACK, /* M-b */ + F_CASECAPITAL, /* M-c */ + F_DELWORDNEXT, /* M-d */ + F_UNASSIGNED, /* M-e */ + F_WORDFWD, /* M-f */ + F_UNASSIGNED, /* M-g */ + F_HELPME, /* M-h */ + F_UNASSIGNED, /* M-i */ + F_UNASSIGNED, /* M-j */ + F_UNASSIGNED, /* M-k */ + F_CASELOWER, /* M-l */ + F_UNASSIGNED, /* M-m */ + F_DOWN_SEARCH_HIST, /* M-n */ + F_UNASSIGNED, /* M-o */ + F_UP_SEARCH_HIST, /* M-p */ + F_UNASSIGNED, /* M-q */ + F_TOGGLE_HIST, /* M-r */ + F_CORRECT, /* M-s */ + F_UNASSIGNED, /* M-t */ + F_CASEUPPER, /* M-u */ + F_UNASSIGNED, /* M-v */ + F_COPYREGION, /* M-w */ + F_UNASSIGNED, /* M-x */ + F_UNASSIGNED, /* M-y */ + F_UNASSIGNED, /* M-z */ + F_UNASSIGNED, /* M-{ */ + F_UNASSIGNED, /* M-| */ + F_UNASSIGNED, /* M-} */ + F_UNASSIGNED, /* M-~ */ + F_DELWORDPREV /* M-^? */ +}; + +/* + * keymap table for vi. Each index into above tbl; should be + * 256 entries long. Vi mode uses a sticky-extend to do command mode: + * insert mode characters are in the normal keymap, and command mode + * in the extended keymap. + */ +KEYCMD CcViMap[] = { + F_UNASSIGNED, /* ^@ */ + F_TOBEG, /* ^A */ + F_CHARBACK, /* ^B */ + F_TTY_INT, /* ^C */ + F_LIST_EOF, /* ^D */ + F_TOEND, /* ^E */ + F_CHARFWD, /* ^F */ + F_LIST_GLOB, /* ^G */ + F_DELPREV, /* ^H */ + F_COMPLETE, /* ^I */ + F_NEWLINE, /* ^J */ + F_KILLEND, /* ^K */ + F_CLEARDISP, /* ^L */ + F_NEWLINE, /* ^M */ + F_DOWN_HIST, /* ^N */ + F_TTY_FLUSHO, /* ^O */ + F_UP_HIST, /* ^P */ + F_TTY_STARTO, /* ^Q */ + F_REDISP, /* ^R */ + F_TTY_STOPO, /* ^S */ + F_CHARSWITCH, /* ^T */ + F_KILLBEG, /* ^U */ + F_QUOTE, /* ^V */ + F_DELWORDPREV, /* ^W */ + F_EXPAND, /* ^X */ + F_TTY_DSUSP, /* ^Y */ + F_TTY_TSUSP, /* ^Z */ + V_CMD_MODE, /* ^[ */ + F_TTY_QUIT, /* ^\ */ + F_UNASSIGNED, /* ^] */ + F_UNASSIGNED, /* ^^ */ + F_UNASSIGNED, /* ^_ */ + F_INSERT, /* SPACE */ + F_INSERT, /* ! */ + F_INSERT, /* " */ + F_INSERT, /* # */ + F_INSERT, /* $ */ + F_INSERT, /* % */ + F_INSERT, /* & */ + F_INSERT, /* ' */ + F_INSERT, /* ( */ + F_INSERT, /* ) */ + F_INSERT, /* * */ + F_INSERT, /* + */ + F_INSERT, /* , */ + F_INSERT, /* - */ + F_INSERT, /* . */ + F_INSERT, /* / */ + F_INSERT, /* 0 */ + F_INSERT, /* 1 */ + F_INSERT, /* 2 */ + F_INSERT, /* 3 */ + F_INSERT, /* 4 */ + F_INSERT, /* 5 */ + F_INSERT, /* 6 */ + F_INSERT, /* 7 */ + F_INSERT, /* 8 */ + F_INSERT, /* 9 */ + F_INSERT, /* : */ + F_INSERT, /* ; */ + F_INSERT, /* < */ + F_INSERT, /* = */ + F_INSERT, /* > */ + F_INSERT, /* ? */ + F_INSERT, /* @ */ + F_INSERT, /* A */ + F_INSERT, /* B */ + F_INSERT, /* C */ + F_INSERT, /* D */ + F_INSERT, /* E */ + F_INSERT, /* F */ + F_INSERT, /* G */ + F_INSERT, /* H */ + F_INSERT, /* I */ + F_INSERT, /* J */ + F_INSERT, /* K */ + F_INSERT, /* L */ + F_INSERT, /* M */ + F_INSERT, /* N */ + F_INSERT, /* O */ + F_INSERT, /* P */ + F_INSERT, /* Q */ + F_INSERT, /* R */ + F_INSERT, /* S */ + F_INSERT, /* T */ + F_INSERT, /* U */ + F_INSERT, /* V */ + F_INSERT, /* W */ + F_INSERT, /* X */ + F_INSERT, /* Y */ + F_INSERT, /* Z */ + F_INSERT, /* [ */ + F_INSERT, /* \ */ + F_INSERT, /* ] */ + F_INSERT, /* ^ */ + F_INSERT, /* _ */ + F_INSERT, /* ` */ + F_INSERT, /* a */ + F_INSERT, /* b */ + F_INSERT, /* c */ + F_INSERT, /* d */ + F_INSERT, /* e */ + F_INSERT, /* f */ + F_INSERT, /* g */ + F_INSERT, /* h */ + F_INSERT, /* i */ + F_INSERT, /* j */ + F_INSERT, /* k */ + F_INSERT, /* l */ + F_INSERT, /* m */ + F_INSERT, /* n */ + F_INSERT, /* o */ + F_INSERT, /* p */ + F_INSERT, /* q */ + F_INSERT, /* r */ + F_INSERT, /* s */ + F_INSERT, /* t */ + F_INSERT, /* u */ + F_INSERT, /* v */ + F_INSERT, /* w */ + F_INSERT, /* x */ + F_INSERT, /* y */ + F_INSERT, /* z */ + F_INSERT, /* { */ + F_INSERT, /* | */ + F_INSERT, /* } */ + F_INSERT, /* ~ */ + F_DELPREV, /* ^? */ + F_UNASSIGNED, /* M-^@ */ + F_UNASSIGNED, /* M-^A */ + F_UNASSIGNED, /* M-^B */ + F_UNASSIGNED, /* M-^C */ + F_UNASSIGNED, /* M-^D */ + F_UNASSIGNED, /* M-^E */ + F_UNASSIGNED, /* M-^F */ + F_UNASSIGNED, /* M-^G */ + F_UNASSIGNED, /* M-^H */ + F_UNASSIGNED, /* M-^I */ + F_UNASSIGNED, /* M-^J */ + F_UNASSIGNED, /* M-^K */ + F_UNASSIGNED, /* M-^L */ + F_UNASSIGNED, /* M-^M */ + F_UNASSIGNED, /* M-^N */ + F_UNASSIGNED, /* M-^O */ + F_UNASSIGNED, /* M-^P */ + F_UNASSIGNED, /* M-^Q */ + F_UNASSIGNED, /* M-^R */ + F_UNASSIGNED, /* M-^S */ + F_UNASSIGNED, /* M-^T */ + F_UNASSIGNED, /* M-^U */ + F_UNASSIGNED, /* M-^V */ + F_UNASSIGNED, /* M-^W */ + F_UNASSIGNED, /* M-^X */ + F_UNASSIGNED, /* M-^Y */ + F_UNASSIGNED, /* M-^Z */ + F_UNASSIGNED, /* M-^[ */ + F_UNASSIGNED, /* M-^\ */ + F_UNASSIGNED, /* M-^] */ + F_UNASSIGNED, /* M-^^ */ + F_UNASSIGNED, /* M-^_ */ + F_UNASSIGNED, /* M-SPACE */ + F_UNASSIGNED, /* M-! */ + F_UNASSIGNED, /* M-" */ + F_UNASSIGNED, /* M-# */ + F_UNASSIGNED, /* M-$ */ + F_UNASSIGNED, /* M-% */ + F_UNASSIGNED, /* M-& */ + F_UNASSIGNED, /* M-' */ + F_UNASSIGNED, /* M-( */ + F_UNASSIGNED, /* M-) */ + F_UNASSIGNED, /* M-* */ + F_UNASSIGNED, /* M-+ */ + F_UNASSIGNED, /* M-, */ + F_UNASSIGNED, /* M-- */ + F_UNASSIGNED, /* M-. */ + F_UNASSIGNED, /* M-/ */ + F_UNASSIGNED, /* M-0 */ + F_UNASSIGNED, /* M-1 */ + F_UNASSIGNED, /* M-2 */ + F_UNASSIGNED, /* M-3 */ + F_UNASSIGNED, /* M-4 */ + F_UNASSIGNED, /* M-5 */ + F_UNASSIGNED, /* M-6 */ + F_UNASSIGNED, /* M-7 */ + F_UNASSIGNED, /* M-8 */ + F_UNASSIGNED, /* M-9 */ + F_UNASSIGNED, /* M-: */ + F_UNASSIGNED, /* M-; */ + F_UNASSIGNED, /* M-< */ + F_UNASSIGNED, /* M-= */ + F_UNASSIGNED, /* M-> */ + F_UNASSIGNED, /* M-? */ + F_UNASSIGNED, /* M-@ */ + F_UNASSIGNED, /* M-A */ + F_UNASSIGNED, /* M-B */ + F_UNASSIGNED, /* M-C */ + F_UNASSIGNED, /* M-D */ + F_UNASSIGNED, /* M-E */ + F_UNASSIGNED, /* M-F */ + F_UNASSIGNED, /* M-G */ + F_UNASSIGNED, /* M-H */ + F_UNASSIGNED, /* M-I */ + F_UNASSIGNED, /* M-J */ + F_UNASSIGNED, /* M-K */ + F_UNASSIGNED, /* M-L */ + F_UNASSIGNED, /* M-M */ + F_UNASSIGNED, /* M-N */ + F_UNASSIGNED, /* M-O */ + F_UNASSIGNED, /* M-P */ + F_UNASSIGNED, /* M-Q */ + F_UNASSIGNED, /* M-R */ + F_UNASSIGNED, /* M-S */ + F_UNASSIGNED, /* M-T */ + F_UNASSIGNED, /* M-U */ + F_UNASSIGNED, /* M-V */ + F_UNASSIGNED, /* M-W */ + F_UNASSIGNED, /* M-X */ + F_UNASSIGNED, /* M-Y */ + F_UNASSIGNED, /* M-Z */ + F_UNASSIGNED, /* M-[ */ + F_UNASSIGNED, /* M-\ */ + F_UNASSIGNED, /* M-] */ + F_UNASSIGNED, /* M-^ */ + F_UNASSIGNED, /* M-_ */ + F_UNASSIGNED, /* M-` */ + F_UNASSIGNED, /* M-a */ + F_UNASSIGNED, /* M-b */ + F_UNASSIGNED, /* M-c */ + F_UNASSIGNED, /* M-d */ + F_UNASSIGNED, /* M-e */ + F_UNASSIGNED, /* M-f */ + F_UNASSIGNED, /* M-g */ + F_UNASSIGNED, /* M-h */ + F_UNASSIGNED, /* M-i */ + F_UNASSIGNED, /* M-j */ + F_UNASSIGNED, /* M-k */ + F_UNASSIGNED, /* M-l */ + F_UNASSIGNED, /* M-m */ + F_UNASSIGNED, /* M-n */ + F_UNASSIGNED, /* M-o */ + F_UNASSIGNED, /* M-p */ + F_UNASSIGNED, /* M-q */ + F_UNASSIGNED, /* M-r */ + F_UNASSIGNED, /* M-s */ + F_UNASSIGNED, /* M-t */ + F_UNASSIGNED, /* M-u */ + F_UNASSIGNED, /* M-v */ + F_UNASSIGNED, /* M-w */ + F_UNASSIGNED, /* M-x */ + F_UNASSIGNED, /* M-y */ + F_UNASSIGNED, /* M-z */ + F_UNASSIGNED, /* M-{ */ + F_UNASSIGNED, /* M-| */ + F_UNASSIGNED, /* M-} */ + F_UNASSIGNED, /* M-~ */ + F_UNASSIGNED /* M-^? */ +}; + +KEYCMD CcViCmdMap[] = { + F_UNASSIGNED, /* ^@ */ + F_TOBEG, /* ^A */ + F_UNASSIGNED, /* ^B */ + F_TTY_INT, /* ^C */ + F_LIST_CHOICES, /* ^D */ + F_TOEND, /* ^E */ + F_UNASSIGNED, /* ^F */ + F_LIST_GLOB, /* ^G */ + F_DELPREV, /* ^H */ + V_CM_COMPLETE, /* ^I */ + F_NEWLINE, /* ^J */ + F_KILLEND, /* ^K */ + F_CLEARDISP, /* ^L */ + F_NEWLINE, /* ^M */ + F_DOWN_HIST, /* ^N */ + F_TTY_FLUSHO, /* ^O */ + F_UP_HIST, /* ^P */ + F_TTY_STARTO, /* ^Q */ + F_REDISP, /* ^R */ + F_TTY_STOPO, /* ^S */ + F_UNASSIGNED, /* ^T */ + F_KILLBEG, /* ^U */ + F_UNASSIGNED, /* ^V */ + F_DELWORDPREV, /* ^W */ + F_EXPAND, /* ^X */ + F_UNASSIGNED, /* ^Y */ + F_UNASSIGNED, /* ^Z */ + F_METANEXT, /* ^[ */ + F_TTY_QUIT, /* ^\ */ + F_UNASSIGNED, /* ^] */ + F_UNASSIGNED, /* ^^ */ + F_UNASSIGNED, /* ^_ */ + F_CHARFWD, /* SPACE */ + F_EXPAND_HISTORY, /* ! */ + F_UNASSIGNED, /* " */ + F_UNASSIGNED, /* # */ + F_TOEND, /* $ */ + F_UNASSIGNED, /* % */ + F_UNASSIGNED, /* & */ + F_UNASSIGNED, /* ' */ + F_UNASSIGNED, /* ( */ + F_UNASSIGNED, /* ) */ + F_EXPAND_GLOB, /* * */ + F_UNASSIGNED, /* + */ + F_UNASSIGNED, /* , */ + F_UNASSIGNED, /* - */ + F_UNASSIGNED, /* . */ + F_UNASSIGNED, /* / */ + V_ZERO, /* 0 */ + F_ARGDIGIT, /* 1 */ + F_ARGDIGIT, /* 2 */ + F_ARGDIGIT, /* 3 */ + F_ARGDIGIT, /* 4 */ + F_ARGDIGIT, /* 5 */ + F_ARGDIGIT, /* 6 */ + F_ARGDIGIT, /* 7 */ + F_ARGDIGIT, /* 8 */ + F_ARGDIGIT, /* 9 */ + F_UNASSIGNED, /* : */ + F_UNASSIGNED, /* ; */ + F_UNASSIGNED, /* < */ + F_UNASSIGNED, /* = */ + F_UNASSIGNED, /* > */ + F_WHICH, /* ? */ + F_UNASSIGNED, /* @ */ + V_ADDEND, /* A */ + F_WORDBACK, /* B */ + V_CHGTOEND, /* C */ + F_KILLEND, /* D */ + F_UNASSIGNED, /* E */ + F_UNASSIGNED, /* F */ + F_UNASSIGNED, /* G */ + F_UNASSIGNED, /* H */ + V_INSBEG, /* I */ + F_DOWN_SEARCH_HIST, /* J */ + F_UP_SEARCH_HIST, /* K */ + F_UNASSIGNED, /* L */ + F_UNASSIGNED, /* M */ + F_UNASSIGNED, /* N */ + F_XKEY, /* O */ + F_UNASSIGNED, /* P */ + F_UNASSIGNED, /* Q */ + V_REPLMODE, /* R */ + V_SUBSTLINE, /* S */ + F_TOGGLE_HIST, /* T */ + F_UNASSIGNED, /* U */ + F_EXPAND_VARS, /* V */ + F_WORDFWD, /* W */ + F_DELPREV, /* X */ + F_UNASSIGNED, /* Y */ + F_UNASSIGNED, /* Z */ + F_XKEY, /* [ */ + F_UNASSIGNED, /* \ */ + F_UNASSIGNED, /* ] */ + F_TOBEG, /* ^ */ + F_UNASSIGNED, /* _ */ + F_UNASSIGNED, /* ` */ + V_ADD, /* a */ + F_WORDBACK, /* b */ + F_UNASSIGNED, /* c */ + F_DELWORDNEXT, /* d */ + F_UNASSIGNED, /* e */ + F_UNASSIGNED, /* f */ + F_UNASSIGNED, /* g */ + F_CHARBACK, /* h */ + V_INSERT, /* i */ + F_DOWN_HIST, /* j */ + F_UP_HIST, /* k */ + F_CHARFWD, /* l */ + F_UNASSIGNED, /* m */ + F_UNASSIGNED, /* n */ + F_UNASSIGNED, /* o */ + F_UNASSIGNED, /* p */ + F_UNASSIGNED, /* q */ + V_REPLONE, /* r */ + V_SUBSTCHAR, /* s */ + F_TOGGLE_HIST, /* t */ + F_UNASSIGNED, /* u */ + F_EXPAND_VARS, /* v */ + V_WORDBEGNEXT, /* w */ + F_DELNEXT, /* x */ + F_UNASSIGNED, /* y */ + F_UNASSIGNED, /* z */ + F_UNASSIGNED, /* { */ + F_UNASSIGNED, /* | */ + F_UNASSIGNED, /* } */ + V_CHGCASE, /* ~ */ + F_DELPREV, /* ^? */ + F_UNASSIGNED, /* M-^@ */ + F_UNASSIGNED, /* M-^A */ + F_UNASSIGNED, /* M-^B */ + F_UNASSIGNED, /* M-^C */ + F_UNASSIGNED, /* M-^D */ + F_UNASSIGNED, /* M-^E */ + F_UNASSIGNED, /* M-^F */ + F_UNASSIGNED, /* M-^G */ + F_UNASSIGNED, /* M-^H */ + F_UNASSIGNED, /* M-^I */ + F_UNASSIGNED, /* M-^J */ + F_UNASSIGNED, /* M-^K */ + F_UNASSIGNED, /* M-^L */ + F_UNASSIGNED, /* M-^M */ + F_UNASSIGNED, /* M-^N */ + F_UNASSIGNED, /* M-^O */ + F_UNASSIGNED, /* M-^P */ + F_UNASSIGNED, /* M-^Q */ + F_UNASSIGNED, /* M-^R */ + F_UNASSIGNED, /* M-^S */ + F_UNASSIGNED, /* M-^T */ + F_UNASSIGNED, /* M-^U */ + F_UNASSIGNED, /* M-^V */ + F_UNASSIGNED, /* M-^W */ + F_UNASSIGNED, /* M-^X */ + F_UNASSIGNED, /* M-^Y */ + F_UNASSIGNED, /* M-^Z */ + F_UNASSIGNED, /* M-^[ */ + F_UNASSIGNED, /* M-^\ */ + F_UNASSIGNED, /* M-^] */ + F_UNASSIGNED, /* M-^^ */ + F_UNASSIGNED, /* M-^_ */ + F_UNASSIGNED, /* M-SPACE */ + F_UNASSIGNED, /* M-! */ + F_UNASSIGNED, /* M-" */ + F_UNASSIGNED, /* M-# */ + F_UNASSIGNED, /* M-$ */ + F_UNASSIGNED, /* M-% */ + F_UNASSIGNED, /* M-& */ + F_UNASSIGNED, /* M-' */ + F_UNASSIGNED, /* M-( */ + F_UNASSIGNED, /* M-) */ + F_UNASSIGNED, /* M-* */ + F_UNASSIGNED, /* M-+ */ + F_UNASSIGNED, /* M-, */ + F_UNASSIGNED, /* M-- */ + F_UNASSIGNED, /* M-. */ + F_UNASSIGNED, /* M-/ */ + F_UNASSIGNED, /* M-0 */ + F_UNASSIGNED, /* M-1 */ + F_UNASSIGNED, /* M-2 */ + F_UNASSIGNED, /* M-3 */ + F_UNASSIGNED, /* M-4 */ + F_UNASSIGNED, /* M-5 */ + F_UNASSIGNED, /* M-6 */ + F_UNASSIGNED, /* M-7 */ + F_UNASSIGNED, /* M-8 */ + F_UNASSIGNED, /* M-9 */ + F_UNASSIGNED, /* M-: */ + F_UNASSIGNED, /* M-; */ + F_UNASSIGNED, /* M-< */ + F_UNASSIGNED, /* M-= */ + F_UNASSIGNED, /* M-> */ + F_HELPME, /* M-? */ + F_UNASSIGNED, /* M-@ */ + F_UNASSIGNED, /* M-A */ + F_UNASSIGNED, /* M-B */ + F_UNASSIGNED, /* M-C */ + F_UNASSIGNED, /* M-D */ + F_UNASSIGNED, /* M-E */ + F_UNASSIGNED, /* M-F */ + F_UNASSIGNED, /* M-G */ + F_UNASSIGNED, /* M-H */ + F_UNASSIGNED, /* M-I */ + F_UNASSIGNED, /* M-J */ + F_UNASSIGNED, /* M-K */ + F_UNASSIGNED, /* M-L */ + F_UNASSIGNED, /* M-M */ + F_UNASSIGNED, /* M-N */ + F_XKEY, /* M-O *//* extended key esc PWP Mar 88 */ + F_UNASSIGNED, /* M-P */ + F_UNASSIGNED, /* M-Q */ + F_UNASSIGNED, /* M-R */ + F_UNASSIGNED, /* M-S */ + F_UNASSIGNED, /* M-T */ + F_UNASSIGNED, /* M-U */ + F_UNASSIGNED, /* M-V */ + F_UNASSIGNED, /* M-W */ + F_UNASSIGNED, /* M-X */ + F_UNASSIGNED, /* M-Y */ + F_UNASSIGNED, /* M-Z */ + F_XKEY, /* M-[ *//* extended key esc -mf Oct 87 */ + F_UNASSIGNED, /* M-\ */ + F_UNASSIGNED, /* M-] */ + F_UNASSIGNED, /* M-^ */ + F_UNASSIGNED, /* M-_ */ + F_UNASSIGNED, /* M-` */ + F_UNASSIGNED, /* M-a */ + F_UNASSIGNED, /* M-b */ + F_UNASSIGNED, /* M-c */ + F_UNASSIGNED, /* M-d */ + F_UNASSIGNED, /* M-e */ + F_UNASSIGNED, /* M-f */ + F_UNASSIGNED, /* M-g */ + F_UNASSIGNED, /* M-h */ + F_UNASSIGNED, /* M-i */ + F_UNASSIGNED, /* M-j */ + F_UNASSIGNED, /* M-k */ + F_UNASSIGNED, /* M-l */ + F_UNASSIGNED, /* M-m */ + F_UNASSIGNED, /* M-n */ + F_UNASSIGNED, /* M-o */ + F_UNASSIGNED, /* M-p */ + F_UNASSIGNED, /* M-q */ + F_UNASSIGNED, /* M-r */ + F_UNASSIGNED, /* M-s */ + F_UNASSIGNED, /* M-t */ + F_UNASSIGNED, /* M-u */ + F_UNASSIGNED, /* M-v */ + F_UNASSIGNED, /* M-w */ + F_UNASSIGNED, /* M-x */ + F_UNASSIGNED, /* M-y */ + F_UNASSIGNED, /* M-z */ + F_UNASSIGNED, /* M-{ */ + F_UNASSIGNED, /* M-| */ + F_UNASSIGNED, /* M-} */ + F_UNASSIGNED, /* M-~ */ + F_UNASSIGNED /* M-^? */ +}; + + +struct KeyFuncs FuncNames[] = { + "backward-char", F_CHARBACK, +#ifdef LONGFUNCS + "Move back a character", +#endif + "backward-delete-char", F_DELPREV, +#ifdef LONGFUNCS + "Delete the character behind cursor", +#endif + "backward-delete-word", F_DELWORDPREV, +#ifdef LONGFUNCS + "Cut from beginning of current word to cursor - saved in cut buffer", +#endif + "backward-kill-line", F_KILLBEG, +#ifdef LONGFUNCS + "Cut from beginning of line to cursor - save in cut buffer", +#endif + "backward-word", F_WORDBACK, +#ifdef LONGFUNCS + "Move to beginning of current word", +#endif + "beginning-of-line", F_TOBEG, +#ifdef LONGFUNCS + "Move to beginning of line", +#endif + "capitalize-word", F_CASECAPITAL, +#ifdef LONGFUNCS + "Capitalize the characters from cursor to end of current word", +#endif + "change-case", V_CHGCASE, +#ifdef LONGFUNCS + "Vi change case of character under cursor and advance one character", +#endif + "change-till-end-of-line", V_CHGTOEND, /* backwards compat. */ +#ifdef LONGFUNCS + "Vi change to end of line", +#endif + "clear-screen", F_CLEARDISP, +#ifdef LONGFUNCS + "Clear screen leaving current line on top", +#endif + "complete-word", F_COMPLETE, +#ifdef LONGFUNCS + "Complete current word", +#endif + "copy-prev-word", F_COPYPREV, +#ifdef LONGFUNCS + "Copy current word to cursor", +#endif + "copy-region-as-kill", F_COPYREGION, +#ifdef LONGFUNCS + "Copy area between mark and cursor to cut buffer", +#endif + "delete-char", F_DELNEXT, +#ifdef LONGFUNCS + "Delete character under cursor", +#endif + "delete-char-or-list", F_LIST_DELNEXT, +#ifdef LONGFUNCS + "Delete character under cursor or list completions if at end of line", +#endif + "delete-word", F_DELWORDNEXT, +#ifdef LONGFUNCS + "Cut from cursor to end of current word - save in cut buffer", +#endif + "digit", F_DIGIT, +#ifdef LONGFUNCS + "Adds to argument if started or enters digit", +#endif + "digit-argument", F_ARGDIGIT, +#ifdef LONGFUNCS + "Digit that starts argument", +#endif + "down-history", F_DOWN_HIST, +#ifdef LONGFUNCS + "Move to next history line", +#endif + "downcase-word", F_CASELOWER, +#ifdef LONGFUNCS + "Lowercase the characters from cursor to end of current word", +#endif + "end-of-file", F_SEND_EOF, +#ifdef LONGFUNCS + "Indicate end of file", +#endif + "end-of-line", F_TOEND, +#ifdef LONGFUNCS + "Move cursor to end of line", +#endif + "exchange-point-and-mark", F_EXCHANGE_MARK, +#ifdef LONGFUNCS + "Exchange the cursor and mark", +#endif + "expand-glob", F_EXPAND_GLOB, +#ifdef LONGFUNCS + "Expand file name wildcards", +#endif + "expand-history", F_EXPAND_HISTORY, +#ifdef LONGFUNCS + "Expand history escapes", +#endif + "expand-line", F_EXPAND, +#ifdef LONGFUNCS + "Expand the history escapes in a line", +#endif + "expand-variables", F_EXPAND_VARS, +#ifdef LONGFUNCS + "Expand variables", +#endif + "forward-char", F_CHARFWD, +#ifdef LONGFUNCS + "Move forward one character", +#endif + "forward-word", F_WORDFWD, +#ifdef LONGFUNCS + "Move forward to end of current word", +#endif + "gosmacs-transpose-chars", F_GCHARSWITCH, +#ifdef LONGFUNCS + "Exchange the two characters before the cursor", +#endif + "history-search-backward", F_UP_SEARCH_HIST, +#ifdef LONGFUNCS + "Search in history backwards for line beginning as current", +#endif + "history-search-forward", F_DOWN_SEARCH_HIST, +#ifdef LONGFUNCS + "Search in history forward for line beginning as current", +#endif + "insert-last-word", F_LAST_ITEM, +#ifdef LONGFUNCS + "Insert last item of previous command", +#endif + "keyboard-quit", F_STARTOVER, +#ifdef LONGFUNCS + "Clear line", +#endif + "kill-line", F_KILLEND, +#ifdef LONGFUNCS + "Cut to end of line and save in cut buffer", +#endif + "kill-region", F_KILLREGION, +#ifdef LONGFUNCS + "Cut area between mark and cursor and save in cut buffer", +#endif + "kill-whole-line", F_KILLALL, +#ifdef LONGFUNCS + "Cut the entire line and save in cut buffer", +#endif + "list-choices", F_LIST_CHOICES, +#ifdef LONGFUNCS + "List choices for completion", +#endif + "list-glob", F_LIST_GLOB, +#ifdef LONGFUNCS + "List file name wildcard matches", +#endif + "list-or-eof", F_LIST_EOF, +#ifdef LONGFUNCS + "List choices for completion or indicate end of file if empty line", +#endif + "magic-space", F_MAGIC_SPACE, +#ifdef LONGFUNCS + "Expand history escapes and insert a space", +#endif + "newline", F_NEWLINE, +#ifdef LONGFUNCS + "Execute command", +#endif + "overwrite-mode", F_INSOVR, +#ifdef LONGFUNCS + "Switch from insert to overwrite mode or vice versa", +#endif + "prefix-meta", F_METANEXT, +#ifdef LONGFUNCS + "Add 8th bit to next character typed", +#endif + "quoted-insert", F_QUOTE, +#ifdef LONGFUNCS + "Add the next character typed to the line verbatim", +#endif + "redisplay", F_REDISP, +#ifdef LONGFUNCS + "Redisplay everything", +#endif + "run-fg-editor", F_RUN_FG_EDITOR, +#ifdef LONGFUNCS + "Restart stopped editor", +#endif + "run-help", F_HELPME, +#ifdef LONGFUNCS + "Look for help on current command", +#endif + "self-insert-command", F_INSERT, +#ifdef LONGFUNCS + "This character is added to the line", +#endif + "sequence-lead-in", F_XKEY, +#ifdef LONGFUNCS + "This character is the first in a character sequence", +#endif + "set-mark-command", F_SET_MARK, +#ifdef LONGFUNCS + "Set the mark at cursor", +#endif + "spell-word", F_CORRECT, +#ifdef LONGFUNCS + "Correct the spelling of current word", +#endif + "spell-line", F_CORRECT_L, +#ifdef LONGFUNCS + "Correct the spelling of entire line", +#endif + "toggle-literal-history", F_TOGGLE_HIST, +#ifdef LONGFUNCS + "Toggle between literal and lexical current history line", +#endif + "transpose-chars", F_CHARSWITCH, +#ifdef LONGFUNCS + "Exchange the character to the left of the cursor with the one under", +#endif + "transpose-gosling", F_GCHARSWITCH, +#ifdef LONGFUNCS + "Exchange the two characters before the cursor", + /* EGS: make Convex Users happy */ +#endif + "tty-dsusp", F_TTY_DSUSP, +#ifdef LONGFUNCS + "Tty delayed suspend character", +#endif + "tty-flush-output", F_TTY_FLUSHO, +#ifdef LONGFUNCS + "Tty flush output character", +#endif + "tty-sigintr", F_TTY_INT, +#ifdef LONGFUNCS + "Tty interrupt character", +#endif + "tty-sigquit", F_TTY_QUIT, +#ifdef LONGFUNCS + "Tty quit character", +#endif + "tty-sigtsusp", F_TTY_TSUSP, +#ifdef LONGFUNCS + "Tty suspend character", +#endif + "tty-start-output", F_TTY_STARTO, +#ifdef LONGFUNCS + "Tty allow output character", +#endif + "tty-stop-output", F_TTY_STOPO, +#ifdef LONGFUNCS + "Tty disallow output character", +#endif + "undefined-key", F_UNASSIGNED, +#ifdef LONGFUNCS + "Indicates unbound character", +#endif + "universal-argument", F_ARGFOUR, +#ifdef LONGFUNCS + "Emacs universal argument (argument times 4)", +#endif + "up-history", F_UP_HIST, +#ifdef LONGFUNCS + "Move to previous history line", +#endif + "upcase-word", F_CASEUPPER, +#ifdef LONGFUNCS + "Uppercase the characters from cursor to end of current word", +#endif + "vi-beginning-of-next-word", V_WORDBEGNEXT, +#ifdef LONGFUNCS + "Vi goto the beginning of next word", +#endif + "vi-add", V_ADD, +#ifdef LONGFUNCS + "Vi enter insert mode after the cursor", +#endif + "vi-add-at-eol", V_ADDEND, +#ifdef LONGFUNCS + "Vi enter insert mode at end of line", +#endif + "vi-chg-case", V_CHGCASE, +#ifdef LONGFUNCS + "Vi change case of character under cursor and advance one character", +#endif + "vi-chg-to-eol", V_CHGTOEND, +#ifdef LONGFUNCS + "Vi change to end of line", +#endif + "vi-cmd-mode", V_CMD_MODE, +#ifdef LONGFUNCS + "Enter vi command mode (use alternative key bindings)", +#endif + "vi-cmd-mode-complete", V_CM_COMPLETE, +#ifdef LONGFUNCS + "Vi command mode complete current word", +#endif + "vi-insert", V_INSERT, +#ifdef LONGFUNCS + "Enter vi insert mode", +#endif + "vi-insert-at-bol", V_INSBEG, +#ifdef LONGFUNCS + "Enter vi insert mode at beginning of line", +#endif + "vi-replace-char", V_REPLONE, +#ifdef LONGFUNCS + "Vi replace character under the cursor with the next character typed", +#endif + "vi-replace-mode", V_REPLMODE, +#ifdef LONGFUNCS + "Vi replace mode", +#endif + "vi-substitute-char", V_SUBSTCHAR, +#ifdef LONGFUNCS + "Vi replace character under the cursor and enter insert mode", +#endif + "vi-substitute-line", V_SUBSTLINE, +#ifdef LONGFUNCS + "Vi replace entire line", +#endif + "vi-zero", V_ZERO, +#ifdef LONGFUNCS + "Vi goto the beginning of line", +#endif + "which-command", F_WHICH, +#ifdef LONGFUNCS + "Perform which of current command", +#endif + "yank", F_YANK_KILL, +#ifdef LONGFUNCS + "Paste cut buffer at cursor position", +#endif + 0, 0 +}; + +#ifdef DEBUG_EDIT +void +CheckMaps() +{ /* check the size of the key maps */ + int c1 = (256 * sizeof(KEYCMD)); + + if ((sizeof(CcKeyMap)) != c1) + xprintf("CcKeyMap should be 256 entries, but is %d.\r\n", + (sizeof(CcKeyMap) / sizeof(KEYCMD))); + + if ((sizeof(CcAltMap)) != c1) + xprintf("CcAltMap should be 256 entries, but is %d.\r\n", + (sizeof(CcAltMap) / sizeof(KEYCMD))); + + if ((sizeof(CcEmacsMap)) != c1) + xprintf("CcEmacsMap should be 256 entries, but is %d.\r\n", + (sizeof(CcEmacsMap) / sizeof(KEYCMD))); + + if ((sizeof(CcViMap)) != c1) + xprintf("CcViMap should be 256 entries, but is %d.\r\n", + (sizeof(CcViMap) / sizeof(KEYCMD))); + + if ((sizeof(CcViCmdMap)) != c1) + xprintf("CcViCmdMap should be 256 entries, but is %d.\r\n", + (sizeof(CcViCmdMap) / sizeof(KEYCMD))); +} + +#endif + +bool MapsAreInited = 0; +bool NLSMapsAreInited = 0; +bool NoNLSRebind; + +void +ed_INLSMaps() +{ + register int i; + + if (AsciiOnly) + return; + if (NoNLSRebind) + return; + for (i = 0200; i <= 0377; i++) { + if (Isprint(i)) { + CcKeyMap[i] = F_INSERT; + } + } + NLSMapsAreInited = 1; +} + +static void +ed_IMetaBindings() +{ + Char buf[3]; + register int i; + register KEYCMD *map; + + map = CcKeyMap; + for (i = 0; i <= 0377 && CcKeyMap[i] != F_METANEXT; i++); + if (i > 0377) { + for (i = 0; i <= 0377 && CcAltMap[i] != F_METANEXT; i++); + if (i > 0377) { + i = 033; + if (VImode) + map = CcAltMap; + } + else { + map = CcAltMap; + } + } + buf[0] = i; + buf[2] = 0; + for (i = 0200; i <= 0377; i++) { + if (map[i] != F_INSERT && map[i] != F_UNASSIGNED && map[i] != F_XKEY) { + buf[1] = i & ASCII; + AddXKeyCmd(buf, (Char) map[i]); + } + } + map[buf[0]] = F_XKEY; +} + +void +ed_IVIMaps() +{ + register int i; + + VImode = 1; + (void) ResetXmap(VImode); + for (i = 0; i < 256; i++) { + CcKeyMap[i] = CcViMap[i]; + CcAltMap[i] = CcViCmdMap[i]; + } + ed_IMetaBindings(); + (void) ed_INLSMaps(); + BindArrowKeys(); +} + +void +ed_IEmacsMaps() +{ + register int i; + Char buf[3]; + + VImode = 0; + (void) ResetXmap(VImode); + for (i = 0; i < 256; i++) { + CcKeyMap[i] = CcEmacsMap[i]; + CcAltMap[i] = F_UNASSIGNED; + } + ed_IMetaBindings(); + (void) ed_INLSMaps(); + buf[0] = 030; + buf[2] = 0; + buf[1] = 030; + AddXKeyCmd(buf, F_EXCHANGE_MARK); + buf[1] = '*'; + AddXKeyCmd(buf, F_EXPAND_GLOB); + buf[1] = '$'; + AddXKeyCmd(buf, F_EXPAND_VARS); + buf[1] = 'G'; + AddXKeyCmd(buf, F_LIST_GLOB); + buf[1] = 'g'; + AddXKeyCmd(buf, F_LIST_GLOB); + BindArrowKeys(); +} + +void +ed_IMaps() +{ + if (MapsAreInited) + return; +#ifdef VIDEFAULT + ed_IVIMaps(); +#else + ed_IEmacsMaps(); +#endif + + MapsAreInited = 1; +} diff --git a/bin/tcsh/ed.h b/bin/tcsh/ed.h new file mode 100644 index 0000000..4f0d41a --- /dev/null +++ b/bin/tcsh/ed.h @@ -0,0 +1,226 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/ed.h,v 3.0 1991/07/04 21:49:28 christos Exp $ */ +/* + * ed.h: Editor declarations and globals + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#ifndef _h_ed +#define _h_ed + +#ifndef EXTERN +#define EXTERN extern +#endif + +#define TABSIZE 8 /* usually 8 spaces/tab */ +#ifdef pdp11 /* jpn: save space */ +#define INBUFSIZ (BUFSIZ / 2) /* size of input buffer */ +#else +#define INBUFSIZ BUFSIZ /* size of input buffer */ +#endif /* pdp11 */ +#define MAXMACROLEVELS 10 /* max number of nested kbd macros */ + +extern int errno; + +/****************************************************************************/ +/* stuff for the different states returned by the character editor routines */ +/****************************************************************************/ + +#define CCRETVAL char /* size needed for the different char editor */ + /* return values */ + +#define KEYCMD unsigned char /* size needed to index into CcFuncTbl */ + /* Must be unsigned */ + +typedef CCRETVAL(*PFCmd) (); /* pointer to function returning CCRETVAL */ + +struct KeyFuncs { /* for the "bind" shell command */ + char *name; /* function name for bind command */ + int func; /* function numeric value */ +#ifdef LONGFUNCS + char *description; /* description of function */ +#endif +}; + +extern PFCmd CcFuncTbl[]; /* table of available commands */ +extern KEYCMD CcKeyMap[]; /* keymap table, each index into above tbl */ +extern KEYCMD CcAltMap[]; /* Alt keymap table */ +extern KEYCMD CcEmacsMap[]; /* keymap table for Emacs default bindings */ +extern KEYCMD CcViMap[]; /* keymap table for Vi input mode defaults */ +extern KEYCMD CcViCmdMap[]; /* for Vi command mode defaults */ +extern struct KeyFuncs FuncNames[]; /* string names vs. CcFuncTbl indices */ + +EXTERN KEYCMD NumFuns; /* number of KEYCMDs in above table */ + +#define CC_ERROR 100 /* there should NOT be 100 different... */ +#define CC_FATAL 101 /* fatal error: inconsistant, must + * reset */ +#define CC_NORM 0 +#define CC_NEWLINE 1 +#define CC_EOF 2 +#define CC_COMPLETE 3 +#define CC_LIST_CHOICES 4 +#define CC_LIST_GLOB 5 +#define CC_EXPAND_GLOB 6 +#define CC_HELPME 9 +#define CC_CORRECT 10 +#define CC_WHICH 11 +#define CC_ARGHACK 12 +#define CC_CORRECT_L 13 +#define CC_REFRESH 14 +#define CC_EXPAND_VARS 15 + +/*************************/ +/* tty state */ +/*************************/ + + +#ifndef POSIX +#ifdef TERMIO +EXTERN struct termio nio; +EXTERN struct termio xio; +EXTERN struct termio testio; + +#if defined(OREO) || defined(hpux) || defined(_IBMR2) +EXTERN struct ltchars nlc; +EXTERN struct ltchars xlc; +EXTERN struct ltchars testlc; + +#endif /* OREO || hpux || _IBMR2 */ + +#else /* GSTTY */ +EXTERN struct sgttyb nb; /* original setup tty bits */ +EXTERN struct tchars ntc; +EXTERN struct ltchars nlc; +EXTERN int nlb; + +EXTERN struct sgttyb xb; /* running setup tty bits */ +EXTERN struct tchars xtc; +EXTERN struct ltchars xlc; +EXTERN int xlb; + +EXTERN struct sgttyb testsgb; /* running setup tty bits */ +EXTERN int testnlb; /* test local mode word */ +EXTERN struct tchars testtc; +EXTERN struct ltchars testlc; + +#ifdef TIOCGPAGE +EXTERN struct ttypagestat npc; +EXTERN struct ttypagestat xpc; +EXTERN struct ttypagestat testpc; + +#endif /* TIOCGPAGE */ + +#endif /* TERMIO */ +#else /* POSIX */ +EXTERN struct termios nio; +EXTERN struct termios xio; +EXTERN struct termios testio; + +#if defined(hpux) +EXTERN struct ltchars nlc; +EXTERN struct ltchars xlc; +EXTERN struct ltchars testlc; + +#endif /* hpux */ +#endif /* POSIX */ + + + +/****************************/ +/* Editor state and buffers */ +/****************************/ + +EXTERN KEYCMD *Cur_KeyMap; /* current command key map */ +EXTERN int replacemode; /* true if in overwrite mode */ +EXTERN Char GettingInput; /* true if getting an input line (mostly) */ +EXTERN Char NeedsRedraw; /* for editor and twenex error messages */ +EXTERN Char InputBuf[INBUFSIZ]; /* the real input data */ +EXTERN Char *LastChar, *Cursor; /* point to the next open space */ +EXTERN Char *InputLim; /* limit of size of InputBuf */ +EXTERN Char MetaNext; /* flags for ^V and ^[ functions */ +EXTERN Char AltKeyMap; /* Using alternative command map (for vi mode) */ +EXTERN Char VImode; /* true if running in vi mode (PWP 6-27-88) */ +EXTERN Char *Mark; /* the emacs "mark" (dot is Cursor) */ +EXTERN Char DoingArg; /* true if we have an argument */ +EXTERN int Argument; /* "universal" argument value */ +EXTERN KEYCMD LastCmd; /* previous command executed */ +EXTERN Char KillBuf[INBUFSIZ]; /* kill buffer */ +EXTERN Char *LastKill; /* points to end of kill buffer */ +EXTERN Char HistBuf[INBUFSIZ]; /* history buffer */ +EXTERN Char *LastHist; /* points to end of history buffer */ +EXTERN int Hist_num; /* what point up the history we are at now. */ +EXTERN Char WhichBuf[INBUFSIZ]; /* buffer for which command */ +EXTERN Char *LastWhich; /* points to end of which buffer */ +EXTERN Char *CursWhich; /* points to the cursor point in which buf */ +EXTERN int HistWhich; /* Hist_num is saved in this */ +EXTERN Char *SearchPrompt; /* points to string that holds search prompt */ +EXTERN Char DoingSearch; /* true if we are doing a history search */ +EXTERN char Expand; /* true if we are expanding a line */ +EXTERN Char HistLit; /* true if history lines are shown literal */ +EXTERN Char Cur_HistLit; /* Literal status of current show history line */ + +/* + * These are truly extern + */ +extern Char PromptBuf[]; +extern short SHIN, SHOUT; +extern int MacroLvl; + +EXTERN Char *KeyMacro[MAXMACROLEVELS]; + +EXTERN Char **Display; /* display buffer seed vector */ +EXTERN int CursorV, /* real cursor vertical (line) */ + CursorH, /* real cursor horisontal (column) */ + TermV, /* number of real screen lines + * (sizeof(DisplayBuf) / width */ + TermH; /* screen width */ +EXTERN Char **Vdisplay; /* new buffer */ + +/* Variables that describe terminal ability */ +EXTERN int T_Lines, T_Cols; /* Rows and Cols of the terminal */ +EXTERN Char T_CanIns; /* true if I can insert characters */ +EXTERN Char T_CanDel; /* dito for delete characters */ +EXTERN Char T_Tabs; /* true if tty interface is passing tabs */ +EXTERN speed_t T_Speed; /* Tty input Baud rate */ +EXTERN Char T_CanCEOL; /* true if we can clear to end of line */ +EXTERN Char T_CanUP; /* true if this term can do reverse linefeen */ +EXTERN Char T_HasMeta; /* true if we have a meta key */ + +/* note the extra characters in the index() call in this macro */ +#define isword(c) (Isalpha(c)||Isdigit(c)||Strchr(word_chars,c)) +#define min(x,y) (((x)<(y))?(x):(y)) +#define max(x,y) (((x)>(y))?(x):(y)) + +#include "ed.decls.h" + +#endif /* _h_ed */ diff --git a/bin/tcsh/ed.init.c b/bin/tcsh/ed.init.c new file mode 100644 index 0000000..acbca78 --- /dev/null +++ b/bin/tcsh/ed.init.c @@ -0,0 +1,1094 @@ +/* + * ed.init.c: Editor initializations + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#include "config.h" +#if !defined(lint) && !defined(pdp11) +static char *rcsid() + { return "$Id: ed.init.c,v 3.1 1997/3/28 21:49:28 sms Exp $"; } +#endif + +#include "sh.h" +#define EXTERN /* intern */ +#include "ed.h" +#include "ed.defns.h" + +#if defined(TERMIO) || defined(POSIX) +/* + * Aix compatible names + */ +# if defined(VWERSE) && !defined(VWERASE) +# define VWERASE VWERSE +# endif /* VWERSE && !VWERASE */ + +# if defined(VDISCRD) && !defined(VDISCARD) +# define VDISCARD VDISCRD +# endif /* VDISCRD && !VDISCARD */ + +# if defined(VSTRT) && !defined(VSTART) +# define VSTART VSTRT +# endif /* VSTRT && ! VSTART */ + +# if defined(VSTAT) && !defined(VSTATUS) +# define VSTATUS VSTAT +# endif /* VSTAT && ! VSTATUS */ + +# ifndef ONLRET +# define ONLRET 0 +# endif /* ONLRET */ + +# ifndef TAB3 +# ifdef OXTABS +# define TAB3 OXTABS +# else +# define TAB3 0 +# endif /* OXTABS */ +# endif /* !TAB3 */ + +# ifndef ONLCR +# define ONLCR 0 +# endif /* ONLCR */ + +# ifndef IEXTEN +# define IEXTEN 0 +# endif /* IEXTEN */ + +# ifndef ECHOCTL +# define ECHOCTL 0 +# endif /* ECHOCTL */ + +# ifndef PARENB +# define PARENB 0 +# endif /* PARENB */ + +# ifndef EXTPROC +# define EXTPROC 0 +# endif /* EXTPROC */ + +# ifndef FLUSHO +# define FLUSHO 0 +# endif /* FLUSHO */ + +# if defined(VDISABLE) && !defined(_POSIX_VDISABLE) +# define _POSIX_VDISABLE VDISABLE +# endif /* VDISABLE && ! _POSIX_VDISABLE */ + +# ifndef _POSIX_VDISABLE +# define _POSIX_VDISABLE -1 +# endif /* _POSIX_VDISABLE */ + +/* + * Work around ISC's definition of IEXTEN which is + * XCASE! + */ +# ifdef ISC +# ifdef IEXTEN +# undef IEXTEN +# endif /* IEXTEN */ +# define IEXTEN 0 +# endif /* ISC */ +#endif /* TERMIO || POSIX */ + + +/* ed.init.c -- init routines for the line editor */ + +int Tty_raw_mode = 0; /* Last tty change was to raw mode */ +int MacroLvl = -1; /* pointer to current macro nesting level; */ + /* (-1 == none) */ +static int Tty_quote_mode = 0; /* Last tty change was to quote mode */ + +int Tty_eight_bit = -1; /* does the tty handle eight bits */ + +extern bool GotTermCaps; + +#ifdef _IBMR2 +static bool edit_discipline = 0; +union txname tx_disc; +extern char strPOSIX[]; +#endif /* _IBMR2 */ + +static int dosetkey __P((char *, char *)); + +#ifdef SIG_WINDOW +void +check_window_size(force) + int force; +{ +#ifdef BSDSIGS + sigmask_t omask; +#endif /* BSDSIGS */ + int lins, cols; + + /* don't want to confuse things here */ +#ifdef BSDSIGS + omask = sigblock(sigmask(SIG_WINDOW)) & ~sigmask(SIG_WINDOW); +#else /* BSDSIGS */ + (void) sighold(SIG_WINDOW); +#endif /* BSDSIGS */ + + /* + * From: bret@shark.agps.lanl.gov (Bret Thaeler) Avoid sunview bug, where a + * partially hidden window gets a SIG_WINDOW every time the text is + * scrolled + */ + if (GetSize(&lins, &cols) || force) { + if (GettingInput) { + ClearLines(); + ClearDisp(); + MoveToLine(0); + MoveToChar(0); + ChangeSize(lins, cols); + Refresh(); + } + else + ChangeSize(lins, cols); + } + +#ifdef BSDSIGS + (void) sigsetmask(omask); /* can change it again */ +#else /* BSDSIGS */ + (void) sigrelse(SIG_WINDOW); +#endif /* BSDSIGS */ +} + +sigret_t +/*ARGSUSED*/ +window_change(snum) +int snum; +{ + check_window_size(0); +#ifndef SIGVOID + return (snum); +#endif +} + +#endif /* SIG_WINDOW */ + +/* LPASS8 is new in 4.3, and makes cbreak mode provide all 8 bits. */ +#ifndef LPASS8 +# define LPASS8 0 /* we don't have it. Too bad!! */ +#endif + +#ifndef CTRL +# define CTRL(c) ('c'&037) +#endif + +void +ed_set_tty_eight_bit() +{ +#ifndef POSIX +# ifdef TERMIO + struct termio ttynio; +# else /* GSTTY */ + int ttynlb; +# endif /* TERMIO */ +#else /* POSIX */ + struct termios ttynio; +#endif /* POSIX */ + +#ifndef POSIX +# ifdef TERMIO + (void) ioctl(SHIN, TCGETA, (ioctl_t) & ttynio); +# else /* GSTTY */ + (void) ioctl(SHIN, TIOCLGET, (ioctl_t) & ttynlb); +# endif /* TERMIO */ +#else /* POSIX */ + (void) tcgetattr(SHIN, &ttynio); +#endif /* POSIX */ + +#if defined(TERMIO) || defined(POSIX) + Tty_eight_bit = (ttynio.c_cflag & CSIZE) == CS8; +#else /* GSTTY */ + Tty_eight_bit = ttynlb & (LPASS8 | LLITOUT); +#endif +} + +void +ed_I() +{ + static int havesetup = 0; + + ResetInLine(); /* reset the input pointers */ + GettingInput = 0; /* just in case */ + LastKill = KillBuf; /* no kill buffer */ + +#ifdef DEBUG_EDIT + CheckMaps(); /* do a little error checking on key maps */ +#endif + + if (!havesetup) { /* if we have never been called */ + replacemode = 0; /* start out in insert mode */ + ed_IMaps(); + Hist_num = 0; + Expand = 0; + +#ifndef POSIX +# ifdef TERMIO + (void) ioctl(SHIN, TCGETA, (ioctl_t) & nio); +# ifdef CBAUD + T_Speed = nio.c_cflag & CBAUD; +# else + T_Speed = 0; +# endif +# else /* GSTTY */ + (void) ioctl(SHIN, TIOCGETP, (ioctl_t) & nb); /* normal setup */ + xb = nb; /* new setup */ + (void) ioctl(SHIN, TIOCGETC, (ioctl_t) & ntc); + xtc = ntc; + (void) ioctl(SHIN, TIOCGLTC, (ioctl_t) & nlc); + xlc = nlc; +# ifdef TIOCGPAGE + (void) ioctl(SHIN, TIOCGPAGE, (ioctl_t) & npc); + xpc = npc; +# endif /* TIOCGPAGE */ + (void) ioctl(SHIN, TIOCLGET, (ioctl_t) & nlb); + xlb = nlb; + T_Speed = nb.sg_ispeed; +# endif /* TERMIO */ +#else /* POSIX */ + (void) tcgetattr(SHIN, &nio); + T_Speed = cfgetispeed(&nio); +#endif /* POSIX */ + +#if defined(TERMIO) || defined(POSIX) + xio = nio; + + if ((nio.c_oflag & TAB3) == TAB3) { /* then no tabs */ + T_Tabs = 0; + } + else { + T_Tabs = 1; + } + + nio.c_iflag &= ~(INLCR | IGNCR); + nio.c_iflag |= (ICRNL); + + nio.c_oflag &= ~(ONLRET); + nio.c_oflag |= (OPOST | ONLCR); + /* don't muck with c_cflag */ + nio.c_lflag &= ~(NOFLSH | ECHOK | ECHONL | EXTPROC | FLUSHO); + nio.c_lflag |= (ISIG | ICANON | ECHO | ECHOE | ECHOCTL | IEXTEN); + +# ifdef IRIX3_3 + nio.c_line = NTTYDISC; +# endif /* IRIX3_3 */ + nio.c_cc[VINTR] = '\003'; /* ^C */ + nio.c_cc[VQUIT] = '\034'; /* ^\ */ + nio.c_cc[VERASE] = '\177'; /* ^? */ + nio.c_cc[VKILL] = '\025'; /* ^U */ + nio.c_cc[VEOF] = '\004';/* ^D */ + nio.c_cc[VEOL] = _POSIX_VDISABLE; +# ifdef VEOL2 + nio.c_cc[VEOL2] = _POSIX_VDISABLE; +# endif +# ifdef VSWTCH + nio.c_cc[VSWTCH] = _POSIX_VDISABLE; +# endif /* VSWTCH */ +# ifdef VSTART + nio.c_cc[VSTART] = '\021'; /* ^Q */ +# endif /* VSTART */ +# ifdef VSTOP + nio.c_cc[VSTOP] = '\023'; /* ^S */ +# endif /* VSTOP */ +# ifdef VWERASE + nio.c_cc[VWERASE] = '\027'; /* ^W */ +# endif /* VWERASE */ +# ifdef VSUSP + nio.c_cc[VSUSP] = CSUSP; +# endif +# ifdef VDSUSP + nio.c_cc[VDSUSP] = '\031'; /* ^Y */ +# endif /* VDSUSP */ +# ifdef VREPRINT + nio.c_cc[VREPRINT] = '\022'; /* ^R */ +# endif /* WREPRINT */ +# ifdef VDISCARD + nio.c_cc[VDISCARD] = '\017'; /* ^O */ +# endif /* VDISCARD */ +# ifdef VLNEXT + nio.c_cc[VLNEXT] = '\026'; /* ^V */ +# endif /* VLNEXT */ +# ifdef VSTATUS + nio.c_cc[VSTATUS] = '\024'; /* ^T */ +# endif /* VSTATUS */ +# ifdef VPGOFF + nio.c_cc[VPGOFF] = ' '; /* " " */ +# endif /* VPGOFF */ +# ifdef VPAGE + nio.c_cc[VPAGE] = '\015'; /* ^M */ +# endif /* VPAGE */ + +# if defined(OREO) || defined(hpux) || defined(_IBMR2) + + (void) ioctl(SHIN, TIOCGLTC, (ioctl_t) & nlc); + xlc = nlc; + + nlc.t_suspc = '\032'; /* stop process signal */ + nlc.t_dsuspc = '\031'; /* delayed stop process signal */ +# ifdef hpux + /* + * These must be 0377. (Reserved) + */ + nlc.t_rprntc = _POSIX_VDISABLE; /* reprint line */ + nlc.t_flushc = _POSIX_VDISABLE; /* flush output (toggles) */ + nlc.t_werasc = _POSIX_VDISABLE; /* word erase */ + nlc.t_lnextc = _POSIX_VDISABLE; /* literal next character */ +# else + nlc.t_rprntc = '\022'; /* reprint line */ + nlc.t_flushc = '\017'; /* flush output (toggles) */ + nlc.t_werasc = '\027'; /* word erase */ + nlc.t_lnextc = '\026'; /* literal next character */ +# endif /* hpux */ +# endif /* OREO || hpux || _IBMR2 */ +# ifdef SIG_WINDOW + (void) sigset(SIG_WINDOW, window_change); /* for window systems */ +# endif +#else /* GSTTY */ /* V7, Berkeley style tty */ + + + if ((xb.sg_flags & XTABS) == XTABS) { /* check for no tabs mode */ + T_Tabs = 0; + } + else { + T_Tabs = 1; + } + + if (T_Tabs) { + nb.sg_flags &= ~(CBREAK | RAW | XTABS); + nb.sg_flags |= (ECHO | CRMOD | ANYP); + } + else { + nb.sg_flags &= ~(CBREAK | RAW); + nb.sg_flags |= (ECHO | CRMOD | XTABS | ANYP); + } + nlb &= ~(LPRTERA); /* let 8-bit mode stand as set */ + nlb |= (LCRTBS | LCRTERA | LCRTKIL); + + nb.sg_erase = '\177'; /* del prev. char == DEL */ + nb.sg_kill = '\025'; /* special case of del region */ + + ntc.t_intrc = '\003'; /* SIGINTR */ + ntc.t_quitc = '\034'; /* SIGQUIT */ + ntc.t_startc = '\021'; /* start output */ + ntc.t_stopc = '\023'; /* stop output */ + ntc.t_eofc = '\004'; /* no eof char during input... */ +# ifdef masscomp + /* NUL is prefered to in this char, DAS DEC-90. */ + ntc.t_brkc = '\0'; /* input delimiter (like nl) */ +# else + ntc.t_brkc = -1; /* input delimiter (like nl) */ +# endif + + nlc.t_suspc = '\032'; /* stop process signal */ + nlc.t_dsuspc = '\031'; /* delayed stop process signal */ + nlc.t_rprntc = '\022'; /* reprint line */ + nlc.t_flushc = '\017'; /* flush output (toggles) */ + nlc.t_werasc = '\027'; /* word erase */ + nlc.t_lnextc = '\026'; /* literal next character */ + +# ifdef TIOCGPAGE + npc.tps_length = 0; + npc.tps_lpos = 0; + npc.tps_statc = '\024'; /* Show status ^T */ + npc.tps_pagec = '\040'; /* show next page " " */ + npc.tps_pgoffc = '\015';/* Ignore paging until input ^M */ + npc.tps_flag = 0; +# endif /* TIOCGPAGE */ + +# ifdef SIG_WINDOW + (void) sigset(SIG_WINDOW, window_change); /* for window systems */ +# endif +#endif /* TERMIO */ + } + + /* + * if we have been called before but GotTermCaps isn't set, our TERM has + * changed, so get new t_c_s and try again + */ + + if (!GotTermCaps) + GetTermCaps(); /* does the obvious, but gets term type each + * time */ + +#if defined(TERMIO) || defined(POSIX) + xio.c_iflag &= ~(IGNCR); + xio.c_iflag |= (INLCR | ICRNL); + + Tty_eight_bit = (xio.c_cflag & CSIZE) == CS8; + + xio.c_oflag &= ~(ONLRET); + xio.c_oflag |= (OPOST | ONLCR); + + xio.c_lflag &= ~(NOFLSH | ICANON | ECHO | ECHOE | ECHOK | ECHONL | + EXTPROC | IEXTEN | FLUSHO); + xio.c_lflag |= (ISIG); + +# ifdef IRIX3_3 + xio.c_line = NTTYDISC; +# endif /* IRIX3_3 */ + xio.c_cc[VINTR] = '\003'; /* ^C */ + xio.c_cc[VQUIT] = '\034'; /* ^\ */ + xio.c_cc[VERASE] = '\177'; /* ^? */ + xio.c_cc[VKILL] = '\025'; /* ^U */ + xio.c_cc[VMIN] = 1; /* one char at a time input */ + xio.c_cc[VTIME] = 0; /* don't time out */ +# ifdef VEOL2 + xio.c_cc[VEOL2] = _POSIX_VDISABLE; +# endif /* VEOL2 */ +# ifdef VSWTCH + xio.c_cc[VSWTCH] = _POSIX_VDISABLE; +# endif /* VSWTCH */ +# ifdef VSTART + xio.c_cc[VSTART] = '\021'; /* ^Q */ +# endif /* VSTART */ +# ifdef VSTOP + xio.c_cc[VSTOP] = '\023'; /* ^S */ +# endif /* VSTOP */ +# ifdef VWERASE + xio.c_cc[VWERASE] = _POSIX_VDISABLE; +# endif /* VWERASE */ +# ifdef VSUSP + xio.c_cc[VSUSP] = _POSIX_VDISABLE; +# endif /* VSUSP */ +# ifdef VDSUSP + xio.c_cc[VDSUSP] = _POSIX_VDISABLE; +# endif /* VDSUSP */ +# ifdef VREPRINT + xio.c_cc[VREPRINT] = _POSIX_VDISABLE; +# endif /* VREPRINT */ +# ifdef VDISCARD + xio.c_cc[VDISCARD] = '\017';/* ^O */ +# endif /* VDISCARD */ +# ifdef VLNEXT + xio.c_cc[VLNEXT] = _POSIX_VDISABLE; +# endif /* VLNEXT */ +# ifdef VSTATUS + xio.c_cc[VSTATUS] = '\024'; /* ^T */ +# endif /* VSTATUS */ +# ifdef VPGOFF + xio.c_cc[VPGOFF] = ' '; /* " " */ +# endif /* VPGOFF */ +# ifdef VPAGE + xio.c_cc[VPAGE] = '\015'; /* ^M */ +# endif /* VPAGE */ + +# if defined(OREO) || defined(hpux) || defined(_IBMR2) + xlc.t_suspc = -1; /* stop process signal */ + xlc.t_dsuspc = -1; /* delayed stop process signal */ +# ifdef hpux + /* + * These must be 0377. (Reserved) + */ + xlc.t_rprntc = '\377'; /* reprint line */ + xlc.t_flushc = '\377'; /* flush output (toggles) */ + xlc.t_werasc = '\377'; /* word erase */ + xlc.t_lnextc = '\377'; /* literal next character */ +# else + xlc.t_rprntc = -1; /* reprint line */ + xlc.t_flushc = '\017'; /* flush output */ + xlc.t_werasc = -1; /* word erase */ + xlc.t_lnextc = -1; /* literal next character */ +# endif /* hpux */ +# endif /* OREO || hpux || _IBMR2 */ +#else /* GSTTY */ + if (T_Tabs) { + xb.sg_flags &= ~(RAW | ECHO | XTABS); + xb.sg_flags |= (CBREAK | CRMOD | ANYP); + } + else { + xb.sg_flags &= ~(RAW | ECHO); + xb.sg_flags |= (CBREAK | CRMOD | ANYP | XTABS); + } + + xb.sg_erase = '\177'; /* del prev. char == DEL */ + xb.sg_kill = '\025'; /* special case of del region */ + /* bugfix by Michael Boom */ + + xtc.t_intrc = '\003'; /* SIGINTR */ + xtc.t_quitc = '\034'; /* SIGQUIT */ + xtc.t_startc = '\021'; /* start output */ + xtc.t_stopc = '\023'; /* stop output */ + xtc.t_eofc = -1; /* no eof char during input... */ +# ifdef masscomp + /* NUL is prefered to in this char, DAS DEC-90. */ + xtc.t_brkc = '\0'; /* input delimiter (like nl) */ +# else + xtc.t_brkc = -1; /* input delimiter (like nl) */ +# endif + + xlc.t_suspc = -1; /* stop process signal (was CTRL(z)) */ + xlc.t_dsuspc = -1; /* delayed stop process signal */ + xlc.t_rprntc = -1; /* reprint line */ + xlc.t_flushc = '\017'; /* flush output */ + xlc.t_werasc = -1; /* word erase */ + xlc.t_lnextc = -1; /* literal next character */ + +# ifdef TIOCGPAGE + xpc.tps_length = 0; + xpc.tps_lpos = 0; + xpc.tps_statc = -1; /* disable show status */ + xpc.tps_pagec = -1; /* disable show next page */ + xpc.tps_pgoffc = -1; /* disable Ignore paging until input */ + xpc.tps_flag = 0; +# endif /* TIOCGPAGE */ + + xlb &= ~LPRTERA; + xlb |= (LCRTBS | LCRTERA | LCRTKIL); + Tty_eight_bit = nlb & (LPASS8 | LLITOUT); +#endif /* TERMIO || POSIX */ + havesetup = 1; + + /* Make sure the tty has a well-defined initial state */ + /* But don't bother to alter the settings if we are not editing */ + if (editing) { + Tty_raw_mode = 0; + (void) Rawmode(); + } +} + +static int +dosetkey(tcp, ncp) + char *tcp, *ncp; +{ + if ((*tcp & 0377) > 0 && (*tcp & 0377) < 0377) { + *ncp = *tcp; + return 1; + } + return 0; +} + +/* + * Check and re-init the line. set the terminal into 1 char at a time mode. + */ +int +Rawmode() +{ +#ifdef POSIX + speed_t tspeed; +#endif /* POSIX */ + + if (Tty_raw_mode) + return (0); +#ifdef _IBMR2 + tx_disc.tx_which = 0; + if (ioctl(FSHTTY, TXGETLD, (ioctl_t) & tx_disc) < 0) + return (-1); + if (strcmp(tx_disc.tx_name, strPOSIX) != 0) { + edit_discipline = 1; + if (ioctl(FSHTTY, TXSETLD, (ioctl_t) strPOSIX) < 0) + return (-1); + } +#endif /* _IBMR2 */ + +#ifndef POSIX +# ifdef TERMIO + if (ioctl(SHIN, TCGETA, (ioctl_t) & testio) < 0) + return (-1); /* SHIN has been closed */ +# else /* GSTTY */ + if (ioctl(SHIN, TIOCGETP, (ioctl_t) & testsgb) < 0) + return (-1); /* SHIN has been closed */ + /* test the normal flags */ +# endif /* TERMIO */ +#else /* POSIX */ + if (tcgetattr(SHIN, &testio) < 0) + return (-1); /* SHIN has been closed */ +#endif /* POSIX */ + +#if defined(POSIX) || defined(TERMIO) + Tty_eight_bit = (testio.c_cflag & CSIZE) == CS8; + if (testio.c_cflag != nio.c_cflag) { + nio.c_cflag = testio.c_cflag; + xio.c_cflag = testio.c_cflag; + } +# ifdef POSIX + /* + * Fix from: Steven (Steve) B. Green + * Speed was not being set up correctly under POSIX. + */ + if ((tspeed = cfgetispeed(&testio)) == 0) + tspeed = cfgetospeed(&testio); + if (tspeed != cfgetispeed(&nio)) { + T_Speed = tspeed; + (void) cfsetispeed(&nio, T_Speed); + (void) cfsetospeed(&nio, T_Speed); + (void) cfsetispeed(&xio, T_Speed); + (void) cfsetospeed(&xio, T_Speed); + } +# else /* !POSIX */ +# ifdef CBAUD + T_Speed = nio.c_cflag & CBAUD; +# else + T_Speed = 0; +# endif /* CBAUD */ +# endif /* !POSIX */ + + if ((testio.c_lflag != nio.c_lflag) && + (testio.c_lflag != xio.c_lflag)) { + /* Christos: There was and ifdef here that would set ECHONL!?? */ + nio.c_lflag = testio.c_lflag; + nio.c_lflag &= ~(NOFLSH | ECHOK | ECHONL | EXTPROC | FLUSHO); + nio.c_lflag |= (ISIG | ICANON | IEXTEN | ECHO | ECHOE | ECHOCTL); + xio.c_lflag = testio.c_lflag; + xio.c_lflag &= ~(NOFLSH | ICANON | IEXTEN | ECHO | ECHOE | ECHOK | + ECHONL | ECHOCTL | EXTPROC | FLUSHO); + xio.c_lflag |= (ISIG); + } + + if ((testio.c_iflag != nio.c_iflag) && + (testio.c_iflag != xio.c_iflag)) { + nio.c_iflag = testio.c_iflag; + nio.c_iflag &= ~(INLCR | IGNCR); + nio.c_iflag |= (ICRNL); + xio.c_iflag = testio.c_iflag; + xio.c_iflag &= ~(INLCR | IGNCR); + xio.c_iflag |= (ICRNL); + } + + if ((testio.c_oflag != nio.c_oflag) && + (testio.c_oflag != xio.c_oflag)) { + /* Christos: There was and ifdef here that would set ONLRET!?? */ + nio.c_oflag = testio.c_oflag; + nio.c_oflag &= ~(ONLRET); + nio.c_oflag |= (OPOST | ONLCR); + xio.c_oflag = testio.c_oflag; + xio.c_oflag &= ~(ONLRET); + xio.c_oflag |= (OPOST | ONLCR); + } + if ((nio.c_oflag & TAB3) == TAB3) { /* check for no tabs mode */ + T_Tabs = 0; + } + else { + T_Tabs = CanWeTab(); + } + if (dosetkey((char *) &testio.c_cc[VINTR], (char *) &nio.c_cc[VINTR])) + (void) dosetkey((char *) &testio.c_cc[VINTR], (char *) &xio.c_cc[VINTR]); + if (dosetkey((char *) &testio.c_cc[VQUIT], (char *) &nio.c_cc[VQUIT])) + (void) dosetkey((char *) &testio.c_cc[VQUIT], (char *) &xio.c_cc[VQUIT]); + if (dosetkey((char *) &testio.c_cc[VERASE], (char *) &nio.c_cc[VERASE])) + (void) dosetkey((char *) &testio.c_cc[VERASE], + (char *) &xio.c_cc[VERASE]); + if (dosetkey((char *) &testio.c_cc[VKILL], (char *) &nio.c_cc[VKILL])) + (void) dosetkey((char *) &testio.c_cc[VKILL], + (char *) &xio.c_cc[VKILL]); + if (testio.c_cc[VEOF] != 1) { /* 'cause VEOL == VNUM, and 1 is raw + * mode */ + (void) dosetkey((char *) &testio.c_cc[VEOF], (char *) &nio.c_cc[VEOF]); + (void) dosetkey((char *) &testio.c_cc[VEOL], (char *) &nio.c_cc[VEOL]); + } +# ifdef VSWTCH + if (dosetkey((char *) &testio.c_cc[VSWTCH], (char *) &nio.c_cc[VSWTCH])) + (void) dosetkey((char *) &testio.c_cc[VSWTCH], + (char *) &xio.c_cc[VSWTCH]); +# endif /* VSWTCH */ +# ifdef VEOL2 + if (dosetkey((char *) &testio.c_cc[VEOL2], (char *) &nio.c_cc[VEOL2])) + (void) dosetkey((char *) &testio.c_cc[VEOL2], + (char *) &xio.c_cc[VEOL2]); +# endif /* VEOL2 */ +# ifdef VSTART + if (dosetkey((char *) &testio.c_cc[VSTART], (char *) &nio.c_cc[VSTART])) + (void) dosetkey((char *) &testio.c_cc[VSTART], + (char *) &xio.c_cc[VSTART]); +# endif /* VSTART */ +# ifdef VSTOP + if (dosetkey((char *) &testio.c_cc[VSTOP], (char *) &nio.c_cc[VSTOP])) + (void) dosetkey((char *) &testio.c_cc[VSTOP], + (char *) &xio.c_cc[VSTOP]); +# endif /* VSTOP */ +# ifdef VWERASE + (void) dosetkey((char *) &testio.c_cc[VWERASE], + (char *) &nio.c_cc[VWERASE]); +# endif /* VWERASE */ +# ifdef VREPRINT + (void) dosetkey((char *) &testio.c_cc[VREPRINT], + (char *) &nio.c_cc[VREPRINT]); +# endif /* VREPRINT */ +# ifdef VSUSP + (void) dosetkey((char *) &testio.c_cc[VSUSP], (char *) &nio.c_cc[VSUSP]); +# endif /* VSUSP */ +# ifdef VDSUSP + (void) dosetkey((char *) &testio.c_cc[VDSUSP], (char *) &nio.c_cc[VDSUSP]); +# endif /* VDSUSP */ +# ifdef VLNEXT + (void) dosetkey((char *) &testio.c_cc[VLNEXT], (char *) &nio.c_cc[VLNEXT]); +# endif /* VLNEXT */ +# ifdef VDISCARD + if (dosetkey((char *) &testio.c_cc[VDISCARD], (char *) &nio.c_cc[VDISCARD])) + (void) dosetkey((char *) &testio.c_cc[VDISCARD], + (char *) &xio.c_cc[VDISCARD]); +# endif /* VDISCARD */ +# ifdef VSTATUS + if (dosetkey((char *) &testio.c_cc[VSTATUS], (char *) &nio.c_cc[VSTATUS])) + (void) dosetkey((char *) &testio.c_cc[VSTATUS], + (char *) &xio.c_cc[VSTATUS]); +# endif /* VSTATUS */ +# ifdef VPGOFF + if (dosetkey((char *) &testio.c_cc[VPGOFF], (char *) &nio.c_cc[VPGOFF])) + (void) dosetkey((char *) &testio.c_cc[VPGOFF], + (char *) &xio.c_cc[VPGOFF]); +# endif /* VPGOFF */ +# ifdef VPAGE + if (dosetkey((char *) &testio.c_cc[VPAGE], (char *) &nio.c_cc[VPAGE])) + (void) dosetkey((char *) &testio.c_cc[VPAGE], + (char *) &xio.c_cc[VPAGE]); +# endif /* VPAGE */ + +# ifndef POSIX + if (ioctl(SHIN, TCSETAW, (ioctl_t) & xio) < 0) + return (-1); +# else /* POSIX */ + if (tcsetattr(SHIN, TCSADRAIN, &xio) < 0) + return (-1); +# endif /* POSIX */ + +# if defined(OREO) || defined(hpux) || defined(_IBMR2) + /* get and set the new local chars */ + if (ioctl(SHIN, TIOCGLTC, (ioctl_t) & testlc) < 0) + return (-1); + + (void) dosetkey((char *) &testlc.t_suspc, (char *) &nlc.t_suspc); + (void) dosetkey((char *) &testlc.t_dsuspc, (char *) &nlc.t_dsuspc); + (void) dosetkey((char *) &testlc.t_rprntc, (char *) &nlc.t_rprntc); + if (dosetkey((char *) &testlc.t_flushc, (char *) &nlc.t_flushc)) + xlc.t_flushc = nlc.t_flushc; + (void) dosetkey((char *) &testlc.t_werasc, (char *) &nlc.t_werasc); + (void) dosetkey((char *) &testlc.t_lnextc, (char *) &nlc.t_lnextc); + if (ioctl(SHIN, TIOCSLTC, (ioctl_t) & xlc) < 0) + return (-1); +# endif /* OREO || hpux || _IBMR2 */ + +#else /* GSTTY */ /* for BSD... */ + + if (testsgb.sg_ispeed != nb.sg_ispeed) { + nb.sg_ispeed = testsgb.sg_ispeed; + xb.sg_ispeed = testsgb.sg_ispeed; + } + if (testsgb.sg_ospeed != nb.sg_ospeed) { + nb.sg_ospeed = testsgb.sg_ospeed; + xb.sg_ospeed = testsgb.sg_ospeed; + } + T_Speed = nb.sg_ispeed; + + /* get and set the terminal characters */ + /* bugfix by Bruce Robertson */ + /* include erase and kill in the tests */ + if (dosetkey((char *) &testsgb.sg_erase, (char *) &nb.sg_erase)) + xb.sg_erase = nb.sg_erase; + if (dosetkey((char *) &testsgb.sg_kill, (char *) &nb.sg_kill)) + xb.sg_kill = nb.sg_kill; + + (void) ioctl(SHIN, TIOCGETC, (ioctl_t) & testtc); + if (dosetkey((char *) &testtc.t_intrc, (char *) &ntc.t_intrc)) + xtc.t_intrc = ntc.t_intrc; + if (dosetkey((char *) &testtc.t_quitc, (char *) &ntc.t_quitc)) + xtc.t_quitc = ntc.t_quitc; + if (dosetkey((char *) &testtc.t_startc, (char *) &ntc.t_startc)) + xtc.t_startc = ntc.t_startc; + if (dosetkey((char *) &testtc.t_stopc, (char *) &ntc.t_stopc)) + xtc.t_stopc = ntc.t_stopc; + if (dosetkey((char *) &testtc.t_eofc, (char *) &ntc.t_eofc)) + xtc.t_eofc = ntc.t_eofc;/* someone might want to change EOF */ + /* in general, t_brkc shouldn't change */ + (void) dosetkey((char *) &testtc.t_brkc, (char *) &ntc.t_brkc); + + if (ioctl(SHIN, TIOCLGET, (ioctl_t) & testnlb) < 0) + return (-1); + + Tty_eight_bit = testnlb & (LPASS8 | LLITOUT); + + /* If they have changed any tty settings, we have to keep up with them. */ + /* PWP: but only believe them if changes are made to cooked mode! */ + if (((testsgb.sg_flags != nb.sg_flags) || (testnlb != nlb)) && + ((testsgb.sg_flags != xb.sg_flags) || (testnlb != xlb)) && + !(testsgb.sg_flags & (RAW | CBREAK))) { + + nb.sg_flags = testsgb.sg_flags; + + /* + * re-test for some things here (like maybe the user typed "stty -tabs" + */ + if ((nb.sg_flags & XTABS) == XTABS) { /* check for no tabs mode */ + T_Tabs = 0; + } + else { + T_Tabs = CanWeTab(); + } + + nb.sg_flags &= ~(CBREAK | RAW); + nb.sg_flags |= (ECHO | CRMOD | ANYP); + if (T_Tabs) { /* order of &= and |= is important to XTABS */ + nb.sg_flags &= ~XTABS; + } + else { + nb.sg_flags |= XTABS; + } + + xb.sg_flags = testsgb.sg_flags; + if (T_Tabs) { + xb.sg_flags &= ~(RAW | ECHO | XTABS); + xb.sg_flags |= (CBREAK | CRMOD | ANYP); + } + else { + xb.sg_flags &= ~(RAW | ECHO); + xb.sg_flags |= (CBREAK | CRMOD | ANYP | XTABS); + } + + nlb = testnlb; +/* + * Bugfix: turn off output flushing. By: + * Justin Bur + * Universite de Montreal - IRO uunet!utai!musocs!iros1!justin + * Montreal (Qc) Canada H3C 3J7 + * Thanks! + */ + nlb &= ~(LPRTERA | LFLUSHO); + nlb |= (LCRTBS | LCRTERA | LCRTKIL); + + xlb = nlb; + } + + /* get and set the new local chars */ + if (ioctl(SHIN, TIOCGLTC, (ioctl_t) & testlc) < 0) + return (-1); +# ifdef TIOCGPAGE + if (ioctl(SHIN, TIOCGPAGE, (ioctl_t) & testpc) < 0) + return (-1); + (void) dosetkey((char *) &testpc.tps_statc, (char *) &npc.tps_statc); + (void) dosetkey((char *) &testpc.tps_pagec, (char *) &npc.tps_pagec); + (void) dosetkey((char *) &testpc.tps_pgoffc, (char *) &npc.tps_pgoffc); +# endif /* TIOCGPAGE */ + + (void) dosetkey((char *) &testlc.t_suspc, (char *) &nlc.t_suspc); + (void) dosetkey((char *) &testlc.t_dsuspc, (char *) &nlc.t_dsuspc); + if (dosetkey((char *) &testlc.t_flushc, (char *) &nlc.t_flushc)) + xlc.t_flushc = nlc.t_flushc; + (void) dosetkey((char *) &testlc.t_werasc, (char *) &nlc.t_werasc); + (void) dosetkey((char *) &testlc.t_rprntc, (char *) &nlc.t_rprntc); + (void) dosetkey((char *) &testlc.t_lnextc, (char *) &nlc.t_lnextc); + + if (ioctl(SHIN, TIOCSETN, (ioctl_t) & xb) < 0) + return (-1); + if (ioctl(SHIN, TIOCSETC, (ioctl_t) & xtc) < 0) + return (-1); + if (ioctl(SHIN, TIOCSLTC, (ioctl_t) & xlc) < 0) + return (-1); +# ifdef TIOCGPAGE + if (ioctl(SHIN, TIOCSPAGE, (ioctl_t) & xpc) < 0) + return (-1); +# endif /* TIOCGPAGE */ + if (ioctl(SHIN, TIOCLSET, (ioctl_t) & xlb) < 0) + return (-1); +# endif /* TERMIO || POSIX */ + Tty_raw_mode = 1; + flush(); /* flush any buffered output */ + return (0); +} + +int +Cookedmode() +{ /* set tty in normal setup */ + sigret_t(*orig_intr) (); + +#ifdef _IBMR2 + if (edit_discipline) { + if (ioctl(SHIN, TXSETLD, (ioctl_t) & tx_disc) < 0) + return (-1); + edit_discipline = 0; + } +#endif /* _IBMR2 */ + if (!Tty_raw_mode) + return (0); + +#ifdef BSDSIGS + orig_intr = signal(SIGINT, SIG_IGN); /* hold this for reseting tty */ +#else + orig_intr = sigset(SIGINT, SIG_IGN); /* hold this for reseting tty */ +#endif /* BSDSIGS */ +#ifndef POSIX +# ifdef TERMIO + if (ioctl(SHIN, TCSETAW, (ioctl_t) & nio) < 0) + return (-1); +# if defined(OREO) || defined(hpux) || defined(_IBMR2) + if (ioctl(SHIN, TIOCSLTC, (ioctl_t) & nlc) < 0) + return (-1); +# endif /* OREO || hpux || _IBMR2 */ +# else /* GSTTY */ /* for BSD... */ + if (ioctl(SHIN, TIOCSETN, (ioctl_t) & nb) < 0) + return (-1); + if (ioctl(SHIN, TIOCSETC, (ioctl_t) & ntc) < 0) + return (-1); + if (ioctl(SHIN, TIOCSLTC, (ioctl_t) & nlc) < 0) + return (-1); +# ifdef TIOCGPAGE + if (ioctl(SHIN, TIOCSPAGE, (ioctl_t) & npc) < 0) + return (-1); +# endif /* TIOCGPAGE */ + if (ioctl(SHIN, TIOCLSET, (ioctl_t) & nlb) < 0) + return (-1); +# endif /* TERMIO */ +#else /* POSIX */ + if (tcsetattr(SHIN, TCSADRAIN, &nio) < 0) + return (-1); +# if defined(OREO) || defined(hpux) || defined(_IBMR2) + if (ioctl(SHIN, TIOCSLTC, (ioctl_t) & nlc) < 0) + return (-1); +# endif /* OREO || hpux || _IBMR2 */ +#endif /* POSIX */ + Tty_raw_mode = 0; +#ifdef BSDSIGS + (void) signal(SIGINT, orig_intr); /* take these again */ +#else + (void) sigset(SIGINT, orig_intr); /* take these again */ +#endif /* BSDSIGS */ + return (0); +} + +void +ResetInLine() +{ + Cursor = InputBuf; /* reset cursor */ + LastChar = InputBuf; + InputLim = &InputBuf[INBUFSIZ - 2]; + Mark = InputBuf; + MetaNext = 0; + Cur_KeyMap = CcKeyMap; + AltKeyMap = 0; + Hist_num = 0; + DoingArg = 0; + Argument = 1; +#ifdef notdef + LastKill = KillBuf; /* no kill buffer */ +#endif + LastCmd = F_UNASSIGNED; /* previous command executed */ + MacroLvl = -1; /* no currently active macros */ +} + +static Char *Input_Line = NULL; +int +Load_input_line() +{ + long chrs = 0; + + if (Input_Line) + xfree((ptr_t) Input_Line); + Input_Line = NULL; + + if (Tty_raw_mode) + return 0; + +#ifdef FIONREAD + (void) ioctl(SHIN, FIONREAD, &chrs); + if (chrs > 0) { + char buf[BUFSIZ]; + + chrs = read(SHIN, buf, (size_t) min(chrs, BUFSIZ - 1)); + if (chrs > 0) { + buf[chrs] = NULL; + Input_Line = Strsave(str2short(buf)); + PushMacro(Input_Line); + } + } +#endif + return chrs > 0; +} + +/* + * Bugfix (in Swedish) by: + * Johan Widen + * SICS, PO Box 1263, S-163 13 SPANGA, SWEDEN + * {mcvax,munnari,cernvax,diku,inria,prlb2,penet,ukc,unido}!enea!sics.se!jw + * Internet: jw@sics.se + * + * (via Hans J Albertsson (thanks)) + */ + +void +QModeOn() +{ +#ifndef POSIX +# ifndef TERMIO + struct sgttyb rawb; +# else + struct termio rawb; +# endif /* TERMIO */ +#else /* POSIX */ + struct termios rawb; +#endif /* POSIX */ + + if (MacroLvl >= 0) + return; + +#if defined(TERMIO) || defined(POSIX) + rawb = xio; + rawb.c_lflag &= ~(ISIG | IEXTEN | PARENB); + rawb.c_iflag &= ~(IXON | IXOFF); +# ifndef POSIX + if (ioctl(SHIN, TCSETAW, (ioctl_t) & rawb) < 0) + return; +# else /* POSIX */ + if (tcsetattr(SHIN, TCSADRAIN, &rawb) < 0) + return; +# endif /* POSIX */ +#else /* GSTTYB */ + + rawb = xb; + rawb.sg_flags &= ~(CBREAK); + rawb.sg_flags |= RAW; + if (ioctl(SHIN, TIOCSETN, (ioctl_t) & rawb) < 0) + return; +#endif /* TERMIO || POSIX */ + Tty_quote_mode = 1; + return; +} + +void +QModeOff() +{ + if (!Tty_quote_mode) + return; + Tty_quote_mode = 0; +#if defined(TERMIO) || defined(POSIX) +# ifndef POSIX + if (ioctl(SHIN, TCSETAW, (ioctl_t) & xio) < 0) + return; +# else /* POSIX */ + if (tcsetattr(SHIN, TCSADRAIN, &xio) < 0) + return; +# endif /* POSIX */ +#else /* GSTTYB */ + if (ioctl(SHIN, TIOCSETN, (ioctl_t) & xb) < 0) + return; +#endif /* !TERMIO && !POSIX */ + return; +} diff --git a/bin/tcsh/ed.inputl.c b/bin/tcsh/ed.inputl.c new file mode 100644 index 0000000..8f1c42b --- /dev/null +++ b/bin/tcsh/ed.inputl.c @@ -0,0 +1,580 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/ed.inputl.c,v 3.0 1991/07/04 21:49:28 christos Exp $ */ +/* + * ed.inputl.c: Input line handling. + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#include "config.h" +#if !defined(lint) && !defined(pdp11) +static char *rcsid() + { return "$Id: ed.inputl.c,v 3.0 1991/07/04 21:49:28 christos Exp $"; } +#endif + +#include "sh.h" +#include "ed.h" +#include "ed.defns.h" /* for the function names */ +#include "tw.h" /* for twenex stuff */ + +#define OKCMD (INBUFSIZ+INBUFSIZ) +extern CCRETVAL e_up_hist(); +extern CCRETVAL e_ex_history(); + +/* ed.inputl -- routines to get a single line from the input. */ + +extern bool tellwhat; +extern bool MapsAreInited; +extern bool Tty_raw_mode; + +/* mismatched first character */ +static Char mismatch[] = {'!', '\\', '^', '-', '%', '\0'}; + +static int G_N_Command __P((KEYCMD *, Char *)); +static int SpellLine __P((int)); + +/* CCRETVAL */ +int +Inputl() +{ + CCRETVAL retval; + KEYCMD cmdnum = 0; + extern KEYCMD NumFuns; + unsigned char tch; /* the place where read() goes */ + Char ch; + int num; /* how many chars we have read at NL */ + struct varent *crct = adrof(STRcorrect); + struct varent *matchbeep = adrof(STRmatchbeep); + Char *SaveChar, *CorrChar; + Char Origin[INBUFSIZ], Change[INBUFSIZ]; + int matchval; /* from tenematch() */ + + if (!MapsAreInited) /* double extra just in case */ + ed_IMaps(); + + ClearDisp(); /* reset the display stuff */ + ResetInLine(); /* reset the input pointers */ + if (GettingInput) + MacroLvl = -1; /* editor was interrupted during input */ + +#ifdef FIONREAD + if (!Tty_raw_mode && MacroLvl < 0) { + long chrs = 0; + + (void) ioctl(SHIN, FIONREAD, (ioctl_t) & chrs); + if (chrs == 0) { + if (Rawmode() < 0) + return 0; + } + } +#endif + + GettingInput = 1; + NeedsRedraw = 0; + + if (tellwhat) { + copyn(InputBuf, WhichBuf, INBUFSIZ); + LastChar = InputBuf + (LastWhich - WhichBuf); + Cursor = InputBuf + (CursWhich - WhichBuf); + tellwhat = 0; + Hist_num = HistWhich; + } + if (Expand) { + (void) e_up_hist(); + Expand = 0; + } + Refresh(); /* print the prompt */ + + for (num = OKCMD; num == OKCMD;) { /* while still editing this line */ +#ifdef DEBUG_EDIT + if (Cursor > LastChar) + xprintf("Cursor > LastChar\r\n"); + if (Cursor < InputBuf) + xprintf("Cursor < InputBuf\r\n"); + if (Cursor > InputLim) + xprintf("Cursor > InputLim\r\n"); + if (LastChar > InputLim) + xprintf("LastChar > InputLim\r\n"); + if (InputLim != &InputBuf[INBUFSIZ - 2]) + xprintf("InputLim != &InputBuf[INBUFSIZ-2]\r\n"); + if ((!DoingArg) && (Argument != 1)) + xprintf("(!DoingArg) && (Argument != 1)\r\n"); + if (CcKeyMap[0] == 0) + xprintf("CcKeyMap[0] == 0 (maybe not inited)\r\n"); +#endif + + /* if EOF or error */ + if ((num = G_N_Command(&cmdnum, &ch)) != OKCMD) { + break; + } + + if (cmdnum >= NumFuns) {/* BUG CHECK command */ +#ifdef DEBUG_EDIT + xprintf("ERROR: illegal command from key 0%o\r\n", ch); +#endif + continue; /* try again */ + } + + /* now do the real command */ + retval = (*CcFuncTbl[cmdnum]) (ch); + + /* save the last command here */ + LastCmd = cmdnum; + + /* use any return value */ + switch (retval) { + + case CC_REFRESH: + Refresh(); + /* fall through */ + case CC_NORM: /* normal char */ + Argument = 1; + DoingArg = 0; + /* fall through */ + case CC_ARGHACK: /* Suggested by Rich Salz */ + /* */ + break; /* keep going... */ + + case CC_EOF: /* end of file typed */ +#ifdef notdef + PromptBuf[0] = '\0'; +#endif + num = 0; + break; + + case CC_WHICH: /* tell what this command does */ + tellwhat = 1; + copyn(WhichBuf, InputBuf, INBUFSIZ); + LastWhich = WhichBuf + (LastChar - InputBuf); + CursWhich = WhichBuf + (Cursor - InputBuf); + *LastChar++ = '\n'; /* for the benifit of CSH */ + HistWhich = Hist_num; + Hist_num = 0; /* for the history commands */ + num = LastChar - InputBuf; /* number characters read */ +#ifdef notdef + ResetInLine(); /* reset the input pointers */ +#endif + break; + + case CC_NEWLINE: /* normal end of line */ + if (crct && (!Strcmp(*(crct->vec), STRcmd) || + !Strcmp(*(crct->vec), STRall))) { + (void) Strcpy(Origin, InputBuf); + SaveChar = LastChar; + if (SpellLine(!Strcmp(*(crct->vec), STRcmd)) == 1) { + (void) Strcpy(Change, InputBuf); + *Strchr(Change, '\n') = '\0'; + CorrChar = LastChar; /* Save the corrected end */ + LastChar = InputBuf; /* Null the current line */ + Beep(); + printprompt(2, Change); + Refresh(); + (void) read(SHIN, (char *) &tch, 1); + ch = tch; + if (ch != 'y' && ch != ' ') { + (void) Strcpy(InputBuf, Origin); + LastChar = SaveChar; + xprintf("no\n"); + } + else { + LastChar = CorrChar; /* Restore the corrected end */ + xprintf("yes\n"); + } + flush(); + } + } /* end CORRECT code */ + tellwhat = 0; /* just in case */ + Hist_num = 0; /* for the history commands */ + num = LastChar - InputBuf; /* return the number of chars read */ + /* + * For continuation lines, we set the prompt to prompt 2 + */ + printprompt(1, NULL); +#ifdef notdef + ResetInLine(); /* reset the input pointers */ + PromptBuf[0] = '\0'; +#endif + break; + + case CC_CORRECT: + if (tenematch(InputBuf, INBUFSIZ, Cursor - InputBuf, + SPELL) < 0) + Beep(); /* Beep = No match/ambiguous */ + if (NeedsRedraw) { + ClearLines(); + ClearDisp(); + NeedsRedraw = 0; + } + Refresh(); + Argument = 1; + DoingArg = 0; + break; + + case CC_CORRECT_L: + if (SpellLine(FALSE) < 0) + Beep(); /* Beep = No match/ambiguous */ + if (NeedsRedraw) { + ClearLines(); + ClearDisp(); + NeedsRedraw = 0; + } + Refresh(); + Argument = 1; + DoingArg = 0; + break; + + + case CC_COMPLETE: + if (adrof(STRa_expand)) + (void) e_ex_history(); + /* + * Modified by Martin Boyer (gamin@ireq-robot.hydro.qc.ca): + * A separate variable now controls beeping after + * completion, independently of autolisting. + */ + switch (matchval = + tenematch(InputBuf, INBUFSIZ, Cursor-InputBuf, RECOGNIZE)) { + case 1: + if (non_unique_match && matchbeep && + (Strcmp(*(matchbeep->vec), STRnotunique) == 0)) + Beep(); + break; + case 0: + if (matchbeep) { + if (Strcmp(*(matchbeep->vec), STRnomatch) == 0 || + Strcmp(*(matchbeep->vec), STRambiguous) == 0 || + Strcmp(*(matchbeep->vec), STRnotunique) == 0) + Beep(); + } + else + Beep(); + break; + default: + if (matchval < 0) /* Error from tenematch */ + Beep(); + else if (matchbeep) { + if ((Strcmp(*(matchbeep->vec), STRambiguous) == 0 || + Strcmp(*(matchbeep->vec), STRnotunique) == 0)) + Beep(); + } + else + Beep(); + /* + * Addition by David C Lawrence : If an + * attempted completion is ambiguous, list the choices. + * (PWP: this is the best feature addition to tcsh I have + * seen in many months.) + */ + if (adrof(STRa_list)) { + PastBottom(); + (void) tenematch(InputBuf, INBUFSIZ, Cursor-InputBuf, LIST); + } + break; + } + if (NeedsRedraw) { + PastBottom(); + ClearLines(); + ClearDisp(); + NeedsRedraw = 0; + } + Refresh(); + Argument = 1; + DoingArg = 0; + break; + + case CC_LIST_CHOICES: + /* should catch ^C here... */ + (void) tenematch(InputBuf, INBUFSIZ, Cursor - InputBuf, LIST); + Refresh(); + Argument = 1; + DoingArg = 0; + break; + + case CC_LIST_GLOB: + (void) tenematch(InputBuf, INBUFSIZ, Cursor - InputBuf, GLOB); + Refresh(); + Argument = 1; + DoingArg = 0; + break; + + case CC_EXPAND_GLOB: + if (tenematch(InputBuf, INBUFSIZ, Cursor - InputBuf, + GLOB_EXPAND) <= 0) + Beep(); /* Beep = No match */ + if (NeedsRedraw) { + ClearLines(); + ClearDisp(); + NeedsRedraw = 0; + } + Refresh(); + Argument = 1; + DoingArg = 0; + break; + + case CC_EXPAND_VARS: + if (tenematch(InputBuf, INBUFSIZ, Cursor - InputBuf, + VARS_EXPAND) <= 0) + Beep(); /* Beep = No match */ + if (NeedsRedraw) { + ClearLines(); + ClearDisp(); + NeedsRedraw = 0; + } + Refresh(); + Argument = 1; + DoingArg = 0; + break; + + case CC_HELPME: + xputchar('\n'); + /* should catch ^C here... */ + (void) tenematch(InputBuf, INBUFSIZ, LastChar - InputBuf, + PRINT_HELP); + Refresh(); + Argument = 1; + DoingArg = 0; + break; + + case CC_FATAL: /* fatal error, reset to known state */ +#ifdef DEBUG_EDIT + xprintf("*** editor fatal ERROR ***\r\n\n"); +#endif /* DEBUG_EDIT */ + /* put (real) cursor in a known place */ + ClearDisp(); /* reset the display stuff */ + ResetInLine(); /* reset the input pointers */ + Refresh(); /* print the prompt again */ + Argument = 1; + DoingArg = 0; + break; + + case CC_ERROR: + default: /* functions we don't know about */ + DoingArg = 0; + Argument = 1; + Beep(); + flush(); + break; + } + } + (void) Cookedmode(); /* make sure the tty is set up correctly */ + GettingInput = 0; + flush(); /* flush any buffered output */ + return num; +} + +void +PushMacro(str) + Char *str; +{ + if (str != NULL && MacroLvl + 1 < MAXMACROLEVELS) { + MacroLvl++; + KeyMacro[MacroLvl] = str; + } + else { + Beep(); + flush(); + } +} + +static int +G_N_Command(cmdnum, ch) + KEYCMD *cmdnum; + register Char *ch; +{ + KEYCMD cmd = 0; + int num; + Char *str; + + for (; cmd == 0 || cmd == F_XKEY;) { + if ((num = G_N_Char(ch)) != 1) { /* if EOF or error */ + return num; + } +#ifdef KANJI + if (*ch & META) { + MetaNext = 0; + cmd = CcViMap[' ']; + break; + } + else +#endif /* KANJI */ + if (MetaNext) { + MetaNext = 0; + *ch |= META; + } + cmd = Cur_KeyMap[(unsigned char) *ch]; + if (cmd == F_XKEY) { + if (GetXkey(ch, &str)) + cmd = (KEYCMD) * str; + else + PushMacro(str); + } + if (!AltKeyMap) { + Cur_KeyMap = CcKeyMap; + } + } + *cmdnum = cmd; + return OKCMD; +} + +int +G_N_Char(cp) + register Char *cp; +{ + register int num_read; + +#if defined(EWOULDBLOCK) || (defined(POSIX) && defined(EAGAIN)) +# if defined(FIONBIO) || (defined(F_SETFL) && defined(O_NDELAY)) +# define TRY_AGAIN + int tried = 0; + +# endif /* FIONBIO || (F_SETFL && O_NDELAY) */ +#endif /* EWOULDBLOCK || (POSIX && EAGAIN) */ + unsigned char tcp; + + for (;;) { + if (MacroLvl < 0) { + if (!Load_input_line()) + break; + } + if (*KeyMacro[MacroLvl] == 0) { + MacroLvl--; + continue; + } + *cp = *KeyMacro[MacroLvl]++ & CHAR; + if (*KeyMacro[MacroLvl] == 0) { /* Needed for QMode On */ + MacroLvl--; + } + return (1); + } + + if (Rawmode() < 0) /* make sure the tty is set up correctly */ + return 0; /* oops: SHIN was closed */ + + while ((num_read = read(SHIN, (char *) &tcp, 1)) == -1) + switch (errno) { + /* + * Someone might have set our file descriptor to non blocking From + * Gray Watson (gray%antr.uucp@med.pitt.edu), Thanks!!! + */ +#ifdef EWOULDBLOCK + case EWOULDBLOCK: +#endif /* EWOULDBLOCK */ +#if defined(POSIX) && defined(EAGAIN) +# if defined(EWOULDBLOCK) && EAGAIN != EWOULDBLOCK + case EAGAIN: +# endif /* EWOULDBLOCK && EAGAIN != EWOULDBLOCK */ +#endif /* POSIX && EAGAIN */ +#ifdef TRY_AGAIN + if (!tried) { +# if defined(F_SETFL) && defined(O_NDELAY) + (void) fcntl(SHIN, F_SETFL, + fcntl(SHIN, F_GETFL, 0) & ~O_NDELAY); +# endif /* F_SETFL && O_NDELAY */ +# ifdef FIONBIO + (void) ioctl(SHIN, FIONBIO, (ioctl_t) & tried); +# endif /* FIONBIO */ + tried = 1; + break; + } +#endif + *cp = tcp; + return (num_read); +#ifdef _SEQUENT_ + case EBADF: +#endif /* _SEQUENT_ */ + case EINTR: + break; + default: + xprintf("G_N_Char(): errno == %d\n", errno); + *cp = tcp; + return num_read; + } + *cp = tcp; + return num_read; +} + +/* + * SpellLine - do spelling correction on the entire command line + * (which may have trailing newline). + * If cmdonly is set, only check spelling of command words. + * Return value: + * -1: Something was incorrectible, and nothing was corrected + * 0: Everything was correct + * 1: Something was corrected + */ +static int +SpellLine(cmdonly) + int cmdonly; +{ + int endflag, matchval; + Char *argptr, *OldCursor, *OldLastChar; + + OldLastChar = LastChar; + OldCursor = Cursor; + argptr = InputBuf; + endflag = 1; + matchval = 0; + do { + while (ismeta(*argptr) || iscmdmeta(*argptr)) + argptr++; + for (Cursor = argptr; + *Cursor != '\0' && !ismeta(*Cursor) && !iscmdmeta(*Cursor); + Cursor++); + if (*Cursor == '\0') { + Cursor = LastChar; + if (LastChar[-1] == '\n') + Cursor--; + endflag = 0; + } + if (!Strchr(mismatch, *argptr) && + (!cmdonly || starting_a_command(argptr, InputBuf))) { + switch (tenematch(InputBuf, INBUFSIZ, Cursor - InputBuf, SPELL)) { + case 1: /* corrected */ + matchval = 1; + break; + case -1: /* couldn't be corrected */ + if (!matchval) + matchval = -1; + break; + default: /* was correct */ + break; + } + if (LastChar != OldLastChar) { + if (argptr < OldCursor) + OldCursor += (LastChar - OldLastChar); + OldLastChar = LastChar; + } + } + argptr = Cursor; + } while (endflag); + Cursor = OldCursor; + return matchval; +} diff --git a/bin/tcsh/ed.refresh.c b/bin/tcsh/ed.refresh.c new file mode 100644 index 0000000..59ff182 --- /dev/null +++ b/bin/tcsh/ed.refresh.c @@ -0,0 +1,1045 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/ed.refresh.c,v 3.0 1991/07/04 21:49:28 christos Exp $ */ +/* + * ed.refresh.c: Lower level screen refreshing functions + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#include "config.h" +#if !defined(lint) && !defined(pdp11) +static char *rcsid() + { return "$Id: ed.refresh.c,v 3.0 1991/07/04 21:49:28 christos Exp $"; } +#endif + +#include "sh.h" +#include "ed.h" +/* #define DEBUG_UPDATE */ +/* #define DEBUG_REFRESH */ +/* #define DEBUG_LITERAL */ + +/* refresh.c -- refresh the current set of lines on the screen */ + +Char *litptr[256]; +static int vcur_h, vcur_v; + +static void Draw __P((int)); +static void Vdraw __P((int)); +static void Vnewline __P((void)); +static void update_line __P((Char *, Char *, int)); +static int has_other_than_spaces __P((Char *, int)); +static void str_insert __P((Char *, int, int, Char *, int)); +static void str_delete __P((Char *, int, int, int)); +static void str_cp __P((Char *, Char *, int)); +static void PutPlusOne __P((int)); + +static void +Draw(c) /* draw c, expand tabs, ctl chars */ + register int c; +{ + register Char ch = c & CHAR; + + if (Isprint(ch)) { + Vdraw(c); + return; + } + /* from wolman%crltrx.DEC@decwrl.dec.com (Alec Wolman) */ + if (ch == '\n') { /* expand the newline */ + Vdraw('\0'); /* assure end of line */ + vcur_h = 0; /* reset cursor pos */ + vcur_v++; + return; + } + if (ch == '\t') { /* expand the tab */ + for (;;) { + Vdraw(' '); + if ((vcur_h & 07) == 0) + break; /* go until tab stop */ + } + } + else if (Iscntrl(ch)) { + Vdraw('^'); + if (ch == '\177') { + Vdraw('?'); + } + else { + /* uncontrolify it; works only for iso8859-1 like sets */ + Vdraw((c | 0100)); + } + } + else { + Vdraw('\\'); + Vdraw(((c >> 6) & 7) + '0'); + Vdraw(((c >> 3) & 7) + '0'); + Vdraw((c & 7) + '0'); + } +} + +static void +Vdraw(c) /* draw char c onto V lines */ + register int c; +{ +#ifdef DEBUG_REFRESH +# ifdef SHORT_STRINGS + xprintf("Vdrawing %6.6o '%c'\r\n", c, c & ASCII); +# else + xprintf("Vdrawing %3.3o '%c'\r\n", c, c); +# endif +#endif + + Vdisplay[vcur_v][vcur_h] = c; + vcur_h++; /* advance to next place */ + if (vcur_h >= TermH) { + Vdisplay[vcur_v][TermH] = '\0'; /* assure end of line */ + vcur_h = 0; /* reset it. */ + vcur_v++; + if (vcur_v >= TermV) { /* should NEVER happen. */ +#ifdef DEBUG_REFRESH + xprintf("\r\nVdraw: vcur_v overflow! Vcursor_v == %d > %d\r\n", + vcur_v, TermV); + abort(); +#endif /* DEBUG_REFRESH */ + } + } +} + +static void +Vnewline() +{ + /* needs work. */ +} + +/* + * Refresh() + * draws the new virtual screen image from the current input + * line, then goes line-by-line changing the real image to the new + * virtual image. The routine to re-draw a line can be replaced + * easily in hopes of a smarter one being placed there. + */ +static int OldvcV = 0; +void +Refresh() +{ + register int cur_line; + register Char *cp; + int cur_h, cur_v = 0, new_vcv; + Char oldgetting; + int litnum = 0; + +#ifdef DEBUG_REFRESH + xprintf("PromptBuf = :%s:\r\n", short2str(PromptBuf)); + xprintf("InputBuf = :%s:\r\n", short2str(InputBuf)); +#endif + oldgetting = GettingInput; + GettingInput = 0; /* avoid re-entrance via SIGWINCH */ + + /* reset the Vdraw cursor */ + vcur_h = 0; + vcur_v = 0; + + /* draw prompt, we know it's ASCIZ */ + for (cp = PromptBuf; *cp; cp++) { + if (*cp & LITERAL) { + if (litnum < (sizeof(litptr) / sizeof(litptr[0]))) { + litptr[litnum] = cp; +#ifdef DEBUG_LITERAL + xprintf("litnum = %d, litptr = %x:\r\n", + litnum, litptr[litnum]); +#endif + } + while (*cp & LITERAL) + cp++; + if (*cp) + Vdraw(litnum++ | LITERAL); + else { + /* + * XXX: This is a bug, we lose the last literal, if it is not + * followed by a normal character, but it is too hard to fix + */ + break; + } + } + else + Draw(*cp); + } + cur_h = -1; /* set flag in case I'm not set */ + + /* draw the current input buffer */ + for (cp = InputBuf; (cp < LastChar); cp++) { + if (cp == Cursor) { + cur_h = vcur_h; /* save for later */ + cur_v = vcur_v; + } + Draw(*cp); + } + + /* to next line and draw the current search prompt if searching */ + if (DoingSearch) { + Vnewline(); + for (cp = SearchPrompt; *cp; cp++) + Draw(*cp); + for (cp = InputBuf; (cp < LastChar); cp++) { + if (cp == Cursor) { + cur_h = vcur_h; /* save for later */ + cur_v = vcur_v; + } + Draw(*cp); + } + } + + if (cur_h == -1) { /* if I havn't been set yet, I'm at the end */ + cur_h = vcur_h; + cur_v = vcur_v; + } + new_vcv = vcur_v; /* must be done BEFORE the NUL is written */ + Vdraw('\0'); /* put NUL on end */ + +#ifdef DEBUG_REFRESH + xprintf( + "TermH=%d, vcur_h=%d, vcur_v=%d, Vdisplay[0]=\r\n:%80.80s:\r\n", + TermH, vcur_h, vcur_v, short2str(Vdisplay[0])); +#endif + + for (cur_line = 0; cur_line <= new_vcv; cur_line++) { + /* NOTE THAT update_line MAY CHANGE Display[cur_line] */ + update_line(Display[cur_line], Vdisplay[cur_line], cur_line); + (void) Strncpy(Display[cur_line], Vdisplay[cur_line], TermH); + Display[cur_line][TermH] = '\0'; /* just in case */ + } +#ifdef DEBUG_REFRESH + xprintf("\r\nvcur_v = %d, OldvcV = %d, cur_line = %d\r\n", + vcur_v, OldvcV, cur_line); +#endif + if (OldvcV > new_vcv) { + for (; cur_line <= OldvcV; cur_line++) { + MoveToLine(cur_line); + MoveToChar(0); + ClearEOL(Strlen(Display[cur_line])); +#ifdef DEBUG_REFRESH + so_write(str2short("C\b"), 2); +#endif + *Display[cur_line] = '\0'; + } + } + OldvcV = new_vcv; /* set for next time */ +#ifdef DEBUG_REFRESH + xprintf("\r\nCursorH = %d, CursorV = %d, cur_h = %d, cur_v = %d\r\n", + CursorH, CursorV, cur_h, cur_v); +#endif + MoveToLine(cur_v); /* go to where the cursor is */ + MoveToChar(cur_h); + SetAttributes(0); /* Clear all attributes */ + flush(); /* send the output... */ + GettingInput = oldgetting; /* reset to old value */ +} + +#ifdef notdef +GotoBottom() +{ /* used to go to last used screen line */ + MoveToLine(OldvcV); +} + +#endif + +void +PastBottom() +{ /* used to go to last used screen line */ + MoveToLine(OldvcV); + (void) putraw('\r'); + (void) putraw('\n'); + ClearDisp(); + flush(); +} + +static int +has_other_than_spaces(s, n) + register Char *s; + register int n; +{ + if (n <= 0) + return 0; + + while (n-- > 0) { + if (*s != '\0' && *s != ' ') + return 1; + s++; + } + return 0; +} + +/* insert num characters of s into d (in front of the character) at dat, + maximum length of d is dlen */ +static void +str_insert(d, dat, dlen, s, num) + register Char *d; + register int dat, dlen; + register Char *s; + register int num; +{ + register Char *a, *b; + + if (num <= 0) + return; + if (num > dlen - dat) + num = dlen - dat; + +#ifdef DEBUG_REFRESH + xprintf("str_insert() starting: %d at %d max %d, d == \"%s\"\n", + num, dat, dlen, short2str(d)); + xprintf("s == \"%s\"n", short2str(s)); +#endif + + /* open up the space for num chars */ + if (num > 0) { + b = d + dlen - 1; + a = b - num; + while (a >= &d[dat]) + *b-- = *a--; + d[dlen] = '\0'; /* just in case */ + } +#ifdef DEBUG_REFRESH + xprintf("str_insert() after insert: %d at %d max %d, d == \"%s\"\n", + num, dat, dlen, short2str(d)); + xprintf("s == \"%s\"n", short2str(s)); +#endif + + /* copy the characters */ + for (a = d + dat; (a < d + dlen) && (num > 0); num--) + *a++ = *s++; + +#ifdef DEBUG_REFRESH + xprintf("str_insert() after copy: %d at %d max %d, d == \"%s\"\n", + num, dat, dlen, d, short2str(s)); + xprintf("s == \"%s\"n", short2str(s)); +#endif +} + +/* delete num characters d at dat, maximum length of d is dlen */ +static void +str_delete(d, dat, dlen, num) + register Char *d; + register int dat, dlen, num; +{ + register Char *a, *b; + + if (num <= 0) + return; + if (dat + num >= dlen) { + d[dat] = '\0'; + return; + } + +#ifdef DEBUG_REFRESH + xprintf("str_delete() starting: %d at %d max %d, d == \"%s\"\n", + num, dat, dlen, short2str(d)); +#endif + + /* open up the space for num chars */ + if (num > 0) { + b = d + dat; + a = b + num; + while (a < &d[dlen]) + *b++ = *a++; + d[dlen] = '\0'; /* just in case */ + } +#ifdef DEBUG_REFRESH + xprintf("str_delete() after delete: %d at %d max %d, d == \"%s\"\n", + num, dat, dlen, short2str(d)); +#endif +} + +static void +str_cp(a, b, n) + register Char *a, *b; + register int n; +{ + while (n-- && *b) + *a++ = *b++; +} + + + +/* **************************************************************** + update_line() is based on finding the middle difference of each line + on the screen; vis: + + + /old first difference + /beginning of line | /old last same /old EOL + v v v v +old: eddie> Oh, my little gruntle-buggy is to me, as lurgid as +new: eddie> Oh, my little buggy says to me, as lurgid as + ^ ^ ^ ^ + \beginning of line | \new last same \new end of line + \new first difference + + all are character pointers for the sake of speed. Special cases for + no differences, as well as for end of line additions must be handled. +**************************************************************** */ + +/* Minimum at which doing an insert it "worth it". This should be about + * half the "cost" of going into insert mode, inserting a character, and + * going back out. This should really be calculated from the t_c_ + * data... For the moment, a good number for ANSI terminals. + */ +#define MIN_END_KEEP 4 + +static void /* could be changed to make it smarter */ +update_line(old, new, cur_line) + register Char *old, *new; + int cur_line; +{ + register Char *o, *n, *p, c; + Char *ofd, *ols, *oe, *nfd, *nls, *ne; + Char *osb, *ose, *nsb, *nse; + int fx, sx; + + /* + * find first diff + */ + for (o = old, n = new; *o && (*o == *n); o++, n++); + ofd = o; + nfd = n; + + /* + * if no diff, continue to next line + */ + if (*ofd == '\0' && *nfd == '\0') { +#ifdef DEBUG_UPDATE + DEBUGPRINT("no difference.\r\n", 0); +#endif /* DEBUG_UPDATE */ + return; + } + + /* + * Find the end of both old and new + */ + while (*o) + o++; + oe = o; + + while (*n) + n++; + ne = n; + + /* + * find last same * + */ + for (; (o > ofd) && (n > nfd) && (o[-1] == n[-1]); o--, n--); + ols = o; + nls = n; + + /* + * find same begining and same end + */ + osb = ols; + nsb = nls; + ose = ols; + nse = nls; + + /* + * case 1: insert: scan from nfd to nls looking for *ofd + */ + if (*ofd) { + for (c = *ofd, n = nfd; n < nls; n++) { + if (c == *n) { + for (o = ofd, p = n; p < nls && o < ols && *o == *p; o++, p++); + /* + * if the new match is longer and it's worth keeping, then we + * take it + */ + if (((nse - nsb) < (p - n)) && (2 * (p - n) > n - nfd)) { + nsb = n; + nse = p; + osb = ofd; + ose = o; + } + } + } + } + + /* + * case 2: delete: scan from ofd to ols looking for *nfd + */ + if (*nfd) { + for (c = *nfd, o = ofd; o < ols; o++) { + if (c == *o) { + for (n = nfd, p = o; p < ols && n < nls && *p == *n; p++, n++); + /* + * if the new match is longer and it's worth keeping, then we + * take it + */ + if (((ose - osb) < (p - o)) && (2 * (p - o) > o - ofd)) { + nsb = nfd; + nse = n; + osb = o; + ose = p; + } + } + } + } + + /* + * Pragmatics I: If old trailing whitespace or not enough characters to + * save to be worth it, then don't save the last same info. + */ + if ((oe - ols) < MIN_END_KEEP) { + ols = oe; + nls = ne; + } + + /* + * Pragmatics II: if the terminal isn't smart enough, make the data dumber + * so the smart update doesn't try anything fancy + */ + + /* + * fx is the number of characters we need to insert/delete: in the + * beginning to bring the two same begins together + */ + fx = (nsb - nfd) - (osb - ofd); + /* + * sx is the number of characters we need to insert/delete: in the end to + * bring the two same last parts together + */ + sx = (nls - nse) - (ols - ose); + + if (!T_CanIns) { + if (fx > 0) { + osb = ols; + ose = ols; + nsb = nls; + nse = nls; + } + if (sx > 0) { + ols = oe; + nls = ne; + } + if ((ols - ofd) < (nls - nfd)) { + ols = oe; + nls = ne; + } + } + if (!T_CanDel) { + if (fx < 0) { + osb = ols; + ose = ols; + nsb = nls; + nse = nls; + } + if (sx < 0) { + ols = oe; + nls = ne; + } + if ((ols - ofd) > (nls - nfd)) { + ols = oe; + nls = ne; + } + } + + /* + * Pragmatics III: make sure the middle shifted pointers are correct if + * they don't point to anything (we may have moved ols or nls). + */ + if (osb == ose) { + osb = ols; + ose = ols; + nsb = nls; + nse = nls; + } + + /* + * Now that we are done with pragmatics we recompute fx, sx + */ + fx = (nsb - nfd) - (osb - ofd); + sx = (nls - nse) - (ols - ose); + +#ifdef DEBUG_UPDATE + xprintf("\n"); + xprintf("ofd %d, osb %d, ose %d, ols %d, oe %d\n", + ofd - old, osb - old, ose - old, ols - old, oe - old); + xprintf("nfd %d, nsb %d, nse %d, nls %d, ne %d\n", + nfd - new, nsb - new, nse - new, nls - new, ne - new); + xprintf("old:\"%s\"\r\n", short2str(old)); + xprintf("new:\"%s\"\r\n", short2str(new)); + xprintf("ofd:\"%s\"\r\n", short2str(ofd)); + xprintf("nfd:\"%s\"\r\n", short2str(nfd)); + xprintf("ols:\"%s\"\r\n", short2str(ols)); + xprintf("nls:\"%s\"\r\n", short2str(nls)); + xprintf("*oe:%o,*ne:%o\r\n", *oe, *ne); + xprintf("osb:\"%s\"\r\n", short2str(osb)); + xprintf("ose:\"%s\"\r\n", short2str(ose)); + xprintf("nsb:\"%s\"\r\n", short2str(nsb)); + xprintf("nse:\"%s\"\r\n", short2str(nse)); +#endif /* DEBUG_UPDATE */ + + /* + * CursorV to this line cur_line MUST be in this routine so that if we + * don't have to change the line, we don't move to it. CursorH to first + * diff char + */ + MoveToLine(cur_line); + + /* + * at this point we have something like this: + * + * /old /ofd /osb /ose /ols /oe + * v.....................v v..................v v........v + * eddie> Oh, my fredded gruntle-buggy is to me, as foo var lurgid as + * eddie> Oh, my fredded quiux buggy is to me, as gruntle-lurgid as + * ^.....................^ ^..................^ ^........^ + * \new \nfd \nsb \nse \nls \ne + * + */ + + /* + * if we have a net insert on the first difference, AND inserting the net + * amount ((nsb-nfd) - (osb-ofd)) won't push the last useful character + * (which is ne if nls != ne, otherwise is nse) off the edge of the screen + * (TermH) else we do the deletes first so that we keep everything we need + * to. + */ + + /* + * if the last same is the same like the end, there is no last same part, + * otherwise we want to keep the last same part set p to the last useful + * old character + */ + p = (ols != oe) ? oe : ose; + + /* + * if (There is a diffence in the beginning) && (we need to insert + * characters) && (the number of characters to insert is less than the term + * width) We need to do an insert! else if (we need to delete characters) + * We need to delete characters! else No insert or delete + */ + if ((nsb != nfd) && fx > 0 && ((p - old) + fx <= TermH)) { +#ifdef DEBUG_UPDATE + DEBUGPRINT("\nfirst diff insert at %d...\n", nfd - new); +#endif /* DEBUG_UPDATE */ + /* + * Move to the first char to insert, where the first diff is. + */ + MoveToChar(nfd - new); + /* + * Check if we have stuff to keep at end + */ + if (nsb != ne) { +#ifdef DEBUG_UPDATE + DEBUGPRINT("\nwith stuff to keep at end\n", 0); +#endif /* DEBUG_UPDATE */ + /* + * insert fx chars of new starting at nfd + */ + if (fx > 0) { +#ifdef DEBUG_UPDATE + if (!T_CanIns) + xprintf(" ERROR: cannot insert in early first diff\n"); +#endif /* DEBUG_UPDATE */ + Insert_write(nfd, fx); + str_insert(old, ofd - old, TermH, nfd, fx); + } + /* + * write (nsb-nfd) - fx chars of new starting at (nfd + fx) + */ + so_write(nfd + fx, (nsb - nfd) - fx); + str_cp(ofd + fx, nfd + fx, (nsb - nfd) - fx); + } + else { +#ifdef DEBUG_UPDATE + DEBUGPRINT("\nwithout anything to save\n", 0); +#endif /* DEBUG_UPDATE */ + so_write(nfd, (nsb - nfd)); + str_cp(ofd, nfd, (nsb - nfd)); + /* + * Done + */ + return; + } + } + else if (fx < 0) { +#ifdef DEBUG_UPDATE + DEBUGPRINT("\nfirst diff delete at %d...\n", ofd - old); +#endif /* DEBUG_UPDATE */ + /* + * move to the first char to delete where the first diff is + */ + MoveToChar(ofd - old); + /* + * Check if we have stuff to save + */ + if (osb != oe) { +#ifdef DEBUG_UPDATE + DEBUGPRINT("\nwith stuff to save at end\n", 0); +#endif /* DEBUG_UPDATE */ + /* + * fx is less than zero *always* here but we check for code + * symmetry + */ + if (fx < 0) { + if (!T_CanDel) + xprintf(" ERROR: cannot delete in first diff\n"); + DeleteChars(-fx); + str_delete(old, ofd - old, TermH, -fx); + } + /* + * write (nsb-nfd) chars of new starting at nfd + */ + so_write(nfd, (nsb - nfd)); + str_cp(ofd, nfd, (nsb - nfd)); + + } + else { +#ifdef DEBUG_UPDATE + DEBUGPRINT("\nbut with nothing left to save\n", 0); +#endif /* DEBUG_UPDATE */ + /* + * write (nsb-nfd) chars of new starting at nfd + */ + so_write(nfd, (nsb - nfd)); +#ifdef DEBUG_UPDATE + DEBUGPRINT("cleareol %d\n", (oe - old) - (ne - new)); +#endif /* DEBUG_UPDATE */ + ClearEOL((oe - old) - (ne - new)); + /* + * Done + */ + return; + } + } + else + fx = 0; + + if (sx < 0) { +#ifdef DEBUG_UPDATE + DEBUGPRINT("\nsecond diff delete at %d...\n", (ose - old) + fx); +#endif /* DEBUG_UPDATE */ + /* + * Check if we have stuff to delete + */ + /* + * fx is the number of characters inserted (+) or deleted (-) + */ + MoveToChar((ose - old) + fx); + if (ols != oe) { +#ifdef DEBUG_UPDATE + DEBUGPRINT("\nwith stuff to save at end\n", 0); +#endif /* DEBUG_UPDATE */ + /* + * Again a duplicate test. + */ + if (sx < 0) { +#ifdef DEBUG_UPDATE + if (!T_CanDel) + xprintf(" ERROR: cannot delete in second diff\n"); +#endif /* DEBUG_UPDATE */ + DeleteChars(-sx); + } + + /* + * write (nls-nse) chars of new starting at nse + */ + so_write(nse, (nls - nse)); + } + else { +#ifdef DEBUG_UPDATE + DEBUGPRINT("\nbut with nothing left to save\n", 0); +#endif /* DEBUG_UPDATE */ + so_write(nse, (nls - nse)); +#ifdef DEBUG_UPDATE + DEBUGPRINT("cleareol %d\n", (oe - old) - (ne - new)); +#endif /* DEBUG_UPDATE */ + ClearEOL((oe - old) - (ne - new)); + } + } + + /* + * if we have a first insert AND WE HAVEN'T ALREADY DONE IT... + */ + if ((nsb != nfd) && (osb - ofd) <= (nsb - nfd) && (fx == 0)) { +#ifdef DEBUG_UPDATE + DEBUGPRINT("\nlate first diff insert at %d...\n", nfd - new); +#endif /* DEBUG_UPDATE */ + MoveToChar(nfd - new); + /* + * Check if we have stuff to keep at the end + */ + if (nsb != ne) { +#ifdef DEBUG_UPDATE + DEBUGPRINT("\nwith stuff to keep at end\n", 0); +#endif /* DEBUG_UPDATE */ + if (fx > 0) { + /* + * insert fx chars of new starting at nfd + */ +#ifdef DEBUG_UPDATE + if (!T_CanIns) + xprintf(" ERROR: cannot insert in late first diff\n"); +#endif /* DEBUG_UPDATE */ + Insert_write(nfd, fx); + str_insert(old, ofd - old, TermH, nfd, fx); + } + + /* + * write (nsb-nfd) - fx chars of new starting at (nfd + fx) + */ + so_write(nfd + fx, (nsb - nfd) - fx); + str_cp(ofd + fx, nfd + fx, (nsb - nfd) - fx); + } + else { +#ifdef DEBUG_UPDATE + DEBUGPRINT("\nwithout anything to save\n", 0); +#endif /* DEBUG_UPDATE */ + so_write(nfd, (nsb - nfd)); + str_cp(ofd, nfd, (nsb - nfd)); + } + } + + /* + * line is now NEW up to nse + */ + if ((nls != nse) && has_other_than_spaces(nse, (nls - nse)) && sx >= 0) { +#ifdef DEBUG_UPDATE + DEBUGPRINT("\nsecond diff insert at %d...\n", nse - new); +#endif /* DEBUG_UPDATE */ + MoveToChar(nse - new); + if (nls != ne) { +#ifdef DEBUG_UPDATE + DEBUGPRINT("\nwith stuff to keep at end\n", 0); +#endif /* DEBUG_UPDATE */ + if (sx > 0) { + /* insert sx chars of new starting at nse */ +#ifdef DEBUG_UPDATE + if (!T_CanIns) + xprintf(" ERROR: cannot insert in second diff\n"); +#endif /* DEBUG_UPDATE */ + Insert_write(nse, sx); + } + + /* + * write (nls-nse) - sx chars of new starting at (nse + sx) + */ + so_write(nse + sx, (nls - nse) - sx); + } + else { +#ifdef DEBUG_UPDATE + DEBUGPRINT("\nwithout anything to save\n", 0); +#endif /* DEBUG_UPDATE */ + so_write(nse, (nls - nse)); + } + } +#ifdef DEBUG_UPDATE + DEBUGPRINT("\ndone.\n", 0); +#endif /* DEBUG_UPDATE */ +} + +void +RefCursor() +{ /* only move to new cursor pos */ + register Char *cp, c; + register int h, th, v; + + if (DoingSearch) { + Refresh(); + return; + } + + /* first we must find where the cursor is... */ + h = 0; + v = 0; + th = TermH; /* optimize for speed */ + + for (cp = PromptBuf; *cp; cp++) { /* do prompt */ + if (*cp & LITERAL) + continue; + c = *cp & CHAR; /* extra speed plus strip the inverse */ + h++; /* all chars at least this long */ + + /* from wolman%crltrx.DEC@decwrl.dec.com (Alec Wolman) */ + /* lets handle newline as part of the prompt */ + + if (c == '\n') { + h = 0; + v++; + } + else { + if (c == '\t') { /* if a tab, to next tab stop */ + while (h & 07) { + h++; + } + } + else if (Iscntrl(c)) { /* if control char */ + h++; + if (h > th) { /* if overflow, compensate */ + h = 1; + v++; + } + } + else if (!Isprint(c)) { + h += 3; + if (h > th) { /* if overflow, compensate */ + h = h - th; + v++; + } + } + } + + if (h >= th) { /* check, extra long tabs picked up here also */ + h = 0; + v++; + } + } + + for (cp = InputBuf; cp < Cursor; cp++) { /* do input buffer to Cursor */ + c = *cp & CHAR; /* extra speed plus strip the inverse */ + h++; /* all chars at least this long */ + + if (c == '\n') { /* handle newline in data part too */ + h = 0; + v++; + } + else { + if (c == '\t') { /* if a tab, to next tab stop */ + while (h & 07) { + h++; + } + } + else if (Iscntrl(c)) { /* if control char */ + h++; + if (h > th) { /* if overflow, compensate */ + h = 1; + v++; + } + } + else if (!Isprint(c)) { + h += 3; + if (h > th) { /* if overflow, compensate */ + h = h - th; + v++; + } + } + } + + if (h >= th) { /* check, extra long tabs picked up here also */ + h = 0; + v++; + } + } + + /* now go there */ + MoveToLine(v); + MoveToChar(h); + flush(); +} + +static void +PutPlusOne(c) + int c; +{ + (void) putraw(c); + Display[CursorV][CursorH++] = c; + if (CursorH >= TermH) { /* if we must overflow */ + CursorH = 0; + CursorV++; + OldvcV++; + (void) putraw('\r'); + (void) putraw('\n'); + } +} + +void +RefPlusOne() +{ /* we added just one char, handle it fast *//* a + * ssumes that screen cursor == real cursor */ + register Char c, mc; + + c = Cursor[-1] & CHAR; /* the char we just added */ + + if (c == '\t' || Cursor != LastChar) { + Refresh(); /* too hard to handle */ + return; + } /* else (only do at end of line, no TAB) */ + + if (DoingSearch) { + Refresh(); + return; + } + + if (Iscntrl(c)) { /* if control char, do caret */ + mc = (c == '\177') ? '?' : (c | 0100); + PutPlusOne('^'); + PutPlusOne(mc); + } + else if (Isprint(c)) { /* normal char */ + PutPlusOne(c); + } + else { + PutPlusOne('\\'); + PutPlusOne(((c >> 6) & 7) + '0'); + PutPlusOne(((c >> 3) & 7) + '0'); + PutPlusOne((c & 7) + '0'); + } + flush(); +} + +/* clear the screen buffers so that new new prompt starts fresh. */ + +void +ClearDisp() +{ + register int i; + + CursorV = 0; /* clear the display buffer */ + CursorH = 0; + for (i = 0; i < TermV; i++) + Display[i][0] = '\0'; + OldvcV = 0; +} + +void +ClearLines() +{ /* Make sure all lines are *really* blank */ + register int i; + + if (T_CanCEOL) { + MoveToChar(0); + for (i = 0; i <= OldvcV; i++) { /* for each line on the screen */ + MoveToLine(i); + ClearEOL(TermH); + } + MoveToLine(0); + } + else { + MoveToLine(OldvcV); /* go to last line */ + (void) putraw('\r'); /* go to BOL */ + (void) putraw('\n'); /* go to new line */ + } +} diff --git a/bin/tcsh/ed.screen.c b/bin/tcsh/ed.screen.c new file mode 100644 index 0000000..c9514aa --- /dev/null +++ b/bin/tcsh/ed.screen.c @@ -0,0 +1,1420 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/ed.screen.c,v 3.0 1991/07/04 21:49:28 christos Exp $ */ +/* + * ed.screen.c: Editor/t_c_-curses interface + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#include "config.h" +#if !defined(lint) && !defined(pdp11) +static char *rcsid() + { return "$Id: ed.screen.c,v 3.0 1991/07/04 21:49:28 christos Exp $"; } +#endif + +#include "sh.h" +#include "ed.h" +#include "ed.defns.h" + +/* + * We don't prototype these, cause some systems have them wrong! + */ +extern char *tgoto(); +extern char *tgetstr(); +extern char *tputs(); +extern int tgetent(); +extern int tgetflag(); +extern int tgetnum(); + + +/* #define DEBUG_LITERAL */ + +/* + * IMPORTANT NOTE: these routines are allowed to look at the current screen + * and the current possition assuming that it is correct. If this is not + * true, then the update will be WRONG! This is (should be) a valid + * assumption... + */ + +#ifndef TC_BUFSIZ +# ifdef pdp11 +# define TC_BUFSIZ 1024 +# else +# define TC_BUFSIZ 2048 +# endif /* pdp11 */ +#endif + +#define GoodStr(a) (tstr[a].str != NULL && tstr[a].str[0] != '\0') +#define Str(a) tstr[a].str +#define Val(a) tval[a].val + +static struct { + char *b_name; + int b_rate; +} baud_rate[] = { + +#ifdef B0 + { "0", B0 }, +#endif +#ifdef B50 + { "50", B50 }, +#endif +#ifdef B75 + { "75", B75 }, +#endif +#ifdef B110 + { "110", B110 }, +#endif +#ifdef B134 + { "134", B134 }, +#endif +#ifdef B150 + { "150", B150 }, +#endif +#ifdef B200 + { "200", B200 }, +#endif +#ifdef B300 + { "300", B300 }, +#endif +#ifdef B600 + { "600", B600 }, +#endif +#ifdef B900 + { "900", B900 }, +#endif +#ifdef B1200 + { "1200", B1200 }, +#endif +#ifdef B1800 + { "1800", B1800 }, +#endif +#ifdef B2400 + { "2400", B2400 }, +#endif +#ifdef B3600 + { "3600", B3600 }, +#endif +#ifdef B4800 + { "4800", B4800 }, +#endif +#ifdef B7200 + { "7200", B7200 }, +#endif +#ifdef B9600 + { "9600", B9600 }, +#endif +#ifdef EXTA + { "19200", EXTA }, +#endif +#ifdef B19200 + { "19200", B19200 }, +#endif +#ifdef EXTB + { "38400", EXTB }, +#endif +#ifdef B38400 + { "38400", B38400 }, +#endif + { NULL, 0 } +}; + +static struct t_c_str { + char *name; +#ifdef TCLONGNAME + char *long_name; +#endif + char *str; +} tstr[] = { + +#define T_al 0 + { "al", +#ifdef TCLONGNAME + "add new blank line", +#endif + NULL }, +#define T_bl 1 + { "bl", +#ifdef TCLONGNAME + "audible bell", +#endif + NULL }, +#define T_cd 2 + { "cd", +#ifdef TCLONGNAME + "clear to bottom", +#endif + NULL }, +#define T_ce 3 + { "ce", +#ifdef TCLONGNAME + "clear to end of line", +#endif + NULL }, +#define T_ch 4 + { "ch", +#ifdef TCLONGNAME + "cursor to horiz pos", +#endif + NULL }, +#define T_cl 5 + { "cl", +#ifdef TCLONGNAME + "clear screen", +#endif + NULL }, +#define T_dc 6 + { "dc", +#ifdef TCLONGNAME + "delete a character", +#endif + NULL }, +#define T_dl 7 + { "dl", +#ifdef TCLONGNAME + "delete a line", +#endif + NULL }, +#define T_dm 8 + { "dm", +#ifdef TCLONGNAME + "start delete mode", +#endif + NULL }, +#define T_ed 9 + { "ed", +#ifdef TCLONGNAME + "end delete mode", +#endif + NULL }, +#define T_ei 10 + { "ei", +#ifdef TCLONGNAME + "end insert mode", +#endif + NULL }, +#define T_fs 11 + { "fs", +#ifdef TCLONGNAME + "cursor from status line", +#endif + NULL }, +#define T_ho 12 + { "ho", +#ifdef TCLONGNAME + "home cursor", +#endif + NULL }, +#define T_ic 13 + { "ic", +#ifdef TCLONGNAME + "insert character", +#endif + NULL }, +#define T_im 14 + { "im", +#ifdef TCLONGNAME + "start insert mode", +#endif + NULL }, +#define T_ip 15 + { "ip", +#ifdef TCLONGNAME + "insert padding", +#endif + NULL }, +#define T_kd 16 + { "kd", +#ifdef TCLONGNAME + "sends cursor down", +#endif + NULL }, +#define T_kl 17 + { "kl", +#ifdef TCLONGNAME + "sends cursor left", +#endif + NULL }, +#define T_kr 18 + { "kr", +#ifdef TCLONGNAME + "sends cursor right", +#endif + NULL }, +#define T_ku 19 + { "ku", +#ifdef TCLONGNAME + "sends cursor up", +#endif + NULL }, +#define T_md 20 + { "md", +#ifdef TCLONGNAME + "begin bold", +#endif + NULL }, +#define T_me 21 + { "me", +#ifdef TCLONGNAME + "end attributes", +#endif + NULL }, +#define T_nd 22 + { "nd", +#ifdef TCLONGNAME + "non destructive space", +#endif + NULL }, +#define T_se 23 + { "se", +#ifdef TCLONGNAME + "end standout", +#endif + NULL }, +#define T_so 24 + { "so", +#ifdef TCLONGNAME + "begin standout", +#endif + NULL }, +#define T_ts 25 + { "ts", +#ifdef TCLONGNAME + "cursor to status line", +#endif + NULL }, +#define T_up 26 + { "up", +#ifdef TCLONGNAME + "cursor up one", +#endif + NULL }, +#define T_us 27 + { "us", +#ifdef TCLONGNAME + "begin underline", +#endif + NULL }, +#define T_ue 28 + { "ue", +#ifdef TCLONGNAME + "end underline", +#endif + NULL }, +#define T_vb 29 + { "vb", +#ifdef TCLONGNAME + "visible bell", +#endif + NULL }, +#define T_DC 30 + { "DC", +#ifdef TCLONGNAME + "delete multiple chars", +#endif + NULL }, +#define T_DO 31 + { "DO", +#ifdef TCLONGNAME + "cursor down multiple", +#endif + NULL }, +#define T_IC 32 + { "IC", +#ifdef TCLONGNAME + "insert multiple chars", +#endif + NULL }, +#define T_LE 33 + { "LE", +#ifdef TCLONGNAME + "cursor left multiple", +#endif + NULL }, +#define T_RI 34 + { "RI", +#ifdef TCLONGNAME + "cursor right multiple", +#endif + NULL }, +#define T_UP 35 + { "UP", +#ifdef TCLONGNAME + "cursor up multiple", +#endif + NULL }, +#define T_str 36 + { NULL, +#ifdef TCLONGNAME + NULL, +#endif + NULL } +}; + +static struct t_c_val { + char *name; +#ifdef TCLONGNAME + char *long_name; +#endif + int val; +} tval[] = { +#define T_pt 0 + { "pt", +#ifdef TCLONGNAME + "can use physical tabs", +#endif + 0 }, +#define T_li 1 + { "li", +#ifdef TCLONGNAME + "Number of lines", +#endif + 0 }, +#define T_co 2 + { "co", +#ifdef TCLONGNAME + "Number of columns", +#endif + 0 }, +#define T_km 3 + { "km", +#ifdef TCLONGNAME + "Has meta key", +#endif + 0 }, +#define T_val 4 + { NULL, +#ifdef TCLONGNAME + NULL, +#endif + 0 } +}; + +static bool me_all = 0; /* does two or more of the attributes use me */ + +static void ReBufferDisplay __P((void)); +static void TCalloc __P((struct t_c_str *, char *)); + + +static void +TCalloc(t, cap) + struct t_c_str *t; + char *cap; +{ + static char t_c__alloc[TC_BUFSIZ]; + char termbuf[TC_BUFSIZ]; + struct t_c_str *ts; + static int tloc = 0; + int tlen, clen; + + if (cap == NULL || *cap == '\0') { + t->str = NULL; + return; + } + else + clen = strlen(cap); + + if (t->str == NULL) + tlen = 0; + else + tlen = strlen(t->str); + + /* + * New string is shorter; no need to allocate space + */ + if (clen <= tlen) { + (void) strcpy(t->str, cap); + return; + } + + /* + * New string is longer; see if we have enough space to append + */ + if (tloc + 3 < TC_BUFSIZ) { + (void) strcpy(t->str = &t_c__alloc[tloc], cap); + tloc += clen + 1; /* one for \0 */ + return; + } + + /* + * Compact our buffer; no need to check compaction, cause we know it + * fits... + */ + tlen = 0; + for (ts = tstr; ts->name != NULL; ts++) + if (t != ts && ts->str != NULL && ts->str[0] != '\0') { + char *ptr; + + for (ptr = ts->str; *ptr != '\0'; termbuf[tlen++] = *ptr++); + termbuf[tlen++] = '\0'; + } + copy(t_c__alloc, termbuf, TC_BUFSIZ); + tloc = tlen; + if (tloc + 3 >= TC_BUFSIZ) { + stderror(ERR_NAME | ERR_TCNOSTR); + return; + } + (void) strcpy(t->str = &t_c__alloc[tloc], cap); + tloc += clen + 1; /* one for \0 */ + return; +} + + +/*ARGSUSED*/ +void +TellTC(what) + char *what; +{ + struct t_c_str *t; + + xprintf("\n\tTcsh thinks your terminal has the\n"); + xprintf("\tfollowing characteristics:\n\n"); + xprintf("\tIt has %d columns and %d lines\n", + Val(T_co), Val(T_li)); + xprintf("\tIt has %s meta key\n", T_HasMeta ? "a" : "no"); + xprintf("\tIt can%suse tabs\n", T_Tabs ? " " : "not "); + + for (t = tstr; t->name != NULL; t++) +#ifdef TCLONGNAME + xprintf("\t%25s (%s) == %s\n", t->long_name, t->name, + t->str && *t->str ? t->str : "(empty)"); +#else + xprintf("\t(%s) == %s\n", t->name, + t->str && *t->str ? t->str : "(empty)"); +#endif + xprintf("\n"); +} + + +static void +ReBufferDisplay() +{ + register int i; + Char **b; + Char **bufp; + + b = Display; + Display = NULL; + if (b != NULL) { + for (bufp = b; *bufp != NULL; bufp++) + xfree((ptr_t) * bufp); + xfree((ptr_t) b); + } + b = Vdisplay; + Vdisplay = NULL; + if (b != NULL) { + for (bufp = b; *bufp != NULL; bufp++) + xfree((ptr_t) * bufp); + xfree((ptr_t) b); + } + /* make this public, -1 to avoid wraps */ + TermH = Val(T_co) - 1; + TermV = (INBUFSIZ * 4) / TermH + 1; + b = (Char **) xmalloc((size_t) (sizeof(Char *) * (TermV + 1))); + for (i = 0; i < TermV; i++) + b[i] = (Char *) xmalloc((size_t) (sizeof(Char) * (TermH + 1))); + b[TermV] = NULL; + Display = b; + b = (Char **) xmalloc((size_t) (sizeof(Char *) * (TermV + 1))); + for (i = 0; i < TermV; i++) + b[i] = (Char *) xmalloc((size_t) (sizeof(Char) * (TermH + 1))); + b[TermV] = NULL; + Vdisplay = b; +} + +void +SetTC(what, how) + char *what, *how; +{ + struct t_c_str *ts; + struct t_c_val *tv; + + /* + * Do the strings first + */ + setname("settc"); + for (ts = tstr; ts->name != NULL; ts++) + if (strcmp(ts->name, what) == 0) + break; + if (ts->name != NULL) { + TCalloc(ts, how); + /* + * Reset variables + */ + if (GoodStr(T_me) && GoodStr(T_ue)) + me_all = (strcmp(Str(T_me), Str(T_ue)) == 0); + else + me_all = 0; + if (GoodStr(T_me) && GoodStr(T_se)) + me_all |= (strcmp(Str(T_me), Str(T_se)) == 0); + + T_CanCEOL = GoodStr(T_ce); + T_CanDel = GoodStr(T_dc) || GoodStr(T_DC); + T_CanIns = GoodStr(T_im) || GoodStr(T_ic) || GoodStr(T_IC); + T_CanUP = GoodStr(T_up) || GoodStr(T_UP); + return; + } + + /* + * Do the numeric ones second + */ + for (tv = tval; tv->name != NULL; tv++) + if (strcmp(tv->name, what) == 0) + break; + + if (tv->name != NULL) { + if (tv == &tval[T_pt] || tv == &tval[T_km]) { + if (strcmp(how, "yes") == 0) + tv->val = 1; + else if (strcmp(how, "no") == 0) + tv->val = 0; + else { + stderror(ERR_SETTCUS, tv->name); + return; + } + T_Tabs = Val(T_pt); + T_HasMeta = Val(T_km); + return; + } + else { + tv->val = atoi(how); + T_Cols = Val(T_co); + T_Lines = Val(T_li); + if (tv == &tval[T_co]) + ReBufferDisplay(); + return; + } + } + stderror(ERR_NAME | ERR_TCCAP, what); + return; +} + + +/* + * Print the t_c_ string out with variable substitution + */ +void +EchoTC(v) + Char **v; +{ + char *cap, *scap, cv[BUFSIZ]; + int arg_need, arg_cols, arg_rows; + int verbose = 0, silent = 0; + char *area; + static char *fmts = "%s\n", *fmtd = "%d\n"; + char buf[TC_BUFSIZ]; + + area = buf; + + setname("echotc"); + if (!*v || *v[0] == '\0') + return; + if (v[0][0] == '-') { + switch (v[0][1]) { + case 'v': + verbose = 1; + break; + case 's': + silent = 1; + break; + default: + stderror(ERR_NAME | ERR_TCUSAGE); + break; + } + v++; + } + (void) strcpy(cv, short2str(*v)); + if (strcmp(cv, "tabs") == 0) { + xprintf(fmts, T_Tabs ? "yes" : "no"); + flush(); + return; + } + else if (strcmp(cv, "meta") == 0) { + xprintf(fmts, Val(T_km) ? "yes" : "no"); + flush(); + return; + } + else if (strcmp(cv, "baud") == 0) { + int i; + + for (i = 0; baud_rate[i].b_name != NULL; i++) + if (T_Speed == baud_rate[i].b_rate) { + xprintf(fmts, baud_rate[i].b_name); + flush(); + return; + } + xprintf(fmtd, 0); + flush(); + return; + } + else if (strcmp(cv, "rows") == 0 || strcmp(cv, "lines") == 0) { + xprintf(fmtd, Val(T_li)); + flush(); + return; + } + else if (strcmp(cv, "cols") == 0) { + xprintf(fmtd, Val(T_co)); + flush(); + return; + } + + /* + * Count home many values we need for this capability. + */ + scap = tgetstr(cv, &area); + if (!scap || scap[0] == '\0') + stderror(silent ? ERR_SILENT : (ERR_NAME | ERR_TCCAP), cv); + + for (cap = scap, arg_need = 0; *cap; cap++) + if (*cap == '%') + switch (*++cap) { + case 'd': + case '2': + case '3': + case '.': + case '+': + arg_need++; + break; + case '%': + case '>': + case 'i': + case 'r': + case 'n': + case 'B': + case 'D': + break; + default: + /* + * hpux has lot's of them... + */ + if (verbose) + stderror(ERR_NAME | ERR_TCPARM, *cap); + /* This is bad, but I won't complain */ + break; + } + + switch (arg_need) { + case 0: + v++; + if (*v && *v[0]) + stderror(silent ? ERR_SILENT : (ERR_NAME | ERR_TCARGS), + cv, arg_need); + (void) tputs(scap, 1, putraw); + break; + case 1: + v++; + if (!*v || *v[0] == '\0') + stderror(ERR_NAME | ERR_TCNARGS, cv, 1); + arg_rows = 0; + arg_cols = atoi(short2str(*v)); + v++; + if (*v && *v[0]) + stderror(silent ? ERR_SILENT : (ERR_NAME | ERR_TCARGS), + cv, arg_need); + (void) tputs(tgoto(scap, arg_cols, arg_rows), 1, putraw); + break; + default: + /* This is wrong, but I will ignore it... */ + if (verbose) + stderror(ERR_NAME | ERR_TCARGS, cv, arg_need); + case 2: + v++; + if (!*v || *v[0] == '\0') + stderror(silent ? ERR_SILENT : (ERR_NAME | ERR_TCNARGS), cv, 2); + arg_cols = atoi(short2str(*v)); + v++; + if (!*v || *v[0] == '\0') + stderror(silent ? ERR_SILENT : (ERR_NAME | ERR_TCNARGS), cv, 2); + arg_rows = atoi(short2str(*v)); + v++; + if (*v && *v[0]) + stderror(silent ? ERR_SILENT : (ERR_NAME | ERR_TCARGS), + cv, arg_need); + (void) tputs(tgoto(scap, arg_cols, arg_rows), arg_rows, putraw); + break; + } + flush(); +} + +bool GotTermCaps = 0; + +void +BindArrowKeys() +{ + KEYCMD *map; + int i; + char *p; + static struct { + int key, fun; + } ar[] = + { + { T_kd, F_DOWN_HIST }, + { T_ku, F_UP_HIST }, + { T_kl, F_CHARBACK }, + { T_kr, F_CHARFWD } + }; + + if (!GotTermCaps) + return; + map = VImode ? CcAltMap : CcKeyMap; + + for (i = 0; i < 4; i++) { + p = tstr[ar[i].key].str; + if (p && *p) { + if (p[1]) { + AddXKeyCmd(str2short(p), ar[i].fun); + map[(unsigned char) *p] = F_XKEY; + } + else if (map[(unsigned char) *p] == F_UNASSIGNED) { + ClearXkey(map, str2short(p)); + map[(unsigned char) *p] = ar[i].fun; + } + } + } +} + +static Char cur_atr = 0; /* current attributes */ + +void +SetAttributes(atr) + int atr; +{ + atr &= ATTRIBUTES; + if (atr != cur_atr) { + if (me_all && GoodStr(T_me)) { + if ((cur_atr & BOLD) && !(atr & BOLD) || + (cur_atr & UNDER) && !(atr & UNDER) || + (cur_atr & STANDOUT) && !(atr & STANDOUT)) { + (void) tputs(Str(T_me), 1, putpure); + cur_atr = 0; + } + } + if ((atr & BOLD) != (cur_atr & BOLD)) { + if (atr & BOLD) { + if (GoodStr(T_md) && GoodStr(T_me)) { + (void) tputs(Str(T_md), 1, putpure); + cur_atr |= BOLD; + } + } + else { + if (GoodStr(T_md) && GoodStr(T_me)) { + (void) tputs(Str(T_me), 1, putpure); + if ((cur_atr & STANDOUT) && GoodStr(T_se)) { + (void) tputs(Str(T_se), 1, putpure); + cur_atr &= ~STANDOUT; + } + if ((cur_atr & UNDER) && GoodStr(T_ue)) { + (void) tputs(Str(T_ue), 1, putpure); + cur_atr &= ~UNDER; + } + cur_atr &= ~BOLD; + } + } + } + if ((atr & STANDOUT) != (cur_atr & STANDOUT)) { + if (atr & STANDOUT) { + if (GoodStr(T_so) && GoodStr(T_se)) { + (void) tputs(Str(T_so), 1, putpure); + cur_atr |= STANDOUT; + } + } + else { + if (GoodStr(T_se)) { + (void) tputs(Str(T_se), 1, putpure); + cur_atr &= ~STANDOUT; + } + } + } + if ((atr & UNDER) != (cur_atr & UNDER)) { + if (atr & UNDER) { + if (GoodStr(T_us) && GoodStr(T_ue)) { + (void) tputs(Str(T_us), 1, putpure); + cur_atr |= UNDER; + } + } + else { + if (GoodStr(T_ue)) { + (void) tputs(Str(T_ue), 1, putpure); + cur_atr &= ~UNDER; + } + } + } + } +} + +/* PWP 6-27-88 -- if the tty driver thinks that we can tab, we ask t_c_ */ +int +CanWeTab() +{ + return (Val(T_pt)); +} + +void +MoveToLine(where) /* move to line (first line == 0) */ + int where; /* as efficiently as possible; */ +{ + int del, i; + + if (where == CursorV) + return; + + if (where > TermV) { +#ifdef DEBUG_SCREEN + xprintf("MoveToLine: where is ridiculous: %d\r\n", where); + flush(); +#endif + return; + } + + if ((del = where - CursorV) > 0) { + if ((del > 1) && GoodStr(T_DO)) + (void) tputs(tgoto(Str(T_DO), del, del), del, putpure); + else { + for (i = 0; i < del; i++) + (void) putraw('\n'); + CursorH = 0; /* because the \n will become \r\n */ + } + } + else { /* del < 0 */ + if (GoodStr(T_UP) && (-del > 1 || !GoodStr(T_up))) + (void) tputs(tgoto(Str(T_UP), -del, -del), -del, putpure); + else { + if (GoodStr(T_up)) + for (i = 0; i < -del; i++) + (void) tputs(Str(T_up), 1, putpure); + } + } + CursorV = where; /* now where is here */ +} + +void +MoveToChar(where) /* move to character position (where) */ + int where; +{ /* as efficiently as possible */ + int del, i; + +mc_again: + if (where == CursorH) + return; + + if (where > (TermH + 1)) { +#ifdef DEBUG_SCREEN + xprintf("MoveToChar: where is riduculous: %d\r\n", where); + flush(); +#endif + return; + } + + if (!where) { /* if where is first column */ + (void) putraw('\r'); /* do a CR */ + CursorH = 0; + return; + } + + del = where - CursorH; + + if ((del < -4 || del > 4) && GoodStr(T_ch)) + /* go there directly */ + (void) tputs(tgoto(Str(T_ch), where, where), where, putpure); + else { + if (del > 0) { /* moving forward */ + if ((del > 4) && GoodStr(T_RI)) + (void) tputs(tgoto(Str(T_RI), del, del), del, putpure); + else { + if (T_Tabs) { /* if I can do tabs, use them */ + if ((CursorH & 0370) != (where & 0370)) { + /* if not within tab stop */ + for (i = (CursorH & 0370); i < (where & 0370); i += 8) + (void) putraw('\t'); /* then tab over */ + CursorH = where & 0370; + } + } + /* it's usually cheaper to just write the chars, so we do. */ + + /* NOTE THAT so_write() WILL CHANGE CursorH!!! */ + so_write(&Display[CursorV][CursorH], where - CursorH); + + } + } + else { /* del < 0 := moving backward */ + if ((-del > 4) && GoodStr(T_LE)) + (void) tputs(tgoto(Str(T_LE), -del, -del), -del, putpure); + else { /* can't go directly there */ + /* if the "cost" is greater than the "cost" from col 0 */ + if (T_Tabs ? (-del > ((where >> 3) + (where & 07))) + : (-del > where)) { + (void) putraw('\r'); /* do a CR */ + CursorH = 0; + goto mc_again; /* and try again */ + } + for (i = 0; i < -del; i++) + (void) putraw('\b'); + } + } + } + CursorH = where; /* now where is here */ +} + +void +so_write(cp, n) + register Char *cp; + register int n; +{ + if (n <= 0) + return; /* catch bugs */ + + if (n > (TermH + 1)) { +#ifdef DEBUG_SCREEN + xprintf("so_write: n is riduculous: %d\r\n", n); + flush(); +#endif + return; + } + + do { + if (*cp & LITERAL) { + extern Char *litptr[]; + Char *d; + +#ifdef DEBUG_LITERAL + xprintf("so: litnum %d, litptr %x\r\n", + *cp & CHAR, litptr[*cp & CHAR]); +#endif + for (d = litptr[*cp++ & CHAR]; *d & LITERAL; d++) + (void) putraw(*d & CHAR); + (void) putraw(*d); + + } + else + (void) putraw(*cp++); + CursorH++; + } while (--n); +} + + +void +DeleteChars(num) /* deletes characters */ + int num; +{ + if (num <= 0) + return; + + if (!T_CanDel) { +#ifdef DEBUG_EDIT + xprintf(" ERROR: cannot delete \n"); +#endif + flush(); + return; + } + + if (num > TermH) { +#ifdef DEBUG_SCREEN + xprintf("DeleteChars: num is riduculous: %d\r\n", num); + flush(); +#endif + return; + } + + if (GoodStr(T_DC)) /* if I have multiple delete */ + if ((num > 1) || !GoodStr(T_dc)) { /* if dc would be more expen. */ + (void) tputs(tgoto(Str(T_DC), num, num), num, putpure); + return; + } + + if (GoodStr(T_dm)) /* if I have delete mode */ + (void) tputs(Str(T_dm), 1, putpure); + + if (GoodStr(T_dc)) /* else do one at a time */ + while (num--) + (void) tputs(Str(T_dc), 1, putpure); + + if (GoodStr(T_ed)) /* if I have delete mode */ + (void) tputs(Str(T_ed), 1, putpure); +} + +void +Insert_write(cp, num) /* Puts terminal in insert character mode, */ + register Char *cp; + register int num; /* or inserts num characters in the line */ +{ + if (num <= 0) + return; + + if (!T_CanIns) { +#ifdef DEBUG_EDIT + xprintf(" ERROR: cannot insert \n"); +#endif + flush(); + return; + } + + if (num > TermH) { +#ifdef DEBUG_SCREEN + xprintf("StartInsert: num is riduculous: %d\r\n", num); + flush(); +#endif + return; + } + + if (GoodStr(T_IC)) /* if I have multiple insert */ + if ((num > 1) || !GoodStr(T_ic)) { /* if ic would be more expen. */ + (void) tputs(tgoto(Str(T_IC), num, num), num, putpure); + so_write(cp, num); /* this updates CursorH */ + return; + } + + if (GoodStr(T_im)) /* if I have insert mode */ + (void) tputs(Str(T_im), 1, putpure); + + do { + if (GoodStr(T_ic)) /* have to make num chars insert */ + (void) tputs(Str(T_ic), 1, putpure); /* insert a char */ + + (void) putraw(*cp++); + + CursorH++; + + if (GoodStr(T_ip)) /* have to make num chars insert */ + (void) tputs(Str(T_ip), 1, putpure);/* pad the inserted char */ + + } while (--num); + + if (GoodStr(T_ei)) + (void) tputs(Str(T_ei), 1, putpure); +} + +void +ClearEOL(num) /* clear to end of line. There are num */ + int num; /* characters to clear */ +{ + register int i; + + if (T_CanCEOL && GoodStr(T_ce)) + (void) tputs(Str(T_ce), 1, putpure); + else { + for (i = 0; i < num; i++) + (void) putraw(' '); + CursorH += num; /* have written num spaces */ + } +} + +void +ClearScreen() +{ /* clear the whole screen and home */ + if (GoodStr(T_cl)) + /* send the clear screen code */ + (void) tputs(Str(T_cl), Val(T_li), putpure); + else if (GoodStr(T_ho) && GoodStr(T_cd)) { + (void) tputs(Str(T_ho), Val(T_li), putpure); /* home */ + /* clear to bottom of screen */ + (void) tputs(Str(T_cd), Val(T_li), putpure); + } + else { + (void) putraw('\r'); + (void) putraw('\n'); + } +} + +void +Beep() +{ /* produce a sound */ + if (adrof(STRnobeep)) + return; + + if (GoodStr(T_vb) && adrof(STRvisiblebell)) + (void) tputs(Str(T_vb), 1, putpure); /* visible bell */ + else if (GoodStr(T_bl)) + /* what t_c_ says we should use */ + (void) tputs(Str(T_bl), 1, putpure); + else + (void) putraw('\007'); /* an ASCII bell; ^G */ +} + +void +ClearToBottom() +{ /* clear to the bottom of the screen */ + if (GoodStr(T_cd)) + (void) tputs(Str(T_cd), Val(T_li), putpure); + else if (GoodStr(T_ce)) + (void) tputs(Str(T_ce), Val(T_li), putpure); +} + +void +GetTermCaps() +{ /* read in the needed terminal capabilites */ + register int i; + char *ptr; + char buf[TC_BUFSIZ]; + static char bp[TC_BUFSIZ]; + char *area; + extern char *getenv(); + struct t_c_str *t; + + +#ifdef SIG_WINDOW +#ifdef BSDSIGS + sigmask_t omask; +#endif /* BSDSIGS */ + int lins, cols; + + /* don't want to confuse things here */ +#ifdef BSDSIGS + omask = sigblock(sigmask(SIG_WINDOW)) & ~sigmask(SIG_WINDOW); +#else /* BSDSIGS */ + (void) sighold(SIG_WINDOW); +#endif /* BSDSIGS */ +#endif /* SIG_WINDOW */ + area = buf; + + GotTermCaps = 1; + + setname("gett_c_s"); + ptr = getenv("TERM"); +#ifdef apollo + /* + * If we are on a pad, we pretend that we are dumb. Otherwise the t_c_ + * library will put us in a weird screen mode, thinking that we are going + * to use curses + */ + if (isapad()) + ptr = "dumb"; +#endif + if (!ptr || !ptr[0]) + ptr = "dumb"; + + setzero(bp, TC_BUFSIZ); + + i = tgetent(bp, ptr); + if (i <= 0) { + if (i == -1) { +#if SVID == 0 + xprintf("tcsh: Cannot open /etc/t_c_.\n"); + } + else if (i == 0) { +#endif /* SVID */ + xprintf("tcsh: No entry for terminal type \"%s\"\n", + getenv("TERM")); + } + xprintf("tcsh: using dumb terminal settings.\n"); + Val(T_co) = 80; /* do a dumb terminal */ + Val(T_pt) = Val(T_km) = Val(T_li) = 0; + for (t = tstr; t->name != NULL; t++) + TCalloc(t, NULL); + } + else { + /* Can we tab */ + Val(T_pt) = tgetflag("pt") && !tgetflag("xt"); + /* do we have a meta? */ + Val(T_km) = (tgetflag("km") || tgetflag("MT")); + Val(T_co) = tgetnum("co"); + Val(T_li) = tgetnum("li"); + for (t = tstr; t->name != NULL; t++) + TCalloc(t, tgetstr(t->name, &area)); + } + if (Val(T_co) < 2) + Val(T_co) = 80; /* just in case */ + if (Val(T_li) < 1) + Val(T_li) = 24; + + T_Cols = Val(T_co); + T_Lines = Val(T_li); + if (T_Tabs) + T_Tabs = Val(T_pt); + T_HasMeta = Val(T_km); + T_CanCEOL = GoodStr(T_ce); + T_CanDel = GoodStr(T_dc) || GoodStr(T_DC); + T_CanIns = GoodStr(T_im) || GoodStr(T_ic) || GoodStr(T_IC); + T_CanUP = GoodStr(T_up) || GoodStr(T_UP); + if (GoodStr(T_me) && GoodStr(T_ue)) + me_all = (strcmp(Str(T_me), Str(T_ue)) == 0); + else + me_all = 0; + if (GoodStr(T_me) && GoodStr(T_se)) + me_all |= (strcmp(Str(T_me), Str(T_se)) == 0); + + +#ifdef DEBUG_SCREEN + if (!T_CanUP) { + xprintf("tcsh: WARNING: Your terminal cannot move up.\n"); + xprintf("Editing may be odd for long lines.\n"); + } + if (!T_CanCEOL) + xprintf("no clear EOL capability.\n"); + if (!T_CanDel) + xprintf("no delete char capability.\n"); + if (!T_CanIns) + xprintf("no insert char capability.\n"); +#endif /* DEBUG_SCREEN */ + + + +#ifdef SIG_WINDOW + (void) GetSize(&lins, &cols); /* get the correct window size */ + ChangeSize(lins, cols); + +# ifdef BSDSIGS + (void) sigsetmask(omask); /* can change it again */ +# else /* BSDSIGS */ + (void) sigrelse(SIG_WINDOW); +# endif /* BSDSIGS */ +#else /* SIG_WINDOW */ + ChangeSize(Val(T_li), Val(T_co)); +#endif /* SIG_WINDOW */ + + BindArrowKeys(); +} + +#ifdef SIG_WINDOW +/* GetSize(): + * Return the new window size in lines and cols, and + * true if the size was changed. + */ +int +GetSize(lins, cols) + int *lins, *cols; +{ + *cols = Val(T_co); + *lins = Val(T_li); + +#ifdef TIOCGWINSZ +# ifndef lint + { + struct winsize ws; /* from 4.3 */ + + if (ioctl(SHOUT, TIOCGWINSZ, (ioctl_t) & ws) < 0) + return (0); + + if (ws.ws_col) + *cols = ws.ws_col; + if (ws.ws_row) + *lins = ws.ws_row; + } +# endif +#else /* TIOCGWINSZ */ +# ifdef TIOCGSIZE + { + struct ttysize ts; /* from Sun */ + + if (ioctl(SHOUT, TIOCGSIZE, (ioctl_t) & ts) < 0) + return; + + if (ts.ts_cols) + *cols = ts.ts_cols; + if (ts.ts_lines) + *lins = ts.ts_lines; + } +# endif /* TIOCGSIZE */ +#endif /* TIOCGWINSZ */ + + if (*cols < 2) + *cols = 80; /* just in case */ + if (*lins < 1) + *lins = 24; + + return (Val(T_co) != *cols || Val(T_li) != *lins); +} + +#endif /* SIGWINDOW */ + +void +ChangeSize(lins, cols) + int lins, cols; +{ + + Val(T_co) = cols; + Val(T_li) = lins; + +#ifdef SIG_WINDOW + { + Char buf[10]; + char *tptr; + + if (getenv("COLUMNS")) { + Itoa(Val(T_co), buf); + Setenv(STRCOLUMNS, buf); + } + + if (getenv("LINES")) { + Itoa(Val(T_li), buf); + Setenv(STRLINES, buf); + } + + if (tptr = getenv("TERMCAP")) { + Char t_c_[1024], backup[1024], *ptr; + int i; + + ptr = str2short(tptr); + (void) Strncpy(t_c_, ptr, 1024); + t_c_[1023] = '\0'; + + /* update t_c_ string; first do columns */ + buf[0] = 'c'; + buf[1] = 'o'; + buf[2] = '#'; + buf[3] = '\0'; + if ((ptr = Strstr(t_c_, buf)) == NULL) { + (void) Strcpy(backup, t_c_); + } + else { + i = ptr - t_c_ + Strlen(buf); + (void) Strncpy(backup, t_c_, i); + backup[i] = '\0'; + Itoa(Val(T_co), buf); + (void) Strcat(backup + i, buf); + ptr = Strchr(ptr, ':'); + (void) Strcat(backup, ptr); + } + + /* now do lines */ + buf[0] = 'l'; + buf[1] = 'i'; + buf[2] = '#'; + buf[3] = '\0'; + if ((ptr = Strstr(backup, buf)) == NULL) { + (void) Strcpy(t_c_, backup); + } + else { + i = ptr - backup + Strlen(buf); + (void) Strncpy(t_c_, backup, i); + t_c_[i] = '\0'; + Itoa(Val(T_li), buf); + (void) Strcat(t_c_, buf); + ptr = Strchr(ptr, ':'); + (void) Strcat(t_c_, ptr); + } + Setenv(STRTRMCAP, t_c_); + } + } +#endif /* SIG_WINDOW */ + + ReBufferDisplay(); /* re-make display buffers */ + ClearDisp(); +} diff --git a/bin/tcsh/ed.xmap.c b/bin/tcsh/ed.xmap.c new file mode 100644 index 0000000..67dcb04 --- /dev/null +++ b/bin/tcsh/ed.xmap.c @@ -0,0 +1,638 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/ed.xmap.c,v 3.0 1991/07/04 21:49:28 christos Exp $ */ +/* + * ed.xmap.c: This module contains the procedures for maintaining + * the extended-key map. + * + * An extended-key (Xkey) is a sequence of keystrokes + * introduced with an sequence introducer and consisting + * of an arbitrary number of characters. This module maintains + * a map (the Xmap) to convert these extended-key sequences + * into input strings or editor functions. It contains the + * following externally visible functions. + * + * int GetXkey(ch,code); + * Char *ch; + * Char **code; + * + * Looks up *ch in map and then reads characters until a + * complete match is found or a mismatch occurs. Returns 1 + * for command and 0 for a string. Returns NULL in code for + * no match and 0 as value. The last character read is returned + * in *ch. + * + * void AddXkey(Xkey, code); + * Char *Xkey; + * Char * code; + * + * void AddXKeyCmd(Xkey, CmdCode); + * Char *Xkey; + * Char CmdCode; + * + * Adds Xkey to the Xmap and associates the code with it. If + * Xkey is already is in Xmap, the new code is applied to the + * existing Xkey. + * + * int DeleteXkey(Xkey); + * Char *Xkey; + * + * Delete the Xkey and all longer Xkeys staring with Xkey, if + * they exists. + * + * Warning: + * If Xkey is a substring of some other Xkeys, then the longer + * Xkeys are lost!! That is, if the Xkeys "abcd" and "abcef" + * are in Xmap, adding the key "abc" will cause the first two + * definitions to be lost. + * + * void ResetXmap(); + * + * Removes all entries from Xmap and resets the defaults. + * + * void PrintXkey(Xkey); + * Char *Xkey; + * + * Prints all extended keys prefixed by Xkey and their associated + * commands. + * + * Restrictions: + * ------------- + * 1) It is not possible to have one Xkey that is a + * substring of another. + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#include "config.h" +#if !defined(lint) && !defined(pdp11) +static char *rcsid() + { return "$Id: ed.xmap.c,v 3.0 1991/07/04 21:49:28 christos Exp $"; } +#endif + +#include "sh.h" +#include "ed.h" +#include "ed.defns.h" + +#ifndef NULL +#define NULL 0 +#endif + +/* Internal Data types and declarations */ + +/* The Nodes of the Xmap. The Xmap is a linked list of these node + * elements + */ +typedef struct Xmapnode { + Char ch; /* single character of Xkey */ + Char *code; /* command code or pointer to string, if this + * is a leaf */ + struct Xmapnode *next; /* ptr to next char of this Xkey */ + struct Xmapnode *sibling; /* ptr to another Xkey with same prefix */ +} XmapNode; + +static XmapNode *Xmap = NULL; /* the current Xmap */ + +static Char CurCode; +static XmapNode CurCmd = {0, &CurCode, NULL, NULL}; + +/* Some declarations of procedures */ +static int TraverseMap __P((XmapNode *, Char *, Char **)); +static int TryNode __P((XmapNode *, Char *, Char *, int)); +static XmapNode *GetFreeNode __P((int)); +static void PutFreeNode __P((XmapNode *)); +static int TryDeleteNode __P((XmapNode **, Char *)); + + +/* ResetXmap(): + * Takes all nodes on Xmap and puts them on free list. Then + * initializes Xmap with arrow keys + */ +void +ResetXmap(vi) + int vi; +{ + static Char strA[] = {033, '[', 'A', '\0'}; + static Char strB[] = {033, '[', 'B', '\0'}; + static Char strC[] = {033, '[', 'C', '\0'}; + static Char strD[] = {033, '[', 'D', '\0'}; + static Char stOA[] = {033, 'O', 'A', '\0'}; + static Char stOB[] = {033, 'O', 'B', '\0'}; + static Char stOC[] = {033, 'O', 'C', '\0'}; + static Char stOD[] = {033, 'O', 'D', '\0'}; + + PutFreeNode(Xmap); + Xmap = NULL; + AddXKeyCmd(strA, F_UP_HIST); + AddXKeyCmd(strB, F_DOWN_HIST); + AddXKeyCmd(strC, F_CHARFWD); + AddXKeyCmd(strD, F_CHARBACK); + AddXKeyCmd(stOA, F_UP_HIST); + AddXKeyCmd(stOB, F_DOWN_HIST); + AddXKeyCmd(stOC, F_CHARFWD); + AddXKeyCmd(stOD, F_CHARBACK); + if (vi) { + AddXKeyCmd(&strA[1], F_UP_HIST); + AddXKeyCmd(&strB[1], F_DOWN_HIST); + AddXKeyCmd(&strC[1], F_CHARFWD); + AddXKeyCmd(&strD[1], F_CHARBACK); + AddXKeyCmd(&stOA[1], F_UP_HIST); + AddXKeyCmd(&stOB[1], F_DOWN_HIST); + AddXKeyCmd(&stOC[1], F_CHARFWD); + AddXKeyCmd(&stOD[1], F_CHARBACK); + } + return; +} + + +/* GetXkey(): + * Calls the recursive function with entry point Xmap + */ +int +GetXkey(ch, code) + Char *ch; + Char **code; +{ + return (TraverseMap(Xmap, ch, code)); +} + +/* TraverseMap(): + * recursively traverses node in tree until match or mismatch is + * found. May read in more characters. + */ +static int +TraverseMap(ptr, ch, code) + XmapNode *ptr; + Char *ch; + Char **code; +{ + Char tch; + + if (ptr->ch == *ch) { + /* match found */ + if (ptr->next) { + if (ptr->next != &CurCmd) { + /* Xkey not complete so get next char */ + if (G_N_Char(&tch) != 1) { /* if EOF or error */ + *ch = 0; + CurCmd.code[0] = F_SEND_EOF; + *code = CurCmd.code; + return 1; /* PWP: Pretend we just read an end-of-file */ + } + *ch = tch; + return (TraverseMap(ptr->next, ch, code)); + } + else { + CurCmd.code[0] = (Char) ptr->code; + *code = CurCmd.code; + return 1; + } + } + else { + /* next is null so this is leaf node and a string */ + *ch = 0; + *code = ptr->code; + return 0; + } + } + else { + /* no match found here */ + if (ptr->sibling) { + /* try next sibling */ + return (TraverseMap(ptr->sibling, ch, code)); + } + else { + /* no next sibling -- mismatch */ + *code = NULL; + return 0; + } + } +} + +void +AddXkey(Xkey, code) + Char *Xkey; + Char *code; +{ + if (Xkey[0] == '\0') { + xprintf("AddXkey: Null extended-key not allowed.\n"); + return; + } + + if (Xmap == NULL) + /* tree is initially empty. Set up new node to match Xkey[0] */ + Xmap = GetFreeNode(Xkey[0]); /* it is properly initialized */ + + /* Now recurse through Xmap */ + (void) TryNode(Xmap, Xkey, code, 1); /* string */ + return; +} + +void +AddXKeyCmd(Xkey, CmdCode) + Char *Xkey; + int CmdCode; +{ + /* Gould does not like casts... */ + unsigned int comp_r_bug; + + if (Xkey[0] == '\0') { + xprintf("AddXKeyCmd: Null extended-key not allowed.\n"); + return; + } + if (CmdCode == F_XKEY) { + xprintf("AddXKeyCmd: sequence-lead-in command not allowed\n"); + return; + } + + if (Xmap == NULL) + /* tree is initially empty. Set up new node to match Xkey[0] */ + Xmap = GetFreeNode(Xkey[0]); /* it is properly initialized */ + + /* Now recurse through Xmap */ + comp_r_bug = (unsigned int) CmdCode; + (void) TryNode(Xmap, Xkey, (Char *) comp_r_bug, 0); /* command */ + return; +} + + +static int +TryNode(ptr, string, code, IsString) + XmapNode *ptr; + Char *string; + Char *code; + int IsString; +{ + /* + * Find a node that matches *string or allocate a new one + */ + if (ptr->ch != *string) { + XmapNode *xm; + + for (xm = ptr; xm->sibling != NULL; xm = xm->sibling) + if (xm->sibling->ch == *string) + break; + if (xm->sibling == NULL) + xm->sibling = GetFreeNode(*string); /* setup new node */ + ptr = xm->sibling; + } + + if (*++string == '\0') { + /* we're there */ + if (ptr->next != NULL && ptr->next != &CurCmd) { + PutFreeNode(ptr->next); /* lose longer Xkeys with this prefix */ + ptr->next = NULL; + } + if (ptr->next == NULL && ptr->code) + xfree((ptr_t) ptr->code); + if (IsString) { + ptr->next = NULL; + ptr->code = Strsave(code); + } + else { + ptr->next = &CurCmd; + ptr->code = code; + } + } + else { + /* still more chars to go */ + /* + * christos: We need to allocate a new XmapNode also if the next + * XmapNode is the CurCmd, cause the previous XmapNode definition was + * only one char long! + */ + if (ptr->next == NULL || ptr->next == &CurCmd) + ptr->next = GetFreeNode(*string); /* setup new node */ + (void) TryNode(ptr->next, string, code, IsString); + } + return (0); +} + +void +ClearXkey(map, in) + KEYCMD *map; + Char *in; +{ + if ((map[(unsigned char) *in] == F_XKEY) && + ((map == CcKeyMap && CcAltMap[(unsigned char) *in] != F_XKEY) || + (map == CcAltMap && CcKeyMap[(unsigned char) *in] != F_XKEY))) + (void) DeleteXkey(in); +} + +int +DeleteXkey(Xkey) + Char *Xkey; +{ + if (Xkey[0] == '\0') { + xprintf("DeleteXkey: Null extended-key not allowed.\n"); + return (-1); + } + + if (Xmap == NULL) + return (0); + + (void) TryDeleteNode(&Xmap, Xkey); + return (0); +} + +static int +TryDeleteNode(inptr, string) + XmapNode **inptr; + Char *string; +{ + XmapNode *ptr; + XmapNode *prev_ptr = NULL; + + ptr = *inptr; + /* + * Find a node that matches *string or allocate a new one + */ + if (ptr->ch != *string) { + XmapNode *xm; + + for (xm = ptr; xm->sibling != NULL; xm = xm->sibling) + if (xm->sibling->ch == *string) + break; + if (xm->sibling == NULL) + return (0); + prev_ptr = xm; + ptr = xm->sibling; + } + + if (*++string == '\0') { + /* we're there */ + if (prev_ptr == NULL) + *inptr = ptr->sibling; + else + prev_ptr->sibling = ptr->sibling; + ptr->sibling = NULL; + PutFreeNode(ptr); + return (1); + } + else if (ptr->next != NULL && TryDeleteNode(&ptr->next, string) == 1) { + if (ptr->next != NULL) + return (0); + if (prev_ptr == NULL) + *inptr = ptr->sibling; + else + prev_ptr->sibling = ptr->sibling; + ptr->sibling = NULL; + PutFreeNode(ptr); + return (1); + } + else { + return (0); + } +} + + + + + +/* PutFreeNode(): + * Puts a tree of nodes onto free list using free(3). + */ +static void +PutFreeNode(ptr) + XmapNode *ptr; +{ + if (ptr == NULL) + return; + + if (ptr->next && ptr->next != &CurCmd) + PutFreeNode(ptr->next); + PutFreeNode(ptr->sibling); + if (ptr->next == NULL && ptr->code) + xfree((ptr_t) ptr->code); + xfree((ptr_t) ptr); +} + + +/* GetFreeNode(): + * Returns pointer to an XmapNode for ch. + */ +static XmapNode * +GetFreeNode(ch) + int ch; +{ + XmapNode *ptr; + + ptr = (XmapNode *) xmalloc((size_t) sizeof(XmapNode)); + ptr->ch = ch; + ptr->code = NULL; + ptr->next = NULL; + ptr->sibling = NULL; + return (ptr); +} + +/* Now The Print Routine */ +#define maxXkey 100 /* max length of a Xkey for print putposes */ +static Char printbuf[maxXkey]; /* buffer for printing */ + +static int Lookup(); +static int Enumerate(); +static int printOne(); +static int u_p_ch(); +extern unsigned char *u_p_string(); + +/* PrintXKey(): + * Print the binding associated with Xkey key. + * Print entire Xmap if null + */ +void +PrintXkey(key) + Char *key; +{ + /* do nothing if Xmap is empty and null key specified */ + if (Xmap == NULL && *key == 0) + return; + + printbuf[0] = '"'; + if (Lookup(key, Xmap, 1) <= -1) + /* key is not bound */ + xprintf("Unbound extended key \"%s\"\n", short2str(key)); + return; +} + +/* Lookup(): + * look for the string starting at node ptr. + * Print if last node + */ +static int +Lookup(string, ptr, cnt) + int cnt; + Char *string; + XmapNode *ptr; +{ + int ncnt; + + if (ptr == NULL) + return (-1); /* cannot have null ptr */ + + if (*string == 0) { + /* no more chars in string. Enumerate from here. */ + (void) Enumerate(ptr, cnt); + return (0); + } + else { + /* If match put this char into printbuf. Recurse */ + if (ptr->ch == *string) { + /* match found */ + ncnt = u_p_ch(cnt, ptr->ch); + if (ptr->next && ptr->next != &CurCmd) + /* not yet at leaf */ + return (Lookup(string + 1, ptr->next, ncnt + 1)); + else { + /* next node is null or &CurCmd so key should be complete */ + if (string[1] == 0) { + printbuf[ncnt + 1] = '"'; + printbuf[ncnt + 2] = '\0'; + (void) printOne(printbuf, ptr->code, ptr->next == NULL); + return (0); + } + else + return (-1);/* mismatch -- string still has chars */ + } + } + else { + /* no match found try sibling */ + if (ptr->sibling) + return (Lookup(string, ptr->sibling, cnt)); + else + return (-1); + } + } +} + +static int +Enumerate(ptr, cnt) + int cnt; + XmapNode *ptr; +{ + int ncnt; + + if (cnt >= maxXkey - 5) { /* buffer too small */ + printbuf[++cnt] = '"'; + printbuf[++cnt] = '\0'; + xprintf("Some extended keys too long for internal print buffer"); + xprintf(" \"%s...\"\n", short2str(printbuf)); + return (0); + } + + if (ptr == NULL) { +#ifdef DEBUG_EDIT + xprintf("Enumerate: BUG!! Null ptr passed\n!"); +#endif + return (-1); + } + + ncnt = u_p_ch(cnt, ptr->ch); /* put this char at end of string */ + if (ptr->next == NULL || ptr->next == &CurCmd) { + /* print this Xkey and function */ + printbuf[ncnt + 1] = '"'; + printbuf[ncnt + 2] = '\0'; + (void) printOne(printbuf, ptr->code, ptr->next == NULL); + } + else + (void) Enumerate(ptr->next, ncnt + 1); + + /* go to sibling if there is one */ + if (ptr->sibling) + (void) Enumerate(ptr->sibling, cnt); + return (0); +} + + +/* PrintOne(): + * Print the specified key and its associated + * function specified by code + */ +static int +printOne(key, code, prstring) + Char *key; + Char *code; + int prstring; +{ + struct KeyFuncs *fp; + unsigned char unparsbuf[200]; + static char *fmt = "%-15s-> %s\n"; + + if (code) { + if (prstring) + xprintf(fmt, short2str(key), u_p_string(code, unparsbuf)); + else { + for (fp = FuncNames; fp->name; fp++) { + if ((int) code == fp->func) + xprintf(fmt, short2str(key), fp->name); + } + } + } + else + xprintf(fmt, short2str(key), "no input"); + return (0); +} + +static int +u_p_ch(cnt, ch) + int cnt; + Char ch; +{ + if (ch == 0) { + printbuf[cnt++] = '^'; + printbuf[cnt] = '@'; + return cnt; + } + + if (Iscntrl(ch)) { + printbuf[cnt++] = '^'; + if (ch == '\177') + printbuf[cnt] = '?'; + else + printbuf[cnt] = ch | 0100; + } + else if (ch == '^') { + printbuf[cnt++] = '\\'; + printbuf[cnt] = '^'; + } + else if (ch == '\\') { + printbuf[cnt++] = '\\'; + printbuf[cnt] = '\\'; + } + else if (ch == ' ' || (Isprint(ch) && !Isspace(ch))) { + printbuf[cnt] = ch; + } + else { + printbuf[cnt++] = '\\'; + printbuf[cnt++] = ((ch >> 6) & 7) + '0'; + printbuf[cnt++] = ((ch >> 3) & 7) + '0'; + printbuf[cnt] = (ch & 7) + '0'; + } + return cnt; +} diff --git a/bin/tcsh/eight-bit.me b/bin/tcsh/eight-bit.me new file mode 100644 index 0000000..d54c6dc --- /dev/null +++ b/bin/tcsh/eight-bit.me @@ -0,0 +1,141 @@ +.\" $Id: eight-bit.me,v 3.0 1991/07/04 21:56:26 christos Exp $ +How to use 8 bit characters +by +Johan Widen +(jw@sics.se) +and +Per Hedeland +(per@erix.ericsson.se) + +.pp +(Disclaimer: This is really a sketch of an approach rather +than a "how-to" document. +Also, it is mostly relevant to Swedish X Window users...) + +.pp +The way I use this facility at present is to add lines such as the following +to my .cshrc: + +.nf +setenv NOREBIND +setenv LC_CTYPE iso_8859_1 +foreach key ( \\\\304 \\\\305 \\\\326 \\\\344 \\\\345 \\\\366 ) + bindkey $key self-insert-command +end +.fi + +.pp +Note that if I used a system with a reasonably complete NLS +(and a tcsh compiled to use it), +all of the above could be replaced with simply setting the LANG environment +variable to an appropriate value - the NLS would then indicate exactly which +characters should be considered printable, and tcsh would do the rebinding +of these automatically. The above works for tcsh's simulated NLS and for +the NLS in SunOS 4.1 - without the NOREBIND setting, all of the +Meta- bindings would be undone in these cases. + +.pp +These keybindings are the codes for my national characters, but the bindings +(M-d, M-e etc) are not conveniently placed. +They are however consistent with what other programs will see. + +.pp +Now: I actually want the character \\304 to be inserted when I press say '{' +together with a modifier key. I want the behavior to be the same not only +in tcsh but in say cat, an editor and all other programs. I fix this by +performing a keyboard remapping with the +.i xmodmap +program (I use X Windows). + +.pp +I give xmodmap an input something like the following: + +.nf +keycode 26 = Mode_switch +add mod2 = Mode_switch +! if you want Mode_switch to toggle, add the line below +! add Lock = Mode_switch +! Binds swedish characters on ][\\ +! +keycode 71 = bracketleft braceleft adiaeresis Adiaeresis +keycode 72 = bracketright braceright aring Aring +keycode 95 = backslash bar odiaeresis Odiaeresis +.fi + +or: + +.nf +keysym Alt_R = Mode_switch +add mod2 = Mode_switch +keysym bracketleft = bracketleft braceleft Adiaeresis adiaeresis +keysym bracketright = bracketright braceright Aring aring +keysym backslash = backslash bar Odiaeresis odiaeresis +.fi + +Another, more portable way of doing the same thing is: + +.nf +#!/bin/sh +# Make Alt-] etc produce the "appropriate" Swedish iso8859/1 keysym values +# Should handle fairly strange initial mappings + +xmodmap -pk | sed -e 's/[()]//g' | \\ +awk 'BEGIN { + alt["bracketright"] = "Aring"; alt["braceright"] = "aring"; + alt["bracketleft"] = "Adiaeresis"; alt["braceleft"] = "adiaeresis"; + alt["backslash"] = "Odiaeresis"; alt["bar"] = "odiaeresis"; +} +NF >= 5 && (alt[$3] != "" || alt[$5] != "") { + printf "keycode %s = %s %s ", $1, $3, $5; + if (alt[$3] != "") printf "%s ", alt[$3]; + else printf "%s ", $3; + printf "%s\\n", alt[$5]; + next; +} +alt[$3] != "" { + printf "keycode %s = %s %s %s\\n", $1, $3, $3, alt[$3]; +} +NF >= 5 && ($3 ~ /^Alt_[LR]$/ || $5 ~ /^Alt_[LR]$/) { + printf "keycode %s = %s %s Mode_switch\\n", $1, $3, $5; + if ($3 ~ /^Alt_[LR]$/) altkeys = altkeys " " $3; + else altkeys = altkeys " " $5; + next; +} +$3 ~ /^Alt_[LR]$/ { + printf "keycode %s = %s %s Mode_switch\\n", $1, $3, $3; + altkeys = altkeys " " $3; +} +END { + if (altkeys != "") printf "clear mod2\\nadd mod2 =%s\\n", altkeys; +}' | xmodmap - +.fi + +.pp +Finally, with the binding of the codes of my national characters to +self-insert-command, I lost the ability to use the Meta key to call the +functions previously bound to M-d, M-e, and M-v (d etc still works). +However, with the assumption that +most of my input to tcsh will be through the +.i xterm +terminal emulator, I can get that ability back via xterm bindings! +Since M-d is the only one of the "lost" key combinations that was +actually bound to a function in my case, +and it had the same binding as M-D, I can use the following in +my .Xdefaults file: + +.nf +XTerm*VT100.Translations: #override \\n\\ + Meta ~Ctrld: string(0x1b) string(d) +.fi + +- or, if I really want a complete mapping: + +.nf +XTerm*VT100.Translations: #override \\n\\ + :Meta ~Ctrld: string(0x1b) string(d) \\n\\ + :Meta ~CtrlD: string(0x1b) string(D) \\n\\ + :Meta ~Ctrle: string(0x1b) string(e) \\n\\ + :Meta ~CtrlE: string(0x1b) string(E) \\n\\ + :Meta ~Ctrlv: string(0x1b) string(v) \\n\\ + :Meta ~CtrlV: string(0x1b) string(V) +.fi diff --git a/bin/tcsh/glob.3 b/bin/tcsh/glob.3 new file mode 100644 index 0000000..6979018 --- /dev/null +++ b/bin/tcsh/glob.3 @@ -0,0 +1,319 @@ +.\" Copyright (c) 1989 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Guido van Rossum. +.\" +.\" Redistribution and use in source and binary forms are permitted provided +.\" that: (1) source distributions retain this entire copyright notice and +.\" comment, and (2) distributions including binaries display the following +.\" acknowledgement: ``This product includes software developed by the +.\" University of California, Berkeley and its contributors'' in the +.\" documentation or other materials provided with the distribution and in +.\" all advertising materials mentioning features or use of this software. +.\" Neither the name of the University nor the names of its contributors may +.\" be used to endorse or promote products derived from this software without +.\" specific prior written permission. +.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED +.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" @(#)glob.3 5.3 (Berkeley) 3/19/91 +.\" +.TH GLOB 3 "March 19, 1991" +.UC 7 +.SH NAME +glob, globfree \- generate pathnames matching a pattern +.SH SYNOPSIS +.nf +#include + +glob(const char *pattern, int flags, + const int (*errfunc)(char *, int), glob_t *pglob); + +void globfree(glob_t *pglob); +.fi +.SH DESCRIPTION +.I Glob +is a pathname generator that implements the rules for file name pattern +matching used by the shell. +.PP +The include file +.I glob.h +defines the structure type +.IR glob_t , +which contains at least the following fields: +.sp +.RS +.nf +.ta .5i +\w'char **gl_pathv;\0\0\0'u +typedef struct { + int gl_pathc; /* count of total paths so far */ + int gl_matchc; /* count of paths matching pattern */ + int gl_offs; /* reserved at beginning of gl_pathv */ + int gl_flags; /* returned flags */ + char **gl_pathv; /* list of paths matching pattern */ +} glob_t; +.fi +.RE +.PP +The argument +.I pattern +is a pointer to a pathname pattern to be expanded. +.I Glob +matches all accessible pathnames against the pattern and creates +a list of the pathnames that match. +In order to have access to a pathname, +.I glob +requires search permission on every component of a path except the last +and read permission on each directory of any filename component of +.I pattern +that contains any of the special characters ``*'', ``?'' or ``[''. +.PP +.I Glob +stores the number of matched pathnames into the +.I gl_pathc +field, and a pointer to a list of pointers to pathnames into the +.I gl_pathv +field. +The first pointer after the last pathname is NULL. +If the pattern does not match any pathnames, the returned number of +matched paths is set to zero. +.PP +It is the caller's responsibility to create the structure pointed to by +.IR pglob . +The +.I glob +function allocates other space as needed, including the memory pointed +to by +.IR gl_pathv . +.PP +The argument +.I flags +is used to modify the behavior of +.IR glob . +The value of +.I flags +is the bitwise inclusive OR of any of the following +values defined in +.IR glob.h : +.TP +GLOB_APPEND +Append pathnames generated to the ones from a previous call (or calls) +to +.IR glob . +The value of +.I gl_pathc +will be the total matches found by this call and the previous call(s). +The pathnames are appended to, not merged with the pathnames returned by +the previous call(s). +Between calls, the caller must not change the setting of the +GLOB_DOOFFS flag, nor change the value of +.I gl_offs +when +GLOB_DOOFFS is set, nor (obviously) call +.I globfree +for +.I pglob. +.TP +GLOB_DOOFFS +Make use of the +.I gl_offs +field. +If this flag is set, +.I gl_offs +is used to specify how many NULL pointers to prepend to the beginning +of the +.I gl_pathv +field. +In other words, +.I gl_pathv +will point to +.I gl_offs +NULL pointers, +followed by +.I gl_pathc +pathname pointers, followed by a NULL pointer. +.TP +GLOB_ERR +Causes +.I glob +to return when it encounters a directory that it cannot open or read. +Ordinarily, +.I glob +continues to find matches. +.TP +GLOB_MARK +Each pathname that is a directory that matches +.I pattern +has a slash +appended. +.TP +GLOB_NOSORT +By default, the pathnames are sorted in ascending ASCII order; +this flag prevents that sorting (speeding up +.IR glob ). +.TP +GLOB_NOCHECK +If +.I pattern +does not match any pathname, then +.I glob +returns a list +consisting of only +.IR pattern , +with the number of total pathnames is set to 1, and the number of matched +pathnames set to 0. +If +.I GLOB_QUOTE +is set, its effect is present in the pattern returned. +.TP +GLOB_QUOTE +Use the backslash (``\e'') character for quoting: every occurrence of +a backslash followed by a character in the pattern is replaced by that +character, avoiding any special interpretation of the character. +.PP +If, during the search, a directory is encountered that cannot be opened +or read and +.I errfunc +is non-NULL, +.I glob +calls (*\fIerrfunc\fP)(\fIpath\fP, \fIerrno\fP). +This may be unintuitive: a pattern like ``*/Makefile'' will try to +.IR stat (2) +``foo/Makefile'' even if ``foo'' is not a directory, resulting in a +call to +.IR errfunc . +The error routine can suppress this action by testing for ENOENT and +ENOTDIR; however, the GLOB_ERR flag will still cause an immediate +return when this happens. +.PP +If +.I errfunc +returns non-zero, +.I glob +stops the scan and returns +.I GLOB_ABEND +after setting +.I gl_pathc +and +.I gl_pathv +to reflect any paths already matched. +This also happens if an error is encountered and +.I GLOB_ERR +is set in +.IR flags , +regardless of the return value of +.IR errfunc , +if called. +If +.I GLOB_ERR +is not set and either +.I errfunc +is NULL or +.I errfunc +returns zero, the error is ignored. +.PP +The +.I globfree +function frees any space associated with +.I pglob +from a previous call(s) to +.IR glob . +.SH RETURNS +On successful completion, +.I glob +returns zero. +In addition the fields of +.I pglob +contain the values described below: +.TP +.I gl_pathc +contains the total number of matched pathnames so far. +This includes other matches from previous invocations of +.I glob +if +.I GLOB_APPEND +was specified. +.TP +.I gl_matchc +contains the number of matched pathnames in the current invocation of +.I glob. +.TP +.I gl_flags +contains a copy of the +.I flags +parameter with the bit GLOB_MAGCHAR set if +.I pattern +contained any of the special characters ``*'', ``?'' or ``['', cleared +if not. +.TP +.I gl_pathv +contains a pointer to a NULL-terminated list of matched pathnames. +However, if +.I gl_pathc +is zero, the contents of +.I gl_pathv +are undefined. +.PP +If +.I glob +terminates due to an error, it sets errno and returns one of the +following non-zero constants, which are defined in the include +file : +.TP +GLOB_NOSPACE +An attempt to allocate memory failed. +.TP +GLOB_ABEND +The scan was stopped because an error was encountered and either +GLOB_ERR was set or (*\fIerrfunc\fR)() returned non-zero. +.PP +The arguments +.I pglob->gl_pathc +and +.I pglob->gl_pathv +are still set as specified above. +.SH STANDARDS +The +.I glob +function is expected to be POSIX 1003.2 compatible with the exception +that the flag +.I GLOB_QUOTE +and the fields +.I gl_matchc +and +.I gl_flags +should not be used by applications striving for strict POSIX conformance. +.SH EXAMPLE +A rough equivalent of ``ls -l *.c *.h'' can be obtained with the +following code: +.sp +.nf +.RS +glob_t g; + +g.gl_offs = 2; +glob("*.c", GLOB_DOOFFS, NULL, &g); +glob("*.h", GLOB_DOOFFS | GLOB_APPEND, NULL, &g); +g.gl_pathv[0] = "ls"; +g.gl_pathv[1] = "-l"; +execvp("ls", g.gl_pathv); +.RE +.fi +.SH SEE ALSO +sh(1), fnmatch(3), wordexp(3), regexp(3) +.SH BUGS +Patterns longer than MAXPATHLEN may cause unchecked errors. +.PP +.I Glob +may fail and set errno for any of the errors specified for the +library routines +.I stat (2), +.I closedir (3), +.I opendir (3), +.I readdir (3), +.I malloc (3), +and +.I free (3). + diff --git a/bin/tcsh/glob.c b/bin/tcsh/glob.c new file mode 100644 index 0000000..f7f1354 --- /dev/null +++ b/bin/tcsh/glob.c @@ -0,0 +1,764 @@ +#undef DEBUG +/* + * Copyright (c) 1989 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Guido van Rossum. + * + * 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. + */ +#include "config.h" +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)glob.c 5.12 (Berkeley) 6/24/91"; +#endif /* LIBC_SCCS and not lint */ +/* + * Glob: the interface is a superset of the one defined in POSIX 1003.2, + * draft 9. + * + * The [!...] convention to negate a range is supported (SysV, Posix, ksh). + * + * Optional extra services, controlled by flags not defined by POSIX: + * + * GLOB_QUOTE: + * Escaping convention: \ inhibits any special meaning the following + * character might have (except \ at end of string is retained). + * GLOB_MAGCHAR: + * Set in gl_flags if pattern contained a globbing character. + * GLOB_ALTNOT: + * Use ^ instead of ! for "not". + * gl_matchc: + * Number of matches in the current invocation of glob. + */ + +#ifdef notdef +#include +#include +#include +#include +#include +typedef void * ptr_t; +#endif + +#include "sh.h" +#undef QUOTE +#undef TILDE +#undef META +#undef CHAR +#undef ismeta +#undef Strchr + +#include + +#ifndef S_ISDIR +#define S_ISDIR(a) (((a) & S_IFMT) == S_IFDIR) +#endif + +#if !defined(S_ISLNK) && defined(S_IFLNK) +#define S_ISLNK(a) (((a) & S_IFMT) == S_IFLNK) +#endif + +#if !defined(S_ISLNK) && !defined(lstat) +#define lstat stat +#endif + +#ifdef notdef +typedef unsigned short Char; +#endif + +static int glob1 __P((Char *, glob_t *, int)); +static int glob2 __P((Char *, Char *, Char *, glob_t *, int)); +static int glob3 __P((Char *, Char *, Char *, Char *, + glob_t *, int)); +static int globextend __P((Char *, glob_t *)); +static int match __P((Char *, Char *, Char *, int)); +static int compare __P((const void *, const void *)); +static DIR *Opendir __P((Char *)); +#ifdef S_IFLNK +static int Lstat __P((Char *, struct stat *)); +#endif +static Char *Strchr __P((Char *, int)); +#ifdef DEBUG +static void qprintf __P((Char *)); +#endif + +#define DOLLAR '$' +#define DOT '.' +#define EOS '\0' +#define LBRACKET '[' +#define NOT '!' +#define ALTNOT '^' +#define QUESTION '?' +#define QUOTE '\\' +#define RANGE '-' +#define RBRACKET ']' +#define SEP '/' +#define STAR '*' +#define TILDE '~' +#define UNDERSCORE '_' + +#ifdef SHORT_STRINGS +#define M_META 0x8000 +#define M_PROTECT 0x4000 +#define M_MASK 0xffff +#define M_ASCII 0x00ff +#else +#define M_META 0x0080 /* 0200 */ +#define M_PROTECT 0x007f /* 0177 0300 */ +#define M_MASK 0x00ff /* 0377 */ +#define M_ASCII 0x007f /* 0177 */ +#endif /* SHORT_STRINGS */ + +#define CHAR(c) ((c)&M_ASCII) +#define META(c) ((c)|M_META) +#define M_ALL META('*') +#define M_END META(']') +#define M_NOT META('!') +#define M_ALTNOT META('^') +#define M_ONE META('?') +#define M_RNG META('-') +#define M_SET META('[') +#define ismeta(c) (((c)&M_META) != 0) + +/* + * Need to dodge two kernel bugs: + * opendir("") != opendir(".") + * NAMEI_BUG: on plain files trailing slashes are ignored in some kernels. + * POSIX specifies that they should be ignored in directories. + */ + +static DIR * +Opendir(str) + register Char *str; +{ + char buf[MAXPATHLEN]; + register char *dc = buf; + + if (!*str) + return (opendir(".")); + while (*dc++ = *str++); + return (opendir(buf)); +} + +#ifdef S_IFLNK +static int +Lstat(fn, sb) + register Char *fn; + struct stat *sb; +{ + char buf[MAXPATHLEN]; + register char *dc = buf; + + while (*dc++ = *fn++); +# ifdef NAMEI_BUG + { + int st; + + st = lstat(buf, sb); + if (*buf) + dc--; + return (*--dc == '/' && !S_ISDIR(sb->st_mode) ? -1 : st); + } +# else + return (lstat(buf, sb)); +# endif /* NAMEI_BUG */ +} +#else +#define Lstat Stat +#endif /* S_IFLNK */ + +static int +Stat(fn, sb) + register Char *fn; + struct stat *sb; +{ + char buf[MAXPATHLEN]; + register char *dc = buf; + + while (*dc++ = *fn++); +#ifdef NAMEI_BUG + { + int st; + + st = lstat(buf, sb); + if (*buf) + dc--; + return (*--dc == '/' && !S_ISDIR(sb->st_mode) ? -1 : st); + } +#else + return (stat(buf, sb)); +#endif /* NAMEI_BUG */ +} + +static Char * +Strchr(str, ch) + Char *str; + int ch; +{ + do + if (*str == ch) + return (str); + while (*str++); + return (NULL); +} + +#ifdef DEBUG +static void +qprintf(s) +Char *s; +{ + Char *p; + + for (p = s; *p; p++) + printf("%c", *p & 0xff); + printf("\n"); + for (p = s; *p; p++) + printf("%c", *p & M_PROTECT ? '"' : ' '); + printf("\n"); + for (p = s; *p; p++) + printf("%c", *p & M_META ? '_' : ' '); + printf("\n"); +} +#endif /* DEBUG */ + +static int +compare(p, q) + const void *p, *q; +{ + return (strcmp(*(char **) p, *(char **) q)); +} + +/* + * The main glob() routine: comp_s the pattern (optionally processing + * quotes), calls glob1() to do the real pattern matching, and finally + * sorts the list (unless unsorted operation is requested). Returns 0 + * if things went well, nonzero if errors occurred. It is not an error + * to find no matches. + */ +int +glob(pattern, flags, errfunc, pglob) + const char *pattern; + int flags; + int (*errfunc) __P((char *, int)); + glob_t *pglob; +{ + int err, o_pthc; + Char *bufnext, *bufend, *comp_buf, m_not; + const unsigned char *comp_pat, *patnext; + int c, not; + Char patbuf[MAXPATHLEN + 1], *qpatnext; + int no_match; + + patnext = (unsigned char *) pattern; + if (!(flags & GLOB_APPEND)) { + pglob->gl_p_c = 0; + pglob->gl_p_v = NULL; + if (!(flags & GLOB_DOOFFS)) + pglob->gl_offs = 0; + } + pglob->gl_flags = flags & ~GLOB_MAGCHAR; + pglob->gl_errfunc = errfunc; + o_pthc = pglob->gl_p_c; + pglob->gl_matchc = 0; + + if (pglob->gl_flags & GLOB_ALTNOT) { + not = ALTNOT; + m_not = M_ALTNOT; + } + else { + not = NOT; + m_not = M_NOT; + } + + no_match = *patnext == not; + if (no_match) + patnext++; + + bufnext = patbuf; + bufend = bufnext + MAXPATHLEN; + comp_buf = bufnext; + comp_pat = patnext; + if (flags & GLOB_QUOTE) { + /* Protect the quoted characters */ + while (bufnext < bufend && (c = *patnext++) != EOS) + if (c == QUOTE) { + if ((c = *patnext++) == EOS) { + c = QUOTE; + --patnext; + } + *bufnext++ = c | M_PROTECT; + } + else + *bufnext++ = c; + } + else + while (bufnext < bufend && (c = *patnext++) != EOS) + *bufnext++ = c; + *bufnext = EOS; + + bufnext = patbuf; + qpatnext = patbuf; + /* we don't need to check for buffer overflow any more */ + while ((c = *qpatnext++) != EOS) { + switch (c) { + case LBRACKET: + pglob->gl_flags |= GLOB_MAGCHAR; + c = *qpatnext; + if (c == not) + ++qpatnext; + if (*qpatnext == EOS || + Strchr(qpatnext + 1, RBRACKET) == NULL) { + *bufnext++ = LBRACKET; + if (c == not) + --qpatnext; + break; + } + *bufnext++ = M_SET; + if (c == not) + *bufnext++ = m_not; + c = *qpatnext++; + do { + *bufnext++ = CHAR(c); + if (*qpatnext == RANGE && + (c = qpatnext[1]) != RBRACKET) { + *bufnext++ = M_RNG; + *bufnext++ = CHAR(c); + qpatnext += 2; + } + } while ((c = *qpatnext++) != RBRACKET); + *bufnext++ = M_END; + break; + case QUESTION: + pglob->gl_flags |= GLOB_MAGCHAR; + *bufnext++ = M_ONE; + break; + case STAR: + pglob->gl_flags |= GLOB_MAGCHAR; + *bufnext++ = M_ALL; + break; + default: + *bufnext++ = CHAR(c); + break; + } + } + *bufnext = EOS; +#ifdef DEBUG + qprintf(patbuf); +#endif + + if ((err = glob1(patbuf, pglob, no_match)) != 0) + return (err); + + if (pglob->gl_p_c == o_pthc && flags & GLOB_NOCHECK) { + if (!(flags & GLOB_QUOTE)) { + Char *dp = comp_buf; + const unsigned char *sp = comp_pat; + + while (*dp++ = *sp++); + } + else { + /* + * copy pattern, interpreting quotes; this is slightly different + * than the interpretation of quotes above -- which should prevail? + */ + while (*comp_pat != EOS) { + if (*comp_pat == QUOTE) { + if (*++comp_pat == EOS) + --comp_pat; + } + *comp_buf++ = (unsigned char) *comp_pat++; + } + *comp_buf = EOS; + } + return (globextend(patbuf, pglob)); + } + else if (!(flags & GLOB_NOSORT)) + qsort((char *) (pglob->gl_p_v + pglob->gl_offs + o_pthc), + pglob->gl_p_c - o_pthc, sizeof(char *), compare); + return (0); +} + +static int +glob1(pattern, pglob, no_match) + Char *pattern; + glob_t *pglob; + int no_match; +{ + Char pathbuf[MAXPATHLEN + 1]; + + /* + * a null pathname is invalid -- POSIX 1003.1 sect. 2.4. + */ + if (*pattern == EOS) + return (0); + return (glob2(pathbuf, pathbuf, pattern, pglob, no_match)); +} + +/* + * functions glob2 and glob3 are mutually recursive; there is one level + * of recursion for each segment in the pattern that contains one or + * more meta characters. + */ +static int +glob2(pathbuf, pathend, pattern, pglob, no_match) + Char *pathbuf, *pathend, *pattern; + glob_t *pglob; + int no_match; +{ + struct stat sbuf; + int anymeta; + Char *p, *q; + + /* + * loop over pattern segments until end of pattern or until segment with + * meta character found. + */ + anymeta = 0; + for (;;) { + if (*pattern == EOS) { /* end of pattern? */ + *pathend = EOS; + if (Lstat(pathbuf, &sbuf)) + return (0); + + if (((pglob->gl_flags & GLOB_MARK) && + pathend[-1] != SEP) && + (S_ISDIR(sbuf.st_mode) +#ifdef S_IFLNK + || (S_ISLNK(sbuf.st_mode) && + (Stat(pathbuf, &sbuf) == 0) && + S_ISDIR(sbuf.st_mode)) +#endif + )) { + *pathend++ = SEP; + *pathend = EOS; + } + ++pglob->gl_matchc; + return (globextend(pathbuf, pglob)); + } + + /* find end of next segment, copy tentatively to pathend */ + q = pathend; + p = pattern; + while (*p != EOS && *p != SEP) { + if (ismeta(*p)) + anymeta = 1; + *q++ = *p++; + } + + if (!anymeta) { /* no expansion, do next segment */ + pathend = q; + pattern = p; + while (*pattern == SEP) + *pathend++ = *pattern++; + } + else /* need expansion, recurse */ + return (glob3(pathbuf, pathend, pattern, p, pglob, no_match)); + } + /* NOTREACHED */ +} + + +static int +glob3(pathbuf, pathend, pattern, restpattern, pglob, no_match) + Char *pathbuf, *pathend, *pattern, *restpattern; + glob_t *pglob; + int no_match; +{ + extern int errno; + DIR *dirp; + struct dirent *dp; + int err; + Char m_not = (pglob->gl_flags & GLOB_ALTNOT) ? M_ALTNOT : M_NOT; + + *pathend = EOS; + errno = 0; + + if (!(dirp = Opendir(pathbuf))) + /* todo: don't call for ENOENT or ENOTDIR? */ + if (pglob->gl_errfunc && + (*pglob->gl_errfunc) (pathbuf, errno) || + (pglob->gl_flags & GLOB_ERR)) + return (GLOB_ABEND); + else + return (0); + + err = 0; + + /* search directory for matching names */ + while ((dp = readdir(dirp))) { + register unsigned char *sc; + register Char *dc; + + /* initial DOT must be matched literally */ + if (dp->d_name[0] == DOT && *pattern != DOT) + continue; + for (sc = (unsigned char *) dp->d_name, dc = pathend; *dc++ = *sc++;); + if (match(pathend, pattern, restpattern, m_not) == no_match) { + *pathend = EOS; + continue; + } + err = glob2(pathbuf, --dc, restpattern, pglob, no_match); + if (err) + break; + } + /* todo: check error from readdir? */ + (void) closedir(dirp); + return (err); +} + + +/* + * Extend the gl_p_v member of a glob_t structure to accomodate a new item, + * add the new item, and update gl_p_c. + * + * This assumes the BSD realloc, which only copies the block when its size + * crosses a power-of-two boundary; for v7 realloc, this would cause quadratic + * behavior. + * + * Return 0 if new item added, error code if memory couldn't be allocated. + * + * Invariant of the glob_t structure: + * Either gl_p_c is zero and gl_p_v is NULL; or gl_p_c > 0 and + * gl_p_v points to (gl_offs + gl_p_c + 1) items. + */ +#define JPN +#ifndef JPN +static int +globextend(path, pglob) + Char *path; + glob_t *pglob; +{ + register char **pathv; + register int i; + unsigned int newsize; + char *copy; + Char *p; + + newsize = sizeof(*pathv) * (2 + pglob->gl_p_c + pglob->gl_offs); + pathv = (char **) (pglob->gl_p_v ? + realloc((ptr_t) pglob->gl_p_v, newsize) : + malloc((size_t) newsize)); + if (pathv == NULL) + return (GLOB_NOSPACE); + + if (pglob->gl_p_v == NULL && pglob->gl_offs > 0) { + /* first time around -- clear initial gl_offs items */ + pathv += pglob->gl_offs; + for (i = pglob->gl_offs; --i >= 0;) + *--pathv = NULL; + } + pglob->gl_p_v = pathv; + + for (p = path; *p++;); + if ((copy = (char *) malloc((size_t) (p - path))) != NULL) { + register char *dc = copy; + register Char *sc = path; + + while (*dc++ = *sc++); + pathv[pglob->gl_offs + pglob->gl_p_c++] = copy; + } + pathv[pglob->gl_offs + pglob->gl_p_c] = NULL; + return ((copy == NULL) ? GLOB_NOSPACE : 0); +} +#else +/* + * jpn: pdp11 version to get around quadradic behavior of above version + * by managing the increments of storage allocation directly + * note: gl_offs not used in tcsh6.00.00 + */ +#define NFIRST 100 +#define NINC 50 + +static int +globextend(path, pglob) + Char *path; + glob_t *pglob; +{ + register char **pathv; + register char **opathv; + register int i; + unsigned getmem; + static unsigned int globsize = 0; + static unsigned int pathslots = 0; + + if (pglob->gl_p_c == 0) { + /* first pass; allow for NULL at end of array */ + getmem = sizeof(*pathv) * (1 + NFIRST + pglob->gl_offs); + pathv = (char **) malloc((size_t) getmem); + if (pathv == NULL) + return (GLOB_NOSPACE); + globsize = getmem; +#undef DEBUG +#ifdef DEBUG + xprintf("new gl_p_c globsize=%d\n",globsize); +#endif DEBUG + pathslots = NFIRST; + pglob->gl_p_v = pathv; + if (pglob->gl_offs > 0) { + /* first time around -- clear initial gl_offs items */ + pathv += pglob->gl_offs; + for (i = pglob->gl_offs; --i >= 0;) + *--pathv = NULL; + } + } else if (pglob->gl_p_c >= pathslots) { + /* high water, increment needed */ + char **npp; + char **opp; + opathv = pglob->gl_p_v; + getmem = globsize + (NINC * sizeof(*pathv)); + pathv = (char **) malloc((size_t) getmem); + if (pathv == NULL) + return (GLOB_NOSPACE); + globsize = getmem; +#ifdef DEBUG + xprintf("new increment, globsize=%d\n",globsize); +#endif DEBUG + pathslots += NINC; + + /* copy slots including gl_offs if any, whether or not NULL */ + i = pglob->gl_offs + pglob->gl_p_c ; + for( npp=pathv, opp=opathv; i > 0 ; i--) { + *npp++ = *opp++; + } + *npp = NULL; /* no assumption that slots are NULL */ + pglob->gl_p_v = pathv; + xfree(opathv); /* free the old base pointer; data has been copied */ + } else { + /* still room for more */ + pathv = pglob->gl_p_v; +#ifdef DEBUG + xprintf("same gl_p_v globsize=%d\n",globsize); +#endif DEBUG + } + + /* now that a free slot has been assured, save the path there */ + { + register Char *p; + char *copy; + register char *dc; + register Char *sc; + int i; + + for (p = path; *p++;); + i = p - path; + copy = (char *) malloc((size_t) (p - path)); + if (copy == NULL) + return (GLOB_NOSPACE); + dc = copy; + sc = path; + while (*dc++ = *sc++); + pathv[pglob->gl_offs + pglob->gl_p_c] = copy; + pglob->gl_p_c++; + pathv[pglob->gl_offs + pglob->gl_p_c] = NULL; +#ifdef DEBUG + xprintf("gl_p_c= %d\n",pglob->gl_p_c); +#endif DEBUG +#ifdef DEBUG2 + xprintf("path is %s\n",path); + xprintf("malloc size is %d\n",i); + xprintf("copy is %s\n",copy); +#endif DEBUG2 + } + return (0); +} +#endif /* pdp11 */ + +/* + * pattern matching function for filenames. Each occurrence of the * + * pattern causes a recursion level. + */ +static int +match(name, pat, patend, m_not) + register Char *name, *pat, *patend; + int m_not; +{ + int ok, negate_range; + Char c, k; + + while (pat < patend) { + c = *pat++; + switch (c & M_MASK) { + case M_ALL: + if (pat == patend) + return (1); + for (; *name != EOS; ++name) { + if (match(name, pat, patend, m_not)) + return (1); + } + return (0); + case M_ONE: + if (*name++ == EOS) + return (0); + break; + case M_SET: + ok = 0; + k = *name++; + if (negate_range = ((*pat & M_MASK) == m_not)) + ++pat; + while (((c = *pat++) & M_MASK) != M_END) { + if ((*pat & M_MASK) == M_RNG) { + if (c <= k && k <= pat[1]) + ok = 1; + pat += 2; + } + else if (c == k) + ok = 1; + } + if (ok == negate_range) + return (0); + break; + default: + if (*name++ != c) + return (0); + break; + } + } + return (*name == EOS); +} + +/* free allocated data belonging to a glob_t structure */ +void +globfree(pglob) + glob_t *pglob; +{ + register int i; + register char **pp; + + if (pglob->gl_p_v != NULL) { + pp = pglob->gl_p_v + pglob->gl_offs; + for (i = pglob->gl_p_c; i--; ++pp) + if (*pp) + xfree((ptr_t) * pp); + xfree((ptr_t) pglob->gl_p_v); + pglob->gl_p_c = 0; /* jpn */ + } +#ifdef DEBUG + xprintf("did globfree\n"); +#endif +} diff --git a/bin/tcsh/glob.h b/bin/tcsh/glob.h new file mode 100644 index 0000000..c9f2170 --- /dev/null +++ b/bin/tcsh/glob.h @@ -0,0 +1,67 @@ +/* + * Copyright (c) 1989 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Guido van Rossum. + * + * 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. + * + * @(#)glob.h 5.6 (Berkeley) 4/3/91 + */ + +#ifndef _GLOB_H_ +#define _GLOB_H_ + +typedef struct { + int gl_p_c; /* count of total paths so far */ + int gl_matchc; /* count of paths matching pattern */ + int gl_offs; /* reserved at beginning of gl_p_v */ + int gl_flags; /* copy of flags parameter to glob() */ + int (*gl_errfunc)(); /* copy of errfunc parameter to glob() */ + char **gl_p_v; /* list of paths matching pattern */ +} glob_t; + +#define GLOB_APPEND 0x001 /* append to output from previous call */ +#define GLOB_DOOFFS 0x002 /* use gl_offs */ +#define GLOB_ERR 0x004 /* return on error */ +#define GLOB_MAGCHAR 0x008 /* pattern had globbing characters */ +#define GLOB_MARK 0x010 /* append / to matching directories */ +#define GLOB_NOCHECK 0x020 /* return pattern itself if nothing matches */ +#define GLOB_NOSORT 0x040 /* don't sort */ +#define GLOB_QUOTE 0x080 /* quote special chars with \ */ +#define GLOB_ALTNOT 0x100 /* use alternate glob character [^ not !] */ + +#define GLOB_NOSPACE (-1) /* malloc call failed */ +#define GLOB_ABEND (-2) /* unignored error */ + +int glob __P((const char *, int, int (*)(char *, int), glob_t *)); +void globfree __P((glob_t *)); + +#endif /* !_GLOB_H_ */ diff --git a/bin/tcsh/jpnerror.c b/bin/tcsh/jpnerror.c new file mode 100644 index 0000000..33616c2 --- /dev/null +++ b/bin/tcsh/jpnerror.c @@ -0,0 +1,42 @@ +#include +#include "config.h" +#include "sh.h" + +char *efilname = "/etc/tcsh6.00strgs" ; + +void +mkprintf(a1,a2,a3,a4) + int a1; + int a2, a3, a4; +{ + char buf[256]; + int efil = -1; + + /* better not assume same file descriptor each time + static int efil = -1; + if (efil < 0) { + efil = open(efilname, O_RDONLY); + if (efil < 0) { + perror(efilname); + exit(2); + } + } + */ + efil = open(efilname, O_RDONLY); + if (efil < 0) { + perror(efilname); + exit(2); + } + if (lseek(efil, (long)a1,0) == -1) { + printf("lseek of mkstr file failed\n"); + perror(efilname); + exit(2); + } + if (read(efil, buf, 256) <= 0) { + printf("read of mkstr file failed\n"); + perror(efilname); + exit(2); + } + close(efil); + xprintf(buf, a2, a3, a4); +} diff --git a/bin/tcsh/mkprstr.c b/bin/tcsh/mkprstr.c new file mode 100644 index 0000000..75025e1 --- /dev/null +++ b/bin/tcsh/mkprstr.c @@ -0,0 +1,296 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#ifndef lint +char copyright[] = +"@(#) Copyright (c) 1980 Regents of the University of California.\n\ + All rights reserved.\n"; +#endif not lint + +#ifndef lint +static char sccsid[] = "@(#)mkstr.c 5.1 (Berkeley) 5/31/85"; +#endif not lint + +#include + +#define ungetchar(c) ungetc(c, stdin) + +long ftell(); +char *calloc(); +/* + * mkstr - create a string error message file by massaging C source + * + * Bill Joy UCB August 1977 + * + * Modified March 1978 to hash old messages to be able to recomp_ + * without addding messages to the message file (usually) + * + * Based on an earlier program conceived by Bill Joy and Chuck Haley + * + * Program to create a string error message file + * from a group of C programs. Arguments are the name + * of the file where the strings are to be placed, the + * prefix of the new files where the processed source text + * is to be placed, and the files to be processed. + * + * The program looks for 'xprintf("' in the source stream. + * Whenever it finds this, the following characters from the '"' + * to a '"' are replaced by 'seekpt' where seekpt is a + * pointer into the error message file. + * If the '(' is not immediately followed by a '"' no change occurs. + * + * The optional '-' causes strings to be added at the end of the + * existing error message file for recompilation of single routines. + */ + + +FILE *mesgread, *mesgwrite; +char *progname; +char usagestr[] = "usage: %s [ - ] mesgfile prefix file ...\n"; +char name[100], *np; + +main(argc, argv) + int argc; + char *argv[]; +{ + char addon = 0; + + argc--, progname = *argv++; + if (argc > 1 && argv[0][0] == '-') + addon++, argc--, argv++; + if (argc < 3) + fprintf(stderr, usagestr, progname), exit(1); + mesgwrite = fopen(argv[0], addon ? "a" : "w"); + if (mesgwrite == NULL) + perror(argv[0]), exit(1); + mesgread = fopen(argv[0], "r"); + if (mesgread == NULL) + perror(argv[0]), exit(1); + inithash(); + argc--, argv++; + strcpy(name, argv[0]); + np = name + strlen(name); + argc--, argv++; + do { + strcpy(np, argv[0]); + if (freopen(name, "w", stdout) == NULL) + perror(name), exit(1); + if (freopen(argv[0], "r", stdin) == NULL) + perror(argv[0]), exit(1); + process(); + argc--, argv++; + } while (argc > 0); + exit(0); +} + +process() +{ + register char *cp; + register c; + + for (;;) { + c = getchar(); + if (c == EOF) + return; + if (c != 'x') { + putchar(c); + continue; + } + if (match("xprintf(")) { + c = getchar(); + if (c != '"') { + printf("xprintf("); + putchar(c); + } + else + copystr(); + } + } +} + +match(ocp) + char *ocp; +{ + register char *cp; + register c; + + for (cp = ocp + 1; *cp; cp++) { + c = getchar(); + if (c != *cp) { + while (ocp < cp) + putchar(*ocp++); + ungetchar(c); + return (0); + } + } + return (1); +} + +copystr() +{ + register c, ch; + char buf[512]; + char obuf[512]; + register char *cp; + register char *obufp; + + cp = buf; + obufp = obuf; + for (;;) { + c = getchar(); + if (c == EOF) + break; + *obufp++ = c; /* save copy */ + switch (c) { + + case '"': + /* jpn: skip it all if string < 6 chars */ + if ( (obufp - obuf) < 6 ) { + *obufp = 0; + printf("xprintf(\"%s", obuf); + return; + } + *cp++ = 0; + goto out; + case '\\': + c = getchar(); + *obufp++ = c; /* save copy */ + switch (c) { + + case 'b': + c = '\b'; + break; + case 't': + c = '\t'; + break; + case 'r': + c = '\r'; + break; + case 'n': + c = '\n'; + break; + case '\n': + continue; + case 'f': + c = '\f'; + break; + case '\\': + break; + default: + if (!octdigit(c)) + break; + c -= '0'; + ch = getchar(); + *obufp++ = ch; /* save copy */ + if (!octdigit(ch)) + break; + c <<= 3, c += ch - '0'; + ch = getchar(); + *obufp++ = ch; /* save copy */ + if (!octdigit(ch)) + break; + c <<= 3, c += ch - '0'; + break; + } + } + *cp++ = c; + } +out: + *cp = 0; + printf("mkprintf(%d", hashit(buf, 1, NULL)); + return; +} + +octdigit(c) + char c; +{ + + return (c >= '0' && c <= '7'); +} + +inithash() +{ + char buf[512]; + int mesgpt = 0; + + rewind(mesgread); + while (fgetNUL(buf, sizeof buf, mesgread) != NULL) { + hashit(buf, 0, mesgpt); + mesgpt += strlen(buf) + 2; + } +} + +#define NBUCKETS 511 + +struct hash { + long hval; + unsigned hpt; + struct hash *hnext; +} *bucket[NBUCKETS]; + +hashit(str, really, fakept) + char *str; + char really; + unsigned fakept; +{ + int i; + register struct hash *hp; + char buf[512]; + long hshval = 0; + register char *cp; + + if (really) + fflush(mesgwrite); + for (cp = str; *cp;) + hshval = (hshval << 1) + *cp++; + i = hshval % NBUCKETS; + if (i < 0) + i += NBUCKETS; + if (really != 0) + for (hp = bucket[i]; hp != 0; hp = hp->hnext) + if (hp->hval == hshval) { + fseek(mesgread, (long) hp->hpt, 0); + fgetNUL(buf, sizeof buf, mesgread); +/* + fprintf(stderr, "Got (from %d) %s\n", hp->hpt, buf); +*/ + if (strcmp(buf, str) == 0) + break; + } + if (!really || hp == 0) { + hp = (struct hash *) calloc(1, sizeof *hp); + hp->hnext = bucket[i]; + hp->hval = hshval; + hp->hpt = really ? ftell(mesgwrite) : fakept; + if (really) { + fwrite(str, sizeof (char), strlen(str) + 1, mesgwrite); + fwrite("\n", sizeof (char), 1, mesgwrite); + } + bucket[i] = hp; + } +/* + fprintf(stderr, "%s hashed to %ld at %d\n", str, hp->hval, hp->hpt); +*/ + return (hp->hpt); +} + +#include +#include + +fgetNUL(obuf, rmdr, file) + char *obuf; + register int rmdr; + FILE *file; +{ + register c; + register char *buf = obuf; + + while (--rmdr > 0 && (c = getc(file)) != 0 && c != EOF) + *buf++ = c; + *buf++ = 0; + getc(file); + return ((feof(file) || ferror(file)) ? NULL : 1); +} diff --git a/bin/tcsh/patchlevel.h b/bin/tcsh/patchlevel.h new file mode 100644 index 0000000..60ed0f9 --- /dev/null +++ b/bin/tcsh/patchlevel.h @@ -0,0 +1,14 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/patchlevel.h,v 3.0 1991/07/04 21:54:11 christos Exp $ */ +/* + * patchlevel.h: Our life story. + */ +#ifndef _h_patchlevel +#define _h_patchlevel + +#define ORIGIN "Cornell" +#define REV 6 +#define VERS 00 +#define PATCHLEVEL 00 +#define DATE "07/04/91" + +#endif /* _h_patchlevel */ diff --git a/bin/tcsh/pathnames.h b/bin/tcsh/pathnames.h new file mode 100644 index 0000000..81d8886 --- /dev/null +++ b/bin/tcsh/pathnames.h @@ -0,0 +1,81 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/pathnames.h,v 3.0 1991/07/04 21:54:11 christos Exp $ */ +/* + * pathnames.h: Location of things to find + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#ifndef _h_pathnames +#define _h_pathnames + +#ifdef CMUCS +#define _PATH_LOCAL "/usr/cs/bin" +#else +#define _PATH_LOCAL "/usr/local" +#endif + +#define _PATH_USRBIN "/usr/bin" +#define _PATH_USRUCB "/usr/ucb" +#define _PATH_USRBSD "/usr/bsd" +#define _PATH_BIN "/bin" + +#if defined(convex) || defined(__convex__) +# define _PATH_DOTLOGIN "/etc/login" +# define _PATH_DOTLOGOUT "/etc/logout" +# define _PATH_DOTCSHRC "/etc/cshrc" +#endif /* convex || __convex__ */ + +#if defined(IRIS4D) || defined(OREO) +# define _PATH_DOTLOGIN "/etc/cshrc" +#endif /* IRIS4D || OREO */ + +#ifndef _PATH_DOTLOGIN +# define _PATH_DOTCSHRC "/etc/csh.cshrc" +# define _PATH_DOTLOGIN "/etc/csh.login" +# define _PATH_DOTLOGOUT "/etc/csh.logout" +#endif + +#define _PATH_DEVNULL "/dev/null" + +#define _PATH_BSHELL "/bin/sh" +#ifdef notdef +# define _PATH_CSHELL "/bin/csh" +#endif +#define _PATH_TCSHELL "/bin/tcsh" + +#define _PATH_LOGIN "/bin/login" +#ifdef NEWGRP +# define _PATH_BIN_NEWGRP "/bin/newgrp" +# define _PATH_USRBIN_NEWGRP "/usr/bin/newgrp" +#endif + +#endif /* _h_pathnames */ diff --git a/bin/tcsh/sh.c b/bin/tcsh/sh.c new file mode 100644 index 0000000..321cbbb --- /dev/null +++ b/bin/tcsh/sh.c @@ -0,0 +1,1729 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/sh.c,v 3.0 1991/07/04 23:34:26 christos Exp $ */ +/* + * sh.c: Main shell routines + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#include "config.h" +#if !defined(lint) && !defined(pdp11) +char copyright[] = +"@(#) Copyright (c) 1991 The Regents of the University of California.\n\ + All rights reserved.\n"; +#endif /* not lint */ + +#if !defined(lint) && !defined(pdp11) +static char *rcsid() + { return "$Id: sh.c,v 3.0 1991/07/04 23:34:26 christos Exp $"; } +#endif + +#include "sh.h" +#include "ed.h" + +extern bool MapsAreInited; +extern bool NLSMapsAreInited; +extern bool NoNLSRebind; + +/* + * C Shell + * + * Bill Joy, UC Berkeley, California, USA + * October 1978, May 1980 + * + * Jim Kulp, IIASA, Laxenburg, Austria + * April 1980 + * + * Filename recognition added: + * Ken Greer, Ind. Consultant, Palo Alto CA + * October 1983. + * + * Karl Kleinpaste, Computer Consoles, Inc. + * Added precmd, periodic/tperiod, prompt changes, + * directory stack hack, and login watch. + * Sometime March 1983 - Feb 1984. + * + * Added scheduled commands, including the "sched" command, + * plus the call to sched_run near the precmd et al + * routines. + * Upgraded scheduled events for running events while + * sitting idle at command input. + * + * Paul Placeway, Ohio State + * added stuff for running with twenex/inputl 9 Oct 1984. + * + * ported to Apple Unix (TM) (OREO) 26 -- 29 Jun 1987 + */ + +#ifdef TESLA +static int do_logout; +#endif /* TESLA */ + +Char *dumphist[] = {STRhsto, STRmh, 0, 0}; +Char *loadhist[] = {STRsource, STRmh, STRhstf, 0}; + +#ifdef CSHDIRS +Char *loaddirs[] = {STRsource, STRdirfile, 0}; +bool dflag = 0; +#endif + +#if defined(convex) || defined(__convex__) +bool use_fork = 0; /* use fork() instead of vfork()? */ +#endif + +int nofile = 0; +bool reenter = 0; +bool nverbose = 0; +bool nexececho = 0; +bool quitit = 0; +bool fast = 0; +bool batch = 0; +bool mflag = 0; +bool prompt = 1; +bool enterhist = 0; +bool tellwhat = 0; +time_t t_period; + +extern char **environ; + +static int srccat __P((Char *, Char *)); +static int srcfile __P((char *, bool, bool)); +static sigret_t phup __P((int)); +static void srcunit __P((int, bool, bool)); +static void mailchk __P((void)); +static Char **d_path __P((void)); + +int +main(argc, argv) + int argc; + char **argv; +{ + register Char *cp, *cp2; + register char *tcp, *ttyn; + register int f; + register char **tempv; + +#ifdef BSDSIGS + sigvec_t osv; +#endif /* BSDSIGS */ + + settimes(); /* Immed. estab. timing base */ +#ifdef TESLA + do_logout = 0; +#endif /* TESLA */ + + osinit(); /* Os dependent initialization */ + + /* + * Initialize non constant strings + */ +#ifdef _PATH_BSHELL + STR_BSHELL = SAVE(_PATH_BSHELL); +#endif +#ifdef _PATH_CSHELL + STR_SHELLPATH = SAVE(_PATH_CSHELL); +#endif +#ifdef _PATH_TCSHELL + STR_SHELLPATH = SAVE(_PATH_TCSHELL); +#endif + STR_environ = blk2short(environ); + environ = short2blk(STR_environ); /* So that we can free it */ + STR_WORD_CHARS = SAVE(WORD_CHARS); + + HIST = '!'; + HISTSUB = '^'; + word_chars = STR_WORD_CHARS; + bslash_quote = 0; /* PWP: do tcsh-style backslash quoting? */ + + tempv = argv; + if (eq(str2short(tempv[0]), STRaout)) /* A.out's are quittable */ + quitit = 1; + uid = getuid(); + gid = getgid(); + /* + * We are a login shell if: 1. we were invoked as - and we had + * no arguments 2. or we were invoked only with the -l flag + */ + loginsh = (**tempv == '-' && argc == 1) || (argc == 2 && + tempv[1][0] == '-' && tempv[1][1] == 'l' && + tempv[1][2] == '\0'); + if (loginsh && **tempv != '-') { + /* + * Mangle the argv space + */ + tempv[1][0] = '\0'; + tempv[1][1] = '\0'; + tempv[1] = NULL; + for (tcp = *tempv; *tcp++;); + for (tcp--; tcp >= *tempv; tcp--) + tcp[1] = tcp[0]; + *++tcp = '-'; + argc--; + } + if (loginsh) + (void) time(&chktim); + + AsciiOnly = 1; + NoNLSRebind = getenv("NOREBIND") != NULL; +#ifdef NLS + (void) setlocale(LC_ALL, ""); + { + int k; + + for (k = 0200; k <= 0377 && !Isprint(k); k++); + AsciiOnly = k > 0377; + } +#else + AsciiOnly = getenv("LANG") == NULL && getenv("LC_CTYPE") == NULL; +#endif /* NLS */ + if (MapsAreInited && !NLSMapsAreInited) + ed_INLSMaps(); + + /* + * Initialize for periodic command intervals. Also, initialize the dummy + * tty list for login-watch. + */ + (void) time(&t_period); + initwatch(); + + /* + * Move the descriptors to safe places. The variable didfds is 0 while we + * have only FSH* to work with. When didfds is true, we have 0,1,2 and + * prefer to use these. + */ + initdesc(); + + /* + * Get and set the tty now + */ + if (ttyn = ttyname(SHIN)) { + /* + * Could use rindex to get rid of other possible path components, but + * hpux preserves the subdirectory /pty/ when storing the tty name in + * utmp, so we keep it too. + */ + if (strncmp(ttyn, "/dev/", 5) == 0) + set(STRtty, cp = SAVE(ttyn + 5)); + else + set(STRtty, cp = SAVE(ttyn)); + } + else + set(STRtty, cp = SAVE("")); + /* + * Initialize the shell variables. ARGV and PROMPT are initialized later. + * STATUS is also munged in several places. CHILD is munged when + * forking/waiting + */ + + /* + * 7-10-87 Paul Placeway autologout should be set ONLY on login shells and + * on shells running as root. Out of these, autologout should NOT be set + * for any psudo-terminals (this catches most window systems) and not for + * any terminal running X windows. + * + * At Ohio State, we have had problems with a user having his X session drop + * out from under him (on a Sun) because the shell in his master xterm + * timed out and exited. + * + * Really, this should be done with a program external to the shell, that + * watches for no activity (and NO running programs, such as dump) on a + * terminal for a long peroid of time, and then SIGHUPS the shell on that + * terminal. + * + * bugfix by Rich Salz : For root rsh things allways + * first check to see if loginsh or really root, then do things with + * ttyname() + * + * Also by Jean-Francois Lamy : check the + * value of cp before using it! ("root can rsh too") + * + * PWP: keep the nested ifs; the order of the tests matters and a good (smart) + * C comp_r might re-arange things wrong. + */ +#ifdef AUTOLOGOUT + if (loginsh || (uid == 0)) { + if (*cp) { + /* only for login shells or root and we must have a tty */ + if ((cp2 = Strrchr(cp, (Char) '/')) != NULL) { + cp = cp2 + 1; + } + if (!((Strncmp(cp, STRtty, 3) == 0) && + (cp[3] >= 'p' && cp[3] <= 'u'))) { + if (getenv("DISPLAY") == NULL) { + /* NOT on X window shells */ + set(STRa_logout, Strsave(STRdflt_auto_logout)); + } + } + } + } +#endif /* AUTOLOGOUT */ + + (void) sigset(SIGALRM, alrmcatch); + + set(STRstatus, Strsave(STR0)); + fix_version(); /* publish the shell version */ + + /* + * set the shell-level var to 1 or increment it. + */ + if ((tcp = getenv("SHLVL")) != NULL) { + Char buff[BUFSIZ]; + + Itoa(1 + atoi(tcp), buff); + set(STRshlvl, Strsave(buff)); + Setenv(STRSHLVL, buff); + } + else { + set(STRshlvl, SAVE("1")); + Setenv(STRSHLVL, str2short("1")); + } + + if ((tcp = getenv("HOME")) != NULL) + cp = SAVE(tcp); + else + cp = NOSTR; + if (cp == NOSTR) + fast = 1; /* No home -> can't read scripts */ + else + set(STRhome, cp); + dinit(cp); /* dinit thinks that HOME == cwd in a login + * shell */ + /* + * Grab other useful things from the environment. Should we grab + * everything?? + */ + if ((tcp = getenv("LOGNAME")) != NULL || (tcp = getenv("USER")) != NULL) + set(STRuser, SAVE(tcp)); + if ((tcp = getenv("TERM")) != NULL) + set(STRterm, SAVE(tcp)); + + /* + * set usefull environment things for the user + */ + { + + Char buff[BUFSIZ]; + +#ifdef apollo + int oid = getoid(); + + Itoa(oid, buff); + set(STRoid, Strsave(buff)); +#endif /* apollo */ + Itoa(uid, buff); + set(STRuid, Strsave(buff)); + + Itoa(gid, buff); + set(STRgid, Strsave(buff)); + } + + /* + * HOST may be wrong, since rexd transports the entire environment on sun + * 3.x Just set it again + */ + { + char cbuff[MAXHOSTNAMELEN]; + + if (gethostname(cbuff, sizeof(cbuff)) >= 0) { + cbuff[sizeof(cbuff) - 1] = '\0'; /* just in case */ + Setenv(STRHST, str2short(cbuff)); + } + else + Setenv(STRHST, str2short("unknown")); + } + + + /* + * HOSTTYPE, too. Just set it again. + */ + Setenv(STRHSTTYPE, GetHostType()); +#ifdef apollo + if ((tcp = getenv("SYSTYPE")) == NULL) + tcp = "bsd4.3"; + Setenv(STRSYSTYPE, str2short(tcp)); +#endif /* apollo */ + + /* + * set editing on by default, unless running under Emacs as an inferior + * shell. + */ + if ((tcp = getenv("EMACS")) == NULL || strcmp(tcp, "t") != 0) { + /* not running under Emacs */ + /* The 'edit' variable is either set or unset. It doesn't */ + /* need a value. Making it 'emacs' might be confusing. */ + set(STRedit, Strsave(STRNULL)); + editing = 1; + } + else { /* running under Emacs */ + /* we don't set edit to anything */ + editing = 0; + } + + + /* + * still more mutability: make the complete routine automatically add the + * suffix of file names... + */ + set(STRaddsuffix, Strsave(STRNULL)); + + /* + * Re-initialize path if set in environment + */ + if ((tcp = getenv("PATH")) == NULL) + set1(STRpath, d_path(), &shvhed); + else + importpath(SAVE(tcp)); + + set(STRshell, Strsave(STR_SHELLPATH)); + + doldol = putn((int) getpid()); /* For $$ */ + shtemp = Strspl(STRtmpsh, doldol); /* For << */ + + /* + * Record the interrupt states from the parent process. If the parent is + * non-interruptible our hand must be forced or we (and our children) won't + * be either. Our children inherit termination from our parent. We catch it + * only if we are the login shell. + */ +#ifdef BSDSIGS + /* parents interruptibility */ + (void) mysigvec(SIGINT, NULL, &osv); + parintr = (sigret_t(*) ()) osv.sv_handler; + (void) mysigvec(SIGTERM, NULL, &osv); + parterm = (sigret_t(*) ()) osv.sv_handler; +#else /* BSDSIGS */ + parintr = signal(SIGINT, SIG_IGN); /* parents interruptibility */ + (void) sigset(SIGINT, parintr); /* ... restore */ + parterm = signal(SIGTERM, SIG_IGN); /* parents terminability */ + (void) sigset(SIGTERM, parterm); /* ... restore */ +#endif /* BSDSIGS */ + + if (loginsh) { + (void) signal(SIGHUP, phup); /* exit processing on HUP */ +#ifdef SIGXCPU + (void) signal(SIGXCPU, phup); /* ...and on XCPU */ +#endif /* SIGXCPU */ +#ifdef SIGXFSZ + (void) signal(SIGXFSZ, phup); /* ...and on XFSZ */ +#endif /* SIGXFSZ */ + } + +#ifdef TCF + /* Enable process migration on ourselves and our progeny */ + (void) signal(SIGMIGRATE, SIG_DFL); +#endif /* TCF */ + + /* + * Process the arguments. + * + * Note that processing of -v/-x is actually delayed till after script + * processing. + * + * We set the first character of our name to be '-' if we are a shell running + * interruptible commands. Many programs which examine ps'es use this to + * filter such shells out. + */ + argc--, tempv++; + while (argc > 0 && (tcp = tempv[0])[0] == '-' && + *++tcp != '\0' && !batch) { + do + switch (*tcp++) { + + case 0: /* - Interruptible, no prompt */ + prompt = 0; + setintr = 1; + nofile = 1; + break; + + case 'b': /* -b Next arg is input file */ + batch = 1; + break; + + case 'c': /* -c Command input from arg */ + if (argc == 1) + xexit(0); + argc--, tempv++; + arginp = SAVE(tempv[0]); + /* + * * Give an error on -c arguments that end in * backslash to + * ensure that you don't make * nonportable csh scripts. + */ + { + register Char *cp; + register int count; + + cp = arginp + Strlen(arginp); + count = 0; + while (cp > arginp && *--cp == '\\') + ++count; + if ((count & 1) != 0) { + exiterr = 1; + stderror(ERR_ARGC); + } + } + prompt = 0; + nofile = 1; + break; + +#ifdef CSHDIRS + case 'd': /* -d Force load of ~/.cshdirs */ + dflag++; + break; +#endif + + + case 'e': /* -e Exit on any error */ + exiterr = 1; + break; + + case 'f': /* -f Fast start */ + fast = 1; + break; + + case 'i': /* -i Interactive, even if !intty */ + intact = 1; + nofile = 1; + break; + + case 'm': /* -m read .cshrc (from su) */ + mflag = 1; + break; + + case 'n': /* -n Don't execute */ + noexec = 1; + break; + + case 'q': /* -q (Undoc'd) ... die on quit */ + quitit = 1; + break; + + case 's': /* -s Read from std input */ + nofile = 1; + break; + + case 't': /* -t Read one line from input */ + onelflg = 2; + prompt = 0; + nofile = 1; + break; + + case 'v': /* -v Echo hist expanded input */ + nverbose = 1; /* ... later */ + break; + + case 'x': /* -x Echo just before execution */ + nexececho = 1; /* ... later */ + break; + + case 'V': /* -V Echo hist expanded input */ + setNS(STRverbose); /* NOW! */ + break; + + case 'X': /* -X Echo just before execution */ + setNS(STRecho); /* NOW! */ + break; + +#if defined(__convex__) || defined(convex) + case 'F': /* Undocumented flag */ + /* + * This will cause children to be created using fork instead of + * vfork. + */ + use_fork = 1; + break; +#endif + + } while (*tcp); + tempv++, argc--; + } + + if (quitit) /* With all due haste, for debugging */ + (void) signal(SIGQUIT, SIG_DFL); + + /* + * Unless prevented by -, -c, -i, -s, or -t, if there are remaining + * arguments the first of them is the name of a shell file from which to + * read commands. + */ + if (nofile == 0 && argc > 0) { + nofile = open(tempv[0], O_RDONLY); + if (nofile < 0) { + child = 1; /* So this ... */ + /* ... doesn't return */ + stderror(ERR_SYSTEM, tempv[0], strerror(errno)); + } + ffile = SAVE(tempv[0]); + /* + * Replace FSHIN. Handle /dev/std{in,out,err} specially + * since once they are closed we cannot open them again. + * In that case we use our own saved descriptors + */ + if ((SHIN = dmove(nofile, FSHIN)) < 0) + switch(nofile) { + case 0: + SHIN = FSHIN; + break; + case 1: + SHIN = FSHOUT; + break; + case 2: + SHIN = FSHDIAG; + break; + default: + stderror(ERR_SYSTEM, tempv[0], strerror(errno)); + break; + } +#ifdef FIOCLEX + (void) ioctl(SHIN, FIOCLEX, NULL); +#endif + prompt = 0; + /* argc not used any more */ tempv++; + } + /* + * Consider input a tty if it really is or we are interactive. but not for + * editing (christos) + */ + if (!(intty = isatty(SHIN))) { + if (adrof(STRedit)) + unsetv(STRedit); + editing = 0; + } + intty |= intact; + if (intty || (intact && isatty(SHOUT))) { + if (!batch && (uid != geteuid() || gid != getegid())) { + errno = EACCES; + child = 1; /* So this ... */ + /* ... doesn't return */ + stderror(ERR_SYSTEM, "tcsh", strerror(errno)); + } + } + isoutatty = isatty(SHOUT); + isdiagatty = isatty(SHDIAG); + /* + * Decide whether we should play with signals or not. If we are explicitly + * told (via -i, or -) or we are a login shell (arg0 starts with -) or the + * input and output are both the ttys("csh", or "csh/dev/ttyx") + * Note that in only the login shell is it likely that parent may have set + * signals to be ignored + */ + if (loginsh || intact || intty && isatty(SHOUT)) + setintr = 1; + settell(); + /* + * Save the remaining arguments in argv. + */ + setq(STRargv, blk2short(tempv), &shvhed); + + /* + * Set up the prompt. + */ + if (prompt) { + set(STRprompt, Strsave(uid == 0 ? STRsymhash : STRsymarrow)); + /* that's a meta-questionmark */ + set(STRp_2, Strsave(STRmquestion)); + set(STRp_3, Strsave(STRCORRECT)); + } + + /* + * If we are an interactive shell, then start fiddling with the signals; + * this is a tricky game. + */ + shpgrp = mygetpgrp(); + opgrp = tpgrp = -1; + if (setintr) { + **argv = '-'; + if (!quitit) /* Wary! */ + (void) signal(SIGQUIT, SIG_IGN); + (void) sigset(SIGINT, pintr); + (void) sighold(SIGINT); + (void) signal(SIGTERM, SIG_IGN); + if (quitit == 0 && arginp == 0) { +#ifdef SIGTSTP + (void) signal(SIGTSTP, SIG_IGN); +#endif +#ifdef SIGTTIN + (void) signal(SIGTTIN, SIG_IGN); +#endif +#ifdef SIGTTOU + (void) signal(SIGTTOU, SIG_IGN); +#endif + /* + * Wait till in foreground, in case someone stupidly runs csh & + * dont want to try to grab away the tty. + */ + if (isatty(FSHDIAG)) + f = FSHDIAG; + else if (isatty(FSHOUT)) + f = FSHOUT; + else if (isatty(OLDSTD)) + f = OLDSTD; + else + f = -1; + + retry: +#ifdef BSDJOBS /* if we have tty job control */ + if ((tpgrp = tcgetpgrp(f)) != -1) { + if (tpgrp != shpgrp) { + sigret_t(*old) () = signal(SIGTTIN, SIG_DFL); + (void) kill(0, SIGTTIN); + (void) signal(SIGTTIN, old); + goto retry; + } + /* + * Thanks to Matt Day for the POSIX references, and to + * Paul Close for the SGI clarification. + */ + if (setdisc(f) != -1) { + opgrp = shpgrp; + shpgrp = getpid(); + tpgrp = shpgrp; + if (tcsetpgrp(f, shpgrp) == -1) { + /* + * On hpux 7.03 this fails with EPERM. This happens on + * the 800 when opgrp != shpgrp at this point. (we were + * forked from a non job control shell) + * POSIX 7.2.4, says we failed because the process + * group specified did not belong to a process + * in the same session with the tty. So we set our + * process group and try again. + */ + if (setpgid(0, shpgrp) == -1) { + xprintf("setpgid:"); + goto notty; + } + if (tcsetpgrp(f, shpgrp) == -1) { + xprintf("tcsetpgrp:"); + goto notty; + } + } + /* + * We check the process group now. If it is the same, then + * we don't need to set it again. On hpux 7.0 on the 300's + * if we set it again it fails with EPERM. This is the + * correct behavior according to POSIX 4.3.3 if the process + * was a session leader . + */ + else if (shpgrp != mygetpgrp()) { + if(setpgid(0, shpgrp) == -1) { + xprintf("setpgid:"); + goto notty; + } + } +#ifdef IRIS4D + /* + * But on irix 3.3 we need to set it again, even if it is + * the same. We do that to tell the system that we + * need BSD process group compatibility. + */ + else + (void) setpgid(0, shpgrp); +#endif +#ifdef FIOCLEX + (void) ioctl(dcopy(f, FSHTTY), FIOCLEX, NULL); +#else /* FIOCLEX */ + (void) dcopy(f, FSHTTY); +#endif /* FIOCLEX */ + } + else + tpgrp = -1; + } + if (tpgrp == -1) { + notty: + xprintf("Warning: no access to tty (%s).\n", strerror(errno)); + xprintf("Thus no job control in this shell.\n"); + /* + * Fix from:Sakari Jalovaara if we don't + * have access to tty, disable editing too + */ + if (adrof(STRedit)) + unsetv(STRedit); + editing = 0; + } +#else /* BSDJOBS */ /* don't have job control, so frotz it */ + tpgrp = -1; +#endif /* BSDJOBS */ + } + } + if ((setintr == 0) && (parintr == SIG_DFL)) + setintr = 1; + (void) sigset(SIGCHLD, pchild); /* while signals not ready */ + + /* + * Set an exit here in case of an interrupt or error reading the shell + * start-up scripts. + */ + reenter = setexit(); /* PWP */ + haderr = 0; /* In case second time through */ + if (!fast && reenter == 0) { + /* Will have value(STRhome) here because set fast if don't */ + { + int osetintr = setintr; + +#ifdef BSDSIGS + sigmask_t omask = sigblock(sigmask(SIGINT)); +#else + sighold(SIGINT); +#endif + setintr = 0; +#ifdef _PATH_DOTCSHRC + (void) srcfile(_PATH_DOTCSHRC, 0, 0); +#endif + if (!fast && !arginp && !onelflg) + dohash(); +#ifdef _PATH_DOTLOGIN + if (loginsh) + (void) srcfile(_PATH_DOTLOGIN, 0, 0); +#endif +#ifdef BSDSIGS + (void) sigsetmask(omask); +#else + (void) sigrelse(SIGINT); +#endif + setintr = osetintr; + } +#ifdef LOGINFIRST + if (loginsh) + (void) srccat(value(STRhome), STRd_login); +#endif + /* upward compat. */ + if (!srccat(value(STRhome), STRd_tcshrc)) + (void) srccat(value(STRhome), STRd_cshrc); + + if (!fast && !arginp && !onelflg && !havhash) + dohash(); + /* + * Source history before .login so that it is available in .login + */ + dosource(loadhist); +#ifndef LOGINFIRST + if (loginsh) + (void) srccat(value(STRhome), STRd_login); +#endif +#ifdef CSHDIRS + /* + * if dflag then source ~/.cshdirs, but if fast ALWAYS skip the dirs + * restoring. (dflag used to get non-login shells to source the save + * dirs file). Of course, ~/.cshdirs must exist. -strike + */ + { + extern int bequiet; /* make dirs shut up */ + Char cshd[BUFSIZ]; + struct stat st; + + (void) Strcpy(cshd, value(STRhome)); + (void) Strcat(cshd, STRs_dirs); + if (!stat(short2str(cshd), &st) && + (dflag || loginsh) && !fast) { + bequiet = 1; + dosource(loaddirs); + bequiet = 0; + } + } +#endif + } + /* Initing AFTER .cshrc is the Right Way */ + if (intty && !arginp) { /* PWP setup stuff */ + ed_I(); /* init the new line editor */ +#ifdef SIG_WINDOW + check_window_size(1); /* mung environment */ +#endif /* SIG_WINDOW */ + } + + /* + * Now are ready for the -v and -x flags + */ + if (nverbose) + setNS(STRverbose); + if (nexececho) + setNS(STRecho); + /* + * All the rest of the world is inside this call. The argument to process + * indicates whether it should catch "error unwinds". Thus if we are a + * interactive shell our call here will never return by being blown past on + * an error. + */ + process(setintr); + + /* + * Mop-up. + */ + if (intty) { + if (loginsh) { + xprintf("logout\n"); + (void) close(SHIN); + child = 1; +#ifdef TESLA + do_logout = 1; +#endif /* TESLA */ + goodbye(); + } + else { + xprintf("exit\n"); + } + } +#ifdef CSHDIRS + /* + * save the directory stack -strike + */ + recdirs(); +#endif + rechist(); + exitstat(); + return (0); +} + +void +untty() +{ +#ifdef BSDJOBS + if (tpgrp > 0) { + (void) setpgid(0, opgrp); + (void) tcsetpgrp(FSHTTY, opgrp); + (void) resetdisc(FSHTTY); + } +#endif /* BSDJOBS */ +} + +void +importpath(cp) + Char *cp; +{ + register int i = 0; + register Char *dp; + register Char **pv; + int c; + + for (dp = cp; *dp; dp++) + if (*dp == ':') + i++; + /* + * i+2 where i is the number of colons in the path. There are i+1 + * directories in the path plus we need room for a zero terminator. + */ + pv = (Char **) xcalloc((size_t) (i + 2), sizeof(Char **)); + dp = cp; + i = 0; + if (*dp) + for (;;) { + if ((c = *dp) == ':' || c == 0) { + *dp = 0; + pv[i++] = Strsave(*cp ? cp : STRdot); + if (c) { + cp = dp + 1; + *dp = ':'; + } + else + break; + } + dp++; + } + pv[i] = 0; + set1(STRpath, pv, &shvhed); +} + +/* + * Source to the file which is the catenation of the argument names. + */ +static int +srccat(cp, dp) + Char *cp, *dp; +{ + if (cp[0] == '/' && cp[1] == '\0') + return srcfile(short2str(dp), mflag ? 0 : 1, 0); + else { + register Char *ep = Strspl(cp, dp); + char *ptr = short2str(ep); + + xfree((ptr_t) ep); + return srcfile(ptr, mflag ? 0 : 1, 0); + } +} + +/* + * Source to a file putting the file descriptor in a safe place (> 2). + */ +static int +srcfile(f, onlyown, flag) + char *f; + bool onlyown, flag; +{ + register int unit; + + if ((unit = open(f, O_RDONLY)) == -1) + return 0; + unit = dmove(unit, -1); + +#ifdef FIOCLEX + (void) ioctl(unit, FIOCLEX, NULL); +#endif + srcunit(unit, onlyown, flag); + return 1; +} + +/* + * Source to a unit. If onlyown it must be our file or our group or + * we don't chance it. This occurs on ".cshrc"s and the like. + */ +int insource; +static void +srcunit(unit, onlyown, hflg) + register int unit; + bool onlyown, hflg; +{ + /* + * PWP: this is arranged like this so that an optimizing comp_r won't go + * and put things like oSHIN in a register that longjmp() restores. The + * problem is that on my Sun 3/50, gcc will put oSHIN in a register. That + * would be OK, but setjmp() saves ALL of the registers and longjmp() + * restores ALL of them, thus if you do a setjmp(), set oSHIN to something + * (like SHIN), then do a longjmp(), the value of oSHIN will magically + * become -1 again. + * + * Perhaps setjmp() should only save the stack pointer, frame pointer, and + * program counter... + */ + + /* We have to push down a lot of state here */ + /* All this could go into a structure */ + int oSHIN = -1, oldintty = intty, oinsource = insource; + struct whyle *oldwhyl = whyles; + Char *ogointr = gointr, *oarginp = arginp; + Char *oevalp = evalp, **oevalvec = evalvec; + int oonelflg = onelflg; + bool oenterhist = enterhist; + char OHIST = HIST; + bool otell = cantell; + struct Bin saveB; +#ifdef BSDSIGS + volatile sigmask_t omask = (sigmask_t) 0; +#endif + jmp_buf oldexit; + + /* The (few) real local variables */ + int my_reenter; + + if (unit < 0) + return; + if (didfds) + donefds(); + if (onlyown) { + struct stat stb; + + if (fstat(unit, &stb) < 0 + /* || (stb.st_uid != uid && stb.st_gid != gid) */ + ) { + (void) close(unit); + return; + } + } + + /* + * There is a critical section here while we are pushing down the input + * stream since we have stuff in different structures. If we weren't + * careful an interrupt could corrupt SHIN's Bin structure and kill the + * shell. + * + * We could avoid the critical region by grouping all the stuff in a single + * structure and pointing at it to move it all at once. This is less + * efficient globally on many variable references however. + */ + insource = 1; + getexit(oldexit); + + if (setintr) +#ifdef BSDSIGS + omask = sigblock(sigmask(SIGINT)); +#else + (void) sighold(SIGINT); +#endif + /* + * Bugfix for running out of memory by: Jak Kirman + * . Solution: pay attention to what + * setexit() is returning because my_reenter _may_ be in a register, and + * thus restored to 0 on a longjump(). (PWP: insert flames about + * comp_r-dependant code here) PWP: THANKS LOTS !!! + */ + /* Setup the new values of the state stuff saved above */ + copy((char *) &(saveB), (char *) &B, sizeof(B)); + fbuf = NULL; + fseekp = feobp = fblocks = 0; + oSHIN = SHIN, SHIN = unit, arginp = 0, onelflg = 0; + intty = isatty(SHIN), whyles = 0, gointr = 0; + evalvec = 0; + evalp = 0; + enterhist = hflg; + if (enterhist) + HIST = '\0'; + + /* + * Now if we are allowing commands to be interrupted, we let ourselves be + * interrupted. + */ + if (setintr) +#ifdef BSDSIGS + (void) sigsetmask(omask); +#else + (void) sigrelse(SIGINT); +#endif + settell(); + +/* PWP: think of this as like a LISP (unwind-protect ...) */ +/* thanks to Diana Smetters for pointing out how this _should_ be written */ + if ((my_reenter = setexit()) == 0) { + process(0); /* 0 -> blow away on errors */ + } + + if (setintr) +#ifdef BSDSIGS + (void) sigsetmask(omask); +#else + (void) sigrelse(SIGINT); +#endif + if (oSHIN >= 0) { + register int i; + + /* We made it to the new state... free up its storage */ + /* This code could get run twice but xfree doesn't care */ + for (i = 0; i < fblocks; i++) + xfree((ptr_t) fbuf[i]); + xfree((ptr_t) fbuf); + + /* Reset input arena */ + copy((char *) &B, (char *) &(saveB), sizeof(B)); + + (void) close(SHIN), SHIN = oSHIN; + arginp = oarginp, onelflg = oonelflg; + evalp = oevalp, evalvec = oevalvec; + intty = oldintty, whyles = oldwhyl, gointr = ogointr; + if (enterhist) + HIST = OHIST; + enterhist = oenterhist; + cantell = otell; + } + + resexit(oldexit); + /* + * If process reset() (effectively an unwind) then we must also unwind. + */ + if (my_reenter) + stderror(ERR_SILENT); + insource = oinsource; +} + +void +rechist() +{ + Char buf[BUFSIZ]; + int fp, ftmp, oldidfds; + + if (!fast) { + if (value(STRsvhist)[0] == '\0') + return; + (void) Strcpy(buf, value(STRhome)); + (void) Strcat(buf, STRs_hist); + fp = creat(short2str(buf), 0600); + if (fp == -1) + return; + oldidfds = didfds; + didfds = 0; + ftmp = SHOUT; + SHOUT = fp; + (void) Strcpy(buf, value(STRsvhist)); + dumphist[2] = buf; + dohist(dumphist); + (void) close(fp); + SHOUT = ftmp; + didfds = oldidfds; + } +} + +void +goodbye() +{ + rechist(); + +#ifdef CSHDIRS + recdirs(); +#endif + + if (loginsh) { + (void) signal(SIGQUIT, SIG_IGN); + (void) sigset(SIGINT, SIG_IGN); + (void) signal(SIGTERM, SIG_IGN); + setintr = 0; /* No interrupts after "logout" */ + if (!(adrof(STRlogout))) + set(STRlogout, STRnormal); +#ifdef _PATH_DOTLOGOUT + (void) srcfile(_PATH_DOTLOGOUT, 0, 0); +#endif + if (adrof(STRhome)) + (void) srccat(value(STRhome), STRs_logout); +#ifdef TESLA + do_logout = 1; +#endif /* TESLA */ + } + exitstat(); +} + +void +exitstat() +{ + +#ifdef PROF + monitor(0); +#endif + /* + * Note that if STATUS is corrupted (i.e. getn bombs) then error will exit + * directly because we poke child here. Otherwise we might continue + * unwarrantedly (sic). + */ + child = 1; + xexit(getn(value(STRstatus))); +} + +/* + * in the event of a HUP we want to save the history + */ +static sigret_t +phup(i) +int i; +{ + rechist(); +#ifdef CSHDIRS + /* + * save the directory stack on HUP - strike + */ + recdirs(); +#endif + xexit(i); +#ifndef SIGVOID + return (i); +#endif +} + +Char *jobargv[2] = {STRjobs, 0}; + +/* + * Catch an interrupt, e.g. during lexical input. + * If we are an interactive shell, we reset the interrupt catch + * immediately. In any case we drain the shell output, + * and finally go through the normal error mechanism, which + * gets a chance to make the shell go away. + */ +int just_signaled; /* bugfix by Michael Bloom (mg@ttidca.TTI.COM) */ + +sigret_t +pintr(i) +int i; +{ + just_signaled = 1; + pintr1(1); +#ifndef SIGVOID + return (i); +#endif +} + +void +pintr1(wantnl) + bool wantnl; +{ + register Char **v; +#ifdef BSDSIGS + sigmask_t omask; +#endif + +#ifdef BSDSIGS + omask = sigblock((sigmask_t) 0); +#endif + if (setintr) { +#ifdef BSDSIGS + (void) sigsetmask(omask & ~sigmask(SIGINT)); +#else + (void) sigrelse(SIGINT); +#endif + if (pjobs) { + pjobs = 0; + xprintf("\n"); + dojobs(jobargv); + stderror(ERR_NAME | ERR_INTR); + } + } + /* JV - Make sure we shut off inputl */ + { + extern Char GettingInput; + + (void) Cookedmode(); + GettingInput = 0; + } +#ifdef BSDSIGS + (void) sigsetmask(omask & ~sigmask(SIGCHLD)); +#else + if (setintr) + (void) sighold(SIGINT); + (void) sigrelse(SIGCHLD); +#endif + draino(); + (void) endpwent(); + + /* + * If we have an active "onintr" then we search for the label. Note that if + * one does "onintr -" then we shan't be interruptible so we needn't worry + * about that here. + */ + if (gointr) { + search(T_GOTO, 0, gointr); + timflg = 0; + if (v = pargv) + pargv = 0, blkfree(v); + if (v = gargv) + gargv = 0, blkfree(v); + reset(); + } + else if (intty && wantnl) { + /* xprintf("\n"); *//* Some like this, others don't */ + (void) putraw('\r'); + (void) putraw('\n'); + } + stderror(ERR_SILENT); +} + +/* + * Process is the main driving routine for the shell. + * It runs all command processing, except for those within { ... } + * in expressions (which is run by a routine evalav in sh.exp.c which + * is a stripped down process), and `...` evaluation which is run + * also by a subset of this code in sh.glob.c in the routine backeval. + * + * The code here is a little strange because part of it is interruptible + * and hence freeing of structures appears to occur when none is necessary + * if this is ignored. + * + * Note that if catch is not set then we will unwind on any error. + * If an end-of-file occurs, we return. + */ +struct command *savet = NULL; +void +process(catch) + bool catch; +{ + extern char Expand; + jmp_buf osetexit; + /* PWP: This might get nuked my longjmp so don't make it a register var */ + struct command *t = savet; + + savet = NULL; + getexit(osetexit); + for (;;) { + + pendjob(); + paraml.next = paraml.prev = ¶ml; + paraml.word = STRNULL; + (void) setexit(); + justpr = enterhist; /* execute if not entering history */ + + /* + * Interruptible during interactive reads + */ + if (setintr) +#ifdef BSDSIGS + (void) sigsetmask(sigblock((sigmask_t) 0) & ~sigmask(SIGINT)); +#else + (void) sigrelse(SIGINT); +#endif + + + /* + * For the sake of reset() + */ + freelex(¶ml); + if (savet) + freesyn(savet), savet = NULL; + + if (haderr) { + if (!catch) { + /* unwind */ + doneinp = 0; + savet = t; + resexit(osetexit); + reset(); + } + haderr = 0; + /* + * Every error is eventually caught here or the shell dies. It is + * at this point that we clean up any left-over open files, by + * closing all but a fixed number of pre-defined files. Thus + * routines don't have to worry about leaving files open due to + * deeper errors... they will get closed here. + */ + closem(); + continue; + } + if (doneinp) { + doneinp = 0; + break; + } + if (chkstop) + chkstop--; + if (neednote) + pnote(); + if (intty && prompt && evalvec == 0) { + mailchk(); + /* + * Watch for logins/logouts. Next is scheduled commands stored + * previously using "sched." Then execute periodic commands. + * Following that, the prompt precmd is run. + */ + watch_login(); + sched_run(); + period_cmd(); + precmd(); + /* + * If we are at the end of the input buffer then we are going to + * read fresh stuff. Otherwise, we are rereading input and don't + * need or want to prompt. + */ + if (fseekp == feobp) + printprompt(0, NULL); + flush(); + setalarm(); + } + if (seterr) { + xfree((ptr_t) seterr); + seterr = NULL; + } + + /* + * Echo not only on VERBOSE, but also with history expansion. If there + * is a lexical error then we forego history echo. + */ + if (lex(¶ml) && !seterr && intty && !tellwhat && !Expand || + adrof(STRverbose)) { + haderr = 1; + prlex(¶ml); + haderr = 0; + } + (void) alarm(0); /* Autologout OFF */ + + /* + * The parser may lose space if interrupted. + */ + if (setintr) +#ifdef BSDSIGS + (void) sigblock(sigmask(SIGINT)); +#else + (void) sighold(SIGINT); +#endif + + /* + * Save input text on the history list if reading in old history, or it + * is from the terminal at the top level and not in a loop. + * + * PWP: entry of items in the history list while in a while loop is done + * elsewhere... + */ + if (enterhist || catch && intty && !whyles && !tellwhat) + savehist(¶ml); + + if (Expand && seterr) + Expand = 0; + + /* + * Print lexical error messages, except when sourcing history lists. + */ + if (!enterhist && seterr) + stderror(ERR_OLD); + + /* + * If had a history command :p modifier then this is as far as we + * should go + */ + if (justpr) + reset(); + + /* + * If had a tellwhat from twenex() then do + */ + if (tellwhat) { + tellmewhat(¶ml); + reset(); + } + + alias(¶ml); + +#ifdef BSDJOBS + /* + * If we are interactive, try to continue jobs that we have stopped + */ + if (prompt) + con_jobs(¶ml); +#endif /* BSDJOBS */ + + /* + * Check to see if the user typed "rm * .o" or something + */ + if (prompt) + rmstar(¶ml); + /* + * Parse the words of the input into a parse tree. + */ + savet = syntax(paraml.next, ¶ml, 0); + if (seterr) + stderror(ERR_OLD); + + /* + * Execute the parse tree From: Michael Schroeder + * was execute(t, tpgrp); + */ + execute(savet, (tpgrp > 0 ? tpgrp : -1), NULL, NULL); + + /* + * Made it! + */ + freelex(¶ml); + freesyn(savet), savet = NULL; +#ifdef SIG_WINDOW + if (catch && intty && !whyles && !tellwhat) + window_change(0); /* for window systems */ +#endif /* SIG_WINDOW */ + } + savet = t; + resexit(osetexit); +} + +void +dosource(t) + register Char **t; +{ + register Char *f; + bool hflg = 0; + Char buf[BUFSIZ]; + + t++; + if (*t && eq(*t, STRmh)) { + if (*++t == NOSTR) + stderror(ERR_NAME | ERR_HFLAG); + hflg++; + } + (void) Strcpy(buf, *t); + f = globone(buf, G_ERROR); + (void) strcpy((char *) buf, short2str(f)); + xfree((ptr_t) f); + if (!srcfile((char *) buf, 0, hflg) && !hflg) + stderror(ERR_SYSTEM, (char *) buf, strerror(errno)); +} + +/* + * Check for mail. + * If we are a login shell, then we don't want to tell + * about any mail file unless its been modified + * after the time we started. + * This prevents us from telling the user things he already + * knows, since the login program insists on saying + * "You have mail." + */ +static void +mailchk() +{ + register struct varent *v; + register Char **vp; + time_t t; + int intvl, cnt; + struct stat stb; + bool new; + + v = adrof(STRmail); + if (v == 0) + return; + (void) time(&t); + vp = v->vec; + cnt = blklen(vp); + intvl = (cnt && number(*vp)) ? (--cnt, getn(*vp++)) : MAILINTVL; + if (intvl < 1) + intvl = 1; + if (chktim + intvl > t) + return; + for (; *vp; vp++) { + if (stat(short2str(*vp), &stb) < 0) + continue; +#if defined(BSDTIMES) || defined(_SEQUENT_) + new = stb.st_mtime > time0.tv_sec; +#else + new = stb.st_mtime > time0; +#endif + if (stb.st_size == 0 || stb.st_atime > stb.st_mtime || + (stb.st_atime < chktim && stb.st_mtime < chktim) || + loginsh && !new) + continue; + if (cnt == 1) + xprintf("You have %smail.\n", new ? "new " : ""); + else + xprintf("%s in %s.\n", new ? "New mail" : "Mail", + short2str(*vp)); + } + chktim = t; +} + +/* + * Extract a home directory from the password file + * The argument points to a buffer where the name of the + * user whose home directory is sought is currently. + * We write the home directory of the user back there. + */ +int +gethdir(home) + Char *home; +{ + Char *h; + + /* + * Is it us? + */ + if (*home == '\0') { + if (h = value(STRhome)) { + (void) Strcpy(home, h); + return 0; + } + else + return 1; + } + + /* + * Look in the cache + */ + if ((h = gettilde(home)) == NULL) + return 1; + else { + (void) Strcpy(home, h); + return 0; + } +} + +/* + * Move the initial descriptors to their eventual + * resting places, closing all other units. + */ +void +initdesc() +{ + + didfds = 0; /* 0, 1, 2 aren't set up */ +#ifdef FIOCLEX + (void) ioctl(SHIN = dcopy(0, FSHIN), FIOCLEX, NULL); + (void) ioctl(SHOUT = dcopy(1, FSHOUT), FIOCLEX, NULL); + (void) ioctl(SHDIAG = dcopy(2, FSHDIAG), FIOCLEX, NULL); + (void) ioctl(OLDSTD = dcopy(SHIN, FOLDSTD), FIOCLEX, NULL); +#else + didcch = 0; /* Havent closed for child */ + SHIN = dcopy(0, FSHIN); + SHOUT = dcopy(1, FSHOUT); + isoutatty = isatty(SHOUT); + SHDIAG = dcopy(2, FSHDIAG); + isdiagatty = isatty(SHDIAG); + OLDSTD = dcopy(SHIN, FOLDSTD); +#endif + closem(); +} + + +void +#ifdef PROF +done(i) +#else +xexit(i) +#endif + int i; +{ +#ifdef TESLA + if (loginsh && do_logout) { + /* this is to send hangup signal to the develcon */ + /* we toggle DTR. clear dtr - sleep 1 - set dtr */ + /* ioctl will return ENOTTY for pty's but we ignore it */ + /* exitstat will run after disconnect */ + /* we sleep for 2 seconds to let things happen in */ + /* .logout and rechist() */ +#ifdef TIOCCDTR + (void) sleep(2); + (void) ioctl(FSHTTY, TIOCCDTR, NULL); + (void) sleep(1); + (void) ioctl(FSHTTY, TIOCSDTR, NULL); +#endif /* TIOCCDTR */ + } +#endif /* TESLA */ + + untty(); + _exit(i); +} + +static Char ** +d_path() +{ + char *ptr; + Char **blk, **blkp; + struct stat stb; + + blkp = blk = (Char **) xmalloc((size_t) sizeof(Char *) * 10); + +#ifndef DOTLAST + *blkp++ = Strsave(STRdot); +#endif + +#define DIRAPPEND(a) \ + if (stat(ptr = a, &stb) == 0 && S_ISDIR(stb.st_mode)) \ + *blkp++ = SAVE(ptr) + +#ifdef _PATH_LOCAL + DIRAPPEND(_PATH_LOCAL); +#endif + +#ifdef _PATH_USRUCB + DIRAPPEND(_PATH_USRUCB); +#endif + +#ifdef _PATH_USRBSD + DIRAPPEND(_PATH_USRBSD); +#endif + +#ifdef _PATH_BIN + DIRAPPEND(_PATH_BIN); +#endif + +#ifdef _PATH_USRBIN + DIRAPPEND(_PATH_USRBIN); +#endif + +#undef DIRAPPEND + +#ifdef DOTLAST + *blkp++ = Strsave(STRdot); +#endif + *blkp = NULL; + return (blk); +} diff --git a/bin/tcsh/sh.char.c b/bin/tcsh/sh.char.c new file mode 100644 index 0000000..595de4c --- /dev/null +++ b/bin/tcsh/sh.char.c @@ -0,0 +1,316 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/sh.char.c,v 3.0 1991/07/04 21:49:28 christos Exp $ */ +/* + * sh.char.c: Character classification tables + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#include "config.h" +#if !defined(lint) && !defined(pdp11) +static char *rcsid() + { return "$Id: sh.char.c,v 3.0 1991/07/04 21:49:28 christos Exp $"; } +#endif + +#include "sh.char.h" + +unsigned short _cmap[256] = { +/* nul soh stx etx */ + _CTR, _CTR, _CTR, _CTR, + +/* eot enq ack bel */ + _CTR, _CTR, _CTR, _CTR, + +/* bs ht nl vt */ + _CTR, _CTR|_SP|_META, _CTR|_NL|_META, _CTR, + +/* np cr so si */ + _CTR, _CTR, _CTR, _CTR, + +/* dle dc1 dc2 dc3 */ + _CTR, _CTR, _CTR, _CTR, + +/* dc4 nak syn etb */ + _CTR, _CTR, _CTR, _CTR, + +/* can em sub esc */ + _CTR, _CTR, _CTR, _CTR, + +/* fs gs rs us */ + _CTR, _CTR, _CTR, _CTR, + +/* sp ! " # */ + _SP|_META, 0, _Q, _META, + +/* $ % & ' */ + _DOL, 0, _META|_CMD, _Q, + +/* ( ) * + */ + _META|_CMD, _META, _GLOB, 0, + +/* , - . / */ + 0, 0, 0, 0, + +/* 0 1 2 3 */ + _DIG|_XD, _DIG|_XD, _DIG|_XD, _DIG|_XD, + +/* 4 5 6 7 */ + _DIG|_XD, _DIG|_XD, _DIG|_XD, _DIG|_XD, + +/* 8 9 : ; */ + _DIG|_XD, _DIG|_XD, 0, _META|_CMD, + +/* < = > ? */ + _META, 0, _META, _GLOB, + +/* @ A B C */ + 0, _LET|_UP|_XD, _LET|_UP|_XD, _LET|_UP|_XD, + +/* D E F G */ + _LET|_UP|_XD, _LET|_UP|_XD, _LET|_UP|_XD, _LET|_UP, + +/* H I J K */ + _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, + +/* L M N O */ + _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, + +/* P Q R S */ + _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, + +/* T U V W */ + _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, + +/* X Y Z [ */ + _LET|_UP, _LET|_UP, _LET|_UP, _GLOB, + +/* \ ] ^ _ */ + _ESC, 0, 0, 0, + +/* ` a b c */ + _Q1|_GLOB|_CMD|_META, _LET|_LOW|_XD, _LET|_LOW|_XD, _LET|_LOW|_XD, + +/* d e f g */ + _LET|_LOW|_XD, _LET|_LOW|_XD, _LET|_LOW|_XD, _LET|_LOW, + +/* h i j k */ + _LET|_LOW, _LET|_LOW, _LET|_LOW, _LET|_LOW, + +/* l m n o */ + _LET|_LOW, _LET|_LOW, _LET|_LOW, _LET|_LOW, + +/* p q r s */ + _LET|_LOW, _LET|_LOW, _LET|_LOW, _LET|_LOW, + +/* t u v w */ + _LET|_LOW, _LET|_LOW, _LET|_LOW, _LET|_LOW, + +/* x y z { */ + _LET|_LOW, _LET|_LOW, _LET|_LOW, _GLOB, + +/* | } ~ del */ + _META|_CMD, 0, 0, _CTR, + +#if defined(SHORT_STRINGS) && !defined(KANJI) +/****************************************************************/ +/* 128 - 255 The below is supposedly ISO 8859/1 */ +/****************************************************************/ +/* (undef) (undef) (undef) (undef) */ + _CTR, _CTR, _CTR, _CTR, + +/* (undef) (undef) (undef) (undef) */ + _CTR, _CTR, _CTR, _CTR, + +/* (undef) (undef) (undef) (undef) */ + _CTR, _CTR, _CTR, _CTR, + +/* (undef) (undef) (undef) (undef) */ + _CTR, _CTR, _CTR, _CTR, + +/* (undef) (undef) (undef) (undef) */ + _CTR, _CTR, _CTR, _CTR, + +/* (undef) (undef) (undef) (undef) */ + _CTR, _CTR, _CTR, _CTR, + +/* (undef) (undef) (undef) (undef) */ + _CTR, _CTR, _CTR, _CTR, + +/* (undef) (undef) (undef) (undef) */ + _CTR, _CTR, _CTR, _CTR, + +/* nobreakspace exclamdown cent sterling */ + _SP, 0, 0, 0, + +/* currency yen brokenbar section */ + 0, 0, 0, 0, + +/* diaeresis copyright ordfeminine guillemotleft */ + 0, 0, 0, 0, + +/* notsign hyphen registered macron */ + 0, 0, 0, 0, + +/* degree plusminus twosuperior threesuperior */ + 0, 0, 0, 0, + +/* acute mu paragraph periodcentered */ + 0, 0, 0, 0, + +/* cedilla onesuperior masculine guillemotright */ + 0, 0, 0, 0, + +/* onequarter onehalf threequarters questiondown */ + 0, 0, 0, 0, + +/* Agrave Aacute Acircumflex Atilde */ + _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, + +/* Adiaeresis Aring AE Ccedilla */ + _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, + +/* Egrave Eacute Ecircumflex Ediaeresis */ + _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, + +/* Igrave Iacute Icircumflex Idiaeresis */ + _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, + +/* ETH Ntilde Ograve Oacute */ + _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, + +/* Ocircumflex Otilde Odiaeresis multiply */ + _LET|_UP, _LET|_UP, _LET|_UP, 0, + +/* Ooblique Ugrave Uacute Ucircumflex */ + _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP, + +/* Udiaeresis Yacute THORN ssharp */ + _LET|_UP, _LET|_UP, _LET|_UP, _LET|_LOW, + +/* agrave aacute acircumflex atilde */ + _LET|_LOW, _LET|_LOW, _LET|_LOW, _LET|_LOW, + +/* adiaeresis aring ae ccedilla */ + _LET|_LOW, _LET|_LOW, _LET|_LOW, _LET|_LOW, + +/* egrave eacute ecircumflex ediaeresis */ + _LET|_LOW, _LET|_LOW, _LET|_LOW, _LET|_LOW, + +/* igrave iacute icircumflex idiaeresis */ + _LET|_LOW, _LET|_LOW, _LET|_LOW, _LET|_LOW, + +/* eth ntilde ograve oacute */ + _LET|_LOW, _LET|_LOW, _LET|_LOW, _LET|_LOW, + +/* ocircumflex otilde odiaeresis division */ + _LET|_LOW, _LET|_LOW, _LET|_LOW, 0, + +/* oslash ugrave uacute ucircumflex */ + _LET|_LOW, _LET|_LOW, _LET|_LOW, _LET|_LOW, + +/* udiaeresis yacute thorn ydiaeresis */ + _LET|_LOW, _LET|_LOW, _LET|_LOW, _LET|_LOW, +#endif /* SHORT_STRINGS && !KANJI */ +}; + +#ifndef NLS +/* _cmap_lower, _cmap_upper for ISO 8859/1 */ + +unsigned char _cmap_lower[256] = { + 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, 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, 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, + 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, + 0340, 0341, 0342, 0343, 0344, 0345, 0346, 0347, + 0350, 0351, 0352, 0353, 0354, 0355, 0356, 0357, + 0360, 0361, 0362, 0363, 0364, 0365, 0366, 0327, + 0370, 0371, 0372, 0373, 0374, 0375, 0376, 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, +}; + +unsigned char _cmap_upper[256] = { + 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, 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, + 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, + 0300, 0301, 0302, 0303, 0304, 0305, 0306, 0307, + 0310, 0311, 0312, 0313, 0314, 0315, 0316, 0317, + 0320, 0321, 0322, 0323, 0324, 0325, 0326, 0367, + 0330, 0331, 0332, 0333, 0334, 0335, 0336, 0377, +}; +#endif /* NLS */ diff --git a/bin/tcsh/sh.char.h b/bin/tcsh/sh.char.h new file mode 100644 index 0000000..119c5f4 --- /dev/null +++ b/bin/tcsh/sh.char.h @@ -0,0 +1,102 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/sh.char.h,v 3.0 1991/07/04 21:49:28 christos Exp $ */ +/* + * sh.char.h: Table for spotting special characters quickly + * Makes for very obscure but efficient coding. + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#ifndef _h_sh_char +#define _h_sh_char +#include + +extern unsigned short _cmap[]; + +#ifndef NLS +extern unsigned char _cmap_lower[], _cmap_upper[]; + +#endif + +#define _Q 0x0001 /* '" */ +#define _Q1 0x0002 /* ` */ +#define _SP 0x0004 /* space and tab */ +#define _NL 0x0008 /* \n */ +#define _META 0x0010 /* lex meta characters, sp #'`";&<>()|\t\n */ +#define _GLOB 0x0020 /* glob characters, *?{[` */ +#define _ESC 0x0040 /* \ */ +#define _DOL 0x0080 /* $ */ +#define _DIG 0x0100 /* 0-9 */ +#define _LET 0x0200 /* a-z, A-Z, _ */ +#define _UP 0x0400 /* A-Z */ +#define _LOW 0x0800 /* a-z */ +#define _XD 0x1000 /* 0-9, a-f, A-F */ +#define _CMD 0x2000 /* lex end of command chars, ;&(|` */ +#define _CTR 0x4000 /* control */ + +#define cmap(c, bits) \ + (((c) & QUOTE) ? 0 : (_cmap[(unsigned char)(c)] & (bits))) + +#define isglob(c) cmap(c, _GLOB) +#define isspc(c) cmap(c, _SP) +#define ismeta(c) cmap(c, _META) +#define iscmdmeta(c) cmap(c, _CMD) +#define letter(c) (((c) & QUOTE) ? 0 : \ + (isalpha((unsigned char) (c)) || (c) == '_')) +#define alnum(c) (((c) & QUOTE) ? 0 : \ + (isalnum((unsigned char) (c)) || (c) == '_')) +#ifdef NLS +# define Isspace(c) (((c) & QUOTE) ? 0 : isspace((unsigned char) (c))) +# define Isdigit(c) (((c) & QUOTE) ? 0 : isdigit((unsigned char) (c))) +# define Isalpha(c) (((c) & QUOTE) ? 0 : isalpha((unsigned char) (c))) +# define Islower(c) (((c) & QUOTE) ? 0 : islower((unsigned char) (c))) +# define Isupper(c) (((c) & QUOTE) ? 0 : isupper((unsigned char) (c))) +# define Tolower(c) (((c) & QUOTE) ? 0 : tolower((unsigned char) (c))) +# define Toupper(c) (((c) & QUOTE) ? 0 : toupper((unsigned char) (c))) +# define Isxdigit(c) (((c) & QUOTE) ? 0 : isxdigit((unsigned char) (c))) +# define Isalnum(c) (((c) & QUOTE) ? 0 : isalnum((unsigned char) (c))) +# define Iscntrl(c) (((c) & QUOTE) ? 0 : iscntrl((unsigned char) (c))) +# define Isprint(c) (((c) & QUOTE) ? 0 : isprint((unsigned char) (c))) +#else +# define Isspace(c) cmap(c, _SP|_NL) +# define Isdigit(c) cmap(c, _DIG) +# define Isalpha(c) (cmap(c,_LET) && !(((c) & META) && AsciiOnly)) +# define Islower(c) (cmap(c,_LOW) && !(((c) & META) && AsciiOnly)) +# define Isupper(c) (cmap(c, _UP) && !(((c) & META) && AsciiOnly)) +# define Tolower(c) (_cmap_lower[(unsigned char)(c)]) +# define Toupper(c) (_cmap_upper[(unsigned char)(c)]) +# define Isxdigit(c) cmap(c, _XD) +# define Isalnum(c) (cmap(c, _DIG|_LET) && !(((c) & META) && AsciiOnly)) +# define Iscntrl(c) (cmap(c,_CTR) && !(((c) & META) && AsciiOnly)) +# define Isprint(c) (!cmap(c,_CTR) && !(((c) & META) && AsciiOnly)) +#endif + +#endif /* _h_sh_char */ diff --git a/bin/tcsh/sh.decls.h b/bin/tcsh/sh.decls.h new file mode 100644 index 0000000..82cf50f --- /dev/null +++ b/bin/tcsh/sh.decls.h @@ -0,0 +1,361 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/sh.decls.h,v 3.0 1991/07/04 23:34:26 christos Exp $ */ +/* + * sh.decls External declarations from sh*.c + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#ifndef _h_sh_decls +#define _h_sh_decls + +/* + * sh.c + */ +extern int gethdir __P((Char *)); +extern void dosource __P((Char **)); +extern void exitstat __P((void)); +extern void goodbye __P((void)); +extern void importpath __P((Char *)); +extern void initdesc __P((void)); +extern sigret_t pintr __P((int)); +extern void pintr1 __P((bool)); +extern void process __P((bool)); +extern void rechist __P((void)); +extern void untty __P((void)); +#ifdef PROF +extern void done __P((int)); +#else +extern void xexit __P((int)); +#endif + +/* + * sh.dir.c + */ +extern void dinit __P((Char *)); +extern void dodirs __P((Char **)); +extern Char *dcanon __P((Char *, Char *)); +extern void dtildepr __P((Char *, Char *)); +extern void dtilde __P((void)); +extern void dochngd __P((Char **)); +extern Char *dnormalize __P((Char *)); +extern void dopushd __P((Char **)); +extern void dopopd __P((Char **)); +extern void dfree __P((struct directory *)); +extern int getstakd __P((Char *, int)); +extern void dextract __P((struct directory *)); +#ifdef CSHDIRS +extern void recdirs __P((void)); +#endif + +/* + * sh.dol.c + */ +extern void Dfix __P((struct command *)); +extern Char *Dfix1 __P((Char *)); +extern void heredoc __P((Char *)); + +/* + * sh.err.c + */ +extern void seterror __P((int, ...)); +extern void stderror __P((int, ...)); + +/* + * sh.exec.c + */ +extern void doexec __P((struct command *)); +extern void dohash __P((void)); +extern void dounhash __P((void)); +extern void execash __P((char **, struct command *)); +#ifdef VFORK +extern void hashstat __P((void)); +#endif +extern void xechoit __P((Char **)); +extern int iscommand __P((Char *)); +extern int executable __P((Char *, Char *, bool)); +extern void tellmewhat __P((struct wordent *)); + +/* + * sh.exp.c + */ +extern int exp __P((Char ***)); +extern int exp0 __P((Char ***, bool)); + +/* + * sh.file.c + */ +#ifdef FILEC +extern int tenex __P((Char *, int)); +#endif + +/* + * sh.func.c + */ +extern void Setenv __P((Char *, Char *)); +extern void doalias __P((Char **)); +extern void dobreak __P((void)); +extern void docontin __P((void)); +extern void doecho __P((Char **)); +extern void doelse __P((void)); +extern void doend __P((void)); +extern void doeval __P((Char **)); +extern void doexit __P((Char **)); +extern void doforeach __P((Char **)); +extern void doglob __P((Char **)); +extern void dogoto __P((Char **)); +extern void doif __P((Char **, struct command *)); +extern void dolimit __P((Char **)); +extern void dologin __P((Char **)); +extern void dologout __P((void)); +#ifdef NEWGRP +extern void donewgrp __P((Char **)); +#endif +extern void donohup __P((void)); +extern void doonintr __P((Char **)); +extern void dorepeat __P((Char **, struct command *)); +extern void dosetenv __P((Char **)); +extern void dosuspend __P((void)); +extern void doswbrk __P((void)); +extern void doswitch __P((Char **)); +extern void doumask __P((Char **)); +extern void dounlimit __P((Char **)); +extern void dounsetenv __P((Char **)); +extern void dowhile __P((Char **)); +extern void dozip __P((void)); +extern void func __P((struct command *, + struct biltins *)); +extern struct biltins *isbfunc __P((struct command *)); +extern void prvars __P((void)); +extern void search __P((int, int, Char *)); +extern int srchx __P((Char *)); +extern void unalias __P((Char **)); +extern void wfree __P((void)); + +/* + * sh.glob.c + */ +extern Char **dobackp __P((Char *, bool)); +extern void Gcat __P((Char *, Char *)); +extern Char *globone __P((Char *, int)); +extern int Gmatch __P((Char *, Char *)); +extern void ginit __P((void)); +extern Char **globall __P((Char **)); +extern void rscan __P((Char **, void (*)())); +extern void tglob __P((Char **)); +extern void trim __P((Char **)); +#ifdef FILEC +extern int sortscmp __P((Char **, Char **)); +#endif + +/* + * sh.hist.c + */ +extern void dohist __P((Char **)); +extern struct Hist *enthist __P((int, struct wordent *, bool)); +extern void savehist __P((struct wordent *)); + + +/* + * sh.lex.c + */ +extern void addla __P((Char *)); +extern void bseek __P((off_t)); +#ifndef btell +extern off_t btell __P((void)); +#endif +extern void btoeof __P((void)); +extern void copylex __P((struct wordent *, + struct wordent *)); +extern Char *domod __P((Char *, int)); +extern void freelex __P((struct wordent *)); +extern int lex __P((struct wordent *)); +extern void prlex __P((struct wordent *)); +extern int readc __P((bool)); +extern void settell __P((void)); +extern void unreadc __P((int)); + + +/* + * sh.misc.c + */ +extern int any __P((char *, int)); +extern Char **blkcat __P((Char **, Char **)); +extern Char **blkcpy __P((Char **, Char **)); +extern Char **blkend __P((Char **)); +extern void blkfree __P((Char **)); +extern int blklen __P((Char **)); +extern void blkpr __P((Char **)); +extern Char **blkspl __P((Char **, Char **)); +#ifndef copy +extern void copy __P((char *, char *, int)); +#endif +extern void closem __P((void)); +#ifndef FIOCLEX +extern void closech __P((void)); +#endif +extern Char **copyblk __P((Char **)); +extern int dcopy __P((int, int)); +extern int dmove __P((int, int)); +extern void donefds __P((void)); +extern Char lastchr __P((Char *)); +extern void lshift __P((Char **, int)); +extern int number __P((Char *)); +extern int prefix __P((Char *, Char *)); +extern Char **saveblk __P((Char **)); +extern void setzero __P((char *, int)); +extern Char *strip __P((Char *)); +extern char *strsave __P((char *)); +extern char *strspl __P((char *, char *)); +#ifndef POSIX +extern char *strstr __P((const char *, const char *)); +#endif +extern void udvar __P((Char *)); +#ifndef SHORT_STRINGS +extern char *strend __P((char *)); +#endif + +/* + * sh.parse.c + */ +extern void alias __P((struct wordent *)); +extern void freesyn __P((struct command *)); +extern struct command *syntax __P((struct wordent *, + struct wordent *, int)); + +/* + * sh.print.c + */ +extern void draino __P((void)); +extern void flush __P((void)); +#ifdef BSDTIMES +extern void pcsecs __P((long)); +#else /* !BSDTIMES */ +# ifdef POSIX +extern void pcsecs __P((clock_t)); +# else /* !POSIX */ +extern void pcsecs __P((time_t)); +# endif /* !POSIX */ +#endif /* BSDTIMES */ +#ifdef RLIMIT_CPU +extern void psecs __P((long)); +#endif /* RLIMIT_CPU */ +extern int putpure __P((int)); +extern int putraw __P((int)); +extern void xputchar __P((int)); + + +/* + * sh.proc.c + */ +extern void dobg __P((Char **)); +extern void dobg1 __P((Char **)); +extern void dofg __P((Char **)); +extern void dofg1 __P((Char **)); +extern void dojobs __P((Char **)); +extern void dokill __P((Char **)); +extern void donotify __P((Char **)); +extern void dostop __P((Char **)); +extern void dowait __P((void)); +extern void palloc __P((int, struct command *)); +extern void panystop __P((bool)); +extern sigret_t pchild __P((int)); +extern void pendjob __P((void)); +extern struct process *pfind __P((Char *)); +extern int pfork __P((struct command *, int)); +extern void pgetty __P((int, int)); +extern void pjwait __P((struct process *)); +extern void pnote __P((void)); +extern void prestjob __P((void)); +extern void psavejob __P((void)); +extern void pstart __P((struct process *, int)); +extern void pwait __P((void)); + +/* + * sh.sem.c + */ +extern void execute __P((struct command *, int, int *, + int *)); +extern void mypipe __P((int *)); + +/* + * sh.set.c + */ +extern struct varent *adrof1 __P((Char *, struct varent *)); +extern void doset __P((Char **)); +extern void dolet __P((Char **)); +extern Char *putn __P((int)); +extern int getn __P((Char *)); +extern Char *value1 __P((Char *, struct varent *)); +extern void set __P((Char *, Char *)); +extern void set1 __P((Char *, Char **, struct varent *)); +extern void setq __P((Char *, Char **, struct varent *)); +extern void unset __P((Char *[])); +extern void unset1 __P((Char *[], struct varent *)); +extern void unsetv __P((Char *)); +extern void setNS __P((Char *)); +extern void shift __P((Char **)); +extern void plist __P((struct varent *)); + +/* + * sh.time.c + */ +extern void donice __P((Char **)); +extern void dotime __P((void)); +#ifdef BSDTIMES +extern void prusage __P((struct rusage *, struct rusage *, + tmval_t *, tmval_t *)); +#else /* BSDTIMES */ +# ifdef _SEQUENT_ +extern void prusage __P((struct pro_stats *, + struct pro_stats *, + tmval_t *, tmval_t *)); +# else /* !_SEQUENT_ */ +# ifdef POSIX +extern void prusage __P((struct tms *, struct tms *, + clock_t, clock_t)); +# else /* !POSIX */ +extern void prusage __P((struct tms *, struct tms *, + time_t, time_t)); +# endif /* !POSIX */ +# endif /* !_SEQUENT_ */ +#endif /* BSDTIMES */ +extern void settimes __P((void)); +#if defined(BSDTIMES) || defined(_SEQUENT_) +extern void ruadd __P((struct rusage *, struct rusage *)); +extern void tvadd __P((struct timeval *, + struct timeval *)); +extern void tvsub __P((struct timeval *, + struct timeval *, + struct timeval *)); +#endif /* BSDTIMES || _SEQUENT_ */ + +#endif /* _h_sh_decls */ diff --git a/bin/tcsh/sh.dir.c b/bin/tcsh/sh.dir.c new file mode 100644 index 0000000..2534434 --- /dev/null +++ b/bin/tcsh/sh.dir.c @@ -0,0 +1,1126 @@ +/* + * sh.dir.c: Directory manipulation functions + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#include "config.h" +#if !defined(lint) && !defined(pdp11) +static char *rcsid() + { return "$Id: sh.dir.c,v 3.0.1 1996/04/04 21:49:28 sms Exp $"; } +#endif + + +#include "sh.h" +/* + * C Shell - directory management + */ + +static struct directory *dfind __P((Char *)); +static Char *dfollow __P((Char *)); +static void printdirs __P((void)); +static Char *dgoto __P((Char *)); +static void dnewcwd __P((struct directory *)); +static void dset __P((Char *)); + +struct directory dhead; /* "head" of loop */ +int printd; /* force name to be printed */ + +#ifdef CSHDIRS +int bequiet = 0; /* do not print dir stack -strike */ + +#endif +static int dirflag = 0; + +/* + * dinit - initialize current working directory + */ +void +dinit(hp) + Char *hp; +{ + register char *tcp; + register Char *cp; + register struct directory *dp; + char path[MAXPATHLEN]; + static char *emsg = "tcsh: Trying to start from \"%s\"\n"; + + /* Don't believe the login shell home, because it may be a symlink */ + tcp = getwd(path); /* see ngetwd.c for System V version */ + if (tcp == NULL || *tcp == '\0') { + (void) xprintf("tcsh: %s\n", path); + if (hp && *hp) { + tcp = short2str(hp); + (void) xprintf(emsg, tcp); + if (chdir(tcp) == -1) + cp = NULL; + else + cp = hp; + } + else + cp = NULL; + if (cp == NULL) { + (void) xprintf(emsg, "/"); + if (chdir("/") == -1) + /* I am not even try to print an error message! */ + xexit(1); + cp = SAVE("/"); + } + } + else { +#ifdef S_IFLNK + struct stat swd, shp; + + /* + * See if $HOME is the working directory we got and use that + */ + if (hp && *hp && + stat(tcp, &swd) != -1 && stat(short2str(hp), &shp) != -1 && + swd.st_dev == shp.st_dev && swd.st_ino == shp.st_ino) + cp = hp; + else { + char *cwd; + + /* + * use PWD if we have it (for subshells) + */ + if (cwd = getenv("PWD")) { + if (stat(cwd, &shp) != -1 && swd.st_dev == shp.st_dev && + swd.st_ino == shp.st_ino) + tcp = cwd; + } + cp = dcanon(str2short(tcp), STRNULL); + } +#else /* S_IFLNK */ + cp = dcanon(str2short(tcp), STRNULL); +#endif /* S_IFLNK */ + } + + dp = (struct directory *) xcalloc(sizeof(struct directory), 1); + dp->di_name = Strsave(cp); + dp->di_count = 0; + dhead.di_next = dhead.di_prev = dp; + dp->di_next = dp->di_prev = &dhead; + printd = 0; + dnewcwd(dp); +} + +static void +dset(dp) +Char *dp; +{ + /* + * Don't call set() directly cause if the directory contains ` or + * other junk characters glob will fail. + */ + register Char **vec = (Char **) xmalloc((size_t) (2 * sizeof(Char **))); + + vec[0] = Strsave(dp); + vec[1] = 0; + setq(STRcwd, vec, &shvhed); + Setenv(STRPWD, dp); +} + +#define DIR_LONG 1 +#define DIR_VERT 2 +#define DIR_LINE 4 + +static void +skipargs(v, str) + Char ***v; + char *str; +{ + register Char **n = *v, *s; + + dirflag = 0; + for (n++; *n != NOSTR && (*n)[0] == '-'; n++) + for (s = &((*n)[1]); *s; s++) + switch (*s) { + case 'l': + dirflag |= DIR_LONG; + break; + case 'v': + dirflag |= DIR_VERT; + break; + case 'n': + dirflag |= DIR_LINE; + break; + default: + stderror(ERR_DIRUS, short2str(**v), str); + break; + } + *v = n; +} + +/* + * dodirs - list all directories in directory loop + */ +void +dodirs(v) + Char **v; +{ + skipargs(&v, ""); + + if (*v != NOSTR) + stderror(ERR_DIRUS, "dirs", ""); + printdirs(); +} + +static void +printdirs() +{ + register struct directory *dp; + Char *s, *hp = value(STRhome); + int idx, len, cur; + extern int T_Cols; + + if (*hp == '\0') + hp = NOSTR; + dp = dcwd; + idx = 0; + cur = 0; + do { + if (dp == &dhead) + continue; + if (dirflag & DIR_VERT) { + xprintf("%d\t", idx++); + cur = 0; + } + if (!(dirflag & DIR_LONG) && hp != NOSTR && !eq(hp, STRslash) && + prefix(hp, dp->di_name)) + len = Strlen(s = (dp->di_name + Strlen(hp))) + 2; + else + len = Strlen(s = dp->di_name) + 1; + + cur += len; + if ((dirflag & DIR_LINE) && cur >= T_Cols - 1 && len < T_Cols) { + xprintf("\n"); + cur = len; + } + xprintf(s != dp->di_name ? "~%s%c" : "%s%c", + short2str(s), (dirflag & DIR_VERT) ? '\n' : ' '); + } while ((dp = dp->di_prev) != dcwd); + if (!(dirflag & DIR_VERT)) + xprintf("\n"); +} + +void +dtildepr(home, dir) + register Char *home, *dir; +{ + + if (!eq(home, STRslash) && prefix(home, dir)) + xprintf("~%s", short2str(dir + Strlen(home))); + else + xprintf("%s", short2str(dir)); +} + +void +dtilde() +{ + register struct directory *d = dcwd; + + do { + if (d == &dhead) + continue; + d->di_name = dcanon(d->di_name, STRNULL); + } while ((d = d->di_prev) != dcwd); + + dset(dcwd->di_name); +} + + +/* dnormalize(): + * If the name starts with . or .. then we might need to normalize + * it depending on the symbolic link flags + */ +Char * +dnormalize(cp) + register Char *cp; +{ + +#define UC (unsigned char) +#define ISDOT(c) (UC(c)[0] == '.' && ((UC(c)[1] == '\0') || (UC(c)[1] == '/'))) +#define ISDOTDOT(c) (UC(c)[0] == '.' && ISDOT(&((c)[1]))) + + if ((unsigned char) cp[0] == '/') + return (Strsave(cp)); + +#ifdef S_IFLNK + if (adrof(STRig__symlinks)) { + int dotdot = 0; + register Char *dp, *cwd; +#ifdef apollo + bool slashslash; +#endif + + cwd = (Char *) xmalloc((size_t) ((Strlen(dcwd->di_name) + 3) * + sizeof(Char))); + (void) Strcpy(cwd, dcwd->di_name); +#ifdef apollo + slashslash = cwd[0] == '/' && cwd[1] == '/'; +#endif + + /* + * Ignore . and count ..'s + */ + while (*cp) { + if (ISDOT(cp)) { + if (*++cp) + cp++; + } + else if (ISDOTDOT(cp)) { + dotdot++; + cp += 2; + if (*cp) + cp++; + } + else + break; + } + while (dotdot > 0) + if ((dp = Strrchr(cwd, '/'))) { +#ifdef apollo + if (dp == &cwd[1]) + slashslash = 1; +#endif + *dp = '\0'; + dotdot--; + } + else + break; + + if (*cp) { + if (((unsigned char) cwd[(dotdot = Strlen(cwd)) - 1]) != '/') + cwd[dotdot++] = '/'; + cwd[dotdot] = '\0'; + dp = Strspl(cwd, cp); + xfree((ptr_t) cwd); + return dp; + } + else { + if (!*cwd) { + cwd[0] = '/'; +#ifdef apollo + cwd[1] = '/'; + cwd[2] = '\0'; +#else + cwd[1] = '\0'; +#endif + } +#ifdef apollo + else if (slashslash && cwd[1] == '\0') { + cwd[1] = '/'; + cwd[2] = '\0'; + } +#endif + return cwd; + } + } +#endif + return Strsave(cp); +} + +/* + * dochngd - implement chdir command. + */ +void +dochngd(v) + Char **v; +{ + register Char *cp; + register struct directory *dp; + + skipargs(&v, " []"); + printd = 0; + if (*v == NOSTR) { + if ((cp = value(STRhome)) == NOSTR || *cp == 0) + stderror(ERR_NAME | ERR_NOHOMEDIR); + if (chdir(short2str(cp)) < 0) + stderror(ERR_NAME | ERR_CANTCHANGE); + cp = Strsave(cp); + } + else if (v[1] != NOSTR) { + stderror(ERR_NAME | ERR_TOOMANY); + /* NOTREACHED */ + return; + } + else if ((dp = dfind(*v)) != 0) { + char *tmp; + + printd = 1; + if (chdir(tmp = short2str(dp->di_name)) < 0) + stderror(ERR_SYSTEM, tmp, strerror(errno)); + dcwd->di_prev->di_next = dcwd->di_next; + dcwd->di_next->di_prev = dcwd->di_prev; + dfree(dcwd); + dnewcwd(dp); + return; + } + else + cp = dfollow(*v); + dp = (struct directory *) xcalloc(sizeof(struct directory), 1); + dp->di_name = cp; + dp->di_count = 0; + dp->di_next = dcwd->di_next; + dp->di_prev = dcwd->di_prev; + dp->di_prev->di_next = dp; + dp->di_next->di_prev = dp; + dfree(dcwd); + dnewcwd(dp); +} + +static Char * +dgoto(cp) + Char *cp; +{ + Char *dp; + + if (*cp != '/') { + register Char *p, *q; + int cwdlen; + + for (p = dcwd->di_name; *p++;); + if ((cwdlen = p - dcwd->di_name - 1) == 1) /* root */ + cwdlen = 0; + for (p = cp; *p++;); + dp = (Char *) xmalloc((size_t)((cwdlen + (p - cp) + 1) * sizeof(Char))); + for (p = dp, q = dcwd->di_name; *p++ = *q++;); + if (cwdlen) + p[-1] = '/'; + else + p--; /* don't add a / after root */ + for (q = cp; *p++ = *q++;); + xfree((ptr_t) cp); + cp = dp; + dp += cwdlen; + } + else + dp = cp; + + cp = dcanon(cp, dp); + return cp; +} + +/* + * dfollow - change to arg directory; fall back on cdpath if not valid + */ +static Char * +dfollow(cp) + register Char *cp; +{ + register Char *dp; + struct varent *c; + char ebuf[MAXPATHLEN]; + int serrno; + + cp = globone(cp, G_ERROR); +#ifdef apollo + if (Strchr(cp, '`')) { + char *dptr, *ptr; + if (chdir(dptr = short2str(cp)) < 0) + stderror(ERR_SYSTEM, dptr, strerror(errno)); + else if ((ptr = getwd(ebuf)) && *ptr != '\0') { + xfree((ptr_t) cp); + cp = Strsave(str2short(ptr)); + return dgoto(cp); + } + else + stderror(ERR_SYSTEM, dptr, ebuf); + } +#endif + + /* + * if we are ignoring symlinks, try to fix relatives now. + */ + dp = dnormalize(cp); + if (chdir(short2str(dp)) >= 0) { + xfree((ptr_t) cp); + return dgoto(dp); + } + else { + xfree((ptr_t) dp); + if (chdir(short2str(cp)) >= 0) + return dgoto(cp); + serrno = errno; + } + + if (cp[0] != '/' && !prefix(STRdt_l, cp) && !prefix(STRdotdotsl, cp) + && (c = adrof(STRcdpath))) { + Char **cdp; + register Char *p; + Char buf[MAXPATHLEN]; + + for (cdp = c->vec; *cdp; cdp++) { + for (dp = buf, p = *cdp; *dp++ = *p++;); + dp[-1] = '/'; + for (p = cp; *dp++ = *p++;); + if (chdir(short2str(buf)) >= 0) { + printd = 1; + xfree((ptr_t) cp); + cp = Strsave(buf); + return dgoto(cp); + } + } + } + dp = value(cp); + if ((dp[0] == '/' || dp[0] == '.') && chdir(short2str(dp)) >= 0) { + xfree((ptr_t) cp); + cp = Strsave(dp); + printd = 1; + return dgoto(cp); + } + (void) strcpy(ebuf, short2str(cp)); + xfree((ptr_t) cp); +#ifdef CSHDIRS + /* + * on login source of ~/.cshdirs, errors are eaten. the dir stack is all + * directories we could get to. + */ + if (!bequiet) + stderror(ERR_SYSTEM, ebuf, strerror(serrno)); + else + return (NOSTR); +#else + stderror(ERR_SYSTEM, ebuf, strerror(serrno)); +#endif + /* NOTREACHED */ + return (NOSTR); +} + + +/* + * dopushd - push new directory onto directory stack. + * with no arguments exchange top and second. + * with numeric argument (+n) bring it to top. + */ +void +dopushd(v) + Char **v; +{ + register struct directory *dp; + register Char *cp; + + skipargs(&v, " [|+]"); + printd = 1; + if (*v == NOSTR) { + if (adrof(STRputohome)) { + if ((cp = value(STRhome)) == NOSTR || *cp == 0) + stderror(ERR_NAME | ERR_NOHOMEDIR); + if (chdir(short2str(cp)) < 0) + stderror(ERR_NAME | ERR_CANTCHANGE); + cp = Strsave(cp); /* hmmm... PWP */ + cp = dfollow(cp); + dp = (struct directory *) xcalloc(sizeof(struct directory), 1); + dp->di_name = cp; + dp->di_count = 0; + dp->di_prev = dcwd; + dp->di_next = dcwd->di_next; + dcwd->di_next = dp; + dp->di_next->di_prev = dp; + } + else { + char *tmp; + + if ((dp = dcwd->di_prev) == &dhead) + dp = dhead.di_prev; + if (dp == dcwd) + stderror(ERR_NAME | ERR_NODIR); + if (chdir(tmp = short2str(dp->di_name)) < 0) + stderror(ERR_SYSTEM, tmp, strerror(errno)); + dp->di_prev->di_next = dp->di_next; + dp->di_next->di_prev = dp->di_prev; + dp->di_next = dcwd->di_next; + dp->di_prev = dcwd; + dcwd->di_next->di_prev = dp; + dcwd->di_next = dp; + } + } + else if (v[1] != NOSTR) { + stderror(ERR_NAME | ERR_TOOMANY); + /* NOTREACHED */ + return; + } + else if (dp = dfind(*v)) { + char *tmp; + + if (chdir(tmp = short2str(dp->di_name)) < 0) + stderror(ERR_SYSTEM, tmp, strerror(errno)); + /* + * kfk - 10 Feb 1984 - added new "extraction style" pushd +n + */ + if (adrof(STRdextract)) + dextract(dp); + } + else { + register Char *ccp; + + ccp = dfollow(*v); + dp = (struct directory *) xcalloc(sizeof(struct directory), 1); + dp->di_name = ccp; + dp->di_count = 0; + dp->di_prev = dcwd; + dp->di_next = dcwd->di_next; + dcwd->di_next = dp; + dp->di_next->di_prev = dp; + } + dnewcwd(dp); +} + +/* + * dfind - find a directory if specified by numeric (+n) argument + */ +static struct directory * +dfind(cp) + register Char *cp; +{ + register struct directory *dp; + register int i; + register Char *ep; + + if (*cp++ != '+') + return (0); + for (ep = cp; Isdigit(*ep); ep++) + continue; + if (*ep) + return (0); + i = getn(cp); + if (i <= 0) + return (0); + for (dp = dcwd; i != 0; i--) { + if ((dp = dp->di_prev) == &dhead) + dp = dp->di_prev; + if (dp == dcwd) + stderror(ERR_NAME | ERR_DEEP); + } + return (dp); +} + +/* + * dopopd - pop a directory out of the directory stack + * with a numeric argument just discard it. + */ +void +dopopd(v) + Char **v; +{ + register struct directory *dp, *p = NULL; + + skipargs(&v, " [+]"); + printd = 1; + if (*v == NOSTR) + dp = dcwd; + else if (v[1] != NOSTR) { + stderror(ERR_NAME | ERR_TOOMANY); + /* NOTREACHED */ + return; + } + else if ((dp = dfind(*v)) == 0) + stderror(ERR_NAME | ERR_BADDIR); + if (dp->di_prev == &dhead && dp->di_next == &dhead) + stderror(ERR_NAME | ERR_EMPTY); + if (dp == dcwd) { + char *tmp; + + if ((p = dp->di_prev) == &dhead) + p = dhead.di_prev; + if (chdir(tmp = short2str(p->di_name)) < 0) + stderror(ERR_SYSTEM, tmp, strerror(errno)); + } + dp->di_prev->di_next = dp->di_next; + dp->di_next->di_prev = dp->di_prev; + if (dp == dcwd) + dnewcwd(p); + else { + printdirs(); + } + dfree(dp); +} + +/* + * dfree - free the directory (or keep it if it still has ref count) + */ +void +dfree(dp) + register struct directory *dp; +{ + + if (dp->di_count != 0) { + dp->di_next = dp->di_prev = 0; + } + else { + xfree((char *) dp->di_name); + xfree((ptr_t) dp); + } +} + +/* + * dcanon - canonicalize the pathname, removing excess ./ and ../ etc. + * we are of course assuming that the file system is standardly + * constructed (always have ..'s, directories have links) + */ +Char * +dcanon(cp, p) + register Char *cp, *p; +{ + register Char *sp; + register Char *p1, *p2; /* general purpose */ + bool slash; +#ifdef apollo + bool slashslash; +#endif + +#ifdef S_IFLNK /* if we have symlinks */ + Char link[MAXPATHLEN]; + char tlink[MAXPATHLEN]; + int cc; + Char *newcp; +#endif /* S_IFLNK */ + + /* + * christos: if the path given does not start with a slash prepend cwd. If + * cwd does not start with a slash or the result would be too long abort(). + */ + if (*cp != '/') { + Char tmpdir[MAXPATHLEN]; + + p1 = value(STRcwd); + if (p1 == NULL || *p1 != '/') + abort(); + if (Strlen(p1) + Strlen(cp) + 1 >= MAXPATHLEN) + abort(); + (void) Strcpy(tmpdir, p1); + (void) Strcat(tmpdir, STRslash); + (void) Strcat(tmpdir, cp); + xfree((ptr_t) cp); + cp = p = Strsave(tmpdir); + } + +#ifdef COMMENT + if (*cp != '/') + abort(); +#endif + +#ifdef apollo + slashslash = (cp[0] == '/' && cp[1] == '/'); +#endif + + while (*p) { /* for each component */ + sp = p; /* save slash address */ + while (*++p == '/') /* flush extra slashes */ + ; + if (p != ++sp) + for (p1 = sp, p2 = p; *p1++ = *p2++;); + p = sp; /* save start of component */ + slash = 0; + while (*++p) /* find next slash or end of path */ + if (*p == '/') { + slash = 1; + *p = 0; + break; + } + +#ifdef apollo + if (&cp[1] == sp && sp[0] == '.' && sp[1] == '.' && sp[2] == '\0') + slashslash = 1; +#endif + if (*sp == '\0') /* if component is null */ + if (--sp == cp) /* if path is one char (i.e. /) */ + break; + else + *sp = '\0'; + else if (sp[0] == '.' && sp[1] == 0) { + if (slash) { + for (p1 = sp, p2 = p + 1; *p1++ = *p2++;); + p = --sp; + } + else if (--sp != cp) + *sp = '\0'; + } + else if (sp[0] == '.' && sp[1] == '.' && sp[2] == 0) { + /* + * We have something like "yyy/xxx/..", where "yyy" can be null or + * a path starting at /, and "xxx" is a single component. Before + * compressing "xxx/..", we want to expand "yyy/xxx", if it is a + * symbolic link. + */ + *--sp = 0; /* form the pathname for readlink */ +#ifdef S_IFLNK /* if we have symlinks */ + if (sp != cp && !adrof(STRig__symlinks) && + (cc = readlink(short2str(cp), tlink, + sizeof tlink)) >= 0) { + (void) Strcpy(link, str2short(tlink)); + link[cc] = '\0'; + + if (slash) + *p = '/'; + /* + * Point p to the '/' in "/..", and restore the '/'. + */ + *(p = sp) = '/'; + /* + * find length of p + */ + for (p1 = p; *p1++;); + if (*link != '/') { + /* + * Relative path, expand it between the "yyy/" and the + * "/..". First, back sp up to the character past "yyy/". + */ + while (*--sp != '/'); + sp++; + *sp = 0; + /* + * New length is "yyy/" + link + "/.." and rest + */ + p1 = newcp = (Char *) xmalloc((size_t) + (((sp - cp) + cc + (p1 - p)) * + sizeof(Char))); + /* + * Copy new path into newcp + */ + for (p2 = cp; *p1++ = *p2++;); + for (p1--, p2 = link; *p1++ = *p2++;); + for (p1--, p2 = p; *p1++ = *p2++;); + /* + * Restart canonicalization at expanded "/xxx". + */ + p = sp - cp - 1 + newcp; + } + else { + /* + * New length is link + "/.." and rest + */ + p1 = newcp = (Char *) xmalloc((size_t) + ((cc + (p1 - p)) * sizeof(Char))); + /* + * Copy new path into newcp + */ + for (p2 = link; *p1++ = *p2++;); + for (p1--, p2 = p; *p1++ = *p2++;); + /* + * Restart canonicalization at beginning + */ + p = newcp; + } + xfree((ptr_t) cp); + cp = newcp; + continue; /* canonicalize the link */ + } +#endif /* S_IFLNK */ + *sp = '/'; + if (sp != cp) + while (*--sp != '/'); + if (slash) { + for (p1 = sp + 1, p2 = p + 1; *p1++ = *p2++;); + p = sp; + } + else if (cp == sp) + *++sp = '\0'; + else + *sp = '\0'; + } + else { /* normal dir name (not . or .. or nothing) */ + +#ifdef S_IFLNK /* if we have symlinks */ + if (sp != cp && adrof(STRchase_symlinks) && + !adrof(STRig__symlinks) && + (cc = readlink(short2str(cp), tlink, + sizeof tlink)) >= 0) { + (void) Strcpy(link, str2short(tlink)); + link[cc] = '\0'; + + /* + * restore the '/'. + */ + if (slash) + *p = '/'; + + /* + * point sp to p (rather than backing up). + */ + sp = p; + + /* + * find length of p + */ + for (p1 = p; *p1++;); + if (*link != '/') { + /* + * Relative path, expand it between the "yyy/" and the + * remainder. First, back sp up to the character past + * "yyy/". + */ + while (*--sp != '/'); + sp++; + *sp = 0; + /* + * New length is "yyy/" + link + "/.." and rest + */ + p1 = newcp = (Char *) xmalloc((size_t) + (((sp - cp) + cc + (p1 - p)) + * sizeof(Char))); + /* + * Copy new path into newcp + */ + for (p2 = cp; *p1++ = *p2++;); + for (p1--, p2 = link; *p1++ = *p2++;); + for (p1--, p2 = p; *p1++ = *p2++;); + /* + * Restart canonicalization at expanded "/xxx". + */ + p = sp - cp - 1 + newcp; + } + else { + /* + * New length is link + the rest + */ + p1 = newcp = (Char *) xmalloc((size_t) + ((cc + (p1 - p)) * sizeof(Char))); + /* + * Copy new path into newcp + */ + for (p2 = link; *p1++ = *p2++;); + for (p1--, p2 = p; *p1++ = *p2++;); + /* + * Restart canonicalization at beginning + */ + p = newcp; + } + xfree((ptr_t) cp); + cp = newcp; + continue; /* canonicalize the link */ + } +#endif /* S_IFLNK */ + if (slash) + *p = '/'; + } + } + + /* + * fix home... + */ +#ifdef S_IFLNK + p1 = value(STRhome); + cc = Strlen(p1); + /* + * See if we're not in a subdir of STRhome + */ + if (p1 && *p1 == '/' && + (Strncmp(p1, cp, cc) != 0 || (cp[cc] != '/' && cp[cc] != '\0'))) { + static ino_t home_ino = -1; + static dev_t home_dev = -1; + static Char *home_ptr = NULL; + struct stat statbuf; + + /* + * Get dev and ino of STRhome + */ + if (home_ptr != p1 && + stat(short2str(p1), &statbuf) != -1) { + home_dev = statbuf.st_dev; + home_ino = statbuf.st_ino; + home_ptr = p1; + } + /* + * Start comparing dev & ino backwards + */ + p2 = Strcpy(link, cp); + for (sp = NULL; *p2 && stat(short2str(p2), &statbuf) != -1;) { + if (statbuf.st_dev == home_dev && + statbuf.st_ino == home_ino) { + sp = (Char *) - 1; + break; + } + if (sp = Strrchr(p2, '/')) + *sp = '\0'; + } + /* + * See if we found it + */ + if (*p2 && sp == (Char *) -1) { + /* + * Use STRhome to make '~' work + */ + p2 = cp + Strlen(p2); + sp = newcp = (Char *) xmalloc((size_t) + ((cc + Strlen(p2) + 1) * sizeof(Char))); + while (*p1) + *sp++ = *p1++; + while (*p2) + *sp++ = *p2++; + *sp = '\0'; + xfree((ptr_t) cp); + cp = newcp; + } + } +#endif /* S_IFLNK */ + +#ifdef apollo + if (slashslash) { + if (cp[1] != '/') { + p = (Char *) xmalloc((size_t) (Strlen(cp) + 2) * sizeof(Char)); + *p = '/'; + (void) Strcpy(&p[1], cp); + xfree((ptr_t) cp); + cp = p; + } + } + if (cp[1] == '/' && cp[2] == '/') + (void) Strcpy(&cp[1], &cp[2]); +#endif + return cp; +} + + +/* + * dnewcwd - make a new directory in the loop the current one + */ +static void +dnewcwd(dp) + register struct directory *dp; +{ + dcwd = dp; + dset(dcwd->di_name); + if (printd && !(adrof(STRpusilent)) /* PWP: pushdsilent */ +#ifdef CSHDIRS + && !bequiet /* be quite while restoring stack -strike */ +#endif + ) + printdirs(); + cwd_cmd(); /* PWP: run the defined cwd command */ +} + +/* + * getstakd - added by kfk 17 Jan 1984 + * Support routine for the stack hack. Finds nth directory in + * the directory stack, or finds last directory in stack. + */ +int +getstakd(s, cnt) + Char *s; + int cnt; +{ + register struct directory *dp; + + dp = dcwd; + if (cnt < 0) { /* < 0 ==> last dir requested. */ + dp = dp->di_next; + if (dp == &dhead) + dp = dp->di_next; + } + else { + while (cnt-- > 0) { + dp = dp->di_prev; + if (dp == &dhead) + dp = dp->di_prev; + if (dp == dcwd) + return (0); + } + } + (void) Strcpy(s, dp->di_name); + return (1); +} + +/* + * Karl Kleinpaste - 10 Feb 1984 + * Added dextract(), which is used in pushd +n. + * Instead of just rotating the entire stack around, dextract() + * lets the user have the nth dir extracted from its current + * position, and pushes it onto the top. + */ +void +dextract(dp) + register struct directory *dp; +{ + if (dp == dcwd) + return; + dp->di_next->di_prev = dp->di_prev; + dp->di_prev->di_next = dp->di_next; + dp->di_next = dcwd->di_next; + dp->di_prev = dcwd; + dp->di_next->di_prev = dp; + dcwd->di_next = dp; +} + +#ifdef CSHDIRS +/* + * create a file called ~/.cshdirs which has a sequence + * of pushd commands which will restore the dir stack to + * its state before exit/logout. remember that the order + * is reversed in the file because we are pushing. + * -strike + */ +void +recdirs() +{ + int fp, ftmp, oldidfds; + int cdflag = 0; + extern int fast; + Char buf[BUFSIZ]; + + if (!fast) { + if (!adrof(STRsvdirs))/* does it exist */ + return; + (void) Strcpy(buf, value(STRhome)); + (void) Strcat(buf, STRs_dirs); + if ((fp = creat(short2str(buf), 0666)) == -1) + return; + oldidfds = didfds; + didfds = 0; + ftmp = SHOUT; + SHOUT = fp; + { + extern struct directory dhead; + extern struct directory *dcwd; + struct directory *dp = dcwd->di_next; + + do { + if (dp == &dhead) + continue; + if (cdflag == 0) + cdflag++, xprintf("cd %s\n", + short2str(dp->di_name)); + else + xprintf("pushd %s\n", + short2str(dp->di_name)); + } while ((dp = dp->di_next) != dcwd->di_next); + } + xprintf("dirs\n"); /* show the dir stack */ + + (void) close(fp); + SHOUT = ftmp; + didfds = oldidfds; + } +} + +#endif diff --git a/bin/tcsh/sh.dir.h b/bin/tcsh/sh.dir.h new file mode 100644 index 0000000..7fbd7bb --- /dev/null +++ b/bin/tcsh/sh.dir.h @@ -0,0 +1,50 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/sh.dir.h,v 3.0 1991/07/04 21:49:28 christos Exp $ */ +/* + * sh.dir.h: Directory data structures and globals + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#ifndef _h_sh_dir +#define _h_sh_dir +/* + * Structure for entries in directory stack. + */ +struct directory { + struct directory *di_next; /* next in loop */ + struct directory *di_prev; /* prev in loop */ + unsigned short *di_count; /* refcount of processes */ + Char *di_name; /* actual name */ +}; +struct directory *dcwd; /* the one we are in now */ + +#endif /* _h_sh_dir */ diff --git a/bin/tcsh/sh.dol.c b/bin/tcsh/sh.dol.c new file mode 100644 index 0000000..a874631 --- /dev/null +++ b/bin/tcsh/sh.dol.c @@ -0,0 +1,837 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/sh.dol.c,v 3.0 1991/07/04 21:49:28 christos Exp $ */ +/* + * sh.dol.c: Variable substitutions + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#include "config.h" +#if !defined(lint) && !defined(pdp11) +static char *rcsid() + { return "$Id: sh.dol.c,v 3.0 1991/07/04 21:49:28 christos Exp $"; } +#endif + +#include "sh.h" + +/* + * C shell + */ + +/* + * These routines perform variable substitution and quoting via ' and ". + * To this point these constructs have been preserved in the divided + * input words. Here we expand variables and turn quoting via ' and " into + * QUOTE bits on characters (which prevent further interpretation). + * If the `:q' modifier was applied during history expansion, then + * some QUOTEing may have occurred already, so we dont "trim()" here. + */ + +static int Dpeekc, Dpeekrd; /* Peeks for DgetC and Dreadc */ +static Char *Dcp, **Dvp; /* Input vector for Dreadc */ + +#define DEOF -1 + +#define unDgetC(c) Dpeekc = c + +#define QUOTES (_Q|_Q1|_ESC) /* \ ' " ` */ + +/* + * The following variables give the information about the current + * $ expansion, recording the current word position, the remaining + * words within this expansion, the count of remaining words, and the + * information about any : modifier which is being applied. + */ +static Char *dolp; /* Remaining chars from this word */ +static Char **dolnxt; /* Further words */ +static int dolcnt; /* Count of further words */ +static Char dolmod; /* : modifier character */ +static int dolmcnt; /* :gx -> 10000, else 1 */ + +static void Dfix2 __P((Char **)); +static Char *Dpack __P((Char *, Char *)); +static int Dword __P((void)); +static void dolerror __P((Char *)); +static int DgetC __P((int)); +static void Dgetdol __P((void)); +static void fixDolMod __P((void)); +static void setDolp __P((Char *)); +static void unDredc __P((int)); +static int Dredc __P((void)); +static void Dtestq __P((int)); + +/* + * Fix up the $ expansions and quotations in the + * argument list to command t. + */ +void +Dfix(t) + register struct command *t; +{ + register Char **pp; + register Char *p; + + if (noexec) + return; + /* Note that t_dcom isn't trimmed thus !...:q's aren't lost */ + for (pp = t->t_dcom; p = *pp++;) + for (; *p; p++) { + if (cmap(*p, _DOL | QUOTES)) { /* $, \, ', ", ` */ + Dfix2(t->t_dcom); /* found one */ + blkfree(t->t_dcom); + t->t_dcom = gargv; + gargv = 0; + return; + } + } +} + +/* + * $ substitute one word, for i/o redirection + */ +Char * +Dfix1(cp) + register Char *cp; +{ + Char *Dv[2]; + + if (noexec) + return (0); + Dv[0] = cp; + Dv[1] = NOSTR; + Dfix2(Dv); + if ((int)gargc != 1) { + setname(short2str(cp)); + stderror(ERR_NAME | ERR_AMBIG); + } + cp = Strsave(gargv[0]); + blkfree(gargv), gargv = 0; + return (cp); +} + +/* + * Subroutine to do actual fixing after state initialization. + */ +static void +Dfix2(v) + Char **v; +{ + ginit(); /* Initialize glob's area pointers */ + Dvp = v; + Dcp = STRNULL; /* Setup input vector for Dreadc */ + unDgetC(0); + unDredc(0); /* Clear out any old peeks (at error) */ + dolp = 0; + dolcnt = 0; /* Clear out residual $ expands (...) */ + while (Dword()) + continue; +} + +#define MAXWLEN (BUFSIZ - 4) +/* + * Pack up more characters in this word + */ +static Char * +Dpack(wbuf, wp) + Char *wbuf, *wp; +{ + register int c; + register int i = MAXWLEN - (wp - wbuf); + + for (;;) { + c = DgetC(DODOL); + if (c == '\\') { + c = DgetC(0); + if (c == DEOF) { + unDredc(c); + *wp = 0; + Gcat(STRNULL, wbuf); + return (NULL); + } + if (c == '\n') + c = ' '; + else + c |= QUOTE; + } + if (c == DEOF) { + unDredc(c); + *wp = 0; + Gcat(STRNULL, wbuf); + return (NULL); + } + if (cmap(c, _SP | _NL | _Q | _Q1)) { /* sp \t\n'"` */ + unDgetC(c); + if (cmap(c, QUOTES)) + return (wp); + *wp++ = 0; + Gcat(STRNULL, wbuf); + return (NULL); + } + if (--i <= 0) + stderror(ERR_WTOOLONG); + *wp++ = c; + } +} + +/* + * Get a word. This routine is analogous to the routine + * word() in sh.lex.c for the main lexical input. One difference + * here is that we don't get a newline to terminate our expansion. + * Rather, DgetC will return a DEOF when we hit the end-of-input. + */ +static int +Dword() +{ + register int c, c1; + Char wbuf[BUFSIZ]; + register Char *wp = wbuf; + register int i = MAXWLEN; + register bool dolflg; + bool sofar = 0, done = 0; + + while (!done) { + done = 1; + c = DgetC(DODOL); + switch (c) { + + case DEOF: + if (sofar == 0) + return (0); + /* finish this word and catch the code above the next time */ + unDredc(c); + /* fall into ... */ + + case '\n': + *wp = 0; + Gcat(STRNULL, wbuf); + return (1); + + case ' ': + case '\t': + done = 0; + break; + + case '`': + /* We preserve ` quotations which are done yet later */ + *wp++ = c, --i; + case '\'': + case '"': + /* + * Note that DgetC never returns a QUOTES character from an + * expansion, so only true input quotes will get us here or out. + */ + c1 = c; + dolflg = c1 == '"' ? DODOL : 0; + for (;;) { + c = DgetC(dolflg); + if (c == c1) + break; + if (c == '\n' || c == DEOF) + stderror(ERR_UNMATCHED, c1); + if ((c & (QUOTE | TRIM)) == ('\n' | QUOTE)) + --wp, ++i; + if (--i <= 0) + stderror(ERR_WTOOLONG); + switch (c1) { + + case '"': + /* + * Leave any `s alone for later. Other chars are all + * quoted, thus `...` can tell it was within "...". + */ + *wp++ = c == '`' ? '`' : c | QUOTE; + break; + + case '\'': + /* Prevent all further interpretation */ + *wp++ = c | QUOTE; + break; + + case '`': + /* Leave all text alone for later */ + *wp++ = c; + break; + } + } + if (c1 == '`') + *wp++ = '`' /* i--; eliminated */; + sofar = 1; + if ((wp = Dpack(wbuf, wp)) == NULL) + return (1); + else { + i = MAXWLEN - (wp - wbuf); + done = 0; + } + break; + + case '\\': + c = DgetC(0); /* No $ subst! */ + if (c == '\n' || c == DEOF) { + done = 0; + break; + } + c |= QUOTE; + break; + } + if (done) { + unDgetC(c); + sofar = 1; + if ((wp = Dpack(wbuf, wp)) == NULL) + return (1); + else { + i = MAXWLEN - (wp - wbuf); + done = 0; + } + } + } + /* Really NOTREACHED */ + return (0); +} + + +/* + * Get a character, performing $ substitution unless flag is 0. + * Any QUOTES character which is returned from a $ expansion is + * QUOTEd so that it will not be recognized above. + */ +static int +DgetC(flag) + register int flag; +{ + register int c; + +top: + if (c = Dpeekc) { + Dpeekc = 0; + return (c); + } + if (lap) { + c = *lap++ & (QUOTE | TRIM); + if (c == 0) { + lap = 0; + goto top; + } +quotspec: + if (cmap(c, QUOTES)) + return (c | QUOTE); + return (c); + } + if (dolp) { + if (c = *dolp++ & (QUOTE | TRIM)) + goto quotspec; + if (dolcnt > 0) { + setDolp(*dolnxt++); + --dolcnt; + return (' '); + } + dolp = 0; + } + if (dolcnt > 0) { + setDolp(*dolnxt++); + --dolcnt; + goto top; + } + c = Dredc(); + if (c == '$' && flag) { + Dgetdol(); + goto top; + } + return (c); +} + +static Char *nulvec[] = {0}; +static struct varent nulargv = {nulvec, STRargv, 0}; + +static void +dolerror(s) + Char *s; +{ + setname(short2str(s)); + stderror(ERR_NAME | ERR_RANGE); +} + +/* + * Handle the multitudinous $ expansion forms. + * Ugh. + */ +static void +Dgetdol() +{ + register Char *np; + register struct varent *vp = NULL; + Char name[4 * MAXVARLEN + 1]; + int c, sc; + int subscr = 0, lwb = 1, upb = 0; + bool dimen = 0, bitset = 0; + char tnp; + Char wbuf[BUFSIZ]; + + dolmod = dolmcnt = 0; + c = sc = DgetC(0); + if (c == '{') + c = DgetC(0); /* sc is { to take } later */ + if ((c & TRIM) == '#') + dimen++, c = DgetC(0); /* $# takes dimension */ + else if (c == '?') + bitset++, c = DgetC(0); /* $? tests existence */ + switch (c) { + + case '$': + if (dimen || bitset) + stderror(ERR_SYNTAX); + setDolp(doldol); + goto eatbrac; + + case '<' | QUOTE: + if (bitset) + stderror(ERR_NOTALLOWED, "$?<"); + if (dimen) + stderror(ERR_NOTALLOWED, "$?#"); + for (np = wbuf; read(OLDSTD, &tnp, 1) == 1; np++) { + *np = tnp; + if (np >= &wbuf[BUFSIZ - 1]) + stderror(ERR_LTOOLONG); + if (SIGN_EXTEND_CHAR(tnp) <= 0 || tnp == '\n') + break; + } + *np = 0; + /* + * KLUDGE: dolmod is set here because it will cause setDolp to call + * domod and thus to copy wbuf. Otherwise setDolp would use it + * directly. If we saved it ourselves, no one would know when to free + * it. The actual function of the 'q' causes filename expansion not to + * be done on the interpolated value. + */ + dolmod = 'q'; + dolmcnt = 10000; + setDolp(wbuf); + goto eatbrac; + + case DEOF: + case '\n': + stderror(ERR_SYNTAX); + /* NOTREACHED */ + break; + + case '*': + (void) Strcpy(name, STRargv); + vp = adrof(STRargv); + subscr = -1; /* Prevent eating [...] */ + break; + + default: + np = name; + if (Isdigit(c)) { + if (dimen) + stderror(ERR_NOTALLOWED, "$#"); + subscr = 0; + do { + subscr = subscr * 10 + c - '0'; + c = DgetC(0); + } while (Isdigit(c)); + unDredc(c); + if (subscr < 0) { + dolerror(vp->v_name); + return; + } + if (subscr == 0) { + if (bitset) { + dolp = ffile ? STR1 : STR0; + goto eatbrac; + } + if (ffile == 0) + stderror(ERR_DOLZERO); + fixDolMod(); + setDolp(ffile); + goto eatbrac; + } + if (bitset) + stderror(ERR_DOLQUEST); + vp = adrof(STRargv); + if (vp == 0) { + vp = &nulargv; + goto eatmod; + } + break; + } + if (!alnum(c)) + stderror(ERR_VARALNUM); + for (;;) { + *np++ = c; + c = DgetC(0); + if (!alnum(c)) + break; + if (np >= &name[MAXVARLEN]) + stderror(ERR_VARTOOLONG); + } + *np++ = 0; + unDredc(c); + vp = adrof(name); + } + if (bitset) { + dolp = (vp || getenv(short2str(name))) ? STR1 : STR0; + goto eatbrac; + } + if (vp == 0) { + np = str2short(getenv(short2str(name))); + if (np) { + fixDolMod(); + setDolp(np); + goto eatbrac; + } + udvar(name); + /* NOTREACHED */ + } + c = DgetC(0); + upb = blklen(vp->vec); + if (dimen == 0 && subscr == 0 && c == '[') { + np = name; + for (;;) { + c = DgetC(DODOL); /* Allow $ expand within [ ] */ + if (c == ']') + break; + if (c == '\n' || c == DEOF) + stderror(ERR_INCBR); + if (np >= &name[sizeof(name) / sizeof(Char) - 2]) + stderror(ERR_VARTOOLONG); + *np++ = c; + } + *np = 0, np = name; + if (dolp || dolcnt) /* $ exp must end before ] */ + stderror(ERR_EXPORD); + if (!*np) + stderror(ERR_SYNTAX); + if (Isdigit(*np)) { + int i; + + for (i = 0; Isdigit(*np); i = i * 10 + *np++ - '0'); + if ((i < 0 || i > upb) && !any("-*", *np)) { + dolerror(vp->v_name); + return; + } + lwb = i; + if (!*np) + upb = lwb, np = STRstar; + } + if (*np == '*') + np++; + else if (*np != '-') + stderror(ERR_MISSING, '-'); + else { + register int i = upb; + + np++; + if (Isdigit(*np)) { + i = 0; + while (Isdigit(*np)) + i = i * 10 + *np++ - '0'; + if (i < 0 || i > upb) { + dolerror(vp->v_name); + return; + } + } + if (i < lwb) + upb = lwb - 1; + else + upb = i; + } + if (lwb == 0) { + if (upb != 0) { + dolerror(vp->v_name); + return; + } + upb = -1; + } + if (*np) + stderror(ERR_SYNTAX); + } + else { + if (subscr > 0) + if (subscr > upb) + lwb = 1, upb = 0; + else + lwb = upb = subscr; + unDredc(c); + } + if (dimen) { + Char *cp = putn(upb - lwb + 1); + + addla(cp); + xfree((ptr_t) cp); + } + else { +eatmod: + fixDolMod(); + dolnxt = &vp->vec[lwb - 1]; + dolcnt = upb - lwb + 1; + } +eatbrac: + if (sc == '{') { + c = Dredc(); + if (c != '}') + stderror(ERR_MISSING, '}'); + } +} + +static void +fixDolMod() +{ + register int c; + + c = DgetC(0); + if (c == ':') { + c = DgetC(0), dolmcnt = 1; + if (c == 'g') + c = DgetC(0), dolmcnt = 10000; + if (!any("htrqxe", c)) + stderror(ERR_BADMOD, c); + dolmod = c; + if (c == 'q') + dolmcnt = 10000; + } + else + unDredc(c); +} + +static void +setDolp(cp) + register Char *cp; +{ + register Char *dp; + + if (dolmod == 0 || dolmcnt == 0) { + dolp = cp; + return; + } + dp = domod(cp, dolmod); + if (dp) { + dolmcnt--; + addla(dp); + xfree((ptr_t) dp); + } + else + addla(cp); + dolp = STRNULL; + if (seterr) + stderror(ERR_OLD); +} + +static void +unDredc(c) + int c; +{ + + Dpeekrd = c; +} + +static int +Dredc() +{ + register int c; + + if (c = Dpeekrd) { + Dpeekrd = 0; + return (c); + } + if (Dcp && (c = *Dcp++)) + return (c & (QUOTE | TRIM)); + if (*Dvp == 0) { + Dcp = 0; + return (DEOF); + } + Dcp = *Dvp++; + return (' '); +} + +static void +Dtestq(c) + register int c; +{ + + if (cmap(c, QUOTES)) + gflag = 1; +} + +/* + * Form a shell temporary file (in unit 0) from the words + * of the shell input up to EOF or a line the same as "term". + * Unit 0 should have been closed before this call. + */ +void +heredoc(term) + Char *term; +{ + register int c; + Char *Dv[2]; + Char obuf[BUFSIZ], lbuf[BUFSIZ], mbuf[BUFSIZ]; + int ocnt, lcnt, mcnt; + register Char *lbp, *obp, *mbp; + Char **vp; + bool quoted; + char *tmp; + + if (creat(tmp = short2str(shtemp), 0600) < 0) + stderror(ERR_SYSTEM, tmp, strerror(errno)); + (void) close(0); + if (open(tmp, O_RDWR) < 0) { + int oerrno = errno; + + (void) unlink(tmp); + errno = oerrno; + stderror(ERR_SYSTEM, tmp, strerror(errno)); + } + (void) unlink(tmp); /* 0 0 inode! */ + Dv[0] = term; + Dv[1] = NOSTR; + gflag = 0; + trim(Dv); + rscan(Dv, Dtestq); + quoted = gflag; + ocnt = BUFSIZ; + obp = obuf; + for (;;) { + /* + * Read up a line + */ + lbp = lbuf; + lcnt = BUFSIZ - 4; + for (;;) { + c = readc(1); /* 1 -> Want EOF returns */ + if (c < 0 || c == '\n') + break; + if (c &= TRIM) { + *lbp++ = c; + if (--lcnt < 0) { + setname("<<"); + stderror(ERR_NAME | ERR_OVERFLOW); + } + } + } + *lbp = 0; + + /* + * Check for EOF or compare to terminator -- before expansion + */ + if (c < 0 || eq(lbuf, term)) { + (void) write(0, short2str(obuf), (size_t) (BUFSIZ - ocnt)); + (void) lseek(0, 0l, L_SET); + return; + } + + /* + * If term was quoted or -n just pass it on + */ + if (quoted || noexec) { + *lbp++ = '\n'; + *lbp = 0; + for (lbp = lbuf; c = *lbp++;) { + *obp++ = c; + if (--ocnt == 0) { + (void) write(0, short2str(obuf), BUFSIZ); + obp = obuf; + ocnt = BUFSIZ; + } + } + continue; + } + + /* + * Term wasn't quoted so variable and then command expand the input + * line + */ + Dcp = lbuf; + Dvp = Dv + 1; + mbp = mbuf; + mcnt = BUFSIZ - 4; + for (;;) { + c = DgetC(DODOL); + if (c == DEOF) + break; + if ((c &= TRIM) == 0) + continue; + /* \ quotes \ $ ` here */ + if (c == '\\') { + c = DgetC(0); + if (!any("$\\`", c)) + unDgetC(c | QUOTE), c = '\\'; + else + c |= QUOTE; + } + *mbp++ = c; + if (--mcnt == 0) { + setname("<<"); + stderror(ERR_NAME | ERR_OVERFLOW); + } + } + *mbp++ = 0; + + /* + * If any ` in line do command substitution + */ + mbp = mbuf; + if (any(short2str(mbp), '`')) { + /* + * 1 arg to dobackp causes substitution to be literal. Words are + * broken only at newlines so that all blanks and tabs are + * preserved. Blank lines (null words) are not discarded. + */ + vp = dobackp(mbuf, 1); + } + else + /* Setup trivial vector similar to return of dobackp */ + Dv[0] = mbp, Dv[1] = NOSTR, vp = Dv; + + /* + * Resurrect the words from the command substitution each separated by + * a newline. Note that the last newline of a command substitution + * will have been discarded, but we put a newline after the last word + * because this represents the newline after the last input line! + */ + for (; *vp; vp++) { + for (mbp = *vp; *mbp; mbp++) { + *obp++ = *mbp & TRIM; + if (--ocnt == 0) { + (void) write(0, short2str(obuf), BUFSIZ); + obp = obuf; + ocnt = BUFSIZ; + } + } + *obp++ = '\n'; + if (--ocnt == 0) { + (void) write(0, short2str(obuf), BUFSIZ); + obp = obuf; + ocnt = BUFSIZ; + } + } + if (pargv) + blkfree(pargv), pargv = 0; + } +} diff --git a/bin/tcsh/sh.err.c b/bin/tcsh/sh.err.c new file mode 100644 index 0000000..9f1ecca --- /dev/null +++ b/bin/tcsh/sh.err.c @@ -0,0 +1,472 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/sh.err.c,v 3.0 1991/07/04 21:49:28 christos Exp $ */ +/* + * sh.err.c: Error printing routines. There are lots of them + * and none does the right thing! + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#include "config.h" +#if !defined(lint) && !defined(pdp11) +static char *rcsid() + { return "$Id: sh.err.c,v 3.0 1991/07/04 21:49:28 christos Exp $"; } +#endif + +#define _h_tc_err /* Don't redefine the errors */ +#include "sh.h" + +/* + * C Shell + */ + +char *seterr = NULL; /* Holds last error if there was one */ + +#ifndef pdp11 +#define ERR_FLAGS 0xf0000000 +#define ERR_NAME 0x10000000 +#define ERR_SILENT 0x20000000 +#define ERR_OLD 0x40000000 +#else +#define ERR_FLAGS 070000 +#define ERR_NAME 010000 +#define ERR_SILENT 020000 +#define ERR_OLD 040000 +#endif /* pdp11 */ + +static char *errorlist[] = +{ +#define ERR_SYNTAX 0 + "Syntax Error", +#define ERR_NOTALLOWED 1 + "%s is not allowed", +#define ERR_WTOOLONG 2 + "Word too long", +#define ERR_LTOOLONG 3 + "$< line too long", +#define ERR_DOLZERO 4 + "No file for $0", +#define ERR_DOLQUEST 5 + "$? not allowed here", +#define ERR_INCBR 6 + "Incomplete [] modifier", +#define ERR_EXPORD 7 + "$ expansion must end before ]", +#define ERR_BADMOD 8 + "Bad : modifier in $ (%c)", +#define ERR_SUBSCRIPT 9 + "Subscript error", +#define ERR_BADNUM 10 + "Badly formed number", +#define ERR_NOMORE 11 + "No more words", +#define ERR_FILENAME 12 + "Missing file name", +#define ERR_GLOB 13 + "Internal glob error", +#define ERR_COMMAND 14 + "Command not found", +#define ERR_TOOFEW 15 + "Too few arguments", +#define ERR_TOOMANY 16 + "Too many arguments", +#define ERR_DANGER 17 + "Too dangerous to alias that", +#define ERR_EMPTYIF 18 + "Empty if", +#define ERR_IMPRTHEN 19 + "Improper then", +#define ERR_NOPAREN 20 + "Words not parenthesized", +#define ERR_NOTFOUND 21 + "%s not found", +#define ERR_MASK 22 + "Improper mask", +#define ERR_LIMIT 23 + "No such limit", +#define ERR_TOOLARGE 24 + "Argument too large", +#define ERR_SCALEF 25 + "Improper or unknown scale factor", +#define ERR_UNDVAR 26 + "Undefined variable", +#define ERR_DEEP 27 + "Directory stack not that deep", +#define ERR_BADSIG 28 + "Bad signal number", +#define ERR_UNKSIG 29 + "Unknown signal; kill -l lists signals", +#define ERR_VARBEGIN 30 + "Variable name must begin with a letter", +#define ERR_VARTOOLONG 31 + "Variable name too long", +#define ERR_VARALNUM 32 + "Variable name must contain alphanumeric characters", +#define ERR_JOBCONTROL 33 + "No job control in this shell", +#define ERR_EXPRESSION 34 + "Expression Syntax", +#define ERR_NOHOMEDIR 35 + "No home directory", +#define ERR_CANTCHANGE 36 + "Can't change to home directory", +#define ERR_NULLCOM 37 + "Invalid null command", +#define ERR_ASSIGN 38 + "Assignment missing expression", +#define ERR_UNKNOWNOP 39 + "Unknown operator", +#define ERR_AMBIG 40 + "Ambiguous", +#define ERR_EXISTS 41 + "%s: File exists", +#define ERR_ARGC 42 + "Argument for -c ends in backslash", +#define ERR_INTR 43 + "Interrupted", +#define ERR_RANGE 44 + "Subscript out of range", +#define ERR_OVERFLOW 45 + "Line overflow", +#define ERR_NOSUCHJOB 46 + "No such job", +#define ERR_TERMINAL 47 + "Can't from terminal", +#define ERR_NOTWHILE 48 + "Not in while/foreach", +#define ERR_NOPROC 49 + "No more processes", +#define ERR_NOMATCH 50 + "No match", +#define ERR_MISSING 51 + "Missing %c", +#define ERR_UNMATCHED 52 + "Unmatched %c", +#define ERR_NOMEM 53 + "Out of memory", +#define ERR_PIPE 54 + "Can't make pipe", +#define ERR_SYSTEM 55 + "%s: %s", +#define ERR_STRING 56 + "%s", +#define ERR_JOBS 57 + "Usage: jobs [ -l ]", +#define ERR_JOBARGS 58 + "Arguments should be jobs or process id's", +#define ERR_JOBCUR 59 + "No current job", +#define ERR_JOBPREV 60 + "No previous job", +#define ERR_JOBPAT 61 + "No job matches pattern", +#define ERR_NESTING 62 + "Fork nesting > %d; maybe `...` loop", +#define ERR_JOBCTRLSUB 63 + "No job control in subshells", +#define ERR_SYNC 64 + "Sunc fault: Process %d not found", +#define ERR_STOPPED 65 +#ifdef SUSPENDED + "%sThere are suspended jobs", +#else + "%sThere are stopped jobs", +#endif /* SUSPENDED */ +#define ERR_NODIR 66 + "No other directory", +#define ERR_EMPTY 67 + "Directory stack empty", +#define ERR_BADDIR 68 + "Bad directory", +#define ERR_DIRUS 69 + "Usage: %s [-lvn]%s", +#define ERR_HFLAG 70 + "No operand for -h flag", +#define ERR_NOTLOGIN 71 + "Not a login shell", +#define ERR_DIV0 72 + "Division by 0", +#define ERR_MOD0 73 + "Mod by 0", +#define ERR_BADSCALE 74 + "Bad scaling; did you mean \"%s\"?", +#define ERR_SUSPLOG 75 + "Can't suspend a login shell (yet)", +#define ERR_UNKUSER 76 + "Unknown user: %s", +#define ERR_NOHOME 77 + "No $home variable set", +#define ERR_HISTUS 78 + "Usage: history [-rht] [# number of events]", +#define ERR_SPDOLLT 79 + "$ or < not allowed with $# or $?", +#define ERR_NEWLINE 80 + "Newline in variable name", +#define ERR_SPSTAR 81 + "* not allowed with $# or $?", +#define ERR_DIGIT 82 + "$? or $# not allowed", +#define ERR_VARILL 83 + "Illegal variable name", +#define ERR_NLINDEX 84 + "Newline in variable index", +#define ERR_EXPOVFL 85 + "Expansion buffer overflow", +#define ERR_VARSYN 86 + "Variable syntax", +#define ERR_BADBANG 87 + "Bad ! form", +#define ERR_NOSUBST 88 + "No previous substitute", +#define ERR_BADSUBST 89 + "Bad substitute", +#define ERR_LHS 90 + "No previous left hand side", +#define ERR_RHSLONG 91 + "Right hand side too long", +#define ERR_BADBANGMOD 92 + "Bad ! modifier: %c", +#define ERR_MODFAIL 93 + "Modifier failed", +#define ERR_SUBOVFL 94 + "Substitution buffer overflow", +#define ERR_BADBANGARG 95 + "Bad ! arg selector", +#define ERR_NOSEARCH 96 + "No prev search", +#define ERR_NOEVENT 97 + "%s: Event not found", +#define ERR_TOOMANYRP 98 + "Too many )'s", +#define ERR_TOOMANYLP 99 + "Too many ('s", +#define ERR_BADPLP 100 + "Badly placed (", +#define ERR_MISRED 101 + "Missing name for redirect", +#define ERR_OUTRED 102 + "Ambiguous output redirect", +#define ERR_REDPAR 103 + "Can't << within ()'s", +#define ERR_INRED 104 + "Ambiguous input redirect", +#define ERR_BADPLPS 105 + "Badly placed ()'s", +#define ERR_VARMOD 106 + "Unknown variable modifier", +#define ERR_ALIASLOOP 107 + "Alias loop", +#define ERR_NOWATCH 108 + "No $watch variable set", +#define ERR_NOSCHED 109 + "No scheduled events", +#define ERR_SCHEDUSAGE 110 + "Usage: sched -.\nUsage: sched [+]hh:mm ", +#define ERR_SCHEDEV 111 + "Not that many scheduled events", +#define ERR_SCHEDCOM 112 + "No command to run", +#define ERR_SCHEDTIME 113 + "Invalid time for event", +#define ERR_SCHEDREL 114 + "Relative time inconsistent with am/pm", +#define ERR_TCNOSTR 115 + "Out of t_c_ string space", +#define ERR_SETTCUS 116 + "Usage: settc %s [yes|no]", +#define ERR_TCCAP 117 + "Unknown capability `%s'", +#define ERR_TCPARM 118 + "Unknown t_c_ parameter `%%%c'", +#define ERR_TCARGS 119 + "Too many arguments for `%s' (%d)", +#define ERR_TCNARGS 120 + "`%s' requires %d arguments", +#define ERR_TCUSAGE 121 + "Usage: echotc [-v|-s] [ []]", +#define ERR_ARCH 122 + "%s: %s. Wrong Architecture", +#define ERR_HISTLOOP 123 + "!# History loop", +#define ERR_FILEINQ 124 + "Malformed file inquiry", +#define ERR_SELOVFL 125 + "Selector overflow", +#define ERR_INVALID 126 + "Invalid Error" +}; + +/* + * The parser and scanner set up errors for later by calling seterr, + * which sets the variable err as a side effect; later to be tested, + * e.g. in process. + */ +void +/*VARARGS1*/ +#if __STDC__ +seterror(int id, ...) +#else +seterror(va_alist) + va_dcl +#endif +{ + + if (seterr == 0) { + va_list va; + char berr[BUFSIZ]; +#if __STDC__ + va_start(va, id); +#else + int id; + va_start(va); + id = va_arg(va, int); +#endif + + if (id < 0 || id > sizeof(errorlist) / sizeof(errorlist[0])) + id = ERR_INVALID; +/* xprintf("error id is %d\n",id); /* jpn */ + xvsprintf(berr, errorlist[id], va); + va_end(va); + + seterr = strsave(berr); + } +} + +/* + * Print the error with the given id. + * + * Special ids: + * ERR_SILENT: Print nothing. + * ERR_OLD: Print the previously set error if one was there. + * otherwise return. + * ERR_NAME: If this bit is set, print the name of the function + * in bname + * + * This routine always resets or exits. The flag haderr + * is set so the routine who catches the unwind can propogate + * it if they want. + * + * Note that any open files at the point of error will eventually + * be closed in the routine process in sh.c which is the only + * place error unwinds are ever caught. + */ +void +/*VARARGS*/ +#if __STDC__ +stderror(int id, ...) +#else +stderror(va_alist) + va_dcl +#endif +{ + va_list va; + register Char **v; + int flags; + +#if __STDC__ + va_start(va, id); +#else + int id; + + va_start(va); + id = va_arg(va, int); +#endif + + flags = id & ERR_FLAGS; + id &= ~ERR_FLAGS; + + if ((flags & ERR_OLD) && seterr == NULL) { + va_end(va); + return; + } + + if (id < 0 || id > sizeof(errorlist) / sizeof(errorlist[0])) + id = ERR_INVALID; + + /* + * Must flush before we print as we wish output before the error to go on + * (some form of) standard output, while output after goes on (some form + * of) diagnostic output. If didfds then output will go to 1/2 else to + * FSHOUT/FSHDIAG. See flush in sh.print.c. + */ + flush(); + haderr = 1; /* Now to diagnostic output */ + timflg = 0; /* This isn't otherwise reset */ + + /* jpn debug */ + /* + if (flags & ERR_NOMEM) + abort(); + */ + + if (!(flags & ERR_SILENT)) { + if (flags & ERR_NAME) + xprintf("%s: ", bname); + if ((flags & ERR_OLD)) + /* Old error. */ + xprintf("%s.\n", seterr); + else { + xvprintf(errorlist[id], va); + xprintf(".\n"); + } + } + va_end(va); + + if (seterr) { + xfree((ptr_t) seterr); + seterr = NULL; + } + + if (v = pargv) + pargv = 0, blkfree(v); + if (v = gargv) + gargv = 0, blkfree(v); + + didfds = 0; /* Forget about 0,1,2 */ + /* + * Go away if -e or we are a child shell + */ + if (exiterr || child) + xexit(1); + + /* + * Reset the state of the input. This buffered seek to end of file will + * also clear the while/foreach stack. + */ + btoeof(); + + set(STRstatus, Strsave(STR1)); +#ifdef BSDJOBS + if (tpgrp > 0) + (void) tcsetpgrp(FSHTTY, tpgrp); +#endif + reset(); /* Unwind */ +} diff --git a/bin/tcsh/sh.exec.c b/bin/tcsh/sh.exec.c new file mode 100644 index 0000000..a1db6c6 --- /dev/null +++ b/bin/tcsh/sh.exec.c @@ -0,0 +1,694 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/sh.exec.c,v 3.0 1991/07/04 21:49:28 christos Exp $ */ +/* + * sh.exec.c: Search, find, and execute a command! + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#include "config.h" +#if !defined(lint) && !defined(pdp11) +static char *rcsid() + { return "$Id: sh.exec.c,v 3.0 1991/07/04 21:49:28 christos Exp $"; } +#endif + +#include "sh.h" +#include "tw.h" + +/* + * C shell + */ + +/* + * System level search and execute of a command. + * We look in each directory for the specified command name. + * If the name contains a '/' then we execute only the full path name. + * If there is no search path then we execute only full path names. + */ + +/* + * As we search for the command we note the first non-trivial error + * message for presentation to the user. This allows us often + * to show that a file has the wrong mode/no access when the file + * is not in the last component of the search path, so we must + * go on after first detecting the error. + */ +static char *exerr; /* Execution error message */ +static Char *expath; /* Path for exerr */ + +/* + * Xhash is an array of HSHSIZ bits (HSHSIZ / 8 chars), which are used + * to hash execs. If it is allocated (havhash true), then to tell + * whether ``name'' is (possibly) present in the i'th component + * of the variable path, you look at the bit in xhash indexed by + * hash(hashname("name"), i). This is setup automatically + * after .login is executed, and recomputed whenever ``path'' is + * changed. + * The two part hash function is designed to let texec() call the + * more expensive hashname() only once and the simple hash() several + * times (once for each path component checked). + * Byte size is assumed to be 8. + */ +#define HSHSIZ 8192 /* 1k bytes */ +#define HSHMASK (HSHSIZ - 1) +#define HSHMUL 243 +static char xhash[HSHSIZ / 8]; + +#define hash(a, b) ((a) * HSHMUL + (b) & HSHMASK) +#define bit(h, b) ((h)[(b) >> 3] & 1 << ((b) & 7)) /* bit test */ +#define bis(h, b) ((h)[(b) >> 3] |= 1 << ((b) & 7)) /* bit set */ +#ifdef VFORK +static int hits, misses; + +#endif + +/* Dummy search path for just absolute search when no path */ +static Char *justabs[] = {STRNULL, 0}; + +static void pexerr __P((void)); +static void texec __P((Char *, Char **)); +static int hashname __P((Char *)); + +void +doexec(t) + register struct command *t; +{ + register Char *dp, **pv, **av, *sav; + register struct varent *v; + register bool slash; + register int hshval = 0, hshval1, i; + Char *blk[2]; + + /* + * Glob the command name. We will search $path even if this does something, + * as in sh but not in csh. One special case: if there is no PATH, then we + * execute only commands which start with '/'. + */ + blk[0] = t->t_dcom[0]; + blk[1] = 0; + gflag = 0, tglob(blk); + if (gflag) { + pv = globall(blk); + if (pv == 0) { + setname(short2str(blk[0])); + stderror(ERR_NAME | ERR_NOMATCH); + } + gargv = 0; + } + else + pv = saveblk(blk); + + trim(pv); + + exerr = 0; + expath = Strsave(pv[0]); +#ifdef VFORK + Vexpath = expath; +#endif + + v = adrof(STRpath); + if (v == 0 && expath[0] != '/') { + blkfree(pv); + pexerr(); + } + slash = any(short2str(expath), '/'); + + /* + * Glob the argument list, if necessary. Otherwise trim off the quote bits. + */ + gflag = 0; + av = &t->t_dcom[1]; + tglob(av); + if (gflag) { + av = globall(av); + if (av == 0) { + blkfree(pv); + setname(short2str(expath)); + stderror(ERR_NAME | ERR_NOMATCH); + } + gargv = 0; + } + else + av = saveblk(av); + + blkfree(t->t_dcom); + t->t_dcom = blkspl(pv, av); + xfree((ptr_t) pv); + xfree((ptr_t) av); + av = t->t_dcom; + trim(av); + + if (*av == NULL || **av == '\0') + pexerr(); + + xechoit(av); /* Echo command if -x */ +#ifdef FIOCLEX + /* + * Since all internal file descriptors are set to close on exec, we don't + * need to close them explicitly here. Just reorient ourselves for error + * messages. + */ + SHIN = 0; + SHOUT = 1; + SHDIAG = 2; + OLDSTD = 0; + isoutatty = isatty(SHOUT); + isdiagatty = isatty(SHDIAG); +#else + closech(); /* Close random fd's */ +#endif + /* + * We must do this AFTER any possible forking (like `foo` in glob) so that + * this shell can still do subprocesses. + */ +#ifdef BSDSIGS + (void) sigsetmask((sigmask_t) 0); +#else /* BSDSIGS */ + (void) sigrelse(SIGINT); + (void) sigrelse(SIGCHLD); +#endif /* BSDSIGS */ + + /* + * If no path, no words in path, or a / in the filename then restrict the + * command search. + */ + if (v == 0 || v->vec[0] == 0 || slash) + pv = justabs; + else + pv = v->vec; + sav = Strspl(STRslash, *av);/* / command name for postpending */ +#ifdef VFORK + Vsav = sav; +#endif + if (havhash) + hshval = hashname(*av); + i = 0; +#ifdef VFORK + hits++; +#endif + do { + /* + * Try to save time by looking at the hash table for where this command + * could be. If we are doing delayed hashing, then we put the names in + * one at a time, as the user enters them. This is kinda like Korn + * Shell's "tracked aliases". + */ + if (!slash && pv[0][0] == '/' && havhash) { + hshval1 = hash(hshval, i); + if (!bit(xhash, hshval1)) + goto cont; + } + if (pv[0][0] == 0 || eq(pv[0], STRdot)) /* don't make ./xxx */ + texec(*av, av); + else { + dp = Strspl(*pv, sav); +#ifdef VFORK + Vdp = dp; +#endif + texec(dp, av); +#ifdef VFORK + Vdp = 0; +#endif + xfree((ptr_t) dp); + } +#ifdef VFORK + misses++; +#endif +cont: + pv++; + i++; + } while (*pv); +#ifdef VFORK + hits--; +#endif +#ifdef VFORK + Vsav = 0; +#endif + xfree((ptr_t) sav); + pexerr(); +} + +static void +pexerr() +{ + /* Couldn't find the damn thing */ + if (expath) { + setname(short2str(expath)); +#ifdef VFORK + Vexpath = 0; +#endif + xfree((ptr_t) expath); + expath = 0; + } + else + setname(""); + if (exerr) + stderror(ERR_NAME | ERR_STRING, exerr); + stderror(ERR_NAME | ERR_COMMAND); +} + +/* + * Execute command f, arg list t. + * Record error message if not found. + * Also do shell scripts here. + */ +static void +texec(sf, st) + Char *sf; + register Char **st; +{ + register char **t; + register char *f; + register struct varent *v; + register Char **vp; + Char *lastsh[2]; + int fd; + unsigned char c; + Char *st0, **ost; + + /* The order for the conversions is significant */ + t = short2blk(st); + f = short2str(sf); +#ifdef VFORK + Vt = t; +#endif + errno = 0; /* don't use a previous error */ +#ifdef apollo + /* + * If we try to execute an nfs mounted directory on the apollo, we + * hang forever. So until apollo fixes that.. + */ + { + struct stat stb; + if (stat(f, &stb) == 0 && S_ISDIR(stb.st_mode)) + errno = EISDIR; + } + if (errno == 0) +#endif + (void) execv(f, t); +#ifdef VFORK + Vt = 0; +#endif + blkfree((Char **) t); + switch (errno) { + + case ENOEXEC: + /* + * From: casper@fwi.uva.nl (Casper H.S. Dik) If we could not execute + * it, don't feed it to the shell if it looks like a binary! + */ + if ((fd = open(f, O_RDONLY)) != -1) { + if (read(fd, (char *) &c, 1) == 1) { + if (!Isprint(c) && (c != '\n' && c != '\t')) { + (void) close(fd); + /* + * We *know* what ENOEXEC means. + */ + stderror(ERR_ARCH, f, strerror(errno)); + } + } +#ifdef _PATH_BSHELL + else + c = '#'; +#endif + (void) close(fd); + } + /* + * If there is an alias for shell, then put the words of the alias in + * front of the argument list replacing the command name. Note no + * interpretation of the words at this point. + */ + v = adrof1(STRshell, &aliases); + if (v == 0) { + vp = lastsh; + vp[0] = adrof(STRshell) ? value(STRshell) : STR_SHELLPATH; + vp[1] = NOSTR; +#ifdef _PATH_BSHELL + if (fd != -1 && c != '#') + vp[0] = STR_BSHELL; +#endif + } + else + vp = v->vec; + st0 = st[0]; + st[0] = sf; + ost = st; + st = blkspl(vp, st); /* Splice up the new arglst */ + ost[0] = st0; + sf = *st; + /* The order for the conversions is significant */ + t = short2blk(st); + f = short2str(sf); + xfree((ptr_t) st); +#ifdef VFORK + Vt = t; +#endif + (void) execv(f, t); +#ifdef VFORK + Vt = 0; +#endif + blkfree((Char **) t); + /* The sky is falling, the sky is falling! */ + + case ENOMEM: + stderror(ERR_SYSTEM, f, strerror(errno)); + +#ifdef _IBMR2 + case 0: /* execv fails and returns 0! */ +#endif /* _IBMR2 */ + case ENOENT: + break; + + default: + if (exerr == 0) { + exerr = strerror(errno); + if (expath) + xfree((ptr_t) expath); + expath = Strsave(sf); +#ifdef VFORK + Vexpath = expath; +#endif + } + } +} + +/*ARGSUSED*/ +void +execash(t, kp) + char **t; + register struct command *kp; +{ + if (chkstop == 0 && setintr) + panystop(0); +#ifdef notdef + /* + * Why we don't want to close SH* on exec? I think we do... Christos + */ +#ifndef FIOCLEX + didcch = 1; +#endif +#endif /* notdef */ + rechist(); + (void) signal(SIGINT, parintr); + (void) signal(SIGQUIT, parintr); + (void) signal(SIGTERM, parterm); /* if doexec loses, screw */ + lshift(kp->t_dcom, 1); + exiterr = 1; + doexec(kp); + /* NOTREACHED */ +} + +void +xechoit(t) + Char **t; +{ + if (adrof(STRecho)) { + flush(); + haderr = 1; + blkpr(t), xputchar('\n'); + haderr = 0; + } +} + +/*VARARGS0*/ +void +dohash() +{ +#ifdef COMMENT + struct stat stb; +#endif + DIR *dirp; + register struct dirent *dp; + register int cnt; + int i = 0; + struct varent *v = adrof(STRpath); + Char **pv; + int hshval; + + tw_clear_comm_list(); + havhash = 1; + for (cnt = 0; cnt < sizeof xhash; cnt++) + xhash[cnt] = 0; + if (v == 0) + return; + for (pv = v->vec; *pv; pv++, i++) { + if (pv[0][0] != '/') + continue; + dirp = opendir(short2str(*pv)); + if (dirp == NULL) + continue; +#ifdef COMMENT /* this isn't needed. opendir won't open + * non-dirs */ + if (fstat(dirp->dd_fd, &stb) < 0 || !S_ISDIR(stb.st_mode)) { + (void) closedir(dirp); + continue; + } +#endif + while ((dp = readdir(dirp)) != NULL) { + if (dp->d_ino == 0) + continue; + if (dp->d_name[0] == '.' && + (dp->d_name[1] == '\0' || + dp->d_name[1] == '.' && dp->d_name[2] == '\0')) + continue; + hshval = hash(hashname(str2short(dp->d_name)), i); + bis(xhash, hshval); + /* tw_comm_name_add (dp->d_name); */ + } + (void) closedir(dirp); + } +} + +void +dounhash() +{ + havhash = 0; +} + +#ifdef VFORK +void +hashstat() +{ + if (hits + misses) + xprintf("%d hits, %d misses, %d%%\n", + hits, misses, 100 * hits / (hits + misses)); +} + +#endif + +/* + * Hash a command name. + */ +static int +hashname(cp) + register Char *cp; +{ + register long h = 0; + + while (*cp) + h = hash(h, *cp++); + return ((int) h); +} + +int +iscommand(name) + Char *name; +{ + register Char **pv; + register Char *sav; + register struct varent *v; + register bool slash = any(short2str(name), '/'); + register int hshval = 0, hshval1, i; + + v = adrof(STRpath); + if (v == 0 || v->vec[0] == 0 || slash) + pv = justabs; + else + pv = v->vec; + sav = Strspl(STRslash, name); /* / command name for postpending */ + if (havhash) + hshval = hashname(name); + i = 0; + do { + if (!slash && pv[0][0] == '/' && havhash) { + hshval1 = hash(hshval, i); + if (!bit(xhash, hshval1)) + goto cont; + } + if (pv[0][0] == 0 || eq(pv[0], STRdot)) { /* don't make ./xxx */ + if (executable(NULL, name, 0)) { + xfree((ptr_t) sav); + return i + 1; + } + } + else { + if (executable(*pv, sav, 0)) { + xfree((ptr_t) sav); + return i + 1; + } + } +cont: + pv++; + i++; + } while (*pv); + xfree((ptr_t) sav); + return 0; +} + +/* Also by: + * Andreas Luik + * I S A GmbH - Informationssysteme fuer computerintegrierte Automatisierung + * Azenberstr. 35 + * D-7000 Stuttgart 1 + * West-Germany + * is the executable() routine below and changes to iscommand(). + * Thanks again!! + */ + +/* + * executable() examines the pathname obtained by concatenating dir and name + * (dir may be NULL), and returns 1 either if it is executable by us, or + * if dir_ok is set and the pathname refers to a directory. + * This is a bit kludgy, but in the name of optimization... + */ +int +executable(dir, name, dir_ok) + Char *dir, *name; + bool dir_ok; +{ + struct stat stbuf; + Char path[MAXPATHLEN + 1]; + char *strname; + + if (dir && *dir) { + copyn(path, dir, MAXPATHLEN); + catn(path, name, MAXPATHLEN); + strname = short2str(path); + } + else + strname = short2str(name); + return (stat(strname, &stbuf) != -1 && + ((S_ISREG(stbuf.st_mode) && + /* save time by not calling access() in the hopeless case */ + (stbuf.st_mode & (S_IXOTH | S_IXGRP | S_IXUSR)) && + access(strname, X_OK) == 0) || + (dir_ok && S_ISDIR(stbuf.st_mode)))); +} + +void +tellmewhat(lex) + struct wordent *lex; +{ + register int i; + register struct biltins *bptr; + register struct wordent *sp = lex->next; + bool aliased = 0; + Char *s0, *s1, *s2; + Char qc; + + if (adrof1(sp->word, &aliases)) { + alias(lex); + sp = lex->next; + aliased = 1; + } + + s0 = sp->word; /* to get the memory freeing right... */ + + /* handle quoted alias hack */ + if ((*(sp->word) & (QUOTE | TRIM)) == QUOTE) + (sp->word)++; + + /* do quoting, if it hasn't been done */ + s1 = s2 = sp->word; + while (*s2) + switch (*s2) { + case '\'': + case '"': + qc = *s2++; + while (*s2 && *s2 != qc) + *s1++ = *s2++ | QUOTE; + if (*s2) + s2++; + break; + case '\\': + if (*++s2) + *s1++ = *s2++ | QUOTE; + break; + default: + *s1++ = *s2++; + } + *s1 = '\0'; + + for (bptr = bfunc; bptr < &bfunc[nbfunc]; bptr++) { + if (eq(sp->word, str2short(bptr->bname))) { + if (aliased) + prlex(lex); + xprintf("%s: shell built-in command.\n", short2str(sp->word)); + flush(); + sp->word = s0; /* we save and then restore this */ + return; + } + } + + if (i = iscommand(strip(sp->word))) { + register Char **pv; + register struct varent *v; + bool slash = any(short2str(sp->word), '/'); + + v = adrof(STRpath); + if (v == 0 || v->vec[0] == 0 || slash) + pv = justabs; + else + pv = v->vec; + + while (--i) + pv++; + if (pv[0][0] == 0 || eq(pv[0], STRdot)) { + sp->word = Strspl(STRdt_l, sp->word); + prlex(lex); + xfree((ptr_t) sp->word); + sp->word = s0; /* we save and then restore this */ + return; + } + s1 = Strspl(*pv, STRslash); + sp->word = Strspl(s1, sp->word); + xfree((ptr_t) s1); + prlex(lex); + xfree((ptr_t) sp->word); + } + else { + if (aliased) + prlex(lex); + xprintf("%s: Command not found.\n", short2str(sp->word)); + flush(); + } + sp->word = s0; /* we save and then restore this */ +} diff --git a/bin/tcsh/sh.exp.c b/bin/tcsh/sh.exp.c new file mode 100644 index 0000000..14a6865 --- /dev/null +++ b/bin/tcsh/sh.exp.c @@ -0,0 +1,706 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/sh.exp.c,v 3.0 1991/07/04 21:49:28 christos Exp $ */ +/* + * sh.exp.c: Expression evaluations + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#include "config.h" +#if !defined(lint) && !defined(pdp11) +static char *rcsid() + { return "$Id: sh.exp.c,v 3.0 1991/07/04 21:49:28 christos Exp $"; } +#endif + +#include "sh.h" + +/* + * C shell + */ + +#define IGNORE 1 /* in ignore, it means to ignore value, just parse */ +#define NOGLOB 2 /* in ignore, it means not to globone */ + +#define ADDOP 1 +#define MULOP 2 +#define EQOP 4 +#define RELOP 8 +#define RESTOP 16 +#define ANYOP 31 + +#define EQEQ 1 +#define GTR 2 +#define LSS 4 +#define NOTEQ 6 +#define EQMATCH 7 +#define NOTEQMATCH 8 + +static int exp1 __P((Char ***, bool)); +static int exp2 __P((Char ***, bool)); +static int exp2a __P((Char ***, bool)); +static int exp2b __P((Char ***, bool)); +static int exp2c __P((Char ***, bool)); +static Char *exp3 __P((Char ***, bool)); +static Char *exp3a __P((Char ***, bool)); +static Char *exp4 __P((Char ***, bool)); +static Char *exp5 __P((Char ***, bool)); +static Char *exp6 __P((Char ***, bool)); +static void evalav __P((Char **)); +static int isa __P((Char *, int)); +static int egetn __P((Char *)); + +#ifdef EDEBUG +static void etracc __P((char *, Char *, Char ***)); +static void etraci __P((char *, int, Char ***)); +#endif + +int +exp(vp) + register Char ***vp; +{ + return (exp0(vp, 0)); +} + +int +exp0(vp, ignore) + register Char ***vp; + bool ignore; +{ + register int p1 = exp1(vp, ignore); + +#ifdef EDEBUG + etraci("exp0 p1", p1, vp); +#endif + if (**vp && eq(**vp, STRor2)) { + register int p2; + + (*vp)++; + p2 = exp0(vp, (ignore & IGNORE) || p1); +#ifdef EDEBUG + etraci("exp0 p2", p2, vp); +#endif + return (p1 || p2); + } + return (p1); +} + +static int +exp1(vp, ignore) + register Char ***vp; + bool ignore; +{ + register int p1 = exp2(vp, ignore); + +#ifdef EDEBUG + etraci("exp1 p1", p1, vp); +#endif + if (**vp && eq(**vp, STRand2)) { + register int p2; + + (*vp)++; + p2 = exp1(vp, (ignore & IGNORE) || !p1); +#ifdef EDEBUG + etraci("exp1 p2", p2, vp); +#endif + return (p1 && p2); + } + return (p1); +} + +static int +exp2(vp, ignore) + register Char ***vp; + bool ignore; +{ + register int p1 = exp2a(vp, ignore); + +#ifdef EDEBUG + etraci("exp3 p1", p1, vp); +#endif + if (**vp && eq(**vp, STRor)) { + register int p2; + + (*vp)++; + p2 = exp2(vp, ignore); +#ifdef EDEBUG + etraci("exp3 p2", p2, vp); +#endif + return (p1 | p2); + } + return (p1); +} + +static int +exp2a(vp, ignore) + register Char ***vp; + bool ignore; +{ + register int p1 = exp2b(vp, ignore); + +#ifdef EDEBUG + etraci("exp2a p1", p1, vp); +#endif + if (**vp && eq(**vp, STRcaret)) { + register int p2; + + (*vp)++; + p2 = exp2a(vp, ignore); +#ifdef EDEBUG + etraci("exp2a p2", p2, vp); +#endif + return (p1 ^ p2); + } + return (p1); +} + +static int +exp2b(vp, ignore) + register Char ***vp; + bool ignore; +{ + register int p1 = exp2c(vp, ignore); + +#ifdef EDEBUG + etraci("exp2b p1", p1, vp); +#endif + if (**vp && eq(**vp, STRand)) { + register int p2; + + (*vp)++; + p2 = exp2b(vp, ignore); +#ifdef EDEBUG + etraci("exp2b p2", p2, vp); +#endif + return (p1 & p2); + } + return (p1); +} + +static int +exp2c(vp, ignore) + register Char ***vp; + bool ignore; +{ + register Char *p1 = exp3(vp, ignore); + register Char *p2; + register int i; + +#ifdef EDEBUG + etracc("exp2c p1", p1, vp); +#endif + if (i = isa(**vp, EQOP)) { + (*vp)++; + if (i == EQMATCH || i == NOTEQMATCH) + ignore |= NOGLOB; + p2 = exp3(vp, ignore); +#ifdef EDEBUG + etracc("exp2c p2", p2, vp); +#endif + if (!(ignore & IGNORE)) + switch (i) { + + case EQEQ: + i = eq(p1, p2); + break; + + case NOTEQ: + i = !eq(p1, p2); + break; + + case EQMATCH: + i = Gmatch(p1, p2); + break; + + case NOTEQMATCH: + i = !Gmatch(p1, p2); + break; + } + xfree((ptr_t) p1); + xfree((ptr_t) p2); + return (i); + } + i = egetn(p1); + xfree((ptr_t) p1); + return (i); +} + +static Char * +exp3(vp, ignore) + register Char ***vp; + bool ignore; +{ + register Char *p1, *p2; + register int i; + + p1 = exp3a(vp, ignore); +#ifdef EDEBUG + etracc("exp3 p1", p1, vp); +#endif + if (i = isa(**vp, RELOP)) { + (*vp)++; + if (**vp && eq(**vp, STRequal)) + i |= 1, (*vp)++; + p2 = exp3(vp, ignore); +#ifdef EDEBUG + etracc("exp3 p2", p2, vp); +#endif + if (!(ignore & IGNORE)) + switch (i) { + + case GTR: + i = egetn(p1) > egetn(p2); + break; + + case GTR | 1: + i = egetn(p1) >= egetn(p2); + break; + + case LSS: + i = egetn(p1) < egetn(p2); + break; + + case LSS | 1: + i = egetn(p1) <= egetn(p2); + break; + } + xfree((ptr_t) p1); + xfree((ptr_t) p2); + return (putn(i)); + } + return (p1); +} + +static Char * +exp3a(vp, ignore) + register Char ***vp; + bool ignore; +{ + register Char *p1, *p2, *op; + register int i; + + p1 = exp4(vp, ignore); +#ifdef EDEBUG + etracc("exp3a p1", p1, vp); +#endif + op = **vp; + if (op && any("<>", op[0]) && op[0] == op[1]) { + (*vp)++; + p2 = exp3a(vp, ignore); +#ifdef EDEBUG + etracc("exp3a p2", p2, vp); +#endif + if (op[0] == '<') + i = egetn(p1) << egetn(p2); + else + i = egetn(p1) >> egetn(p2); + xfree((ptr_t) p1); + xfree((ptr_t) p2); + return (putn(i)); + } + return (p1); +} + +static Char * +exp4(vp, ignore) + register Char ***vp; + bool ignore; +{ + register Char *p1, *p2; + register int i = 0; + + p1 = exp5(vp, ignore); +#ifdef EDEBUG + etracc("exp4 p1", p1, vp); +#endif + if (isa(**vp, ADDOP)) { + register Char *op = *(*vp)++; + + p2 = exp4(vp, ignore); +#ifdef EDEBUG + etracc("exp4 p2", p2, vp); +#endif + if (!(ignore & IGNORE)) + switch (op[0]) { + + case '+': + i = egetn(p1) + egetn(p2); + break; + + case '-': + i = egetn(p1) - egetn(p2); + break; + } + xfree((ptr_t) p1); + xfree((ptr_t) p2); + return (putn(i)); + } + return (p1); +} + +static Char * +exp5(vp, ignore) + register Char ***vp; + bool ignore; +{ + register Char *p1, *p2; + register int i = 0; + + p1 = exp6(vp, ignore); +#ifdef EDEBUG + etracc("exp5 p1", p1, vp); +#endif + if (isa(**vp, MULOP)) { + register Char *op = *(*vp)++; + + p2 = exp5(vp, ignore); +#ifdef EDEBUG + etracc("exp5 p2", p2, vp); +#endif + if (!(ignore & IGNORE)) + switch (op[0]) { + + case '*': + i = egetn(p1) * egetn(p2); + break; + + case '/': + i = egetn(p2); + if (i == 0) + stderror(ERR_DIV0); + i = egetn(p1) / i; + break; + + case '%': + i = egetn(p2); + if (i == 0) + stderror(ERR_MOD0); + i = egetn(p1) % i; + break; + } + xfree((ptr_t) p1); + xfree((ptr_t) p2); + return (putn(i)); + } + return (p1); +} + +static Char * +exp6(vp, ignore) + register Char ***vp; + bool ignore; +{ + int ccode, i = 0; + register Char *cp, *dp, *ep; + + if (**vp == 0) + stderror(ERR_NAME | ERR_EXPRESSION); + if (eq(**vp, STRbang)) { + (*vp)++; + cp = exp6(vp, ignore); +#ifdef EDEBUG + etracc("exp6 ! cp", cp, vp); +#endif + i = egetn(cp); + xfree((ptr_t) cp); + return (putn(!i)); + } + if (eq(**vp, STRtilde)) { + (*vp)++; + cp = exp6(vp, ignore); +#ifdef EDEBUG + etracc("exp6 ~ cp", cp, vp); +#endif + i = egetn(cp); + xfree((ptr_t) cp); + return (putn(~i)); + } + if (eq(**vp, STRLparen)) { + (*vp)++; + ccode = exp0(vp, ignore); +#ifdef EDEBUG + etraci("exp6 () ccode", ccode, vp); +#endif + if (*vp == 0 || **vp == 0 || ***vp != ')') + stderror(ERR_NAME | ERR_EXPRESSION); + (*vp)++; + return (putn(ccode)); + } + if (eq(**vp, STRLbrace)) { + register Char **v; + struct command faket; + Char *fakecom[2]; + + faket.t_dtyp = NODE_COMMAND; + faket.t_dflg = 0; + faket.t_dcar = faket.t_dcdr = faket.t_dspr = NULL; + faket.t_dcom = fakecom; + fakecom[0] = STRfkcom; + fakecom[1] = NOSTR; + (*vp)++; + v = *vp; + for (;;) { + if (!**vp) + stderror(ERR_NAME | ERR_MISSING, '}'); + if (eq(*(*vp)++, STRRbrace)) + break; + } + if (ignore & IGNORE) + return (Strsave(STRNULL)); + psavejob(); + if (pfork(&faket, -1) == 0) { + *--(*vp) = 0; + evalav(v); + exitstat(); + } + pwait(); + prestjob(); +#ifdef EDEBUG + etraci("exp6 {} status", egetn(value(STRstatus)), vp); +#endif + return (putn(egetn(value(STRstatus)) == 0)); + } + if (isa(**vp, ANYOP)) + return (Strsave(STRNULL)); + cp = *(*vp)++; + if (*cp == '-' && any("erwxfdzopls", cp[1])) { + struct stat stb; + + if (cp[2] != '\0') + stderror(ERR_NAME | ERR_FILEINQ); + /* + * Detect missing file names by checking for operator in the file name + * position. However, if an operator name appears there, we must make + * sure that there's no file by that name (e.g., "/") before announcing + * an error. Even this check isn't quite right, since it doesn't take + * globbing into account. + */ + if (isa(**vp, ANYOP) && stat(short2str(**vp), &stb)) + stderror(ERR_NAME | ERR_FILENAME); + + dp = *(*vp)++; + if (ignore & IGNORE) + return (Strsave(STRNULL)); + ep = globone(dp, G_ERROR); + switch (cp[1]) { + + case 'r': + i = !access(short2str(ep), R_OK); + break; + + case 'w': + i = !access(short2str(ep), W_OK); + break; + + case 'x': + i = !access(short2str(ep), X_OK); + break; + + default: + if ( +#ifdef S_IFLNK + cp[1] == 'l' ? lstat(short2str(ep), &stb) : +#endif + stat(short2str(ep), &stb)) { + xfree((ptr_t) ep); + return (Strsave(STR0)); + } + switch (cp[1]) { + + case 'f': + i = S_ISREG(stb.st_mode); + break; + + case 'd': + i = S_ISDIR(stb.st_mode); + break; + + case 'p': +#ifdef S_ISFIFO + i = S_ISFIFO(stb.st_mode); +#else + i = 0; +#endif + break; + + case 'l': +#ifdef S_ISLNK + i = S_ISLNK(stb.st_mode); +#else + i = 0; +#endif + break; + + case 's': +#ifdef S_ISSOCK + i = S_ISSOCK(stb.st_mode); +#else + i = 0; +#endif + break; + + case 'z': + i = stb.st_size == 0; + break; + + case 'e': + i = 1; + break; + + case 'o': + i = stb.st_uid == uid; + break; + } + } +#ifdef EDEBUG + etraci("exp6 -? i", i, vp); +#endif + xfree((ptr_t) ep); + return (putn(i)); + } +#ifdef EDEBUG + etracc("exp6 default", cp, vp); +#endif + return (ignore & NOGLOB ? Strsave(cp) : globone(cp, G_ERROR)); +} + +static void +evalav(v) + register Char **v; +{ + struct wordent paraml1; + register struct wordent *hp = ¶ml1; + struct command *t; + register struct wordent *wdp = hp; + + set(STRstatus, Strsave(STR0)); + hp->prev = hp->next = hp; + hp->word = STRNULL; + while (*v) { + register struct wordent *new = + (struct wordent *) xcalloc(1, sizeof *wdp); + + new->prev = wdp; + new->next = hp; + wdp->next = new; + wdp = new; + wdp->word = Strsave(*v++); + } + hp->prev = wdp; + alias(¶ml1); + t = syntax(paraml1.next, ¶ml1, 0); + if (seterr) + stderror(ERR_OLD); + execute(t, -1, NULL, NULL); + freelex(¶ml1), freesyn(t); +} + +static int +isa(cp, what) + register Char *cp; + register int what; +{ + if (cp == 0) + return ((what & RESTOP) != 0); + if (cp[1] == 0) { + if (what & ADDOP && (*cp == '+' || *cp == '-')) + return (1); + if (what & MULOP && (*cp == '*' || *cp == '/' || *cp == '%')) + return (1); + if (what & RESTOP && (*cp == '(' || *cp == ')' || *cp == '!' || + *cp == '~' || *cp == '^' || *cp == '"')) + return (1); + } + else if (cp[2] == 0) { + if (what & RESTOP) { + if (cp[0] == '|' && cp[1] == '&') + return (1); + if (cp[0] == '<' && cp[1] == '<') + return (1); + if (cp[0] == '>' && cp[1] == '>') + return (1); + } + if (what & EQOP) { + if (cp[0] == '=') { + if (cp[1] == '=') + return (EQEQ); + if (cp[1] == '~') + return (EQMATCH); + } + else if (cp[0] == '!') { + if (cp[1] == '=') + return (NOTEQ); + if (cp[1] == '~') + return (NOTEQMATCH); + } + } + } + if (what & RELOP) { + if (*cp == '<') + return (LSS); + if (*cp == '>') + return (GTR); + } + return (0); +} + +static int +egetn(cp) + register Char *cp; +{ + if (*cp && *cp != '-' && !Isdigit(*cp)) + stderror(ERR_NAME | ERR_EXPRESSION); + return (getn(cp)); +} + +/* Phew! */ + +#ifdef EDEBUG +static void +etraci(str, i, vp) + char *str; + int i; + Char ***vp; +{ + xprintf("%s=%d\t", str, i); + blkpr(*vp); + xprintf("\n"); +} +static void +etracc(str, cp, vp) + char *str; + Char *cp; + Char ***vp; +{ + xprintf("%s=%s\t", str, cp); + blkpr(*vp); + xprintf("\n"); +} +#endif diff --git a/bin/tcsh/sh.file.c b/bin/tcsh/sh.file.c new file mode 100644 index 0000000..bea9ab6 --- /dev/null +++ b/bin/tcsh/sh.file.c @@ -0,0 +1,726 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/sh.file.c,v 3.0 1991/07/04 21:49:28 christos Exp $ */ +/* + * sh.file.c: File completion for csh. + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#ifdef FILEC +#include "config.h" +#ifndef lint +static char *rcsid() + { return "$Id: sh.file.c,v 3.0 1991/07/04 21:49:28 christos Exp $"; } +#endif + +#include "sh.h" + +/* + * Tenex style file name recognition, .. and more. + * History: + * Author: Ken Greer, Sept. 1975, CMU. + * Finally got around to adding to the Cshell., Ken Greer, Dec. 1981. + */ + +#define ON 1 +#define OFF 0 +#ifndef TRUE +#define TRUE 1 +#endif +#ifndef FALSE +#define FALSE 0 +#endif + +#define ESC '\033' + +typedef enum { + LIST, RECOGNIZE +} COMMAND; + +static void setup_tty __P((int)); +static void back_to_col_1 __P((void)); +static void pushback __P((Char *)); +static void catn __P((Char *, Char *, int)); +static void copyn __P((Char *, Char *, int)); +static Char filetype __P((Char *, Char *)); +static void print_by_column __P((Char *, Char *[], int)); +static Char *tilde __P((Char *, Char *)); +static void retype __P((void)); +static void beep __P((void)); +static void print_recog_stuff __P((Char *)); +static void extract_dir_and_name __P((Char *, Char *, Char *)); +static Char *getentry __P((DIR *, int)); +static void free_items __P((Char **)); +static int tsearch __P((Char *, COMMAND, int)); +static int recognize __P((Char *, Char *, int, int)); +static int is_prefix __P((Char *, Char *)); +static int is_suffix __P((Char *, Char *)); +static int ignored __P((Char *)); + + +/* + * Put this here so the binary can be patched with adb to enable file + * completion by default. Filec controls completion, nobeep controls + * ringing the terminal bell on incomplete expansions. + */ +bool filec = 0; + +static void +setup_tty(on) + int on; +{ +#ifdef TERMIOS + static struct termios tchars; + + if (on) { + (void) tcgetattr(SHIN, &tchars); + tchars.c_cc[VEOL] = ESC; + if (tchars.c_lflag & ICANON) + on = TCSANOW; + else { + on = TCSAFLUSH; + tchars.c_lflag |= ICANON; + } + (void) tcsetattr(SHIN, on, &tchars); + } + else { + tchars.c_cc[VEOL] = _POSIX_VDISABLE; + (void) tcsetattr(SHIN, TCSANOW, &tchars); + } +#else + struct sgttyb sgtty; + static struct tchars tchars;/* INT, QUIT, XON, XOFF, EOF, BRK */ + + if (on) { + (void) ioctl(SHIN, TIOCGETC, (ioctl_t) & tchars); + tchars.t_brkc = ESC; + (void) ioctl(SHIN, TIOCSETC, (ioctl_t) & tchars); + /* + * This must be done after every command: if the tty gets into raw or + * cbreak mode the user can't even type 'reset'. + */ + (void) ioctl(SHIN, TIOCGETP, (ioctl_t) & sgtty); + if (sgtty.sg_flags & (RAW | CBREAK)) { + sgtty.sg_flags &= ~(RAW | CBREAK); + (void) ioctl(SHIN, TIOCSETP, (ioctl_t) & sgtty); + } + } + else { + tchars.t_brkc = -1; + (void) ioctl(SHIN, TIOCSETC, (ioctl_t) & tchars); + } +#endif +} + +/* + * Move back to beginning of current line + */ +static void +back_to_col_1() +{ +#ifdef TERMIOS + struct termios tty, tty_normal; + sigmask_t omask; + + omask = sigblock(sigmask(SIGINT)); + (void) tcgetattr(SHOUT, &tty); + tty_normal = tty; + tty.c_iflag &= ~INLCR; + tty.c_oflag &= ~ONLCR; + (void) tcsetattr(SHOUT, TCSANOW, &tty); + (void) write(SHOUT, "\r", 1); + (void) tcsetattr(SHOUT, TCSANOW, &tty_normal); + (void) sigsetmask(omask); +#else + struct sgttyb tty, tty_normal; + sigmask_t omask; + + omask = sigblock(sigmask(SIGINT)); + (void) ioctl(SHIN, TIOCGETP, (ioctl_t) & tty); + tty_normal = tty; + tty.sg_flags &= ~CRMOD; + (void) ioctl(SHIN, TIOCSETN, (ioctl_t) & tty); + (void) write(SHOUT, "\r", 1); + (void) ioctl(SHIN, TIOCSETN, (ioctl_t) & tty_normal); + (void) sigsetmask(omask); +#endif +} + +/* + * Push string contents back into tty queue + */ +static void +pushback(string) + Char *string; +{ +#ifdef TERMIOS + register Char *p; + struct termios tty, tty_normal; + sigmask_t omask; + char c; + + omask = sigblock(sigmask(SIGINT)); + (void) tcgetattr(SHOUT, &tty); + tty_normal = tty; + tty.c_lflag &= ~(ECHOKE | ECHO | ECHOE | ECHOK | ECHONL | ECHOPRT | ECHOCTL); + (void) tcsetattr(SHOUT, TCSANOW, &tty); + + for (p = string; c = *p; p++) + (void) ioctl(SHOUT, TIOCSTI, (ioctl_t) & c); + (void) tcsetattr(SHOUT, TCSANOW, &tty_normal); + (void) sigsetmask(omask); +#else + register Char *p; + struct sgttyb tty, tty_normal; + sigmask_t omask; + char c; + + omask = sigblock(sigmask(SIGINT)); + (void) ioctl(SHOUT, TIOCGETP, (ioctl_t) & tty); + tty_normal = tty; + tty.sg_flags &= ~ECHO; + (void) ioctl(SHOUT, TIOCSETN, (ioctl_t) & tty); + + for (p = string; c = *p; p++) + (void) ioctl(SHOUT, TIOCSTI, (ioctl_t) & c); + (void) ioctl(SHOUT, TIOCSETN, (ioctl_t) & tty_normal); + (void) sigsetmask(omask); +#endif +} + +/* + * Concatenate src onto tail of des. + * Des is a string whose maximum length is count. + * Always null terminate. + */ +static void +catn(des, src, count) + register Char *des, *src; + register count; +{ + while (--count >= 0 && *des) + des++; + while (--count >= 0) + if ((*des++ = *src++) == 0) + return; + *des = '\0'; +} + +/* + * Like strncpy but always leave room for trailing \0 + * and always null terminate. + */ +static void +copyn(des, src, count) + register Char *des, *src; + register count; +{ + while (--count >= 0) + if ((*des++ = *src++) == 0) + return; + *des = '\0'; +} + +static Char +filetype(dir, file) + Char *dir, *file; +{ + Char path[MAXPATHLEN]; + struct stat statb; + + catn(Strcpy(path, dir), file, sizeof(path) / sizeof(Char)); + if (lstat(short2str(path), &statb) == 0) { + switch (statb.st_mode & S_IFMT) { + case S_IFDIR: + return ('/'); + + case S_IFLNK: + if (stat(short2str(path), &statb) == 0 && /* follow it out */ + S_ISDIR(statb.st_mode)) + return ('>'); + else + return ('@'); + + case S_IFSOCK: + return ('='); + + default: + if (statb.st_mode & 0111) + return ('*'); + } + } + return (' '); +} + +static struct winsize win; + +/* + * Print sorted down columns + */ +static void +print_by_column(dir, items, count) + Char *dir, *items[]; + int count; +{ + register int i, rows, r, c, maxwidth = 0, columns; + + if (ioctl(SHOUT, TIOCGWINSZ, (ioctl_t) & win) < 0 || win.ws_col == 0) + win.ws_col = 80; + for (i = 0; i < count; i++) + maxwidth = maxwidth > (r = Strlen(items[i])) ? maxwidth : r; + maxwidth += 2; /* for the file tag and space */ + columns = win.ws_col / maxwidth; + if (columns == 0) + columns = 1; + rows = (count + (columns - 1)) / columns; + for (r = 0; r < rows; r++) { + for (c = 0; c < columns; c++) { + i = c * rows + r; + if (i < count) { + register int w; + + xprintf("%s", short2str(items[i])); + xputchar(dir ? filetype(dir, items[i]) : ' '); + if (c < columns - 1) { /* last column? */ + w = Strlen(items[i]) + 1; + for (; w < maxwidth; w++) + xputchar(' '); + } + } + } + xputchar('\r'); + xputchar('\n'); + } +} + +/* + * Expand file name with possible tilde usage + * ~person/mumble + * expands to + * home_directory_of_person/mumble + */ +static Char * +tilde(new, old) + Char *new, *old; +{ + register Char *o, *p; + register struct passwd *pw; + static Char person[40]; + + if (old[0] != '~') + return (Strcpy(new, old)); + + for (p = person, o = &old[1]; *o && *o != '/'; *p++ = *o++); + *p = '\0'; + if (person[0] == '\0') + (void) Strcpy(new, value(STRhome)); + else { + pw = getpwnam(short2str(person)); + if (pw == NULL) + return (NULL); + (void) Strcpy(new, str2short(pw->pw_dir)); + } + (void) Strcat(new, o); + return (new); +} + +/* + * Cause pending line to be printed + */ +static void +retype() +{ +#ifdef TERMIOS + struct termios tty; + + (void) tcgetattr(SHOUT, &tty); + tty.c_lflag |= PENDIN; + (void) tcsetattr(SHOUT, TCSANOW, &tty); +#else + int pending_input = LPENDIN; + + (void) ioctl(SHOUT, TIOCLBIS, (ioctl_t) & pending_input); +#endif +} + +static void +beep() +{ + if (adrof(STRnobeep) == 0) + (void) write(SHOUT, "\007", 1); +} + +/* + * Erase that silly ^[ and + * print the recognized part of the string + */ +static void +print_recog_stuff(recog_part) + Char *recog_part; +{ + /* An optimized erasing of that silly ^[ */ + putraw('\b'); + putraw('\b'); + switch (Strlen(recog_part)) { + + case 0: /* erase two Characters: ^[ */ + putraw(' '); + putraw(' '); + putraw('\b'); + putraw('\b'); + break; + + case 1: /* overstrike the ^, erase the [ */ + xprintf("%s", short2str(recog_part)); + putraw(' '); + putraw('\b'); + break; + + default: /* overstrike both Characters ^[ */ + xprintf("%s", short2str(recog_part)); + break; + } + flush(); +} + +/* + * Parse full path in file into 2 parts: directory and file names + * Should leave final slash (/) at end of dir. + */ +static void +extract_dir_and_name(path, dir, name) + Char *path, *dir, *name; +{ + register Char *p; + + p = Strrchr(path, '/'); + if (p == NULL) { + copyn(name, path, MAXNAMLEN); + dir[0] = '\0'; + } + else { + copyn(name, ++p, MAXNAMLEN); + copyn(dir, path, p - path); + } +} + +static Char * +getentry(dir_fd, look_lognames) + DIR *dir_fd; + int look_lognames; +{ + register struct passwd *pw; + register struct dirent *dirp; + + if (look_lognames) { + if ((pw = getpwent()) == NULL) + return (NULL); + return (str2short(pw->pw_name)); + } + if (dirp = readdir(dir_fd)) + return (str2short(dirp->d_name)); + return (NULL); +} + +static void +free_items(items) + register Char **items; +{ + register int i; + + for (i = 0; items[i]; i++) + xfree((ptr_t) items[i]); + xfree((ptr_t) items); +} + +#define FREE_ITEMS(items) { \ + sigmask_t omask;\ +\ + omask = sigblock(sigmask(SIGINT));\ + free_items(items);\ + items = NULL;\ + (void) sigsetmask(omask);\ +} + +/* + * Perform a RECOGNIZE or LIST command on string "word". + */ +static int +tsearch(word, command, max_word_length) + Char *word; + int max_word_length; + COMMAND command; +{ + static Char **items = NULL; + register DIR *dir_fd; + register numitems = 0, ignoring = TRUE, nignored = 0; + register name_length, look_lognames; + Char tilded_dir[MAXPATHLEN + 1], dir[MAXPATHLEN + 1]; + Char name[MAXNAMLEN + 1], extended_name[MAXNAMLEN + 1]; + Char *entry; + +#define MAXITEMS 1024 + + if (items != NULL) + FREE_ITEMS(items); + + look_lognames = (*word == '~') && (Strchr(word, '/') == NULL); + if (look_lognames) { + (void) setpwent(); + copyn(name, &word[1], MAXNAMLEN); /* name sans ~ */ + dir_fd = NULL; + } + else { + extract_dir_and_name(word, dir, name); + if (tilde(tilded_dir, dir) == 0) + return (0); + dir_fd = opendir(*tilded_dir ? short2str(tilded_dir) : "."); + if (dir_fd == NULL) + return (0); + } + +again: /* search for matches */ + name_length = Strlen(name); + for (numitems = 0; entry = getentry(dir_fd, look_lognames);) { + if (!is_prefix(name, entry)) + continue; + /* Don't match . files on null prefix match */ + if (name_length == 0 && entry[0] == '.' && + !look_lognames) + continue; + if (command == LIST) { + if (numitems >= MAXITEMS) { + xprintf("\nYikes!! Too many %s!!\n", + look_lognames ? + "names in password file" : "files"); + break; + } + if (items == NULL) + items = (Char **) xcalloc(sizeof(items[0]), MAXITEMS); + items[numitems] = (Char *) xmalloc((size_t) (Strlen(entry) + 1) * + sizeof(Char)); + copyn(items[numitems], entry, MAXNAMLEN); + numitems++; + } + else { /* RECOGNIZE command */ + if (ignoring && ignored(entry)) + nignored++; + else if (recognize(extended_name, + entry, name_length, ++numitems)) + break; + } + } + if (ignoring && numitems == 0 && nignored > 0) { + ignoring = FALSE; + nignored = 0; + if (look_lognames) + (void) setpwent(); + else + rewinddir(dir_fd); + goto again; + } + + if (look_lognames) + (void) endpwent(); + else + (void) closedir(dir_fd); + if (numitems == 0) + return (0); + if (command == RECOGNIZE) { + if (look_lognames) + copyn(word, STRtilde, 1); + else + /* put back dir part */ + copyn(word, dir, max_word_length); + /* add extended name */ + catn(word, extended_name, max_word_length); + return (numitems); + } + else { /* LIST */ + qsort((ptr_t) items, numitems, sizeof(items[0]), sortscmp); + print_by_column(look_lognames ? NULL : tilded_dir, + items, numitems); + if (items != NULL) + FREE_ITEMS(items); + } + return (0); +} + +/* + * Object: extend what user typed up to an ambiguity. + * Algorithm: + * On first match, copy full entry (assume it'll be the only match) + * On subsequent matches, shorten extended_name to the first + * Character mismatch between extended_name and entry. + * If we shorten it back to the prefix length, stop searching. + */ +static int +recognize(extended_name, entry, name_length, numitems) + Char *extended_name, *entry; + int name_length, numitems; +{ + if (numitems == 1) /* 1st match */ + copyn(extended_name, entry, MAXNAMLEN); + else { /* 2nd & subsequent matches */ + register Char *x, *ent; + register int len = 0; + + x = extended_name; + for (ent = entry; *x && *x == *ent++; x++, len++); + *x = '\0'; /* Shorten at 1st Char diff */ + if (len == name_length) /* Ambiguous to prefix? */ + return (-1); /* So stop now and save time */ + } + return (0); +} + +/* + * Return true if check matches initial Chars in template. + * This differs from PWB imatch in that if check is null + * it matches anything. + */ +static int +is_prefix(check, template) + register Char *check, *template; +{ + do + if (*check == 0) + return (TRUE); + while (*check++ == *template++); + return (FALSE); +} + +/* + * Return true if the Chars in template appear at the + * end of check, I.e., are it's suffix. + */ +static int +is_suffix(check, template) + Char *check, *template; +{ + register Char *c, *t; + + for (c = check; *c++;); + for (t = template; *t++;); + for (;;) { + if (t == template) + return 1; + if (c == check || *--t != *--c) + return 0; + } +} + +int +tenex(in_line, in_li_size) + Char *in_line; + int in_li_size; +{ + register int numitems, num_read; + char tin_line[BUFSIZ]; + + + setup_tty(ON); + + while ((num_read = read(SHIN, tin_line, BUFSIZ)) > 0) { + int i; + static Char delims[] = {' ', '\'', '"', '\t', ';', '&', '<', + '>', '(', ')', '|', '^', '%', '\0'}; + register Char *str_end, *word_start, last_Char, should_retype; + register int space_left; + COMMAND command; + + for (i = 0; i < num_read; i++) + in_line[i] = (unsigned char) tin_line[i]; + last_Char = in_line[num_read - 1] & ASCII; + + if (last_Char == '\n' || num_read == in_li_size) + break; + command = (last_Char == ESC) ? RECOGNIZE : LIST; + if (command == LIST) + xputchar('\n'); + str_end = &in_line[num_read]; + if (last_Char == ESC) + --str_end; /* wipeout trailing cmd Char */ + *str_end = '\0'; + /* + * Find LAST occurence of a delimiter in the in_line. The word start + * is one Character past it. + */ + for (word_start = str_end; word_start > in_line; --word_start) + if (Strchr(delims, word_start[-1])) + break; + space_left = in_li_size - (word_start - in_line) - 1; + numitems = tsearch(word_start, command, space_left); + + if (command == RECOGNIZE) { + /* print from str_end on */ + print_recog_stuff(str_end); + if (numitems != 1) /* Beep = No match/ambiguous */ + beep(); + } + + /* + * Tabs in the input line cause trouble after a pushback. tty driver + * won't backspace over them because column positions are now + * incorrect. This is solved by retyping over current line. + */ + should_retype = FALSE; + if (Strchr(in_line, '\t')) { /* tab Char in input line? */ + back_to_col_1(); + should_retype = TRUE; + } + if (command == LIST) /* Always retype after a LIST */ + should_retype = TRUE; + if (should_retype) + printprompt(); + pushback(in_line); + if (should_retype) + retype(); + } + setup_tty(OFF); + return (num_read); +} + +static int +ignored(entry) + register Char *entry; +{ + struct varent *vp; + register Char **cp; + + if ((vp = adrof(STRfignore)) == NULL || (cp = vp->vec) == NULL) + return (FALSE); + for (; *cp != NULL; cp++) + if (is_suffix(entry, *cp)) + return (TRUE); + return (FALSE); +} +#endif /* FILEC */ diff --git a/bin/tcsh/sh.func.c b/bin/tcsh/sh.func.c new file mode 100644 index 0000000..a5ac868 --- /dev/null +++ b/bin/tcsh/sh.func.c @@ -0,0 +1,1733 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/sh.func.c,v 3.1 1991/07/05 19:07:02 christos Exp $ */ +/* + * sh.func.c: csh builtin functions + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#include "config.h" + +#if !defined(lint) && !defined(pdp11) +static char *rcsid() + { return "$Id: sh.func.c,v 3.1 1991/07/05 19:07:02 christos Exp $"; } +#endif + +#include "sh.h" +#include "ed.h" +#include "tw.h" + +/* + * C shell + */ + +extern int just_signaled; +extern char **environ; + +extern bool MapsAreInited; +extern bool NLSMapsAreInited; +extern bool NoNLSRebind; + +static int zlast = -1; + +static void islogin __P((void)); +static void reexecute __P((struct command *)); +static void preread __P((void)); +static void doagain __P((void)); +static int getword __P((Char *)); +static int keyword __P((Char *)); +static void Unsetenv __P((Char *)); +static void toend __P((void)); +static void xecho __P((int, Char **)); + +struct biltins * +isbfunc(t) + struct command *t; +{ + register Char *cp = t->t_dcom[0]; + register struct biltins *bp, *bp1, *bp2; + static struct biltins label = {"", dozip, 0, 0}; + static struct biltins foregnd = {"%job", dofg1, 0, 0}; + static struct biltins backgnd = {"%job &", dobg1, 0, 0}; + + if (lastchr(cp) == ':') { + label.bname = short2str(cp); + return (&label); + } + if (*cp == '%') { + if (t->t_dflg & F_AMPERSAND) { + t->t_dflg &= ~F_AMPERSAND; + backgnd.bname = short2str(cp); + return (&backgnd); + } + foregnd.bname = short2str(cp); + return (&foregnd); + } +#ifdef WARP + /* + * This is a perhaps kludgy way to determine if the warp builtin is to be + * acknowledged or not. If checkwarp() fails, then we are to assume that + * the warp command is invalid, and carry on as we would handle any other + * non-builtin command. -- JDK 2/4/88 + */ + if (eq(STRwarp, cp) && !checkwarp()) { + return (0); /* this builtin disabled */ + } +#endif + /* + * Binary search Bp1 is the beginning of the current search range. Bp2 is + * one past the end. + */ + for (bp1 = bfunc, bp2 = bfunc + nbfunc; bp1 < bp2;) { + register i; + + bp = bp1 + ((bp2 - bp1) >> 1); + if ((i = *cp - *bp->bname) == 0 && + (i = Strcmp(cp, str2short(bp->bname))) == 0) + return bp; + if (i < 0) + bp2 = bp; + else + bp1 = bp + 1; + } + return (0); +} + +void +func(t, bp) + register struct command *t; + register struct biltins *bp; +{ + int i; + + xechoit(t->t_dcom); + setname(bp->bname); + i = blklen(t->t_dcom) - 1; + if (i < bp->minargs) + stderror(ERR_NAME | ERR_TOOFEW); + if (i > bp->maxargs) + stderror(ERR_NAME | ERR_TOOMANY); + (*bp->bfunct) (t->t_dcom, t); +} + +void +doonintr(v) + Char **v; +{ + register Char *cp; + register Char *vv = v[1]; + + if (parintr == SIG_IGN) + return; + if (setintr && intty) + stderror(ERR_NAME | ERR_TERMINAL); + cp = gointr; + gointr = 0; + xfree((ptr_t) cp); + if (vv == 0) { +#ifdef BSDSIGS + if (setintr) + (void) sigblock(sigmask(SIGINT)); + else + (void) signal(SIGINT, SIG_DFL); +#else + if (setintr) + (void) sighold(SIGINT); + else + (void) sigset(SIGINT, SIG_DFL); +#endif + gointr = 0; + } + else if (eq((vv = strip(vv)), STRminus)) { +#ifdef BSDSIGS + (void) signal(SIGINT, SIG_IGN); +#else + (void) sigset(SIGINT, SIG_IGN); +#endif + gointr = Strsave(STRminus); + } + else { + gointr = Strsave(vv); +#ifdef BSDSIGS + (void) signal(SIGINT, pintr); +#else + (void) sigset(SIGINT, pintr); +#endif + } +} + +void +donohup() +{ + if (intty) + stderror(ERR_NAME | ERR_TERMINAL); + if (setintr == 0) { + (void) signal(SIGHUP, SIG_IGN); +#ifdef CC + submit(getpid()); +#endif + } +} + +void +dozip() +{ + ; +} + +void +prvars() +{ + plist(&shvhed); +} + +void +doalias(v) + register Char **v; +{ + register struct varent *vp; + register Char *p; + + v++; + p = *v++; + if (p == 0) + plist(&aliases); + else if (*v == 0) { + vp = adrof1(strip(p), &aliases); + if (vp) + blkpr(vp->vec), xprintf("\n"); + } + else { + if (eq(p, STRalias) || eq(p, STRunalias)) { + setname(short2str(p)); + stderror(ERR_NAME | ERR_DANGER); + } + set1(strip(p), saveblk(v), &aliases); + tw_clear_comm_list(); + } +} + +void +unalias(v) + Char **v; +{ + unset1(v, &aliases); + tw_clear_comm_list(); +} + +void +dologout() +{ + islogin(); + goodbye(); +} + +void +dologin(v) + Char **v; +{ + islogin(); + rechist(); + (void) signal(SIGTERM, parterm); + (void) execl(_PATH_LOGIN, "login", short2str(v[1]), NULL); + untty(); + xexit(1); +} + + +#ifdef NEWGRP +void +donewgrp(v) + Char **v; +{ + if (chkstop == 0 && setintr) + panystop(0); + (void) signal(SIGTERM, parterm); + (void) execl(_PATH_BIN_NEWGRP, "newgrp", short2str(v[1]), NULL); + (void) execl(_PATH_USRBIN_NEWGRP, "newgrp", short2str(v[1]), NULL); + untty(); + xexit(1); +} +#endif + +static void +islogin() +{ + if (chkstop == 0 && setintr) + panystop(0); + if (loginsh) + return; + stderror(ERR_NOTLOGIN); +} + +void +doif(v, kp) + Char **v; + struct command *kp; +{ + register int i; + register Char **vv; + + v++; + i = exp(&v); + vv = v; + if (*vv == NOSTR) + stderror(ERR_NAME | ERR_EMPTYIF); + if (eq(*vv, STRthen)) { + if (*++vv) + stderror(ERR_NAME | ERR_IMPRTHEN); + setname(short2str(STRthen)); + /* + * If expression was zero, then scan to else, otherwise just fall into + * following code. + */ + if (!i) + search(T_IF, 0, NOSTR); + return; + } + /* + * Simple command attached to this if. Left shift the node in this tree, + * munging it so we can reexecute it. + */ + if (i) { + lshift(kp->t_dcom, vv - kp->t_dcom); + reexecute(kp); + donefds(); + } +} + +/* + * Reexecute a command, being careful not + * to redo i/o redirection, which is already set up. + */ +static void +reexecute(kp) + register struct command *kp; +{ + kp->t_dflg &= F_SAVE; + kp->t_dflg |= F_REPEAT; + /* + * If tty is still ours to arbitrate, arbitrate it; otherwise dont even set + * pgrp's as the jobs would then have no way to get the tty (we can't give + * it to them, and our parent wouldn't know their pgrp, etc. + */ + execute(kp, (tpgrp > 0 ? tpgrp : -1), NULL, NULL); +} + +void +doelse() +{ + search(T_ELSE, 0, NOSTR); +} + +void +dogoto(v) + Char **v; +{ + register struct whyle *wp; + Char *lp; + + /* + * While we still can, locate any unknown ends of existing loops. This + * obscure code is the WORST result of the fact that we don't really parse. + */ + zlast = T_GOTO; + for (wp = whyles; wp; wp = wp->w_next) + if (wp->w_end == 0) { + search(T_BREAK, 0, NOSTR); + wp->w_end = btell(); + } + else + bseek(wp->w_end); + search(T_GOTO, 0, lp = globone(v[1], G_ERROR)); + xfree((ptr_t) lp); + /* + * Eliminate loops which were exited. + */ + wfree(); +} + +void +doswitch(v) + register Char **v; +{ + register Char *cp, *lp; + + v++; + if (!*v || *(*v++) != '(') + stderror(ERR_SYNTAX); + cp = **v == ')' ? STRNULL : *v++; + if (*(*v++) != ')') + v--; + if (*v) + stderror(ERR_SYNTAX); + search(T_SWITCH, 0, lp = globone(cp, G_ERROR)); + xfree((ptr_t) lp); +} + +void +dobreak() +{ + if (whyles) + toend(); + else + stderror(ERR_NAME | ERR_NOTWHILE); +} + +void +doexit(v) + Char **v; +{ + if (chkstop == 0 && (intty || intact) && evalvec == 0) + panystop(0); + /* + * Don't DEMAND parentheses here either. + */ + v++; + if (*v) { + set(STRstatus, putn(exp(&v))); + if (*v) + stderror(ERR_NAME | ERR_EXPRESSION); + } + btoeof(); + if (intty) + (void) close(SHIN); +} + +void +doforeach(v) + register Char **v; +{ + register Char *cp, *sp; + register struct whyle *nwp; + + v++; + sp = cp = strip(*v); + if (!letter(*sp)) + stderror(ERR_NAME | ERR_VARBEGIN); + while (*cp && alnum(*cp)) + cp++; + if (*cp) + stderror(ERR_NAME | ERR_VARALNUM); + if ((cp - sp) > MAXVARLEN) + stderror(ERR_NAME | ERR_VARTOOLONG); + cp = *v++; + if (v[0][0] != '(' || v[blklen(v) - 1][0] != ')') + stderror(ERR_NAME | ERR_NOPAREN); + v++; + gflag = 0, tglob(v); + v = globall(v); + if (v == 0) + stderror(ERR_NAME | ERR_NOMATCH); + nwp = (struct whyle *) xcalloc(1, sizeof *nwp); + nwp->w_fe = nwp->w_fe0 = v; + gargv = 0; + nwp->w_start = btell(); + nwp->w_fename = Strsave(cp); + nwp->w_next = whyles; + whyles = nwp; + /* + * Pre-read the loop so as to be more comprehensible to a terminal user. + */ + zlast = T_FOREACH; + if (intty) + preread(); + doagain(); +} + +void +dowhile(v) + Char **v; +{ + register int status; + register bool again = whyles != 0 && whyles->w_start == lineloc && + whyles->w_fename == 0; + + v++; + /* + * Implement prereading here also, taking care not to evaluate the + * expression before the loop has been read up from a terminal. + */ + if (intty && !again) + status = !exp0(&v, 1); + else + status = !exp(&v); + if (*v) + stderror(ERR_NAME | ERR_EXPRESSION); + if (!again) { + register struct whyle *nwp = + (struct whyle *) xcalloc(1, sizeof(*nwp)); + + nwp->w_start = lineloc; + nwp->w_end = 0; + nwp->w_next = whyles; + whyles = nwp; + zlast = T_WHILE; + if (intty) { + /* + * The tty preread + */ + preread(); + doagain(); + return; + } + } + if (status) + /* We ain't gonna loop no more, no more! */ + toend(); +} + +static void +preread() +{ + whyles->w_end = -1; + if (setintr) +#ifdef BSDSIGS + (void) sigsetmask(sigblock((sigmask_t) 0) & ~sigmask(SIGINT)); +#else + (void) sigrelse(SIGINT); +#endif + search(T_BREAK, 0, NOSTR); /* read the expression in */ + if (setintr) +#ifdef BSDSIGS + (void) sigblock(sigmask(SIGINT)); +#else + (void) sighold(SIGINT); +#endif + whyles->w_end = btell(); +} + +void +doend() +{ + if (!whyles) + stderror(ERR_NAME | ERR_NOTWHILE); + whyles->w_end = btell(); + doagain(); +} + +void +docontin() +{ + if (!whyles) + stderror(ERR_NAME | ERR_NOTWHILE); + doagain(); +} + +static void +doagain() +{ + /* Repeating a while is simple */ + if (whyles->w_fename == 0) { + bseek(whyles->w_start); + return; + } + /* + * The foreach variable list actually has a spurious word ")" at the end of + * the w_fe list. Thus we are at the of the list if one word beyond this + * is 0. + */ + if (!whyles->w_fe[1]) { + dobreak(); + return; + } + set(whyles->w_fename, Strsave(*whyles->w_fe++)); + bseek(whyles->w_start); +} + +void +dorepeat(v, kp) + Char **v; + struct command *kp; +{ + register int i; + +#ifdef BSDSIGS + sigmask_t omask = 0; + +#endif + + i = getn(v[1]); + if (setintr) +#ifdef BSDSIGS + omask = sigblock(sigmask(SIGINT)) & ~sigmask(SIGINT); +#else + (void) sighold(SIGINT); +#endif + lshift(v, 2); + while (i > 0) { + if (setintr) +#ifdef BSDSIGS + (void) sigsetmask(omask); +#else + (void) sigrelse(SIGINT); +#endif + reexecute(kp); + --i; + } + donefds(); + if (setintr) +#ifdef BSDSIGS + (void) sigsetmask(omask); +#else + (void) sigrelse(SIGINT); +#endif +} + +void +doswbrk() +{ + search(T_BRKSW, 0, NOSTR); +} + +int +srchx(cp) + register Char *cp; +{ + register struct srch *sp, *sp1, *sp2; + register i; + + /* + * Binary search Sp1 is the beginning of the current search range. Sp2 is + * one past the end. + */ + for (sp1 = srchn, sp2 = srchn + nsrchn; sp1 < sp2;) { + sp = sp1 + ((sp2 - sp1) >> 1); + if ((i = *cp - *sp->s_name) == 0 && + (i = Strcmp(cp, str2short(sp->s_name))) == 0) + return sp->s_value; + if (i < 0) + sp2 = sp; + else + sp1 = sp + 1; + } + return (-1); +} + +static char * +isrchx(n) + register int n; +{ + register struct srch *sp, *sp2; + + for (sp = srchn, sp2 = srchn + nsrchn; sp < sp2; sp++) + if (sp->s_value == n) + return (sp->s_name); + return (""); +} + + +static Char Stype; +static Char *Sgoal; + +/*VARARGS2*/ +void +search(type, level, goal) + int type; + register int level; + Char *goal; +{ + Char wordbuf[BUFSIZ]; + register Char *aword = wordbuf; + register Char *cp; + + Stype = type; + Sgoal = goal; + if (type == T_GOTO) + bseek((off_t) 0); + do { + if (intty && fseekp == feobp) + printprompt(1, str2short(isrchx(type == T_BREAK ? + zlast : type))); + /* xprintf("? "), flush(); */ + aword[0] = 0; + (void) getword(aword); + switch (srchx(aword)) { + + case T_ELSE: + if (level == 0 && type == T_IF) + return; + break; + + case T_IF: + while (getword(aword)) + continue; + if ((type == T_IF || type == T_ELSE) && + eq(aword, STRthen)) + level++; + break; + + case T_ENDIF: + if (type == T_IF || type == T_ELSE) + level--; + break; + + case T_FOREACH: + case T_WHILE: + if (type == T_BREAK) + level++; + break; + + case T_END: + if (type == T_BREAK) + level--; + break; + + case T_SWITCH: + if (type == T_SWITCH || type == T_BRKSW) + level++; + break; + + case T_ENDSW: + if (type == T_SWITCH || type == T_BRKSW) + level--; + break; + + case T_LABEL: + if (type == T_GOTO && getword(aword) && eq(aword, goal)) + level = -1; + break; + + default: + if (type != T_GOTO && (type != T_SWITCH || level != 0)) + break; + if (lastchr(aword) != ':') + break; + aword[Strlen(aword) - 1] = 0; + if (type == T_GOTO && eq(aword, goal) || + type == T_SWITCH && eq(aword, STRdefault)) + level = -1; + break; + + case T_CASE: + if (type != T_SWITCH || level != 0) + break; + (void) getword(aword); + if (lastchr(aword) == ':') + aword[Strlen(aword) - 1] = 0; + cp = strip(Dfix1(aword)); + if (Gmatch(goal, cp)) + level = -1; + xfree((ptr_t) cp); + break; + + case T_DEFAULT: + if (type == T_SWITCH && level == 0) + level = -1; + break; + } + (void) getword(NOSTR); + } while (level >= 0); +} + +static int +getword(wp) + register Char *wp; +{ + register int found = 0; + register int c, d; + int kwd = 0; + Char *owp = wp; + + c = readc(1); + d = 0; + do { + while (c == ' ' || c == '\t') + c = readc(1); + if (c == '#') + do + c = readc(1); + while (c >= 0 && c != '\n'); + if (c < 0) + goto past; + if (c == '\n') { + if (wp) + break; + return (0); + } + unreadc(c); + found = 1; + do { + c = readc(1); + if (c == '\\' && (c = readc(1)) == '\n') + c = ' '; + if (c == '\'' || c == '"') + if (d == 0) + d = c; + else if (d == c) + d = 0; + if (c < 0) + goto past; + if (wp) { + *wp++ = c; + *wp = 0; /* end the string b4 test */ + } + } while ((d || !(kwd = keyword(owp)) && c != ' ' + && c != '\t') && c != '\n'); + } while (wp == 0); + + /* + * if we have read a keyword ( "if", "switch" or "while" ) then we do not + * need to unreadc the look-ahead char + */ + if (!kwd) { + unreadc(c); + if (found) + *--wp = 0; + } + + return (found); + +past: + switch (Stype) { + + case T_IF: + stderror(ERR_NAME | ERR_NOTFOUND, "then/endif"); + + case T_ELSE: + stderror(ERR_NAME | ERR_NOTFOUND, "endif"); + + case T_BRKSW: + case T_SWITCH: + stderror(ERR_NAME | ERR_NOTFOUND, "endsw"); + + case T_BREAK: + stderror(ERR_NAME | ERR_NOTFOUND, "end"); + + case T_GOTO: + setname(short2str(Sgoal)); + stderror(ERR_NAME | ERR_NOTFOUND, "label"); + } + /* NOTREACHED */ + return (0); +} + +/* + * keyword(wp) determines if wp is one of the built-n functions if, + * switch or while. It seems that when an if statement looks like + * "if(" then getword above sucks in the '(' and so the search routine + * never finds what it is scanning for. Rather than rewrite doword, I hack + * in a test to see if the string forms a keyword. Then doword stops + * and returns the word "if" -strike + */ + +static int +keyword(wp) + Char *wp; +{ + static Char STRif[] = {'i', 'f', '\0'}; + static Char STRwhile[] = {'w', 'h', 'i', 'l', 'e', '\0'}; + static Char STRswitch[] = {'s', 'w', 'i', 't', 'c', 'h', '\0'}; + + if (!wp) + return (0); + + if ((Strcmp(wp, STRif) == 0) || (Strcmp(wp, STRwhile) == 0) + || (Strcmp(wp, STRswitch) == 0)) + return (1); + + return (0); +} + +static void +toend() +{ + if (whyles->w_end == 0) { + search(T_BREAK, 0, NOSTR); + whyles->w_end = btell() - 1; + } + else + bseek(whyles->w_end); + wfree(); +} + +void +wfree() +{ + long o = btell(); + + while (whyles) { + register struct whyle *wp = whyles; + register struct whyle *nwp = wp->w_next; + + if (o >= wp->w_start && (wp->w_end == 0 || o < wp->w_end)) + break; + if (wp->w_fe0) + blkfree(wp->w_fe0); + if (wp->w_fename) + xfree((ptr_t) wp->w_fename); + xfree((ptr_t) wp); + whyles = nwp; + } +} + +void +doecho(v) + Char **v; +{ + xecho(' ', v); +} + +void +doglob(v) + Char **v; +{ + xecho(0, v); + flush(); +} + +static void +xecho(sep, v) + Char sep; + register Char **v; +{ + register Char *cp; + int nonl = 0; + + if (setintr) +#ifdef BSDSIGS + (void) sigsetmask(sigblock((sigmask_t) 0) & ~sigmask(SIGINT)); +#else + (void) sigrelse(SIGINT); +#endif + v++; + if (*v == 0) + return; + gflag = 0, tglob(v); + if (gflag) { + v = globall(v); + if (v == 0) + stderror(ERR_NAME | ERR_NOMATCH); + } + else { + v = gargv = saveblk(v); + trim(v); + } + if (sep == ' ' && *v && eq(*v, STRmn)) + nonl++, v++; + while (cp = *v++) { + register int c; + + while (c = *cp++) { +#if SVID > 0 +#ifndef OREO + if (c == '\\') { + switch (c = *cp++) { + case 'b': + c = '\b'; + break; + case 'c': + nonl = 1; + goto done; + case 'f': + c = '\f'; + break; + case 'n': + c = '\n'; + break; + case 'r': + c = '\r'; + break; + case 't': + c = '\t'; + break; + case 'v': + c = '\v'; + break; + case '\\': + c = '\\'; + break; + case '0': + c = 0; + if (*cp >= '0' && *cp < '8') + c = c * 8 + *cp++ - '0'; + if (*cp >= '0' && *cp < '8') + c = c * 8 + *cp++ - '0'; + if (*cp >= '0' && *cp < '8') + c = c * 8 + *cp++ - '0'; + break; + case '\0': + c = *--cp; + break; + default: + xputchar('\\' | QUOTE); + break; + } + } +#endif /* OREO */ +#endif /* SVID > 0 */ + xputchar(c | QUOTE); + + } + if (*v) + xputchar(sep | QUOTE); + } +#if SVID > 0 +#ifndef OREO +done: +#endif /* OREO */ +#endif /* SVID > 0 */ + if (sep && nonl == 0) + xputchar('\n'); + else + flush(); + if (setintr) +#ifdef BSDSIGS + (void) sigblock(sigmask(SIGINT)); +#else + (void) sighold(SIGINT); +#endif + if (gargv) + blkfree(gargv), gargv = 0; +} + +/* from "Karl Berry." -- for NeXT things + (and anything else with a modern comp_r) */ + +void +dosetenv(v) + register Char **v; +{ + Char *vp, *lp; + + v++; + if ((vp = *v++) == 0) { + register Char **ep; + + if (setintr) +#ifdef BSDSIGS + (void) sigsetmask(sigblock((sigmask_t) 0) & ~sigmask(SIGINT)); +#else + (void) sigrelse(SIGINT); +#endif + for (ep = STR_environ; *ep; ep++) + xprintf("%s\n", short2str(*ep)); + return; + } + if ((lp = *v++) == 0) + lp = STRNULL; + Setenv(vp, lp = globone(lp, G_ERROR)); + if (eq(vp, STRPATH)) { + importpath(lp); + dohash(); + } +#ifdef apollo + else if (eq(vp, STRSYSTYPE)) + dohash(); +#endif /* apollo */ + else if (eq(vp, STRLANG) || eq(vp, STRLC_CTYPE)) { +#ifdef NLS + int k; + + (void) setlocale(LC_ALL, ""); + for (k = 0200; k <= 0377 && !Isprint(k); k++); + AsciiOnly = k > 0377; +#else + AsciiOnly = 0; +#endif /* NLS */ + NLSMapsAreInited = 0; + ed_I(); + if (MapsAreInited && !NLSMapsAreInited) + (void) ed_INLSMaps(); + } + else if (eq(vp, STRNOREBIND)) { + NoNLSRebind = 1; + } +#ifdef SIG_WINDOW + else if ((eq(lp, STRNULL) && + (eq(vp, STRLINES) || eq(vp, STRCOLUMNS))) || + eq(vp, STRTRMCAP)) { + check_window_size(1); + } +#endif /* SIG_WINDOW */ + xfree((ptr_t) lp); +} + +void +dounsetenv(v) + register Char **v; +{ + Char **ep, *p, *n; + int i, maxi; + static Char *name = NULL; + + if (name) + xfree((ptr_t) name); + /* + * Find the longest environment variable + */ + for (maxi = 0, ep = STR_environ; *ep; ep++) { + for (i = 0, p = *ep; *p && *p != '='; p++, i++); + if (i > maxi) + maxi = i; + } + + name = (Char *) xmalloc((size_t) (maxi + 1) * sizeof(Char)); + + while (++v && *v) + for (maxi = 1; maxi;) + for (maxi = 0, ep = STR_environ; *ep; ep++) { + for (n = name, p = *ep; *p && *p != '='; *n++ = *p++); + *n = '\0'; + if (!Gmatch(name, *v)) + continue; + maxi = 1; + if (eq(name, STRNOREBIND)) + NoNLSRebind = 0; +#ifdef apollo + else if (eq(name, STRSYSTYPE)) + dohash(); +#endif /* apollo */ + else if (eq(name, STRLANG) || eq(name, STRLC_CTYPE)) { +#ifdef NLS + int k; + + (void) setlocale(LC_ALL, ""); + for (k = 0200; k <= 0377 && !Isprint(k); k++); + AsciiOnly = k > 0377; +#else + AsciiOnly = getenv("LANG") == NULL && + getenv("LC_CTYPE") == NULL; +#endif /* NLS */ + NLSMapsAreInited = 0; + ed_I(); + if (MapsAreInited && !NLSMapsAreInited) + (void) ed_INLSMaps(); + + } + /* + * Delete name, and start again cause the environment changes + */ + Unsetenv(name); + break; + } + xfree((ptr_t) name), name = NULL; +} + +void +Setenv(name, val) + Char *name, *val; +{ +#ifdef SETENV_IN_LIB +#undef setenv + char nameBuf[BUFSIZ]; + char *cname = short2str(name); + + if (cname == NULL) + return; + (void) strcpy(nameBuf, cname); + setenv(nameBuf, short2str(val), 1); +#else + register Char **ep = STR_environ; + register Char *cp, *dp; + Char *blk[2]; + Char **oep = ep; + + + for (; *ep; ep++) { + for (cp = name, dp = *ep; *cp && *cp == *dp; cp++, dp++) + continue; + if (*cp != 0 || *dp != '=') + continue; + cp = Strspl(STRequal, val); + xfree((ptr_t) * ep); + *ep = strip(Strspl(name, cp)); + xfree((ptr_t) cp); + blkfree((Char **) environ); + environ = short2blk(STR_environ); + return; + } + cp = Strspl(name, STRequal); + blk[0] = strip(Strspl(cp, val)); + xfree((ptr_t) cp); + blk[1] = 0; + STR_environ = blkspl(STR_environ, blk); + blkfree((Char **) environ); + environ = short2blk(STR_environ); + xfree((ptr_t) oep); +#endif /* SETENV_IN_LIB */ +} + +static void +Unsetenv(name) + Char *name; +{ + register Char **ep = STR_environ; + register Char *cp, *dp; + Char **oep = ep; + + for (; *ep; ep++) { + for (cp = name, dp = *ep; *cp && *cp == *dp; cp++, dp++) + continue; + if (*cp != 0 || *dp != '=') + continue; + cp = *ep; + *ep = 0; + STR_environ = blkspl(STR_environ, ep + 1); + environ = short2blk(STR_environ); + *ep = cp; + xfree((ptr_t) cp); + xfree((ptr_t) oep); + return; + } +} + +void +doumask(v) + register Char **v; +{ + register Char *cp = v[1]; + register int i; + + if (cp == 0) { + i = umask(0); + (void) umask(i); + xprintf("%o\n", i); + return; + } + i = 0; + while (Isdigit(*cp) && *cp != '8' && *cp != '9') + i = i * 8 + *cp++ - '0'; + if (*cp || i < 0 || i > 0777) + stderror(ERR_NAME | ERR_MASK); + (void) umask(i); +} + +#ifndef BSDTIMES +typedef long RLIM_TYPE; + +#ifndef RLIM_INFINITY +extern RLIM_TYPE ulimit(); + +#define RLIM_INFINITY 0x003fffff +#define RLIMIT_FSIZE 1 +#endif /* RLIM_INFINITY */ +#ifdef aiws +#define toset(a) (((a) == 3) ? 1004 : (a) + 1) +#define RLIMIT_STACK 1005 +#else /* aiws */ +#define toset(a) ((a) + 1) +#endif /* aiws */ +#else /* BSDTIMES */ +typedef int RLIM_TYPE; + +#endif /* BSDTIMES */ + + +static struct limits { + int limconst; + char *limname; + int limdiv; + char *limscale; +} limits[] = { + +#ifdef RLIMIT_CPU + RLIMIT_CPU, "cputime", 1, "seconds", +#endif /* RLIMIT_CPU */ + +#ifdef RLIMIT_FSIZE + RLIMIT_FSIZE, "filesize", 1024, "kbytes", +#endif /* RLIMIT_FSIZE */ + +#ifdef RLIMIT_DATA + RLIMIT_DATA, "datasize", 1024, "kbytes", +#endif /* RLIMIT_DATA */ + +#ifdef RLIMIT_STACK + RLIMIT_STACK, "stacksize", 1024, "kbytes", +#endif /* RLIMIT_STACK */ + +#ifdef RLIMIT_CORE + RLIMIT_CORE, "coredumpsize", 1024, "kbytes", +#endif /* RLIMIT_CORE */ + +#ifdef RLIMIT_RSS + RLIMIT_RSS, "memoryuse", 1024, "kbytes", +#endif /* RLIMIT_RSS */ + +#ifdef RLIMIT_NOFILE + RLIMIT_NOFILE, "descriptors", 1, "", +#endif + +#ifdef RLIMIT_CONCUR + RLIMIT_CONCUR, "concurrency", 1, "thread(s)", +#endif + +#ifdef RLIMIT_MEMLOCK + RLIMIT_MEMLOCK, "memorylocked", 1024, "kbytes", +#endif + +#ifdef RLIMIT_NPROC + RLIMIT_NPROC, "maxproc", 1, "", +#endif + +#ifdef RLIMIT_OFILE + RLIMIT_OFILE, "openfiles", 1, "", +#endif + + -1, NULL, 0, NULL +}; + +static struct limits *findlim(); +static RLIM_TYPE getval(); +static void limtail(); +static void plim(); +static int setlim(); + +#if defined(convex) || defined(__convex__) +static RLIM_TYPE +restrict_limit(value) + double value; +{ + /* + * is f too large to cope with? return the maximum or minimum int + */ + if (value > (double) INT_MAX) + return (INT_MAX); + else if (value < (double) INT_MIN) + return (INT_MIN); + else + return ((int) value); +} +#endif /* convex */ + + +static struct limits * +findlim(cp) + Char *cp; +{ + register struct limits *lp, *res; + + res = (struct limits *) NULL; + for (lp = limits; lp->limconst >= 0; lp++) + if (prefix(cp, str2short(lp->limname))) { + if (res) + stderror(ERR_NAME | ERR_AMBIG); + res = lp; + } + if (res) + return (res); + stderror(ERR_NAME | ERR_LIMIT); + /* NOTREACHED */ + return (0); +} + +void +dolimit(v) + register Char **v; +{ + register struct limits *lp; + register RLIM_TYPE limit; + char hard = 0; + + v++; + if (*v && eq(*v, STRmh)) { + hard = 1; + v++; + } + if (*v == 0) { + for (lp = limits; lp->limconst >= 0; lp++) + plim(lp, hard); + return; + } + lp = findlim(v[0]); + if (v[1] == 0) { + plim(lp, hard); + return; + } + limit = getval(lp, v + 1); + if (setlim(lp, hard, limit) < 0) + stderror(ERR_SILENT); +} + +static RLIM_TYPE +getval(lp, v) + register struct limits *lp; + Char **v; +{ +#if defined(convex) || defined(__convex__) + RLIM_TYPE restrict_limit(); +#endif /* convex */ + + register float f; + double atof(); + Char *cp = *v++; + + f = atof(short2str(cp)); + +#if defined(convex)||defined(__convex__) + /* + * is f too large to cope with. limit f to minint, maxint - X-6768 by + * strike + */ + if ((f < (double) INT_MIN) || (f > (double) INT_MAX)) { + stderror(ERR_NAME | ERR_TOOLARGE); + } +#endif /* convex */ + + while (Isdigit(*cp) || *cp == '.' || *cp == 'e' || *cp == 'E') + cp++; + if (*cp == 0) { + if (*v == 0) +#if defined(convex) || defined(__convex__) + return ((RLIM_TYPE) restrict_limit((f + 0.5) * lp->limdiv)); +#else /* convex */ + return ((RLIM_TYPE) ((f + 0.5) * lp->limdiv)); +#endif /* convex */ + cp = *v; + } + switch (*cp) { +#ifdef RLIMIT_CPU + case ':': + if (lp->limconst != RLIMIT_CPU) + goto badscal; +#if defined(convex) || defined(__convex__) + return ((RLIM_TYPE) + restrict_limit((f * 60.0 + atof(short2str(cp + 1))))); +#else /* convex */ + return ((RLIM_TYPE) (f * 60.0 + atof(short2str(cp + 1)))); +#endif /* convex */ + case 'h': + if (lp->limconst != RLIMIT_CPU) + goto badscal; + limtail(cp, "hours"); + f *= 3600.0; + break; + case 'm': + if (lp->limconst == RLIMIT_CPU) { + limtail(cp, "minutes"); + f *= 60.0; + break; + } + *cp = 'm'; + limtail(cp, "megabytes"); + f *= 1024.0 * 1024.0; + break; + case 's': + if (lp->limconst != RLIMIT_CPU) + goto badscal; + limtail(cp, "seconds"); + break; +#endif /* RLIMIT_CPU */ + case 'M': +#ifdef RLIMIT_CPU + if (lp->limconst == RLIMIT_CPU) + goto badscal; +#endif /* RLIMIT_CPU */ + *cp = 'm'; + limtail(cp, "megabytes"); + f *= 1024.0 * 1024.0; + break; + case 'k': +#ifdef RLIMIT_CPU + if (lp->limconst == RLIMIT_CPU) + goto badscal; +#endif /* RLIMIT_CPU */ + limtail(cp, "kbytes"); + f *= 1024.0; + break; + case 'u': + limtail(cp, "unlimited"); + return (RLIM_INFINITY); + default: +#ifdef RLIMIT_CPU +badscal: +#endif /* RLIMIT_CPU */ + stderror(ERR_NAME | ERR_SCALEF); + } +#if defined(convex) || defined(__convex__) + return ((RLIM_TYPE) restrict_limit((f + 0.5))); +#else + return ((RLIM_TYPE) (f + 0.5)); +#endif +} + +static void +limtail(cp, str) + Char *cp; + char *str; +{ + while (*cp && *cp == *str) + cp++, str++; + if (*cp) + stderror(ERR_BADSCALE, str); +} + + +/*ARGSUSED*/ +static void +plim(lp, hard) + register struct limits *lp; + Char hard; +{ +#ifdef BSDTIMES + struct rlimit rlim; + +#endif /* BSDTIMES */ + RLIM_TYPE limit; + + xprintf("%s \t", lp->limname); + +#ifndef BSDTIMES + limit = ulimit(lp->limconst, 0); +#else /* BSDTIMES */ + (void) getrlimit(lp->limconst, &rlim); + limit = hard ? rlim.rlim_max : rlim.rlim_cur; +#endif /* BSDTIMES */ + + if (limit == RLIM_INFINITY) + xprintf("unlimited"); +#ifdef RLIMIT_CPU + else if (lp->limconst == RLIMIT_CPU) + psecs((long) limit); +#endif /* RLIMIT_CPU */ + else +#ifndef BSDTIMES + if (lp->limconst == RLIMIT_FSIZE) + /* + * Christos: filesize comes in 512 blocks. we divide by 2 to get 1024 + * blocks. Note we cannot pre-multiply cause we might overflow (A/UX) + */ + xprintf("%ld %s", (long) (limit / 2), lp->limscale); + else +#endif /* BSDTIMES */ + xprintf("%ld %s", (long) (limit / lp->limdiv), lp->limscale); + xprintf("\n"); +} + +void +dounlimit(v) + register Char **v; +{ + register struct limits *lp; + int lerr = 0; + Char hard = 0; + + v++; + if (*v && eq(*v, STRmh)) { + hard = 1; + v++; + } + if (*v == 0) { + for (lp = limits; lp->limconst >= 0; lp++) + if (setlim(lp, hard, (RLIM_TYPE) RLIM_INFINITY) < 0) + lerr++; + if (lerr) + stderror(ERR_SILENT); + return; + } + while (*v) { + lp = findlim(*v++); + if (setlim(lp, hard, (RLIM_TYPE) RLIM_INFINITY) < 0) + stderror(ERR_SILENT); + } +} + +static int +setlim(lp, hard, limit) + register struct limits *lp; + Char hard; + RLIM_TYPE limit; +{ +#ifdef BSDTIMES + struct rlimit rlim; + + (void) getrlimit(lp->limconst, &rlim); + + if (hard) + rlim.rlim_max = limit; + else if (limit == RLIM_INFINITY && geteuid() != 0) + rlim.rlim_cur = rlim.rlim_max; + else + rlim.rlim_cur = limit; + + if (setrlimit(lp->limconst, &rlim) < 0) { +#else /* BSDTIMES */ + if (limit != RLIM_INFINITY && lp->limconst == RLIMIT_FSIZE) + limit /= 512; + if (ulimit(toset(lp->limconst), limit) < 0) { +#endif /* BSDTIMES */ + xprintf("%s: %s: Can't %s%s limit\n", bname, lp->limname, + limit == RLIM_INFINITY ? "remove" : "set", + hard ? " hard" : ""); + return (-1); + } + return (0); +} + +void +dosuspend() +{ + int ctpgrp; + sigmask_t omask; + + sigret_t(*old) (); + + if (loginsh) + stderror(ERR_SUSPLOG); + untty(); + +#ifdef BSDJOBS + old = signal(SIGTSTP, SIG_DFL); +#ifndef pdp11 + (void) kill(0, SIGTSTP); +#else + (void) kill(0, SIGSTOP); /* jpn: TSTP doesn't do anything. why? */ +#endif + /* the shell stops here */ + (void) signal(SIGTSTP, old); +#else + stderror(ERR_JOBCONTROL); +#endif /* BSDJOBS */ + +#ifdef BSDJOBS + if (tpgrp != -1) { +retry: + ctpgrp = tcgetpgrp(FSHTTY); + if (ctpgrp != opgrp) { + old = signal(SIGTTIN, SIG_DFL); + (void) kill(0, SIGTTIN); + (void) signal(SIGTTIN, old); + goto retry; + } + (void) setpgid(0, shpgrp); + (void) tcsetpgrp(FSHTTY, shpgrp); + } +#endif /* BSDJOBS */ + (void) setdisc(FSHTTY); +} + +/* This is the dreaded EVAL built-in. + * If you don't fiddle with file descriptors, and reset didfds, + * this command will either ignore redirection inside or outside + * its aguments, e.g. eval "date >x" vs. eval "date" >x + * The stuff here seems to work, but I did it by trial and error rather + * than really knowing what was going on. If tpgrp is zero, we are + * probably a background eval, e.g. "eval date &", and we want to + * make sure that any processes we start stay in our pgrp. + * This is also the case for "time eval date" -- stay in same pgrp. + * Otherwise, under stty tostop, processes will stop in the wrong + * pgrp, with no way for the shell to get them going again. -IAN! + */ +static Char **gv = NULL; +void +doeval(v) + Char **v; +{ + Char **oevalvec; + Char *oevalp; + int odidfds; + +#ifndef FIOCLEX + int odidcch; + +#endif /* FIOCLEX */ + jmp_buf osetexit; + int my_reenter; + Char **savegv; + int saveIN; + int saveOUT; + int saveDIAG; + int oSHIN; + int oSHOUT; + int oSHDIAG; + + oevalvec = evalvec; + oevalp = evalp; + odidfds = didfds; +#ifndef FIOCLEX + odidcch = didcch; +#endif /* FIOCLEX */ + oSHIN = SHIN; + oSHOUT = SHOUT; + oSHDIAG = SHDIAG; + + savegv = gv; + + v++; + if (*v == 0) + return; + gflag = 0, tglob(v); + if (gflag) { + gv = v = globall(v); + gargv = 0; + if (v == 0) + stderror(ERR_NOMATCH); + v = copyblk(v); + } + else { + gv = NULL; + v = copyblk(v); + trim(v); + } + + saveIN = dcopy(SHIN, -1); + saveOUT = dcopy(SHOUT, -1); + saveDIAG = dcopy(SHDIAG, -1); + + getexit(osetexit); + + /* PWP: setjmp/longjmp bugfix for optimizing comp_rs */ + if ((my_reenter = setexit()) == 0) { + evalvec = v; + evalp = 0; + SHIN = dcopy(0, -1); + SHOUT = dcopy(1, -1); + SHDIAG = dcopy(2, -1); +#ifndef FIOCLEX + didcch = 0; +#endif /* FIOCLEX */ + didfds = 0; + process(0); + } + + evalvec = oevalvec; + evalp = oevalp; + doneinp = 0; +#ifndef FIOCLEX + didcch = odidcch; +#endif /* FIOCLEX */ + didfds = odidfds; + (void) close(SHIN); + (void) close(SHOUT); + (void) close(SHDIAG); + SHIN = dmove(saveIN, oSHIN); + SHOUT = dmove(saveOUT, oSHOUT); + SHDIAG = dmove(saveDIAG, oSHDIAG); + + if (gv) + blkfree(gv); + + gv = savegv; + resexit(osetexit); + if (my_reenter) + stderror(ERR_SILENT); +} diff --git a/bin/tcsh/sh.glob.c b/bin/tcsh/sh.glob.c new file mode 100644 index 0000000..cbb3419 --- /dev/null +++ b/bin/tcsh/sh.glob.c @@ -0,0 +1,897 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/sh.glob.c,v 3.0 1991/07/04 21:49:28 christos Exp $ */ +/* + * sh.glob.c: Regular expression expansion + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#include "config.h" +#if !defined(lint) && !defined(pdp11) +static char *rcsid() + { return "$Id: sh.glob.c,v 3.0 1991/07/04 21:49:28 christos Exp $"; } +#endif + +#include "sh.h" +#include + +static int noglob, nonomatch; +static int pargsiz, gargsiz; + +/* + * Values for gflag + */ +#define G_NONE 0 /* No globbing needed */ +#define G_GLOB 1 /* string contains *?[] characters */ +#define G_CSH 2 /* string contains ~`{ characters */ + +#define GLOBSPACE 100 /* Alloc increment */ + +#define LBRC '{' +#define RBRC '}' +#define LBRK '[' +#define RBRK ']' +#define EOS '\0' + +Char **gargv = NULL; +Char **pargv = NULL; +#ifdef notdef +int gargc = 0; +int pargc = 0; +#else +long gargc = 0; +long pargc = 0; +#endif /* pdp11 */ + +/* + * globbing is now done in two stages. In the first pass we expand + * csh globbing idioms ~`{ and then we proceed doing the normal + * globbing if needed ?*[ + * + * Csh type globbing is handled in globexpand() and the rest is + * handled in glob() which is part of the 4.4BSD libc. + * + */ +static Char *globtilde __P((Char **, Char *)); +static Char *globequal __P((Char **, Char *)); +static Char **libglob __P((Char **)); +static Char **globexpand __P((Char **)); +static int globbrace __P((Char *, Char *, Char ***)); +static void pword __P((void)); +static void psave __P((int)); +static void backeval __P((Char *, bool)); + +static Char * +globtilde(nv, s) + Char **nv, *s; +{ + Char gbuf[MAXPATHLEN], *gstart, *b, *u, *e; +#ifdef apollo + int slash; +#endif + + gstart = gbuf; + *gstart++ = *s++; + u = s; + for (b = gstart, e = &gbuf[MAXPATHLEN - 1]; *s && *s != '/' && b < e; + *b++ = *s++); + *b = EOS; + if (gethdir(gstart)) { + blkfree(nv); + if (*gstart) + stderror(ERR_UNKUSER, short2str(gstart)); + else + stderror(ERR_NOHOME); + } + b = &gstart[Strlen(gstart)]; +#ifdef apollo + slash = gstart[0] == '/' && gstart[1] == '\0'; +#endif + while (*s) + *b++ = *s++; + *b = EOS; + --u; + xfree((ptr_t) u); +#ifdef apollo + if (slash && gstart[1] == '/') + gstart++; +#endif + return (Strsave(gstart)); +} + +static Char * +globequal(nv, s) + Char **nv, *s; +{ + int dig; + Char gp[MAXPATHLEN], *b, *d; + + /* + * kfk - 17 Jan 1984 - stack hack allows user to get at arbitrary dir names + * in stack. PWP: let =foobar pass through (for X windows) + */ + if ((Isdigit(s[1]) || s[1] == '-') && (s[2] == '\0' || s[2] == '/')) { + dig = (s[1] == '-') ? -1 : s[1] - '0'; + if (!getstakd(gp, dig)) { + blkfree(nv); + stderror(ERR_DEEP); + } + for (b = &s[2], d = &gp[Strlen(gp)]; *d++ = *b++;); + xfree((ptr_t) s); + return (Strsave(gp)); + } + else + return (s); +} + +static int +globbrace(s, p, bl) + Char *s, *p, ***bl; +{ + int i, len; + Char *pm, *pe, *lm, *pl; + Char **nv, **vl; + Char gbuf[MAXPATHLEN]; + int size = GLOBSPACE; + + nv = vl = (Char **) xmalloc((size_t) sizeof(Char *) * size); + *vl = NULL; + + len = 0; + /* copy part up to the brace */ + for (lm = gbuf, p = s; *p != LBRC; *lm++ = *p++) + continue; + + /* check for balanced braces */ + for (i = 0, pe = ++p; *pe; pe++) + if (*pe == LBRK) { + /* Ignore everything between [] */ + for (++pe; *pe != RBRK && *pe != EOS; pe++) + continue; + if (*pe == EOS) { + blkfree(nv); + return (-RBRK); + } + } + else if (*pe == LBRC) + i++; + else if (*pe == RBRC) { + if (i == 0) + break; + i--; + } + + if (i != 0 || *pe == '\0') { + blkfree(nv); + return (-RBRC); + } + + for (i = 0, pl = pm = p; pm <= pe; pm++) + switch (*pm) { + case LBRK: + for (++pm; *pm != RBRK && *pm != EOS; pm++) + continue; + if (*pm == EOS) { + *vl = NULL; + blkfree(nv); + return (-RBRK); + } + break; + case LBRC: + i++; + break; + case RBRC: + if (i) { + i--; + break; + } + /* FALLTHROUGH */ + case ',': + if (i && *pm == ',') + break; + else { + Char savec = *pm; + + *pm = EOS; + (void) Strcpy(lm, pl); + (void) Strcat(gbuf, pe + 1); + *pm = savec; + *vl++ = Strsave(gbuf); + len++; + pl = pm + 1; + if (vl == &nv[size]) { + size += GLOBSPACE; + nv = (Char **) xrealloc((ptr_t) nv, (size_t) + size * sizeof(Char *)); + vl = &nv[size - GLOBSPACE]; + } + } + break; + } + *vl = NULL; + *bl = nv; + return (len); +} + +static Char ** +globexpand(v) + Char **v; +{ + Char *s; + Char **nv, **vl, **el; + int size = GLOBSPACE; + + + nv = vl = (Char **) xmalloc((size_t) sizeof(Char *) * size); + *vl = NULL; + + /* + * Step 1: expand backquotes. + */ + while (s = *v++) { + if (Strchr(s, '`')) { + int i; + + (void) dobackp(s, 0); + for (i = 0; i < (int)pargc; i++) { + *vl++ = pargv[i]; + if (vl == &nv[size]) { + size += GLOBSPACE; + nv = (Char **) xrealloc((ptr_t) nv, + (size_t) size * sizeof(Char *)); + vl = &nv[size - GLOBSPACE]; + } + } + xfree((ptr_t) pargv); + pargv = NULL; + } + else { + *vl++ = Strsave(s); + if (vl == &nv[size]) { + size += GLOBSPACE; + nv = (Char **) xrealloc((ptr_t) nv, (size_t) + size * sizeof(Char *)); + vl = &nv[size - GLOBSPACE]; + } + } + } + *vl = NULL; + + if (noglob) + return (nv); + + /* + * Step 2: expand braces + */ + el = vl; + vl = nv; + for (s = *vl; s; s = *++vl) { + Char *b; + Char **vp, **bp; + + if (b = Strchr(s, LBRC)) { + Char **bl; + int len; + + if ((len = globbrace(s, b, &bl)) < 0) { + blkfree(nv); + stderror(ERR_MISSING, -len); + } + xfree((ptr_t) s); + if (len == 1) { + *vl-- = *bl; + xfree((ptr_t) bl); + continue; + } + len = blklen(bl); + if (&el[len] >= &nv[size]) { + int l, e; + + l = &el[len] - &nv[size]; + size += GLOBSPACE > l ? GLOBSPACE : l; + l = vl - nv; + e = el - nv; + nv = (Char **) xrealloc((ptr_t) nv, (size_t) + size * sizeof(Char *)); + vl = nv + l; + el = nv + e; + } + vp = vl--; + *vp = *bl; + len--; + for (bp = el; bp != vp; bp--) + bp[len] = *bp; + el += len; + vp++; + for (bp = bl + 1; *bp; *vp++ = *bp++) + continue; + xfree((ptr_t) bl); + } + + } + + /* + * Step 3: expand ~ = + */ + vl = nv; + for (s = *vl; s; s = *++vl) + switch (*s) { + case '~': + *vl = globtilde(nv, s); + break; + case '=': + *vl = globequal(nv, s); + break; + default: + break; + } + vl = nv; + return (vl); +} + +static Char * +handleone(str, vl, action) + Char *str, **vl; + int action; +{ + + Char *cp, **vlp = vl; + + switch (action) { + case G_ERROR: + setname(short2str(str)); + blkfree(vl); + stderror(ERR_NAME | ERR_AMBIG); + break; + case G_APPEND: + trim(vlp); + str = Strsave(*vlp++); + do { + cp = Strspl(str, STRspace); + xfree((ptr_t) str); + str = Strspl(cp, *vlp); + xfree((ptr_t) cp); + } + while (*++vlp); + blkfree(vl); + break; + case G_IGNORE: + str = Strsave(strip(*vlp)); + blkfree(vl); + break; + } + return (str); +} + +static Char ** +libglob(vl) + Char **vl; +{ + int gflgs = GLOB_QUOTE | GLOB_NOCHECK | GLOB_ALTNOT; + glob_t globv; + char *ptr; + + globv.gl_offs = 0; + globv.gl_p_v = 0; + globv.gl_p_c = 0; + nonomatch = adrof(STRnonomatch) != 0; + do { + ptr = short2qstr(*vl); + switch (glob(ptr, gflgs, 0, &globv)) { + case GLOB_ABEND: + setname(ptr); + globfree(&globv); + stderror(ERR_NAME | ERR_GLOB); + /* NOTREACHED */ + case GLOB_NOSPACE: + globfree(&globv); + stderror(ERR_NOMEM); + /* NOTREACHED */ + default: + break; + } + if (!nonomatch && (globv.gl_matchc == 0) && + (globv.gl_flags & GLOB_MAGCHAR)) { + globfree(&globv); + return (NULL); + } + gflgs |= GLOB_APPEND; + } + while (*++vl); + vl = blk2short(globv.gl_p_v); + globfree(&globv); + return (vl); +} + +Char * +globone(str, action) + Char *str; + int action; +{ + + Char *v[2], **vl, **vo; + + noglob = adrof(STRnoglob) != 0; + gflag = 0; + v[0] = str; + v[1] = 0; + tglob(v); + if (gflag == G_NONE) + return (strip(Strsave(str))); + + if (gflag & G_CSH) { + /* + * Expand back-quote, tilde and brace + */ + vo = globexpand(v); + if (noglob || (gflag & G_GLOB) == 0) { + if (vo[0] == NULL) { + xfree((ptr_t) vo); + return (Strsave(STRNULL)); + } + if (vo[1] != NULL) + return (handleone(str, vo, action)); + else { + str = strip(vo[0]); + xfree((ptr_t) vo); + return (str); + } + } + } + else if (noglob || (gflag & G_GLOB) == 0) + return (strip(Strsave(str))); + else + vo = v; + + vl = libglob(vo); + if (gflag & G_CSH) + blkfree(vo); + if (vl == NULL) { + setname(short2str(str)); + stderror(ERR_NAME | ERR_NOMATCH); + } + if (vl[0] == NULL) { + xfree((ptr_t) vl); + return (Strsave(STRNULL)); + } + if (vl[1]) + return (handleone(str, vl, action)); + else { + str = strip(*vl); + xfree((ptr_t) vl); + return (str); + } +} + +Char ** +globall(v) + Char **v; +{ + Char **vl, **vo; + + if (!v || !v[0]) { + gargv = saveblk(v); + gargc = blklen(gargv); + return (gargv); + } + + noglob = adrof(STRnoglob) != 0; + + if (gflag & G_CSH) + /* + * Expand back-quote, tilde and brace + */ + vl = vo = globexpand(v); + else + vl = vo = saveblk(v); + + if (!noglob && (gflag & G_GLOB)) { + vl = libglob(vo); + if (gflag & G_CSH) + blkfree(vo); + } + + gargc = vl ? blklen(vl) : 0; + return (gargv = vl); +} + +void +ginit() +{ + gargsiz = GLOBSPACE; + gargv = (Char **) xmalloc((size_t) sizeof(Char *) * gargsiz); + gargv[0] = 0; + gargc = 0; +} + +void +rscan(t, f) + register Char **t; + void (*f) (); +{ + register Char *p; + + while (p = *t++) + while (*p) + (*f) (*p++); +} + +void +trim(t) + register Char **t; +{ + register Char *p; + + while (p = *t++) + while (*p) + *p++ &= TRIM; +} + +void +tglob(t) + register Char **t; +{ + register Char *p, c; + + while (p = *t++) { + if (*p == '~' || *p == '=') + gflag |= G_CSH; + else if (*p == '{' && + (p[1] == '\0' || p[1] == '}' && p[2] == '\0')) + continue; + while (c = *p++) + if (isglob(c)) + gflag |= (c == '{' || c == '`') ? G_CSH : G_GLOB; + } +} + +/* + * Command substitute cp. If literal, then this is a substitution from a + * << redirection, and so we should not crunch blanks and tabs, separating + * words only at newlines. + */ +#ifndef TC_BUFSIZ + /* jpn: needs to fit TERMCAP doing eval of tset results */ +#define TC_BUFSIZ 1024+4 +#endif + +Char ** +dobackp(cp, literal) + Char *cp; + bool literal; +{ + register Char *lp, *rp; + Char *ep, word[TC_BUFSIZ]; + + if (pargv) { +#ifdef notdef + abort(); +#endif + blkfree(pargv); + } + pargsiz = GLOBSPACE; + pargv = (Char **) xmalloc((size_t) sizeof(Char *) * pargsiz); + pargv[0] = NOSTR; + pargcp = pargs = word; + pargc = 0; + pnleft = TC_BUFSIZ - 4; + for (;;) { + for (lp = cp; *lp != '`'; lp++) { + if (*lp == 0) { + if (pargcp != pargs) + pword(); + return (pargv); + } + psave(*lp); + } + lp++; + for (rp = lp; *rp && *rp != '`'; rp++) + if (*rp == '\\') { + rp++; + if (!*rp) + goto oops; + } + if (!*rp) + oops: stderror(ERR_UNMATCHED, '`'); + ep = Strsave(lp); + ep[rp - lp] = 0; + backeval(ep, literal); + cp = rp + 1; + } +} + +static void +backeval(cp, literal) + Char *cp; + bool literal; +{ + register int icnt, c; + register Char *ip; + struct command faket; + bool hadnl; + int pvec[2], quoted; + Char *fakecom[2], ibuf[BUFSIZ]; + char tibuf[BUFSIZ]; + + hadnl = 0; + icnt = 0; + quoted = (literal || (cp[0] & QUOTE)) ? QUOTE : 0; + faket.t_dtyp = NODE_COMMAND; + faket.t_dflg = 0; + faket.t_dlef = 0; + faket.t_drit = 0; + faket.t_dspr = 0; + faket.t_dcom = fakecom; + fakecom[0] = STRfk_com1; + fakecom[1] = 0; + + /* + * We do the psave job to temporarily change the current job so that the + * following fork is considered a separate job. This is so that when + * backquotes are used in a builtin function that calls glob the "current + * job" is not corrupted. We only need one level of pushed jobs as long as + * we are sure to fork here. + */ + psavejob(); + + /* + * It would be nicer if we could integrate this redirection more with the + * routines in sh.sem.c by doing a fake execute on a builtin function that + * was piped out. + */ + mypipe(pvec); + if (pfork(&faket, -1) == 0) { + struct wordent paraml; + struct command *t; + + (void) close(pvec[0]); + (void) dmove(pvec[1], 1); + (void) dmove(SHDIAG, 2); + initdesc(); + /* + * Bugfix for nested backquotes by Michael Greim , + * posted to comp.bugs.4bsd 12 Sep. 1989. + */ + if (pargv) /* mg, 21.dec.88 */ + blkfree(pargv), pargv = 0, pargsiz = 0; + /* mg, 21.dec.88 */ + arginp = cp; + while (*cp) + *cp++ &= TRIM; + (void) lex(¶ml); + if (seterr) + stderror(ERR_OLD); + alias(¶ml); + t = syntax(paraml.next, ¶ml, 0); + if (seterr) + stderror(ERR_OLD); + if (t) + t->t_dflg |= F_NOFORK; +#ifdef SIGTSTP + (void) sigignore(SIGTSTP); +#endif +#ifdef SIGTTIN + (void) sigignore(SIGTTIN); +#endif +#ifdef SIGTTOU + (void) sigignore(SIGTTOU); +#endif + execute(t, -1, NULL, NULL); + exitstat(); + } + xfree((ptr_t) cp); + (void) close(pvec[1]); + c = 0; + ip = NULL; + do { + int cnt = 0; + + for (;;) { + if (icnt == 0) { + int i; + + ip = ibuf; + do + icnt = read(pvec[0], tibuf, BUFSIZ); + while (icnt == -1 && errno == EINTR); + if (icnt <= 0) { + c = -1; + break; + } + for (i = 0; i < icnt; i++) + ip[i] = (unsigned char) tibuf[i]; + } + if (hadnl) + break; + --icnt; + c = (*ip++ & TRIM); + if (c == 0) + break; + if (c == '\n') { + /* + * Continue around the loop one more time, so that we can eat + * the last newline without terminating this word. + */ + hadnl = 1; + continue; + } + if (!quoted && (c == ' ' || c == '\t')) + break; + cnt++; + psave(c | quoted); + } + /* + * Unless at end-of-file, we will form a new word here if there were + * characters in the word, or in any case when we take text literally. + * If we didn't make empty words here when literal was set then we + * would lose blank lines. + */ + if (c != -1 && (cnt || literal)) + pword(); + hadnl = 0; + } while (c >= 0); + (void) close(pvec[0]); + pwait(); + prestjob(); +} + +static void +psave(c) + Char c; +{ + if (--pnleft <= 0) + stderror(ERR_WTOOLONG); + *pargcp++ = c; +} + +static void +pword() +{ + psave(0); + if ((int)pargc == pargsiz - 1) { + pargsiz += GLOBSPACE; + pargv = (Char **) xrealloc((ptr_t) pargv, + (size_t) pargsiz * sizeof(Char *)); + } + pargv[(int)pargc++] = Strsave(pargs); + pargv[(int)pargc] = NOSTR; + pargcp = pargs; + pnleft = TC_BUFSIZ - 4; +} + +int +Gmatch(string, pattern) + register Char *string, *pattern; +{ + register Char stringc, pat_c; + int match; + Char rangec; + + for (;; ++string) { + stringc = *string & TRIM; + /* + * apollo comp_r bug: switch (pat_c = *pattern++) { dies + */ + pat_c = *pattern++; + switch (pat_c) { + case 0: + return (stringc == 0); + case '?': + if (stringc == 0) + return (0); + break; + case '*': + if (!*pattern) + return (1); + while (*string) + if (Gmatch(string++, pattern)) + return (1); + return (0); + case '[': + match = 0; + while (rangec = *pattern++) { + if (rangec == ']') + if (match) + break; + else + return (0); + if (match) + continue; + if (rangec == '-' && *(pattern-2) != '[' && *pattern != ']') { + match = (stringc <= (*pattern & TRIM) && + (*(pattern-2) & TRIM) <= stringc); + pattern++; + } + else + match = (stringc == (rangec & TRIM)); + } + if (rangec == 0) + stderror(ERR_NAME | ERR_MISSING, ']'); + break; + default: + if ((pat_c & TRIM) != stringc) + return (0); + break; + + } + } +} + +void +Gcat(s1, s2) + Char *s1, *s2; +{ + register Char *p, *q; + int n; + + for (p = s1; *p++;); + for (q = s2; *q++;); + n = (p - s1) + (q - s2) - 1; + if ((int)++gargc >= gargsiz) { + gargsiz += GLOBSPACE; + gargv = (Char **) xrealloc((ptr_t) gargv, + (size_t) gargsiz * sizeof(Char *)); + } + gargv[(int)gargc] = 0; + p = gargv[(int)gargc - 1] = (Char *) xmalloc((size_t) n * sizeof(Char)); + for (q = s1; *p++ = *q++;); + for (p--, q = s2; *p++ = *q++;); +} + +#ifdef FILEC +int +sortscmp(a, b) + register Char **a, **b; +{ +#if defined(NLS) && !defined(NOSTRCOLL) + char buf[2048]; + +#endif + + if (!a) /* check for NULL */ + return (b ? 1 : 0); + if (!b) + return (-1); + + if (!*a) /* check for NULL */ + return (*b ? 1 : 0); + if (!*b) + return (-1); + +#if defined(NLS) && !defined(NOSTRCOLL) + (void) strcpy(buf, short2str(*a)); + return ((int) strcoll(buf, short2str(*b))); +#else + return ((int) Strcmp(*a, *b)); +#endif +} + +#endif diff --git a/bin/tcsh/sh.h b/bin/tcsh/sh.h new file mode 100644 index 0000000..4452cd1 --- /dev/null +++ b/bin/tcsh/sh.h @@ -0,0 +1,799 @@ +/* $Header: src/sys/tcsh-6.00/RCS/sh.h,v 3.1.1 1996/03/21 19:07:20 christos Exp $ */ +/* + * sh.h: Catch it all globals and includes file! + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#ifndef _h_sh +#define _h_sh + + +/* + * Sanity + */ +#if defined(_POSIX_SOURCE) && !defined(POSIX) +# define POSIX +#endif + +#if defined(POSIXJOBS) && !defined(BSDJOBS) +# define BSDJOBS +#endif + +#ifdef SHORT_STRINGS +typedef short Char; +# define SAVE(a) (Strsave(str2short(a))) +#else +typedef char Char; +# define SAVE(a) (strsave(a)) +#endif + +/* + * If your comp_r complains, then you can either + * throw it away and get gcc or, use the following define + * and get rid of the typedef. + * [The 4.2/3BSD vax comp_r does not like that] + */ +#ifdef SIGVOID +# if defined(vax) && !defined(__GNUC__) +# define sigret_t void +# else +typedef void sigret_t; +# endif +#else +typedef int sigret_t; +#endif /* SIGVOID */ + +/* + * Fundamental definitions which may vary from system to system. + * + * BUFSIZ The i/o buffering size; also limits word size + * MAILINTVL How often to mailcheck; more often is more expensive + */ +#ifndef BUFSIZ +#define BUFSIZ 1024 /* default buffer size */ +#endif /* BUFSIZ */ + +#define FORKSLEEP 10 /* delay loop on non-interactive fork failure */ +#define MAILINTVL 600 /* 10 minutes */ + +/* + * The shell moves std in/out/diag and the old std input away from units + * 0, 1, and 2 so that it is easy to set up these standards for invoked + * commands. + */ +#define FSHTTY 15 /* /dev/tty when manip pgrps */ +#define FSHIN 16 /* Preferred desc for shell input */ +#define FSHOUT 17 /* ... shell output */ +#define FSHDIAG 18 /* ... shell diagnostics */ +#define FOLDSTD 19 /* ... old std input */ + +#ifdef PROF +#define xexit(n) done(n) +#endif + +#include +#ifdef _SEQUENT_ +# include +#endif /* _SEQUENT_ */ +#if defined(POSIX) || SVID > 0 +# include +#endif /* POSIX || SVID > 0 */ + +#ifdef NLS +# include +#endif + +#include +#include + +#ifdef BSDTIMES +# include +# include +#endif /* BSDTIMES */ + +#ifndef POSIX +# ifdef TERMIO +# ifdef _IBMR2 + /* Aix redefines NOFLSH when _BSD_INCLUDES is defined! */ +# undef _BSD +# undef _BSD_INCLUDES +# endif /* _IBMR2 */ +# include +# ifdef _IBMR2 + /* but we need it. */ +# define _BSD +# define _BSD_INCLUDES +# endif /* _IBMR2 */ +# else +# include +# endif /* TERMIO */ +#else /* POSIX */ +# include +#endif /* POSIX */ + +#ifdef POSIX +/* + * We should be using setpgid and setpgid + * by now, but in some systems we use the + * old routines... + */ +# define getpgrp __getpgrp +# define setpgrp __setpgrp +# include +# undef getpgrp +# undef setpgrp +extern int getpgrp(); +extern int setpgrp(); + +/* + * the gcc+protoize version of + * redefines malloc(), so we define the following + * to avoid it. + */ +# define _GNU_STDLIB_H +# define malloc __malloc +# define free __free +# define calloc __calloc +# define realloc __realloc +# include +# undef malloc +# undef free +# undef calloc +# undef realloc +# include +#endif /* POSIX */ + +#if SVID > 0 +# if !defined(pyr) || !defined(aiws) +# include +# endif /* !aiws || !pyr */ +#endif /* SVID > 0 */ + +#if !(defined(sun) && defined(TERMIO)) +# include +#endif + +#if !defined(FIOCLEX) && defined(sun) +# include +#endif /* !FIOCLEX && sun */ + + +#include + +#if !defined(O_RDONLY) || !defined(O_NDELAY) +# include +#endif + +#include + +#include + +#if __STDC__ +# include +#else +# include +#endif + +#ifdef DIRENT +# include +#else +# include +# define dirent direct +#endif /* DIRENT */ +#ifdef hpux +# include /* So the fgetpwent() prototypes work */ +#endif +#include +#ifdef BSD +# include +# define strchr(a, b) index(a, b) +# define strrchr(a, b) rindex(a, b) +#else +# include +#endif /* BSD */ + +typedef int bool; + +#include "sh.types.h" + +#ifndef lint +typedef ptr_t memalign_t; +#else +typedef union { + char am_ch, *am_char_p; + short am_sh, *am_short_p; + int am_in, *am_int_p; + long am_lo, *am_long_p; + float am_fl, *am_float_p; + double am_do, *am_double_p; +} *memalign_t; + +# define malloc lint_malloc +# define free lint_free +# define realloc lint_realloc +# define calloc lint_calloc +#endif + +#ifdef SYSMALLOC +# define xmalloc(i) Malloc(i) +# define xrealloc(p, i) Realloc(p, i) +# define xcalloc(n, s) Calloc(n, s) +# define xfree(p) Free(p) +#else +# define xmalloc(i) malloc(i) +# define xrealloc(p, i) realloc(p, i) +# define xcalloc(n, s) calloc(n, s) +# define xfree(p) free(p) +#endif /* SYSMALLOC */ +#include "sh.char.h" +#include "sh.err.h" +#include "sh.dir.h" +#include "sh.proc.h" + +#include "pathnames.h" + + +/* + * C shell + * + * Bill Joy, UC Berkeley + * October, 1978; May 1980 + * + * Jim Kulp, IIASA, Laxenburg Austria + * April, 1980 + */ + +#define SIGN_EXTEND_CHAR(a) \ + ((a) & 0x80 ? ((int) (a)) | 0xffffff00 : ((int) a) & 0x000000ff) + + + +#if !defined(MAXNAMLEN) && defined(_D_NAME_MAX) +# define MAXNAMLEN _D_NAME_MAX +#endif /* MAXNAMLEN */ + +#ifndef MAXHOSTNAMELEN +# define MAXHOSTNAMELEN 255 +#endif /* MAXHOSTNAMELEN */ + + + +#define eq(a, b) (Strcmp(a, b) == 0) + +/* globone() flags */ +#define G_ERROR 0 /* default action: error if multiple words */ +#define G_IGNORE 1 /* ignore the rest of the words */ +#define G_APPEND 2 /* make a sentence by cat'ing the words */ + +/* + * Global flags + */ +bool chkstop; /* Warned of stopped jobs... allow exit */ + +#ifndef FIOCLEX +bool didcch; /* Have closed unused fd's for child */ +#endif + +bool didfds; /* Have setup i/o fd's for child */ +bool doneinp; /* EOF indicator after reset from readc */ +bool exiterr; /* Exit if error or non-zero exit status */ +bool child; /* Child shell ... errors cause exit */ +bool haderr; /* Reset was because of an error */ +bool intty; /* Input is a tty */ +bool intact; /* We are interactive... therefore prompt */ +bool justpr; /* Just print because of :p hist mod */ +bool loginsh; /* We are a loginsh -> .login/.logout */ +bool neednote; /* Need to pnotify() */ +bool noexec; /* Don't execute, just syntax check */ +bool pjobs; /* want to print jobs if interrupted */ +bool setintr; /* Set interrupts on/off -> Wait intr... */ +bool timflg; /* Time the next waited for command */ +bool havhash; /* path hashing is available */ +bool editing; /* doing filename expansion and line editing */ +bool bslash_quote; /* PWP: tcsh-style quoting? (in sh.c) */ +bool isoutatty; /* is SHOUT a tty */ +bool isdiagatty; /* is SHDIAG a tty */ +bool is1atty; /* is file descriptor 1 a tty (didfds mode) */ +bool is2atty; /* is file descriptor 2 a tty (didfds mode) */ + +/* + * Global i/o info + */ +Char *arginp; /* Argument input for sh -c and internal `xx` */ +int onelflg; /* 2 -> need line for -t, 1 -> exit on read */ +Char *ffile; /* Name of shell file for $0 */ + +extern char *seterr; /* Error message from scanner/parser */ +extern int errno; /* Error from C library routines */ +Char *shtemp; /* Temp name for << shell files in /tmp */ + +#ifdef BSDTIMES +struct timeval time0; /* Time at which the shell started */ +struct rusage ru0; +#else +# ifdef _SEQUENT_ +tmval_t time0; /* Time at which the shell started */ +struct pro_stats ru0; +# else /* _SEQUENT_ */ +# ifndef POSIX +time_t time0; /* time at which shell started */ +# else /* POSIX */ +clock_t time0; /* time at which shell started */ +# endif /* POSIX */ +struct tms shtimes; /* shell and child times for process timing */ +# endif /* _SEQUENT_ */ +#endif /* BSDTIMES */ + +/* + * Miscellany + */ +Char *doldol; /* Character pid for $$ */ +int uid; /* Invokers uid */ +int gid; /* Invokers gid */ +time_t chktim; /* Time mail last checked */ +int shpgrp; /* Pgrp of shell */ +int tpgrp; /* Terminal process group */ + +/* If tpgrp is -1, leave tty alone! */ +int opgrp; /* Initial pgrp and tty pgrp */ + +Char PromptBuf[256]; /* buffer for the actual printed prompt. this + * is used in tenex.c and sh.c for pegets.c */ + +/* + * These are declared here because they want to be + * initialized in sh.init.c (to allow them to be made readonly) + */ + +extern struct biltins { + char *bname; + void (*bfunct) (); + short minargs, maxargs; +} bfunc[]; +extern int nbfunc; + +extern struct srch { + char *s_name; + short s_value; +} srchn[]; +extern int nsrchn; + +/* + * To be able to redirect i/o for builtins easily, the shell moves the i/o + * descriptors it uses away from 0,1,2. + * Ideally these should be in units which are closed across exec's + * (this saves work) but for version 6, this is not usually possible. + * The desired initial values for these descriptors are defined in + * sh.local.h. + */ +short SHIN; /* Cur_ shell input (script) */ +short SHOUT; /* Shell output */ +short SHDIAG; /* Diagnostic output... shell errs go here */ +short OLDSTD; /* Old standard input (def for cmds) */ + +/* + * Error control + * + * Errors in scanning and parsing set up an error message to be printed + * at the end and complete. Other errors always cause a reset. + * Because of source commands and .cshrc we need nested error catches. + */ + +jmp_buf reslab; + +/* bugfix by Jak Kirman @ Brown U.: remove the (void) cast here, see sh.c */ +#define setexit() (setjmp(reslab)) +#define reset() longjmp(reslab, 1) + /* Should use structure assignment here */ +#define getexit(a) copy((char *)(a), (char *)reslab, sizeof reslab) +#define resexit(a) copy((char *)reslab, ((char *)(a)), sizeof reslab) + +Char *gointr; /* Label for an onintr transfer */ + +sigret_t (*parintr) (); /* Parents interrupt catch */ +sigret_t (*parterm) (); /* Parents terminate catch */ + +/* + * Lexical definitions. + * + * All lexical space is allocated dynamically. + * The eighth/sizteenth bit of characters is used to prevent recognition, + * and eventually stripped. + */ +#define META 0200 +#define ASCII 0177 +#ifdef SHORT_STRINGS +# define QUOTE 0100000 /* 16nth char bit used for 'ing */ +# define TRIM 0077777 /* Mask to strip quote bit */ +# define UNDER 0040000 /* Underline flag */ +# define BOLD 0020000 /* Bold flag */ +# define STANDOUT 0010000 /* Standout flag */ +# define LITERAL 0004000 /* Literal character flag */ +# define ATTRIBUTES 0074000 /* The bits used for attributes */ +# define CHAR 0000377 /* Mask to mask out the character */ +#else +# define QUOTE 0200 /* Eighth char bit used for 'ing */ +# define TRIM 0177 /* Mask to strip quote bit */ +# define UNDER 0000000 /* No extra bits to do both */ +# define BOLD 0000000 /* Bold flag */ +# define STANDOUT META /* Standout flag */ +# define LITERAL 0000000 /* Literal character flag */ +# define ATTRIBUTES 0200 /* The bits used for attributes */ +# define CHAR 0000177 /* Mask to mask out the character */ +#endif + +int AsciiOnly; /* If set only 7 bits is expected in characters */ + +/* + * Each level of input has a buffered input structure. + * There are one or more blocks of buffered input for each level, + * exactly one if the input is seekable and tell is available. + * In other cases, the shell buffers enough blocks to keep all loops + * in the buffer. + */ +struct Bin { + off_t Bfseekp; /* Seek pointer */ + off_t Bfbobp; /* Seekp of beginning of buffers */ + off_t Bfeobp; /* Seekp of end of buffers */ + short Bfblocks; /* Number of buffer blocks */ + Char **Bfbuf; /* The array of buffer blocks */ +} B; + +#define fseekp B.Bfseekp +#define fbobp B.Bfbobp +#define feobp B.Bfeobp +#define fblocks B.Bfblocks +#define fbuf B.Bfbuf + +#define btell() fseekp + +/* + * The shell finds commands in loops by reseeking the input + * For whiles, in particular, it reseeks to the beginning of the + * line the while was on; hence the while placement restrictions. + */ +off_t lineloc; + +bool cantell; /* Is current source tellable ? */ + +/* + * Input lines are parsed into doubly linked circular + * lists of words of the following form. + */ +struct wordent { + Char *word; + struct wordent *prev; + struct wordent *next; +}; + +/* + * During word building, both in the initial lexical phase and + * when expanding $ variable substitutions, expansion by `!' and `$' + * must be inhibited when reading ahead in routines which are themselves + * processing `!' and `$' expansion or after characters such as `\' or in + * quotations. The following flags are passed to the getC routines + * telling them which of these substitutions are appropriate for the + * next character to be returned. + */ +#define DODOL 1 +#define DOEXCL 2 +#define DOALL DODOL|DOEXCL + +/* + * Labuf implements a general buffer for lookahead during lexical operations. + * Text which is to be placed in the input stream can be stuck here. + * We stick parsed ahead $ constructs during initial input, + * process id's from `$$', and modified variable values (from qualifiers + * during expansion in sh.dol.c) here. + */ +Char *lap; + +/* + * Parser structure + * + * Each command is parsed to a tree of command structures and + * flags are set bottom up during this process, to be propagated down + * as needed during the semantics/exeuction pass (sh.sem.c). + */ +struct command { + short t_dtyp; /* Type of node */ +#define NODE_COMMAND 1 /* t_dcom t_drit */ +#define NODE_PAREN 2 /* ( t_dspr ) t_drit */ +#define NODE_PIPE 3 /* t_dlef | t_drit */ +#define NODE_LIST 4 /* t_dlef ; t_drit */ +#define NODE_OR 5 /* t_dlef || t_drit */ +#define NODE_AND 6 /* t_dlef && t_drit */ + short t_dflg; /* Flags, e.g. F_AMPERSAND|... */ +/* save these when re-doing */ +#ifndef apollo +#define F_SAVE (F_NICE|F_TIME|F_NOHUP) +#else +#define F_SAVE (F_NICE|F_TIME|F_NOHUP|F_VER) +#endif +#define F_AMPERSAND (1<<0) /* executes in background */ +#define F_APPEND (1<<1) /* output is redirected >> */ +#define F_PIPEIN (1<<2) /* input is a pipe */ +#define F_PIPEOUT (1<<3) /* output is a pipe */ +#define F_NOFORK (1<<4) /* don't fork, last ()ized cmd */ +#define F_NOINTERRUPT (1<<5) /* should be immune from intr's */ +/* spare */ +#define F_STDERR (1<<7) /* redirect unit 2 with unit 1 */ +#define F_OVERWRITE (1<<8) /* output was ! */ +#define F_READ (1<<9) /* input redirection is << */ +#define F_REPEAT (1<<10) /* reexec aft if, repeat,... */ +#define F_NICE (1<<11) /* t_nice is meaningful */ +#define F_NOHUP (1<<12) /* nohup this command */ +#define F_TIME (1<<13) /* time this command */ +#ifdef apollo +#define F_VER (1<<14) /* execute command under SYSTYPE */ +#endif + union { + Char *T_dlef; /* Input redirect word */ + struct command *T_dcar; /* Left part of list/pipe */ + } L; + union { + Char *T_drit; /* Output redirect word */ + struct command *T_dcdr; /* Right part of list/pipe */ + } R; +#define t_dlef L.T_dlef +#define t_dcar L.T_dcar +#define t_drit R.T_drit +#define t_dcdr R.T_dcdr + Char **t_dcom; /* Command/argument vector */ + struct command *t_dspr; /* Pointer to ()'d subtree */ + short t_nice; +#ifdef F_VER + short t_systype; +#endif +}; + + +/* + * The keywords for the parser + */ +#define T_BREAK 0 +#define T_BRKSW 1 +#define T_CASE 2 +#define T_DEFAULT 3 +#define T_ELSE 4 +#define T_END 5 +#define T_ENDIF 6 +#define T_ENDSW 7 +#define T_EXIT 8 +#define T_FOREACH 9 +#define T_GOTO 10 +#define T_IF 11 +#define T_LABEL 12 +#define T_LET 13 +#define T_SET 14 +#define T_SWITCH 15 +#define T_TEST 16 +#define T_THEN 17 +#define T_WHILE 18 + +/* + * Structure defining the existing while/foreach loops at this + * source level. Loops are implemented by seeking back in the + * input. For foreach (fe), the word list is attached here. + */ +struct whyle { + off_t w_start; /* Point to restart loop */ + off_t w_end; /* End of loop (0 if unknown) */ + Char **w_fe, **w_fe0; /* Cur_/initial wordlist for fe */ + Char *w_fename; /* Name for fe */ + struct whyle *w_next; /* Next (more outer) loop */ +} *whyles; + +/* + * Variable structure + * + * Aliases and variables are stored in AVL balanced binary trees. + */ +struct varent { + Char **vec; /* Array of words which is the value */ + Char *v_name; /* Name of variable/alias */ + struct varent *v_link[3]; /* The links, see below */ + int v_bal; /* Balance factor */ +} shvhed, aliases; + +#define v_left v_link[0] +#define v_right v_link[1] +#define v_parent v_link[2] + +struct varent *adrof1(); + +#define adrof(v) adrof1(v, &shvhed) +#define value(v) value1(v, &shvhed) + +/* + * The following are for interfacing redo substitution in + * aliases to the lexical routines. + */ +struct wordent *alhistp; /* Argument list (first) */ +struct wordent *alhistt; /* Node after last in arg list */ +Char **alvec; /* The (remnants of) alias vector */ + +/* + * Filename/command name expansion variables + */ +short gflag; /* After tglob -> is globbing needed? */ + +#define MAXVARLEN 30 /* Maximum number of char in a variable name */ + +#ifndef MAXPATHLEN +# define MAXPATHLEN 2048 +#endif /* MAXPATHLEN */ + +#ifndef MAXNAMLEN +# define MAXNAMLEN 512 +#endif /* MAXNAMLEN */ + +/* + * Variables for filename expansion + */ +extern Char **gargv; /* Pointer to the (stack) arglist */ +extern long gargc; /* Number args in gargv */ + +/* + * Variables for command expansion. + */ +extern Char **pargv; /* Pointer to the argv list space */ +extern long pargc; /* Count of arguments in pargv */ +Char *pargs; /* Pointer to start current word */ +long pnleft; /* Number of chars left in pargs */ +Char *pargcp; /* Cur_ index into pargs */ + +/* + * History list + * + * Each history list entry contains an embedded wordlist + * from the scanner, a number for the event, and a reference count + * to aid in discarding old entries. + * + * Essentially "invisible" entries are put on the history list + * when history substitution includes modifiers, and thrown away + * at the next discarding since their event numbers are very negative. + */ +struct Hist { + struct wordent Hlex; + int Hnum; + int Href; + long Htime; + Char *histline; + struct Hist *Hnext; +} Histlist; + +struct wordent paraml; /* Cur_ lexical word list */ +int eventno; /* Next events number */ +int lastev; /* Last event reference (default) */ + +Char HIST; /* history invocation character */ +Char HISTSUB; /* auto-substitute character */ + +/* + * strings.h: + */ +#ifndef SHORT_STRINGS +#define Strchr(a, b) strchr(a, b) +#define Strrchr(a, b) strrchr(a, b) +#define Strcat(a, b) strcat(a, b) +#define Strncat(a, b, c) strncat(a, b, c) +#define Strcpy(a, b) strcpy(a, b) +#define Strncpy(a, b, c) strncpy(a, b, c) +#define Strlen(a) strlen(a) +#define Strcmp(a, b) strcmp(a, b) +#define Strncmp(a, b, c) strncmp(a, b, c) + +#define Strspl(a, b) strspl(a, b) +#define Strsave(a) strsave(a) +#define Strend(a) strend(a) +#define Strstr(a, b) strstr(a, b) + +#define str2short(a) (a) +#define blk2short(a) saveblk(a) +#define short2blk(a) saveblk(a) +#define short2str(a) (a) +#define short2qstr(a) (a) +#else +#define Strchr(a, b) s_strchr(a, b) +#define Strrchr(a, b) s_strrchr(a, b) +#define Strcat(a, b) s_strcat(a, b) +#define Strncat(a, b, c) s_scat(a, b, c) +#define Strcpy(a, b) s_strcpy(a, b) +#define Strncpy(a, b, c) s_scpy(a, b, c) +#define Strlen(a) s_strlen(a) +#define Strcmp(a, b) s_strcmp(a, b) +#define Strncmp(a, b, c) s_scmp(a, b, c) + +#define Strspl(a, b) s_strspl(a, b) +#define Strsave(a) s_strsave(a) +#define Strend(a) s_strend(a) +#define Strstr(a, b) s_strstr(a, b) +#endif + +#define NOSTR ((Char *) 0) +/* + * setname is a macro to save space (see sh.err.c) + */ +char *bname; + +#define setname(a) (bname = (a)) + +#ifdef VFORK +Char *Vsav; +Char *Vdp; +Char *Vexpath; +char **Vt; + +#endif /* VFORK */ + +Char **evalvec; +Char *evalp; + +extern struct mesg { + char *iname; /* name from /usr/include */ + char *pname; /* print name */ +} mesg[]; + +/* word_chars is set by default to WORD_CHARS but can be overridden by + the worchars variable--if unset, reverts to WORD_CHARS */ + +Char *word_chars; + +#define WORD_CHARS "*?_-.[]~=" /* default chars besides alnums in words */ + +Char *STR_SHELLPATH; + +#ifdef _PATH_BSHELL +Char *STR_BSHELL; +#endif +Char *STR_WORD_CHARS; +Char **STR_environ; + +/* + * ANSIisms... + */ +#ifndef __P +# if __STDC__ +# define __P(a) a +# else +# define __P(a) () +# define const +# define volatile +# endif +#endif + +#include "tc.h" +#include "sh.decls.h" + +#endif /* _h_sh */ diff --git a/bin/tcsh/sh.hist.c b/bin/tcsh/sh.hist.c new file mode 100644 index 0000000..c87dcda --- /dev/null +++ b/bin/tcsh/sh.hist.c @@ -0,0 +1,226 @@ +/* + * sh.hist.c: Shell history expansions and substitutions + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#include "config.h" +#if !defined(lint) && !defined(pdp11) +static char *rcsid() + { return "$Id: sh.hist.c,v 3.0.1 1996/04/04 21:49:28 sms Exp $"; } +#endif + +#include "sh.h" + +extern bool histvalid; +extern Char histline[]; +static Char HistLit = 0; + +static void hfree __P((struct Hist *)); +static void dohist1 __P((struct Hist *, int *, int, int, int)); +static void phist __P((struct Hist *, int, int)); + +/* + * C shell + */ + +void +savehist(sp) + struct wordent *sp; +{ + register struct Hist *hp, *np; + register int histlen = 0; + Char *cp; + + /* throw away null lines */ + if (sp->next->word[0] == '\n') + return; + cp = value(STRhsto); + if (*cp) { + register Char *p = cp; + + while (*p) { + if (!Isdigit(*p)) { + histlen = 0; + break; + } + histlen = histlen * 10 + *p++ - '0'; + } + } + for (hp = &Histlist; np = hp->Hnext;) + if (eventno - np->Href >= histlen || histlen == 0) + hp->Hnext = np->Hnext, hfree(np); + else + hp = np; + (void) enthist(++eventno, sp, 1); +} + +struct Hist * +enthist(event, lp, docopy) + int event; + register struct wordent *lp; + bool docopy; +{ + register struct Hist *np; + + np = (struct Hist *) xmalloc((size_t) sizeof(*np)); + (void) time(&(np->Htime)); + np->Hnum = np->Href = event; + if (docopy) { + copylex(&np->Hlex, lp); + if (histvalid) + np->histline = Strsave(histline); + else + np->histline = NULL; + } + else { + np->Hlex.next = lp->next; + lp->next->prev = &np->Hlex; + np->Hlex.prev = lp->prev; + lp->prev->next = &np->Hlex; + np->histline = NULL; + } + np->Hnext = Histlist.Hnext; + Histlist.Hnext = np; + return (np); +} + +static void +hfree(hp) + register struct Hist *hp; +{ + + freelex(&hp->Hlex); + if (hp->histline) + xfree((ptr_t) hp->histline); + xfree((ptr_t) hp); +} + +void +dohist(vp) + Char **vp; +{ + int n, rflg = 0, hflg = 0, tflg = 0; + + if (getn(value(STRhsto)) == 0) + return; + if (setintr) +#ifdef BSDSIGS + (void) sigsetmask(sigblock((sigmask_t) 0) & ~sigmask(SIGINT)); +#else + (void) sigrelse(SIGINT); +#endif + while (*++vp && **vp == '-') { + Char *vp2 = *vp; + + while (*++vp2) + switch (*vp2) { + case 'h': + hflg++; + break; + case 'r': + rflg++; + break; + case 't': + tflg++; + break; + case '-': /* ignore multiple '-'s */ + break; + default: + stderror(ERR_HISTUS); + break; + } + } + if (*vp) + n = getn(*vp); + else { + n = getn(value(STRhsto)); + } + dohist1(Histlist.Hnext, &n, rflg, hflg, tflg); +} + +static void +dohist1(hp, np, rflg, hflg, tflg) + register struct Hist *hp; + register int *np; + int rflg, hflg, tflg; +{ + bool print = (*np) > 0; + + for (; hp != 0; hp = hp->Hnext) { + (*np)--; + hp->Href++; + if (rflg == 0) { + dohist1(hp->Hnext, np, rflg, hflg, tflg); + if (print) + phist(hp, hflg, tflg); + return; + } + if (*np >= 0) + phist(hp, hflg, tflg); + } +} + +static void +phist(hp, hflg, tflg) + register struct Hist *hp; + int hflg, tflg; +{ + register struct tm *t; + char ampm = 'a'; + + if (hflg == 0) { + xprintf("%6d\t", hp->Hnum); +#ifdef BSDTIMES + if (tflg == 0) { + t = localtime(&hp->Htime); + if (adrof(STRampm)) { /* addition by Hans J. Albertsson */ + if (t->tm_hour >= 12) { + if (t->tm_hour > 12) + t->tm_hour -= 12; + ampm = 'p'; + } + else if (t->tm_hour == 0) + t->tm_hour = 12; + xprintf("%2d:%02d%cm\t", t->tm_hour, t->tm_min, ampm); + } + else { + xprintf("%2d:%02d\t", t->tm_hour, t->tm_min); + } + } +#endif /*BSDTIMES*/ + } + if (HistLit && hp->histline) + xprintf("%s\n", short2str(hp->histline)); + else + prlex(&hp->Hlex); +} diff --git a/bin/tcsh/sh.init.c b/bin/tcsh/sh.init.c new file mode 100644 index 0000000..0c10ec2 --- /dev/null +++ b/bin/tcsh/sh.init.c @@ -0,0 +1,632 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/sh.init.c,v 3.0 1991/07/04 21:49:28 christos Exp $ */ +/* + * sh.init.c: Function and signal tables + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#include "config.h" +#if !defined(lint) && !defined(pdp11) +static char *rcsid() + { return "$Id: sh.init.c,v 3.0 1991/07/04 21:49:28 christos Exp $"; } +#endif + +#include "sh.h" + +/* + * C shell + */ + +#define INF 1000 + +struct biltins bfunc[] = { + "@", dolet, 0, INF, + "alias", doalias, 0, INF, + "aliases", do_aliases, 0, 1, /* PWP */ + "alloc", showall, 0, 1, + "bg", dobg, 0, INF, + "bind", dobind, 0, 2, + "bindkey", dobindkey, 0, 8, + "break", dobreak, 0, 0, + "breaksw", doswbrk, 0, 0, +#if defined(IIASA) || defined(KAI) + "bye", goodbye, 0, 0, +#endif + "case", dozip, 0, 1, + "cd", dochngd, 0, INF, + "chdir", dochngd, 0, INF, + "continue", docontin, 0, 0, + "default", dozip, 0, 0, + "dirs", dodirs, 0, INF, + "echo", doecho, 0, INF, + "echotc", doechotc, 0, INF, + "else", doelse, 0, INF, + "end", doend, 0, 0, + "endif", dozip, 0, 0, + "endsw", dozip, 0, 0, + "eval", doeval, 0, INF, + "exec", execash, 1, INF, + "exit", doexit, 0, INF, + "fg", dofg, 0, INF, + "foreach", doforeach, 3, INF, +#ifdef TCF + "getspath", dogetspath, 0, 0, + "getxvers", dogetxvers, 0, 0, +#endif /* TCF */ +#ifdef IIASA + "gd", dopushd, 0, INF, +#endif + "glob", doglob, 0, INF, + "goto", dogoto, 1, 1, +#ifdef VFORK + "hashstat", hashstat, 0, 0, +#endif + "history", dohist, 0, 2, + "if", doif, 1, INF, +#ifdef apollo + "inlib", doinlib, 1, INF, +#endif + "jobs", dojobs, 0, 1, + "kill", dokill, 1, INF, + "limit", dolimit, 0, 3, + "linedit", doecho, 0, INF, +#ifndef KAI + "log", dolog, 0, 0, +#endif + "login", dologin, 0, 1, + "logout", dologout, 0, 0, + "ls-F", dolist, 0, INF, +#ifdef TCF + "migrate", domigrate, 1, INF, +#endif /* TCF */ +#ifdef NEWGRP + "newgrp", donewgrp, 1, 1, +#endif + "nice", donice, 0, INF, + "nohup", donohup, 0, INF, + "notify", donotify, 0, INF, + "onintr", doonintr, 0, 2, + "popd", dopopd, 0, INF, + "pushd", dopushd, 0, INF, +#ifdef IIASA + "rd", dopopd, 0, INF, +#endif + "rehash", dohash, 0, 0, + "repeat", dorepeat, 2, INF, +#ifdef apollo + "rootnode", dorootnode, 1, 1, +#endif + "sched", dosched, 0, INF, + "set", doset, 0, INF, + "setenv", dosetenv, 0, 2, +#ifdef MACH + "setpath", dosetpath, 0, INF, +#endif /* MACH */ +#ifdef TCF + "setspath", dosetspath, 1, INF, +#endif /* TCF */ + "settc", dosettc, 2, 2, +#ifdef TCF + "setxvers", dosetxvers, 0, 1, +#endif /* TCF */ + "shift", shift, 0, 1, + "source", dosource, 1, 2, + "stop", dostop, 1, INF, + "suspend", dosuspend, 0, 0, + "switch", doswitch, 1, INF, + "telltc", dotelltc, 0, INF, + "time", dotime, 0, INF, + "umask", doumask, 0, 1, + "unalias", unalias, 1, INF, + "unhash", dounhash, 0, 0, +#ifdef masscomp + "universe", douniverse, 0, 1, +#endif + "unlimit", dounlimit, 0, INF, + "unset", unset, 1, INF, + "unsetenv", dounsetenv, 1, INF, +#ifdef apollo + "ver", dover, 0, INF, +#endif + "wait", dowait, 0, 0, +#ifdef WARP + "warp", dowarp, 0, 2, +#endif +#ifdef KAI + "watchlog", dolog, 0, 0, +#endif + "which", dowhich, 1, INF, + "while", dowhile, 1, INF, +}; +int nbfunc = sizeof bfunc / sizeof *bfunc; + +struct srch srchn[] = { + "@", T_LET, + "break", T_BREAK, + "breaksw", T_BRKSW, + "case", T_CASE, + "default", T_DEFAULT, + "else", T_ELSE, + "end", T_END, + "endif", T_ENDIF, + "endsw", T_ENDSW, + "exit", T_EXIT, + "foreach", T_FOREACH, + "goto", T_GOTO, + "if", T_IF, + "label", T_LABEL, + "set", T_SET, + "switch", T_SWITCH, + "while", T_WHILE, +}; +int nsrchn = sizeof srchn / sizeof *srchn; + +/* + * Note: For some machines, (hpux eg.) + * NSIG = number of signals + 1... + * so we define 33 signals for + * everybody + */ +struct mesg mesg[] = { +/* 0 */ 0, "", +/* 1 */ "HUP", "Hangup", +/* 2 */ "INT", "Interrupt", +/* 3 */ "QUIT", "Quit", +/* 4 */ "ILL", "Illegal instruction", +/* 5 */ "TRAP", "Trace/BPT trap", +/* 6 */ "IOT", "IOT trap", +#ifdef aiws +/* 7 */ "DANGER", "System Crash Imminent", +#else /* aiws */ +/* 7 */ "EMT", "EMT trap", +#endif /* aiws */ +/* 8 */ "FPE", "Floating exception", +/* 9 */ "KILL", "Killed", +/* 10 */ "BUS", "Bus error", +/* 11 */ "SEGV", "Segmentation fault", +/* 12 */ "SYS", "Bad system call", +/* 13 */ "PIPE", "Broken pipe", +/* 14 */ "ALRM", "Alarm clock", +/* 15 */ "TERM", "Terminated", + +#if (SVID > 0) || defined(DGUX) || defined(IBMAIX) || defined(apollo) + +# ifdef _sigextra_ +# undef _sigextra_ +# endif /* _sigextra_ */ + +#ifndef IBMAIX +/* these are the real svid signals */ +/* 16 */ "USR1", "User signal 1", +/* 17 */ "USR2", "User signal 2", +# ifdef apollo +/* 18 */ "CLD", "Death of child", +/* 19 */ "APOLLO", "Apollo-specific fault", +# else +/* 18 */ "CHLD", "Child exited", +/* 19 */ "PWR", "Power failure", +# endif /* apollo */ +#endif /* IBMAIX */ + +# ifdef OREO +# define _sigextra_ +# ifdef SUSPENDED +/* 20 */ "TSTP", "Suspended", +/* 21 */ "TTIN", "Suspended (tty input)", +/* 22 */ "TTOU", "Suspended (tty output)", +/* 23 */ "STOP", "Suspended (signal)", +# else +/* 20 */ "TSTP", "Stopped", +/* 21 */ "TTIN", "Stopped (tty input)", +/* 22 */ "TTOU", "Stopped (tty output)", +/* 23 */ "STOP", "Stopped (signal)", +# endif /* SUSPENDED */ +/* 24 */ "XCPU", "Cputime limit exceeded", +/* 25 */ "XFSZ", "Filesize limit exceeded", +/* 26 */ "VTALRM", "Virtual time alarm", +/* 27 */ "PROF", "Profiling time alarm", +/* 28 */ "WINCH", "Window changed", +/* 29 */ "CONT", "Continued", +/* 30 */ "URG", "Urgent condition on IO channel", +/* 31 */ "IO", "Asynchronous I/O (select)", +/* 32 */ 0, "Signal 32", +# endif /* OREO */ + +# ifdef hpux +# define _sigextra_ +/* 20 */ "VTALRM", "Virtual time alarm", +/* 21 */ "PROF", "Profiling time alarm", +/* 22 */ "IO", "Asynchronous I/O (select)", +/* 23 */ "WINDOW", "Window changed", +# ifdef SUSPENDED +/* 24 */ "STOP", "Suspended (signal)", +/* 25 */ "TSTP", "Suspended", +# else /* SUSPENDED */ +/* 24 */ "STOP", "Stopped (signal)", +/* 25 */ "TSTP", "Stopped", +# endif /* SUSPENDED */ +/* 26 */ "CONT", "Continued", +# ifdef SUSPENDED +/* 27 */ "TTIN", "Suspended (tty input)", +/* 28 */ "TTOU", "Suspended (tty output)", +# else /* SUSPENDED */ +/* 27 */ "TTIN", "Stopped (tty input)", +/* 28 */ "TTOU", "Stopped (tty output)", +# endif /* SUSPENDED */ +/* 29 */ "URG", "Urgent condition on IO channel", +/* 30 */ "LOST", "Remote lock lost (NFS)", +/* 31 */ 0, "Reserved", /* Reserved */ +/* 32 */ "DIL", "DIL signal", +# endif /* hpux */ + +# if defined(ISC) && defined(POSIX) +# define _sigextra_ +/* 20 */ "WINCH", "Window change", +/* 21 */ 0, "Unused", /* SIGPHONE used only for UNIXPC */ +/* 22 */ "POLL", "Pollable event occured", +/* 23 */ "CONT", "Continued", +# ifdef SUSPENDED +/* 24 */ "STOP", "Suspended (signal)", +/* 25 */ "TSTP", "Suspended", +/* 26 */ "TTIN", "Suspended (tty input)", +/* 27 */ "TTOU", "Suspended (tty output)", +# else /* SUSPENDED */ +/* 24 */ "STOP", "Stopped (signal)", +/* 25 */ "TSTP", "Stopped", +/* 26 */ "TTIN", "Stopped (tty input)", +/* 27 */ "TTOU", "Stopped (tty output)", +# endif /* SUSPENDED */ +/* 28 */ 0, "number of signals", +/* 29 */ 0, "Reserved", /* Reserved */ +/* 30 */ 0, "Reserved", /* Reserved */ +/* 31 */ 0, "Reserved", /* Reserved */ +/* 32 */ 0, "Maximum number of signals", +# endif /* ISC && POSIX */ + +# ifdef IRIS4D +# define _sigextra_ +# ifdef SUSPENDED +/* 20 */ "STOP", "Suspended (signal)", +/* 21 */ "TSTP", "Suspended", +# else /* SUSPENDED */ +/* 20 */ "STOP", "Stopped (signal)", +/* 21 */ "TSTP", "Stopped", +# endif /* SUSPENDED */ +/* 22 */ "POLL", "Stream I/O pending", +/* 23 */ "IO", "Asynchronous I/O (select)", +/* 24 */ "URG", "Urgent condition on IO channel", +/* 25 */ "WINCH", "Window changed", +/* 26 */ "VTALRM", "Virtual time alarm", +/* 27 */ "PROF", "Profiling time alarm", +/* 28 */ "CONT", "Continued", +# ifdef SUSPENDED +/* 29 */ "TTIN", "Suspended (tty input)", +/* 30 */ "TTOU", "Suspended (tty output)", +# else /* SUSPENDED */ +/* 29 */ "TTIN", "Stopped (tty input)", +/* 30 */ "TTOU", "Stopped (tty output)", +# endif /* SUSPENDED */ +/* 31 */ 0, "Signal 31", +/* 32 */ 0, "Signal 32", +# endif /* IRIS4D */ + +# ifdef apollo +# define _sigextra_ +# ifdef SUSPENDED +/* 20 */ "STOP", "Suspended (signal)", +/* 21 */ "TSTP", "Suspended", +# else /* SUSPENDED */ +/* 20 */ "STOP", "Stopped (signal)", +/* 21 */ "TSTP", "Stopped", +# endif /* SUSPENDED */ +/* 22 */ "CONT", "Continued", +/* 23 */ "CHLD", "Child stopped or exited", +# ifdef SUSPENDED +/* 24 */ "TTIN", "Suspended (tty input)", +/* 25 */ "TTOU", "Suspended (tty output)", +# else /* SUSPENDED */ +/* 24 */ "TTIN", "Stopped (tty input)", +/* 25 */ "TTOU", "Stopped (tty output)", +# endif /* SUSPENDED */ +/* 26 */ "IO", "Asynchronous I/O (select)", +/* 27 */ "XCPU", "Cputime limit exceeded", +/* 28 */ "XFSZ", "Filesize limit exceeded", +/* 29 */ "VTALRM", "Virtual time alarm", +/* 30 */ "PROF", "Profiling time alarm", +/* 31 */ "URG", "Urgent condition on IO channel", +/* 32 */ "WINCH", "Window changed", +# endif /* apollo */ + +# ifdef aiws +# define _sigextra_ +/* 20 */ 0, "Signal 20", +/* 21 */ 0, "Signal 21", +/* 22 */ 0, "Signal 22" +/* 23 */ "AIO", "LAN Asyncronous I/O", +/* 24 */ "PTY", "PTY read/write availability", +/* 25 */ "IOINT", "I/O intervention required", +/* 26 */ "GRANT", "monitor mode granted", +/* 27 */ "RETRACT", "monitor mode retracted", +/* 28 */ "WINCH","Window size changed", +/* 29 */ 0, "Signal 29", +/* 30 */ "SOUND", "sound completed", +/* 31 */ "MSG", "input hft data pending", +/* 32 */ 0, "Signal 32", +# endif /* aiws */ + +# ifdef m88k /* ICON/UXV 4.10 (mday@iconsys.UUCP) */ +# define _sigextra_ +/* 20 */ "WINCH", "Window changed", +# ifdef DGUX +/* 21 */ 0, "Signal 21", +# else +# ifdef SUSPENDED +/* 21 */ "TTIN", "Suspended (tty input)", +# else /* SUSPENDED */ +/* 21 */ "TTIN", "Stopped (tty input)", +# endif /* SUSPENDED */ +# endif /* DGUX */ +/* 22 */ "POLL", "Stream I/O pending", +# ifdef SUSPENDED +/* 23 */ "STOP", "Suspended (signal)", +/* 24 */ "TSTP", "Suspended", +# else /* SUSPENDED */ +/* 23 */ "STOP", "Stopped (signal)", +/* 24 */ "TSTP", "Stopped", +# endif /* SUSPENDED */ +/* 25 */ "CONT", "Continued", +# ifdef SUSPENDED +/* 26 */ "TTIN", "Suspended (tty input)", +/* 27 */ "TTOU", "Suspended (tty output)", +# else /* SUSPENDED */ +/* 26 */ "TTIN", "Stopped (tty input)", +/* 27 */ "TTOU", "Stopped (tty output)", +# endif /* SUSPENDED */ +/* 28 */ 0, "Signal 28", +/* 29 */ 0, "Signal 29", +/* 30 */ 0, "Signal 30", +/* 31 */ 0, "Signal 31", +/* 32 */ 0, "Signal 32", +/* 33 */ "URG", "Urgent condition on IO channel", +/* 34 */ "IO", "Asynchronous I/O (select)", +/* 35 */ "XCPU", "Cputime limit exceeded", +/* 36 */ "XFSZ", "Filesize limit exceeded", +/* 37 */ "VTALRM", "Virtual time alarm", +/* 38 */ "PROF", "Profiling time alarm", +/* 39 */ 0, "Signal 39", +/* 40 */ "LOST", "Resource lost", +/* 41 */ 0, "Signal 41", +/* 42 */ 0, "Signal 42", +/* 43 */ 0, "Signal 43", +/* 44 */ 0, "Signal 44", +/* 45 */ 0, "Signal 45", +/* 46 */ 0, "Signal 46", +/* 47 */ 0, "Signal 47", +/* 48 */ 0, "Signal 48", +/* 49 */ 0, "Signal 49", +/* 50 */ 0, "Signal 50", +/* 51 */ 0, "Signal 51", +/* 52 */ 0, "Signal 52", +/* 53 */ 0, "Signal 53", +/* 54 */ 0, "Signal 54", +/* 55 */ 0, "Signal 55", +/* 56 */ 0, "Signal 56", +/* 57 */ 0, "Signal 57", +/* 58 */ 0, "Signal 58", +/* 59 */ 0, "Signal 59", +/* 60 */ 0, "Signal 60", +/* 61 */ 0, "Signal 61", +/* 62 */ 0, "Signal 62", +/* 63 */ 0, "Signal 63", +/* 64 */ 0, "Signal 64", +# endif /* m88k */ + + +#ifdef IBMAIX +# define _sigextra_ + +/* 16 */ "URG", "Urgent condition on IO channel", +# ifdef SUSPENDED +/* 17 */ "STOP", "Suspended (signal)", +/* 18 */ "TSTP", "Suspended", +# else /* SUSPENDED */ +/* 17 */ "STOP", "Stopped (signal)", +/* 18 */ "TSTP", "Stopped", +# endif /* SUSPENDED */ +/* 19 */ "CONT", "Continued", +/* 20 */ "CHLD", "Child exited", +# ifdef SUSPENDED +/* 21 */ "TTIN", "Suspended (tty input)", +/* 22 */ "TTOU", "Suspended (tty output)", +# else /* SUSPENDED */ +/* 21 */ "TTIN", "Stopped (tty input)", +/* 22 */ "TTOU", "Stopped (tty output)", +# endif /* SUSPENDED */ +/* 23 */ "IO", "IO possible interrupt", +/* 24 */ "XCPU", "Cputime limit exceeded", +/* 25 */ "XFSZ", "Filesize limit exceeded", +/* 26 */ 0, "Signal 26", +/* 27 */ "MSG", "Data in HFT ring buffer", +/* 28 */ "WINCH", "Window size changed", +/* 29 */ "PWR", "Power failure", +/* 30 */ "USR1", "User signal 1", +/* 31 */ "USR2", "User signal 2", +/* 32 */ "PROF", "Profiling time alarm", +/* 33 */ "DANGER", "System Crash Imminent", +/* 34 */ "VTALRM", "Virtual time alarm", +/* 35 */ "MIGRATE", "Migrate process", +/* 36 */ "PRE", "Programming exception", +/* 37 */ 0, "Signal 37", +/* 38 */ 0, "Signal 38", +/* 39 */ 0, "Signal 39", +/* 40 */ 0, "Signal 40", +/* 41 */ 0, "Signal 41", +/* 42 */ 0, "Signal 42", +/* 43 */ 0, "Signal 43", +/* 44 */ 0, "Signal 44", +/* 45 */ 0, "Signal 45", +/* 46 */ 0, "Signal 46", +/* 47 */ 0, "Signal 47", +/* 48 */ 0, "Signal 48", +/* 49 */ 0, "Signal 49", +/* 50 */ 0, "Signal 50", +/* 51 */ 0, "Signal 51", +/* 52 */ 0, "Signal 52", +/* 53 */ 0, "Signal 53", +/* 54 */ 0, "Signal 54", +/* 55 */ 0, "Signal 55", +/* 56 */ 0, "Signal 56", +/* 57 */ 0, "Signal 57", +/* 58 */ 0, "Signal 58", +/* 59 */ 0, "Signal 59", +/* 60 */ "GRANT", "HFT monitor mode granted", +/* 61 */ "RETRACT", "HFT monitor mode should be relinguished", +/* 62 */ "SOUND", "HFT sound control has completed", +#ifdef SIGSAK +/* 63 */ "SAK", "Secure attention key", +#else +/* 63 */ 0, "Signal 63", +#endif +/* 64 */ 0, "Signal 64", +#endif /* IBMAIX */ + +# ifdef _SEQUENT_ +# define _sigextra_ +/* 20 */ "WINCH", "Window changed", +/* 21 */ 0, "Signal 21", +/* 22 */ "POLL", "Stream I/O pending", +# ifdef SUSPENDED +/* 23 */ "STOP", "Suspended (signal)", +/* 24 */ "TSTP", "Suspended", +/* 25 */ "CONT", "Continued", +/* 26 */ "TTIN", "Suspended (tty input)", +/* 27 */ "TTOU", "Suspended (tty output)", +# else /* SUSPENDED */ +/* 23 */ "STOP", "Stopped (signal)", +/* 24 */ "TSTP", "Stopped", +/* 25 */ "CONT", "Continued", +/* 26 */ "TTIN", "Stopped (tty input)", +/* 27 */ "TTOU", "Stopped (tty output)", +# endif /* SUSPENDED */ +/* 28 */ 0, "Signal 28", +/* 29 */ 0, "Signal 29", +/* 30 */ 0, "Signal 30", +/* 31 */ 0, "Signal 31", +/* 32 */ 0, "Signal 32", +# endif /* _SEQUENT_ */ + +# ifndef _sigextra_ +/* 20 */ 0, "Signal 20", +/* 21 */ 0, "Signal 21", +/* 22 */ 0, "Signal 22", +/* 23 */ 0, "Signal 23", +/* 24 */ 0, "Signal 24", +/* 25 */ 0, "Signal 25", +/* 26 */ 0, "Signal 26", +/* 27 */ 0, "Signal 27", +/* 28 */ 0, "Signal 28", +/* 29 */ 0, "Signal 29", +/* 30 */ 0, "Signal 30", +/* 31 */ 0, "Signal 31", +/* 32 */ 0, "Signal 32", +# endif /* _sigextra_ */ + + +#else /* bsd */ + +# ifdef _sigextra_ +# undef _sigextra_ +# endif /* _sigextra_ */ + +/* 16 */ "URG", "Urgent condition on IO channel", +# ifdef SUSPENDED +/* 17 */ "STOP", "Suspended (signal)", +/* 18 */ "TSTP", "Suspended", +# else /* SUSPENDED */ +/* 17 */ "STOP", "Stopped (signal)", +/* 18 */ "TSTP", "Stopped", +# endif /* SUSPENDED */ +/* 19 */ "CONT", "Continued", +/* 20 */ "CHLD", "Child exited", +# ifdef SUSPENDED +/* 21 */ "TTIN", "Suspended (tty input)", +/* 22 */ "TTOU", "Suspended (tty output)", +# else /* SUSPENDED */ +/* 21 */ "TTIN", "Stopped (tty input)", +/* 22 */ "TTOU", "Stopped (tty output)", +# endif /* SUSPENDED */ +/* 23 */ "IO", "IO possible interrupt", +/* 24 */ "XCPU", "Cputime limit exceeded", +/* 25 */ "XFSZ", "Filesize limit exceeded", +/* 26 */ "VTALRM", "Virtual time alarm", +/* 27 */ "PROF", "Profiling time alarm", + +# if defined(sun) || defined(ultrix) || defined(hp9000) || defined(convex) || defined(__convex__) +# define _sigextra_ +/* 28 */ "WINCH", "Window changed", +/* 29 */ "LOST", "Resource lost", +/* 30 */ "USR1", "User signal 1", +/* 31 */ "USR2", "User signal 2", +/* 32 */ 0, "Signal 32", +# endif /* sun */ + +# ifdef pyr +# define _sigextra_ +/* 28 */ "USR1", "User signal 1", +/* 29 */ "USR2", "User signal 2", +/* 30 */ "PWR", "Power failure", +/* 31 */ 0, "Signal 31", +/* 32 */ 0, "Signal 32", +# endif /* pyr */ + +# ifndef _sigextra_ +/* 28 */ "WINCH", "Window size changed", +# ifdef RENO +/* 29 */ "INFO", "Information request", +# else +/* 29 */ 0, "Signal 29", +# endif /* RENO */ +/* 30 */ "USR1", "User defined signal 1", +/* 31 */ "USR2", "User defined signal 2", +/* 32 */ 0, "Signal 32", +# endif /* _sigextra_ */ + + +#endif /* (SVID > 0) || DGUX || IBMAIX */ + +/* These are here for systems with bad NSIG */ +#ifndef POSIX +/* 33 */ 0, "Signal 33" +#else /* POSIX */ +/* 65 */ 0, "Signal 65" +#endif /* POSIX */ +}; diff --git a/bin/tcsh/sh.lex.c b/bin/tcsh/sh.lex.c new file mode 100644 index 0000000..197361c --- /dev/null +++ b/bin/tcsh/sh.lex.c @@ -0,0 +1,1605 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/sh.lex.c,v 3.0 1991/07/04 21:49:28 christos Exp $ */ +/* + * sh.lex.c: Lexical analysis into tokens + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#include "config.h" +#if !defined(lint) && !defined(pdp11) +static char *rcsid() + { return "$Id: sh.lex.c,v 3.0 1991/07/04 21:49:28 christos Exp $"; } +#endif + +#include "sh.h" +#include "ed.h" + +/* + * C shell + */ + +/* + * These lexical routines read input and form lists of words. + * There is some involved processing here, because of the complications + * of input buffering, and especially because of history substitution. + */ +static Char *word __P((void)); +static int getC1 __P((int)); +static void getdol __P((void)); +static void getexcl __P((int)); +static struct Hist *findev __P((Char *, bool)); +static void setexclp __P((Char *)); +static int bgetc __P((void)); +static void bfree __P((void)); +static struct wordent *gethent __P((int)); +static int matchs __P((Char *, Char *)); +static int getsel __P((int *, int *, int)); +static struct wordent *getsub __P((struct wordent *)); +static Char *subword __P((Char *, int, bool *)); +static struct wordent *dosub __P((int, struct wordent *, bool)); + +/* + * Peekc is a peek character for getC, peekread for readc. + * There is a subtlety here in many places... history routines + * will read ahead and then insert stuff into the input stream. + * If they push back a character then they must push it behind + * the text substituted by the history substitution. On the other + * hand in several places we need 2 peek characters. To make this + * all work, the history routines read with getC, and make use both + * of ungetC and unreadc. The key observation is that the state + * of getC at the call of a history reference is such that calls + * to getC from the history routines will always yield calls of + * readc, unless this peeking is involved. That is to say that during + * getexcl the variables lap, exclp, and exclnxt are all zero. + * + * Getdol invokes history substitution, hence the extra peek, peekd, + * which it can ungetD to be before history substitutions. + */ +static Char peekc = 0, peekd = 0; +static Char peekread = 0; + +/* (Tail of) current word from ! subst */ +static Char *exclp = NULL; + +/* The rest of the ! subst words */ +static struct wordent *exclnxt = NULL; + +/* Count of remaining words in ! subst */ +static int exclc = 0; + +/* "Globp" for alias resubstitution */ +static Char *alvecp = NULL; + +/* + * Labuf implements a general buffer for lookahead during lexical operations. + * Text which is to be placed in the input stream can be stuck here. + * We stick parsed ahead $ constructs during initial input, + * process id's from `$$', and modified variable values (from qualifiers + * during expansion in sh.dol.c) here. + */ +static Char labuf[BUFSIZ]; + +/* + * Lex returns to its caller not only a wordlist (as a "var" parameter) + * but also whether a history substitution occurred. This is used in + * the main (process) routine to determine whether to echo, and also + * when called by the alias routine to determine whether to keep the + * argument list. + */ +static bool hadhist = 0; + +/* + * Avoid alias expansion recursion via \!# + */ +int hleft; + +Char histline[BUFSIZ + 2]; /* last line input */ + + /* The +2 is to fool hp's optimizer */ +bool histvalid = 0; /* is histline valid */ +static Char *hist_p_line = NULL; /* current pointer into histline */ + +static Char getCtmp; + +#define getC(f) ((getCtmp = peekc) ? (peekc = 0, getCtmp) : getC1(f)) +#define ungetC(c) peekc = c +#define ungetD(c) peekd = c + +int +lex(hp) + register struct wordent *hp; +{ + register struct wordent *wdp; + int c; + + histvalid = 0; + hist_p_line = histline; + *hist_p_line = '\0'; + + lineloc = btell(); + hp->next = hp->prev = hp; + hp->word = STRNULL; + alvecp = 0, hadhist = 0; + do + c = readc(0); + while (c == ' ' || c == '\t'); + if (c == HISTSUB && intty) + /* ^lef^rit from tty is short !:s^lef^rit */ + getexcl(c); + else + unreadc(c); + wdp = hp; + /* + * The following loop is written so that the links needed by freelex will + * be ready and rarin to go even if it is interrupted. + */ + do { + register struct wordent *new; + + new = (struct wordent *) xmalloc((size_t) sizeof(*wdp)); + new->word = 0; + new->prev = wdp; + new->next = hp; + wdp->next = new; + wdp = new; + wdp->word = word(); + } while (wdp->word[0] != '\n'); + hp->prev = wdp; + if (hist_p_line < histline + BUFSIZ) { + *hist_p_line = '\0'; + if (hist_p_line > histline && hist_p_line[-1] == '\n') + hist_p_line[-1] = '\0'; + histvalid = 1; + } + else { + histline[BUFSIZ - 1] = '\0'; + } + return (hadhist); +} + +void +prlex(sp0) + struct wordent *sp0; +{ + register struct wordent *sp = sp0->next; + + for (;;) { + xprintf("%s", short2str(sp->word)); + sp = sp->next; + if (sp == sp0) + break; + if (sp->word[0] != '\n') + xputchar(' '); + } +} + +void +copylex(hp, fp) + register struct wordent *hp; + register struct wordent *fp; +{ + register struct wordent *wdp; + + wdp = hp; + fp = fp->next; + do { + register struct wordent *new; + + new = (struct wordent *) xmalloc((size_t) sizeof(*wdp)); + new->prev = wdp; + new->next = hp; + wdp->next = new; + wdp = new; + wdp->word = Strsave(fp->word); + fp = fp->next; + } while (wdp->word[0] != '\n'); + hp->prev = wdp; +} + +void +freelex(vp) + register struct wordent *vp; +{ + register struct wordent *fp; + + while (vp->next != vp) { + fp = vp->next; + vp->next = fp->next; + xfree((ptr_t) fp->word); + xfree((ptr_t) fp); + } + vp->prev = vp; +} + +static Char * +word() +{ + register Char c, c1; + register Char *wp; + Char wbuf[BUFSIZ]; + register bool dolflg; + register int i; + + wp = wbuf; + i = BUFSIZ - 4; +loop: + while ((c = getC(DOALL)) == ' ' || c == '\t'); + if (cmap(c, _META | _ESC)) + switch (c) { + case '&': + case '|': + case '<': + case '>': + *wp++ = c; + c1 = getC(DOALL); + if (c1 == c) + *wp++ = c1; + else + ungetC(c1); + goto ret; + + case '#': + if (intty) + break; + c = 0; + do { + c1 = c; + c = getC(0); + } while (c != '\n'); + if (c1 == '\\') + goto loop; + /* fall into ... */ + + case ';': + case '(': + case ')': + case '\n': + *wp++ = c; + goto ret; + + case '\\': + c = getC(0); + if (c == '\n') { + if (onelflg == 1) + onelflg = 2; + goto loop; + } + if (c != HIST) + *wp++ = '\\', --i; + c |= QUOTE; + } + c1 = 0; + dolflg = DOALL; + for (;;) { + if (c1) { + if (c == c1) { + c1 = 0; + dolflg = DOALL; + } + else if (c == '\\') { + c = getC(0); +/* + * PWP: this is dumb, but how all of the other shells work. If \ quotes + * a character OUTSIDE of a set of ''s, why shouldn't it quote EVERY + * following character INSIDE a set of ''s. + * + * Actually, all I really want to be able to say is 'foo\'bar' --> foo'bar + */ + if (c == HIST) + c |= QUOTE; + else { + if (bslash_quote && + ((c == '\'') || (c == '"') || + (c == '\\'))) { + c |= QUOTE; + } + else { + if (c == '\n') + /* + * if (c1 == '`') c = ' '; else + */ + c |= QUOTE; + ungetC(c); + c = '\\'; + } + } + } + else if (c == '\n') { + seterror(ERR_UNMATCHED, c1); + ungetC(c); + break; + } + } + else if (cmap(c, _META | _Q | _Q1 | _ESC)) { + if (c == '\\') { + c = getC(0); + if (c == '\n') { + if (onelflg == 1) + onelflg = 2; + break; + } + if (c != HIST) + *wp++ = '\\', --i; + c |= QUOTE; + } + else if (cmap(c, _Q | _Q1)) { /* '"` */ + c1 = c; + dolflg = c == '"' ? DOALL : DOEXCL; + } + else if (c != '#' || !intty) { + ungetC(c); + break; + } + } + if (--i > 0) { + *wp++ = c; + c = getC(dolflg); + } + else { + seterror(ERR_WTOOLONG); + wp = &wbuf[1]; + break; + } + } +ret: + *wp = 0; + return (Strsave(wbuf)); +} + +static int +getC1(flag) + register int flag; +{ + register Char c; + + while (1) { + if (c = peekc) { + peekc = 0; + return (c); + } + if (lap) { + if ((c = *lap++) == 0) + lap = 0; + else { + if (cmap(c, _META | _Q | _Q1)) + c |= QUOTE; + return (c); + } + } + if (c = peekd) { + peekd = 0; + return (c); + } + if (exclp) { + if (c = *exclp++) + return (c); + if (exclnxt && --exclc >= 0) { + exclnxt = exclnxt->next; + setexclp(exclnxt->word); + return (' '); + } + exclp = 0; + exclnxt = 0; + } + if (exclnxt) { + exclnxt = exclnxt->next; + if (--exclc < 0) + exclnxt = 0; + else + setexclp(exclnxt->word); + continue; + } + c = readc(0); + if (c == '$' && (flag & DODOL)) { + getdol(); + continue; + } + if (c == HIST && (flag & DOEXCL)) { + getexcl(0); + continue; + } + break; + } + return (c); +} + +static void +getdol() +{ + register Char *np, *ep; + Char name[4 * MAXVARLEN + 1]; + register int c; + int sc; + bool special = 0, toolong; + + np = name, *np++ = '$'; + c = sc = getC(DOEXCL); + if (any("\t \n", c)) { + ungetD(c); + ungetC('$' | QUOTE); + return; + } + if (c == '{') + *np++ = c, c = getC(DOEXCL); + if (c == '#' || c == '?') + special++, *np++ = c, c = getC(DOEXCL); + *np++ = c; + switch (c) { + + case '<': + case '$': + if (special) + seterror(ERR_SPDOLLT); + *np = 0; + addla(name); + return; + + case '\n': + ungetD(c); + np--; + seterror(ERR_NEWLINE); + *np = 0; + addla(name); + return; + + case '*': + if (special) + seterror(ERR_SPSTAR); + *np = 0; + addla(name); + return; + + default: + toolong = 0; + if (Isdigit(c)) { +#ifdef notdef + /* let $?0 pass for now */ + if (special) { + seterror(ERR_DIGIT); + *np = 0; + addla(name); + return; + } +#endif + /* we know that np < &name[4] */ + ep = &np[MAXVARLEN]; + while (c = getC(DOEXCL)) { + if (!Isdigit(c)) + break; + if (np < ep) + *np++ = c; + else + toolong = 1; + } + } + else if (letter(c)) { + /* we know that np < &name[4] */ + ep = &np[MAXVARLEN]; + toolong = 0; + while (c = getC(DOEXCL)) { + /* Bugfix for ${v123x} from Chris Torek, DAS DEC-90. */ + if (!letter(c) && !Isdigit(c)) + break; + if (np < ep) + *np++ = c; + else + toolong = 1; + } + } + else { + *np = 0; + seterror(ERR_VARILL); + addla(name); + return; + } + if (toolong) { + seterror(ERR_VARTOOLONG); + *np = 0; + addla(name); + return; + } + break; + } + if (c == '[') { + *np++ = c; + /* + * Name up to here is a max of MAXVARLEN + 8. + */ + ep = &np[2 * MAXVARLEN + 8]; + do { + /* + * Michael Greim: Allow $ expansion to take place in selector + * expressions. (limits the number of characters returned) + */ + c = getC(DOEXCL | DODOL); + if (c == '\n') { + ungetD(c); + np--; + seterror(ERR_NLINDEX); + *np = 0; + addla(name); + return; + } + if (np < ep) + *np++ = c; + } while (c != ']'); + *np = '\0'; + if (np >= ep) { + seterror(ERR_SELOVFL); + addla(name); + return; + } + c = getC(DOEXCL); + } + /* + * Name up to here is a max of 2 * MAXVARLEN + 8. + */ + if (c == ':') { + /* + * if the :g modifier is followed by a newline, then error right away! + * -strike + */ + + int gmodflag = 0; + + *np++ = c, c = getC(DOEXCL); + if (c == 'g') + gmodflag++, *np++ = c, c = getC(DOEXCL); + *np++ = c; + if (!any("htrqxe", c)) { + if (gmodflag && c == '\n') + stderror(ERR_VARSYN); /* strike */ + seterror(ERR_VARMOD, c); + *np = 0; + addla(name); + return; + } + } + else + ungetD(c); + if (sc == '{') { + c = getC(DOEXCL); + if (c != '}') { + ungetD(c); + seterror(ERR_MISSING, '}'); + *np = 0; + addla(name); + return; + } + *np++ = c; + } + *np = 0; + addla(name); + return; +} + +void +addla(cp) + Char *cp; +{ + Char buf[BUFSIZ]; + + if (Strlen(cp) + (lap ? Strlen(lap) : 0) >= + (sizeof(labuf) - 4) / sizeof(Char)) { + seterror(ERR_EXPOVFL); + return; + } + if (lap) + (void) Strcpy(buf, lap); + (void) Strcpy(labuf, cp); + if (lap) + (void) Strcat(labuf, buf); + lap = labuf; +} + +static Char lhsb[32]; +static Char slhs[32]; +static Char rhsb[64]; +static int quesarg; + +static void +getexcl(sc) + Char sc; +{ + register struct wordent *hp, *ip; + int left, right, dol; + register int c; + + if (sc == 0) { + sc = getC(0); + if (sc != '{') { + ungetC(sc); + sc = 0; + } + } + quesarg = -1; + lastev = eventno; + hp = gethent(sc); + if (hp == 0) + return; + hadhist = 1; + dol = 0; + if (hp == alhistp) + for (ip = hp->next->next; ip != alhistt; ip = ip->next) + dol++; + else + for (ip = hp->next->next; ip != hp->prev; ip = ip->next) + dol++; + left = 0, right = dol; + if (sc == HISTSUB) { + ungetC('s'), unreadc(HISTSUB), c = ':'; + goto subst; + } + c = getC(0); + if (!any(":^$*-%", c)) + goto subst; + left = right = -1; + if (c == ':') { + c = getC(0); + unreadc(c); + if (letter(c) || c == '&') { + c = ':'; + left = 0, right = dol; + goto subst; + } + } + else + ungetC(c); + if (!getsel(&left, &right, dol)) + return; + c = getC(0); + if (c == '*') + ungetC(c), c = '-'; + if (c == '-') { + if (!getsel(&left, &right, dol)) + return; + c = getC(0); + } +subst: + exclc = right - left + 1; + while (--left >= 0) + hp = hp->next; + if (sc == HISTSUB || c == ':') { + do { + hp = getsub(hp); + c = getC(0); + } while (c == ':'); + } + unreadc(c); + if (sc == '{') { + c = getC(0); + if (c != '}') + seterror(ERR_BADBANG); + } + exclnxt = hp; +} + +static struct wordent * +getsub(en) + struct wordent *en; +{ + register Char *cp; + int delim; + register int c; + int sc; + bool global = 0; + Char orhsb[sizeof(rhsb) / sizeof(Char)]; + + exclnxt = 0; + sc = c = getC(0); + if (c == 'g') + global++, sc = c = getC(0); + + switch (c) { + case 'p': + justpr++; + return (en); + + case 'x': + case 'q': + global++; + + /* fall into ... */ + + case 'h': + case 'r': + case 't': + case 'e': + break; + + case '&': + if (slhs[0] == 0) { + seterror(ERR_NOSUBST); + return (en); + } + (void) Strcpy(lhsb, slhs); + break; + +#ifdef notdef + case '~': + if (lhsb[0] == 0) + goto badlhs; + break; +#endif + + case 's': + delim = getC(0); + if (letter(delim) || Isdigit(delim) || any(" \t\n", delim)) { + unreadc(delim); + lhsb[0] = 0; + seterror(ERR_BADSUBST); + return (en); + } + cp = lhsb; + for (;;) { + c = getC(0); + if (c == '\n') { + unreadc(c); + break; + } + if (c == delim) + break; + if (cp > &lhsb[sizeof(lhsb) / sizeof(Char) - 2]) { + lhsb[0] = 0; + seterror(ERR_BADSUBST); + return (en); + } + if (c == '\\') { + c = getC(0); + if (c != delim && c != '\\') + *cp++ = '\\'; + } + *cp++ = c; + } + if (cp != lhsb) + *cp++ = 0; + else if (lhsb[0] == 0) { + seterror(ERR_LHS); + return (en); + } + cp = rhsb; + (void) Strcpy(orhsb, cp); + for (;;) { + c = getC(0); + if (c == '\n') { + unreadc(c); + break; + } + if (c == delim) + break; +#ifdef notdef + if (c == '~') { + if (&cp[Strlen(orhsb)] > &rhsb[sizeof(rhsb) / + sizeof(Char) - 2]) + goto toorhs; + (void) Strcpy(cp, orhsb); + cp = Strend(cp); + continue; + } +#endif + if (cp > &rhsb[sizeof(rhsb) / sizeof(Char) - 2]) { + seterror(ERR_RHSLONG); + return (en); + } + if (c == '\\') { + c = getC(0); + if (c != delim /* && c != '~' */ ) + *cp++ = '\\'; + } + *cp++ = c; + } + *cp++ = 0; + break; + + default: + if (c == '\n') + unreadc(c); + seterror(ERR_BADBANGMOD, c); + return (en); + } + (void) Strcpy(slhs, lhsb); + if (exclc) + en = dosub(sc, en, global); + return (en); +} + +static struct wordent * +dosub(sc, en, global) + int sc; + struct wordent *en; + bool global; +{ + struct wordent lexi; + bool didsub = 0; + struct wordent *hp = &lexi; + register struct wordent *wdp; + register int i = exclc; + + wdp = hp; + while (--i >= 0) { + register struct wordent *new = (struct wordent *) + xcalloc(1, sizeof *wdp); + + new->word = 0; + new->prev = wdp; + new->next = hp; + wdp->next = new; + wdp = new; + en = en->next; + wdp->word = (en->word && (global ||didsub == 0)) ? + subword(en->word, sc, &didsub) : Strsave(en->word); + } + if (didsub == 0) + seterror(ERR_MODFAIL); + hp->prev = wdp; + return (&enthist(-1000, &lexi, 0)->Hlex); +} + +static Char * +subword(cp, type, adid) + Char *cp; + int type; + bool *adid; +{ + Char wbuf[BUFSIZ]; + register Char *wp, *mp, *np; + register int i; + + switch (type) { + + case 'r': + case 'e': + case 'h': + case 't': + case 'q': + case 'x': + wp = domod(cp, type); + if (wp == 0) + return (Strsave(cp)); + *adid = 1; + return (wp); + + default: + wp = wbuf; + i = BUFSIZ - 4; + for (mp = cp; *mp; mp++) + if (matchs(mp, lhsb)) { + for (np = cp; np < mp;) + *wp++ = *np++, --i; + for (np = rhsb; *np; np++) + switch (*np) { + + case '\\': + if (np[1] == '&') + np++; + /* fall into ... */ + + default: + if (--i < 0) { + seterror(ERR_SUBOVFL); + return (STRNULL); + } + *wp++ = *np; + continue; + + case '&': + i -= Strlen(lhsb); + if (i < 0) { + seterror(ERR_SUBOVFL); + return (STRNULL); + } + *wp = 0; + (void) Strcat(wp, lhsb); + wp = Strend(wp); + continue; + } + mp += Strlen(lhsb); + i -= Strlen(mp); + if (i < 0) { + seterror(ERR_SUBOVFL); + return (STRNULL); + } + *wp = 0; + (void) Strcat(wp, mp); + *adid = 1; + return (Strsave(wbuf)); + } + return (Strsave(cp)); + } +} + +Char * +domod(cp, type) + Char *cp; + int type; +{ + register Char *wp, *xp; + register int c; + + switch (type) { + + case 'x': + case 'q': + wp = Strsave(cp); + for (xp = wp; c = *xp; xp++) + if ((c != ' ' && c != '\t') || type == 'q') + *xp |= QUOTE; + return (wp); + + case 'h': + case 't': + if (!any(short2str(cp), '/')) + return (type == 't' ? Strsave(cp) : 0); + wp = Strend(cp); + while (*--wp != '/') + continue; + if (type == 'h') + xp = Strsave(cp), xp[wp - cp] = 0; + else + xp = Strsave(wp + 1); + return (xp); + + case 'e': + case 'r': + wp = Strend(cp); + for (wp--; wp >= cp && *wp != '/'; wp--) + if (*wp == '.') { + if (type == 'e') + xp = Strsave(wp + 1); + else + xp = Strsave(cp), xp[wp - cp] = 0; + return (xp); + } + return (Strsave(type == 'e' ? STRNULL : cp)); + } + return (0); +} + +static int +matchs(str, pat) + register Char *str, *pat; +{ + while (*str && *pat && *str == *pat) + str++, pat++; + return (*pat == 0); +} + +static int +getsel(al, ar, dol) + register int *al, *ar; + int dol; +{ + register int c = getC(0); + register int i; + bool first = *al < 0; + + switch (c) { + + case '%': + if (quesarg == -1) { + seterror(ERR_BADBANGARG); + return (0); + } + if (*al < 0) + *al = quesarg; + *ar = quesarg; + break; + + case '-': + if (*al < 0) { + *al = 0; + *ar = dol - 1; + unreadc(c); + } + return (1); + + case '^': + if (*al < 0) + *al = 1; + *ar = 1; + break; + + case '$': + if (*al < 0) + *al = dol; + *ar = dol; + break; + + case '*': + if (*al < 0) + *al = 1; + *ar = dol; + if (*ar < *al) { + *ar = 0; + *al = 1; + return (1); + } + break; + + default: + if (Isdigit(c)) { + i = 0; + while (Isdigit(c)) { + i = i * 10 + c - '0'; + c = getC(0); + } + if (i < 0) + i = dol + 1; + if (*al < 0) + *al = i; + *ar = i; + } + else if (*al < 0) + *al = 0, *ar = dol; + else + *ar = dol - 1; + unreadc(c); + break; + } + if (first) { + c = getC(0); + unreadc(c); + if (any("-$*", c)) + return (1); + } + if (*al > *ar || *ar > dol) { + seterror(ERR_BADBANGARG); + return (0); + } + return (1); + +} + +static struct wordent * +gethent(sc) + int sc; +{ + register struct Hist *hp; + register Char *np; + register int c; + int event; + bool back = 0; + + c = sc == HISTSUB ? HIST : getC(0); + if (c == HIST) { + if (alhistp) + return (alhistp); + event = eventno; + } + else + switch (c) { + + case ':': + case '^': + case '$': + case '*': + case '%': + ungetC(c); + if (lastev == eventno && alhistp) + return (alhistp); + event = lastev; + break; + + case '#': /* !# is command being typed in (mrh) */ + if (--hleft == 0) { + seterror(ERR_HISTLOOP); + return (0); + } + else + return (¶ml); + /* NOTREACHED */ + + case '-': + back = 1; + c = getC(0); + /* FALLSTHROUGH */ + + default: + if (any("(=~", c)) { + unreadc(c); + ungetC(HIST); + return (0); + } + np = lhsb; + event = 0; + while (!any(": \t\\\n}", c)) { + if (event != -1 && Isdigit(c)) + event = event * 10 + c - '0'; + else + event = -1; + if (np < &lhsb[sizeof(lhsb) / sizeof(Char) - 2]) + *np++ = c; + c = getC(0); + } + unreadc(c); + if (np == lhsb) { + ungetC(HIST); + return (0); + } + *np++ = 0; + if (event != -1) { + /* + * History had only digits + */ + if (back) + event = eventno + (alhistp == 0) - (event ? event : 0); + break; + } + hp = findev(lhsb, 0); + if (hp) + lastev = hp->Hnum; + return (&hp->Hlex); + + case '?': + np = lhsb; + for (;;) { + c = getC(0); + if (c == '\n') { + unreadc(c); + break; + } + if (c == '?') + break; + if (np < &lhsb[sizeof(lhsb) / sizeof(Char) - 2]) + *np++ = c; + } + if (np == lhsb) { + if (lhsb[0] == 0) { + seterror(ERR_NOSEARCH); + return (0); + } + } + else + *np++ = 0; + hp = findev(lhsb, 1); + if (hp) + lastev = hp->Hnum; + return (&hp->Hlex); + } + + for (hp = Histlist.Hnext; hp; hp = hp->Hnext) + if (hp->Hnum == event) { + hp->Href = eventno; + lastev = hp->Hnum; + return (&hp->Hlex); + } + np = putn(event); + seterror(ERR_NOEVENT, short2str(np)); + return (0); +} + +static struct Hist * +findev(cp, anyarg) + Char *cp; + bool anyarg; +{ + register struct Hist *hp; + + for (hp = Histlist.Hnext; hp; hp = hp->Hnext) { + Char *dp; + register Char *p, *q; + register struct wordent *lp = hp->Hlex.next; + int argno = 0; + + /* + * The entries added by alias substitution don't have a newline but do + * have a negative event number. Savehist() trims off these entries, + * but it happens before alias expansion, too early to delete those + * from the previous command. + */ + if (hp->Hnum < 0) + continue; + if (lp->word[0] == '\n') + continue; + if (!anyarg) { + p = cp; + q = lp->word; + do + if (!*p) + return (hp); + while (*p++ == *q++); + continue; + } + do { + for (dp = lp->word; *dp; dp++) { + p = cp; + q = dp; + do + if (!*p) { + quesarg = argno; + return (hp); + } + while (*p++ == *q++); + } + lp = lp->next; + argno++; + } while (lp->word[0] != '\n'); + } + seterror(ERR_NOEVENT, short2str(cp)); + return (0); +} + + +static void +setexclp(cp) + register Char *cp; +{ + if (cp && cp[0] == '\n') + return; + exclp = cp; +} + +void +unreadc(c) + Char c; +{ + peekread = c; +} + +int +readc(wanteof) + bool wanteof; +{ + register int c; + static sincereal; + + if (c = peekread) { + peekread = 0; + return (c); + } +top: + if (alvecp) { + if (c = *alvecp++) + return (c); + if (*alvec) { + alvecp = *alvec++; + return (' '); + } + } + if (alvec) { + if (alvecp = *alvec) { + alvec++; + goto top; + } + /* Infinite source! */ + return ('\n'); + } + if (evalp) { + if (c = *evalp++) + return (c); + if (*evalvec) { + evalp = *evalvec++; + return (' '); + } + evalp = 0; + } + if (evalvec) { + if (evalvec == (Char **) 1) { + doneinp = 1; + reset(); + } + if (evalp = *evalvec) { + evalvec++; + goto top; + } + evalvec = (Char **) 1; + return ('\n'); + } + do { + if (arginp == (Char *) 1 || onelflg == 1) { + if (wanteof) + return (-1); + exitstat(); + } + if (arginp) { + if ((c = *arginp++) == 0) { + arginp = (Char *) 1; + return ('\n'); + } + return (c); + } +reread: + c = bgetc(); + if (c < 0) { +#ifndef POSIX +#ifdef TERMIO +#include + struct termio tty; + +#else /* SGTTYB */ +#include + struct sgttyb tty; + +#endif /* TERMIO */ +#else /* POSIX */ +#include + struct termios tty; + +#endif /* POSIX */ + if (wanteof) + return (-1); + /* was isatty but raw with ignoreeof yields problems */ +#ifndef POSIX +#ifdef TERMIO + if (ioctl(SHIN, TCGETA, (ioctl_t) & tty) == 0 && + (tty.c_lflag & ICANON)) +#else /* GSTTYB */ + if (ioctl(SHIN, TIOCGETP, (ioctl_t) & tty) == 0 && + (tty.sg_flags & RAW) == 0) +#endif /* TERMIO */ +#else /* POSIX */ + if (tcgetattr(SHIN, &tty) == 0 && + (tty.c_lflag & ICANON)) +#endif /* POSIX */ + { + /* was 'short' for FILEC */ + int ctpgrp; + + if (++sincereal > 25) + goto oops; +#ifdef BSDJOBS + if (tpgrp != -1 && + (ctpgrp = tcgetpgrp(FSHTTY)) != -1 && + tpgrp != ctpgrp) { + (void) tcsetpgrp(FSHTTY, tpgrp); + (void) killpg((pid_t) ctpgrp, SIGHUP); + xprintf("Reset tty pgrp from %d to %d\n", ctpgrp, tpgrp); + goto reread; + } +#endif /* BSDJOBS */ + if (adrof(STRig_eof)) { + if (loginsh) + xprintf("\nUse \"logout\" to logout.\n"); + else + xprintf("\nUse \"exit\" to leave tcsh.\n"); + reset(); + } + if (chkstop == 0) + panystop(1); + } + oops: + doneinp = 1; + reset(); + } + sincereal = 0; + if (c == '\n' && onelflg) + onelflg--; + } while (c == 0); + if (hist_p_line < histline + BUFSIZ) + *hist_p_line++ = c; + return (c); +} + +static int +bgetc() +{ + register int buf, off, c; + register int numleft = 0, roomleft; + extern Char InputBuf[]; + char tbuf[BUFSIZ + 1]; + + if (cantell) { + if (fseekp < fbobp || fseekp > feobp) { + fbobp = feobp = fseekp; + (void) lseek(SHIN, fseekp, L_SET); + } + if (fseekp == feobp) { + int i; + + fbobp = feobp; + do + c = read(SHIN, tbuf, BUFSIZ); + while (c < 0 && errno == EINTR); + if (c <= 0) + return (-1); + for (i = 0; i < c; i++) + fbuf[0][i] = (unsigned char) tbuf[i]; + feobp += c; + } + c = fbuf[0][fseekp - fbobp]; + fseekp++; + return (c); + } +again: + buf = (int) fseekp / BUFSIZ; + if (buf >= fblocks) { + register Char **nfbuf = + (Char **) xcalloc((size_t) (fblocks + 2), + sizeof(Char **)); + + if (fbuf) { + (void) blkcpy(nfbuf, fbuf); + xfree((ptr_t) fbuf); + } + fbuf = nfbuf; + fbuf[fblocks] = (Char *) xcalloc(BUFSIZ, sizeof(Char)); + fblocks++; + if (!intty) + goto again; + } + if (fseekp >= feobp) { + buf = (int) feobp / BUFSIZ; + off = (int) feobp % BUFSIZ; + roomleft = BUFSIZ - off; + for (;;) { + if (editing && intty) { /* then use twenex routine */ + c = numleft ? numleft : Inputl(); /* PWP: get a line */ + if (c > roomleft) { /* No room in this buffer? */ + /* start with fresh buffer */ + feobp = fseekp = fblocks * BUFSIZ; + numleft = c; + goto again; + } + if (c > 0) + copy((char *) (fbuf[buf] + off), + (char *) InputBuf, (int) (c * sizeof(Char))); + /* copy (fbuf[buf] + off, ttyline, c); */ + numleft = 0; + } + else { + c = read(SHIN, tbuf, (size_t) roomleft); + if (c > 0) { + int i; + Char *ptr = fbuf[buf] + off; + + for (i = 0; i < c; i++) + ptr[i] = (unsigned char) tbuf[i]; + } + } + if (c >= 0) + break; + switch (errno) { +#ifdef FIONBIO + static int zero = 0; + +#endif /* FIONBIO */ +#ifdef EWOULDBLOCK + case EWOULDBLOCK: +#endif /* EWOULDBLOCK */ +#if defined(POSIX) && defined(EAGAIN) +#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN + case EAGAIN: +#endif /* EWOULDBLOCK && EWOULDBLOCK != EAGAIN */ +#endif /* POSIX && EAGAIN */ +#if defined(F_SETFL) && defined(O_NDELAY) + (void) fcntl(SHIN, F_SETFL, + fcntl(SHIN, F_GETFL, 0) & ~O_NDELAY); +#endif /* F_SETFL && O_NDELAY */ +#ifdef FIONBIO + (void) ioctl(SHIN, FIONBIO, (ioctl_t) & zero); +#endif /* FIONBIO */ +#if (defined(F_SETFL) && defined(O_NDELAY)) || defined(FIONBIO) + c = 0; +#endif /* (F_SETFL && O_NDELAY) || FIONBIO */ + break; +#ifdef _SEQUENT_ + case EBADF: +#endif /* _SEQUENT_ */ + case EINTR: + c = 0; + break; + default: + c = -1; + break; + } + if (c == -1) + break; + } + if (c <= 0) + return (-1); + feobp += c; + if (editing && !intty) + goto again; + } + c = fbuf[buf][(int) fseekp % BUFSIZ]; + fseekp++; + return (c); +} + +static void +bfree() +{ + register int sb, i; + + if (cantell) + return; + if (whyles) + return; + sb = (int) (fseekp - 1) / BUFSIZ; + if (sb > 0) { + for (i = 0; i < sb; i++) + xfree((ptr_t) fbuf[i]); + (void) blkcpy(fbuf, &fbuf[sb]); + fseekp -= BUFSIZ * sb; + feobp -= BUFSIZ * sb; + fblocks -= sb; + } +} + +void +bseek(l) + off_t l; +{ + + fseekp = l; + if (!cantell) { +#ifdef notdef + register struct whyle *wp; +#endif + if (!whyles) + return; +#ifdef notdef + /* + * Christos: I don't understand this? both wp and l are local. What is + * this used for? I suspect the author meant fseek = wp->w_start + */ + for (wp = whyles; wp->w_next; wp = wp->w_next) + continue; + if (wp->w_start > l) + l = wp->w_start; +#endif + } +} + +/* any similarity to bell telephone is purely accidental */ +#ifndef btell +off_t +btell() +{ + return (fseekp); +} + +#endif + +void +btoeof() +{ + (void) lseek(SHIN, (off_t) 0, L_XTND); + fseekp = feobp; + wfree(); + bfree(); +} + +void +settell() +{ + cantell = 0; + if (arginp || onelflg || intty) + return; + if (lseek(SHIN, (off_t) 0, L_INCR) < 0 || errno == ESPIPE) + return; + fbuf = (Char **) xcalloc(2, sizeof(Char **)); + fblocks = 1; + fbuf[0] = (Char *) xcalloc(BUFSIZ, sizeof(Char)); + fseekp = fbobp = feobp = lseek(SHIN, (off_t) 0, L_INCR); + cantell = 1; +} diff --git a/bin/tcsh/sh.misc.c b/bin/tcsh/sh.misc.c new file mode 100644 index 0000000..517e62a --- /dev/null +++ b/bin/tcsh/sh.misc.c @@ -0,0 +1,460 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/sh.misc.c,v 3.2 1991/07/05 02:23:28 christos Exp $ */ +/* + * sh.misc.c: Miscelaneous functions + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#include "config.h" +#if !defined(lint) && !defined(pdp11) +static char *rcsid() + { return "$Id: sh.misc.c,v 3.2 1991/07/05 02:23:28 christos Exp $"; } +#endif + +#include "sh.h" + +static int renum __P((int, int)); + +/* + * C Shell + */ + +int +any(s, c) + register char *s; + register int c; +{ + if (!s) + return (0); /* Check for nil pointer */ + while (*s) + if (*s++ == c) + return (1); + return (0); +} + +void +setzero(cp, i) + char *cp; + int i; +{ + if (i != 0) + do + *cp++ = 0; + while (--i); +} + +char * +strsave(s) + register char *s; +{ + char *n; + register char *p; + + if (s == 0) + s = ""; + for (p = s; *p++;); + n = p = (char *) xmalloc((size_t) ((p - s) * sizeof(char))); + while (*p++ = *s++); + return (n); +} + +Char ** +blkend(up) + register Char **up; +{ + + while (*up) + up++; + return (up); +} + + +void +blkpr(av) + register Char **av; +{ + + for (; *av; av++) { + xprintf("%s", short2str(*av)); + if (av[1]) + xprintf(" "); + } +} + +int +blklen(av) + register Char **av; +{ + register int i = 0; + + while (*av++) + i++; + return (i); +} + +Char ** +blkcpy(oav, bv) + Char **oav; + register Char **bv; +{ + register Char **av = oav; + + while (*av++ = *bv++) + continue; + return (oav); +} + +Char ** +blkcat(up, vp) + Char **up, **vp; +{ + + (void) blkcpy(blkend(up), vp); + return (up); +} + +void +blkfree(av0) + Char **av0; +{ + register Char **av = av0; + + if (!av0) + return; + for (; *av; av++) + xfree((ptr_t) * av); + xfree((ptr_t) av0); +} + +Char ** +saveblk(v) + register Char **v; +{ + register Char **newv = + (Char **) xcalloc((size_t) (blklen(v) + 1), sizeof(Char **)); + Char **onewv = newv; + + while (*v) + *newv++ = Strsave(*v++); + return (onewv); +} + +#ifndef POSIX +char * +strstr(s, t) + register const char *s, *t; +{ + do { + register const char *ss = s; + register const char *tt = t; + + do + if (*tt == '\0') + return ((char *) s); + while (*ss++ == *tt++); + } while (*s++ != '\0'); + return (NULL); +} + +#endif /* POSIX */ + +#ifndef SHORT_STRINGS +char * +strspl(cp, dp) + char *cp, *dp; +{ + char *ep; + register char *p, *q; + + if (!cp) + cp = ""; + if (!dp) + dp = ""; + for (p = cp; *p++;); + for (q = dp; *q++;); + ep = (char *) xmalloc((size_t) (((p - cp) + (q - dp) - 1) * sizeof(char))); + for (p = ep, q = cp; *p++ = *q++;); + for (p--, q = dp; *p++ = *q++;); + return (ep); +} + +#endif + +Char ** +blkspl(up, vp) + register Char **up, **vp; +{ + register Char **wp = + (Char **) xcalloc((size_t) (blklen(up) + blklen(vp) + 1), + sizeof(Char **)); + + (void) blkcpy(wp, up); + return (blkcat(wp, vp)); +} + +Char +lastchr(cp) + register Char *cp; +{ + + if (!cp) + return (0); + if (!*cp) + return (0); + while (cp[1]) + cp++; + return (*cp); +} + +/* + * This routine is called after an error to close up + * any units which may have been left open accidentally. + */ +void +closem() +{ + register int f; + +#ifdef YPBUGS + /* suggested by Justin Bur; thanks to Karl Kleinpaste */ + fix_yp_bugs(); +#endif + for (f = 0; f < NOFILE; f++) + if (f != SHIN && f != SHOUT && f != SHDIAG && f != OLDSTD && + f != FSHTTY) + (void) close(f); +} + +#ifndef FIOCLEX +/* + * Close files before executing a file. + * We could be MUCH more intelligent, since (on a version 7 system) + * we need only close files here during a source, the other + * shell fd's being in units 16-19 which are closed automatically! + */ +void +closech() +{ + register int f; + + if (didcch) + return; + didcch = 1; + SHIN = 0; + SHOUT = 1; + SHDIAG = 2; + OLDSTD = 0; + isoutatty = isatty(SHOUT); + isdiagatty = isatty(SHDIAG); + for (f = 3; f < NOFILE; f++) + (void) close(f); +} + +#endif + +void +donefds() +{ + + (void) close(0); + (void) close(1); + (void) close(2); + didfds = 0; +} + +/* + * Move descriptor i to j. + * If j is -1 then we just want to get i to a safe place, + * i.e. to a unit > 2. This also happens in dcopy. + */ +int +dmove(i, j) + register int i, j; +{ + + if (i == j || i < 0) + return (i); +#ifdef DUP2 + if (j >= 0) { + (void) dup2(i, j); + if (j != i) + (void) close(i); + return (j); + } +#endif + j = dcopy(i, j); + if (j != i) + (void) close(i); + return (j); +} + +int +dcopy(i, j) + register int i, j; +{ + + if (i == j || i < 0 || j < 0 && i > 2) + return (i); +#ifdef DUP2 + if (j >= 0) { + (void) dup2(i, j); + return (j); + } +#endif + (void) close(j); + return (renum(i, j)); +} + +static int +renum(i, j) + register int i, j; +{ + register int k = dup(i); + + if (k < 0) + return (-1); + if (j == -1 && k > 2) + return (k); + if (k != j) { + j = renum(k, j); + (void) close(k); + return (j); + } + return (k); +} + +void +copy(to, from, size) + register char *to, *from; + register int size; +{ + + if (size && from && to) + do + *to++ = *from++; + while (--size != 0); +} + +/* + * Left shift a command argument list, discarding + * the first c arguments. Used in "shift" commands + * as well as by commands like "repeat". + */ +void +lshift(v, c) + register Char **v; + register int c; +{ + register Char **u = v; + + while (*u && --c >= 0) + xfree((ptr_t) * u++); + (void) blkcpy(v, u); +} + +int +number(cp) + Char *cp; +{ + if (!cp) + return (0); + if (*cp == '-') { + cp++; + if (!Isdigit(*cp)) + return (0); + cp++; + } + while (*cp && Isdigit(*cp)) + cp++; + return (*cp == 0); +} + +Char ** +copyblk(v) + register Char **v; +{ + register Char **nv = + (Char **) xcalloc((size_t) (blklen(v) + 1), sizeof(Char **)); + + return (blkcpy(nv, v)); +} + +#ifndef SHORT_STRINGS +char * +strend(cp) + register char *cp; +{ + if (!cp) + return (cp); + while (*cp) + cp++; + return (cp); +} + +#endif /* SHORT_STRINGS */ + +Char * +strip(cp) + Char *cp; +{ + register Char *dp = cp; + + if (!cp) + return (cp); + while (*dp++ &= TRIM) + continue; + return (cp); +} + +void +udvar(name) + Char *name; +{ + + setname(short2str(name)); + stderror(ERR_NAME | ERR_UNDVAR); +} + +int +prefix(sub, str) + register Char *sub, *str; +{ + + for (;;) { + if (*sub == 0) + return (1); + if (*str == 0) + return (0); + if (*sub++ != *str++) + return (0); + } +} diff --git a/bin/tcsh/sh.parse.c b/bin/tcsh/sh.parse.c new file mode 100644 index 0000000..3706eb5 --- /dev/null +++ b/bin/tcsh/sh.parse.c @@ -0,0 +1,689 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/sh.parse.c,v 3.0 1991/07/04 21:49:28 christos Exp $ */ +/* + * sh.parse.c: Interpret a list of tokens + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#include "config.h" +#if !defined(lint) && !defined(pdp11) +static char *rcsid() + { return "$Id: sh.parse.c,v 3.0 1991/07/04 21:49:28 christos Exp $"; } +#endif + +#include "sh.h" + +/* + * C shell + */ +static void asyntax __P((struct wordent *, struct wordent *)); +static void asyn0 __P((struct wordent *, struct wordent *)); +static void asyn3 __P((struct wordent *, struct wordent *)); +static struct wordent *freenod __P((struct wordent *, struct wordent *)); +static struct command *syn0 __P((struct wordent *, struct wordent *, int)); +static struct command *syn1 __P((struct wordent *, struct wordent *, int)); +static struct command *syn1a __P((struct wordent *, struct wordent *, int)); +static struct command *syn1b __P((struct wordent *, struct wordent *, int)); +static struct command *syn2 __P((struct wordent *, struct wordent *, int)); +static struct command *syn3 __P((struct wordent *, struct wordent *, int)); + +#define ALEFT 21 /* max of 20 alias expansions */ +#define HLEFT 11 /* max of 10 history expansions */ +/* + * Perform aliasing on the word list lex + * Do a (very rudimentary) parse to separate into commands. + * If word 0 of a command has an alias, do it. + * Repeat a maximum of 20 times. + */ +static int aleft; +extern int hleft; +void +alias(lex) + register struct wordent *lex; +{ + jmp_buf osetexit; + + aleft = ALEFT; + hleft = HLEFT; + getexit(osetexit); + (void) setexit(); + if (haderr) { + resexit(osetexit); + reset(); + } + if (--aleft == 0) + stderror(ERR_ALIASLOOP); + asyntax(lex->next, lex); + resexit(osetexit); +} + +static void +asyntax(p1, p2) + register struct wordent *p1, *p2; +{ + while (p1 != p2) + if (any(";&\n", p1->word[0])) + p1 = p1->next; + else { + asyn0(p1, p2); + return; + } +} + +static void +asyn0(p1, p2) + struct wordent *p1; + register struct wordent *p2; +{ + register struct wordent *p; + register int l = 0; + + for (p = p1; p != p2; p = p->next) + switch (p->word[0]) { + + case '(': + l++; + continue; + + case ')': + l--; + if (l < 0) + stderror(ERR_TOOMANYRP); + continue; + + case '>': + if (p->next != p2 && eq(p->next->word, STRand)) + p = p->next; + continue; + + case '&': + case '|': + case ';': + case '\n': + if (l != 0) + continue; + asyn3(p1, p); + asyntax(p->next, p2); + return; + } + if (l == 0) + asyn3(p1, p2); +} + +static void +asyn3(p1, p2) + struct wordent *p1; + register struct wordent *p2; +{ + register struct varent *ap; + struct wordent alout; + register bool redid; + + if (p1 == p2) + return; + if (p1->word[0] == '(') { + for (p2 = p2->prev; p2->word[0] != ')'; p2 = p2->prev) + if (p2 == p1) + return; + if (p2 == p1->next) + return; + asyn0(p1->next, p2); + return; + } + ap = adrof1(p1->word, &aliases); + if (ap == 0) + return; + alhistp = p1->prev; + alhistt = p2; + alvec = ap->vec; + redid = lex(&alout); + alhistp = alhistt = 0; + alvec = 0; + if (seterr) { + freelex(&alout); + stderror(ERR_OLD); + } + if (p1->word[0] && eq(p1->word, alout.next->word)) { + Char *cp = alout.next->word; + + alout.next->word = Strspl(STRQNULL, cp); + xfree((ptr_t) cp); + } + p1 = freenod(p1, redid ? p2 : p1->next); + if (alout.next != &alout) { + p1->next->prev = alout.prev->prev; + alout.prev->prev->next = p1->next; + alout.next->prev = p1; + p1->next = alout.next; + xfree((ptr_t) alout.prev->word); + xfree((ptr_t) (alout.prev)); + } + reset(); /* throw! */ +} + +static struct wordent * +freenod(p1, p2) + register struct wordent *p1, *p2; +{ + register struct wordent *retp = p1->prev; + + while (p1 != p2) { + xfree((ptr_t) p1->word); + p1 = p1->next; + xfree((ptr_t) (p1->prev)); + } + retp->next = p2; + p2->prev = retp; + return (retp); +} + +#define P_HERE 1 +#define P_IN 2 +#define P_OUT 4 +#define P_DIAG 8 + +/* + * syntax + * empty + * syn0 + */ +struct command * +syntax(p1, p2, flags) + register struct wordent *p1, *p2; + int flags; +{ + + while (p1 != p2) + if (any(";&\n", p1->word[0])) + p1 = p1->next; + else + return (syn0(p1, p2, flags)); + return (0); +} + +/* + * syn0 + * syn1 + * syn1 & syntax + */ +static struct command * +syn0(p1, p2, flags) + struct wordent *p1, *p2; + int flags; +{ + register struct wordent *p; + register struct command *t, *t1; + int l; + + l = 0; + for (p = p1; p != p2; p = p->next) + switch (p->word[0]) { + + case '(': + l++; + continue; + + case ')': + l--; + if (l < 0) + seterror(ERR_TOOMANYRP); + continue; + + case '|': + if (p->word[1] == '|') + continue; + /* fall into ... */ + + case '>': + if (p->next != p2 && eq(p->next->word, STRand)) + p = p->next; + continue; + + case '&': + if (l != 0) + break; + if (p->word[1] == '&') + continue; + t1 = syn1(p1, p, flags); + if (t1->t_dtyp == NODE_LIST || + t1->t_dtyp == NODE_AND || + t1->t_dtyp == NODE_OR) { + t = (struct command *) xcalloc(1, sizeof(*t)); + t->t_dtyp = NODE_PAREN; + t->t_dflg = F_AMPERSAND | F_NOINTERRUPT; + t->t_dspr = t1; + t1 = t; + } + else + t1->t_dflg |= F_AMPERSAND | F_NOINTERRUPT; + t = (struct command *) xcalloc(1, sizeof(*t)); + t->t_dtyp = NODE_LIST; + t->t_dflg = 0; + t->t_dcar = t1; + t->t_dcdr = syntax(p, p2, flags); + return (t); + } + if (l == 0) + return (syn1(p1, p2, flags)); + seterror(ERR_TOOMANYLP); + return (0); +} + +/* + * syn1 + * syn1a + * syn1a ; syntax + */ +static struct command * +syn1(p1, p2, flags) + struct wordent *p1, *p2; + int flags; +{ + register struct wordent *p; + register struct command *t; + int l; + + l = 0; + for (p = p1; p != p2; p = p->next) + switch (p->word[0]) { + + case '(': + l++; + continue; + + case ')': + l--; + continue; + + case ';': + case '\n': + if (l != 0) + break; + t = (struct command *) xcalloc(1, sizeof(*t)); + t->t_dtyp = NODE_LIST; + t->t_dcar = syn1a(p1, p, flags); + t->t_dcdr = syntax(p->next, p2, flags); + if (t->t_dcdr == 0) + t->t_dcdr = t->t_dcar, t->t_dcar = 0; + return (t); + } + return (syn1a(p1, p2, flags)); +} + +/* + * syn1a + * syn1b + * syn1b || syn1a + */ +static struct command * +syn1a(p1, p2, flags) + struct wordent *p1, *p2; + int flags; +{ + register struct wordent *p; + register struct command *t; + register int l = 0; + + for (p = p1; p != p2; p = p->next) + switch (p->word[0]) { + + case '(': + l++; + continue; + + case ')': + l--; + continue; + + case '|': + if (p->word[1] != '|') + continue; + if (l == 0) { + t = (struct command *) xcalloc(1, sizeof(*t)); + t->t_dtyp = NODE_OR; + t->t_dcar = syn1b(p1, p, flags); + t->t_dcdr = syn1a(p->next, p2, flags); + t->t_dflg = 0; + return (t); + } + continue; + } + return (syn1b(p1, p2, flags)); +} + +/* + * syn1b + * syn2 + * syn2 && syn1b + */ +static struct command * +syn1b(p1, p2, flags) + struct wordent *p1, *p2; + int flags; +{ + register struct wordent *p; + register struct command *t; + register int l = 0; + + for (p = p1; p != p2; p = p->next) + switch (p->word[0]) { + + case '(': + l++; + continue; + + case ')': + l--; + continue; + + case '&': + if (p->word[1] == '&' && l == 0) { + t = (struct command *) xcalloc(1, sizeof(*t)); + t->t_dtyp = NODE_AND; + t->t_dcar = syn2(p1, p, flags); + t->t_dcdr = syn1b(p->next, p2, flags); + t->t_dflg = 0; + return (t); + } + continue; + } + return (syn2(p1, p2, flags)); +} + +/* + * syn2 + * syn3 + * syn3 | syn2 + * syn3 |& syn2 + */ +static struct command * +syn2(p1, p2, flags) + struct wordent *p1, *p2; + int flags; +{ + register struct wordent *p, *pn; + register struct command *t; + register int l = 0; + int f; + + for (p = p1; p != p2; p = p->next) + switch (p->word[0]) { + + case '(': + l++; + continue; + + case ')': + l--; + continue; + + case '|': + if (l != 0) + continue; + t = (struct command *) xcalloc(1, sizeof(*t)); + f = flags | P_OUT; + pn = p->next; + if (pn != p2 && pn->word[0] == '&') { + f |= P_DIAG; + t->t_dflg |= F_STDERR; + } + t->t_dtyp = NODE_PIPE; + t->t_dcar = syn3(p1, p, f); + if (pn != p2 && pn->word[0] == '&') + p = pn; + t->t_dcdr = syn2(p->next, p2, flags | P_IN); + return (t); + } + return (syn3(p1, p2, flags)); +} + +static char RELPAR[] = {'<', '>', '(', ')', '\0'}; + +/* + * syn3 + * ( syn0 ) [ < in ] [ > out ] + * word word* [ < in ] [ > out ] + * KEYWORD ( word* ) word* [ < in ] [ > out ] + * + * KEYWORD = (@ exit foreach if set switch test while) + */ +static struct command * +syn3(p1, p2, flags) + struct wordent *p1, *p2; + int flags; +{ + register struct wordent *p; + struct wordent *lp, *rp; + register struct command *t; + register int l; + Char **av; + int n, c; + bool specp = 0; + + if (p1 != p2) { + p = p1; +again: + switch (srchx(p->word)) { + + case T_ELSE: + p = p->next; + if (p != p2) + goto again; + break; + + case T_EXIT: + case T_FOREACH: + case T_IF: + case T_LET: + case T_SET: + case T_SWITCH: + case T_WHILE: + specp = 1; + break; + } + } + n = 0; + l = 0; + for (p = p1; p != p2; p = p->next) + switch (p->word[0]) { + + case '(': + if (specp) + n++; + l++; + continue; + + case ')': + if (specp) + n++; + l--; + continue; + + case '>': + case '<': + if (l != 0) { + if (specp) + n++; + continue; + } + if (p->next == p2) + continue; + if (any(RELPAR, p->next->word[0])) + continue; + n--; + continue; + + default: + if (!specp && l != 0) + continue; + n++; + continue; + } + if (n < 0) + n = 0; + t = (struct command *) xcalloc(1, sizeof(*t)); + av = (Char **) xcalloc((size_t) (n + 1), sizeof(Char **)); + t->t_dcom = av; + n = 0; + if (p2->word[0] == ')') + t->t_dflg = F_NOFORK; + lp = 0; + rp = 0; + l = 0; + for (p = p1; p != p2; p = p->next) { + c = p->word[0]; + switch (c) { + + case '(': + if (l == 0) { + if (lp != 0 && !specp) + seterror(ERR_BADPLP); + lp = p->next; + } + l++; + goto savep; + + case ')': + l--; + if (l == 0) + rp = p; + goto savep; + + case '>': + if (l != 0) + goto savep; + if (p->word[1] == '>') + t->t_dflg |= F_APPEND; + if (p->next != p2 && eq(p->next->word, STRand)) { + t->t_dflg |= F_STDERR, p = p->next; + if (flags & (P_OUT | P_DIAG)) { + seterror(ERR_OUTRED); + continue; + } + } + if (p->next != p2 && eq(p->next->word, STRbang)) + t->t_dflg |= F_OVERWRITE, p = p->next; + if (p->next == p2) { + seterror(ERR_MISRED); + continue; + } + p = p->next; + if (any(RELPAR, p->word[0])) { + seterror(ERR_MISRED); + continue; + } + if ((flags & P_OUT) && (flags & P_DIAG) == 0 || t->t_drit) + seterror(ERR_OUTRED); + else + t->t_drit = Strsave(p->word); + continue; + + case '<': + if (l != 0) + goto savep; + if (p->word[1] == '<') + t->t_dflg |= F_READ; + if (p->next == p2) { + seterror(ERR_MISRED); + continue; + } + p = p->next; + if (any(RELPAR, p->word[0])) { + seterror(ERR_MISRED); + continue; + } + if ((flags & P_HERE) && (t->t_dflg & F_READ)) + seterror(ERR_REDPAR); + else if ((flags & P_IN) || t->t_dlef) + seterror(ERR_INRED); + else + t->t_dlef = Strsave(p->word); + continue; + + savep: + if (!specp) + continue; + default: + if (l != 0 && !specp) + continue; + if (seterr == 0) + av[n] = Strsave(p->word); + n++; + continue; + } + } + if (lp != 0 && !specp) { + if (n != 0) + seterror(ERR_BADPLPS); + t->t_dtyp = NODE_PAREN; + t->t_dspr = syn0(lp, rp, P_HERE); + } + else { + if (n == 0) + seterror(ERR_NULLCOM); + t->t_dtyp = NODE_COMMAND; + } + return (t); +} + +void +freesyn(t) + register struct command *t; +{ + register Char **v; + + if (t == 0) + return; + switch (t->t_dtyp) { + + case NODE_COMMAND: + for (v = t->t_dcom; *v; v++) + xfree((ptr_t) * v); + xfree((ptr_t) (t->t_dcom)); + xfree((ptr_t) t->t_dlef); + xfree((ptr_t) t->t_drit); + break; + case NODE_PAREN: + freesyn(t->t_dspr); + xfree((ptr_t) t->t_dlef); + xfree((ptr_t) t->t_drit); + break; + + case NODE_AND: + case NODE_OR: + case NODE_PIPE: + case NODE_LIST: + freesyn(t->t_dcar), freesyn(t->t_dcdr); + break; + } + xfree((ptr_t) t); +} diff --git a/bin/tcsh/sh.print.c b/bin/tcsh/sh.print.c new file mode 100644 index 0000000..2c3a3e5 --- /dev/null +++ b/bin/tcsh/sh.print.c @@ -0,0 +1,226 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/sh.print.c,v 3.0 1991/07/04 21:49:28 christos Exp $ */ +/* + * sh.print.c: Primitive Output routines. + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#include "config.h" +#if !defined(lint) && !defined(pdp11) +static char *rcsid() + { return "$Id: sh.print.c,v 3.0 1991/07/04 21:49:28 christos Exp $"; } +#endif + +#include "sh.h" +#include "ed.h" + +extern int Tty_eight_bit; +extern int Tty_raw_mode; +extern Char GettingInput; + +int lbuffed = 1; /* true if line buffered */ + +static void p2dig __P((int)); + +/* + * C Shell + */ + +#ifdef RLIMIT_CPU +void +psecs(l) + long l; +{ + register int i; + + i = l / 3600; + if (i) { + xprintf("%d:", i); + i = l % 3600; + p2dig(i / 60); + goto minsec; + } + i = l; + xprintf("%d", i / 60); +minsec: + i %= 60; + xprintf(":"); + p2dig(i); +} + +#endif + +void +pcsecs(l) /* PWP: print mm:ss.dd, l is in sec*100 */ +#ifdef BSDTIMES + long l; + +#else /* BSDTIMES */ +#ifndef POSIX + time_t l; + +#else /* POSIX */ + clock_t l; + +#endif /* POSIX */ +#endif /* BSDTIMES */ +{ + register int i; + + i = l / 360000L; + if (i) { + xprintf("%d:", i); + i = (l % 360000L) / 100; + p2dig(i / 60); + goto minsec; + } + i = l / 100; + xprintf("%d", i / 60); +minsec: + i %= 60; + xprintf(":"); + p2dig(i); + xprintf("."); + p2dig((int) (l % 100)); +} + +static void +p2dig(i) + register int i; +{ + + xprintf("%d%d", i / 10, i % 10); +} + +char linbuf[BUFSIZ]; /* was 128 */ +char *linp = linbuf; +bool output_raw = 0; /* PWP */ + +void +xputchar(c) + register int c; +{ + int atr = 0; + + atr |= c & ATTRIBUTES & TRIM; + c &= CHAR | QUOTE; + if (!output_raw && (c & QUOTE) == 0) { + if (Iscntrl(c)) { + if (c != '\t' && c != '\n' && c != '\r') { + xputchar('^' | atr); + if (c == ASCII) + c = '?'; + else + c |= 0100; + } + } + else if (!Isprint(c)) { + xputchar('\\' | atr); + xputchar((((c >> 6) & 7) + '0') | atr); + xputchar((((c >> 3) & 7) + '0') | atr); + c = (c & 7) + '0'; + } + (void) putraw(c | atr); + } + else { + c &= TRIM; + if (haderr ? (didfds ? is2atty : isdiagatty) : + (didfds ? is1atty : isoutatty)) + SetAttributes(c | atr); + (void) putpure(c); + } + if (lbuffed && (c & CHAR) == '\n') + flush(); +} + +int +putraw(c) + register int c; +{ + if (haderr ? (didfds ? is2atty : isdiagatty) : + (didfds ? is1atty : isoutatty)) { + if (Tty_eight_bit == -1) + ed_set_tty_eight_bit(); + if (!Tty_eight_bit && (c & META)) { + c = (c & ~META) | STANDOUT; + } + SetAttributes(c); + } + return putpure(c); +} + +int +putpure(c) + register int c; +{ + c &= CHAR; + + *linp++ = c; + if (linp >= &linbuf[sizeof linbuf - 10]) + flush(); + return (1); +} + +void +draino() +{ + linp = linbuf; +} + +void +flush() +{ + register int unit; + + /* int lmode; */ + + if (linp == linbuf) + return; + if (GettingInput && !Tty_raw_mode && linp < &linbuf[sizeof linbuf - 10]) + return; + if (haderr) + unit = didfds ? 2 : SHDIAG; + else + unit = didfds ? 1 : SHOUT; +#ifdef COMMENT +#ifdef TIOCLGET + if (didfds == 0 && ioctl(unit, TIOCLGET, (ioctl_t) & lmode) == 0 && + lmode & LFLUSHO) { + lmode = LFLUSHO; + (void) ioctl(unit, TIOCLBIC, (ioclt_t) & lmode); + (void) write(unit, "\n", 1); + } +#endif +#endif + (void) write(unit, linbuf, (size_t) (linp - linbuf)); + linp = linbuf; +} diff --git a/bin/tcsh/sh.proc.c b/bin/tcsh/sh.proc.c new file mode 100644 index 0000000..dc827dc --- /dev/null +++ b/bin/tcsh/sh.proc.c @@ -0,0 +1,1863 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/sh.proc.c,v 3.1 1991/07/05 02:00:43 christos Exp $ */ +/* + * sh.proc.c: Job manipulations + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#include "config.h" +#if !defined(lint) && !defined(pdp11) +static char *rcsid() + { return "$Id: sh.proc.c,v 3.1 1991/07/05 02:00:43 christos Exp $"; } +#endif + +#include "sh.h" +#include "ed.h" + +/* + * a little complicated #include ! :-( + */ +#if SVID > 0 +# ifdef hpux +# ifndef __hpux +# include "tc.wait.h" /* 6.5 broke */ +# else +# ifndef POSIX +# define _BSD +# endif +# ifndef _CLASSIC_POSIX_TYPES +# define _CLASSIC_POSIX_TYPES +# endif +# include /* 7.0 fixed it again */ +# endif /* __hpux */ +# else /* hpux */ +# if defined(OREO) || defined(IRIS4D) || defined(POSIX) +# include +# else /* OREO || IRIS4D || POSIX */ +# include "tc.wait.h" +# endif /* OREO || IRIS4D || POSIX */ +# endif /* hpux */ +#else /* SVID == 0 */ +# include +#endif /* SVID == 0 */ + +#if !defined(NSIG) && defined(SIGMAX) +# define NSIG (SIGMAX+1) +#endif /* !NSIG && SIGMAX */ + +#ifdef aiws +# undef HZ +# define HZ 16 +#endif /* aiws */ + +#ifndef HZ +# define HZ 100 /* for division into seconds */ +#endif + +#ifndef WTERMSIG +# define WTERMSIG(w) (((union wait *) &(w))->w_termsig) +# define BSDWAIT +#endif /* !WTERMSIG */ +#ifndef WEXITSTATUS +# define WEXITSTATUS(w) (((union wait *) &(w))->w_retcode) +#endif /* !WEXITSTATUS */ +#ifndef WSTOPSIG +# define WSTOPSIG(w) (((union wait *) &(w))->w_stopsig) +#endif /* WSTOPSIG */ + +#ifndef WCOREDUMP +# ifdef BSDWAIT +# define WCOREDUMP(w) (((union wait *) &(w))->w_coredump) +# else /* !BSDWAIT */ +# define WCOREDUMP(w) ((w) & 0200) +# endif /* !BSDWAIT */ +#endif /* !WCOREDUMP */ + +/* + * C Shell - functions that manage processes, handling hanging, termination + */ + +#define BIGINDEX 9 /* largest desirable job index */ + +#ifdef BSDTIMES +# if defined(sun) || defined(hp9000) +static struct rusage zru = {{0L, 0L}, {0L, 0L}, 0L, 0L, 0L, 0L, + 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L}; + +# else /* !sun && !hp9000 */ +# ifdef masscomp +/* + * Initialization of this structure under RTU 4.1A & RTU 5.0 is problematic + * because the first two elements are unions of a time_t and a struct timeval. + * So we'll just have to trust the loader to do the "right thing", DAS DEC-90. + */ +static struct rusage zru; +# else /* masscomp */ +static struct rusage zru = {{0L, 0L}, {0L, 0L}, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0}; +# endif /* masscomp */ +# endif /* !sun && !hp9000 */ +#else /* ! BSDTIMES */ +# ifdef _SEQUENT_ +static struct pro_stats zru = {{0L, 0L}, {0L, 0L}, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; +# else /* !_SEQUENT_ */ +static struct tms zru = {0L, 0L, 0L, 0L}, lru = {0L, 0L, 0L, 0L}; +# endif /* !_SEQUENT_ */ +#endif /* !BSDTIMES */ + +#ifndef RUSAGE_CHILDREN +# define RUSAGE_CHILDREN -1 +#endif + +static void pflushall __P((void)); +static void pflush __P((struct process *)); +static void pclrcurr __P((struct process *)); +static void padd __P((struct command *)); +static int pprint __P((struct process *, int)); +static void ptprint __P((struct process *)); +static void pads __P((Char *)); +static void pkill __P((Char **v, int)); +static struct process *pgetcurr __P((struct process *)); +static void okpcntl __P((void)); + +/* + * pchild - called at interrupt level by the SIGCHLD signal + * indicating that at least one child has terminated or stopped + * thus at least one wait system call will definitely return a + * childs status. Top level routines (like pwait) must be sure + * to mask interrupts when playing with the proclist data structures! + */ +sigret_t +/*ARGSUSED*/ +pchild(snum) +int snum; +{ + register struct process *pp; + register struct process *fp; + register int pid; + extern int insource; +#ifdef BSDWAIT + union wait w; +#else /* !BSDWAIT */ + int w; +#endif /* !BSDWAIT */ + int jobflags; +#ifdef BSDTIMES + struct rusage ru; +#else /* !BSDTIMES */ +# ifdef _SEQUENT_ + struct pro_stats ru; + struct pro_stats cpst1, cpst2; + tmval_t tv; +# else /* !_SEQUENT_ */ + struct tms proctimes; + + if (!timesdone) { + timesdone++; + (void) times(&shtimes); + } +# endif /* _SEQUENT_ */ +#endif /* BSDTIMES */ + +#ifdef JOBDEBUG + xprintf("pchild()\n"); +#endif /* JOBDEBUG */ + +/* Christos on where the signal(SIGCHLD, pchild) shoud be: + * + * I think that it should go *after* the wait, unlike most signal handlers. + * + * In release two (for which I have manuals), it says that wait will remove + * the first child from the queue of dead children. + * All the rest of the children that die while in the signal handler of the + * SIGC(H)LD, will be placed in the queue. If signal is called to re-establish + * the signal handler, and there are items in the queue, the process will + * receive another SIGC(H)LD before signal returns. BTW this is from the + * manual page on comp-sim... Maybe it is not applicable to the hp's, but + * I read on the news in comp.unix.wizards or comp.unix.questions yesterday + * that another person was claiming the the signal() call should be after + * the wait(). + */ + +loop: + errno = 0; /* reset, just in case */ +#ifdef JOBDEBUG + xprintf("Waiting...\n"); + flush(); +#endif +#ifdef BSDJOBS +# ifdef BSDTIMES + /* both a wait3 and rusage */ +# ifndef BSDWAIT + pid = wait3(&w, + (setintr && (intty || insource) ? WNOHANG | WUNTRACED : WNOHANG), &ru); +# else /* BSDWAIT */ + pid = wait3(&w.w_status, + (setintr && (intty || insource) ? WNOHANG | WUNTRACED : WNOHANG), &ru); +# endif /* BSDWAIT */ +# else /* !BSDTIMES */ +# ifdef _SEQUENT_ + (void) get_pro_stats(&tv, PS_SELF, 0, &cpst1); + pid = waitpid(-1, &w, + (setintr && (intty || insource) ? WNOHANG | WUNTRACED : WNOHANG)); + (void) get_pro_stats(&tv, PS_SELF, 0, &cpst2); + pr_stat_sub(&cpst2, &cpst1, &ru); +# else /* !_SEQUENT_ */ +# ifndef POSIX + /* we have a wait3, but no rusage stuff */ + pid = wait3(&w.w_status, + (setintr && (intty || insource) ? WNOHANG | WUNTRACED : WNOHANG), 0); +# else /* POSIX */ + pid = waitpid(-1, &w, + (setintr && (intty || insource) ? WNOHANG | WUNTRACED : WNOHANG)); +# endif /* POSIX */ +# endif /* !_SEQUENT_ */ +# endif /* !BSDTIMES */ +#else /* !BSDJOBS */ +# ifdef BSDTIMES + /* both a wait3 and rusage */ +# ifdef hpux + pid = wait3(&w.w_status, WNOHANG, 0); +# else /* !hpux */ + pid = wait3(&w.w_status, WNOHANG, &ru); +# endif /* !hpux */ +# else /* !BSDTIMES */ +# if SVID < 3 + /* no wait3, therefore no rusage */ + /* on Sys V, this may hang. I hope it's not going to be a problem */ + pid = ourwait(&w.w_status); +# else /* SVID >= 3 */ + /* + * XXX: for greater than 3 we should use waitpid(). + * but then again, SVR4 falls into the POSIX/BSDJOBS category. + */ + pid = wait(&w.w_status); +# endif /* SVID >= 3 */ +# endif /* BSDTIMES */ +#endif /* BSDJOBS */ + +#ifdef JOBDEBUG + { + char buffer[100]; + xsprintf(buffer, "pid %d, retval %x termsig %x retcode %x\n", + pid, w, WTERMSIG(w), WEXITSTATUS(w)); + xprintf(buffer); + flush(); + } +#endif /* JOBDEBUG */ + + if (pid <= 0) { +#ifdef JOBDEBUG + xprintf("errno == %d\n", errno); +#endif + if (errno == EINTR) { + errno = 0; + goto loop; + } + pnoprocesses = pid == -1; +#ifndef SIGVOID + return (0); +#else /* !SIGVOID */ + return; +#endif /* SIGVOID */ + } + for (pp = proclist.p_next; pp != PNULL; pp = pp->p_next) + if (pid == pp->p_pid) + goto found; +#ifndef BSDJOBS + /* this should never have happened */ + stderror(ERR_SYNC, pid); + xexit(0); +#else /* BSDJOBS */ + goto loop; +#endif /* BSDJOBS */ +found: + if (pid == atoi(short2str(value(STRchild)))) + unsetv(STRchild); + pp->p_flags &= ~(PRUNNING | PSTOPPED | PREPORTED); + if (WIFSTOPPED(w)) { + pp->p_flags |= PSTOPPED; + pp->p_reason = WSTOPSIG(w); + } + else { + if (pp->p_flags & (PTIME | PPTIME) || adrof(STRtime)) +#ifndef BSDTIMES +# ifdef _SEQUENT_ + (void) get_pro_stats(&pp->p_etime, PS_SELF, NULL, NULL); +# else /* !_SEQUENT_ */ + pp->p_etime = times(&proctimes); +# endif /* !_SEQUENT_ */ +#else /* BSDTIMES */ + (void) gettimeofday(&pp->p_etime, NULL); +#endif /* BSDTIMES */ + + +#if defined(BSDTIMES) || defined(_SEQUENT_) + pp->p_rusage = ru; +#else /* !BSDTIMES && !_SEQUENT_ */ + (void) times(&proctimes); + pp->p_utime = proctimes.tms_cutime - shtimes.tms_cutime; + pp->p_stime = proctimes.tms_cstime - shtimes.tms_cstime; + shtimes = proctimes; +#endif /* !BSDTIMES && !_SEQUENT_ */ + if (WIFSIGNALED(w)) { + if (WTERMSIG(w) == SIGINT) + pp->p_flags |= PINTERRUPTED; + else + pp->p_flags |= PSIGNALED; + if (WCOREDUMP(w)) + pp->p_flags |= PDUMPED; + pp->p_reason = WTERMSIG(w); + } + else { + pp->p_reason = WEXITSTATUS(w); + if (pp->p_reason != 0) + pp->p_flags |= PAEXITED; + else + pp->p_flags |= PNEXITED; + } + } + jobflags = 0; + fp = pp; + do { + if ((fp->p_flags & (PPTIME | PRUNNING | PSTOPPED)) == 0 && + !child && adrof(STRtime) && +#ifdef BSDTIMES + fp->p_rusage.ru_utime.tv_sec + fp->p_rusage.ru_stime.tv_sec +#else /* !BSDTIMES */ +# ifdef _SEQUENT_ + fp->p_rusage.ps_utime.tv_sec + fp->p_rusage.ps_stime.tv_sec +# else /* !_SEQUENT_ */ +# ifndef POSIX + (fp->p_utime + fp->p_stime) / HZ +# else /* POSIX */ + (fp->p_utime + fp->p_stime) / CLK_TCK +# endif /* POSIX */ +# endif /* !_SEQUENT_ */ +#endif /* !BSDTIMES */ + >= atoi(short2str(value(STRtime)))) + fp->p_flags |= PTIME; + jobflags |= fp->p_flags; + } while ((fp = fp->p_friends) != pp); + pp->p_flags &= ~PFOREGND; + if (pp == pp->p_friends && (pp->p_flags & PPTIME)) { + pp->p_flags &= ~PPTIME; + pp->p_flags |= PTIME; + } + if ((jobflags & (PRUNNING | PREPORTED)) == 0) { + fp = pp; + do { + if (fp->p_flags & PSTOPPED) + fp->p_flags |= PREPORTED; + } while ((fp = fp->p_friends) != pp); + while (fp->p_pid != fp->p_jobid) + fp = fp->p_friends; + if (jobflags & PSTOPPED) { + if (pcurrent && pcurrent != fp) + pprevious = pcurrent; + pcurrent = fp; + } + else + pclrcurr(fp); + if (jobflags & PFOREGND) { + if (jobflags & (PSIGNALED | PSTOPPED | PPTIME) || +#ifdef IIASA + jobflags & PAEXITED || +#endif /* IIASA */ + !eq(dcwd->di_name, fp->p_cwd->di_name)) { + ; /* print in pjwait */ + } + /* PWP: print a newline after ^C */ + else if (jobflags & PINTERRUPTED) +#ifdef SHORT_STRINGS + xputchar('\r' | QUOTE), xputchar('\n'); +#else /* !SHORT_STRINGS */ + xprintf("\215\n"); /* \215 is a quoted ^M */ +#endif /* !SHORT_STRINGS */ +#ifdef notdef + else if ((jobflags & (PTIME|PSTOPPED)) == PTIME) + ptprint(fp); +#endif + } + else { + if (jobflags & PNOTIFY || adrof(STRnotify)) { +#ifdef SHORT_STRINGS + xputchar('\r' | QUOTE), xputchar('\n'); +#else /* !SHORT_STRINGS */ + xprintf("\215\n"); /* \215 is a quoted ^M */ +#endif /* !SHORT_STRINGS */ + (void) pprint(pp, NUMBER | NAME | REASON); + if ((jobflags & PSTOPPED) == 0) + pflush(pp); + { + extern Char GettingInput; + + if (GettingInput) { + errno = 0; + (void) Rawmode(); + ClearLines(); + ClearDisp(); + Refresh(); + } + } + } + else { + fp->p_flags |= PNEEDNOTE; + neednote++; + } + } + } +#ifdef BSDJOBS + goto loop; +#endif /* BSDJOBS */ +} + +void +pnote() +{ + register struct process *pp; + int flags; +#ifdef BSDSIGS + sigmask_t omask; +#endif /* BSDSIGS */ + + neednote = 0; + for (pp = proclist.p_next; pp != PNULL; pp = pp->p_next) { + if (pp->p_flags & PNEEDNOTE) { +#ifdef BSDSIGS + omask = sigblock(sigmask(SIGCHLD)); +#else /* !BSDSIGS */ + (void) sighold(SIGCHLD); +#endif /* !BSDSIGS */ + pp->p_flags &= ~PNEEDNOTE; + flags = pprint(pp, NUMBER | NAME | REASON); + if ((flags & (PRUNNING | PSTOPPED)) == 0) + pflush(pp); +#ifdef BSDSIGS + (void) sigsetmask(omask); +#else /* !BSDSIGS */ + (void) sigrelse(SIGCHLD); +#endif /* !BSDSIGS */ + } + } +} + +/* + * pwait - wait for current job to terminate, maintaining integrity + * of current and previous job indicators. + */ +void +pwait() +{ + register struct process *fp, *pp; +#ifdef BSDSIGS + sigmask_t omask; +#endif /* BSDSIGS */ + + /* + * Here's where dead procs get flushed. + */ +#ifdef BSDSIGS + omask = sigblock(sigmask(SIGCHLD)); +#else /* !BSDSIGS */ + (void) sighold(SIGCHLD); +#endif /* !BSDSIGS */ + for (pp = (fp = &proclist)->p_next; pp != PNULL; pp = (fp = pp)->p_next) + if (pp->p_pid == 0) { + fp->p_next = pp->p_next; + xfree((ptr_t) pp->p_command); + if (pp->p_cwd && --pp->p_cwd->di_count == 0) + if (pp->p_cwd->di_next == 0) + dfree(pp->p_cwd); + xfree((ptr_t) pp); + pp = fp; + } +#ifdef BSDSIGS + (void) sigsetmask(omask); +#else /* !BSDSIGS */ + (void) sigrelse(SIGCHLD); +# ifdef notdef + if (setintr) + sigignore(SIGINT); +# endif +#endif /* !BSDSIGS */ + pjwait(pcurrjob); +} + + +/* + * pjwait - wait for a job to finish or become stopped + * It is assumed to be in the foreground state (PFOREGND) + */ +void +pjwait(pp) + register struct process *pp; +{ + register struct process *fp; + int jobflags, reason; +#ifdef BSDSIGS + sigmask_t omask; +#endif /* BSDSIGS */ + + while (pp->p_pid != pp->p_jobid) + pp = pp->p_friends; + fp = pp; + + do { + if ((fp->p_flags & (PFOREGND | PRUNNING)) == PRUNNING) + xprintf("BUG: waiting for background job!\n"); + } while ((fp = fp->p_friends) != pp); + /* + * Now keep pausing as long as we are not interrupted (SIGINT), and the + * target process, or any of its friends, are running + */ + fp = pp; +#ifdef BSDSIGS + omask = sigblock(sigmask(SIGCHLD)); +#endif /* BSDSIGS */ + for (;;) { +#ifndef BSDSIGS + (void) sighold(SIGCHLD); +#endif /* !BSDSIGS */ + jobflags = 0; + do + jobflags |= fp->p_flags; + while ((fp = (fp->p_friends)) != pp); + if ((jobflags & PRUNNING) == 0) + break; +#ifdef JOBDEBUG + xprintf("starting to sigpause for SIGCHLD on %d\n", fp->p_pid); +#endif /* JOBDEBUG */ +#ifdef BSDSIGS + /* sigpause(sigblock((sigmask_t) 0) &~ sigmask(SIGCHLD)); */ + (void) sigpause(omask & ~sigmask(SIGCHLD)); +#else /* !BSDSIGS */ + (void) sigpause(SIGCHLD); +#endif /* !BSDSIGS */ + } +#ifdef BSDSIGS + (void) sigsetmask(omask); +#else /* !BSDSIGS */ + (void) sigrelse(SIGCHLD); +#endif /* !BSDSIGS */ +#ifdef BSDJOBS + if (tpgrp > 0) /* get tty back */ + (void) tcsetpgrp(FSHTTY, tpgrp); +#endif /* BSDJOBS */ + if ((jobflags & (PSIGNALED | PSTOPPED | PTIME)) || + !eq(dcwd->di_name, fp->p_cwd->di_name)) { + if (jobflags & PSTOPPED) { + xprintf("\n"); + if (adrof(STRl_jobs)) { + Char *jobcommand[3]; + + jobcommand[0] = STRjobs; + if (eq(value(STRl_jobs), STRlong)) + jobcommand[1] = STRml; + else + jobcommand[1] = NULL; + jobcommand[2] = NULL; + + dojobs(jobcommand); + (void) pprint(pp, SHELLDIR); + } + else + (void) pprint(pp, AREASON | SHELLDIR); + } + else + (void) pprint(pp, AREASON | SHELLDIR); + } + if ((jobflags & (PINTERRUPTED | PSTOPPED)) && setintr && + (!gointr || !eq(gointr, STRminus))) { + if ((jobflags & PSTOPPED) == 0) + pflush(pp); + pintr1(0); + /* NOTREACHED */ + } + reason = 0; + fp = pp; + do { + if (fp->p_reason) + reason = fp->p_flags & (PSIGNALED | PINTERRUPTED) ? + fp->p_reason | META : fp->p_reason; + } while ((fp = fp->p_friends) != pp); + if ((reason != 0) && (adrof(STRprintexitvalue))) /* PWP */ + xprintf("Exit %d\n", reason); + set(STRstatus, putn(reason)); + if (reason && exiterr) + exitstat(); + pflush(pp); + /* cwd_cmd(); *//* (PWP) this is what pre_cmd is for! */ +} + +/* + * dowait - wait for all processes to finish + */ +void +dowait() +{ + register struct process *pp; +#ifdef BSDSIGS + sigmask_t omask; +#endif /* BSDSIGS */ + + pjobs++; +#ifdef BSDSIGS + omask = sigblock(sigmask(SIGCHLD)); +loop: +#else /* !BSDSIGS */ + if (setintr) + (void) sigrelse(SIGINT); +loop: + (void) sighold(SIGCHLD); +#endif /* !BSDSIGS */ + for (pp = proclist.p_next; pp; pp = pp->p_next) + if (pp->p_pid && /* pp->p_pid == pp->p_jobid && */ + pp->p_flags & PRUNNING) { +#ifdef BSDSIGS + (void) sigpause((sigmask_t) 0); +#else /* !BSDSIGS */ + (void) sigpause(SIGCHLD); +#endif /* !BSDSIGS */ + goto loop; + } +#ifdef BSDSIGS + (void) sigsetmask(omask); +#else /* !BSDSIGS */ + (void) sigrelse(SIGCHLD); +#endif /* !BSDSIGS */ + pjobs = 0; +} + +/* + * pflushall - flush all jobs from list (e.g. at fork()) + */ +static void +pflushall() +{ + register struct process *pp; + + for (pp = proclist.p_next; pp != PNULL; pp = pp->p_next) + if (pp->p_pid) + pflush(pp); +} + +/* + * pflush - flag all process structures in the same job as the + * the argument process for deletion. The actual free of the + * space is not done here since pflush is called at interrupt level. + */ +static void +pflush(pp) + register struct process *pp; +{ + register struct process *np; + register int idx; + + if (pp->p_pid == 0) { + xprintf("BUG: process flushed twice"); + return; + } + while (pp->p_pid != pp->p_jobid) + pp = pp->p_friends; + pclrcurr(pp); + if (pp == pcurrjob) + pcurrjob = 0; + idx = pp->p_index; + np = pp; + do { + np->p_index = np->p_pid = 0; + np->p_flags &= ~PNEEDNOTE; + } while ((np = np->p_friends) != pp); + if (idx == pmaxindex) { + for (np = proclist.p_next, idx = 0; np; np = np->p_next) + if (np->p_index > idx) + idx = np->p_index; + pmaxindex = idx; + } +} + +/* + * pclrcurr - make sure the given job is not the current or previous job; + * pp MUST be the job leader + */ +static void +pclrcurr(pp) + register struct process *pp; +{ + if (pp == pcurrent) + if (pprevious != PNULL) { + pcurrent = pprevious; + pprevious = pgetcurr(pp); + } + else { + pcurrent = pgetcurr(pp); + pprevious = pgetcurr(pp); + } + else if (pp == pprevious) + pprevious = pgetcurr(pp); +} + +/* +4 here is 1 for '\0', 1 ea for << >& >> */ +static Char command[PMAXLEN + 4]; +static int cmdlen; +static Char *cmdp; + +/* + * palloc - allocate a process structure and fill it up. + * an important assumption is made that the process is running. + */ +void +palloc(pid, t) + int pid; + register struct command *t; +{ + register struct process *pp; + int i; + + pp = (struct process *) xcalloc(1, (size_t) sizeof(struct process)); + pp->p_pid = pid; + pp->p_flags = t->t_dflg & F_AMPERSAND ? PRUNNING : PRUNNING | PFOREGND; + if (t->t_dflg & F_TIME) + pp->p_flags |= PPTIME; + cmdp = command; + cmdlen = 0; + padd(t); + *cmdp++ = 0; + if (t->t_dflg & F_PIPEOUT) { + pp->p_flags |= PPOU; + if (t->t_dflg & F_STDERR) + pp->p_flags |= PDIAG; + } + pp->p_command = Strsave(command); + if (pcurrjob) { + struct process *fp; + + /* careful here with interrupt level */ + pp->p_cwd = 0; + pp->p_index = pcurrjob->p_index; + pp->p_friends = pcurrjob; + pp->p_jobid = pcurrjob->p_pid; + for (fp = pcurrjob; fp->p_friends != pcurrjob; fp = fp->p_friends); + fp->p_friends = pp; + } + else { + pcurrjob = pp; + pp->p_jobid = pid; + pp->p_friends = pp; + pp->p_cwd = dcwd; + dcwd->di_count++; + if (pmaxindex < BIGINDEX) + pp->p_index = ++pmaxindex; + else { + struct process *np; + + for (i = 1;; i++) { + for (np = proclist.p_next; np; np = np->p_next) + if (np->p_index == i) + goto tryagain; + pp->p_index = i; + if (i > pmaxindex) + pmaxindex = i; + break; + tryagain:; + } + } + if (pcurrent == PNULL) + pcurrent = pp; + else if (pprevious == PNULL) + pprevious = pp; + } + pp->p_next = proclist.p_next; + proclist.p_next = pp; +#ifdef BSDTIMES + (void) gettimeofday(&pp->p_btime, NULL); +#else /* !BSDTIMES */ +# ifdef _SEQUENT_ + (void) get_pro_stats(&pp->p_btime, PS_SELF, NULL, NULL); +# else /* !_SEQUENT_ */ + { + struct tms tmptimes; + + pp->p_btime = times(&tmptimes); + } +# endif /* !_SEQUENT_ */ +#endif /* !BSDTIMES */ +} + +static void +padd(t) + register struct command *t; +{ + Char **argp; + + if (t == 0) + return; + switch (t->t_dtyp) { + + case NODE_PAREN: + pads(STRL_parensp); + padd(t->t_dspr); + pads(STRspRparen); + break; + + case NODE_COMMAND: + for (argp = t->t_dcom; *argp; argp++) { + pads(*argp); + if (argp[1]) + pads(STRspace); + } + break; + + case NODE_OR: + case NODE_AND: + case NODE_PIPE: + case NODE_LIST: + padd(t->t_dcar); + switch (t->t_dtyp) { + case NODE_OR: + pads(STRsP2sp); + break; + case NODE_AND: + pads(STRspand2sp); + break; + case NODE_PIPE: + pads(STRsPsp); + break; + case NODE_LIST: + pads(STRsmsp); + break; + } + padd(t->t_dcdr); + return; + } + if ((t->t_dflg & F_PIPEIN) == 0 && t->t_dlef) { + pads((t->t_dflg & F_READ) ? STRspL_arrow2sp : STRspLarrowsp); + pads(t->t_dlef); + } + if ((t->t_dflg & F_PIPEOUT) == 0 && t->t_drit) { + pads((t->t_dflg & F_APPEND) ? STRspR_arrow2 : STRspRarrow); + if (t->t_dflg & F_STDERR) + pads(STRand); + pads(STRspace); + pads(t->t_drit); + } +} + +static void +pads(cp) + Char *cp; +{ + register int i; + + /* + * Avoid the Quoted Space alias hack! Reported by: + * sam@john-bigboote.ICS.UCI.EDU (Sam Horrocks) + */ + if (cp[0] == STRQNULL[0]) + cp++; + + i = Strlen(cp); + + if (cmdlen >= PMAXLEN) + return; + if (cmdlen + i >= PMAXLEN) { + (void) Strcpy(cmdp, STRsp3dots); + cmdlen = PMAXLEN; + cmdp += 4; + return; + } + (void) Strcpy(cmdp, cp); + cmdp += i; + cmdlen += i; +} + +/* + * psavejob - temporarily save the current job on a one level stack + * so another job can be created. Used for { } in exp6 + * and `` in globbing. + */ +void +psavejob() +{ + pholdjob = pcurrjob; + pcurrjob = PNULL; +} + +/* + * prestjob - opposite of psavejob. This may be missed if we are interrupted + * somewhere, but pendjob cleans up anyway. + */ +void +prestjob() +{ + pcurrjob = pholdjob; + pholdjob = PNULL; +} + +/* + * pendjob - indicate that a job (set of commands) has been completed + * or is about to begin. + */ +void +pendjob() +{ + register struct process *pp, *tp; + + if (pcurrjob && (pcurrjob->p_flags & (PFOREGND | PSTOPPED)) == 0) { + pp = pcurrjob; + while (pp->p_pid != pp->p_jobid) + pp = pp->p_friends; + xprintf("[%d]", pp->p_index); + tp = pp; + do { + xprintf(" %d", pp->p_pid); + pp = pp->p_friends; + } while (pp != tp); + xprintf("\n"); + } + pholdjob = pcurrjob = 0; +} + +/* + * pprint - print a job + */ +static int +pprint(pp, flag) + register struct process *pp; + bool flag; +{ + register status, reason; + struct process *tp; + extern char *linp, linbuf[]; + int jobflags, pstatus; + char *format; + + while (pp->p_pid != pp->p_jobid) + pp = pp->p_friends; + if (pp == pp->p_friends && (pp->p_flags & PPTIME)) { + pp->p_flags &= ~PPTIME; + pp->p_flags |= PTIME; + } + tp = pp; + status = reason = -1; + jobflags = 0; + do { + jobflags |= pp->p_flags; + pstatus = pp->p_flags & PALLSTATES; + if (tp != pp && linp != linbuf && !(flag & FANCY) && + (pstatus == status && pp->p_reason == reason || + !(flag & REASON))) + xprintf(" "); + else { + if (tp != pp && linp != linbuf) + xprintf("\n"); + if (flag & NUMBER) + if (pp == tp) + xprintf("[%d]%s %c ", pp->p_index, + pp->p_index < 10 ? " " : "", + pp == pcurrent ? '+' : + (pp == pprevious ? '-' : ' ')); + else + xprintf(" "); + if (flag & FANCY) { +#ifdef TCF + extern char *sitename(); + +#endif /* TCF */ + xprintf("%5d ", pp->p_pid); +#ifdef TCF + xprintf("%11s ", sitename(pp->p_pid)); +#endif /* TCF */ + } + if (flag & (REASON | AREASON)) { + if (flag & NAME) +#ifdef SUSPENDED + format = "%-23s"; +#else /* !SUSPENDED */ + format = "%-21s"; +#endif /* !SUSPENDED */ + else + format = "%s"; + if (pstatus == status) + if (pp->p_reason == reason) { + xprintf(format, ""); + goto prcomd; + } + else + reason = pp->p_reason; + else { + status = pstatus; + reason = pp->p_reason; + } + switch (status) { + + case PRUNNING: + xprintf(format, "Running "); + break; + + case PINTERRUPTED: + case PSTOPPED: + case PSIGNALED: + /* + * tell what happened to the background job + * From: Michael Schroeder + * + */ + if ((flag & REASON) + || ((flag & AREASON) + && reason != SIGINT + && (reason != SIGPIPE + || (pp->p_flags & PPOU) == 0))) + xprintf(format, mesg[pp->p_reason].pname); + else + reason = -1; + break; + + case PNEXITED: + case PAEXITED: + if (flag & REASON) + if (pp->p_reason) +#ifdef SUSPENDED + xprintf("Exit %-18d", pp->p_reason); +#else /* SUSPENDED */ + xprintf("Exit %-16d", pp->p_reason); +#endif /* SUSPENDED */ + else + xprintf(format, "Done"); + break; + + default: + xprintf("BUG: status=%-9o", status); + } + } + } +prcomd: + if (flag & NAME) { + xprintf("%s", short2str(pp->p_command)); + if (pp->p_flags & PPOU) + xprintf(" |"); + if (pp->p_flags & PDIAG) + xprintf("&"); + } + if (flag & (REASON | AREASON) && pp->p_flags & PDUMPED) + xprintf(" (core dumped)"); + if (tp == pp->p_friends) { + if (flag & AMPERSAND) + xprintf(" &"); + if (flag & JOBDIR && + !eq(tp->p_cwd->di_name, dcwd->di_name)) { + xprintf(" (wd: "); + dtildepr(value(STRhome), tp->p_cwd->di_name); + xprintf(")"); + } + } + if (pp->p_flags & PPTIME && !(status & (PSTOPPED | PRUNNING))) { + if (linp != linbuf) + xprintf("\n\t"); +#if defined(BSDTIMES) || defined(_SEQUENT_) + prusage(&zru, &pp->p_rusage, &pp->p_etime, + &pp->p_btime); +#else /* !BSDTIMES && !SEQUENT */ + lru.tms_utime = pp->p_utime; + lru.tms_stime = pp->p_stime; + lru.tms_cutime = 0; + lru.tms_cstime = 0; + prusage(&zru, &lru, pp->p_etime, + pp->p_btime); +#endif /* !BSDTIMES && !SEQUENT */ + + } + if (tp == pp->p_friends) { + if (linp != linbuf) + xprintf("\n"); + if (flag & SHELLDIR && !eq(tp->p_cwd->di_name, dcwd->di_name)) { + xprintf("(wd now: "); + dtildepr(value(STRhome), dcwd->di_name); + xprintf(")\n"); + } + } + } while ((pp = pp->p_friends) != tp); + if (jobflags & PTIME && (jobflags & (PSTOPPED | PRUNNING)) == 0) { + if (jobflags & NUMBER) + xprintf(" "); + ptprint(tp); + } + return (jobflags); +} + +static void +ptprint(tp) + register struct process *tp; +{ +#ifdef BSDTIMES + struct timeval tetime, diff; + static struct timeval ztime; + struct rusage ru; + static struct rusage zru; + register struct process *pp = tp; + + ru = zru; + tetime = ztime; + do { + ruadd(&ru, &pp->p_rusage); + tvsub(&diff, &pp->p_etime, &pp->p_btime); + if (timercmp(&diff, &tetime, >)) + tetime = diff; + } while ((pp = pp->p_friends) != tp); + prusage(&zru, &ru, &tetime, &ztime); +#else /* !BSDTIMES */ +# ifdef _SEQUENT_ +# define timercmp(tvp, uvp, cmp) \ + ((tvp)->tv_sec cmp (uvp)->tv_sec || \ + (tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec) + tmval_t tetime, diff; + static tmval_t ztime; + struct pro_stats ru; + static struct pro_stats zru; + register struct process *pp = tp; + + ru = zru; + tetime = ztime; + do { + ruadd(&ru, &pp->p_rusage); + tvsub(&diff, &pp->p_etime, &pp->p_btime); + if (timercmp(&diff, &tetime, >)) + tetime = diff; + } while ((pp = pp->p_friends) != tp); + prusage(&zru, &ru, &tetime, &ztime); +# else /* !_SEQUENT_ */ +# ifndef POSIX + static time_t ztime = 0; + static time_t zu_time = 0; + static time_t zs_time = 0; + time_t tetime, diff; + time_t u_time, s_time; + +# else /* POSIX */ + static clock_t ztime = 0; + static clock_t zu_time = 0; + static clock_t zs_time = 0; + clock_t tetime, diff; + clock_t u_time, s_time; + +# endif /* POSIX */ + struct tms zts, rts; + register struct process *pp = tp; + + u_time = zu_time; + s_time = zs_time; + tetime = ztime; + do { + u_time += pp->p_utime; + s_time += pp->p_stime; + diff = pp->p_etime - pp->p_btime; + if (diff > tetime) + tetime = diff; + } while ((pp = pp->p_friends) != tp); + zts.tms_utime = zu_time; + zts.tms_stime = zs_time; + zts.tms_cutime = 0; + zts.tms_cstime = 0; + rts.tms_utime = u_time; + rts.tms_stime = s_time; + rts.tms_cutime = 0; + rts.tms_cstime = 0; + prusage(&zts, &rts, tetime, ztime); +# endif /* !_SEQUENT_ */ +#endif /* !BSDTIMES */ +} + +/* + * dojobs - print all jobs + */ +void +dojobs(v) + Char **v; +{ + register struct process *pp; + register int flag = NUMBER | NAME | REASON; + int i; + + if (chkstop) + chkstop = 2; + if (*++v) { + if (v[1] || !eq(*v, STRml)) + stderror(ERR_JOBS); + flag |= FANCY | JOBDIR; + } + for (i = 1; i <= pmaxindex; i++) + for (pp = proclist.p_next; pp; pp = pp->p_next) + if (pp->p_index == i && pp->p_pid == pp->p_jobid) { + pp->p_flags &= ~PNEEDNOTE; + if (!(pprint(pp, flag) & (PRUNNING | PSTOPPED))) + pflush(pp); + break; + } +} + +/* + * dofg - builtin - put the job into the foreground + */ +void +dofg(v) + Char **v; +{ + register struct process *pp; + + okpcntl(); + ++v; + do { + pp = pfind(*v); + pstart(pp, 1); +#ifndef BSDSIGS +# ifdef notdef + if (setintr) + sigignore(SIGINT); +# endif +#endif /* !BSDSIGS */ + pjwait(pp); + } while (*v && *++v); +} + +/* + * %... - builtin - put the job into the foreground + */ +void +dofg1(v) + Char **v; +{ + register struct process *pp; + + okpcntl(); + pp = pfind(v[0]); + pstart(pp, 1); +#ifndef BSDSIGS +# ifdef notdef + if (setintr) + sigignore(SIGINT); +# endif +#endif /* !BSDSIGS */ + pjwait(pp); +} + +/* + * dobg - builtin - put the job into the background + */ +void +dobg(v) + Char **v; +{ + register struct process *pp; + + okpcntl(); + ++v; + do { + pp = pfind(*v); + pstart(pp, 0); + } while (*v && *++v); +} + +/* + * %... & - builtin - put the job into the background + */ +void +dobg1(v) + Char **v; +{ + register struct process *pp; + + pp = pfind(v[0]); + pstart(pp, 0); +} + +/* + * dostop - builtin - stop the job + */ +void +dostop(v) + Char **v; +{ +#ifdef BSDJOBS + pkill(++v, SIGSTOP); +#endif /* BSDJOBS */ +} + +/* + * dokill - builtin - superset of kill (1) + */ +void +dokill(v) + Char **v; +{ + register int signum, len = 0; + register char *name; + extern int T_Cols; + + v++; + if (v[0] && v[0][0] == '-') { + if (v[0][1] == 'l') { + for (signum = 1; signum <= NSIG; signum++) { + if ((name = mesg[signum].iname) != NULL) { + len += strlen(name) + 1; + if (len >= T_Cols - 1) { + xprintf("\n"); + len = strlen(name) + 1; + } + xprintf("%s ", name); + } + } + xprintf("\n"); + return; + } + if (Isdigit(v[0][1])) { + signum = atoi(short2str(v[0] + 1)); + if (signum < 0 || signum > NSIG) + stderror(ERR_NAME | ERR_BADSIG); + } + else { + for (signum = 1; signum <= NSIG; signum++) + if (mesg[signum].iname && + eq(&v[0][1], str2short(mesg[signum].iname))) + goto gotsig; + setname(short2str(&v[0][1])); + stderror(ERR_NAME | ERR_UNKSIG); + } +gotsig: + v++; + } + else + signum = SIGTERM; + pkill(v, signum); +} + +static void +pkill(v, signum) + Char **v; + int signum; +{ + register struct process *pp, *np; + register int jobflags = 0; + int pid, err1 = 0; +#ifdef BSDSIGS + sigmask_t omask; +#endif /* BSDSIGS */ + Char *cp; + +#ifdef BSDSIGS + omask = sigmask(SIGCHLD); + if (setintr) + omask |= sigmask(SIGINT); + omask = sigblock(omask) & ~omask; +#else /* !BSDSIGS */ + if (setintr) + (void) sighold(SIGINT); + (void) sighold(SIGCHLD); +#endif /* !BSDSIGS */ + gflag = 0, tglob(v); + if (gflag) { + v = globall(v); + if (v == 0) + stderror(ERR_NAME | ERR_NOMATCH); + } + else { + v = gargv = saveblk(v); + trim(v); + } + + while (v && (cp = *v)) { + if (*cp == '%') { + np = pp = pfind(cp); + do + jobflags |= np->p_flags; + while ((np = np->p_friends) != pp); +#ifdef BSDJOBS + switch (signum) { + + case SIGSTOP: + case SIGTSTP: + case SIGTTIN: + case SIGTTOU: + if ((jobflags & PRUNNING) == 0) { +# ifdef SUSPENDED + xprintf("%s: Already suspended\n", + short2str(cp)); +# else /* !SUSPENDED */ + xprintf("%s: Already stopped\n", + short2str(cp)); +# endif /* !SUSPENDED */ + err1++; + goto cont; + } + break; + /* + * suspend a process, kill -CONT %, then type jobs; the shell + * says it is suspended, but it is running; thanks jaap.. + */ + case SIGCONT: + pstart(pp, 0); + goto cont; + } +#endif /* BSDJOBS */ + if (killpg((pid_t) pp->p_jobid, signum) < 0) { + xprintf("%s: %s\n", short2str(cp), strerror(errno)); + err1++; + } +#ifdef BSDJOBS + if (signum == SIGTERM || signum == SIGHUP) + (void) killpg((pid_t) pp->p_jobid, SIGCONT); +#endif /* BSDJOBS */ + } + else if (!(Isdigit(*cp) || *cp == '-')) + stderror(ERR_NAME | ERR_JOBARGS); + else { + pid = atoi(short2str(cp)); + if (kill((pid_t) pid, signum) < 0) { + xprintf("%d: %s\n", pid, strerror(errno)); + err1++; + goto cont; + } +#ifdef BSDJOBS + if (signum == SIGTERM || signum == SIGHUP) + (void) kill((pid_t) pid, SIGCONT); +#endif /* BSDJOBS */ + } +cont: + v++; + } + if (gargv) + blkfree(gargv), gargv = 0; +#ifdef BSDSIGS + (void) sigsetmask(omask); +#else /* !BSDSIGS */ + (void) sigrelse(SIGCHLD); + if (setintr) + (void) sigrelse(SIGINT); +#endif /* !BSDSIGS */ + if (err1) + stderror(ERR_SILENT); +} + +/* + * pstart - start the job in foreground/background + */ +void +pstart(pp, foregnd) + register struct process *pp; + int foregnd; +{ + register struct process *np; +#ifdef BSDSIGS + sigmask_t omask; +#endif /* BSDSIGS */ + long jobflags = 0; + +#ifdef BSDSIGS + omask = sigblock(sigmask(SIGCHLD)); +#else /* !BSDSIGS */ + (void) sighold(SIGCHLD); +#endif + np = pp; + do { + jobflags |= np->p_flags; + if (np->p_flags & (PRUNNING | PSTOPPED)) { + np->p_flags |= PRUNNING; + np->p_flags &= ~PSTOPPED; + if (foregnd) + np->p_flags |= PFOREGND; + else + np->p_flags &= ~PFOREGND; + } + } while ((np = np->p_friends) != pp); + if (!foregnd) + pclrcurr(pp); + (void) pprint(pp, foregnd ? NAME | JOBDIR : NUMBER | NAME | AMPERSAND); +#ifdef BSDJOBS + if (foregnd) + (void) tcsetpgrp(FSHTTY, pp->p_jobid); + if (jobflags & PSTOPPED) + (void) killpg((pid_t) pp->p_jobid, SIGCONT); +#endif /* BSDJOBS */ +#ifdef BSDSIGS + (void) sigsetmask(omask); +#else /* !BSDSIGS */ + (void) sigrelse(SIGCHLD); +#endif /* !BSDSIGS */ +} + +void +panystop(neednl) + bool neednl; +{ + register struct process *pp; + + chkstop = 2; + for (pp = proclist.p_next; pp; pp = pp->p_next) + if (pp->p_flags & PSTOPPED) + stderror(ERR_STOPPED, neednl ? "\n" : ""); +} + +struct process * +pfind(cp) + Char *cp; +{ + register struct process *pp, *np; + + if (cp == 0 || cp[1] == 0 || eq(cp, STRc_2) || eq(cp, STRc_plus)) { + if (pcurrent == PNULL) + stderror(ERR_NAME | ERR_JOBCUR); + return (pcurrent); + } + if (eq(cp, STRc_minus) || eq(cp, STRc_hash)) { + if (pprevious == PNULL) + stderror(ERR_NAME | ERR_JOBPREV); + return (pprevious); + } + if (Isdigit(cp[1])) { + int idx = atoi(short2str(cp + 1)); + + for (pp = proclist.p_next; pp; pp = pp->p_next) + if (pp->p_index == idx && pp->p_pid == pp->p_jobid) + return (pp); + stderror(ERR_NAME | ERR_NOSUCHJOB); + } + np = PNULL; + for (pp = proclist.p_next; pp; pp = pp->p_next) + if (pp->p_pid == pp->p_jobid) { + if (cp[1] == '?') { + register Char *dp; + + for (dp = pp->p_command; *dp; dp++) { + if (*dp != cp[2]) + continue; + if (prefix(cp + 2, dp)) + goto match; + } + } + else if (prefix(cp + 1, pp->p_command)) { + match: + if (np) + stderror(ERR_NAME | ERR_AMBIG); + np = pp; + } + } + if (np) + return (np); + stderror(ERR_NAME | cp[1] == '?' ? ERR_JOBPAT : ERR_NOSUCHJOB); + /* NOTREACHED */ + return (0); +} + + +/* + * pgetcurr - find most recent job that is not pp, preferably stopped + */ +static struct process * +pgetcurr(pp) + register struct process *pp; +{ + register struct process *np; + register struct process *xp = PNULL; + + for (np = proclist.p_next; np; np = np->p_next) + if (np != pcurrent && np != pp && np->p_pid && + np->p_pid == np->p_jobid) { + if (np->p_flags & PSTOPPED) + return (np); + if (xp == PNULL) + xp = np; + } + return (xp); +} + +/* + * donotify - flag the job so as to report termination asynchronously + */ +void +donotify(v) + Char **v; +{ + register struct process *pp; + + pp = pfind(*++v); + pp->p_flags |= PNOTIFY; +} + +/* + * Do the fork and whatever should be done in the child side that + * should not be done if we are not forking at all (like for simple builtin's) + * Also do everything that needs any signals fiddled with in the parent side + * + * Wanttty tells whether process and/or tty pgrps are to be manipulated: + * -1: leave tty alone; inherit pgrp from parent + * 0: already have tty; manipulate process pgrps only + * 1: want to claim tty; manipulate process and tty pgrps + * It is usually just the value of tpgrp. + */ + +int +pfork(t, wanttty) + struct command *t; /* command we are forking for */ + int wanttty; +{ + register int pid; + bool ignint = 0; + int pgrp; +#ifdef BSDSIGS + sigmask_t omask; +#endif /* BSDSIGS */ +#if SIGSYNCH + sigvec_t osv; + static sigvec_t nsv = {synch_handler, ~0, 0}; +#endif /* SIGSYNCH */ + + /* + * A child will be uninterruptible only under very special conditions. + * Remember that the semantics of '&' is implemented by disconnecting the + * process from the tty so signals do not need to ignored just for '&'. + * Thus signals are set to default action for children unless: we have had + * an "onintr -" (then specifically ignored) we are not playing with + * signals (inherit action) + */ + if (setintr) + ignint = (tpgrp == -1 && (t->t_dflg & F_NOINTERRUPT)) + || (gointr && eq(gointr, STRminus)); + /* + * Check for maximum nesting of 16 processes to avoid Forking loops + */ + if (child == 16) + stderror(ERR_NESTING, 16); + /* + * Hold SIGCHLD until we have the process installed in our table. + */ +#ifdef SIGSYNCH + if (mysigvec(SIGSYNCH, &nsv, &osv)) + stderror(ERR_SYSTEM, "pfork: sigvec set", strerror(errno)); +#endif /* SIGSYNCH */ +#ifdef BSDSIGS + omask = sigblock(sigmask(SIGCHLD)); +#else /* !BSDSIGS */ + (void) sighold(SIGCHLD); +#endif /* !BSDSIGS */ + while ((pid = fork()) < 0) + if (setintr == 0) + (void) sleep(FORKSLEEP); + else { +#ifdef BSDSIGS + (void) sigsetmask(omask); +#else /* !BSDSIGS */ + (void) sigrelse(SIGINT); + (void) sigrelse(SIGCHLD); +#endif /* !BSDSIGS */ + stderror(ERR_NOPROC); + } + if (pid == 0) { + settimes(); + pgrp = pcurrjob ? pcurrjob->p_jobid : getpid(); + pflushall(); + pcurrjob = PNULL; +#if !defined(BSDTIMES) && !defined(_SEQUENT_) + timesdone = 0; +#endif /* !defined(BSDTIMES) && !defined(_SEQUENT_) */ + child++; + if (setintr) { + setintr = 0; /* until I think otherwise */ +#ifndef BSDSIGS + (void) sigrelse(SIGCHLD); +#endif /* !BSDSIGS */ + /* + * Children just get blown away on SIGINT, SIGQUIT unless "onintr + * -" seen. + */ + (void) signal(SIGINT, ignint ? SIG_IGN : SIG_DFL); + (void) signal(SIGQUIT, ignint ? SIG_IGN : SIG_DFL); +#ifdef BSDJOBS + if (wanttty >= 0) { + /* make stoppable */ + (void) signal(SIGTSTP, SIG_DFL); + (void) signal(SIGTTIN, SIG_DFL); + (void) signal(SIGTTOU, SIG_DFL); + } +#endif /* BSDJOBS */ + (void) signal(SIGTERM, parterm); + } + else if (tpgrp == -1 && (t->t_dflg & F_NOINTERRUPT)) { + (void) signal(SIGINT, SIG_IGN); + (void) signal(SIGQUIT, SIG_IGN); + } +#ifdef OREO + sigignore(SIGIO); /* ignore SIGIO in child too */ +#endif /* OREO */ + + pgetty(wanttty, pgrp); + /* + * Nohup and nice apply only to NODE_COMMAND's but it would be nice + * (?!?) if you could say "nohup (foo;bar)" Then the parser would have + * to know about nice/nohup/time + */ + if (t->t_dflg & F_NOHUP) + (void) signal(SIGHUP, SIG_IGN); + if (t->t_dflg & F_NICE) +#ifdef BSDNICE + (void) setpriority(PRIO_PROCESS, 0, t->t_nice); +#else /* !BSDNICE */ + (void) nice(t->t_nice); +#endif /* !BSDNICE */ +#ifdef F_VER + if (t->t_dflg & F_VER) { + Setenv(STRSYSTYPE, t->t_systype ? STRbsd43 : STRsys53); + dohash(); + } +#endif /* F_VER */ +#ifdef SIGSYNCH + /* rfw 8/89 now parent can continue */ + if (kill(getppid(), SIGSYNCH)) + stderror(ERR_SYSTEM, "pfork child: kill", strerror(errno)); +#endif /* SIGSYNCH */ + + } + else { +#ifdef POSIXJOBS + if (wanttty >= 0) + (void) setpgid(pid, pcurrjob ? pcurrjob->p_jobid : pid); +#endif /* POSIXJOBS */ + palloc(pid, t); +#ifdef SIGSYNCH + /* + * rfw 8/89 Wait for child to own terminal. Solves half of ugly + * synchronization problem. With this change, we know that the only + * reason setpgrp to a previous process in a pipeline can fail is that + * the previous process has already exited. Without this hack, he may + * either have exited or not yet started to run. Two uglies become + * one. + */ + sigpause(omask & ~SYNCHMASK); + if (mysigvec(SIGSYNCH, &osv, NULL)) + stderror(ERR_SYSTEM, "pfork parent: sigvec restore", + strerror(errno)); +#endif /* SIGSYNCH */ + +#ifdef BSDSIGS + (void) sigsetmask(omask); +#else /* !BSDSIGS */ + (void) sigrelse(SIGCHLD); +#endif /* !BSDSIGS */ + } + return (pid); +} + +static void +okpcntl() +{ + if (tpgrp == -1) + stderror(ERR_JOBCONTROL); + if (tpgrp == 0) + stderror(ERR_JOBCTRLSUB); +} + +/* + * if we don't have vfork(), things can still go in the wrong order + * resulting in the famous 'Stopped (tty output)'. But some systems + * don't permit the setpgid() call, (these are more recent secure + * systems such as ibm's aix), when they do. Then we'd rather print + * an error message than hang the shell! + * I am open to suggestions how to fix that. + */ +void +pgetty(wanttty, pgrp) + int wanttty, pgrp; +{ +#ifdef BSDJOBS +# if defined(BSDSIGS) && defined(POSIXJOBS) + sigmask_t omask = 0; +# endif /* BSDSIGS && POSIXJOBS */ + +# ifdef JOBDEBUG + xprintf("wanttty %d\n", wanttty); +# endif + +# ifdef POSIXJOBS + /* + * christos: I am blocking the tty signals till I've set things + * correctly.... + */ + if (wanttty > 0) +# ifdef BSDSIGS + omask = sigblock(sigmask(SIGTSTP)|sigmask(SIGTTIN)|sigmask(SIGTTOU)); +# else /* !BSDSIGS */ + { + (void) sighold(SIGTSTP); + (void) sighold(SIGTTIN); + (void) sighold(SIGTTOU); + } +# endif /* !BSDSIGS */ + + /* + * From: Michael Schroeder + * Don't check for tpgrp >= 0 so even non-interactive shells give + * background jobs process groups Same for the comparison in the other part + * of the #ifdef + */ + if (wanttty >= 0) + if (setpgid(0, pgrp) == -1) { + xprintf("tcsh: setpgid error.\n"); + xexit(0); + } +# endif /* POSIXJOBS */ + + if (wanttty > 0) + (void) tcsetpgrp(FSHTTY, pgrp); + +# ifndef POSIXJOBS + if (wanttty >= 0) + if (setpgid(0, pgrp) == -1) { + xprintf("tcsh: setpgid error.\n"); + xexit(0); + } +# else /* POSIXJOBS */ + if (wanttty > 0) +# ifdef BSDSIGS + (void) sigsetmask(omask); +# else /* BSDSIGS */ + { + (void) sigrelse(SIGTSTP); + (void) sigrelse(SIGTTIN); + (void) sigrelse(SIGTTOU); + } +# endif /* !BSDSIGS */ +# endif /* POSIXJOBS */ + + if (tpgrp > 0) + tpgrp = 0; /* gave tty away */ +#endif /* BSDJOBS */ +} diff --git a/bin/tcsh/sh.proc.h b/bin/tcsh/sh.proc.h new file mode 100644 index 0000000..2f5ee9f --- /dev/null +++ b/bin/tcsh/sh.proc.h @@ -0,0 +1,136 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/sh.proc.h,v 3.0 1991/07/04 21:49:28 christos Exp $ */ +/* + * sh.proc.h: Process data structures and variables + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#ifndef _h_sh_proc +#define _h_sh_proc +/* + * C shell - process structure declarations + */ + +/* + * Structure for each process the shell knows about: + * allocated and filled by pcreate. + * flushed by pflush; freeing always happens at top level + * so the interrupt level has less to worry about. + * processes are related to "friends" when in a pipeline; + * p_friends links makes a circular list of such jobs + */ +struct process { + struct process *p_next; /* next in global "proclist" */ + struct process *p_friends; /* next in job list (or self) */ + struct directory *p_cwd; /* cwd of the job (only in head) */ + short unsigned p_flags; /* various job status flags */ + char p_reason; /* reason for entering this state */ + int p_index; /* shorthand job index */ + int p_pid; + int p_jobid; /* pid of job leader */ + /* if a job is stopped/background p_jobid gives its pgrp */ +#ifdef BSDTIMES + struct timeval p_btime; /* begin time */ + struct timeval p_etime; /* end time */ + struct rusage p_rusage; +#else /* BSDTIMES */ +# ifdef _SEQUENT_ + tmval_t p_btime; /* begin time */ + tmval_t p_etime; /* end time */ + struct pro_stats p_rusage; +# else /* _SEQUENT_ */ +# ifndef POSIX + time_t p_btime; /* begin time */ + time_t p_etime; /* end time */ + time_t p_utime; /* user time */ + time_t p_stime; /* system time */ +# else /* POSIX */ + clock_t p_btime; /* begin time */ + clock_t p_etime; /* end time */ + clock_t p_utime; /* user time */ + clock_t p_stime; /* system time */ +# endif /* POSIX */ +# endif /* _SEQUENT_ */ +#endif /* BSDTIMES */ + Char *p_command; /* first PMAXLEN chars of command */ +}; + +/* flag values for p_flags */ +#define PRUNNING (1<<0) /* running */ +#define PSTOPPED (1<<1) /* stopped */ +#define PNEXITED (1<<2) /* normally exited */ +#define PAEXITED (1<<3) /* abnormally exited */ +#define PSIGNALED (1<<4) /* terminated by a signal != SIGINT */ + +#define PALLSTATES (PRUNNING|PSTOPPED|PNEXITED|PAEXITED| \ + PSIGNALED|PINTERRUPTED) +#define PNOTIFY (1<<5) /* notify async when done */ +#define PTIME (1<<6) /* job times should be printed */ +#define PAWAITED (1<<7) /* top level is waiting for it */ +#define PFOREGND (1<<8) /* started in shells pgrp */ +#define PDUMPED (1<<9) /* process dumped core */ +#define PDIAG (1<<10) /* diagnostic output also piped out */ +#define PPOU (1<<11) /* piped output */ +#define PREPORTED (1<<12) /* status has been reported */ +#define PINTERRUPTED (1<<13) /* job stopped via interrupt signal */ +#define PPTIME (1<<14) /* time individual process */ +#define PNEEDNOTE (1<<15) /* notify as soon as practical */ + +#define PNULL (struct process *)0 +#define PMAXLEN 80 + +/* defines for arguments to pprint */ +#define NUMBER 01 +#define NAME 02 +#define REASON 04 +#define AMPERSAND 010 +#define FANCY 020 +#define SHELLDIR 040 /* print shell's dir if not the same */ +#define JOBDIR 0100 /* print job's dir if not the same */ +#define AREASON 0200 + +struct process proclist; /* list head of all processes */ +bool pnoprocesses; /* pchild found nothing to wait for */ + +struct process *pholdjob; /* one level stack of current jobs */ + +struct process *pcurrjob; /* current job */ +struct process *pcurrent; /* current job in table */ +struct process *pprevious; /* previous job in table */ + +int pmaxindex; /* current maximum job index */ + +#ifndef BSDTIMES +bool timesdone; /* shtimes buffer full ? */ +#endif /* BSDTIMES */ + +#endif /* _h_sh_proc */ diff --git a/bin/tcsh/sh.sem.c b/bin/tcsh/sh.sem.c new file mode 100644 index 0000000..a6c768b --- /dev/null +++ b/bin/tcsh/sh.sem.c @@ -0,0 +1,774 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/sh.sem.c,v 3.0 1991/07/04 23:34:26 christos Exp $ */ +/* + * sh.sem.c: I/O redirections and job forking. A touchy issue! + * Most stuff with builtins is incorrect + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#include "config.h" +#if !defined(lint) && !defined(pdp11) +static char *rcsid() + { return "$Id: sh.sem.c,v 3.0 1991/07/04 23:34:26 christos Exp $"; } +#endif + +#include "sh.h" + +#ifdef FIOCLEX +#ifndef sun +#ifndef CLEX_DUPS +#define CLEX_DUPS +#endif /* CLEX_DUPS */ +#endif /* sun */ +#endif /* FIOCLEX */ + +#ifdef sparc +#include +#endif /* sparc */ + +#ifdef VFORK +static sigret_t vffree __P((int)); +#endif +static void doio __P((struct command *t, int *, int *)); +static void chkclob __P((char *)); + +/* + * C shell + */ +/*VARARGS 1*/ +void +execute(t, wanttty, pipein, pipeout) + register struct command *t; + int wanttty, *pipein, *pipeout; +{ +#if defined(convex) || defined(__convex__) + extern bool use_fork; /* use fork() instead of vfork()? */ + +#endif + + bool forked = 0; + struct biltins *bifunc; + int pid = 0; + int pv[2]; + +#ifdef BSDSIGS + static sigmask_t csigmask; +# ifdef VFORK + static sigmask_t ocsigmask; +# endif /* VFORK */ +#endif /* BSDSIGS */ +#ifdef VFORK + static int onosigchld = 0; +#endif /* VFORK */ + static int nosigchld = 0; + + if (t == 0) + return; + /* + * From: Michael Schroeder + * Don't check for wantty > 0... + */ + if (t->t_dflg & F_AMPERSAND) + wanttty = 0; + switch (t->t_dtyp) { + + case NODE_COMMAND: + if ((t->t_dcom[0][0] & (QUOTE | TRIM)) == QUOTE) + (void) Strcpy(t->t_dcom[0], t->t_dcom[0] + 1); + if ((t->t_dflg & F_REPEAT) == 0) + Dfix(t); /* $ " ' \ */ + if (t->t_dcom[0] == 0) + return; + /* fall into... */ + + case NODE_PAREN: + if (t->t_dflg & F_PIPEOUT) + mypipe(pipeout); + /* + * Must do << early so parent will know where input pointer should be. + * If noexec then this is all we do. + */ + if (t->t_dflg & F_READ) { + (void) close(0); + heredoc(t->t_dlef); + if (noexec) + (void) close(0); + } + if (noexec) + break; + + set(STRstatus, Strsave(STR0)); + + /* + * This mess is the necessary kludge to handle the prefix builtins: + * nice, nohup, time. These commands can also be used by themselves, + * and this is not handled here. This will also work when loops are + * parsed. + */ + while (t->t_dtyp == NODE_COMMAND) + if (eq(t->t_dcom[0], STRnice)) + if (t->t_dcom[1]) + if (strchr("+-", t->t_dcom[1][0])) + if (t->t_dcom[2]) { + setname("nice"); + t->t_nice = + getn(t->t_dcom[1]); + lshift(t->t_dcom, 2); + t->t_dflg |= F_NICE; + } + else + break; + else { + t->t_nice = 4; + lshift(t->t_dcom, 1); + t->t_dflg |= F_NICE; + } + else + break; + else if (eq(t->t_dcom[0], STRnohup)) + if (t->t_dcom[1]) { + t->t_dflg |= F_NOHUP; + lshift(t->t_dcom, 1); + } + else + break; + else if (eq(t->t_dcom[0], STRtime)) + if (t->t_dcom[1]) { + t->t_dflg |= F_TIME; + lshift(t->t_dcom, 1); + } + else + break; +#ifdef F_VER + else if (eq(t->t_dcom[0], STRver)) + if (t->t_dcom[1] && t->t_dcom[2]) { + setname("ver"); + t->t_systype = getv(t->t_dcom[1]); + lshift(t->t_dcom, 2); + t->t_dflg |= F_VER; + } + else + break; +#endif + else + break; + + /* is t a command */ + if (t->t_dtyp == NODE_COMMAND) { + /* + * Check if we have a builtin function and remember which one. + */ + bifunc = isbfunc(t); + } + else { /* not a command */ + bifunc = NULL; + } + + /* + * We fork only if we are timed, or are not the end of a parenthesized + * list and not a simple builtin function. Simple meaning one that is + * not pipedout, niced, nohupped, or &'d. It would be nice(?) to not + * fork in some of these cases. + */ + /* + * Prevent forking cd, pushd, popd, chdir cause this will cause the + * shell not to change dir! + */ + if (bifunc && (bifunc->bfunct == dochngd || + bifunc->bfunct == dopushd || + bifunc->bfunct == dopopd)) + t->t_dflg &= ~(F_NICE); + if (((t->t_dflg & F_TIME) || (t->t_dflg & F_NOFORK) == 0 && + (!bifunc || t->t_dflg & + (F_PIPEOUT | F_AMPERSAND | F_NICE | F_NOHUP))) || + /* + * We have to fork for eval too. + */ + (bifunc && (t->t_dflg & F_PIPEIN) != 0 && + bifunc->bfunct == doeval)) +#ifdef VFORK + if (t->t_dtyp == NODE_PAREN || + t->t_dflg & (F_REPEAT | F_AMPERSAND) || bifunc) +#endif + { + forked++; + /* + * We need to block SIGCHLD here, so that if the process does + * not die before we can set the process group + */ + if (wanttty >= 0 && !nosigchld) { +#ifdef BSDSIGS + csigmask = sigblock(sigmask(SIGCHLD)); +#else + sighold(SIGCHLD); +#endif /* BSDSIGS */ + + nosigchld = 1; + } + + pid = pfork(t, wanttty); + if (pid == 0 && nosigchld) { +#ifdef BSDSIGS + (void) sigsetmask(csigmask); +#else + (void) sigrelse(SIGCHLD); +#endif /* BSDSIGS */ + nosigchld = 0; + } + } + +#ifdef VFORK + else { + int ochild, osetintr, ohaderr, odidfds; + int oSHIN, oSHOUT, oSHDIAG, oOLDSTD, otpgrp; + int oisoutatty, oisdiagatty; + +#ifndef FIOCLEX + int odidcch; + +#endif +#ifdef BSDSIGS + sigmask_t omask; +#endif /* BSDSIGS */ + + /* + * Prepare for the vfork by saving everything that the child + * corrupts before it exec's. Note that in some signal + * implementations which keep the signal info in user space + * (e.g. Sun's) it will also be necessary to save and restore + * the current sigvec's for the signals the child touches + * before it exec's. + */ +#ifdef BSDSIGS + + /* + * Sooooo true... If this is a Sun, save the sigvec's. (Skip + * Gilbrech - 11/22/87) + */ +#ifdef SAVESIGVEC + sigvec_t savesv[NSIGSAVED]; + sigmask_t savesm; + +#endif /* SAVESIGVEC */ + if (wanttty >= 0 && !nosigchld && !noexec) { +#ifdef BSDSIGS + csigmask = sigblock(sigmask(SIGCHLD)); +#else + sighold(SIGCHLD); +#endif /* BSDSIGS */ + nosigchld = 1; + } + omask = sigblock(sigmask(SIGCHLD) | sigmask(SIGINT)); +#else + (void) sighold(SIGCHLD); + (void) sighold(SIGINT); +#endif + ochild = child; + osetintr = setintr; + ohaderr = haderr; + odidfds = didfds; +#ifndef FIOCLEX + odidcch = didcch; +#endif + oSHIN = SHIN; + oSHOUT = SHOUT; + oSHDIAG = SHDIAG; + oOLDSTD = OLDSTD; + otpgrp = tpgrp; + oisoutatty = isoutatty; + oisdiagatty = isdiagatty; +#ifdef BSDSIGS + ocsigmask = csigmask; +#endif /* BSDSIGS */ + onosigchld = nosigchld; + Vsav = Vdp = 0; + Vexpath = 0; + Vt = 0; +#ifdef SAVESIGVEC + savesm = savesigvec(savesv); +#endif /* SAVESIGVEC */ +#if defined(convex) || defined(__convex__) + if (use_fork) + pid = fork(); + else + pid = vfork(); +#else + pid = vfork(); +#endif + + if (pid < 0) { +#ifdef BSDSIGS +#ifdef SAVESIGVEC + restoresigvec(savesv, savesm); +#endif /* SAVESIGVEC */ + (void) sigsetmask(omask); +#else + (void) sigrelse(SIGCHLD); + (void) sigrelse(SIGINT); +#endif + stderror(ERR_NOPROC); + } + forked++; + if (pid) { /* parent */ +#ifdef pdp11 + register char **v; +#endif +#ifdef BSDSIGS +#ifdef SAVESIGVEC + restoresigvec(savesv, savesm); +#endif /* SAVESIGVEC */ +#endif /* BSDSIGS */ + child = ochild; + setintr = osetintr; + haderr = ohaderr; + didfds = odidfds; + SHIN = oSHIN; +#ifndef FIOCLEX + didcch = odidcch; +#endif + SHOUT = oSHOUT; + SHDIAG = oSHDIAG; + OLDSTD = oOLDSTD; + tpgrp = otpgrp; + isoutatty = oisoutatty; + isdiagatty = oisdiagatty; +#ifdef BSDSIGS + csigmask = ocsigmask; +#endif /* BSDSIGS */ + nosigchld = onosigchld; + + xfree((ptr_t) Vsav); + Vsav = 0; + xfree((ptr_t) Vdp); + Vdp = 0; + xfree((ptr_t) Vexpath); + Vexpath = 0; + blkfree((Char **) Vt); + Vt = 0; +#ifdef pdp11 + if (v = gargv) + gargv = 0, blkfree(v); + if (v = pargv) + pargv = 0, blkfree(v); +#endif + /* this is from pfork() */ + palloc(pid, t); +#ifdef BSDSIGS + (void) sigsetmask(omask); +#else + (void) sigrelse(SIGCHLD); + (void) sigrelse(SIGINT); +#endif + } + else { /* child */ + /* this is from pfork() */ + int pgrp; + bool ignint = 0; + + if (nosigchld) { +#ifdef BSDSIGS + (void) sigsetmask(csigmask); +#else + (void) sigrelse(SIGCHLD); +#endif /* BSDSIGS */ + nosigchld = 0; + } + + if (setintr) + ignint = + (tpgrp == -1 && + (t->t_dflg & F_NOINTERRUPT)) + || gointr && eq(gointr, STRminus); + pgrp = pcurrjob ? pcurrjob->p_jobid : getpid(); + child++; + if (setintr) { + setintr = 0; +#ifdef notdef + (void) signal(SIGCHLD, SIG_DFL); +#endif +/* + * casts made right for SunOS 4.0 by Douglas C. Schmidt + * + * (thanks! -- PWP) + * + * ignint ifs cleaned by Johan Widen + * (thanks again) + */ + if (ignint) { + (void) signal(SIGINT, SIG_IGN); + (void) signal(SIGQUIT, SIG_IGN); + } + else { + (void) signal(SIGINT, vffree); + (void) signal(SIGQUIT, SIG_DFL); + } + + if (wanttty >= 0) { + (void) signal(SIGTSTP, SIG_DFL); + (void) signal(SIGTTIN, SIG_DFL); + (void) signal(SIGTTOU, SIG_DFL); + } + + (void) signal(SIGTERM, parterm); + } + else if (tpgrp == -1 && + (t->t_dflg & F_NOINTERRUPT)) { + (void) signal(SIGINT, SIG_IGN); + (void) signal(SIGQUIT, SIG_IGN); + } + +#ifdef _SEQUENT_ + pgetty(wanttty ? wanttty : 1, pgrp); +#else /* _SEQUENT_ */ + pgetty(wanttty, pgrp); +#endif /* _SEQUENT_ */ + + if (t->t_dflg & F_NOHUP) + (void) signal(SIGHUP, SIG_IGN); + if (t->t_dflg & F_NICE) +#ifdef BSDNICE + (void) setpriority(PRIO_PROCESS, + 0, t->t_nice); +#else /* BSDNICE */ + (void) nice(t->t_nice); +#endif /* BSDNICE */ +#ifdef F_VER + if (t->t_dflg & F_VER) { + Setenv(STRSYSTYPE, t->t_systype ? STRbsd43 : STRsys53); + dohash(); + } +#endif + } + + } +#endif /* VFORK */ + if (pid != 0) { + /* + * It would be better if we could wait for the whole job when we + * knew the last process had been started. Pwait, in fact, does + * wait for the whole job anyway, but this test doesn't really + * express our intentions. + */ + if (didfds == 0 && t->t_dflg & F_PIPEIN) { + (void) close(pipein[0]); + (void) close(pipein[1]); + } + if ((t->t_dflg & F_PIPEOUT) == 0) { + if (nosigchld) { +#ifdef BSDSIGS + (void) sigsetmask(csigmask); +#else + (void) sigrelse(SIGCHLD); +#endif /* BSDSIGS */ + nosigchld = 0; + } + if ((t->t_dflg & F_AMPERSAND) == 0) + pwait(); + } + break; + } + doio(t, pipein, pipeout); + if (t->t_dflg & F_PIPEOUT) { + (void) close(pipeout[0]); + (void) close(pipeout[1]); + } + /* + * Perform a builtin function. If we are not forked, arrange for + * possible stopping + */ + if (bifunc) { + func(t, bifunc); + if (forked) + exitstat(); + break; + } + if (t->t_dtyp != NODE_PAREN) { + doexec(t); + /* NOTREACHED */ + } + /* + * For () commands must put new 0,1,2 in FSH* and recurse + */ + OLDSTD = dcopy(0, FOLDSTD); + SHOUT = dcopy(1, FSHOUT); + isoutatty = isatty(SHOUT); + SHDIAG = dcopy(2, FSHDIAG); + isdiagatty = isatty(SHDIAG); + (void) close(SHIN); + SHIN = -1; +#ifndef FIOCLEX + didcch = 0; +#endif + didfds = 0; + wanttty = -1; + t->t_dspr->t_dflg |= t->t_dflg & F_NOINTERRUPT; + execute(t->t_dspr, wanttty, NULL, NULL); + exitstat(); + + case NODE_PIPE: + t->t_dcar->t_dflg |= F_PIPEOUT | + (t->t_dflg & (F_PIPEIN | F_AMPERSAND | F_STDERR | F_NOINTERRUPT)); + execute(t->t_dcar, wanttty, pipein, pv); + t->t_dcdr->t_dflg |= F_PIPEIN | (t->t_dflg & + (F_PIPEOUT | F_AMPERSAND | F_NOFORK | F_NOINTERRUPT)); + if (wanttty > 0) + wanttty = 0; /* got tty already */ + execute(t->t_dcdr, wanttty, pv, pipeout); + break; + + case NODE_LIST: + if (t->t_dcar) { + t->t_dcar->t_dflg |= t->t_dflg & F_NOINTERRUPT; + execute(t->t_dcar, wanttty, NULL, NULL); + /* + * In strange case of A&B make a new job after A + */ + if (t->t_dcar->t_dflg & F_AMPERSAND && t->t_dcdr && + (t->t_dcdr->t_dflg & F_AMPERSAND) == 0) + pendjob(); + } + if (t->t_dcdr) { + t->t_dcdr->t_dflg |= t->t_dflg & + (F_NOFORK | F_NOINTERRUPT); + execute(t->t_dcdr, wanttty, NULL, NULL); + } + break; + + case NODE_OR: + case NODE_AND: + if (t->t_dcar) { + t->t_dcar->t_dflg |= t->t_dflg & F_NOINTERRUPT; + execute(t->t_dcar, wanttty, NULL, NULL); + if ((getn(value(STRstatus)) == 0) != + (t->t_dtyp == NODE_AND)) + return; + } + if (t->t_dcdr) { + t->t_dcdr->t_dflg |= t->t_dflg & + (F_NOFORK | F_NOINTERRUPT); + execute(t->t_dcdr, wanttty, NULL, NULL); + } + break; + } + /* + * Fall through for all breaks from switch + * + * If there will be no more executions of this command, flush all file + * descriptors. Places that turn on the F_REPEAT bit are responsible for + * doing donefds after the last re-execution + */ + if (didfds && !(t->t_dflg & F_REPEAT)) + donefds(); +} + +#ifdef VFORK +static sigret_t +/*ARGSUSED*/ +vffree(snum) +int snum; +{ + register Char **v; + + if (v = gargv) { + gargv = 0; +#ifdef pdp11 + blkfree(v); +#else + xfree((ptr_t) v); +#endif + } + if (v = pargv) { + pargv = 0; +#ifdef pdp11 + blkfree(v); +#else + xfree((ptr_t) v); +#endif + } + _exit(1); +} + +#endif + +/* + * Perform io redirection. + * We may or maynot be forked here. + */ +static void +doio(t, pipein, pipeout) + register struct command *t; + int *pipein, *pipeout; +{ + register int fd; + register Char *cp, *dp; + register int flags = t->t_dflg; + + if (didfds || (flags & F_REPEAT)) + return; + if ((flags & F_READ) == 0) {/* F_READ already done */ + if (cp = t->t_dlef) { + char tmp[MAXPATHLEN+1]; + + /* + * so < /dev/std{in,out,err} work + */ + (void) dcopy(SHIN, 0); + (void) dcopy(SHOUT, 1); + (void) dcopy(SHDIAG, 2); + cp = globone(dp = Dfix1(cp), G_IGNORE); + (void) strncpy(tmp, short2str(cp), MAXPATHLEN); + tmp[MAXPATHLEN] = '\0'; + xfree((ptr_t) cp); + xfree((ptr_t) dp); + if ((fd = open(tmp, O_RDONLY)) < 0) + stderror(ERR_SYSTEM, tmp, strerror(errno)); + (void) dmove(fd, 0); + } + else if (flags & F_PIPEIN) { + (void) close(0); + (void) dup(pipein[0]); + (void) close(pipein[0]); + (void) close(pipein[1]); + } + else if ((flags & F_NOINTERRUPT) && tpgrp == -1) { + (void) close(0); + (void) open(_PATH_DEVNULL, O_RDONLY); + } + else { + (void) close(0); + (void) dup(OLDSTD); +#ifdef FIOCLEX +#ifdef CLEX_DUPS + /* + * PWP: Unlike Bezerkeley 4.3, FIONCLEX for Pyramid is preserved + * across dup()s, so we have to UNSET it here or else we get a + * command with NO stdin, stdout, or stderr at all (a bad thing + * indeed) + */ + + (void) ioctl(0, FIONCLEX, NULL); +#endif /* CLEX_DUPS */ +#endif /* FIONCLEX */ + } + } + if (cp = t->t_drit) { + char tmp[MAXPATHLEN+1]; + + cp = globone(dp = Dfix1(cp), G_IGNORE); + (void) strncpy(tmp, short2str(cp), MAXPATHLEN); + tmp[MAXPATHLEN] = '\0'; + xfree((ptr_t) dp); + xfree((ptr_t) cp); + /* + * so > /dev/std{out,err} work + */ + (void) dcopy(SHOUT, 1); + (void) dcopy(SHDIAG, 2); + if ((flags & F_APPEND) && +#ifdef O_APPEND + (fd = open(tmp, O_WRONLY | O_APPEND)) >= 0); +#else + (fd = open(tmp, O_WRONLY)) >= 0) + (void) lseek(1, (off_t) 0, L_XTND); +#endif + else { + if (!(flags & F_OVERWRITE) && adrof(STRnoclobber)) { + if (flags & F_APPEND) + stderror(ERR_SYSTEM, tmp, strerror(errno)); + chkclob(tmp); + } + if ((fd = creat(tmp, 0666)) < 0) + stderror(ERR_SYSTEM, tmp, strerror(errno)); + } + (void) dmove(fd, 1); + is1atty = isatty(1); + } + else if (flags & F_PIPEOUT) { + (void) close(1); + (void) dup(pipeout[1]); + is1atty = 0; + } + else { + (void) close(1); + (void) dup(SHOUT); + is1atty = isoutatty; +#ifdef FIOCLEX +#ifdef CLEX_DUPS + (void) ioctl(1, FIONCLEX, NULL); +#endif /* CLEX_DUPS */ +#endif /* FIONCLEX */ + } + + (void) close(2); + if (flags & F_STDERR) { + (void) dup(1); + is2atty = is1atty; + } + else { + (void) dup(SHDIAG); + is2atty = isdiagatty; +#ifdef FIOCLEX +#ifdef CLEX_DUPS + (void) ioctl(2, FIONCLEX, NULL); +#endif /* CLEX_DUPS */ +#endif /* FIONCLEX */ + } + didfds = 1; +} + +void +mypipe(pv) + register int *pv; +{ + + if (pipe(pv) < 0) + goto oops; + pv[0] = dmove(pv[0], -1); + pv[1] = dmove(pv[1], -1); + if (pv[0] >= 0 && pv[1] >= 0) + return; +oops: + stderror(ERR_PIPE); +} + +static void +chkclob(cp) + register char *cp; +{ + struct stat stb; + + if (stat(cp, &stb) < 0) + return; + if ((stb.st_mode & S_IFMT) == S_IFCHR) + return; + stderror(ERR_EXISTS, cp); +} diff --git a/bin/tcsh/sh.set.c b/bin/tcsh/sh.set.c new file mode 100644 index 0000000..760b47f --- /dev/null +++ b/bin/tcsh/sh.set.c @@ -0,0 +1,866 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/sh.set.c,v 3.0 1991/07/04 21:49:28 christos Exp $ */ +/* + * sh.set.c: Setting and Clearing of variables + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#include "config.h" +#if !defined(lint) && !defined(pdp11) +static char *rcsid() + { return "$Id: sh.set.c,v 3.0 1991/07/04 21:49:28 christos Exp $"; } +#endif + +#include "sh.h" +#include "ed.h" +#include "tw.h" + +extern Char HistLit; +extern bool GotTermCaps; + +static Char *getinx __P((Char *, int *)); +static void asx __P((Char *, int, Char *)); +static struct varent *getvx __P((Char *, int)); +static Char *xset __P((Char *, Char ***)); +static Char *operate __P((int, Char *, Char *)); +static void putn1 __P((int)); +static struct varent *madrof __P((Char *, struct varent *)); +static void unsetv1 __P((struct varent *)); +static void exportpath __P((Char **)); +static void balance __P((struct varent *, int, int)); + +/* + * C Shell + */ + +void +doset(v) + register Char **v; +{ + register Char *p; + Char *vp, op; + Char **vecp; + bool hadsub; + int subscr; + + v++; + p = *v++; + if (p == 0) { + prvars(); + return; + } + do { + hadsub = 0; + vp = p; + if (letter(*p)) + for (; alnum(*p); p++) + continue; + if (vp == p || !letter(*vp)) + stderror(ERR_NAME | ERR_VARBEGIN); + if ((p - vp) > MAXVARLEN) { + stderror(ERR_NAME | ERR_VARTOOLONG); + return; + } + if (*p == '[') { + hadsub++; + p = getinx(p, &subscr); + } + if (op = *p) { + *p++ = 0; + if (*p == 0 && *v && **v == '(') + p = *v++; + } + else if (*v && eq(*v, STRequal)) { + op = '=', v++; + if (*v) + p = *v++; + } + if (op && op != '=') + stderror(ERR_NAME | ERR_SYNTAX); + if (eq(p, STRLparen)) { + register Char **e = v; + + if (hadsub) + stderror(ERR_NAME | ERR_SYNTAX); + for (;;) { + if (!*e) + stderror(ERR_NAME | ERR_MISSING, ')'); + if (**e == ')') + break; + e++; + } + p = *e; + *e = 0; + vecp = saveblk(v); + set1(vp, vecp, &shvhed); + *e = p; + v = e + 1; + } + else if (hadsub) + asx(vp, subscr, Strsave(p)); + else + set(vp, Strsave(p)); + if (eq(vp, STRpath)) { + exportpath(adrof(STRpath)->vec); + dohash(); + } + else if (eq(vp, STRhstc)) { + register Char *pn = value(STRhstc); + + HIST = *pn++; + HISTSUB = *pn; + } + else if (eq(vp, STRhstl)) { + HistLit = 1; + } + else if (eq(vp, STRuser)) { + Setenv(STRUSER, value(vp)); + Setenv(STRLOGNAME, value(vp)); + } + else if (eq(vp, STRwordchars)) { + word_chars = value(vp); + } + else if (eq(vp, STRterm)) { +#ifdef DOESNT_WORK_RIGHT + register Char *cp; + +#endif + Setenv(STRTRM, value(vp)); +#ifdef DOESNT_WORK_RIGHT + cp = getenv("TERMCAP"); + if (cp && (*cp != '/')) /* if TERMCAP and not a path */ + Unsetenv(STRTRMCAP); +#endif /* DOESNT_WORK_RIGHT */ + GotTermCaps = 0; + ed_I(); /* reset the editor */ + } + else if (eq(vp, STRhome)) { + register Char *cp; + + cp = Strsave(value(vp)); /* get the old value back */ + + /* + * convert to cononical pathname (possibly resolving symlinks) + */ + cp = dcanon(cp, cp); + + set(vp, Strsave(cp)); /* have to save the new val */ + + /* and now mirror home with HOME */ + Setenv(STRHOME, cp); + /* fix directory stack for new tilde home */ + dtilde(); + xfree((ptr_t) cp); + } + else if (eq(vp, STRedit)) { + editing = 1; + /* PWP: add more stuff in here later */ + } + else if (eq(vp, STRshlvl)) { + Setenv(STRSHLVL, value(vp)); + } + else if (eq(vp, STRbKslash_quote)) { + bslash_quote = 1; + } + else if (eq(vp, STRrecognize_only_executables)) { + tw_clear_comm_list(); + } + else if (eq(vp, STRwatch)) { + resetwatch(); + } + } while (p = *v++); +} + +static Char * +getinx(cp, ip) + register Char *cp; + register int *ip; +{ + *ip = 0; + *cp++ = 0; + while (*cp && Isdigit(*cp)) + *ip = *ip * 10 + *cp++ - '0'; + if (*cp++ != ']') + stderror(ERR_NAME | ERR_SUBSCRIPT); + return (cp); +} + +static void +asx(vp, subscr, p) + Char *vp; + int subscr; + Char *p; +{ + register struct varent *v = getvx(vp, subscr); + + xfree((ptr_t) v->vec[subscr - 1]); + v->vec[subscr - 1] = globone(p, G_APPEND); +} + +static struct varent * +getvx(vp, subscr) + Char *vp; + int subscr; +{ + register struct varent *v = adrof(vp); + + if (v == 0) + udvar(vp); + if (subscr < 1 || subscr > blklen(v->vec)) + stderror(ERR_NAME | ERR_RANGE); + return (v); +} + +void +dolet(v) + Char **v; +{ + register Char *p; + Char *vp, c, op; + bool hadsub; + int subscr; + + v++; + p = *v++; + if (p == 0) { + prvars(); + return; + } + do { + hadsub = 0; + vp = p; + if (letter(*p)) + for (; alnum(*p); p++) + continue; + if (vp == p || !letter(*vp)) + stderror(ERR_NAME | ERR_VARBEGIN); + if ((p - vp) > MAXVARLEN) + stderror(ERR_NAME | ERR_VARTOOLONG); + if (*p == '[') { + hadsub++; + p = getinx(p, &subscr); + } + if (*p == 0 && *v) + p = *v++; + if (op = *p) + *p++ = 0; + else + stderror(ERR_NAME | ERR_ASSIGN); + + /* + * if there is no expression after the '=' then print a "Syntax Error" + * message - strike + */ + if (*p == '\0' && *v == NULL) + stderror(ERR_NAME | ERR_ASSIGN); + + vp = Strsave(vp); + if (op == '=') { + c = '='; + p = xset(p, &v); + } + else { + c = *p++; + if (any("+-", c)) { + if (c != op || *p) + stderror(ERR_NAME | ERR_UNKNOWNOP); + p = Strsave(STR1); + } + else { + if (any("<>", op)) { + if (c != op) + stderror(ERR_NAME | ERR_UNKNOWNOP); + c = *p++; + stderror(ERR_NAME | ERR_SYNTAX); + } + if (c != '=') + stderror(ERR_NAME | ERR_UNKNOWNOP); + p = xset(p, &v); + } + } + if (op == '=') + if (hadsub) + asx(vp, subscr, p); + else + set(vp, p); + else if (hadsub) { + struct varent *gv = getvx(vp, subscr); + + asx(vp, subscr, operate(op, gv->vec[subscr - 1], p)); + } + else + set(vp, operate(op, value(vp), p)); + if (eq(vp, STRpath)) { + exportpath(adrof(STRpath)->vec); + dohash(); + } + xfree((ptr_t) vp); + if (c != '=') + xfree((ptr_t) p); + } while (p = *v++); +} + +static Char * +xset(cp, vp) + Char *cp, ***vp; +{ + register Char *dp; + + if (*cp) { + dp = Strsave(cp); + --(*vp); + xfree((ptr_t) ** vp); + **vp = dp; + } + return (putn(exp(vp))); +} + +static Char * +operate(op, vp, p) + Char op, *vp, *p; +{ + Char opr[2]; + Char *vec[5]; + register Char **v = vec; + Char **vecp = v; + register int i; + + if (op != '=') { + if (*vp) + *v++ = vp; + opr[0] = op; + opr[1] = 0; + *v++ = opr; + if (op == '<' || op == '>') + *v++ = opr; + } + *v++ = p; + *v++ = 0; + i = exp(&vecp); + if (*vecp) + stderror(ERR_NAME | ERR_EXPRESSION); + return (putn(i)); +} + +static Char *putp; + +Char * +putn(n) + register int n; +{ + int num; + static Char number[15]; + + putp = number; + if (n < 0) { + n = -n; + *putp++ = '-'; + } + num = 2; /* comfuse lint */ + if (sizeof(int) == num && n == -32768) { + *putp++ = '3'; + n = 2768; +#ifdef pdp11 + } +#else + } + else { + num = 4; /* comfuse lint */ + if (sizeof(int) == num && n == -2147483648) { + *putp++ = '2'; + n = 147483648; + } + } +#endif + putn1(n); + *putp = 0; + return (Strsave(number)); +} + +static void +putn1(n) + register int n; +{ + if (n > 9) + putn1(n / 10); + *putp++ = n % 10 + '0'; +} + +int +getn(cp) + register Char *cp; +{ + register int n; + int sign; + + sign = 0; + if (cp[0] == '+' && cp[1]) + cp++; + if (*cp == '-') { + sign++; + cp++; + if (!Isdigit(*cp)) + stderror(ERR_NAME | ERR_BADNUM); + } + n = 0; + while (Isdigit(*cp)) + n = n * 10 + *cp++ - '0'; + if (*cp) + stderror(ERR_NAME | ERR_BADNUM); + return (sign ? -n : n); +} + +Char * +value1(var, head) + Char *var; + struct varent *head; +{ + register struct varent *vp; + + vp = adrof1(var, head); + return (vp == 0 || vp->vec[0] == 0 ? STRNULL : vp->vec[0]); +} + +static struct varent * +madrof(pat, vp) + Char *pat; + register struct varent *vp; +{ + register struct varent *vp1; + + for (; vp; vp = vp->v_right) { + if (vp->v_left && (vp1 = madrof(pat, vp->v_left))) + return vp1; + if (Gmatch(vp->v_name, pat)) + return vp; + } + return vp; +} + +struct varent * +adrof1(name, v) + register Char *name; + register struct varent *v; +{ + register cmp; + + v = v->v_left; + while (v && ((cmp = *name - *v->v_name) || (cmp = Strcmp(name, v->v_name)))) + if (cmp < 0) + v = v->v_left; + else + v = v->v_right; + return v; +} + +/* + * The caller is responsible for putting value in a safe place + */ +void +set(var, val) + Char *var, *val; +{ + register Char **vec = (Char **) xmalloc((size_t) (2 * sizeof(Char **))); + + vec[0] = val; + vec[1] = 0; + set1(var, vec, &shvhed); +} + +void +set1(var, vec, head) + Char *var, **vec; + struct varent *head; +{ + register Char **oldv = vec; + + gflag = 0; + tglob(oldv); + if (gflag) { + vec = globall(oldv); + if (vec == 0) { + blkfree(oldv); + stderror(ERR_NAME | ERR_NOMATCH); + return; + } + blkfree(oldv); + gargv = 0; + } + setq(var, vec, head); +} + + +void +setq(name, vec, p) + Char *name, **vec; + register struct varent *p; +{ + register struct varent *c; + register f; + + f = 0; /* tree hangs off the header's left link */ + while (c = p->v_link[f]) { + if ((f = *name - *c->v_name) == 0 && + (f = Strcmp(name, c->v_name)) == 0) { + blkfree(c->vec); + goto found; + } + p = c; + f = f > 0; + } + p->v_link[f] = c = (struct varent *) xmalloc((size_t)sizeof(struct varent)); + c->v_name = Strsave(name); + c->v_bal = 0; + c->v_left = c->v_right = 0; + c->v_parent = p; + balance(p, f, 0); +found: + trim(c->vec = vec); +} + +void +unset(v) + Char *v[]; +{ + register bool did_only; + + did_only = adrof(STRrecognize_only_executables) != 0; + unset1(v, &shvhed); + if (adrof(STRhstc) == 0) { + HIST = '!'; + HISTSUB = '^'; + } + if (adrof(STRhstl) == 0) + HistLit = 0; + if (adrof(STRwordchars) == 0) + word_chars = STR_WORD_CHARS; + if (adrof(STRedit) == 0) + editing = 0; + if (adrof(STRbKslash_quote) == 0) + bslash_quote = 0; + if (did_only && adrof(STRrecognize_only_executables) == 0) + tw_clear_comm_list(); +} + +void +unset1(v, head) + register Char *v[]; + struct varent *head; +{ + register struct varent *vp; + register int cnt; + + while (*++v) { + cnt = 0; + while (vp = madrof(*v, head->v_left)) + unsetv1(vp), cnt++; + if (cnt == 0) + setname(short2str(*v)); + } +} + +void +unsetv(var) + Char *var; +{ + register struct varent *vp; + + if ((vp = adrof1(var, &shvhed)) == 0) + udvar(var); + unsetv1(vp); +} + +static void +unsetv1(p) + register struct varent *p; +{ + register struct varent *c, *pp; + register f; + + /* + * Free associated memory first to avoid complications. + */ + blkfree(p->vec); + xfree((ptr_t) p->v_name); + /* + * If p is missing one child, then we can move the other into where p is. + * Otherwise, we find the predecessor of p, which is guaranteed to have no + * right child, copy it into p, and move it's left child into it. + */ + if (p->v_right == 0) + c = p->v_left; + else if (p->v_left == 0) + c = p->v_right; + else { + for (c = p->v_left; c->v_right; c = c->v_right); + p->v_name = c->v_name; + p->vec = c->vec; + p = c; + c = p->v_left; + } + /* + * Move c into where p is. + */ + pp = p->v_parent; + f = pp->v_right == p; + if (pp->v_link[f] = c) + c->v_parent = pp; + /* + * Free the deleted node, and rebalance. + */ + xfree((ptr_t) p); + balance(pp, f, 1); +} + +void +setNS(cp) + Char *cp; +{ + set(cp, Strsave(STRNULL)); +} + +void +shift(v) + register Char **v; +{ + register struct varent *argv; + register Char *name; + + v++; + name = *v; + if (name == 0) + name = STRargv; + else + (void) strip(name); + argv = adrof(name); + if (argv == 0) + udvar(name); + if (argv->vec[0] == 0) + stderror(ERR_NAME | ERR_NOMORE); + lshift(argv->vec, 1); +} + +static void +exportpath(val) + Char **val; +{ + Char exppath[BUFSIZ]; + + exppath[0] = 0; + if (val) + while (*val) { + if (Strlen(*val) + Strlen(exppath) + 2 > BUFSIZ) { + xprintf("Warning: ridiculously long PATH truncated\n"); + break; + } + (void) Strcat(exppath, *val++); + if (*val == 0 || eq(*val, STRRparen)) + break; + (void) Strcat(exppath, STRcolon); + } + Setenv(STRPATH, exppath); +} + +#ifndef lint + /* + * Lint thinks these have null effect + */ + /* macros to do single rotations on node p */ +#define rright(p) (\ + t = (p)->v_left,\ + (t)->v_parent = (p)->v_parent,\ + ((p)->v_left = t->v_right) ? (t->v_right->v_parent = (p)) : 0,\ + (t->v_right = (p))->v_parent = t,\ + (p) = t) +#define rleft(p) (\ + t = (p)->v_right,\ + (t)->v_parent = (p)->v_parent,\ + ((p)->v_right = t->v_left) ? (t->v_left->v_parent = (p)) : 0,\ + (t->v_left = (p))->v_parent = t,\ + (p) = t) +#else +struct varent * +rleft(p) + struct varent *p; +{ + return (p); +} +struct varent * +rright(p) + struct varent *p; +{ + return (p); +} + +#endif /* ! lint */ + + +/* + * Rebalance a tree, starting at p and up. + * F == 0 means we've come from p's left child. + * D == 1 means we've just done a delete, otherwise an insert. + */ +static void +balance(p, f, d) + register struct varent *p; + register int f, d; +{ + register struct varent *pp; + +#ifndef lint + register struct varent *t; /* used by the rotate macros */ + +#endif + register ff; + + /* + * Ok, from here on, p is the node we're operating on; pp is it's parent; f + * is the branch of p from which we have come; ff is the branch of pp which + * is p. + */ + for (; pp = p->v_parent; p = pp, f = ff) { + ff = pp->v_right == p; + if (f ^ d) { /* right heavy */ + switch (p->v_bal) { + case -1: /* was left heavy */ + p->v_bal = 0; + break; + case 0: /* was balanced */ + p->v_bal = 1; + break; + case 1: /* was already right heavy */ + switch (p->v_right->v_bal) { + case 1: /* sigle rotate */ + pp->v_link[ff] = rleft(p); + p->v_left->v_bal = 0; + p->v_bal = 0; + break; + case 0: /* single rotate */ + pp->v_link[ff] = rleft(p); + p->v_left->v_bal = 1; + p->v_bal = -1; + break; + case -1: /* double rotate */ + (void) rright(p->v_right); + pp->v_link[ff] = rleft(p); + p->v_left->v_bal = + p->v_bal < 1 ? 0 : -1; + p->v_right->v_bal = + p->v_bal > -1 ? 0 : 1; + p->v_bal = 0; + break; + } + break; + } + } + else { /* left heavy */ + switch (p->v_bal) { + case 1: /* was right heavy */ + p->v_bal = 0; + break; + case 0: /* was balanced */ + p->v_bal = -1; + break; + case -1: /* was already left heavy */ + switch (p->v_left->v_bal) { + case -1: /* single rotate */ + pp->v_link[ff] = rright(p); + p->v_right->v_bal = 0; + p->v_bal = 0; + break; + case 0: /* signle rotate */ + pp->v_link[ff] = rright(p); + p->v_right->v_bal = -1; + p->v_bal = 1; + break; + case 1: /* double rotate */ + (void) rleft(p->v_left); + pp->v_link[ff] = rright(p); + p->v_left->v_bal = + p->v_bal < 1 ? 0 : -1; + p->v_right->v_bal = + p->v_bal > -1 ? 0 : 1; + p->v_bal = 0; + break; + } + break; + } + } + /* + * If from insert, then we terminate when p is balanced. If from + * delete, then we terminate when p is unbalanced. + */ + if ((p->v_bal == 0) ^ d) + break; + } +} + +void +plist(p) + register struct varent *p; +{ + register struct varent *c; + register len; + + if (setintr) +#ifdef BSDSIGS + (void) sigsetmask(sigblock((sigmask_t) 0) & ~sigmask(SIGINT)); +#else /* BSDSIGS */ + (void) sigrelse(SIGINT); +#endif /* BSDSIGS */ + + for (;;) { + while (p->v_left) + p = p->v_left; +x: + if (p->v_parent == 0) /* is it the header? */ + return; + len = blklen(p->vec); + xprintf(short2str(p->v_name)); + xputchar('\t'); + if (len != 1) + xputchar('('); + blkpr(p->vec); + if (len != 1) + xputchar(')'); + xputchar('\n'); + if (p->v_right) { + p = p->v_right; + continue; + } + do { + c = p; + p = p->v_parent; + } while (p->v_right == c); + goto x; + } +} diff --git a/bin/tcsh/sh.time.c b/bin/tcsh/sh.time.c new file mode 100644 index 0000000..74da59a --- /dev/null +++ b/bin/tcsh/sh.time.c @@ -0,0 +1,623 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/sh.time.c,v 3.0 1991/07/04 21:49:28 christos Exp $ */ +/* + * sh.time.c: Shell time keeping and printing. + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#include "config.h" +#if !defined(lint) && !defined(pdp11) +static char *rcsid() + { return "$Id: sh.time.c,v 3.0 1991/07/04 21:49:28 christos Exp $"; } +#endif + +#include "sh.h" +#if defined(sun) && ! defined(MACH) +# include +#endif /* sun */ + +/* + * C Shell - routines handling process timing and niceing + */ +#ifdef BSDTIMES +# ifndef RUSAGE_SELF +# define RUSAGE_SELF 0 +# define RUSAGE_CHILDREN -1 +# endif /* RUSAGE_SELF */ +#else /* BSDTIMES */ +struct tms times0; + +#endif /* BSDTIMES */ + +#if !defined(BSDTIMES) && !defined(_SEQUENT_) +#ifdef POSIX +static void pdtimet __P((clock_t, clock_t)); +#else /* POSIX */ +static void pdtimet __P((time_t, time_t)); +#endif /* POSIX */ +#else +static void pdeltat __P((tmval_t *, tmval_t *)); +#endif + +void +settimes() +{ +#ifdef BSDTIMES + struct rusage ruch; + + (void) gettimeofday(&time0, NULL); + (void) getrusage(RUSAGE_SELF, &ru0); + (void) getrusage(RUSAGE_CHILDREN, &ruch); + ruadd(&ru0, &ruch); +#else +# ifdef _SEQUENT_ + struct pro_stats ruch; + + (void) get_pro_stats(&time0, PS_SELF, &ru0, &ruch); + ruadd(&ru0, &ruch); +# else /* _SEQUENT_ */ + time0 = times(×0); + times0.tms_stime += times0.tms_cstime; + times0.tms_utime += times0.tms_cutime; + times0.tms_cstime = 0; + times0.tms_cutime = 0; +# endif /* _SEQUENT_ */ +#endif /* BSDTIMES */ +} + +/* + * dotime is only called if it is truly a builtin function and not a + * prefix to another command + */ +void +dotime() +{ +#ifdef BSDTIMES + tmval_t timedol; + struct rusage ru1, ruch; + + (void) getrusage(RUSAGE_SELF, &ru1); + (void) getrusage(RUSAGE_CHILDREN, &ruch); + ruadd(&ru1, &ruch); + (void) gettimeofday(&timedol, NULL); + prusage(&ru0, &ru1, &timedol, &time0); +#else +# ifdef _SEQUENT_ + tmval_t timedol; + struct pro_stats ru1, ruch; + + (void) get_pro_stats(&timedol, PS_SELF, &ru1, &ruch); + ruadd(&ru1, &ruch); + prusage(&ru0, &ru1, &timedol, &time0); +# else /* _SEQUENT_ */ +# ifndef POSIX + time_t timedol; +# else /* POSIX */ + clock_t timedol; +# endif /* POSIX */ + + struct tms times_dol; + + timedol = times(×_dol); + times_dol.tms_stime += times_dol.tms_cstime; + times_dol.tms_utime += times_dol.tms_cutime; + times_dol.tms_cstime = 0; + times_dol.tms_cutime = 0; + prusage(×0, ×_dol, timedol, time0); +# endif /* _SEQUENT_ */ +#endif /* BSDTIMES */ +} + +/* + * donice is only called when it on the line by itself or with a +- value + */ +void +donice(v) + register Char **v; +{ + register Char *cp; + int nval = 0; + + v++, cp = *v++; + if (cp == 0) + nval = 4; + else if (*v == 0 && any("+-", cp[0])) + nval = getn(cp); +#ifdef BSDNICE + (void) setpriority(PRIO_PROCESS, 0, nval); +#else /* BSDNICE */ + (void) nice(nval); +#endif /* BSDNICE */ +} + +#ifdef BSDTIMES +void +ruadd(ru, ru2) + register struct rusage *ru, *ru2; +{ + tvadd(&ru->ru_utime, &ru2->ru_utime); + tvadd(&ru->ru_stime, &ru2->ru_stime); + if (ru2->ru_maxrss > ru->ru_maxrss) + ru->ru_maxrss = ru2->ru_maxrss; + + ru->ru_ixrss += ru2->ru_ixrss; + ru->ru_idrss += ru2->ru_idrss; + ru->ru_isrss += ru2->ru_isrss; + ru->ru_minflt += ru2->ru_minflt; + ru->ru_majflt += ru2->ru_majflt; + ru->ru_nswap += ru2->ru_nswap; + ru->ru_inblock += ru2->ru_inblock; + ru->ru_oublock += ru2->ru_oublock; + ru->ru_msgsnd += ru2->ru_msgsnd; + ru->ru_msgrcv += ru2->ru_msgrcv; + ru->ru_nsignals += ru2->ru_nsignals; + ru->ru_nvcsw += ru2->ru_nvcsw; + ru->ru_nivcsw += ru2->ru_nivcsw; +} + +#else /* BSDTIMES */ +# ifdef _SEQUENT_ +void +ruadd(ru, ru2) + register struct pro_stats *ru, *ru2; +{ + tvadd(&ru->ps_utime, &ru2->ps_utime); + tvadd(&ru->ps_stime, &ru2->ps_stime); + if (ru2->ps_maxrss > ru->ps_maxrss) + ru->ps_maxrss = ru2->ps_maxrss; + + ru->ps_pagein += ru2->ps_pagein; + ru->ps_reclaim += ru2->ps_reclaim; + ru->ps_zerofill += ru2->ps_zerofill; + ru->ps_pffincr += ru2->ps_pffincr; + ru->ps_pffdecr += ru2->ps_pffdecr; + ru->ps_swap += ru2->ps_swap; + ru->ps_syscall += ru2->ps_syscall; + ru->ps_volcsw += ru2->ps_volcsw; + ru->ps_involcsw += ru2->ps_involcsw; + ru->ps_signal += ru2->ps_signal; + ru->ps_lread += ru2->ps_lread; + ru->ps_lwrite += ru2->ps_lwrite; + ru->ps_bread += ru2->ps_bread; + ru->ps_bwrite += ru2->ps_bwrite; + ru->ps_phread += ru2->ps_phread; + ru->ps_phwrite += ru2->ps_phwrite; +} + +# endif /* _SEQUENT_ */ +#endif /* BSDTIMES */ + +#ifdef BSDTIMES + +/* + * PWP: the LOG1024 and pagetok stuff taken from the top command, + * written by William LeFebvre + */ +/* Log base 2 of 1024 is 10 (2^10 == 1024) */ +#define LOG1024 10 + +/* Convert clicks (kernel pages) to kbytes ... */ +/* If there is no PGSHIFT defined, assume it is 11 */ +/* Is this needed for compatability with some old flavor of 4.2 or 4.1? */ +#ifndef PGSHIFT +# define pagetok(size) ((size) << 1) +#else +# if PGSHIFT>10 +# define pagetok(size) ((size) << (PGSHIFT - LOG1024)) +# else +# define pagetok(size) ((size) >> (LOG1024 - PGSHIFT)) +# endif +#endif + +/* + * if any other machines return wierd values in the ru_i* stuff, put + * the adjusting macro here: + */ +#ifdef sun +# define IADJUST(i) (pagetok(i)/2) +#else /* sun */ +# define IADJUST(i) (i) +#endif /* sun */ + +void +prusage(r0, r1, e, b) + register struct rusage *r0, *r1; + tmval_t *e, *b; + +#else /* BSDTIMES */ +# ifdef _SEQUENT_ +void +prusage(r0, r1, e, b) + register struct pro_stats *r0, *r1; + tmval_t *e, *b; + +# else /* _SEQUENT_ */ +void +prusage(bs, es, e, b) + struct tms *bs, *es; + +# ifndef POSIX + time_t e, b; + +# else /* POSIX */ + clock_t e, b; + +# endif /* POSIX */ +# endif /* _SEQUENT_ */ +#endif /* BSDTIMES */ +{ +#ifdef BSDTIMES + register time_t t = + (r1->ru_utime.tv_sec - r0->ru_utime.tv_sec) * 100 + + (r1->ru_utime.tv_usec - r0->ru_utime.tv_usec) / 10000 + + (r1->ru_stime.tv_sec - r0->ru_stime.tv_sec) * 100 + + (r1->ru_stime.tv_usec - r0->ru_stime.tv_usec) / 10000; + +#else +# ifdef _SEQUENT_ + register time_t t = + (r1->ps_utime.tv_sec - r0->ps_utime.tv_sec) * 100 + + (r1->ps_utime.tv_usec - r0->ps_utime.tv_usec) / 10000 + + (r1->ps_stime.tv_sec - r0->ps_stime.tv_sec) * 100 + + (r1->ps_stime.tv_usec - r0->ps_stime.tv_usec) / 10000; + +# else /* _SEQUENT_ */ +# ifndef POSIX + register time_t t = (es->tms_utime - bs->tms_utime + + es->tms_stime - bs->tms_stime) * 100 / HZ; + +# else /* POSIX */ + register clock_t t = (es->tms_utime - bs->tms_utime + + es->tms_stime - bs->tms_stime) * 100 / CLK_TCK; + +# endif /* POSIX */ +# endif /* _SEQUENT_ */ +#endif /* BSDTIMES */ + + register char *cp; + register long i; + register struct varent *vp = adrof(STRtime); + +#ifdef BSDTIMES +#ifdef pdp11 + long ms = +#else + int ms = +#endif + (e->tv_sec - b->tv_sec) * 100 + (e->tv_usec - b->tv_usec) / 10000; + +#ifdef pdp11 + cp = "%Uu %Ss %E %P %I+%Oio %Vov %Wsw"; +#else + cp = "%Uu %Ss %E %P %X+%Dk %I+%Oio %Fpf+%Ww"; +#endif +#else +# ifdef _SEQUENT_ + int ms = + (e->tv_sec - b->tv_sec) * 100 + (e->tv_usec - b->tv_usec) / 10000; + + cp = "%Uu %Ss %E %P %I+%Oio %Fpf+%Ww"; +# else /* _SEQUENT_ */ +# ifndef POSIX + time_t ms = (e - b) * 100 / HZ; + +# else /* POSIX */ + clock_t ms = (e - b) * 100 / CLK_TCK; + +# endif /* POSIX */ + cp = "%Uu %Ss %E %P"; + + /* + * the tms stuff is not very precise, so we fudge it. + * granularity fix: can't be more than 100% + * this breaks in multi-processor systems... + * maybe I should take it out and let people see more then 100% + * utilizations. + */ + if (ms < t && ms != 0) + ms = t; +# endif /* _SEQUENT_ */ +#endif /* BSDTIMES */ +#ifdef TDEBUG + xprintf("es->tms_utime %lu bs->tms_utime %lu\n", + es->tms_utime, bs->tms_utime); + xprintf("es->tms_stime %lu bs->tms_stime %lu\n", + es->tms_stime, bs->tms_stime); + xprintf("ms %lu e %lu b %lu\n", ms, e, b); + xprintf("t %lu\n", t); +#endif /* TDEBUG */ + + if (vp && vp->vec[0] && vp->vec[1]) + cp = short2str(vp->vec[1]); + for (; *cp; cp++) + if (*cp != '%') + xputchar(*cp); + else if (cp[1]) + switch (*++cp) { + + case 'U': /* user CPU time used */ +#ifdef BSDTIMES + pdeltat(&r1->ru_utime, &r0->ru_utime); +#else +# ifdef _SEQUENT_ + pdeltat(&r1->ps_utime, &r0->ps_utime); +# else /* _SEQUENT_ */ +# ifndef POSIX + pdtimet(es->tms_utime, bs->tms_utime); +# else /* POSIX */ + pdtimet(es->tms_utime, bs->tms_utime); +# endif /* POSIX */ +# endif /* _SEQUENT_ */ +#endif /* BSDTIMES */ + break; + + case 'S': /* system CPU time used */ +#ifdef BSDTIMES + pdeltat(&r1->ru_stime, &r0->ru_stime); +#else +# ifdef _SEQUENT_ + pdeltat(&r1->ps_stime, &r0->ps_stime); +# else /* _SEQUENT_ */ +# ifndef POSIX + pdtimet(es->tms_stime, bs->tms_stime); +# else /* POSIX */ + pdtimet(es->tms_stime, bs->tms_stime); +# endif /* POSIX */ +# endif /* _SEQUENT_ */ +#endif /* BSDTIMES */ + break; + + case 'E': /* elapsed (wall-clock) time */ +#ifdef BSDTIMES + pcsecs((long) ms); +#else /* BSDTIMES */ + pcsecs(ms); +#endif /* BSDTIMES */ + break; + + case 'P': /* percent time spent running */ + /* check if the process did not run */ + i = (ms == 0) ? 0 : (t * 1000 / ms); + xprintf("%ld.%01ld%%", i / 10, i % 10); /* nn.n% */ + break; + +#ifdef BSDTIMES +#ifdef pdp11 + case 'V': + xprintf("%ld", r1->ru_ovly - r0->ru_ovly); + break; +#endif + + case 'W': /* number of swaps */ + i = r1->ru_nswap - r0->ru_nswap; + xprintf("%ld", i); + break; + + case 'X': /* (average) shared text size */ + xprintf("%ld", t == 0 ? 0L : + IADJUST(r1->ru_ixrss - r0->ru_ixrss) / t); + break; + + case 'D': /* (average) unshared data size */ + xprintf("%ld", t == 0 ? 0L : + IADJUST(r1->ru_idrss + r1->ru_isrss - + (r0->ru_idrss + r0->ru_isrss)) / t); + break; + + case 'K': /* (average) total data memory used */ + xprintf("%ld", t == 0 ? 0L : + IADJUST((r1->ru_ixrss + r1->ru_isrss + r1->ru_idrss) - + (r0->ru_ixrss + r0->ru_idrss + r0->ru_isrss)) / t); + break; + + case 'M': /* max. Resident Set Size */ +#ifdef sun + /* xprintf("%ld", r1->ru_maxrss * 1024L/(long) getpagesize()); */ + xprintf("%ld", pagetok(r1->ru_maxrss)); +#else + xprintf("%ld", r1->ru_maxrss / 2L); +#endif /* sun */ + break; + + case 'F': /* page faults */ + xprintf("%ld", r1->ru_majflt - r0->ru_majflt); + break; + + case 'R': /* page reclaims */ + xprintf("%ld", r1->ru_minflt - r0->ru_minflt); + break; + + case 'I': /* FS blocks in */ + xprintf("%ld", r1->ru_inblock - r0->ru_inblock); + break; + + case 'O': /* FS blocks out */ + xprintf("%ld", r1->ru_oublock - r0->ru_oublock); + break; + + case 'r': /* PWP: socket messages recieved */ + xprintf("%ld", r1->ru_msgrcv - r0->ru_msgrcv); + break; + + case 's': /* PWP: socket messages sent */ + xprintf("%ld", r1->ru_msgsnd - r0->ru_msgsnd); + break; + + case 'k': /* PWP: number of signals recieved */ + xprintf("%ld", r1->ru_nsignals - r0->ru_nsignals); + break; + + case 'w': /* PWP: num. voluntary context switches (waits) */ + xprintf("%ld", r1->ru_nvcsw - r0->ru_nvcsw); + break; + + case 'c': /* PWP: num. involuntary context switches */ + xprintf("%ld", r1->ru_nivcsw - r0->ru_nivcsw); + break; +#else /* BSDTIMES */ +# ifdef _SEQUENT_ + case 'W': /* number of swaps */ + i = r1->ps_swap - r0->ps_swap; + xprintf("%ld", i); + break; + + case 'M': + xprintf("%ld", r1->ps_maxrss / 2); + break; + + case 'F': + xprintf("%ld", r1->ps_pagein - r0->ps_pagein); + break; + + case 'R': + xprintf("%ld", r1->ps_reclaim - r0->ps_reclaim); + break; + + case 'I': + xprintf("%ld", r1->ps_bread - r0->ps_bread); + break; + + case 'O': + xprintf("%ld", r1->ps_bwrite - r0->ps_bwrite); + break; + + case 'k': + xprintf("%ld", r1->ps_signal - r0->ps_signal); + break; + + case 'w': + xprintf("%ld", r1->ps_volcsw - r0->ps_volcsw); + break; + + case 'c': + xprintf("%ld", r1->ps_involcsw - r0->ps_involcsw); + break; + + case 'Z': + xprintf("%ld", r1->ps_zerofill - r0->ps_zerofill); + break; + + case 'i': + xprintf("%ld", r1->ps_pffincr - r0->ps_pffincr); + break; + + case 'd': + xprintf("%ld", r1->ps_pffdecr - r0->ps_pffdecr); + break; + + case 'Y': + xprintf("%ld", r1->ps_syscall - r0->ps_syscall); + break; + + case 'l': + xprintf("%ld", r1->ps_lread - r0->ps_lread); + break; + + case 'm': + xprintf("%ld", r1->ps_lwrite - r0->ps_lwrite); + break; + + case 'p': + xprintf("%ld", r1->ps_phread - r0->ps_phread); + break; + + case 'q': + xprintf("%ld", r1->ps_phwrite - r0->ps_phwrite); + break; +# endif /* _SEQUENT_ */ +#endif /* BSDTIMES */ + } + xputchar('\n'); +} + +#if defined(BSDTIMES) || defined(_SEQUENT_) +static void +pdeltat(t1, t0) + tmval_t *t1, *t0; +{ + tmval_t td; + + tvsub(&td, t1, t0); + xprintf("%d.%01d", td.tv_sec, td.tv_usec / 100000); +} + +void +tvadd(tsum, t0) + tmval_t *tsum, *t0; +{ + + tsum->tv_sec += t0->tv_sec; + tsum->tv_usec += t0->tv_usec; + if (tsum->tv_usec > 1000000) + tsum->tv_sec++, tsum->tv_usec -= 1000000; +} + +void +tvsub(tdiff, t1, t0) + tmval_t *tdiff, *t1, *t0; +{ + + tdiff->tv_sec = t1->tv_sec - t0->tv_sec; + tdiff->tv_usec = t1->tv_usec - t0->tv_usec; + if (tdiff->tv_usec < 0) + tdiff->tv_sec--, tdiff->tv_usec += 1000000; +} + +#else /* !BSDTIMES && !_SEQUENT_ */ +static void +pdtimet(eval, bval) +#ifndef POSIX + time_t eval, bval; + +#else /* POSIX */ + clock_t eval, bval; + +#endif /* POSIX */ +{ +#ifndef POSIX + time_t val; + +#else /* POSIX */ + clock_t val; + +#endif /* POSIX */ + +#ifndef POSIX + val = (eval - bval) * 100 / HZ; +#else /* POSIX */ + val = (eval - bval) * 100 / CLK_TCK; +#endif /* POSIX */ + + xprintf("%ld.%02ld", val / 100, val - (val / 100 * 100)); +} + +#endif /* BSDTIMES || _SEQUENT_ */ diff --git a/bin/tcsh/sh.types.h b/bin/tcsh/sh.types.h new file mode 100644 index 0000000..8cc9b9a --- /dev/null +++ b/bin/tcsh/sh.types.h @@ -0,0 +1,351 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/sh.types.h,v 3.0 1991/07/04 23:38:32 christos Exp $ */ +/* sh.types.h: Do the necessary typedefs for each system. + * Up till now I avoided making this into a separate file + * But I just wanted to eliminate the whole mess from sh.h + * In reality this should not be here! It is OS and MACHINE + * dependent, even between different revisions of OS's... + * Ideally there should be a way in c, to find out if something + * was typedef'ed, but unfortunately we rely in cpp kludges. + * Someday, this file will be removed... + * + * christos + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#ifndef _h_sh_types +#define _h_sh_types + + +/*** + *** Suns running sunos4.1 + ***/ +#ifdef sun +/* This used to be long, but lint dissagrees... */ +# ifndef _SIGMASK_T +# define _SIGMASK_T + typedef int sigmask_t; +# endif /* _SIGMASK_T */ +# ifndef _PTR_T +# define _PTR_T +# ifdef __GNUC__ + typedef void * ptr_t; +# else + typedef char * ptr_t; +# endif /* __GNUC__ */ +# endif /* _PTR_T */ +# ifndef _SIZE_T +# define _SIZE_T +# endif /* _SIZE_T */ +# ifndef __sys_stdtypes_h +# define __sys_stdtypes_h + typedef int pid_t; + typedef unsigned int speed_t; +# endif /* __sys_stdtypes.h */ +# ifndef _PID_T +# define _PID_T +# endif /* _PID_T */ +# ifndef _SPEED_T +# define _SPEED_T +# endif /* _SPEED_T */ +# ifdef notdef +/* + * This is what sun's lint wants, but the .h file disagree + */ +extern char *getwd(); +extern time_t time(); +extern int getuid(), geteuid(); +extern int getgid(), getguid(); +extern int _exit(); +extern int abort(); +extern int alarm(); +extern void endpwent(); +extern char *sbrk(); +extern int sleep(); +# endif /* notdef */ +#endif /*sun */ + + +/*** + *** Hp's running hpux 7.0 + ***/ +#ifdef __hpux +# ifndef _SIZE_T +# define _SIZE_T + typedef unsigned int size_t; +# endif /* _SIZE_T */ + +# ifndef _PTR_T +# define _PTR_T + typedef void * ptr_t; +# endif /* _PTR_T */ + +# ifndef _PID_T +# define _PID_T + typedef long pid_t; +# endif /* _PID_T */ + +# ifndef _SIGMASK_T +# define _SIGMASK_T + typedef long sigmask_t; +# endif /* _SIGMASK_T */ + +# ifndef _SPEED_T + /* I thought POSIX was supposed to protect all typedefs! */ +# define _SPEED_T +# endif /* _SPEED_T */ + +extern uid_t getuid(), geteuid(); +extern gid_t getgid(), getegid(); +extern sigmask_t sigblock(); +extern sigmask_t sigsetmask(); +#ifndef __hp9000s700 +extern void sigpause(); +extern sigmask_t sigspace(); +#endif +extern pid_t getpid(); +extern pid_t fork(); +extern void perror(); +extern void _exit(); +extern void abort(); +extern void qsort(); +extern void free(); +extern unsigned int alarm(); +extern unsigned int sleep(); +#ifndef __hp9000s700 +extern int lstat(); +extern int readlink(); +extern int sigvector(); +extern int gethostname(); +extern int ioctl(); +extern int nice(); +extern char *sbrk(); +#endif +#endif /* __hpux */ + + +/*** + *** Data General 88000, running dgux ??? + ***/ +#ifdef DGUX +/* + * DGUX types + */ +# ifndef _SIZE_T +# define _SIZE_T + typedef unsigned int size_t; +# endif /* _SIZE_T */ +#endif + + +/*** + *** a PFU/Fujitsu A-xx computer SX/A Edition 60 or later + ***/ +#ifdef SXA +# ifndef _SIZE_T +# define _SIZE_T +# endif /* _SIZE_T */ +#endif /* SXA */ + + +/*** + *** BSD systems, pre and post 4.3 + ***/ +#ifdef BSD +extern uid_t getuid(), geteuid(); +extern gid_t getgid(), getegid(); +# ifndef _SIZE_T +# define _SIZE_T +# endif /* _SIZE_T */ +#endif /* BSD */ +/*** + *** BSD 2_10 has some special needs + ***/ +#ifdef pdp11 +# ifndef _SIGMASK_T +# define _SIGMASK_T +# ifndef sigmask_t +# define sigmask_t sigm_t +# endif + typedef long sigm_t; +# endif /* _SIGMASK_T */ +#endif /* pdp11 */ + +/*** + *** BSD RENO advertises itself as POSIX, but + *** it is missing speed_t (newer versions of RENO have it) + ***/ +#ifdef RENO +# ifndef _SPEED_T +# define _SPEED_T +/* typedef unsigned int speed_t; */ +# endif /* _SPEED_T */ +#endif /* RENO */ + + +/*** + *** rs6000, ibm370, ps2: running flavors of aix. + ***/ +#ifdef IBMAIX +# ifndef _SIZE_T +# define _SIZE_T +# endif /* _SIZE_T */ +# ifndef _PID_T +# define _PID_T +# endif /* _PID_T */ +# ifdef _IBMR2 +# ifndef _SPEED_T +# define _SPEED_T +# endif /* _SPEED_T */ +# endif /* _IBMR2 */ +#endif /* IBMAIX */ + + +/*** + *** Ultrix... + ***/ +#ifdef ultrix +# ifndef _SIZE_T +# define _SIZE_T +# endif /* _SIZE_T */ +# ifndef _PID_T +# define _PID_T +# endif /* _PID_T */ +#endif /* ultrix */ + + +/*** + *** Silicon graphics IRIS4D running IRIX3_3 + ***/ +#if defined(IRIS4D) && defined(IRIX3_3) +# ifndef _PID_T +# define _PID_T +# endif /* _PID_T */ +#endif /* IRIS4D && IRIX3_3 */ + + +/*** + *** Sequent + ***/ +#ifdef sequent +# ifndef _SIZE_T +# define _SIZE_T +# endif /* _SIZE_T */ +#endif /* sequent */ + +/*** + *** Apple AUX. + ***/ +#ifdef OREO +# ifndef _SIZE_T +# define _SIZE_T +# endif /* _SIZE_T */ +# ifndef _PID_T +# define _PID_T +# endif /* _PID_T */ +#endif /* OREO */ + +/*** + *** Intel 386, Hypercube + ***/ +#ifdef HYPERCUBE +# ifndef _SIZE_T +# define _SIZE_T +# endif /* _SIZE_T */ +#endif /* HYPERCUBE */ + +/*** + *** Concurrent (Masscomp) running RTU 4.1A & RTU 5.0. + *** Added, DAS DEC-90. + ***/ +#ifdef masscomp +# ifndef _SIZE_T +# define _SIZE_T +# endif /* _SIZE_T */ +#endif /* masscomp */ + +/*** + *** Catch all for non POSIX systems. + *** Posix things *should* define these automatically + *** I am open to suggestions on how to do this correctly! + ***/ +#ifndef POSIX +#ifndef pdp11 +# ifndef _SIZE_T +# define _SIZE_T + typedef int size_t; /* As sun comments ??? : meaning I take it */ +# endif /* _SIZE_T */ /* Until we make the world POSIX... */ + +# ifndef _PID_T +# define _PID_T + typedef int pid_t; +# endif /* _PID_T */ +#endif /* !pdp11 */ + +# ifndef _SPEED_T +# define _SPEED_T + typedef unsigned int speed_t; +# endif /* _SPEED_T */ + +#ifndef _PTR_T +# define _PTR_T + typedef char * ptr_t; +#endif /* _PTR_T */ + +#ifndef _IOCTL_T +# define _IOCTL_T + typedef char * ioctl_t; /* Third arg of ioctl */ +#endif /* _IOCTL_T */ + +#endif /* ! POSIX */ + + + +/*** + *** This is our own junk types. + ***/ +#ifndef _PTR_T +# define _PTR_T + typedef void * ptr_t; +#endif /* _PTR_T */ + +#ifndef _SIGMASK_T +# define _SIGMASK_T + typedef int sigmask_t; +#endif /* _SIGMASK_T */ + +#ifndef _IOCTL_T +# define _IOCTL_T + typedef void * ioctl_t; /* Third arg of ioctl */ +#endif /* _IOCTL_T */ + +#endif /* _h_sh_types */ diff --git a/bin/tcsh/tc.alloc.c b/bin/tcsh/tc.alloc.c new file mode 100644 index 0000000..12c8008 --- /dev/null +++ b/bin/tcsh/tc.alloc.c @@ -0,0 +1,587 @@ +/* + * tc.alloc.c (Caltech) 2/21/82 + * Chris Kingsley, kingsley@cit-20. + * + * This is a very fast storage allocator. It allocates blocks of a small + * number of different sizes, and keeps free lists of each size. Blocks that + * don't exactly fit are passed up to the next larger size. In this + * implementation, the available sizes are 2^n-4 (or 2^n-12) bytes long. + * This is designed for use in a program that uses vast quantities of memory, + * but bombs when it runs out. + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#include "config.h" +#if !defined(lint) && !defined(pdp11) +static char *rcsid() + { return "$Id: tc.alloc.c,v 3.0.1 1996/04/04 21:49:28 sms Exp $"; } +#endif + + +#include "sh.h" + +char *memtop = NULL; /* PWP: top of current memory */ +char *membot = NULL; /* PWP: bottom of allocatable memory */ + +#ifndef SYSMALLOC + +#define RCHECK +#define DEBUG + + +#ifndef NULL +#define NULL 0 +#endif + +typedef unsigned char U_char; /* we don't really have signed chars */ +#ifdef pdp11 +typedef u_long U_int; +#else +typedef unsigned int U_int; +#endif +typedef unsigned short U_short; + + +/* + * The overhead on a block is at least 4 bytes. When free, this space + * contains a pointer to the next free block, and the bottom two bits must + * be zero. When in use, the first byte is set to MAGIC, and the second + * byte is the size index. The remaining bytes are for alignment. + * If range checking is enabled and the size of the block fits + * in two bytes, then the top two bytes hold the size of the requested block + * plus the range checking words, and the header word MINUS ONE. + */ + + +#define MEMALIGN(a) (((a) + ROUNDUP) & ~ROUNDUP) + +union overhead { + union overhead *ov_next; /* when free */ + struct { + U_char ovu_magic; /* magic number */ + U_char ovu_index; /* bucket # */ +#ifdef RCHECK + U_short ovu_size; /* actual block size */ + U_int ovu_rmagic; /* range magic number */ +#endif + } ovu; +#define ov_magic ovu.ovu_magic +#define ov_index ovu.ovu_index +#define ov_size ovu.ovu_size +#define ov_rmagic ovu.ovu_rmagic +}; + +#define MAGIC 0xfd /* magic # on accounting info */ +#define RMAGIC 0x55555555 /* magic # on range info */ +#ifdef RCHECK +#define RSLOP sizeof (U_int) +#else +#define RSLOP 0 +#endif + + +#ifdef SUNOS4 +/* + * SunOS localtime() overwrites the 9th byte on an 8 byte malloc().... + * So we align to 16 bytes... + */ +#define ROUNDUP 15 +#else +#define ROUNDUP 7 +#endif + +/* + * nextf[i] is the pointer to the next free block of size 2^(i+3). The + * smallest allocatable block is 8 bytes. The overhead information + * precedes the data area returned to the user. + */ +#define NBUCKETS 30 +static union overhead *nextf[NBUCKETS]; + +#ifdef notdef +extern char *sbrk(); + +#endif + +/* + * nmalloc[i] is the difference between the number of mallocs and frees + * for a given block size. + */ +static U_int nmalloc[NBUCKETS]; + +static int findbucket __P((union overhead *, int)); +static void morecore __P((int)); + + +#ifdef DEBUG +#define CHECK(a, str, p) \ + if (a) { \ + xprintf(str, p); \ + xprintf("memtop = %lx membot = %lx.\n", memtop, membot); \ + abort(); \ + } \ + else +#else +#define CHECK(a, str, p) \ + if (a) { \ + xprintf(str, p); \ + xprintf("memtop = %lx membot = %lx.\n", memtop, membot); \ + return; \ + } \ + else +#endif + +memalign_t +malloc(nbytes) + register size_t nbytes; +{ +#ifndef lint + register union overhead *p; + register int bucket = 0; + register unsigned shiftr; + + /* + * Convert amount of memory requested into closest block size stored in + * hash buckets which satisfies request. Account for space used per block + * for accounting. + */ + nbytes = MEMALIGN(MEMALIGN(sizeof(union overhead)) + nbytes + RSLOP); + shiftr = (nbytes - 1) >> 2; + + /* apart from this loop, this is O(1) */ + while (shiftr >>= 1) + bucket++; + /* + * If nothing in hash bucket right now, request more memory from the + * system. + */ + if (nextf[bucket] == NULL) + morecore(bucket); + if ((p = (union overhead *) nextf[bucket]) == NULL) { + child++; +#ifndef DEBUG + stderror(ERR_NOMEM); +#else + showall(); + xprintf("nbytes=%d: Out of memory\n", nbytes); + abort(); +#endif + /* fool lint */ + return ((memalign_t) 0); + } + /* remove from linked list */ + nextf[bucket] = nextf[bucket]->ov_next; + p->ov_magic = MAGIC; + p->ov_index = bucket; + nmalloc[bucket]++; +#ifdef RCHECK + /* + * Record allocated size of block and bound space with magic numbers. + */ + if (nbytes <= 0x10000) + p->ov_size = nbytes - 1; + p->ov_rmagic = RMAGIC; + *((U_int *) (((caddr_t) p) + nbytes - RSLOP)) = RMAGIC; +#endif + return ((memalign_t) (((caddr_t) p) + MEMALIGN(sizeof(union overhead)))); +#else + if (nbytes) + return ((memalign_t) 0); + else + return ((memalign_t) 0); +#endif /* !lint */ +} + +#ifndef lint +/* + * Allocate more memory to the indicated bucket. + */ +static void +morecore(bucket) + register bucket; +{ + register union overhead *op; + register int rnu; /* 2^rnu bytes will be requested */ + register int nblks; /* become nblks blocks of the desired size */ + register int siz; + + if (nextf[bucket]) + return; + /* + * Insure memory is allocated on a page boundary. Should make getpageize + * call? + */ + op = (union overhead *) sbrk(0); + memtop = (char *) op; + if (membot == NULL) + membot = memtop; + if ((int) op & 0x3ff) { + memtop = (char *) sbrk(1024 - ((int) op & 0x3ff)); + memtop += 1024 - ((int) op & 0x3ff); + } + + /* take 2k unless the block is bigger than that */ + rnu = (bucket <= 8) ? 11 : bucket + 3; + nblks = 1 << (rnu - (bucket + 3)); /* how many blocks to get */ + if (rnu < bucket) + rnu = bucket; + memtop = (char *) sbrk(1 << rnu); /* PWP */ + op = (union overhead *) memtop; + memtop += 1 << rnu; + /* no more room! */ + if ((int) op == -1) + return; + /* + * Round up to minimum allocation size boundary and deduct from block count + * to reflect. + */ + if (((U_int) op) & ROUNDUP) { + op = (union overhead *) (((U_int) op + (ROUNDUP + 1)) & ~ROUNDUP); + nblks--; + } + /* + * Add new memory allocated to that on free list for this hash bucket. + */ + nextf[bucket] = op; + siz = 1 << (bucket + 3); + while (--nblks > 0) { + op->ov_next = (union overhead *) (((caddr_t) op) + siz); + op = (union overhead *) (((caddr_t) op) + siz); + } +} + +#endif + +void +free(cp) + ptr_t cp; +{ +#ifndef lint + register int size; + register union overhead *op; + + if (cp == NULL) + return; + CHECK(!memtop || !membot, "free(%lx) called before any allocations.", cp); + CHECK(cp > (ptr_t) memtop, "free(%lx) above top of memory.", cp); + CHECK(cp < (ptr_t) membot, "free(%lx) above top of memory.", cp); + op = (union overhead *) (((caddr_t) cp) - MEMALIGN(sizeof(union overhead))); + CHECK(op->ov_magic != MAGIC, "free(%lx) bad block.", cp); + +#ifdef RCHECK + if (op->ov_index <= 13) + CHECK(*(U_int *) ((caddr_t) op + op->ov_size + 1 - RSLOP) != RMAGIC, + "free(%lx) bad range check.", cp); +#endif + CHECK(op->ov_index >= NBUCKETS, "free(%lx) bad block index.", cp); + size = op->ov_index; + op->ov_next = nextf[size]; + nextf[size] = op; + + nmalloc[size]--; + +#else + if (cp == NULL) + return; +#endif +} + +memalign_t +calloc(i, j) + size_t i, j; +{ +#ifndef lint + register char *cp, *scp; + + i *= j; + scp = cp = (char *) xmalloc((size_t) i); + if (i != 0) + do + *cp++ = 0; + while (--i); + + return (scp); +#else + if (i && j) + return ((memalign_t) 0); + else + return ((memalign_t) 0); +#endif +} + +#ifndef lint +/* PWP: a bcopy that does overlapping extents correctly */ +static void +mybcopy(from, to, len) + char *from, *to; + register unsigned len; +{ + register char *sp, *dp; + + if (from == to) + return; + if (from < to) { + /* len is unsigned, len > 0 is equivalent to len != 0 */ + for (sp = &from[len - 1], dp = &to[len - 1]; len != 0; len--, sp--, dp--) + *dp = *sp; + } + else { + /* len is unsigned, len > 0 is equivalent to len != 0 */ + for (sp = from, dp = to; len != 0; len--, sp++, dp++) + *dp = *sp; + } +} + +#endif + +/* + * When a program attempts "storage compaction" as mentioned in the + * old malloc man page, it realloc's an already freed block. Usually + * this is the last block it freed; occasionally it might be farther + * back. We have to search all the free lists for the block in order + * to determine its bucket: 1st we make one pass thru the lists + * checking only the first block in each; if that fails we search + * ``realloc_srchlen'' blocks in each list for a match (the variable + * is extern so the caller can modify it). If that fails we just copy + * however many bytes was given to realloc() and hope it's not huge. + */ +#ifndef lint +int realloc_srchlen = 4; /* 4 should be plenty, -1 =>'s whole list */ + +#endif /* lint */ + +memalign_t +realloc(cp, nbytes) + ptr_t cp; + size_t nbytes; +{ +#ifndef lint + register U_int onb; + union overhead *op; + char *res; + register int i; + int was_alloced = 0; + + if (cp == NULL) + return (malloc(nbytes)); + op = (union overhead *) (((caddr_t) cp) - MEMALIGN(sizeof(union overhead))); + if (op->ov_magic == MAGIC) { + was_alloced++; + i = op->ov_index; + } + else + /* + * Already free, doing "compaction". + * + * Search for the old block of memory on the free list. First, check the + * most common case (last element free'd), then (this failing) the last + * ``realloc_srchlen'' items free'd. If all lookups fail, then assume + * the size of the memory block being realloc'd is the smallest + * possible. + */ + if ((i = findbucket(op, 1)) < 0 && + (i = findbucket(op, realloc_srchlen)) < 0) + i = 0; + + onb = MEMALIGN(nbytes + MEMALIGN(sizeof(union overhead)) + RSLOP); + + /* avoid the copy if same size block */ + if (was_alloced && (onb < (1 << (i + 3))) && (onb >= (1 << (i + 2)))) + return ((memalign_t) cp); + if ((res = malloc(nbytes)) == NULL) + return (NULL); + if (cp != res) /* common optimization */ + mybcopy(cp, res, nbytes); + if (was_alloced) + free(cp); + return (res); +#else + if (cp && nbytes) + return ((memalign_t) 0); + else + return ((memalign_t) 0); +#endif /* !lint */ +} + + + +#ifndef lint +/* + * Search ``srchlen'' elements of each free list for a block whose + * header starts at ``freep''. If srchlen is -1 search the whole list. + * Return bucket number, or -1 if not found. + */ +static int +findbucket(freep, srchlen) + union overhead *freep; + int srchlen; +{ + register union overhead *p; + register int i, j; + + for (i = 0; i < NBUCKETS; i++) { + j = 0; + for (p = nextf[i]; p && j != srchlen; p = p->ov_next) { + if (p == freep) + return (i); + j++; + } + } + return (-1); +} + +#endif + + +#else /* SYSMALLOC */ + +/** + ** ``Protected versions'' of malloc, realloc, calloc, and free + ** + ** On many systems: + ** + ** 1. malloc(0) is bad + ** 2. free(0) is bad + ** 3. realloc(0, n) is bad + ** 4. realloc(n, 0) is bad + ** + ** Also we call our error routine if we run out of memory. + **/ +memalign_t +Malloc(n) + size_t n; +{ + ptr_t ptr; + + n = n ? n : 1; + + if ((ptr = malloc(n)) == (ptr_t) 0) { + child++; + stderror(ERR_NOMEM); + } + return ((memalign_t) ptr); +} + +memalign_t +Realloc(p, n) + ptr_t p; + register size_t n; +{ + ptr_t ptr; + + n = n ? n : 1; + if ((ptr = (p ? realloc(p, n) : malloc(n))) == (ptr_t) 0) { + child++; + stderror(ERR_NOMEM); + } + return ((memalign_t) ptr); +} + +memalign_t +Calloc(s, n) + register size_t s, n; +{ + register char *sptr; + ptr_t ptr; + + n *= s; + n = n ? n : 1; + if ((ptr = malloc(n)) == (ptr_t) 0) { + child++; + stderror(ERR_NOMEM); + } + + sptr = (char *) ptr; + if (n != 0) + do + *sptr++ = 0; + while (--n); + + return ((memalign_t) ptr); +} + +void +Free(p) + ptr_t p; +{ + if (p) { + free(p); + /* + * jpn: free() doesn't NULL pointers on all systems + * but tcsh seems to expect it: see sh.c where comment that + * xfree doesn't care if called twice on same pointers, + * and fact that Free here tests pointer before freeing it. + */ + p = NULL; + } +} + +#endif /* SYSMALLOC */ + +#ifndef pdp11 +/* + * mstats - print out statistics about malloc + * + * Prints two lines of numbers, one showing the length of the free list + * for each size category, the second showing the number of mallocs - + * frees for each size category. + */ +void +showall() +{ +#ifndef SYSMALLOC + register int i, j; + register union overhead *p; + int totfree = 0, totused = 0; + + xprintf("tcsh current memory allocation:\nfree:\t"); + for (i = 0; i < NBUCKETS; i++) { + for (j = 0, p = nextf[i]; p; p = p->ov_next, j++); + xprintf(" %4d", j); + totfree += j * (1 << (i + 3)); + } + xprintf("\nused:\t"); + for (i = 0; i < NBUCKETS; i++) { + xprintf(" %4d", nmalloc[i]); + totused += nmalloc[i] * (1 << (i + 3)); + } + xprintf("\n\tTotal in use: %d, total free: %d\n", + totused, totfree); + xprintf("\tAllocated memory from 0x%lx to 0x%lx. Real top at 0x%lx\n", + membot, memtop, (char *) sbrk(0)); +#else + xprintf("Allocated memory from 0x%lx to 0x%lx (%ld).\n", + (long)membot, (long)(memtop = (char *) sbrk(0)),(long)(memtop - membot)); +#endif /* SYSMALLOC */ +} +#endif /* pdp11 */ diff --git a/bin/tcsh/tc.bind.c b/bin/tcsh/tc.bind.c new file mode 100644 index 0000000..7b81e28 --- /dev/null +++ b/bin/tcsh/tc.bind.c @@ -0,0 +1,950 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/tc.bind.c,v 3.0 1991/07/04 21:49:28 christos Exp $ */ +/* + * tc.bind.c: Key binding functions + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#include "config.h" +#if !defined(lint) && !defined(pdp11) +static char *rcsid() + { return "$Id: tc.bind.c,v 3.0 1991/07/04 21:49:28 christos Exp $"; } +#endif + +#include "sh.h" +#include "ed.h" +#include "ed.defns.h" + +static int str7cmp __P((char *, char *)); +static int tocontrol __P((int)); +static char *u_p_key __P((int)); +static KEYCMD getkeycmd __P((Char **)); +static int parsekey __P((Char **)); +static void prntky __P((KEYCMD *, Char *)); +static KEYCMD parsecmd __P((Char *)); +static Char *parsestring __P((Char *, Char *)); +static void print_all_keys __P((void)); +static void prntkys __P((KEYCMD *, int, int)); +static void bindkey_usage __P((void)); +static void list_functions __P((void)); +static void pkeys __P((int, int)); + +extern int MapsAreInited; + +/* like strcmp, but compairisons are striped to 7 bits + (due to shell stupidness) */ +static int +str7cmp(a, b) + register char *a, *b; +{ + while ((*a & TRIM) == (*b++ & TRIM)) + if (!*a++) + return (0); + b--; + return ((*a & TRIM) - (*b & TRIM)); +} +static int +tocontrol(c) + int c; +{ + c &= CHAR; + if (Islower(c)) + c = Toupper(c); + else if (c == ' ') + c = '@'; + if (c == '?') + c = 0177; + else + c &= 037; + return (c); +} + +static char * +u_p_key(c) /* 'c' -> "c", '^C' -> "^" + "C" */ + register int c; +{ + register char *cp; + static char tmp[10]; + + cp = tmp; + + if (c & 0400) { + *cp++ = 'A'; + *cp++ = '-'; + c &= 0377; + } + if ((c & META) && !(Isprint(c) || Iscntrl(c) && Isprint(c | 0100))) { + *cp++ = 'M'; + *cp++ = '-'; + c &= ASCII; + } + if (Isprint(c)) { + *cp++ = c; + *cp = '\0'; + return (tmp); + } + else if (c == ' ') { + (void) strcpy(cp, "Spc"); + return (tmp); + } + else if (c == '\n') { + (void) strcpy(cp, "Lfd"); + return (tmp); + } + else if (c == '\r') { + (void) strcpy(cp, "Ret"); + return (tmp); + } + else if (c == '\t') { + (void) strcpy(cp, "Tab"); + return (tmp); + } + else if (c == '\033') { + (void) strcpy(cp, "Esc"); + return (tmp); + } + else if (c == '\177') { + (void) strcpy(cp, "Del"); + return (tmp); + } + else { + *cp++ = '^'; + if (c == '\177') { + *cp++ = '?'; + } + else { + *cp++ = c | 0100; + } + *cp = '\0'; + return (tmp); + } +} + +static KEYCMD +getkeycmd(sp) + Char **sp; +{ + register Char *s = *sp; + register char c; + register KEYCMD keycmd = F_UNASSIGNED; + KEYCMD *map; + int meta = 0; + Char *ret_sp = s; + + map = CcKeyMap; + + while (*s) { + if (*s == '^' && s[1]) { + s++; + c = tocontrol(*s++); + } + else + c = *s++; + + if (*s == '\0') + break; + + switch (map[c | meta]) { + case F_METANEXT: + meta = META; + keycmd = F_METANEXT; + ret_sp = s; + break; + + case F_XKEY: + keycmd = F_XKEY; + ret_sp = s; + /* FALLTHROUGH */ + + default: + *sp = ret_sp; + return (keycmd); + + } + } + *sp = ret_sp; + return (keycmd); +} + +static int +parsekey(sp) + Char **sp; /* Return position of first u_p_d character + * for return value -2 (xkeynext) */ +{ + register int c, meta = 0, control = 0, ctrlx = 0; + Char *s = *sp; + KEYCMD keycmd; + + if (s == NULL) { + xprintf("bad key specification -- null string\n"); + return -1; + } + if (*s == 0) { + xprintf("bad key specification -- empty string\n"); + return -1; + } + + (void) strip(s); /* trim to 7 bits. */ + + if (s[1] == 0) /* single char */ + return (s[0] & 0377); + + if ((s[0] == 'F' || s[0] == 'f') && s[1] == '-') { + if (s[2] == 0) { + xprintf("Bad function-key specification. Null key not allowed\n"); + return (-1); + } + *sp = s + 2; + return (-2); + } + + if (s[0] == '0' && s[1] == 'x') { /* if 0xn, then assume number */ + c = 0; + for (s += 2; *s; s++) { /* convert to hex; skip the first 0 */ + c *= 16; + if (!Isxdigit(*s)) { + xprintf("bad key specification -- malformed hex number\n"); + return -1; /* error */ + } + if (Isdigit(*s)) + c += *s - '0'; + else if (*s >= 'a' && *s <= 'f') + c += *s - 'a' + 0xA; + else if (*s >= 'F' && *s <= 'F') + c += *s - 'A' + 0xA; + } + } + else if (s[0] == '0' && Isdigit(s[1])) { /* if 0n, then assume number */ + c = 0; + for (s++; *s; s++) { /* convert to octal; skip the first 0 */ + if (!Isdigit(*s) || *s == '8' || *s == '9') { + xprintf("bad key specification -- malformed octal number\n"); + return -1; /* error */ + } + c = (c * 8) + *s - '0'; + } + } + else if (Isdigit(s[0]) && Isdigit(s[1])) { /* decimal number */ + c = 0; + for (; *s; s++) { /* convert to octal; skip the first 0 */ + if (!Isdigit(*s)) { + xprintf("bad key specification -- malformed decimal number\n"); + return -1; /* error */ + } + c = (c * 10) + *s - '0'; + } + } + else { + keycmd = getkeycmd(&s); + + if ((s[0] == 'X' || s[0] == 'x') && s[1] == '-') { /* X- */ + ctrlx++; + s += 2; + keycmd = getkeycmd(&s); + } + if ((*s == 'm' || *s == 'M') && s[1] == '-') { /* meta */ + meta++; + s += 2; + keycmd = getkeycmd(&s); + } + else if (keycmd == F_METANEXT && *s) { /* meta */ + meta++; + keycmd = getkeycmd(&s); + } + if (*s == '^' && s[1]) { + control++; + s++; + keycmd = getkeycmd(&s); + } + else if ((*s == 'c' || *s == 'C') && s[1] == '-') { /* control */ + control++; + s += 2; + keycmd = getkeycmd(&s); + } + + if (keycmd == F_XKEY) { + if (*s == 0) { + xprintf("Bad function-key specification.\n"); + xprintf("Null key not allowed\n"); + return (-1); + } + *sp = s; + return (-2); + } + + if (s[1] != 0) { /* if symbolic name */ + char *ts; + + ts = short2str(s); + if (!str7cmp(ts, "space") || !str7cmp(ts, "Spc")) + c = ' '; + else if (!str7cmp(ts, "return") || !str7cmp(ts, "Ret")) + c = '\r'; + else if (!str7cmp(ts, "newline") || !str7cmp(ts, "Lfd")) + c = '\n'; + else if (!str7cmp(ts, "linefeed")) + c = '\n'; + else if (!str7cmp(ts, "tab")) + c = '\t'; + else if (!str7cmp(ts, "escape") || !str7cmp(ts, "Esc")) + c = '\033'; + else if (!str7cmp(ts, "backspace")) + c = '\b'; + else if (!str7cmp(ts, "delete")) + c = '\177'; + else { + xprintf("bad key specification -- unknown name \"%s\"\n", s); + return -1; /* error */ + } + } + else + c = *s; /* just a single char */ + + if (control) + c = tocontrol(c); + if (meta) + c |= META; + if (ctrlx) + c |= 0400; + } + return (c & 0777); +} + + +void +dobindkey(v) + Char **v; +{ + KEYCMD *map; + int string, no, remove; + Char *par; + Char p; + Char inbuf[200]; + Char outbuf[200]; + Char *in; + Char *out; + KEYCMD cmd; + + if (!MapsAreInited) + ed_IMaps(); + + map = CcKeyMap; + string = 0; + remove = 0; + for (no = 1, par = v[no]; + par != NULL && (*par++ & CHAR) == '-'; no++, par = v[no]) { + if ((p = (*par & CHAR)) == '-') { + break; + } + else if (p == 'a') { + map = CcAltMap; + } + else if (p == 's') { + string = 1; + } + else if (p == 'r') { + remove = 1; + } + else if (p == 'v') { + ed_IVIMaps(); + return; + } + else if (p == 'e') { + ed_IEmacsMaps(); + return; + } + else if (p == 'd') { +#ifdef VIDEFAULT + ed_IVIMaps(); +#else + ed_IEmacsMaps(); +#endif + return; + } + else if (p == 'l') { + list_functions(); + return; + } + else { + bindkey_usage(); + return; + } + } + + if (!v[no]) { + print_all_keys(); + return; + } + + if ((in = parsestring(v[no++], inbuf)) == NULL) + return; + if (remove) { + if (in[1]) { + (void) DeleteXkey(in); + } + else if (map[(unsigned char) *in] == F_XKEY) { + (void) DeleteXkey(in); + map[(unsigned char) *in] = F_UNASSIGNED; + } + else { + map[(unsigned char) *in] = F_UNASSIGNED; + } + return; + } + if (!v[no]) { + prntky(map, in); + return; + } + if (v[no + 1]) { + bindkey_usage(); + return; + } + if (string) { + if ((out = parsestring(v[no], outbuf)) == NULL) + return; + AddXkey(in, out); + map[(unsigned char) *in] = F_XKEY; + } + else { + if ((cmd = parsecmd(v[no])) == 0) + return; + if (in[1]) { + AddXKeyCmd(in, (Char) cmd); + map[(unsigned char) *in] = F_XKEY; + } + else { + (void) ClearXkey(map, in); + map[(unsigned char) *in] = cmd; + } + } +} + +static void +prntky(map, in) + KEYCMD *map; + Char *in; +{ + unsigned char outbuf[100]; + register struct KeyFuncs *fp; + + if (in[0] == 0 || in[1] == 0) { + (void) u_p_string(in, outbuf); + for (fp = FuncNames; fp->name; fp++) { + if (fp->func == map[(unsigned char) *in]) { + xprintf("%s\t->\t%s\n", outbuf, fp->name); + } + } + } + else { + (void) PrintXkey(in); + } +} + +static KEYCMD +parsecmd(str) + Char *str; +{ + register struct KeyFuncs *fp; + + for (fp = FuncNames; fp->name; fp++) { + if (str7cmp(short2str(str), fp->name) == 0) { + return fp->func; + } + } + xprintf("Bad command name: %s\n", short2str(str)); + return 0; +} + +int +parseescape(ptr) + Char **ptr; +{ + Char *p, c; + + p = *ptr; + + if ((p[1] & CHAR) == 0) { + xprintf("Something must follow: %c\\n", *p); + return 0; + } + if ((*p & CHAR) == '\\') { + p++; + switch (*p & CHAR) { + case 'a': + c = '\007'; /* Bell */ + break; + case 'b': + c = '\010'; /* Backspace */ + break; + case 't': + c = '\011'; /* Horizontal Tab */ + break; + case 'n': + c = '\012'; /* New Line */ + break; + case 'v': + c = '\013'; /* Vertical Tab */ + break; + case 'f': + c = '\014'; /* Form Feed */ + break; + case 'r': + c = '\015'; /* Carriage Return */ + break; + case 'e': + c = '\033'; /* Escape */ + break; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + { + register int cnt, val, ch; + + for (cnt = 0, val = 0; cnt < 3; cnt++) { + ch = *p++ & CHAR; + if (ch < '0' || ch > '7') { + p--; + break; + } + val = (val << 3) | (ch - '0'); + } + if ((val & 0xffffff00) != 0) { + xprintf("Octal constant does not fit in a char.\n"); + return 0; + } + c = val; + --p; + } + break; + default: + c = *p; + break; + } + } + else if ((*p & CHAR) == '^') { + p++; + c = (*p == '?') ? '\177' : ((*p & CHAR) & 0237); + } + else + c = *p; + *ptr = p; + return (c); +} + +static Char * +parsestring(str, buf) + Char *str; + Char *buf; +{ + Char *b; + Char *p; + + b = buf; + if (*str == 0) { + xprintf("Null string specification\n"); + return 0; + } + + for (p = str; *p != 0; p++) { + if ((*p & CHAR) == '\\' || (*p & CHAR) == '^') { + if ((*b++ = parseescape(&p)) == 0) + return 0; + } + else { + *b++ = *p & CHAR; + } + } + *b = 0; + return buf; +} + +unsigned char * +u_p_string(str, buf) + Char *str; + unsigned char *buf; +{ + unsigned char *b; + Char *p; + + b = buf; + *b++ = '"'; + if (*str == 0) { + *b++ = '^'; + *b++ = '@'; + *b++ = '"'; + *b++ = 0; + return buf; + } + + for (p = str; *p != 0; p++) { + if (Iscntrl(*p)) { + *b++ = '^'; + if (*p == '\177') + *b++ = '?'; + else + *b++ = *p | 0100; + } + else if (*p == '^' || *p == '\\') { + *b++ = '\\'; + *b++ = *p; + } + else if (*p == ' ' || (Isprint(*p) && !Isspace(*p))) { + *b++ = *p; + } + else { + *b++ = '\\'; + *b++ = ((*p >> 6) & 7) + '0'; + *b++ = ((*p >> 3) & 7) + '0'; + *b++ = (*p & 7) + '0'; + } + } + *b++ = '"'; + *b++ = 0; + return buf; /* should check for overflow */ +} + +static void +print_all_keys() +{ + int prev, i; + + xprintf("Standard key bindings\n"); + prev = 0; + for (i = 0; i < 256; i++) { + if (CcKeyMap[prev] == CcKeyMap[i]) + continue; + prntkys(CcKeyMap, prev, i - 1); + prev = i; + } + prntkys(CcKeyMap, prev, i - 1); + + xprintf("Alternative key bindings\n"); + prev = 0; + for (i = 0; i < 256; i++) { + if (CcAltMap[prev] == CcAltMap[i]) + continue; + prntkys(CcAltMap, prev, i - 1); + prev = i; + } + prntkys(CcAltMap, prev, i - 1); + xprintf("Multi-character bindings\n"); + (void) PrintXkey(STRNULL); /* print all Xkey bindings */ +} + +static void +prntkys(map, first, last) + KEYCMD *map; + int first, last; +{ + register struct KeyFuncs *fp; + Char firstbuf[2], lastbuf[2]; + unsigned char unparsbuf[10], extrabuf[10]; + + firstbuf[0] = first; + firstbuf[1] = 0; + lastbuf[0] = last; + lastbuf[1] = 0; + if (map[first] == F_UNASSIGNED) { + if (first == last) + xprintf("%-15s-> is undefined\n", + u_p_string(firstbuf, unparsbuf)); + return; + } + + for (fp = FuncNames; fp->name; fp++) { + if (fp->func == map[first]) { + if (first == last) { + xprintf("%-15s-> %s\n", + u_p_string(firstbuf, unparsbuf), fp->name); + } + else { + xprintf("%-4s to %-7s-> %s\n", + u_p_string(firstbuf, unparsbuf), + u_p_string(lastbuf, extrabuf), fp->name); + } + return; + } + } + if (map == CcKeyMap) { + xprintf("BUG!!! %s isn't bound to anything.\n", + u_p_string(firstbuf, unparsbuf)); + xprintf("CcKeyMap[%d] == %d\n", first, CcKeyMap[first]); + } + else { + xprintf("BUG!!! %s isn't bound to anything.\n", + u_p_string(firstbuf, unparsbuf)); + xprintf("CcAltMap[%d] == %d\n", first, CcAltMap[first]); + } +} + +static void +bindkey_usage() +{ + xprintf( + "Usage: bindkey [options] [--] [in-string [out-string | command]]\n"); + xprintf(" -a bind key in alternative key binding\n"); + xprintf(" -s bind an out-string instad of a command\n"); + xprintf(" -v initialized maps to default vi bindings\n"); + xprintf(" -e initialized maps to default emacs bindings\n"); + xprintf(" -d initialized maps to default bindings\n"); +#ifdef LONGFUNCS + xprintf(" -l list available functions with descriptions\n"); +#else + xprintf(" -l list available functions\n"); +#endif /* LONGFUNCS */ + xprintf(" -r remove the binding of in-string\n"); + xprintf( + "\nIn no out-string or command is given, the binding for in-string\n"); + xprintf("is printed or all bindings if in-strings is not given.\n"); +} + +static void +list_functions() +{ + register struct KeyFuncs *fp; + + for (fp = FuncNames; fp->name; fp++) { +#ifdef LONGFUNCS + xprintf("%s\n %s\n", fp->name, fp->description); +#else + xprintf("%s\n", fp->name); +#endif + } +} + +void +dobind(v) + register Char **v; +{ + register int c; + register struct KeyFuncs *fp; + register int i, prev; + Char *p, *l; + Char buf[1000]; + + /* + * Assume at this point that i'm given 2 or 3 args - 'bind', the f-name, + * and the key; or 'bind' key to print the func for that key. + */ + + if (!MapsAreInited) + ed_IMaps(); + + if (v[1] && v[2] && v[3]) { + xprintf( + "usage: bind [KEY | COMMAND KEY | \"emacs\" | \"vi\" | \"-a\"]\n"); + return; + } + + if (v[1] && v[2]) { /* if bind FUNCTION KEY */ + for (fp = FuncNames; fp->name; fp++) { + if (str7cmp(short2str(v[1]), fp->name) == 0) { + Char *s = v[2]; + + if ((c = parsekey(&s)) == -1) + return; + if (c == -2) { /* extented key */ + for (i = 0; i < 256; i++) { + if (i != 033 && (CcKeyMap[i] == F_XKEY || + CcAltMap[i] == F_XKEY)) { + p = buf; + if (i > 0177) { + *p++ = 033; + *p++ = i & ASCII; + } + else { + *p++ = i; + } + for (l = s; *l != 0; l++) { + *p++ = *l; + } + *p = 0; + AddXKeyCmd(buf, fp->func); + } + } + return; + } + if (c & 0400) { + if (VImode) { + CcAltMap[c & 0377] = fp->func; + /* bind the vi cmd mode key */ + if (c & META) { + buf[0] = 033; + buf[1] = c & ASCII; + buf[2] = 0; + AddXKeyCmd(buf, fp->func); + } + } + else { + buf[0] = 030; /* ^X */ + buf[1] = c & 0377; + buf[2] = 0; + AddXKeyCmd(buf, fp->func); + CcKeyMap[030] = F_XKEY; + } + } + else { + CcKeyMap[c] = fp->func; /* bind the key */ + if (c & META) { + buf[0] = 033; + buf[1] = c & ASCII; + buf[2] = 0; + AddXKeyCmd(buf, fp->func); + } + } + return; + } + } + stderror(ERR_NAME | ERR_STRING, "Invalid function"); + } + else if (v[1]) { + char *cv = short2str(v[1]); + + if (str7cmp(cv, "list") == 0) { + for (fp = FuncNames; fp->name; fp++) { + xprintf("%s\n", fp->name); + } + return; + } + if ((str7cmp(cv, "emacs") == 0) || +#ifndef VIDEFAULT + (str7cmp(cv, "defaults") == 0) || + (str7cmp(cv, "default") == 0) || +#endif + (str7cmp(cv, "mg") == 0) || + (str7cmp(cv, "gnumacs") == 0)) { + /* reset keys to default */ + ed_IEmacsMaps(); +#ifdef VIDEFAULT + } + else if ((str7cmp(cv, "vi") == 0) + || (str7cmp(cv, "default") == 0) + || (str7cmp(cv, "defaults") == 0)) { +#else + } + else if (str7cmp(cv, "vi") == 0) { +#endif + ed_IVIMaps(); + } + else { /* want to know what this key does */ + Char *s = v[1]; + + if ((c = parsekey(&s)) == -1) + return; + if (c == -2) { /* extended key */ + (void) PrintXkey(s); + return; + } + pkeys(c, c); /* must be regular key */ + } + } + else { /* list all the bindings */ + prev = 0; + for (i = 0; i < 256; i++) { + if (CcKeyMap[prev] == CcKeyMap[i]) + continue; + pkeys(prev, i - 1); + prev = i; + } + pkeys(prev, i - 1); + prev = 0; + for (i = 256; i < 512; i++) { + if (CcAltMap[prev & 0377] == CcAltMap[i & 0377]) + continue; + pkeys(prev, i - 1); + prev = i; + } + pkeys(prev, i - 1); + (void) PrintXkey(STRNULL); /* print all Xkey bindings */ + } + return; +} + +static void +pkeys(first, last) + register int first, last; +{ + register struct KeyFuncs *fp; + register KEYCMD *map; + char buf[8]; + + if (last & 0400) { + map = CcAltMap; + first &= 0377; + last &= 0377; + } + else { + map = CcKeyMap; + } + if (map[first] == F_UNASSIGNED) { + if (first == last) +#ifdef _SEQUENT_ + xprintf(" %s\t\tis undefined\n", + u_p_key(map == CcAltMap ? first | 0400 : first)); +#else /* _SEQUENT_ */ + xprintf(" %s\t\tis undefined\n", u_p_key(first)); +#endif /* _SEQUENT_ */ + return; + } + + for (fp = FuncNames; fp->name; fp++) { + if (fp->func == map[first]) { + if (first == last) { + xprintf(" %s\t\t%s\n", + u_p_key((first & 0377) | (map == CcAltMap ? 0400 : 0)), + fp->name); + } + else { + (void) strcpy(buf, u_p_key((first & 0377) | + (map == CcAltMap ? 0400 : 0))); + xprintf(" %s..%s\t\t%s\n", buf, + u_p_key((last & 0377) | (map == CcAltMap ? 0400 : 0)), + fp->name); + } + return; + } + } + if (map == CcKeyMap) { + xprintf("BUG!!! %s isn't bound to anything.\n", u_p_key(first)); + xprintf("CcKeyMap[%d] == %d\n", first, CcKeyMap[first]); + } + else { + xprintf("BUG!!! %s isn't bound to anything.\n", + u_p_key(first & 0400)); + xprintf("CcAltMap[%d] == %d\n", first, CcAltMap[first]); + } +} diff --git a/bin/tcsh/tc.const.c b/bin/tcsh/tc.const.c new file mode 100644 index 0000000..0e9b277 --- /dev/null +++ b/bin/tcsh/tc.const.c @@ -0,0 +1,257 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/tc.const.c,v 3.0 1991/07/04 21:49:28 christos Exp $ */ +/* + * sh.const.c: String constants for tcsh. + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#include "config.h" +#if !defined(lint) && !defined(pdp11) +static char *rcsid() + { return "$Id: tc.const.c,v 3.0 1991/07/04 21:49:28 christos Exp $"; } +#endif +#include "sh.h" + +Char STRlogout[] = { 'l', 'o', 'g', 'o', 'u', 't', '\0' }; +Char STRa_logout[] = { 'a', 'u', 't', 'o', 'l', 'o', 'g', 'o', 'u', 't', + '\0' }; +Char STRdflt_auto_logout[] = { '6', '0', '\0' }; +Char STRa_matic[] = { 'a', 'u', 't', 'o', 'm', 'a', 't', 'i', 'c', '\0' }; +Char STRaout[] = { 'a', '.', 'o', 'u', 't', '\0' }; +Char STRtty[] = { 't', 't', 'y', '\0' }; +Char STRany[] = { 'a', 'n', 'y', '\0' }; +Char STRstatus[] = { 's', 't', 'a', 't', 'u', 's', '\0' }; +Char STR0[] = { '0', '\0' }; +Char STR1[] = { '1', '\0' }; +Char STRNULL[] = { '\0' }; +Char STRtcsh[] = { 't', 'c', 's', 'h', '\0' }; +Char STRhome[] = { 'h', 'o', 'm', 'e', '\0' }; +Char STRuser[] = { 'u', 's', 'e', 'r', '\0' }; +Char STRterm[] = { 't', 'e', 'r', 'm', '\0' }; +Char STRversion[] = { 'v', 'e', 'r', 's', 'i', 'o', 'n', '\0' }; +Char STRuid[] = { 'u', 'i', 'd', '\0' }; +Char STRgid[] = { 'g', 'i', 'd', '\0' }; +Char STRHST[] = { 'H', 'O', 'S', 'T', '\0' }; +Char STRHSTTYPE[] = { 'H', 'O', 'S', 'T', 'T', 'Y', 'P', 'E', '\0' }; +Char STRedit[] = { 'e', 'd', 'i', 't', '\0' }; +Char STRaddsuffix[] = { 'a', 'd', 'd', 's', 'u', 'f', 'f', 'i', 'x', '\0' }; +Char STRshell[] = { 's', 'h', 'e', 'l', 'l', '\0' }; +Char STRtmpsh[] = { '/', 't', 'm', 'p', '/', 's', 'h', '\0' }; +Char STRverbose[] = { 'v', 'e', 'r', 'b', 'o', 's', 'e', '\0' }; +Char STRecho[] = { 'e', 'c', 'h', 'o', '\0' }; +Char STRpath[] = { 'p', 'a', 't', 'h', '\0' }; +Char STRprompt[] = { 'p', 'r', 'o', 'm', 'p', 't', '\0' }; +Char STRp_2[] = { 'p', 'r', 'o', 'm', 'p', 't', '2', '\0' }; +Char STRp_3[] = { 'p', 'r', 'o', 'm', 'p', 't', '3', '\0' }; +Char STRcwd[] = { 'c', 'w', 'd', '\0' }; +Char STRstar[] = { '*', '\0' }; +Char STRdot[] = { '.', '\0' }; +Char STRhsto[] = { 'h', 'i', 's', 't', 'o', 'r', 'y', '\0' }; +Char STRsource[] = { 's', 'o', 'u', 'r', 'c', 'e', '\0' }; +Char STRmh[] = { '-', 'h', '\0' }; +Char STRhstf[] = { '~', '/', '.', 'h', 'i', 's', 't', 'o', 'r', + 'y', '\0' }; + +#ifdef CSHDIRS +Char STRdirfile[] = { '~', '/', '.', 'c', 's', 'h', 'd', 'i', 'r', + 's', '\0' }; +Char STRs_dirs[] = { '/', '.', 'c', 's', 'h', 'd', 'i', 'r', 's', '\0' }; +Char STRsvdirs[] = { 's', 'a', 'v', 'e', 'd', 'i', 'r', 's', '\0' }; +#endif + +Char STRargv[] = { 'a', 'r', 'g', 'v', '\0' }; +Char STRsvhist[] = { 's', 'a', 'v', 'e', 'h', 'i', 's', 't', '\0' }; +Char STRs_hist[] = { '/', '.', 'h', 'i', 's', 't', 'o', 'r', 'y', '\0' }; +Char STRnormal[] = { 'n', 'o', 'r', 'm', 'a', 'l', '\0' }; +Char STRs_logout[] = { '/', '.', 'l', 'o', 'g', 'o', 'u', 't', '\0' }; +Char STRjobs[] = { 'j', 'o', 'b', 's', '\0' }; +Char STRsymhash[] = { '#', ' ', '\0' }; +Char STRsymarrow[] = { '>', ' ', '\0' }; +Char STRmquestion[] = { '%', 'R', '?' | QUOTE, ' ', '\0' }; +Char STRCORRECT[] = { 'C', 'O', 'R', 'R', 'E', 'C', 'T', '>', '%', 'R', + ' ', '(', 'y', '|', 'n', ')', '?' | QUOTE, ' ', + '\0' }; +Char STRunalias[] = { 'u', 'n', 'a', 'l', 'i', 'a', 's', '\0' }; +Char STRalias[] = { 'a', 'l', 'i', 'a', 's', '\0' }; +Char STRprecmd[] = { 'p', 'r', 'e', 'c', 'm', 'd', '\0' }; +Char STRcwdcmd[] = { 'c', 'w', 'd', 'c', 'm', 'd', '\0' }; +Char STRperiodic[] = { 'p', 'e', 'r', 'i', 'o', 'd', 'i', 'c', '\0' }; +Char STRtperiod[] = { 't', 'p', 'e', 'r', 'i', 'o', 'd', '\0' }; +Char STRml[] = { '-', 'l', '\0' }; +Char STRslash[] = { '/', '\0' }; +Char STRdt_l[] = { '.', '/', '\0' }; +Char STRdotdotsl[] = { '.', '.', '/', '\0' }; +Char STRcdpath[] = { 'c', 'd', 'p', 'a', 't', 'h', '\0' }; +Char STRputohome[] = { 'p', 'u', 's', 'h', 'd', 't', 'o', 'h', 'o', 'm', + 'e', '\0' }; +Char STRpusilent[] = { 'p', 'u', 's', 'h', 'd', 's', 'i', 'l', 'e', 'n', + 't', '\0' }; +Char STRdextract[] = { 'd', 'e', 'x', 't', 'r', 'a', 'c', 't', '\0' }; +Char STRig__symlinks[] = { 'i', 'g', 'n', 'o', 'r', 'e', '_', 's', 'y', 'm', + 'l', 'i', 'n', 'k', 's', '\0' }; +Char STRchase_symlinks[] = { 'c', 'h', 'a', 's', 'e', '_', 's', 'y', 'm', 'l', + 'i', 'n', 'k', 's', '\0' }; +Char STRPWD[] = { 'P', 'W', 'D', '\0' }; +Char STRor2[] = { '|', '|', '\0' }; +Char STRand2[] = { '&', '&', '\0' }; +Char STRor[] = { '|', '\0' }; +Char STRcaret[] = { '^', '\0' }; +Char STRand[] = { '&', '\0' }; +Char STRequal[] = { '=', '\0' }; +Char STRbang[] = { '!', '\0' }; +Char STRtilde[] = { '~', '\0' }; +Char STRLparen[] = { '(', '\0' }; +Char STRLbrace[] = { '{', '\0' }; +Char STRfkcom[] = { '{', ' ', '.', '.', '.', ' ', '}', '\0' }; +Char STRRbrace[] = { '}', '\0' }; +Char STRPATH[] = { 'P', 'A', 'T', 'H', '\0' }; +Char STRdefault[] = { 'd', 'e', 'f', 'a', 'u', 'l', 't', '\0' }; +Char STRmn[] = { '-', 'n', '\0' }; +Char STRminus[] = { '-', '\0' }; +Char STRnoglob[] = { 'n', 'o', 'g', 'l', 'o', 'b', '\0' }; +Char STRnonomatch[] = { 'n', 'o', 'n', 'o', 'm', 'a', 't', 'c', 'h', '\0' }; +Char STRfk_com1[] = { '`', ' ', '.', '.', '.', ' ', '`', '\0' }; +Char STRampm[] = { 'a', 'm', 'p', 'm', '\0' }; +Char STRchild[] = { 'c', 'h', 'i', 'l', 'd', '\0' }; +Char STRtime[] = { 't', 'i', 'm', 'e', '\0' }; +Char STRnotify[] = { 'n', 'o', 't', 'i', 'f', 'y', '\0' }; +Char STRprintexitvalue[] = { 'p', 'r', 'i', 'n', 't', 'e', 'x', 'i', 't', 'v', + 'a', 'l', 'u', 'e', '\0' }; +Char STRL_parensp[] = { '(', ' ', '\0' }; +Char STRspRparen[] = { ' ', ')', '\0' }; +Char STRspace[] = { ' ', '\0' }; +Char STRsP2sp[] = { ' ', '|', '|', ' ', '\0' }; +Char STRspand2sp[] = { ' ', '&', '&', ' ', '\0' }; +Char STRsPsp[] = { ' ', '|', ' ', '\0' }; +Char STRsmsp[] = { ';', ' ', '\0' }; +Char STRsm[] = { ';', '\0' }; +Char STRspL_arrow2sp[] = { ' ', '<', '<', ' ', '\0' }; +Char STRspLarrowsp[] = { ' ', '<', ' ', '\0' }; +Char STRspR_arrow2[] = { ' ', '>', '>', '\0' }; +Char STRspRarrow[] = { ' ', '>', '\0' }; +Char STRgt[] = { '>', '\0' }; +Char STRsp3dots[] = { ' ', '.', '.', '.', '\0' }; +Char STRc_2[] = { '%', '%', '\0' }; +Char STRc_plus[] = { '%', '+', '\0' }; +Char STRc_minus[] = { '%', '-', '\0' }; +Char STRc_hash[] = { '%', '#', '\0' }; +#ifdef BSDJOBS +Char STRcontinue[] = { 'c', 'o', 'n', 't', 'i', 'n', 'u', 'e', '\0' }; +Char STRcon_args[] = { 'c', 'o', 'n', 't', 'i', 'n', 'u', 'e', '_', 'a', + 'r', 'g', 's', '\0' }; +Char STRunderpause[] = { '_', 'p', 'a', 'u', 's', 'e', '\0' }; +#endif +Char STRbKqpwd[] = { '`', 'p', 'w', 'd', '`', '\0' }; +Char STRhstc[] = { 'h', 'i', 's', 't', 'c', 'h', 'a', 'r', 's', '\0' }; +Char STRhstl[] = { 'h', 'i', 's', 't', 'l', 'i', 't', '\0' }; +Char STRUSER[] = { 'U', 'S', 'E', 'R', '\0' }; +Char STRLOGNAME[] = { 'L', 'O', 'G', 'N', 'A', 'M', 'E', '\0' }; +Char STRwordchars[] = { 'w', 'o', 'r', 'd', 'c', 'h', 'a', 'r', 's', '\0' }; +Char STRTRM[] = { 'T', 'E', 'R', 'M', '\0' }; +Char STRHOME[] = { 'H', 'O', 'M', 'E', '\0' }; +Char STRbKslash_quote[] = { 'b', 'a', 'c', 'k', 's', 'l', 'a', 's', 'h', '_', + 'q', 'u', 'o', 't', 'e', '\0' }; +Char STRRparen[] = { ')', '\0' }; +Char STRcolon[] = { ':', '\0' }; +Char STRmail[] = { 'm', 'a', 'i', 'l', '\0' }; +Char STRwatch[] = { 'w', 'a', 't', 'c', 'h', '\0' }; + +Char STRd_tcshrc[] = { '/', '.', 't', 'c', 's', 'h', 'r', 'c', '\0' }; +Char STRd_cshrc[] = { '/', '.', 'c', 's', 'h', 'r', 'c', '\0' }; +Char STRd_login[] = { '/', '.', 'l', 'o', 'g', 'i', 'n', '\0' }; +Char STRig_eof[] = { 'i', 'g', 'n', 'o', 'r', 'e', 'e', 'o', 'f', '\0' }; +Char STRnoclobber[] = { 'n', 'o', 'c', 'l', 'o', 'b', 'b', 'e', 'r', '\0' }; +Char STRhelpcommand[] = { 'h', 'e', 'l', 'p', 'c', 'o', 'm', 'm', 'a', 'n', + 'd', '\0' }; +Char STRfignore[] = { 'f', 'i', 'g', 'n', 'o', 'r', 'e', '\0' }; +Char STRrecexact[] = { 'r', 'e', 'c', 'e', 'x', 'a', 'c', 't', '\0' }; +Char STRl_max[] = { 'l', 'i', 's', 't', 'm', 'a', 'x', '\0' }; +Char STRl_links[] = { 'l', 'i', 's', 't', 'l', 'i', 'n', 'k', 's', '\0' }; +Char STRDING[] = { 'D', 'I', 'N', 'G', '!', '\0' }; +Char STRQNULL[] = { '\0' | QUOTE, '\0' }; +Char STRcorrect[] = { 'c', 'o', 'r', 'r', 'e', 'c', 't', '\0' }; +Char STRcmd[] = { 'c', 'm', 'd', '\0' }; +Char STRall[] = { 'a', 'l', 'l', '\0' }; +Char STRa_expand[] = { 'a', 'u', 't', 'o', 'e', 'x', 'p', 'a', 'n', 'd', + '\0' }; +Char STRa_correct[] = { 'a', 'u', 't', 'o', 'c', 'o', 'r', 'r', 'e', 'c', + 't', '\0' }; +Char STRa_list[] = { 'a', 'u', 't', 'o', 'l', 'i', 's', 't', '\0' }; +Char STRmatchbeep[] = { 'm', 'a', 't', 'c', 'h', 'b', 'e', 'e', 'p', '\0' }; +Char STRnever[] = { 'n', 'e', 'v', 'e', 'r', '\0' }; +Char STRnomatch[] = { 'n', 'o', 'm', 'a', 't', 'c', 'h', '\0' }; +Char STRambiguous[] = { 'a', 'm', 'b', 'i', 'g', 'u', 'o', 'u', 's', '\0' }; +Char STRnotunique[] = { 'n', 'o', 't', 'u', 'n', 'i', 'q', 'u', 'e', '\0' }; +Char STRret[] = { '\n', '\0' }; +Char STRnobeep[] = { 'n', 'o', 'b', 'e', 'e', 'p', '\0' }; +Char STRvisiblebell[] = { 'v', 'i', 's', 'i', 'b', 'l', 'e', 'b', 'e', 'l', + 'l', '\0' }; +Char STRrecognize_only_executables[] = { 'r', 'e', 'c', 'o', 'g', 'n', 'i', 'z', + 'e', '_', 'o', 'n', 'l', 'y', '_', 'e', + 'x', 'e', 'c', 'u', 't', 'a', 'b', 'l', + 'e', 's', '\0' }; +Char STRnohup[] = { 'n', 'o', 'h', 'u', 'p', '\0' }; +Char STRnice[] = { 'n', 'i', 'c', 'e', '\0' }; +Char STRl_pathnum[] = { 'l', 'i', 's', 't', 'p', 'a', 't', 'h', 'n', 'u', + 'm', '\0' }; +Char STRshowdots[] = { 's', 'h', 'o', 'w', 'd', 'o', 't', 's', '\0' }; +Char STRthen[] = { 't', 'h', 'e', 'n', '\0' }; +Char STReof[] = { '^', 'D', '\b', '\b', '\0' }; +Char STRl_jobs[] = { 'l', 'i', 's', 't', 'j', 'o', 'b', 's', '\0' }; +Char STRlong[] = { 'l', 'o', 'n', 'g', '\0' }; +Char STRwho[] = { 'w', 'h', 'o', '\0' }; +Char STRrmstar[] = { 'r', 'm', 's', 't', 'a', 'r', '\0' }; +Char STRrm[] = { 'r', 'm', '\0' }; +Char STRshlvl[] = { 's', 'h', 'l', 'v', 'l', '\0' }; +Char STRSHLVL[] = { 'S', 'H', 'L', 'V', 'L', '\0' }; + +Char STRLANG[] = { 'L', 'A', 'N', 'G', '\0' }; +Char STRLC_CTYPE[] = { 'L', 'C', '_', 'C', 'T', 'Y', 'P', 'E' ,'\0' }; +Char STRNOREBIND[] = { 'N', 'O', 'R', 'E', 'B', 'I', 'N', 'D', '\0' }; + +#ifdef SIG_WINDOW +Char STRLINES[] = { 'L', 'I', 'N', 'E', 'S', '\0'}; +Char STRCOLUMNS[] = { 'C', 'O', 'L', 'U', 'M', 'N', 'S', '\0'}; +Char STRTRMCAP[] = { 'T', 'E', 'R', 'M', 'C', 'A', 'P', '\0'}; +#endif /* SIG_WINDOW */ + +#ifdef WARP +Char STRwarp[] = { 'w', 'a', 'r', 'p', '\0' }; +#endif /* WARP */ + +#ifdef apollo +Char STRSYSTYPE[] = { 'S', 'Y', 'S', 'T', 'Y', 'P', 'E', '\0' }; +Char STRoid[] = { 'o', 'i', 'd', '\0' }; +Char STRbsd43[] = { 'b', 's', 'd', '4', '.', '3', '\0' }; +Char STRsys53[] = { 's', 'y', 's', '5', '.', '3', '\0' }; +Char STRver[] = { 'v', 'e', 'r', '\0' }; +#endif /* apollo */ diff --git a/bin/tcsh/tc.decls.h b/bin/tcsh/tc.decls.h new file mode 100644 index 0000000..d0e5ed7 --- /dev/null +++ b/bin/tcsh/tc.decls.h @@ -0,0 +1,250 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/tc.decls.h,v 3.0 1991/07/04 23:34:26 christos Exp $ */ +/* + * tc.decls.h: Function declarations from all the tcsh modules + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#ifndef _h_tc_decls +#define _h_tc_decls + +/* + * tc.alloc.c + */ +#ifndef SYSMALLOC +extern void free __P((ptr_t)); +extern memalign_t malloc __P((size_t)); +extern memalign_t realloc __P((ptr_t, size_t)); +extern memalign_t calloc __P((size_t, size_t)); + +#else /* SYSMALLOC */ +extern void Free __P((ptr_t)); +extern memalign_t Malloc __P((size_t)); +extern memalign_t Realloc __P((ptr_t, size_t)); +extern memalign_t Calloc __P((size_t, size_t)); +#endif /* SYSMALLOC */ +extern void showall __P((void)); + +/* + * tc.bind.c + */ +extern void dobindkey __P((Char **)); +extern int parseescape __P((Char **)); +extern unsigned char *u_p_string __P((Char *, unsigned char *)); +extern void dobind __P((Char **)); + + +/* + * tc.disc.c + */ +extern int setdisc __P((int)); +extern int resetdisc __P((int)); + +/* + * tc.func.c + */ +extern Char *expand_lex __P((Char *, int, struct wordent *, + int, int)); +extern Char *sprlex __P((Char *, struct wordent *)); +extern void Itoa __P((int, Char *)); +extern void dolist __P((Char **)); +extern void dotelltc __P((Char **)); +extern void doechotc __P((Char **)); +extern void dosettc __P((Char **)); +extern void dowhich __P((Char **)); +extern struct process *find_stop_ed __P((void)); +extern void fg_proc_entry __P((struct process *)); +extern sigret_t alrmcatch __P((int)); +extern void precmd __P((void)); +extern void cwd_cmd __P((void)); +extern void period_cmd __P((void)); +extern void aliasrun __P((int, Char *, Char *)); +extern void setalarm __P((void)); +extern void rmstar __P((struct wordent *)); +#ifdef pdp11 +#define con_jobs cont_job +#endif +extern void con_jobs __P((struct wordent *)); +extern Char *gettilde __P((Char *)); +extern Char *getusername __P((Char **)); +extern void do_aliases __P((Char **)); + + +/* + * tc.os.c + */ +#ifdef MACH +extern void dosetpath __P((Char **)); +#endif +#ifdef TCF +extern void dogetxvers __P((Char **)); +extern void dosetxvers __P((Char **)); +extern void dogetspath __P((Char **)); +extern void dosetspath __P((Char **)); +extern char *sitename __P((pid_t)); +extern void domigrate __P((Char **)); +#endif +#ifdef WARP +extern void dowarp __P((Char **)); +#endif +#ifdef masscomp +extern void douniverse __P((Char **)); +#endif +#ifdef _SEQUENT_ +extern void pr_stat_sub __P((struct pro_stats *, + struct pro_stats *, + struct pro_stats *)); +#endif +#ifdef NEEDtcgetpgrp +extern int xtcgetpgrp __P((int)); +#define tcgetpgrp(a) xtcgetpgrp(a) +#endif +#ifdef YPBUGS +extern void fix_yp_bugs __P((void)); +#endif +extern void osinit __P((void)); +#ifdef NEEDgetwd +extern char *xgetwd __P((char *)); +#define getwd(a) xgetwd(a) +#endif +#ifdef NEEDgethostname +extern int gethostname __P((char *, int)); +#define gethostname(a, b) xgethostname(a, b) +#endif +#ifdef iconuxv +extern int vfork __P((void)); +#endif +#ifdef apollo +extern void doinlib __P((Char **)); +extern void dover __P((Char **)); +extern void dorootnode __P((Char **)); +extern int getv __P((Char *)); +#endif + + +/* + * tc.printf.h + */ +extern void xprintf __P((char *, ...)); +extern void mkprintf __P((long, ...)); +extern void xsprintf __P((char *, char *, ...)); +extern void xvprintf __P((char *, va_list)); +extern void xvsprintf __P((char *, char *, va_list)); + +/* + * tc.prompt.c + */ +extern void printprompt __P((int, Char *)); + +/* + * tc.sched.c + */ +extern time_t sched_next __P((void)); +extern void dosched __P((Char **)); +extern void sched_run __P((void)); + +/* + * tc.sig.c + */ +#ifndef BSDSIGS +# if SVID < 3 +# ifdef UNIXPC +extern sigret_t (*sigset __P((int, sigret_t (*)())) (); +extern void sigrelse __P((int)); +extern void sighold __P((int)); +extern void sigignore __P((int)); +extern void sigpause __P((int)); +# endif /* UNIXPC */ +extern int ourwait __P((int *)); +# endif +# ifdef SXA +extern void sigpause __P((int)); +# endif +#endif +#ifdef NEEDsignal +extern sigret_t (*xsignal __P((int, sigret_t (*)()))) (); +#define signal(a, b) xsignal(a, b) +#endif +#ifdef _SEQUENT_ +extern sigmask_t sigsetmask __P((sigmask_t)); +extern sigmask_t sigblock __P((sigmask_t)); +extern void b_sigpause __P((sigmask_t)); +#endif +#ifdef SIGSYNCH +extern sigret_t synch_handler __P((int)); +#endif + + + + +/* + * tc.str.c: + */ +#ifdef SHORT_STRINGS +extern Char *s_strchr __P((Char *, int)); +extern Char *s_strrchr __P((Char *, int)); +extern Char *s_strcat __P((Char *, Char *)); +#ifdef NOTUSED +extern Char *s_scat __P((Char *, Char *, size_t)); +#endif +extern Char *s_strcpy __P((Char *, Char *)); +extern Char *s_scpy __P((Char *, Char *, size_t)); +extern Char *s_strspl __P((Char *, Char *)); +extern size_t s_strlen __P((Char *)); +extern int s_strcmp __P((Char *, Char *)); +extern int s_scmp __P((Char *, Char *, size_t)); +extern Char *s_strsave __P((Char *)); +extern Char *s_strend __P((Char *)); +extern Char *s_strstr __P((Char *, Char *)); +extern Char *str2short __P((char *)); +extern Char **blk2short __P((char **)); +extern char *short2str __P((Char *)); +extern char *short2qstr __P((Char *)); +extern char **short2blk __P((Char **)); +#endif + + +/* + * tc.vers.h: + */ +extern void fix_version __P((void)); +extern Char *GetHostType __P((void)); + +/* + * tc.who.c + */ +extern void initwatch __P((void)); +extern void resetwatch __P((void)); +extern void watch_login __P((void)); +extern void dolog __P((Char **)); + +#endif /* _h_tc_decls */ diff --git a/bin/tcsh/tc.disc.c b/bin/tcsh/tc.disc.c new file mode 100644 index 0000000..2a2b3e8 --- /dev/null +++ b/bin/tcsh/tc.disc.c @@ -0,0 +1,197 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/tc.disc.c,v 3.0 1991/07/04 21:49:28 christos Exp $ */ +/* + * tc.disc.c: Functions to set/clear line disciplines + * + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#include "config.h" +#if !defined(lint) && !defined(pdp11) +static char *rcsid() + { return "$Id: tc.disc.c,v 3.0 1991/07/04 21:49:28 christos Exp $"; } +#endif + +#include "sh.h" + +#ifdef OREO +#include +#endif /* OREO */ + +static bool add_discipline = 0; /* Did we add a line discipline */ + +#if defined(IRIS4D) || defined(OREO) +# define HAVE_DISC +# ifndef POSIX +static struct termio otermiob; +# else +static struct termios otermiob; +# endif /* POSIX */ +#endif /* IRIS4D || OREO */ + +#ifdef _IBMR2 +# define HAVE_DISC +char strPOSIX[] = "posix"; +#endif /* _IBMR2 */ + +#if !defined(HAVE_DISC) && defined(TIOCGETD) && defined(NTTYDISC) +static int oldisc; +#endif /* !HAVE_DISC && TIOCGETD && NTTYDISC */ + +int +/*ARGSUSED*/ +setdisc(f) +int f; +{ +#ifdef IRIS4D +# ifndef POSIX + struct termio termiob; +# else + struct termios termiob; +# endif + + if (ioctl(f, TCGETA, (ioctl_t) & termiob) == 0) { + otermiob = termiob; + if (termiob.c_line != NTTYDISC || termiob.c_cc[VSWTCH] == 0) { + termiob.c_line = NTTYDISC; + termiob.c_cc[VSWTCH] = CSWTCH; + if (ioctl(f, TCSETA, (ioctl_t) & termiob) != 0) + return (-1); + } + } + else + return (-1); + add_discipline = 1; + return (0); +#endif /* IRIS4D */ + + +#ifdef OREO +# ifndef POSIX + struct termio termiob; +# else + struct termios termiob; +# endif + + struct ltchars ltcbuf; + + if (ioctl(f, TCGETA, (ioctl_t) & termiob) == 0) { + otermiob = termiob; + if ((getcompat(COMPAT_BSDTTY) & COMPAT_BSDTTY) != COMPAT_BSDTTY) { + setcompat(COMPAT_BSDTTY); + if (ioctl(f, TIOCGLTC, (ioctl_t) & ltcbuf) != 0) + xprintf("Couldn't get local chars.\n"); + else { + ltcbuf.t_suspc = '\032'; /* ^Z */ + ltcbuf.t_dsuspc = '\031'; /* ^Y */ + ltcbuf.t_rprntc = '\022'; /* ^R */ + ltcbuf.t_flushc = '\017'; /* ^O */ + ltcbuf.t_werasc = '\027'; /* ^W */ + ltcbuf.t_lnextc = '\026'; /* ^V */ + if (ioctl(f, TIOCSLTC, (ioctl_t) & ltcbuf) != 0) + xprintf("Couldn't set local chars.\n"); + } + termiob.c_cc[VSWTCH] = '\0'; + if (ioctl(f, TCSETAF, (ioctl_t) & termiob) != 0) + return (-1); + } + } + else + return (-1); + add_discipline = 1; + return (0); +#endif /* OREO */ + + +#ifdef _IBMR2 + union txname tx; + + tx.tx_which = 0; + + if (ioctl(f, TXGETLD, (ioctl_t) & tx) == 0) { + if (strcmp(tx.tx_name, strPOSIX) != 0) + if (ioctl(f, TXADDCD, (ioctl_t) strPOSIX) == 0) { + add_discipline = 1; + return (0); + } + return (0); + } + else + return (-1); +#endif /* _IBMR2 */ + +#ifndef HAVE_DISC +# if defined(TIOCGETD) && defined(NTTYDISC) + if (ioctl(f, TIOCGETD, (ioctl_t) & oldisc) == 0) { + if (oldisc != NTTYDISC) { + int ldisc = NTTYDISC; + + if (ioctl(f, TIOCSETD, (ioctl_t) & ldisc) != 0) + return (-1); + add_discipline = 1; + } + else + oldisc = -1; + return (0); + } + else + return (-1); +# else + return (0); +# endif /* TIOCGETD && NTTYDISC */ +#endif /* !HAVE_DISC */ +} /* end setdisc */ + + +int +/*ARGSUSED*/ +resetdisc(f) +int f; +{ + if (add_discipline) { + add_discipline = 0; +#if defined(OREO) || defined(IRIS4D) + return (ioctl(f, TCSETAF, &otermiob)); +#endif /* OREO || IRIS4D */ + +#ifdef _IBMR2 + return (ioctl(f, TXDELCD, (ioctl_t) strPOSIX)); +#endif /* _IBMR2 */ + +#ifndef HAVE_DISC +# if defined(TIOCSETD) && defined(NTTYDISC) + return (ioctl(f, TIOCSETD, (ioctl_t) & oldisc)); +# endif /* TIOCSETD && NTTYDISC */ +#endif /* !HAVE_DISC */ + } + return (0); +} /* end resetdisc */ diff --git a/bin/tcsh/tc.func.c b/bin/tcsh/tc.func.c new file mode 100644 index 0000000..2d0a5d4 --- /dev/null +++ b/bin/tcsh/tc.func.c @@ -0,0 +1,1222 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/tc.func.c,v 3.0 1991/07/04 21:49:28 christos Exp $ */ +/* + * tc.func.c: New tcsh builtins. + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#include "config.h" +#if !defined(lint) && !defined(pdp11) +static char *rcsid() + { return "$Id: tc.func.c,v 3.0 1991/07/04 21:49:28 christos Exp $"; } +#endif + +#include "sh.h" +#include "ed.h" +#include "ed.defns.h" /* for the function names */ +#include "tw.h" + +extern time_t t_period; +static bool precmd_active = 0; +static bool periodic_active = 0; +static bool cwdcmd_active = 0; /* PWP: for cwd_cmd */ + +static void Reverse __P((Char *)); +static void auto_logout __P((void)); +static void insert __P((struct wordent *, bool)); +static void insert_we __P((struct wordent *, struct wordent *)); +static int inlist __P((Char *, Char *)); + + +/* + * Tops-C shell + */ + +/* + * expand_lex: Take the given lex and put an expanded version of it in the + * string buf. First guy in lex list is ignored; last guy is ^J which we + * ignore Only take lex'es from position from to position to inclusive Note: + * csh sometimes sets bit 8 in characters which causes all kinds of problems + * if we don't mask it here. Note: excl's in lexes have been un-back-slashed + * and must be re-back-slashed + * (PWP: NOTE: this returns a pointer to the END of the string expanded + * (in other words, where the NUL is).) + */ +/* PWP: this is a combination of the old sprlex() and the expand_lex from + the magic-space stuff */ + +Char * +expand_lex(buf, bufsiz, sp0, from, to) + Char *buf; + int bufsiz; + struct wordent *sp0; + int from, to; +{ + register struct wordent *sp; + register Char *s, *d, *e; + register Char prev_c; + register int i; + + buf[0] = '\0'; + prev_c = '\0'; + d = buf; + e = &buf[bufsiz]; /* for bounds checking */ + + if (!sp0) + return (buf); /* null lex */ + if ((sp = sp0->next) == sp0) + return (buf); /* nada */ + if (sp == (sp0 = sp0->prev)) + return (buf); /* nada */ + + for (i = 0; i < NCARGS; i++) { + if ((i >= from) && (i <= to)) { /* if in range */ + for (s = sp->word; *s && d < e; s++) { + /* + * bugfix by Michael Bloom: anything but the current history + * character {(PWP) and backslash} seem to be dealt with + * elsewhere. + */ + if ((*s & QUOTE) + && (((*s & TRIM) == HIST) || + ((*s & TRIM) == '\\') && (prev_c != '\\'))) { + *d++ = '\\'; + } + *d++ = (*s & TRIM); + prev_c = *s; + } + if (d < e) + *d++ = ' '; + } + sp = sp->next; + if (sp == sp0) + break; + } + if (d > buf) + d--; /* get rid of trailing space */ + + return (d); +} + +Char * +sprlex(buf, sp0) + Char *buf; + struct wordent *sp0; +{ + Char *cp; + + cp = expand_lex(buf, INBUFSIZ, sp0, 0, NCARGS); + *cp = '\0'; + return (buf); +} + +void +Itoa(n, s) /* convert n to characters in s */ + int n; + Char *s; +{ + int i, sign; + + if ((sign = n) < 0) /* record sign */ + n = -n; + i = 0; + do { + s[i++] = n % 10 + '0'; + } while ((n /= 10) > 0); + if (sign < 0) + s[i++] = '-'; + s[i] = '\0'; + Reverse(s); +} + +static void +Reverse(s) + Char *s; +{ + int c, i, j; + + for (i = 0, j = Strlen(s) - 1; i < j; i++, j--) { + c = s[i]; + s[i] = s[j]; + s[j] = c; + } +} + + +void +dolist(v) + register Char **v; +{ + int i, k; + struct stat st; + + if (*++v == NULL) { + (void) t_search(STRNULL, NULL, LIST, 0, 0, 0); + return; + } + gflag = 0; + tglob(v); + if (gflag) { + v = globall(v); + if (v == 0) + stderror(ERR_NAME | ERR_NOMATCH); + } + else + v = gargv = saveblk(v); + trim(v); + for (k = 0; v[k] != NULL && v[k][0] != '-'; k++); + if (v[k]) { + /* + * We cannot process a flag therefore we let ls do it right. + */ + static Char STRls[] = + {'l', 's', '\0'}; + static Char STRmCF[] = + {'-', 'C', 'F', '\0'}; + struct command *t; + struct wordent cmd, *nextword, *lastword; + Char *cp; + +#ifdef BSDSIGS + sigmask_t omask = 0; + + if (setintr) + omask = sigblock(sigmask(SIGINT)) & ~sigmask(SIGINT); +#else + sighold(SIGINT); +#endif + if (seterr) { + xfree((ptr_t) seterr); + seterr = NULL; + } + cmd.word = STRNULL; + lastword = &cmd; + nextword = (struct wordent *) xcalloc(1, sizeof cmd); + nextword->word = Strsave(STRls); + lastword->next = nextword; + nextword->prev = lastword; + lastword = nextword; + nextword = (struct wordent *) xcalloc(1, sizeof cmd); + nextword->word = Strsave(STRmCF); + lastword->next = nextword; + nextword->prev = lastword; + lastword = nextword; + for (cp = *v; cp; cp = *++v) { + nextword = (struct wordent *) xcalloc(1, sizeof cmd); + nextword->word = Strsave(cp); + lastword->next = nextword; + nextword->prev = lastword; + lastword = nextword; + } + lastword->next = &cmd; + cmd.prev = lastword; + + /* build a syntax tree for the command. */ + t = syntax(cmd.next, &cmd, 0); + if (seterr) + stderror(ERR_OLD); + /* expand aliases like process() does */ + /* alias(&cmd); */ + /* execute the parse tree. */ + execute(t, tpgrp > 0 ? tpgrp : -1, NULL, NULL); + /* done. free the lex list and parse tree. */ + freelex(&cmd), freesyn(t); + if (setintr) +#ifdef BSDSIGS + (void) sigsetmask(omask); +#else + (void) sigrelse(SIGINT); +#endif + } + else { + Char *dp, *tmp, buf[MAXPATHLEN]; + + for (k = 0, i = 0; v[k] != NULL; k++) { + tmp = dnormalize(v[k]); + dp = &tmp[Strlen(tmp) - 1]; + if (*dp == '/' && dp != tmp) +#ifdef apollo + if (dp != &tmp[1]) +#endif + *dp = '\0'; + if (stat(short2str(tmp), &st) == -1) { + if (k != i) { + if (i != 0) + xputchar('\n'); + print_by_column(STRNULL, &v[i], k - i, FALSE); + } + xprintf("%s: %s.\n", short2str(tmp), strerror(errno)); + i = k + 1; + } + else if (S_ISDIR(st.st_mode)) { + Char *cp; + + if (k != i) { + if (i != 0) + xputchar('\n'); + print_by_column(STRNULL, &v[i], k - i, FALSE); + } + if (k != 0 && v[1] != NULL) + xputchar('\n'); + xprintf("%s:\n", short2str(tmp)); + for (cp = tmp, dp = buf; *cp; *dp++ = (*cp++ | QUOTE)); + if (dp[-1] != (Char) ('/' | QUOTE)) + *dp++ = '/'; + else + dp[-1] &= TRIM; + *dp = '\0'; + (void) t_search(buf, NULL, LIST, 0, 0, 0); + i = k + 1; + } + xfree((ptr_t) tmp); + } + if (k != i) { + if (i != 0) + xputchar('\n'); + print_by_column(STRNULL, &v[i], k - i, FALSE); + } + } + + if (gargv) { + blkfree(gargv); + gargv = 0; + } +} + +static char *d_tell = "ALL"; +extern bool GotTermCaps; + +void +dotelltc(v) + register Char **v; +{ + + if (!GotTermCaps) + GetTermCaps(); + + TellTC(v[1] ? short2str(v[1]) : d_tell); +} + +void +doechotc(v) + register Char **v; +{ + if (!GotTermCaps) + GetTermCaps(); + EchoTC(++v); +} + +void +dosettc(v) + Char **v; +{ + char tv[2][BUFSIZ]; + + if (!GotTermCaps) + GetTermCaps(); + + (void) strcpy(tv[0], short2str(v[1])); + (void) strcpy(tv[1], short2str(v[2])); + SetTC(tv[0], tv[1]); +} + +/* The dowhich() is by: + * Andreas Luik + * I S A GmbH - Informationssysteme fuer computerintegrierte Automatisierung + * Azenberstr. 35 + * D-7000 Stuttgart 1 + * West-Germany + * Thanks!! + */ + +void +dowhich(v) + register Char **v; +{ + struct wordent lex[3]; + struct varent *vp; + + lex[0].next = &lex[1]; + lex[1].next = &lex[2]; + lex[2].next = &lex[0]; + + lex[0].prev = &lex[2]; + lex[1].prev = &lex[0]; + lex[2].prev = &lex[1]; + + lex[0].word = STRNULL; + lex[2].word = STRret; + + while (*++v) { + if (vp = adrof1(*v, &aliases)) { + xprintf("%s: \t aliased to ", short2str(*v)); + blkpr(vp->vec); + xprintf("\n"); + } + else { + lex[1].word = *v; + tellmewhat(lex); + } + } +} + +/* PWP: a hack to start up your stopped editor on a single keystroke */ +/* jbs - fixed hack so it worked :-) 3/28/89 */ + +struct process * +find_stop_ed() +{ + register struct process *pp; + register char *ep, *vp, *p; + int epl, vpl; + + if ((ep = getenv("EDITOR")) != NULL) { /* if we have a value */ + if ((p = strrchr(ep, '/')) != NULL) { /* if it has a path */ + ep = p + 1; /* then we want only the last part */ + } + } + else { + ep = "ed"; + } + if ((vp = getenv("VISUAL")) != NULL) { /* if we have a value */ + if ((p = strrchr(vp, '/')) != NULL) { /* and it has a path */ + vp = p + 1; /* then we want only the last part */ + } + } + else { + vp = "vi"; + } + vpl = strlen(vp); + epl = strlen(ep); + + if (pcurrent == PNULL) /* see if we have any jobs */ + return PNULL; /* nope */ + + for (pp = proclist.p_next; pp; pp = pp->p_next) { + if (pp->p_pid == pp->p_jobid) { + p = short2str(pp->p_command); + /* if we find either in the current name, fg it */ + if (strncmp(ep, p, (size_t) epl) == 0 || + strncmp(vp, p, (size_t) vpl) == 0) + return pp; + } + } + return PNULL; /* didn't find a job */ +} + +void +fg_proc_entry(pp) + register struct process *pp; +{ +#ifdef BSDSIGS + sigmask_t omask; +#endif + jmp_buf osetexit; + bool ohaderr; + + getexit(osetexit); + +#ifdef BSDSIGS + omask = sigblock(sigmask(SIGINT)); +#else + (void) sighold(SIGINT); +#endif + + ohaderr = haderr; /* we need to ignore setting of haderr due to + * process getting stopped by a signal */ + if (setexit() == 0) { /* come back here after pjwait */ + pendjob(); + pstart(pp, 1); /* found it. */ + pjwait(pp); + } + + resexit(osetexit); + haderr = ohaderr; + +#ifdef BSDSIGS + (void) sigsetmask(omask); +#else + (void) sigrelse(SIGINT); +#endif + +} + +static void +auto_logout() +{ + xprintf("auto-logout\n"); + /* Don't leave the tty in raw mode */ + if (editing) + (void) Cookedmode(); + (void) close(SHIN); + set(STRlogout, Strsave(STRa_matic)); + child = 1; +#ifdef TESLA + do_logout = 1; +#endif /* TESLA */ + goodbye(); +} + +sigret_t +/*ARGSUSED*/ +alrmcatch(snum) +int snum; +{ + time_t cl, nl; + + if ((nl = sched_next()) == -1) + auto_logout(); /* no other possibility - logout */ + (void) time(&cl); + if (nl <= cl + 1) + sched_run(); + else + auto_logout(); + setalarm(); +#ifndef SIGVOID + return (snum); +#endif +} + +/* + * Karl Kleinpaste, 21oct1983. + * Added precmd(), which checks for the alias + * precmd in aliases. If it's there, the alias + * is executed as a command. This is done + * after mailchk() and just before print- + * ing the prompt. Useful for things like printing + * one's current directory just before each command. + */ +void +precmd() +{ +#ifdef BSDSIGS + sigmask_t omask; +#endif + +#ifdef BSDSIGS + omask = sigblock(sigmask(SIGINT)); +#else + (void) sighold(SIGINT); +#endif + if (precmd_active) { /* an error must have been caught */ + aliasrun(2, STRunalias, STRprecmd); + xprintf("Faulty alias 'precmd' removed.\n"); + goto leave; + } + precmd_active = 1; + if (!whyles && adrof1(STRprecmd, &aliases)) + aliasrun(1, STRprecmd, NULL); +leave: + precmd_active = 0; +#ifdef BSDSIGS + (void) sigsetmask(omask); +#else + (void) sigrelse(SIGINT); +#endif +} + +/* + * Paul Placeway 11/24/87 Added cwd_cmd by hacking precmd() into + * submission... Run every time $cwd is set (after it is set). Useful + * for putting your machine and cwd (or anything else) in an xterm title + * space. + */ +void +cwd_cmd() +{ +#ifdef BSDSIGS + sigmask_t omask; +#endif + +#ifdef BSDSIGS + omask = sigblock(sigmask(SIGINT)); +#else + (void) sighold(SIGINT); +#endif + if (cwdcmd_active) { /* an error must have been caught */ + aliasrun(2, STRunalias, STRcwdcmd); + xprintf("Faulty alias 'cwdcmd' removed.\n"); + goto leave; + } + cwdcmd_active = 1; + if (!whyles && adrof1(STRcwdcmd, &aliases)) + aliasrun(1, STRcwdcmd, NULL); +leave: + cwdcmd_active = 0; +#ifdef BSDSIGS + (void) sigsetmask(omask); +#else + (void) sigrelse(SIGINT); +#endif +} + + +/* + * Karl Kleinpaste, 18 Jan 1984. + * Added period_cmd(), which executes the alias "periodic" every + * $tperiod minutes. Useful for occasional checking of msgs and such. + */ +void +period_cmd() +{ + register Char *vp; + time_t t, interval; +#ifdef BSDSIGS + sigmask_t omask; +#endif + +#ifdef BSDSIGS + omask = sigblock(sigmask(SIGINT)); +#else + (void) sighold(SIGINT); +#endif + if (periodic_active) { /* an error must have been caught */ + aliasrun(2, STRunalias, STRperiodic); + xprintf("Faulty alias 'periodic' removed.\n"); + goto leave; + } + periodic_active = 1; + if (!whyles && adrof1(STRperiodic, &aliases)) { + vp = value(STRtperiod); + if (vp == NOSTR) + return; + interval = getn(vp); + (void) time(&t); + if (t - t_period >= interval * 60) { + t_period = t; + aliasrun(1, STRperiodic, NULL); + } + } +leave: + periodic_active = 0; +#ifdef BSDSIGS + (void) sigsetmask(omask); +#else + (void) sigrelse(SIGINT); +#endif +} + +/* + * Karl Kleinpaste, 21oct1983. + * Set up a one-word alias command, for use for special things. + * This code is based on the mainline of process(). + */ +void +aliasrun(cnt, s1, s2) + int cnt; + Char *s1, *s2; +{ + struct wordent w, *new1, *new2; /* for holding alias name */ + struct command *t = NULL; + jmp_buf osetexit; + + getexit(osetexit); + if (seterr) { + xfree((ptr_t) seterr); + seterr = NULL; /* don't repeatedly print err msg. */ + } + w.word = STRNULL; + new1 = (struct wordent *) xcalloc(1, sizeof w); + new1->word = Strsave(s1); + if (cnt == 1) { + /* build a lex list with one word. */ + w.next = w.prev = new1; + new1->next = new1->prev = &w; + } + else { + /* build a lex list with two words. */ + new2 = (struct wordent *) xcalloc(1, sizeof w); + new2->word = Strsave(s2); + w.next = new2->prev = new1; + new1->next = w.prev = new2; + new1->prev = new2->next = &w; + } + + /* expand aliases like process() does. */ + alias(&w); + /* build a syntax tree for the command. */ + t = syntax(w.next, &w, 0); + if (seterr) + stderror(ERR_OLD); + + psavejob(); + /* catch any errors here */ + if (setexit() == 0) + /* execute the parse tree. */ + /* + * From: Michael Schroeder + * was execute(t, tpgrp); + */ + execute(t, tpgrp > 0 ? tpgrp : -1, NULL, NULL); + /* done. free the lex list and parse tree. */ + freelex(&w), freesyn(t); + if (haderr) { + haderr = 0; + /* + * Either precmd, or cwdcmd, or periodic had an error. Call it again so + * that it is removed + */ + if (precmd_active) + precmd(); +#ifdef notdef + /* + * XXX: On the other hand, just interrupting them causes an error too. + * So if we hit ^C in the middle of cwdcmd or periodic the alias gets + * removed. We don't want that. Note that we want to remove precmd + * though, cause that could lead into an infinite loop. This should be + * fixed correctly, but then haderr should give us the whole exit + * status not just true or false. + */ + else if (cwdcmd_active) + cwd_cmd(); + else if (periodic_active) + period_cmd(); +#endif + } + /* reset the error catcher to the old place */ + resexit(osetexit); + prestjob(); + pendjob(); +} + +void +setalarm() +{ + struct varent *vp; + Char *cp; + unsigned alrm_time = 0; + long cl, nl, sched_dif; + + if (vp = adrof(STRa_logout)) { + if (cp = vp->vec[0]) + alrm_time = (atoi(short2str(cp)) * 60); + } + if ((nl = sched_next()) != -1) { + (void) time(&cl); + sched_dif = nl - cl; + if ((alrm_time == 0) || (sched_dif < alrm_time)) + alrm_time = ((int) sched_dif) + 1; + } + (void) alarm(alrm_time); /* Autologout ON */ +} + +#define RMDEBUG /* For now... */ + +void +rmstar(cp) + struct wordent *cp; +{ + struct wordent *we, *args; + register struct wordent *tmp, *del; + +#ifdef RMDEBUG + static Char STRrmdebug[] = + {'r', 'm', 'd', 'e', 'b', 'u', 'g', '\0'}; + Char *tag; + +#endif + Char *charac; + char c; + int ask, doit, star = 0, silent = 0; + + if (!adrof(STRrmstar)) + return; +#ifdef RMDEBUG + tag = value(STRrmdebug); +#endif + we = cp->next; + while (*we->word == ';' && we != cp) + we = we->next; + while (we != cp) { +#ifdef RMDEBUG + if (*tag) + xprintf("parsing command line\n"); +#endif + if (!Strcmp(we->word, STRrm)) { + args = we->next; + ask = (*args->word != '-'); + while (*args->word == '-' && !silent) { /* check options */ + for (charac = (args->word + 1); *charac && !silent; charac++) + silent = (*charac == 'i' || *charac == 'f'); + args = args->next; + } + ask = (ask || !ask && !silent); + if (ask) { + for (; !star && *args->word != ';' + && args != cp; args = args->next) + if (!Strcmp(args->word, STRstar)) + star = 1; + if (ask && star) { + xprintf("Do you really want to delete all files? [n/y] "); + flush(); + (void) read(SHIN, &c, 1); + doit = (c == 'Y' || c == 'y'); + while (c != '\n') + (void) read(SHIN, &c, 1); + if (!doit) { + /* remove the command instead */ + if (*tag) + xprintf("skipping deletion of files!\n"); + for (tmp = we; + *tmp->word != '\n' && + *tmp->word != ';' && tmp != cp;) { + tmp->prev->next = tmp->next; + tmp->next->prev = tmp->prev; + xfree((ptr_t) tmp->word); + del = tmp; + tmp = tmp->next; + xfree((ptr_t) del); + } + if (*tmp->word == ';') { + tmp->prev->next = tmp->next; + tmp->next->prev = tmp->prev; + xfree((ptr_t) tmp->word); + del = tmp; + xfree((ptr_t) del); + } + } + } + } + } + for (we = we->next; + *we->word != ';' && we != cp; + we = we->next); + if (*we->word == ';') + we = we->next; + } +#ifdef RMDEBUG + if (*tag) { + xprintf("command line now is:\n"); + for (we = cp->next; we != cp; we = we->next) + xprintf("%s ", short2str(we->word)); + } +#endif + return; +} + +#ifdef BSDJOBS +/* Check if command is in continue list + and do a "aliasing" if it exists as a job in background */ + +#define CNDEBUG /* For now */ +void +con_jobs(cp) + struct wordent *cp; +{ + struct wordent *we; + register struct process *pp, *np; + Char *cmd, *con_list, *con_args_list; + +#ifdef CNDEBUG + Char *tag; + static Char STRcndebug[] = + {'c', 'n', 'd', 'e', 'b', 'u', 'g', '\0'}; + +#endif + bool in_c__list, in_c__arg_list; + + +#ifdef CNDEBUG + tag = value(STRcndebug); +#endif + con_list = value(STRcontinue); + con_args_list = value(STRcon_args); + if (*con_list == '\0' && *con_args_list == '\0') + return; + + we = cp->next; + while (*we->word == ';' && we != cp) + we = we->next; + while (we != cp) { +#ifdef CNDEBUG + if (*tag) + xprintf("parsing command line\n"); +#endif + cmd = we->word; + in_c__list = inlist(con_list, cmd); + in_c__arg_list = inlist(con_args_list, cmd); + if (in_c__list || in_c__arg_list) { +#ifdef CNDEBUG + if (*tag) + xprintf("in one of the lists\n"); +#endif + np = PNULL; + for (pp = proclist.p_next; pp; pp = pp->p_next) { + if (prefix(cmd, pp->p_command)) { + if (pp->p_index) { + np = pp; + break; + } + } + } + if (np) { + insert(we, in_c__arg_list); + } + } + for (we = we->next; + *we->word != ';' && we != cp; + we = we->next); + if (*we->word == ';') + we = we->next; + } +#ifdef CNDEBUG + if (*tag) { + xprintf("command line now is:\n"); + for (we = cp->next; we != cp; we = we->next) + xprintf("%s ", + short2str(we->word)); + } +#endif + return; +} + +/* The actual "aliasing" of for backgrounds() is done here + with the aid of insert_we(). */ +static void +insert(plist, file_args) + struct wordent *plist; + bool file_args; +{ + struct wordent *now, *last; + Char *cmd, *bcmd, *cp1, *cp2; + int cmd_len; + Char *pause = STRunderpause; + int p_len = Strlen(pause); + + cmd_len = Strlen(plist->word); + cmd = (Char *) xcalloc(1, (size_t) ((cmd_len + 1) * sizeof(Char))); + (void) Strcpy(cmd, plist->word); +/* Do insertions at beginning, first replace command word */ + + if (file_args) { + now = plist; + xfree((ptr_t) now->word); + now->word = (Char *) xcalloc(1, (size_t) (5 * sizeof(Char))); + (void) Strcpy(now->word, STRecho); + + now = (struct wordent *) xcalloc(1, (size_t) sizeof(struct wordent)); + now->word = (Char *) xcalloc(1, (size_t) (6 * sizeof(Char))); + (void) Strcpy(now->word, STRbKqpwd); + insert_we(now, plist); + + for (last = now; *last->word != '\n' && *last->word != ';'; + last = last->next); + + now = (struct wordent *) xcalloc(1, (size_t) sizeof(struct wordent)); + now->word = (Char *) xcalloc(1, (size_t) (2 * sizeof(Char))); + (void) Strcpy(now->word, STRgt); + insert_we(now, last->prev); + + now = (struct wordent *) xcalloc(1, (size_t) sizeof(struct wordent)); + now->word = (Char *) xcalloc(1, (size_t) (2 * sizeof(Char))); + (void) Strcpy(now->word, STRbang); + insert_we(now, last->prev); + + now = (struct wordent *) xcalloc(1, (size_t) sizeof(struct wordent)); + now->word = (Char *) xcalloc(1, (size_t) cmd_len + p_len + 4); + cp1 = now->word; + cp2 = cmd; + *cp1++ = '~'; + *cp1++ = '/'; + *cp1++ = '.'; + while (*cp1++ = *cp2++); + cp1--; + cp2 = pause; + while (*cp1++ = *cp2++); + insert_we(now, last->prev); + + now = (struct wordent *) xcalloc(1, (size_t) sizeof(struct wordent)); + now->word = (Char *) xcalloc(1, (size_t) (2 * sizeof(Char))); + (void) Strcpy(now->word, STRsm); + insert_we(now, last->prev); + bcmd = (Char *) xcalloc(1, (size_t) ((cmd_len + 2) * sizeof(Char))); + cp1 = bcmd; + cp2 = cmd; + *cp1++ = '%'; + while (*cp1++ = *cp2++); + now = (struct wordent *) xcalloc(1, (size_t) (sizeof(struct wordent))); + now->word = bcmd; + insert_we(now, last->prev); + } + else { + struct wordent *del; + + now = plist; + xfree((ptr_t) now->word); + now->word = (Char *) xcalloc(1, (size_t) ((cmd_len + 2) * sizeof(Char))); + cp1 = now->word; + cp2 = cmd; + *cp1++ = '%'; + while (*cp1++ = *cp2++); + for (now = now->next; + *now->word != '\n' && *now->word != ';' && now != plist;) { + now->prev->next = now->next; + now->next->prev = now->prev; + xfree((ptr_t) now->word); + del = now; + now = now->next; + xfree((ptr_t) del); + } + } +} + +static void +insert_we(new, where) + struct wordent *new, *where; +{ + + new->prev = where; + new->next = where->next; + where->next = new; + new->next->prev = new; +} + +static int +inlist(list, name) + Char *list, *name; +{ + register Char *l, *n; + + l = list; + n = name; + + while (*l && *n) { + if (*l == *n) { + l++; + n++; + if (*n == '\0' && (*l == ' ' || *l == '\0')) + return (1); + else + continue; + } + else { + while (*l && *l != ' ') + l++; /* skip to blank */ + while (*l && *l == ' ') + l++; /* and find first nonblank character */ + n = name; + } + } + return (0); +} + +#endif /* BSDJOBS */ + + +/* + * Implement a small cache for tilde names. This is used primarily + * to expand tilde names to directories, but also + * we can find users from their home directories for the tilde + * prompt, on machines where yp lookup is slow this can be a big win... + * As with any cache this can run out of sync... + */ +static struct tildecache { + Char *user; + Char *home; + int hlen; +} *tcache = NULL; + +#define TILINCR 10 +static int tlength = 0, tsize = TILINCR; + +static int +tildecompare(p1, p2) + struct tildecache *p1, *p2; +{ + return Strcmp(p1->user, p2->user); +} + +Char * +gettilde(us) + Char *us; +{ + struct tildecache *bp1, *bp2, *bp; + register struct passwd *pp; + + if (tcache == NULL) + tcache = (struct tildecache *) xmalloc((size_t) (TILINCR * + sizeof(struct tildecache))); + /* + * Binary search + */ + for (bp1 = tcache, bp2 = tcache + tlength; bp1 < bp2;) { + register int i; + + bp = bp1 + ((bp2 - bp1) >> 1); + if ((i = *us - *bp->user) == 0 && (i = Strcmp(us, bp->user)) == 0) + return (bp->home); + if (i < 0) + bp2 = bp; + else + bp1 = bp + 1; + } + /* + * Not in the cache, try to get it from the passwd file + */ + pp = getpwnam(short2str(us)); +#ifdef YPBUGS + fix_yp_bugs(); +#endif + if (pp == NULL) + return NULL; + + /* + * Update the cache + */ + tcache[tlength].user = Strsave(us); + us = tcache[tlength].home = Strsave(str2short(pp->pw_dir)); + tcache[tlength++].hlen = Strlen(us); + + (void) qsort((ptr_t) tcache, (size_t) tlength, sizeof(struct tildecache), + tildecompare); + + if (tlength == tsize) { + tsize += TILINCR; + tcache = (struct tildecache *) xrealloc((ptr_t) tcache, + (size_t) (tsize * + sizeof(struct tildecache))); + } + return (us); +} + +/* + * Return the username if the directory path passed contains a + * user's home directory in the tilde cache, otherwise return NULL + * hm points to the place where the path became different. + * Special case: Our own home directory. + */ +Char * +getusername(hm) + Char **hm; +{ + Char *h, *p; + int i, j; + + if (((h = value(STRhome)) != NULL) && + (Strncmp(p = *hm, h, j = Strlen(h)) == 0) && + (p[j] == '/' || p[j] == '\0')) { + *hm = &p[j]; + return STRNULL; + } + for (i = 0; i < tlength; i++) + if ((Strncmp(p = *hm, tcache[i].home, j = tcache[i].hlen) == 0) && + (p[j] == '/' || p[j] == '\0')) { + *hm = &p[j]; + return tcache[i].user; + } + return NULL; +} + +/* + * PWP: read a bunch of aliases out of a file QUICKLY. The format + * is almost the same as the result of saying "alias > FILE", except + * that saying "aliases > FILE" does not expand non-letters to printable + * sequences. + */ +void +do_aliases(v) + Char **v; +{ + jmp_buf oldexit; + Char **vec, *lp; + int fd; + Char buf[BUFSIZ], line[BUFSIZ]; + char tbuf[BUFSIZ + 1], *tmp; + extern bool output_raw; /* PWP: in sh.print.c */ + + v++; + if (*v == 0) { + output_raw = 1; + plist(&aliases); + output_raw = 0; + return; + } + + gflag = 0, tglob(v); + if (gflag) { + v = globall(v); + if (v == 0) + stderror(ERR_NAME | ERR_NOMATCH); + } + else { + v = gargv = saveblk(v); + trim(v); + } + + if ((fd = open(tmp = short2str(*v), O_RDONLY)) < 0) + stderror(ERR_NAME | ERR_SYSTEM, tmp, strerror(errno)); + + getexit(oldexit); + if (setexit() == 0) { + for (;;) { + lp = line; + for (;;) { + Char *p = NULL; + int n = 0; + if (n <= 0) { + int i; + + if ((n = read(fd, tbuf, BUFSIZ)) <= 0) + goto eof; + for (i = 0; i < n; i++) + buf[i] = tbuf[i]; + p = buf; + } + n--; + if ((*lp++ = *p++) == '\n') { + lp[-1] = '\0'; + break; + } + } + for (lp = line; *lp; lp++) { + if (isspc(*lp)) { + *lp++ = '\0'; + while (isspc(*lp)) + lp++; + vec = (Char **) xmalloc((size_t) + (2 * sizeof(Char **))); + vec[0] = Strsave(lp); + vec[1] = NULL; + setq(strip(line), vec, &aliases); + break; + } + } + } + } + +eof: + (void) close(fd); + tw_clear_comm_list(); + if (gargv) + blkfree(gargv), gargv = 0; + resexit(oldexit); +} diff --git a/bin/tcsh/tc.h b/bin/tcsh/tc.h new file mode 100644 index 0000000..fe4d47e --- /dev/null +++ b/bin/tcsh/tc.h @@ -0,0 +1,45 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/tc.h,v 3.0 1991/07/04 23:38:58 christos Exp $ */ +/* + * tc.h: Tcsh includes + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#ifndef _h_tc +#define _h_tc + +#include "tc.const.h" +#include "tc.os.h" +#include "tc.sig.h" +#include "tc.decls.h" + +#endif /* _h_tc */ diff --git a/bin/tcsh/tc.os.c b/bin/tcsh/tc.os.c new file mode 100644 index 0000000..a4ca2bd --- /dev/null +++ b/bin/tcsh/tc.os.c @@ -0,0 +1,1008 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/tc.os.c,v 3.0 1991/07/05 00:05:11 christos Exp $ */ +/* + * tc.os.c: OS Dependent builtin functions + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#include "config.h" +#if !defined(lint) && !defined(pdp11) +static char *rcsid() + { return "$Id: tc.os.c,v 3.0 1991/07/05 00:05:11 christos Exp $"; } +#endif + +#include "sh.h" +#include "ed.h" +#include "ed.defns.h" /* for the function names */ + +#ifdef titan +int end; +#endif /* titan */ + +/*** + *** MACH + ***/ + +#ifdef MACH +/* dosetpath -- setpath built-in command + * + ********************************************************************** + * HISTORY + * 08-May-88 Richard Draves (rpd) at Carnegie-Mellon University + * Major changes to remove artificial limits on sizes and numbers + * of paths. + * + ********************************************************************** + */ + +#ifdef MACH +static Char STRCPATH[] = {'C', 'P', 'A', 'T', 'H', '\0'}; +static Char STRLPATH[] = {'L', 'P', 'A', 'T', 'H', '\0'}; +static Char STRMPATH[] = {'M', 'P', 'A', 'T', 'H', '\0'}; +static Char STREPATH[] = {'E', 'P', 'A', 'T', 'H', '\0'}; +#endif /* MACH */ + +static Char *syspaths[] = {STRPATH, STRCPATH, STRLPATH, STRMPATH, STREPATH, 0}; +#define LOCALSYSPATH "/usr/cs" + +void +dosetpath(arglist) + Char **arglist; +{ + extern char *getenv(); + + Char **pathvars, **cmdargs; + Char **paths; + char **spaths, **cpaths, **cmds; + char *tcp; + unsigned int npaths, ncmds; + int i, sysflag; + + for (i = 1; arglist[i] && (arglist[i][0] != '-'); i++); + npaths = i - 1; + + cmdargs = &arglist[i]; + for (; arglist[i]; i++); + ncmds = i - npaths - 1; + + if (npaths) { + sysflag = 0; + pathvars = &arglist[1]; + } + else { + sysflag = 1; + npaths = (sizeof syspaths / sizeof *syspaths) - 1; + pathvars = syspaths; + } + + /* note that npaths != 0 */ + + spaths = (char **) xmalloc(npaths * sizeof *spaths); + setzero((char *) spaths, npaths * sizeof *spaths); + paths = (Char **) xmalloc((npaths + 1) * sizeof *paths); + setzero((char *) paths, (npaths + 1) * sizeof *paths); + cpaths = (char **) xmalloc((npaths + 1) * sizeof *cpaths); + setzero((char *) cpaths, (npaths + 1) * sizeof *cpaths); + cmds = (char **) xmalloc((ncmds + 1) * sizeof *cmds); + setzero((char *) cmds, (ncmds + 1) * sizeof *cmds); + for (i = 0; i < npaths; i++) { + char *val = getenv(short2str(pathvars[i])); + + if (val == NULL) + val = ""; + + spaths[i] = xmalloc((Strlen(pathvars[i]) + strlen(val) + + 2) * sizeof **spaths); + (void) strcpy(spaths[i], short2str(pathvars[i])); + (void) strcat(spaths[i], "="); + (void) strcat(spaths[i], val); + cpaths[i] = spaths[i]; + } + + for (i = 0; i < ncmds; i++) { + Char *val = globone(cmdargs[i], G_ERROR); + + if (val == NOSTR) + goto abortpath; + cmds[i] = xmalloc(Strlen(val) + 1); + (void) strcpy(cmds[i], short2str(val)); + } + + if (setpath(cpaths, cmds, LOCALSYSPATH, sysflag, 1) < 0) { +abortpath: + if (spaths) { + for (i = 0; i < npaths; i++) + if (spaths[i]) + xfree((ptr_t) spaths[i]); + xfree((ptr_t) spaths); + } + if (paths) { + for (i = 0; i < npaths; i++) + if (paths[i]) + xfree((ptr_t) paths[i]); + xfree((ptr_t) paths); + } + if (cpaths) + xfree((ptr_t) cpaths); + if (cmds) { + for (i = 0; i < ncmds; i++) + if (cmds[i]) + xfree((ptr_t) cmds[i]); + xfree((ptr_t) cmds); + } + + for (i = 0; i < npaths; i++) { + paths[i] = SAVE(cpaths[i]); + xfree((ptr_t) cpaths[i]); + } + return; + } + + for (i = 0; i < npaths; i++) { + Char *val; + + for (val = paths[i]; val && *val && *val != '='; val++); + if (val && *val == '=') { + *val++ = '\0'; + setenv(paths[i], val); + if (Strcmp(paths[i], STRPATH) == 0) { + importpath(val); + if (havhash) + dohash(); + } + *--val = '='; + } + } +} +#endif /* MACH */ + +/*** + *** AIX + ***/ +#ifdef TCF +/* VARARGS *//* ARGSUSED */ +void +dogetxvers(v) + Char **v; +{ + char xvers[MAXPATHLEN]; + + if (getxvers(xvers, MAXPATHLEN) == -1) + stderror(ERR_SYSTEM, "getxvers", strerror(errno)); + xprintf("%s\n", xvers); + flush(); +} + +void +dosetxvers(v) + Char **v; +{ + char *xvers; + + ++v; + if (!*v || *v[0] == '\0') + xvers = ""; + else + xvers = short2str(*v); + if (setxvers(xvers) == -1) + stderror(ERR_SYSTEM, "setxvers", strerror(errno)); +} + +#include +#ifdef _AIXPS2 +# define XC_PDP11 0x01 +# define XC_23 0x02 +# define XC_Z8K 0x03 +# define XC_8086 0x04 +# define XC_68K 0x05 +# define XC_Z80 0x06 +# define XC_VAX 0x07 +# define XC_16032 0x08 +# define XC_286 0x09 +# define XC_386 0x0a +# define XC_S370 0x0b +#else +# include +#endif /* _AIXPS2 */ + +static struct xc_cpu_t { + short xc_id; + char *xc_name; +} xcpu[] = +{ + { XC_PDP11, "pdp11" }, + { XC_23, "i370" }, + { XC_Z8K, "z8000" }, + { XC_8086, "i86" }, + { XC_68K, "mc68000" }, + { XC_Z80, "x80" }, + { XC_VAX, "vax" }, + { XC_16032, "ns16032" }, + { XC_286, "i286" }, + { XC_386, "i386" }, + { XC_S370, "xa370" }, + { 0, NULL } +}; + +/* + * our local hack table, stolen from x.out.h + */ +static char * +getxcode(xcid) + short xcid; +{ + int i; + + for (i = 0; xcpu[i].xc_name != NULL; i++) + if (xcpu[i].xc_id == xcid) + return (xcpu[i].xc_name); + return (NULL); +} + +static short +getxid(xcname) + char *xcname; +{ + int i; + + for (i = 0; xcpu[i].xc_name != NULL; i++) + if (strcmp(xcpu[i].xc_name, xcname) == 0) + return (xcpu[i].xc_id); + return ((short) -1); +} + + +void +dogetspath(v) + Char **v; +{ + int i, j; + sitepath_t p[MAXSITE]; + struct sf *st; + static char *local = "LOCAL "; + + if ((j = getspath(p, MAXSITE)) == -1) + stderror(ERR_SYSTEM, "getspath", strerror(errno)); + for (i = 0; i < j && (p[i] & SPATH_CPU) != NOSITE; i++) { + if (p[i] & SPATH_CPU) { + if ((p[i] & SPATH_MASK) == NULLSITE) + xprintf(local); + else if ((st = sfxcode((short) (p[i] & SPATH_MASK))) != NULL) + xprintf("%s ", st->sf_ctype); + else { + char *xc = getxcode(p[i] & SPATH_MASK); + + if (xc != NULL) + xprintf("%s ", xc); + else + xprintf("*cpu %d* ", (int) (p[i] & SPATH_MASK)); + /* + * BUG in the aix code... needs that cause if + * sfxcode fails once it fails for ever + */ + endsf(); + } + } + else { + if (p[i] == NULLSITE) + xprintf(local); + else if ((st = sfnum(p[i])) != NULL) + xprintf("%s ", st->sf_sname); + else + xprintf("*site %d* ", (int) (p[i] & SPATH_MASK)); + } + } + xprintf("\n"); + flush(); +} + +void +dosetspath(v) + Char **v; +{ + int i; + short j; + char *s; + sitepath_t p[MAXSITE]; + struct sf *st; + + for (i = 0, v++; *v && *v[0] != '\0'; v++, i++) { + s = short2str(*v); + if (Isdigit(*s)) + p[i] = atoi(s); + else if (strcmp(s, "LOCAL") == 0) + p[i] = NULLSITE; + else if ((st = sfctype(s)) != NULL) + p[i] = SPATH_CPU | st->sf_ccode; + else if ((j = getxid(s)) != -1) + p[i] = SPATH_CPU | j; + else if ((st = sfname(s)) != NULL) + p[i] = st->sf_id; + else { + setname(s); + stderror(ERR_NAME | ERR_STRING, "Bad cpu/site name"); + } + if (i == MAXSITE - 1) + stderror(ERR_NAME | ERR_STRING, "Site path too long"); + } + if (setspath(p, i) == -1) + stderror(ERR_SYSTEM, "setspath", strerror(errno)); +} + +/* sitename(): + * Return the site name where the process is running + */ +char * +sitename(pid) + pid_t pid; +{ + siteno_t ss; + struct sf *st; + + if ((ss = site(pid)) == -1 || (st = sfnum(ss)) == NULL) + return ("unknown"); + else + return (st->sf_sname); +} + +static int +migratepid(pid, new_site) + pid_t pid; + siteno_t new_site; +{ + struct sf *st; + int need_local; + + need_local = (pid == 0) || (pid == getpid()); + + if (kill3((pid_t) pid, SIGMIGRATE, new_site) < 0) { + xprintf("%d: %s\n", pid, strerror(errno)); + return (-1); + } + + if (need_local) { + if ((new_site = site(0)) == -1) { + xprintf("site: %s\n", strerror(errno)); + return (-1); + } + if ((st = sfnum(new_site)) == NULL) { + xprintf("%d: Site not found\n", new_site); + return (-1); + } + if (setlocal(st->sf_local, strlen(st->sf_local)) == -1) { + xprintf("setlocal: %s: %s\n", st->sf_local, strerror(errno)); + return (-1); + } + } + return (0); +} + +void +domigrate(v) + Char **v; +{ + struct sf *st; + char *s; + Char *cp; + struct process *pp; + int pid, err1 = 0; + siteno_t new_site = 0; + sigmask_t omask; + +#ifdef BSDSIGS + omask = sigmask(SIGCHLD); + if (setintr) + omask |= sigmask(SIGINT); + omask = sigblock(omask) & ~omask; +#else + if (setintr) + (void) sighold(SIGINT); + (void) sighold(SIGCHLD); +#endif /* BSDSIGS */ + + ++v; + if (*v[0] == '-') { + /* + * Do the -site. + */ + s = short2str(&v[0][1]); + if ((st = sfname(s)) == NULL) { + setname(s); + stderror(ERR_NAME | ERR_STRING, "Site not found"); + } + new_site = st->sf_id; + ++v; + } + + if (!*v || *v[0] == '\0') { + if (migratepid(0, new_site) == -1) + err1++; + } + else { + gflag = 0, tglob(v); + if (gflag) { + v = globall(v); + if (v == 0) + stderror(ERR_NAME | ERR_NOMATCH); + } + else { + v = gargv = saveblk(v); + trim(v); + } + + while (v && (cp = *v)) { + if (*cp == '%') { + pp = pfind(cp); + if (kill3((pid_t) - pp->p_jobid, SIGMIGRATE, new_site) < 0) { + xprintf("%s: %s\n", short2str(cp), strerror(errno)); + err1++; + } + } + else if (!(Isdigit(*cp) || *cp == '-')) + stderror(ERR_NAME | ERR_JOBARGS); + else { + pid = atoi(short2str(cp)); + if (migratepid(pid, new_site) == -1) + err1++; + } + v++; + } + if (gargv) + blkfree(gargv), gargv = 0; + } + +done: +#ifdef BSDSIGS + (void) sigsetmask(omask); +#else + (void) sigrelse(SIGCHLD); + if (setintr) + (void) sigrelse(SIGINT); +#endif /* BSDSIGS */ + if (err1) + stderror(ERR_SILENT); +} + +#endif /* TCF */ + +/*** + *** CONVEX Warps. + ***/ + +#ifdef WARP +/* + * handle the funky warping of symlinks + */ +#include +#include + +static jmp_buf sigsys_buf; + +static sigret_t +catch_sigsys() +{ + longjmp(sigsys_buf, 1); +} + + +void +dowarp(v) + Char **v; +{ + int warp, oldwarp; + struct warpent *we; + void (*old_sigsys_handler) () = 0; + char *newwarp; + + if (setjmp(sigsys_buf)) { + signal(SIGSYS, old_sigsys_handler); + stderror(ERR_NAME | ERR_STRING, + "You're trapped in a universe you never made"); + return; + } + old_sigsys_handler = signal(SIGSYS, catch_sigsys); + + warp = getwarp(); + + v++; + if (*v == 0) { /* display warp value */ + if (warp < 0) + stderror(ERR_NAME | ERR_STRING, "Getwarp failed"); + we = getwarpbyvalue(warp); + if (we) + printf("%s\n", we->w_name); + else + printf("%d\n", warp); + } + else { /* set warp value */ + oldwarp = warp; + newwarp = short2str(*v); + if (Isdigit(*v[0])) + warp = atoi(newwarp); + else { + we = getwarpbyname(newwarp); + if (we) + warp = we->w_value; + else + warp = -1; + } + if ((warp < 0) || (warp >= WARP_MAXLINK)) + stderror(ERR_NAME | ERR_STRING, "Invalid warp"); + if ((setwarp(warp) < 0) || (getwarp() != warp)) { + (void) setwarp(oldwarp); + stderror(ERR_NAME | ERR_STRING, "Setwarp failed"); + } + } + signal(SIGSYS, old_sigsys_handler); + return; +} +#endif /* WARP */ + +/*** + *** Masscomp + ***/ +/* Added, DAS DEC-90. */ +#ifdef masscomp +void +douniverse(v) + register Char **v; +{ + register Char *cp = v[1]; + char ubuf[100]; + + if (cp == 0) { + (void) getuniverse(ubuf); + xprintf("%s\n", ubuf); + } + else if (*cp == '\0' || setuniverse(short2str(cp)) != 0) + stderror(ERR_NAME | ERR_STRING, "Illegal universe"); +} +#endif /* masscomp */ + + +#ifdef _SEQUENT_ +/* + * Compute the difference in process stats. + */ +void +pr_stat_sub(p2, p1, pr) + struct pro_stats *p2, *p1, *pr; +{ + pr->ps_utime.tv_sec = p2->ps_utime.tv_sec - p1->ps_utime.tv_sec; + pr->ps_utime.tv_usec = p2->ps_utime.tv_usec - p1->ps_utime.tv_usec; + if (pr->ps_utime.tv_usec < 0) { + pr->ps_utime.tv_sec -= 1; + pr->ps_utime.tv_usec += 1000000; + } + pr->ps_stime.tv_sec = p2->ps_stime.tv_sec - p1->ps_stime.tv_sec; + pr->ps_stime.tv_usec = p2->ps_stime.tv_usec - p1->ps_stime.tv_usec; + if (pr->ps_stime.tv_usec < 0) { + pr->ps_stime.tv_sec -= 1; + pr->ps_stime.tv_usec += 1000000; + } + + pr->ps_maxrss = p2->ps_maxrss - p1->ps_maxrss; + pr->ps_pagein = p2->ps_pagein - p1->ps_pagein; + pr->ps_reclaim = p2->ps_reclaim - p1->ps_reclaim; + pr->ps_zerofill = p2->ps_zerofill - p1->ps_zerofill; + pr->ps_pffincr = p2->ps_pffincr - p1->ps_pffincr; + pr->ps_pffdecr = p2->ps_pffdecr - p1->ps_pffdecr; + pr->ps_swap = p2->ps_swap - p1->ps_swap; + pr->ps_syscall = p2->ps_syscall - p1->ps_syscall; + pr->ps_volcsw = p2->ps_volcsw - p1->ps_volcsw; + pr->ps_involcsw = p2->ps_involcsw - p1->ps_involcsw; + pr->ps_signal = p2->ps_signal - p1->ps_signal; + pr->ps_lread = p2->ps_lread - p1->ps_lread; + pr->ps_lwrite = p2->ps_lwrite - p1->ps_lwrite; + pr->ps_bread = p2->ps_bread - p1->ps_bread; + pr->ps_bwrite = p2->ps_bwrite - p1->ps_bwrite; + pr->ps_phread = p2->ps_phread - p1->ps_phread; + pr->ps_phwrite = p2->ps_phwrite - p1->ps_phwrite; +} + +#endif /* _SEQUENT_ */ + + +#ifdef NEEDtcgetpgrp +int +xtcgetpgrp(fd) + int fd; +{ + int pgrp; + + /* ioctl will handle setting errno correctly. */ + if (ioctl(fd, TIOCGPGRP, (ioctl_t) & pgrp) < 0) + return (-1); + return (pgrp); +} + +#endif /* tcgetpgrp */ + + +#ifdef YPBUGS +void +fix_yp_bugs() +{ + char *mydomain; + + /* + * PWP: The previous version assumed that yp domain was the same as the + * internet name domain. This isn't allways true. (Thanks to Mat Landau + * for the original version of this.) + */ + if (yp_get_default_domain(&mydomain) == 0) { /* if we got a name */ + extern void yp_unbind(); + + yp_unbind(mydomain); + } +} + +#endif /* YPBUGS */ + + +void +osinit() +{ + extern ptr_t membot; + + membot = (char *) sbrk(0); + +#ifdef OREO + set42sig(); + sigignore(SIGIO); /* ignore SIGIO */ +#endif /* OREO */ + +#ifdef aiws + struct sigstack inst; + + inst.ss_sp = xmalloc(4192) + 4192; + inst.ss_onstack = 0; + sigstack(&inst, NULL); +#endif /* aiws */ + +#ifdef hpux + (void) sigspace(4192); +#endif /* hpux */ +#ifdef titan + end = sbrk(0); +#endif /* titan */ + +#ifdef apollo + (void) isapad(); +#endif +} + +#ifdef NEEDgethostname +#include + +int +xgethostname(name, namlen) + char *name; + int namlen; +{ + int i, retval; + struct utsname uts; + + retval = uname(&uts); + +#ifdef DEBUG + xprintf("sysname: %s\n", uts.sysname); + xprintf("nodename: %s\n", uts.nodename); + xprintf("release: %s\n", uts.release); + xprintf("version: %s\n", uts.version); + xprintf("machine: %s\n", uts.machine); +#endif /* DEBUG */ + i = strlen(uts.nodename) + 1; + (void) strncpy(name, uts.nodename, i < namlen ? i : namlen); + + return retval; +} /* end gethostname */ + +#endif /* gethostname */ + + +#ifdef NEEDgetwd +static char *strrcpy __P((char *, char *)); + +/* xgetwd(): + * Return the pathname of the current directory, or return + * an error message in pathname. + */ +char * +xgetwd(pathname) + char *pathname; +{ + DIR *dp; + struct dirent *d; + + struct stat st_root, st_cur, st_next, st_dot; + char pathbuf[MAXPATHLEN], next_path_buf[MAXPATHLEN * 2]; + char *cur_name_add; + char *pathptr, *nextpathptr; + + /* find the inode of root */ + if (stat("/", &st_root) == -1) { + (void) xsprintf(pathname, + "getwd: Cannot stat \"/\" (%s)", strerror(errno)); + return (NULL); + } + pathbuf[MAXPATHLEN - 1] = '\0'; + pathptr = &pathbuf[MAXPATHLEN - 1]; + next_path_buf[MAXPATHLEN - 1] = '\0'; + cur_name_add = nextpathptr = &next_path_buf[MAXPATHLEN - 1]; + + /* find the inode of the current directory */ + if (lstat("./", &st_cur) == -1) { + (void) xsprintf(pathname, + "getwd: Cannot stat \".\" (%s)", strerror(errno)); + return (NULL); + } + nextpathptr = strrcpy(nextpathptr, "../"); + + /* Descend to root */ + for (;;) { + + /* look if we found root yet */ + if (st_cur.st_ino == st_root.st_ino && + st_cur.st_dev == st_root.st_dev) { + if (*pathptr != '/') + return ("/"); + (void) strcpy(pathname, pathptr); + return (pathname); + } + + /* open the parent directory */ + if ((dp = opendir(nextpathptr)) == NULL) { + (void) xsprintf(pathname, + "getwd: Cannot open directory \"%s\" (%s)", + nextpathptr, strerror(errno)); + return (NULL); + } + + /* look in the parent for the entry with the same inode */ + for (d = readdir(dp); d != NULL; d = readdir(dp)) { + (void) strcpy(cur_name_add, d->d_name); + if (lstat(nextpathptr, &st_next) == -1) { + (void) xsprintf(pathname, "getwd: Cannot stat \"%s\" (%s)", + d->d_name, strerror(errno)); + return (NULL); + } + if (d->d_name[0] == '.' && d->d_name[1] == '\0') + st_dot = st_next; + + /* check if we found it yet */ + if (st_next.st_ino == st_cur.st_ino && + st_next.st_dev == st_cur.st_dev) { + st_cur = st_dot; + pathptr = strrcpy(pathptr, d->d_name); + pathptr = strrcpy(pathptr, "/"); + nextpathptr = strrcpy(nextpathptr, "../"); + *cur_name_add = '\0'; + (void) closedir(dp); + break; + } + } + if (d == NULL) { + (void) xsprintf(pathname, "getwd: Cannot find \".\" in \"..\""); + return (NULL); + } + } +} /* end getwd */ + +/* strrcpy(): + * Like strcpy, going backwards and returning the new pointer + */ +static char * +strrcpy(ptr, str) + register char *ptr, *str; +{ + register int len = strlen(str); + + while (len) + *--ptr = str[--len]; + + return (ptr); +} /* end strrcpy */ + +#endif /* getwd */ +#ifdef iconuxv +#include +#include + +int +vfork() +{ + return sys_local(VEND_ICON_BSD, 66); +} + +#endif /* iconuxv */ + +#ifdef apollo +/*** + *** Domain/OS + ***/ +#undef value /* XXX: Careful here */ +#include +#include +#include + + +static char * +apperr(st) + status_$t *st; +{ + static char buf[BUFSIZ]; + short e_subl, e_modl, e_codel; + error_$string_t e_sub, e_mod, e_code; + + error_$get_text(*st, e_sub, &e_subl, e_mod, &e_modl, e_code, &e_codel); + e_sub[e_subl] = '\0'; + e_code[e_codel] = '\0'; + e_mod[e_modl] = '\0'; + (void) xsprintf(buf, "%s (%s/%s)", e_code, e_sub, e_mod); + + return(buf); +} + +static int +llib(s) + Char *s; +{ + short len = Strlen(s); + status_$t st; + char *t; + + loader_$inlib(t = short2str(s), len, &st); + if (st.all != status_$ok) + stderror(ERR_SYSTEM, t, apperr(&st)); +} + +void +doinlib(v) + Char **v; +{ + setname(short2str(*v++)); + gflag = 0, tglob(v); + if (gflag) { + v = globall(v); + if (v == 0) + stderror(ERR_NAME | ERR_NOMATCH); + } + else { + v = gargv = saveblk(v); + trim(v); + } + + while (v && *v) + llib(*v++); + if (gargv) + blkfree(gargv), gargv = 0; +} + +int +getv(v) + Char *v; +{ + if (eq(v, STRbsd43)) + return(1); + else if (eq(v, STRsys53)) + return(0); + else + stderror(ERR_NAME | ERR_SYSTEM, short2str(v), "Invalid system type"); + /*NOTREACHED*/ + return(0); +} + +void +dover(v) + Char **v; +{ + Char *p; + + setname(short2str(*v++)); + if (!*v) { + if (!(p = Getenv(STRSYSTYPE))) + stderror(ERR_NAME | ERR_STRING, "System type is not set"); + xprintf("%s\n", short2str(p)); + } + else { + Setenv(STRSYSTYPE, getv(*v) ? STRbsd43 : STRsys53); + dohash(); + } +} + +/* + * Many thanks to rees@citi.umich.edu (Jim Rees) and + * mathys@ssdt-tempe.sps.mot.com (Yves Mathys) + * For figuring out how to do this... I could have never done + * it without their help. + */ +typedef short enum { + name_$wdir_type, + name_$ndir_type, + name_$node_dir_type, +} name_$dir_type_t; + +void +dorootnode(v) + Char **v; +{ + name_$dir_type_t dirtype = name_$node_dir_type; + uid_$t uid; + status_$t st; + char *name; + short namelen; + + setname(short2str(*v++)); + + name = short2str(*v); + namelen = strlen(name); + + name_$resolve(name, &namelen, &uid, &st); + if (st.all != status_$ok) + stderror(ERR_SYSTEM, name, apperr(&st)); + namelen = 0; + name_$set_diru(&uid, "", &namelen, &dirtype, &st); + if (st.all != status_$ok) + stderror(ERR_SYSTEM, name, apperr(&st)); + dohash(); +} + +int +isapad() +{ + static int res = -1; + static status_$t st; + + if (res == -1) { + int strm; + if (isatty(0)) + strm = 0; + if (isatty(1)) + strm = 1; + if (isatty(2)) + strm = 2; + else { + res = 0; + st.all = status_$ok; + return(res); + } + res = stream_$isavt(&strm, &st); + res = res ? 1 : 0; + } + else { + if (st.all != status_$ok) + stderror(ERR_SYSTEM, "stream_$isavt", apperr(&st)); + } + return(res); +} +#endif diff --git a/bin/tcsh/tc.os.h b/bin/tcsh/tc.os.h new file mode 100644 index 0000000..6f96178 --- /dev/null +++ b/bin/tcsh/tc.os.h @@ -0,0 +1,406 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/tc.os.h,v 3.1 1991/07/05 19:07:33 christos Exp $ */ +/* + * tc.os.h: Shell os dependent defines + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#ifndef _h_tc_os +#define _h_tc_os + +#ifdef OREO +#include +#include +#endif /* OREO */ + +#ifdef titan +extern int end; +#endif /* titan */ + +#ifdef hpux +# ifdef lint +/* + * Hpux defines struct ucred, in , but if I include that + * then I need to include the *world* + * [all this to pass lint cleanly!!!] + * so I define struct ucred here... + */ +struct ucred { + int foo; +}; +# endif /* lint */ + +/* + * hpux 7.0 does not define it + */ +# ifndef CSUSP +# define CSUSP 032 +# endif /* CSUSP */ + +# include + +# ifndef POSIX +# ifdef BSDJOBS +# define getpgrp(a) getpgrp2(a) +# define setpgrp(a, b) setpgrp2(a, b) +# endif /* BSDJOBS */ +# endif /* POSIX */ +#endif /* hpux */ + +#ifdef HYPERCUBE +/* + * for struct winsiz + */ +# include +# include +# define NEEDgethostname +#endif /* HYPERCUBE */ + +#ifdef IRIS4D +# include +# include +/* + * BSDsetpgrp() and BSDgetpgrp() are BSD versions of setpgrp, etc. + */ +# define setpgrp BSDsetpgrp +# define getpgrp BSDgetpgrp +#endif /* IRIS4D */ + +/* + * Stat + */ +#ifdef ISC +/* these are not defined for _POSIX_SOURCE under ISC 2.2 */ +# ifndef S_IFMT +# 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_IFIFO 0010000 /* fifo */ +# define S_IFNAM 0050000 /* special named file */ +# endif /* S_IFMT */ +#endif /* ISC */ + +#ifdef S_IFMT +# if !defined(S_ISDIR) && defined(S_IFDIR) +# define S_ISDIR(a) (((a) & S_IFMT) == S_IFDIR) +# endif /* ! S_ISDIR && S_IFDIR */ +# if !defined(S_ISCHR) && defined(S_IFCHR) +# define S_ISCHR(a) (((a) & S_IFMT) == S_IFCHR) +# endif /* ! S_ISCHR && S_IFCHR */ +# if !defined(S_ISBLK) && defined(S_IFBLK) +# define S_ISBLK(a) (((a) & S_IFMT) == S_IFBLK) +# endif /* ! S_ISBLK && S_IFBLK */ +# if !defined(S_ISREG) && defined(S_IFREG) +# define S_ISREG(a) (((a) & S_IFMT) == S_IFREG) +# endif /* ! S_ISREG && S_IFREG */ +# if !defined(S_ISFIFO) && defined(S_IFIFO) +# define S_ISFIFO(a) (((a) & S_IFMT) == S_IFIFO) +# endif /* ! S_ISFIFO && S_IFIFO */ +# if !defined(S_ISNAM) && defined(S_IFNAM) +# define S_ISNAM(a) (((a) & S_IFMT) == S_IFNAM) +# endif /* ! S_ISNAM && S_IFNAM */ +# if !defined(S_ISNAM) && defined(S_IFNAM) +# define S_ISNAM(a) (((a) & S_IFMT) == S_IFNAM) +# endif /* ! S_ISNAM && S_IFNAM */ +# if !defined(S_ISLNK) && defined(S_IFLNK) +# define S_ISLNK(a) (((a) & S_IFMT) == S_IFLNK) +# endif /* ! S_ISLNK && S_IFLNK */ +# if !defined(S_ISSOCK) && defined(S_IFSOCK) +# define S_ISSOCK(a) (((a) & S_IFMT) == S_IFSOCK) +# endif /* ! S_ISSOCK && S_IFSOCK */ +#endif /* S_IFMT */ + +#ifndef S_IEXEC +# define S_IEXEC 0000100 +#endif /* S_IEXEC */ +#ifndef S_IXOTH +# define S_IXOTH (S_IEXEC >> 6) +#endif /* S_IXOTH */ +#ifndef S_IXGRP +# define S_IXGRP (S_IEXEC >> 3) +#endif /* S_IXGRP */ +#ifndef S_IXUSR +# define S_IXUSR S_IEXEC +#endif /* S_IXUSR */ + +/* + * Access() + */ +#ifndef F_OK +# define F_OK 0 +#endif /* F_OK */ +#ifndef X_OK +# define X_OK 1 +#endif /* X_OK */ +#ifndef W_OK +# define W_OK 2 +#endif /* W_OK */ +#ifndef R_OK +# define R_OK 4 +#endif /* R_OK */ + +/* + * Open() + */ +#ifndef O_RDONLY +# define O_RDONLY 0 +#endif /* O_RDONLY */ +#ifndef O_WRONLY +# define O_WRONLY 1 +#endif /* O_WRONLY */ +#ifndef O_RDWR +# define O_RDWR 2 +#endif /* O_RDWR */ + +/* + * Lseek() + */ +#ifndef L_SET +# ifdef SEEK_SET +# define L_SET SEEK_SET +# else +# define L_SET 0 +# endif /* SEEK_SET */ +#endif /* L_SET */ +#ifndef L_INCR +# ifdef SEEK_CUR +# define L_INCR SEEK_CUR +# else +# define L_INCR 1 +# endif /* SEEK_CUR */ +#endif /* L_INCR */ +#ifndef L_XTND +# ifdef SEEK_END +# define L_XTND SEEK_END +# else +# define L_XTND 2 +# endif /* SEEK_END */ +#endif /* L_XTND */ + +#ifdef _SEQUENT_ +# define NEEDgethostname +#endif /* _SEQUENT_ */ + +#if defined(BSD) && defined(POSIXJOBS) +# define setpgid(pid, pgrp) setpgrp(pid, pgrp) +#endif /* BSD && POSIXJOBS */ + +#if defined(BSDJOBS) && !(defined(POSIX) && defined(POSIXJOBS)) +# if !defined(_AIX370) && !defined(_AIXPS2) +# define setpgid(pid, pgrp) setpgrp(pid, pgrp) +# endif /* !_AIX370 && !_AIXPS2 */ +# define tcsetpgrp(fd, pgrp) ioctl((fd), TIOCSPGRP, (ioctl_t) &(pgrp)) +# define NEEDtcgetpgrp +#endif /* BSDJOBS && !(POSIX && POSIXJOBS) */ + +#ifdef RENO +/* + * Older versions of RENO had this broken. It is fixed now. + * In any case, we use ours... + */ +# define tcsetpgrp(fd, pgrp) ioctl((fd), TIOCSPGRP, (ioctl_t) &(pgrp)) +# define NEEDtcgetpgrp +#endif /* RENO */ + +#ifdef DGUX +# define setpgrp(a, b) setpgrp2(a, b) +# define getpgrp(a) getpgrp2(a) +#endif /* DGUX */ + +#ifdef SXA +# ifndef BSDNICE +/* + * We check BSDNICE cause this is not defined in config.sxa. + * Only needed in the system V environment. + */ +# define setrlimit(a, b) b_setrlimit(a, b) +# define getrlimit(a, b) b_getrlimit(a, b) +# endif /* BSDNICE */ +# ifndef NOFILE +# define NOFILE 64 +# endif /* NOFILE */ +#endif /* SXA */ + +#ifndef POSIX +# define mygetpgrp() getpgrp(0) +#else /* POSIX */ +# if defined(BSD) || defined(sun) +# define mygetpgrp() getpgrp(0) +# else /* BSD || sun */ +# define mygetpgrp() getpgrp() +# endif /* BSD || sun */ +#endif /* POSIX */ + + +#if SVID > 0 && !defined(OREO) && !defined(IRIS4D) +# define NEEDgetwd +#endif /* SVID > 0 && !OREO && !IRIS4D */ + +#ifndef S_IFLNK +# define lstat stat +#endif /* S_IFLNK */ + + +#if defined(BSDTIMES) && !defined(_SEQUENT_) +typedef struct timeval tmval_t; +#endif /* BSDTIMES && ! _SEQUENT_ */ + +#ifdef NeXT +/* + * From Tony_Mason@transarc.com, override NeXT's malloc stuff. + */ +# define malloc tcsh_malloc +# define calloc tcsh_calloc +# define realloc tcsh_realloc +# define free tcsh_free +#endif /* NeXT */ + + +#if !defined(POSIX) || defined(sun) +extern time_t time(); +extern char *getenv(); +extern int atoi(); +extern char *ttyname(); + +# ifndef hpux +extern int abort(); +extern int qsort(); +# else +extern void abort(); +extern void qsort(); +# endif +extern void perror(); + +# ifndef NEEDgethostname +extern int gethostname(); +# endif + +# ifdef pdp11 +# ifdef BUFSIZ +# undef BUFSIZ +# endif +# define BUFSIZ 512 +# endif + +# ifdef BSDSIGS +# if defined(_AIX370) || defined(MACH) || defined(NeXT) || defined(_AIXPS2) +extern int sigvec(); +extern int sigpause(); +# else /* _AIX370 || MACH || NeXT || _AIXPS2 */ +extern sigret_t sigvec(); +extern void sigpause(); +# endif /* _AIX370 || MACH || NeXT || _AIXPS2 */ +# ifndef pdp11 +extern sigmask_t sigblock(); +extern sigmask_t sigsetmask(); +# else +/* #define sigmask_t sigm_t in compat.h to avoid 7-char conflict with sigmask */ +extern sigmask_t sigblock(); +extern sigmask_t sigsetmask(); +# endif /* pdp11 */ +# endif /* BSDSIGS */ + +# ifndef killpg +extern int killpg(); +# endif /* killpg */ + +# ifndef lstat +extern int lstat(); +# endif /* lstat */ + +# ifdef SYSMALLOC +extern memalign_t malloc(); +extern memalign_t realloc(); +extern memalign_t calloc(); +extern void free(); +# endif /* SYSMALLOC */ + +# ifdef BSDTIMES +extern int getrlimit(); +extern int setrlimit(); +extern int getrusage(); +extern int gettimeofday(); +# endif /* BSDTIMES */ + +# if defined(NLS) && !defined(NOSTRCOLL) && !defined(NeXT) +extern int strcoll(); +# endif + +# ifdef BSDJOBS +# ifdef BSDTIMES +extern int wait3(); +# else /* ! BSDTIMES */ +# if !defined(POSIXJOBS) && !defined(_SEQUENT_) +extern int wait3(); +# else /* POSIXJOBS || _SEQUENT_ */ +extern int waitpid(); +# endif /* POSIXJOBS || _SEQUENT_ */ +# endif /* ! BSDTIMES */ +# else /* !BSDJOBS */ +# if SVID < 3 +extern int ourwait(); +# else /* SVID >= 3 */ +extern int wait(); +# endif /* SVID >= 3 */ +# endif /* ! BSDJOBS */ + +# ifdef BSDNICE +extern int setpriority(); +# else /* !BSDNICE */ +extern int nice(); +# endif /* !BSDNICE */ + +#ifdef pdp11 +extern int setpwent(); +#else +extern void setpwent(); +#endif +extern void endpwent(); +extern struct passwd *getpwuid(), *getpwnam(), *getpwent(); + +# ifndef getwd +extern char *getwd(); +# endif /* getwd */ +#else /* POSIX */ + +# if defined(sun) && !defined(__GNUC__) +extern char *getwd(); +# endif /* sun && ! __GNUC__ */ + +# ifdef RENO +extern void perror(); /* Reno declares that in stdio.h :-( */ +# endif /* RENO */ +#endif /* POSIX */ + +#endif /* _h_tc_os */ diff --git a/bin/tcsh/tc.printf.c b/bin/tcsh/tc.printf.c new file mode 100644 index 0000000..13cc078 --- /dev/null +++ b/bin/tcsh/tc.printf.c @@ -0,0 +1,318 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/tc.printf.c,v 3.0 1991/07/04 21:49:28 christos Exp $ */ +/* + * tc.printf.c: A public-domain, minimal printf/sprintf routine that prints + * through the putchar() routine. Feel free to use for + * anything... -- 7/17/87 Paul Placeway + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#include "config.h" +#if !defined(lint) && !defined(pdp11) +static char *rcsid() + { return "$Id: tc.printf.c,v 3.0 1991/07/04 21:49:28 christos Exp $"; } +#endif + +#include "sh.h" + +#ifdef lint +#undef va_arg +#define va_arg(a, b) (a ? (b) 0 : (b) 0) +#endif + +#define INF 32766 /* should be bigger than any field to print */ + +static unsigned char buf[128]; + +static void xaddchar __P((int)); +static void doprnt __P((void (*) __P((int)), char *, va_list)); + +static void +doprnt(addchar, sfmt, ap) + void (*addchar)(); + char *sfmt; + va_list ap; +{ + register unsigned char *f, *bp; + register long l; + register u_long u; + register int i; + register int fmt; + register unsigned char pad = ' '; + int flush_left = 0, f_width = 0, prec = INF, hash = 0, do_long = 0; + int sign = 0; + int attributes = 0; + + + f = (unsigned char *) sfmt; + for (; *f; f++) { + if (*f != '%') { /* then just out the char */ + (*addchar) ((int) (*f | attributes)); + } + else { + f++; /* skip the % */ + + if (*f == '-') { /* minus: flush left */ + flush_left = 1; + f++; + } + + if (*f == '0' || *f == '.') { + /* padding with 0 rather than blank */ + pad = '0'; + f++; + } + if (*f == '*') { /* field width */ + f_width = va_arg(ap, int); + f++; + } + else if (Isdigit(*f)) { + f_width = atoi((char *) f); + while (Isdigit(*f)) + f++; /* skip the digits */ + } + + if (*f == '.') { /* precision */ + f++; + if (*f == '*') { + prec = va_arg(ap, int); + f++; + } + else if (Isdigit(*f)) { + prec = atoi((char *) f); + while (Isdigit(*f)) + f++; /* skip the digits */ + } + } + + if (*f == '#') { /* alternate form */ + hash = 1; + f++; + } + + if (*f == 'l') { /* long format */ + do_long = 1; + f++; + } + + fmt = *f; + if (Isupper(fmt)) { + do_long = 1; + fmt = Tolower(fmt); + } + bp = buf; + switch (fmt) { /* do the format */ + case 'd': + if (do_long) + l = va_arg(ap, long); + else + l = (long) (va_arg(ap, int)); + if (l < 0) { + sign = 1; + l = -l; + } + do { + *bp++ = l % 10 + '0'; + } while ((l /= 10) > 0); + if (sign) + *bp++ = '-'; + f_width = f_width - (bp - buf); + if (!flush_left) + while (f_width-- > 0) + (*addchar) ((int) (pad | attributes)); + for (bp--; bp >= buf; bp--) + (*addchar) ((int) (*bp | attributes)); + if (flush_left) + while (f_width-- > 0) + (*addchar) ((int) (' ' | attributes)); + break; + + case 'o': + case 'x': + case 'u': + if (do_long) + u = va_arg(ap, u_long); + else + u = (u_long) (va_arg(ap, unsigned)); + if (fmt == 'u') { /* unsigned decimal */ + do { + *bp++ = u % 10 + '0'; + } while ((u /= 10) > 0); + } + else if (fmt == 'o') { /* octal */ + do { + *bp++ = u % 8 + '0'; + } while ((u /= 8) > 0); + if (hash) + *bp++ = '0'; + } + else if (fmt == 'x') { /* hex */ + do { + i = u % 16; + if (i < 10) + *bp++ = i + '0'; + else + *bp++ = i - 10 + 'a'; + } while ((u /= 16) > 0); + if (hash) { + *bp++ = 'x'; + *bp++ = '0'; + } + } + i = f_width - (bp - buf); + if (!flush_left) + while (i-- > 0) + (*addchar) ((int) (pad | attributes)); + for (bp--; bp >= buf; bp--) + (*addchar) ((int) (*bp | attributes)); + if (flush_left) + while (i-- > 0) + (*addchar) ((int) (' ' | attributes)); + break; + + + case 'c': + i = va_arg(ap, int); + (*addchar) ((int) (i | attributes)); + break; + + case 's': + bp = va_arg(ap, unsigned char *); + if (!bp) + bp = (unsigned char *) "(nil)"; + f_width = f_width - strlen((char *) bp); + if (!flush_left) + while (f_width-- > 0) + (*addchar) ((int) (pad | attributes)); + for (i = 0; *bp && i < prec; i++) { + (*addchar) ((int) (*bp | attributes)); + bp++; + } + if (flush_left) + while (f_width-- > 0) + (*addchar) ((int) (' ' | attributes)); + + break; + + case 'a': + attributes = va_arg(ap, int); + break; + + case '%': + (*addchar) ((int) ('%' | attributes)); + break; + } + flush_left = 0, f_width = 0, prec = INF, hash = 0, do_long = 0; + sign = 0; + pad = ' '; + } + } +} + + +static unsigned char *xstring; +static void +xaddchar(c) + int c; +{ + *xstring++ = c; +} + + +void +/*VARARGS*/ +#if __STDC__ +xsprintf(char *str, char *fmt, ...) +#else +xsprintf(va_alist) + va_dcl +#endif +{ + va_list va; +#if __STDC__ + va_start(va, fmt); +#else + char *str, *fmt; + + va_start(va); + str = va_arg(va, char *); + fmt = va_arg(va, char *); +#endif + + xstring = (unsigned char *) str; + doprnt(xaddchar, fmt, va); + va_end(va); + *xstring++ = '\0'; +} + + +void +/*VARARGS*/ +#if __STDC__ +xprintf(char *fmt, ...) +#else +xprintf(va_alist) + va_dcl +#endif +{ + va_list va; +#if __STDC__ + va_start(va, fmt); +#else + char *fmt; + + va_start(va); + fmt = va_arg(va, char *); +#endif + doprnt(xputchar, fmt, va); + va_end(va); +} + + +void +xvprintf(fmt, va) + char *fmt; + va_list va; +{ + doprnt(xputchar, fmt, va); +} + +void +xvsprintf(str, fmt, va) + char *str; + char *fmt; + va_list va; +{ + xstring = (unsigned char *) str; + doprnt(xaddchar, fmt, va); + *xstring++ = '\0'; +} diff --git a/bin/tcsh/tc.prompt.c b/bin/tcsh/tc.prompt.c new file mode 100644 index 0000000..2cc09c4 --- /dev/null +++ b/bin/tcsh/tc.prompt.c @@ -0,0 +1,401 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/tc.prompt.c,v 3.0 1991/07/04 21:49:28 christos Exp $ */ +/* + * tc.prompt.c: Prompt printing stuff + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#include "config.h" +#if !defined(lint) && !defined(pdp11) +static char *rcsid() + { return "$Id: tc.prompt.c,v 3.0 1991/07/04 21:49:28 christos Exp $"; } +#endif + +#include "sh.h" +#include "ed.h" +/* + * kfk 21oct1983 -- add @ (time) and / ($cwd) in prompt. + * PWP 4/27/87 -- rearange for tcsh. + * mrdch@com.tau.edu.il 6/26/89 - added ~, T and .# - rearanged to switch() + * instead of if/elseif + */ + +char *month_list[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", + "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; +void +printprompt(promptno, str) + int promptno; + Char *str; +{ + Char *p, *z, *q; + register Char attributes = 0; + static int print_prompt_did_ding = 0; + register char *cz; + struct tm *t; + long lclock; + Char buff[BUFSIZ]; + Char *cp; + + (void) time(&lclock); + t = localtime(&lclock); + + PromptBuf[0] = '\0'; + p = PromptBuf; + switch (promptno) { + default: + case 0: + cp = value(STRprompt); + break; + case 1: + cp = value(STRp_2); + break; + case 2: + cp = value(STRp_3); + break; + } + + for (; *cp; cp++) { + if (*cp == '%') { + cp++; + switch (*cp) { + case 'R': + if (str != NULL) + while (*str) + *p++ = attributes | *str++; + break; + case '#': + *p++ = attributes | ((uid == 0) ? '#' : '>'); + break; + case '!': + case 'h': + Itoa(eventno + 1, buff); + for (z = buff; *z; z++) + *p++ = attributes | *z; + break; + case 'T': /* 24 hour format */ + case '@': + case 't': /* 12 hour am/pm format */ + { + char ampm = 'a'; + int hr = t->tm_hour; + + /* addition by Hans J. Albertsson */ + /* and another adapted from Justin Bur */ + if (adrof(STRampm) || *cp != 'T') { + if (hr >= 12) { + if (hr > 12) + hr -= 12; + ampm = 'p'; + } + else if (hr == 0) + hr = 12; + } /* else do a 24 hour clock */ + + /* "DING!" stuff by Hans also */ + if (t->tm_min || print_prompt_did_ding + /* || !adrof(STRprompt_ding) */ ) { + if (t->tm_min) + print_prompt_did_ding = 0; + Itoa(hr, buff); + *p++ = attributes | buff[0]; + if (buff[1]) + *p++ = attributes | buff[1]; + *p++ = attributes | ':'; + Itoa(t->tm_min, buff); + if (buff[1]) { + *p++ = attributes | buff[0]; + *p++ = attributes | buff[1]; + } + else { + *p++ = attributes | '0'; + *p++ = attributes | buff[0]; + } + if (adrof(STRampm) || *cp != 'T') { + *p++ = attributes | ampm; + *p++ = attributes | 'm'; + } + } + else { /* we need to ding */ + int i = 0; + + (void) Strcpy(buff, STRDING); + while (buff[i]) { + *p++ = attributes | buff[i++]; + } + print_prompt_did_ding = 1; + } + } + break; + + case 'M': + /* + * Bug pointed out by Laurent Dami : don't + * derefrence that NULL (if HOST is not set)... + */ + if ((cz = getenv("HOST")) != NULL) + while (*cz) + *p++ = attributes | *cz++; + break; + + case 'm': + if ((cz = getenv("HOST")) != NULL) + while (*cz && *cz != '.') + *p++ = attributes | *cz++; + break; + + case '~': /* show ~ whenever possible - a la dirs */ + { + static Char *olddir = 0, *olduser = 0, *o_pth = 0; + + if (!(z = value(STRcwd))) + break; /* no cwd, so don't do anything */ + /* + * Have we changed directory? + */ + if (olddir != z) { + o_pth = olddir = z; + olduser = getusername(&o_pth); + } + if (olduser) { + *p++ = attributes | '~'; + for (q = olduser; *q; *p++ = attributes | *q++); + for (z = o_pth; *z; *p++ = attributes | *z++); + break; + } + } + /* fall through if ~ not matched */ + case '/': + case 'd': + if (z = value(STRcwd)) { + while (*z) + *p++ = attributes | *z++; + } + break; + case '.': + case 'c': + case 'C': + { + register int j, k; + Char scp; + + scp = *cp; + /* option to determine fix number of dirs from path */ + if (*(cp + 1) >= '1' && *(cp + 1) <= '9') { + j = *(cp + 1) - '0'; + cp++; + } + else { + j = 1; + } + if (!(z = value(STRcwd))) + break; + (void) Strcpy(buff, z); + if (!buff[1]) { /* if CWD == / */ + *p++ = attributes | buff[0]; + } + else { + if ((scp != 'C') && (q = value(STRhome)) && + Strncmp(buff, q, (k = Strlen(q))) == 0 && + (buff[k] == '/' || buff[k] == '\0')) { + buff[--k] = '~'; + q = &buff[k]; + } + else + q = buff; + for (z = q; *z; z++); /* find the end */ + while (j-- > 0) { + while ((z > q) && (*z != '/')) + z--; /* back up */ + if (j && z > q) + z--; + } + if (*z == '/' && z != q) + z++; + while (*z) + *p++ = attributes | *z++; + } + } + break; + case 'n': + if (z = value(STRuser)) + while (*z) + *p++ = attributes | *z++; + break; + case 'l': + if (z = value(STRtty)) + while (*z) + *p++ = attributes | *z++; + break; + case 'w': + for (cz = month_list[t->tm_mon]; *cz;) + *p++ = attributes | *cz++; + *p++ = attributes | ' '; + Itoa(t->tm_mday, buff); + *p++ = attributes | buff[0]; + if (buff[1]) + *p++ = attributes | buff[1]; + break; + case 'W': + Itoa(t->tm_mon + 1, buff); + if (buff[1]) { + *p++ = attributes | buff[0]; + *p++ = attributes | buff[1]; + } + else { + *p++ = attributes | '0'; + *p++ = attributes | buff[0]; + } + *p++ = attributes | '/'; + + Itoa(t->tm_mday, buff); + if (buff[1]) { + *p++ = attributes | buff[0]; + *p++ = attributes | buff[1]; + } + else { + *p++ = attributes | '0'; + *p++ = attributes | buff[0]; + } + *p++ = attributes | '/'; + + Itoa(t->tm_year, buff); + if (buff[1]) { + *p++ = attributes | buff[0]; + *p++ = attributes | buff[1]; + } + else { + *p++ = attributes | '0'; + *p++ = attributes | buff[0]; + } + break; + case 'D': + Itoa(t->tm_year, buff); + if (buff[1]) { + *p++ = attributes | buff[0]; + *p++ = attributes | buff[1]; + } + else { + *p++ = attributes | '0'; + *p++ = attributes | buff[0]; + } + *p++ = attributes | '-'; + + Itoa(t->tm_mon + 1, buff); + if (buff[1]) { + *p++ = attributes | buff[0]; + *p++ = attributes | buff[1]; + } + else { + *p++ = attributes | '0'; + *p++ = attributes | buff[0]; + } + *p++ = attributes | '-'; + + Itoa(t->tm_mday, buff); + if (buff[1]) { + *p++ = attributes | buff[0]; + *p++ = attributes | buff[1]; + } + else { + *p++ = attributes | '0'; + *p++ = attributes | buff[0]; + } + break; + case 'S': /* start standout */ + attributes |= STANDOUT; + break; + case 'B': /* start bold */ + attributes |= BOLD; + break; + case 'U': /* start underline */ + attributes |= UNDER; + break; + case 's': /* end standout */ + attributes &= ~STANDOUT; + break; + case 'b': /* end bold */ + attributes &= ~BOLD; + break; + case 'u': /* end underline */ + attributes &= ~UNDER; + break; + case 'L': + ClearToBottom(); + break; + case '?': + if (z = value(STRstatus)) + while (*z) + *p++ = attributes | *z++; + break; + case '%': + *p++ = attributes | '%'; + break; + case '{': /* literal characters start */ +#if LITERAL == 0 + /* + * No literal capability, so skip all chars in the literal + * string + */ + while (*cp != '\0' && (*cp != '%' || cp[1] != '}')) + cp++; +#endif /* LITERAL == 0 */ + attributes |= LITERAL; + break; + case '}': /* literal characters end */ + attributes &= ~LITERAL; + break; + default: + *p++ = attributes | '%'; + *p++ = attributes | *cp; + break; + } + } + else if (*cp == '\\' | *cp == '^') { + *p++ = attributes | parseescape(&cp); + } + else if (*cp == '!') { /* EGS: handle '!'s in prompts */ + Itoa(eventno + 1, buff); + for (z = buff; *z; z++) + *p++ = attributes | *z; + } + else { + *p++ = attributes | *cp; /* normal character */ + } + } + *p = '\0'; + if (!editing) { + for (z = PromptBuf; z < p; z++) + (void) putraw(*z); + SetAttributes(0); + flush(); + } +} diff --git a/bin/tcsh/tc.sched.c b/bin/tcsh/tc.sched.c new file mode 100644 index 0000000..53dfbbd --- /dev/null +++ b/bin/tcsh/tc.sched.c @@ -0,0 +1,270 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/tc.sched.c,v 3.0 1991/07/04 21:49:28 christos Exp $ */ +/* + * tc.sched.c: Scheduled command execution + * + * Karl Kleinpaste: Computer Consoles Inc. 1984 + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#include "config.h" +#if !defined(lint) && !defined(pdp11) +static char *rcsid() + { return "$Id: tc.sched.c,v 3.0 1991/07/04 21:49:28 christos Exp $"; } +#endif + +#include "sh.h" +#include "ed.h" + +extern int just_signaled; + +struct sched_event { + struct sched_event *t_next; + long t_when; + Char **t_lex; +}; +static struct sched_event *sched_ptr = NULL; + + +time_t +sched_next() +{ + if (sched_ptr) + return (sched_ptr->t_when); + return ((time_t) - 1); +} + +void +dosched(v) + register Char **v; +{ + register struct sched_event *tp, *tp1, *tp2; + long cur_time; + int count, hours, minutes, dif_hour, dif_min; + Char *cp; + bool relative; /* time specified as +hh:mm */ + struct tm *ltp; + char *timeline; + char *ctime(); + + v++; + cp = *v++; + if (cp == NOSTR) { + /* print list of scheduled events */ + for (count = 1, tp = sched_ptr; tp; count++, tp = tp->t_next) { + timeline = ctime(&tp->t_when); + timeline[16] = '\0'; + xprintf("%6d\t%s\t", count, timeline); + blkpr(tp->t_lex); + xprintf("\n"); + } + return; + } + + if (*cp == '-') { + /* remove item from list */ + if (!sched_ptr) + stderror(ERR_NOSCHED); + if (*v) + stderror(ERR_SCHEDUSAGE); + count = atoi(short2str(++cp)); + if (count <= 0) + stderror(ERR_SCHEDUSAGE); + tp = sched_ptr; + tp1 = 0; + while (--count) { + if (tp->t_next == 0) + break; + else { + tp1 = tp; + tp = tp->t_next; + } + } + if (count) + stderror(ERR_SCHEDEV); + if (tp1 == 0) + sched_ptr = tp->t_next; + else + tp1->t_next = tp->t_next; + blkfree(tp->t_lex); + xfree((ptr_t) tp); + return; + } + + /* else, add an item to the list */ + if (!*v) + stderror(ERR_SCHEDCOM); + relative = 0; + if (!Isdigit(*cp)) { /* not abs. time */ + if (*cp != '+') + stderror(ERR_SCHEDUSAGE); + cp++, relative++; + } + minutes = 0; + hours = atoi(short2str(cp)); + while (*cp && *cp != ':' && *cp != 'a' && *cp != 'p') + cp++; + if (*cp && *cp == ':') + minutes = atoi(short2str(++cp)); + if ((hours < 0) || (minutes < 0) || + (hours > 23) || (minutes > 59)) + stderror(ERR_SCHEDTIME); + while (*cp && *cp != 'p' && *cp != 'a') + cp++; + if (*cp && relative) + stderror(ERR_SCHEDREL); + if (*cp == 'p') + hours += 12; + (void) time(&cur_time); + ltp = localtime(&cur_time); + if (relative) { + dif_hour = hours; + dif_min = minutes; + } + else { + if ((dif_hour = hours - ltp->tm_hour) < 0) + dif_hour += 24; + if ((dif_min = minutes - ltp->tm_min) < 0) { + dif_min += 60; + if ((--dif_hour) < 0) + dif_hour = 23; + } + } + tp = (struct sched_event *) xcalloc(1, sizeof *tp); + tp->t_when = cur_time - ltp->tm_sec + dif_hour * 3600L + dif_min * 60L; + /* use of tm_sec: get to beginning of minute. */ + if (!sched_ptr || tp->t_when < sched_ptr->t_when) { + tp->t_next = sched_ptr; + sched_ptr = tp; + } + else { + tp1 = sched_ptr->t_next; + tp2 = sched_ptr; + while (tp1 && tp->t_when >= tp1->t_when) { + tp2 = tp1; + tp1 = tp1->t_next; + } + tp->t_next = tp1; + tp2->t_next = tp; + } + tp->t_lex = saveblk(v); +} + +/* + * Execute scheduled events + */ +void +sched_run() +{ + long cur_time; + register struct sched_event *tp, *tp1; + struct wordent cmd, *nextword, *lastword; + struct command *t; + Char **v, *cp; + extern Char GettingInput; + +#ifdef BSDSIGS + sigmask_t omask; + + omask = sigblock(sigmask(SIGINT)) & ~sigmask(SIGINT); +#else + (void) sighold(SIGINT); +#endif + + (void) time(&cur_time); + tp = sched_ptr; + + /* bugfix by: Justin Bur at Universite de Montreal */ + /* + * this test wouldn't be necessary if this routine were not called before + * each prompt (in sh.c). But it is, to catch missed alarms. Someone + * ought to fix it all up. -jbb + */ + if (!(tp && tp->t_when < cur_time)) { +#ifdef BSDSIGS + (void) sigsetmask(omask); +#else + (void) sigrelse(SIGINT); +#endif + return; + } + + if (GettingInput) + (void) Cookedmode(); + + while (tp && tp->t_when < cur_time) { + if (seterr) { + xfree((char *) seterr); + seterr = NULL; + } + cmd.word = STRNULL; + lastword = &cmd; + v = tp->t_lex; + for (cp = *v; cp; cp = *++v) { + nextword = (struct wordent *) xcalloc(1, sizeof cmd); + nextword->word = Strsave(cp); + lastword->next = nextword; + nextword->prev = lastword; + lastword = nextword; + } + lastword->next = &cmd; + cmd.prev = lastword; + tp1 = tp; + sched_ptr = tp = tp1->t_next; /* looping termination cond: */ + blkfree(tp1->t_lex); /* straighten out in case of */ + xfree((ptr_t) tp1); /* command blow-up. */ + + /* expand aliases like process() does. */ + alias(&cmd); + /* build a syntax tree for the command. */ + t = syntax(cmd.next, &cmd, 0); + if (seterr) + stderror(ERR_OLD); + /* execute the parse tree. */ + execute(t, -1, NULL, NULL); + /* done. free the lex list and parse tree. */ + freelex(&cmd), freesyn(t); + } + if (GettingInput && !just_signaled) { /* PWP */ + (void) Rawmode(); + ClearLines(); /* do a real refresh since something may */ + ClearDisp(); /* have printed to the screen */ + Refresh(); + } + just_signaled = 0; + +#ifdef BSDSIGS + (void) sigsetmask(omask); +#else + (void) sigrelse(SIGINT); +#endif +} diff --git a/bin/tcsh/tc.sig.c b/bin/tcsh/tc.sig.c new file mode 100644 index 0000000..23fe8fb --- /dev/null +++ b/bin/tcsh/tc.sig.c @@ -0,0 +1,400 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/tc.sig.c,v 3.0 1991/07/04 23:34:26 christos Exp $ */ +/* + * sh.sig.c: Signal routine emulations + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#include "config.h" +#if !defined(lint) && !defined(pdp11) +static char *rcsid() + { return "$Id: tc.sig.c,v 3.0 1991/07/04 23:34:26 christos Exp $"; } +#endif + +#include "sh.h" +/* + * a little complicated #include ! :-( + */ +#if SVID > 0 +# ifdef hpux +# ifndef __hpux +# include "tc.wait.h" /* 6.5 broke */ +# else +# ifndef POSIX +# define _BSD +# endif +# ifndef _CLASSIC_POSIX_TYPES +# define _CLASSIC_POSIX_TYPES +# endif +# include /* 7.0 fixed it again */ +# endif /* __hpux */ +# else /* hpux */ +# if defined(OREO) || defined(IRIS4D) || defined(POSIX) +# include +# else /* OREO || IRIS4D || POSIX */ +# include "tc.wait.h" +# endif /* OREO || IRIS4D || POSIX */ +# endif /* hpux */ +#else /* SVID == 0 */ +# include +#endif /* SVID == 0 */ + +#ifndef BSDSIGS +/* libc.a contains these functions in SVID >= 3. */ +#if SVID < 3 || defined(UNIXPC) +sigret_t +(*sigset(a, b)) () + int a; + int (*b) (); +{ + return (signal(a, b)); +} + +/* release signal + * release all queued signals and + * set the default signal handler + */ +void +sigrelse(what) + int what; +{ + if (what == SIGCHLD) + sig_ch_rel(); +} + +/* hold signal + * only works with child and interrupt + */ +void +sighold(what) + int what; +{ + int sig_ch_queue(); + + if (what == SIGCHLD) + (void) signal(SIGCHLD, sig_ch_queue); +} + +/* ignore signal + */ +void +sigignore(a) + int a; +{ + (void) signal(a, SIG_IGN); +} + +#endif /* SVID < 3 || (UNIXPC) */ + +/* this stack is used to queue signals + * we can handle up to MAX_CHLD outstanding children now; + */ +#define MAX_CHLD 50 +static struct mysigstack { + int s_w; /* wait report */ + int s_errno; /* errno returned; */ + int s_pid; /* pid returned */ +} stk[MAX_CHLD]; +static int stk_ptr = -1; + + +/* return either awaiting processes or do a wait now + */ +int +ourwait(w) + int *w; +{ + int pid; + +#ifdef JOBDEBUG + xprintf("our wait %d\n", stk_ptr); + flush(); +#endif /* JOBDEBUG */ + + if (stk_ptr == -1) { + /* stack empty return signal from stack */ + pid = wait(w); +#ifdef JOBDEBUG + xprintf("signal(SIGCHLD, pchild);\n"); +#endif /* JOBDEBUG */ + (void) signal(SIGCHLD, pchild); + return (pid); + } + else { + /* return signal from stack */ + errno = stk[stk_ptr].s_errno; + *w = stk[stk_ptr].s_w; + stk_ptr--; + return (stk[stk_ptr + 1].s_pid); + } +} /* end ourwait */ + +/* queue child signals + * + */ +static void +sig_ch_queue() +{ +#ifdef JOBDEBUG + xprintf("queue SIGCHLD\n"); + flush(); +#endif /* JOBDEBUG */ + stk_ptr++; + stk[stk_ptr].s_pid = wait(&stk[stk_ptr].s_w); + stk[stk_ptr].s_errno = errno; + (void) signal(SIGCHLD, sig_ch_queue); +} + + + + +/* process all awaiting child signals + */ +static void +sig_ch_rel() +{ + while (stk_ptr > -1) + pchild(SIGCHLD); +#ifdef JOBDEBUG + xprintf("signal(SIGCHLD, pchild);\n"); +#endif /* JOBDEBUG */ + (void) signal(SIGCHLD, pchild); +} + +/* libc.a contains sigpause.o in SVID >= 3. */ +#if SVID < 3 || defined(UNIXPC) + +/* atomically release one signal + */ +void +sigpause(what) + int what; +{ +#ifdef notdef + if (what == SIGCHLD) { + if (stk_ptr > -1) { + pchild(SIGCHLD); + } + else { + (void) sleep(1); + } + } +#endif + /* From: Jim Mattson */ + if (what == SIGCHLD) + pchild(SIGCHLD); + +} + +#endif /* SVID < 3 || (UNIXPC) */ + +#ifdef SXA +/* + * SX/A is SVID3 but does not have sys5-sigpause(). + * I've heard that sigpause() is not defined in SVID3. + */ +/* This is not need if you make tcsh by BSD option's cc. */ +void +sigpause(what) +{ + if (what == SIGCHLD) { + b_sigpause(b_sigblock((sigmask_t) 0) & ~sigmask(SIGBSDCHLD)); + } + else if (what == 0) { + pause(); + } + else { + xprintf("sigpause(%d)\n", what); + pause(); + } +} + +#endif /* SXA */ +#endif /* BSDSIGS */ + +#ifdef NEEDsignal +/* turn into bsd signals */ +sigret_t(* + xsignal(s, a)) () + int s; + +sigret_t(*a) (); +{ + sigvec_t osv, sv; + + (void) mysigvec(s, NULL, &osv); + sv = osv; + sv.sv_handler = a; +#ifdef SIG_STK + sv.sv_onstack = SIG_STK; +#endif +#if defined(SV_BSDSIG) && defined(SV_ONSTACK) + sv.sv_flags = SV_BSDSIG | SV_ONSTACK; +#endif + + if (mysigvec(s, &sv, NULL) < 0) + return (BADSIG); + return (osv.sv_handler); +} + +#endif /* NEEDsignal */ + +#ifdef _SEQUENT_ +/* + * Support for signals. + */ + +extern int errno; + +/* Set and test a bit. Bits numbered 1 to 32 */ + +#define SETBIT(x, y) x |= sigmask(y) +#define ISSET(x, y) ((x & sigmask(y)) != 0) + +#ifdef DEBUG +# define SHOW_SIGNALS 1 /* to assist in debugging signals */ +#endif + +#ifdef SHOW_SIGNALS +char *show_sig_mask(); +#endif + +int debug_signals = 0; + +/* + * igsetmask(mask) + * + * Set a new signal mask. Return old mask. + */ +sigmask_t +sigsetmask(mask) + sigmask_t mask; +{ + sigset_t set, oset; + int m; + register int i; + + sigemptyset(&set); + sigemptyset(&oset); + + for (i = 1; i <= MAXSIG; i++) + if (ISSET(mask, i)) + sigaddset(&set, i); + + if (sigprocmask(SIG_SETMASK, &set, &oset)) + xprintf("sigsetmask(0x%x) - sigprocmask failed, errno %d", + mask, errno); + + m = 0; + for (i = 1; i < MAXSIG; i++) + if (sigismember(&oset, i)) + SETBIT(m, i); + + return (m); +} + +/* + * sigblock(mask) + * + * Add "mask" set of signals to the present signal mask. + * Return old mask. + */ +sigmask_t +sigblock(mask) + sigmask_t mask; +{ + sigset_t set, oset; + int m; + register int i; + + set = 0; + oset = 0; + + /* Get present set of signals. */ + if (sigprocmask(SIG_SETMASK, NULL, &set)) + xprintf("sigblock(0x%x) - sigprocmask failed, errno %d", + mask, errno); + + /* Add in signals from mask. */ + for (i = 1; i <= MAXSIG; i++) + if (ISSET(mask, i)) + sigaddset(&set, i); + + sigprocmask(SIG_SETMASK, &set, &oset); + + /* Return old mask to user. */ + m = 0; + for (i = 1; i < MAXSIG; i++) + if (sigismember(&oset, i)) + SETBIT(m, i); + + return (m); +} + + +/* + * b_sigpause(mask) + * + * Set new signal mask and wait for signal; + * Old mask is restored on signal. + */ +void +b_sigpause(mask) + sigmask_t mask; +{ + sigset_t set; + register int i; + + sigemptyset(&set); + + for (i = 1; i <= MAXSIG; i++) + if (ISSET(mask, i)) + sigaddset(&set, i); + sigsuspend(&set); +} + +#endif /* _SEQUENT_ */ + + +#ifdef SIGSYNCH +static long Synch_Cnt = 0; + +sigret_t +synch_handler(sno) +int sno; +{ + if (sno != SIGSYNCH) + abort(); + Synch_Cnt++; +} + +#endif /* SIGSYNCH */ diff --git a/bin/tcsh/tc.sig.h b/bin/tcsh/tc.sig.h new file mode 100644 index 0000000..80f0b43 --- /dev/null +++ b/bin/tcsh/tc.sig.h @@ -0,0 +1,178 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/tc.sig.h,v 3.0 1991/07/04 23:34:26 christos Exp $ */ +/* + * tc.sig.h: Signal handling + * + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#ifndef _h_tc_sig +#define _h_tc_sig + +#if SVID > 0 +# include +# ifndef SIGCHLD +# define SIGCHLD SIGCLD +# endif /* SIGCHLD */ +#else /* SVID == 0 */ +# include +#endif /* SVID > 0 */ + +#ifdef sun +# define SAVESIGVEC +#endif + +#ifdef BSDSIGS +/* + * sigvec is not the same everywhere + */ +# ifdef _SEQUENT_ +# define HAVE_SIGVEC +# define mysigvec(a, b, c) sigaction(a, b, c) +typedef struct sigaction sigvec_t; +# define sv_handler sa_handler +# endif /* _SEQUENT */ + +# ifdef hpux +# define HAVE_SIGVEC +# define mysigvec(a, b, c) sigvector(a, b, c) +# define NEEDsignal +typedef struct sigvec sigvec_t; +# endif /* hpux */ + +# ifndef HAVE_SIGVEC +# define mysigvec(a, b, c) sigvec(a, b, c) +typedef struct sigvec sigvec_t; +# endif /* HAVE_SIGVEC */ + +# undef HAVE_SIGVEC +#endif /* BSDSIGS */ + +#if SVID > 0 +# ifdef BSDJOBS +/* here I assume that systems that have bsdjobs implement the + * the setpgrp call correctly. Otherwise defining this would + * work, but it would kill the world, because all the setpgrp + * code is the the part defined when BSDJOBS are defined + * NOTE: we don't want killpg(a, b) == kill(-getpgrp(a), b) + * cause process a might be already dead and getpgrp would fail + */ +# define killpg(a, b) kill(-(a), (b)) +# else +/* this is the poor man's version of killpg()! Just kill the + * current process and don't worry about the rest. Someday + * I hope I get to fix that. + */ +# define killpg(a, b) kill((a), (b)) +# endif /* BSDJOBS */ +#endif /* SVID > 0 */ + + +#ifdef BSDSIGS +/* + * For 4.2bsd signals. + */ +# ifdef sigmask +# undef sigmask +# endif /* sigmask */ +# define sigmask(s) ((sigmask_t)1 << ((s)-1)) +# ifdef _SEQUENT_ +# define sigpause(a) b_sigpause(a) +# define signal(a, b) sigset(a, b) +# else /* _SEQUENT_ */ +# define sighold(s) sigblock(sigmask(s)) +# define sigignore(s) signal(s, SIG_IGN) +# define sigset(s, a) signal(s, a) +# endif /* _SEQUENT_ */ +# ifdef aiws +# define sigrelse(a) sigsetmask(sigblock(0) & ~sigmask(a)) +# undef killpg +# define killpg(a, b) kill(-getpgrp(a), b) +# define NEEDsignal +# endif /* aiws */ +#endif /* BSDSIGS */ + + +/* + * We choose a define for the window signal if it exists.. + */ +#ifdef SIGWINCH +# define SIG_WINDOW SIGWINCH +#else +# ifdef SIGWINDOW +# define SIG_WINDOW SIGWINDOW +# endif /* SIGWINDOW */ +#endif /* SIGWINCH */ + +#if defined(convex) || defined(__convex__) +# define SIGSYNCH 0 +# ifdef SIGSYNCH +# define SYNCHMASK (sigmask(SIGCHLD)|sigmask(SYNCH_SIG)) +# else +# define SYNCHMASK (sigmask(SIGCHLD)) +# endif +extern sigret_t synch_handler(); +#endif /* convex || __convex__ */ + +#ifdef SAVESIGVEC +# define NSIGSAVED 7 + /* + * These are not inline for speed. gcc -traditional -O on the sparc ignores + * the fact that vfork() corrupts the registers. Calling a routine is not + * nice, since it can make the comp_r put some things that we want saved + * into registers - christos + */ +# define savesigvec(sv) \ + (mysigvec(SIGINT, (sigvec_t *) 0, &(sv)[0]), \ + mysigvec(SIGQUIT, (sigvec_t *) 0, &(sv)[1]), \ + mysigvec(SIGTSTP, (sigvec_t *) 0, &(sv)[2]), \ + mysigvec(SIGTTIN, (sigvec_t *) 0, &(sv)[3]), \ + mysigvec(SIGTTOU, (sigvec_t *) 0, &(sv)[4]), \ + mysigvec(SIGTERM, (sigvec_t *) 0, &(sv)[5]), \ + mysigvec(SIGHUP, (sigvec_t *) 0, &(sv)[6]), \ + sigblock(sigmask(SIGINT) | sigmask(SIGQUIT) | \ + sigmask(SIGTSTP) | sigmask(SIGTTIN) | \ + sigmask(SIGTTOU) | sigmask(SIGTERM) | \ + sigmask(SIGHUP))) + +# define restoresigvec(sv, sm) \ + (void) (mysigvec(SIGINT, &(sv)[0], (sigvec_t *) 0), \ + mysigvec(SIGQUIT, &(sv)[1], (sigvec_t *) 0), \ + mysigvec(SIGTSTP, &(sv)[2], (sigvec_t *) 0), \ + mysigvec(SIGTTIN, &(sv)[3], (sigvec_t *) 0), \ + mysigvec(SIGTTOU, &(sv)[4], (sigvec_t *) 0), \ + mysigvec(SIGTERM, &(sv)[5], (sigvec_t *) 0), \ + mysigvec(SIGHUP, &(sv)[6], (sigvec_t *) 0), \ + sigsetmask(sm)) +# endif /* SAVESIGVEC */ + +#endif /* _h_tc_sig */ diff --git a/bin/tcsh/tc.str.c b/bin/tcsh/tc.str.c new file mode 100644 index 0000000..91834fc --- /dev/null +++ b/bin/tcsh/tc.str.c @@ -0,0 +1,409 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/tc.str.c,v 3.0 1991/07/04 21:49:28 christos Exp $ */ +/* + * tc.str.c: Short string package + * This has been a lesson of how to write buggy code! + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#include "config.h" +#ifdef SHORT_STRINGS +#if !defined(lint) && !defined(pdp11) +static char *rcsid() + { return "$Id: tc.str.c,v 3.0 1991/07/04 21:49:28 christos Exp $"; } +#endif + +#include "sh.h" + +Char ** +blk2short(src) + register char **src; +{ + size_t n; + register Char **sdst, **dst; + + /* + * Count + */ + for (n = 0; src[n] != NULL; n++); + sdst = dst = (Char **) xmalloc((size_t) ((n + 1) * sizeof(Char *))); + + for (; *src != NULL; src++) + *dst++ = SAVE(*src); + *dst = NULL; + return (sdst); +} + +char ** +short2blk(src) + register Char **src; +{ + size_t n; + register char **sdst, **dst; + + /* + * Count + */ + for (n = 0; src[n] != NULL; n++); + sdst = dst = (char **) xmalloc((size_t) ((n + 1) * sizeof(char *))); + + for (; *src != NULL; src++) + *dst++ = strsave(short2str(*src)); + *dst = NULL; + return (sdst); +} + +#define MALLOC_INCR 1024 +Char * +str2short(src) + register char *src; +{ + static Char *sdst; + static size_t dstsize = 0; + register Char *dst, *edst; + + if (src == NULL) + return (NULL); + + if (sdst == (NULL)) { + dstsize = MALLOC_INCR; + sdst = (Char *) xmalloc((size_t) dstsize * sizeof(Char)); + } + + dst = sdst; + edst = &dst[dstsize]; + while (*src) { + *dst++ = (Char) ((unsigned char) *src++); + if (dst == edst) { + dstsize += MALLOC_INCR; + sdst = (Char *) xrealloc((ptr_t) sdst, + (size_t) dstsize * sizeof(Char)); + edst = &sdst[dstsize]; + dst = &edst[-MALLOC_INCR]; + } + } + *dst = 0; + return (sdst); +} + +char * +short2qstr(src) + register Char *src; +{ + static char *sdst = NULL; + static size_t dstsize = 0; + register char *dst, *edst; + + if (src == NULL) + return (NULL); + + if (sdst == NULL) { + dstsize = MALLOC_INCR; + sdst = (char *) xmalloc((size_t) dstsize * sizeof(char)); + } + dst = sdst; + edst = &dst[dstsize]; + while (*src) { + if (*src & QUOTE) { + *dst++ = '\\'; + if (dst == edst) { + dstsize += MALLOC_INCR; + sdst = (char *) xrealloc((ptr_t) sdst, + (size_t) dstsize * sizeof(char)); + edst = &sdst[dstsize]; + dst = &edst[-MALLOC_INCR]; + } + } + *dst++ = (char) *src++; + if (dst == edst) { + dstsize += MALLOC_INCR; + sdst = (char *) xrealloc((ptr_t) sdst, + (size_t) dstsize * sizeof(char)); + edst = &sdst[dstsize]; + dst = &edst[-MALLOC_INCR]; + } + } + *dst = 0; + return (sdst); +} +char * +short2str(src) + register Char *src; +{ + static char *sdst = NULL; + static size_t dstsize = 0; + register char *dst, *edst; + + if (src == NULL) + return (NULL); + + if (sdst == NULL) { + dstsize = MALLOC_INCR; + sdst = (char *) xmalloc((size_t) dstsize * sizeof(char)); + } + dst = sdst; + edst = &dst[dstsize]; + while (*src) { + *dst++ = (char) *src++; + if (dst == edst) { + dstsize += MALLOC_INCR; + sdst = (char *) xrealloc((ptr_t) sdst, + (size_t) dstsize * sizeof(char)); + edst = &sdst[dstsize]; + dst = &edst[-MALLOC_INCR]; + } + } + *dst = 0; + return (sdst); +} + +Char * +s_strcpy(dst, src) + register Char *dst, *src; +{ + register Char *sdst; + + sdst = dst; + while (*dst++ = *src++); + return (sdst); +} + +Char * +s_scpy(dst, src, n) + register Char *dst, *src; + register size_t n; +{ + register Char *sdst; + + if (n == 0) + return(dst); + + sdst = dst; + do + if ((*dst++ = *src++) == '\0') { + while (--n != 0) + *dst++ = '\0'; + return(sdst); + } + while (--n != 0); + return (sdst); +} + +Char * +s_strcat(dst, src) + register Char *dst, *src; +{ + register short *sdst; + + sdst = dst; + while (*dst++); + --dst; + while (*dst++ = *src++); + return (sdst); +} + +#ifdef NOTUSED +Char * +s_scat(dst, src, n) + register Char *dst, *src; + register size_t n; +{ + register Char *sdst; + + if (n == 0) + return (dst); + + sdst = dst; + + while (*dst++); + --dst; + + do + if ((*dst++ = *src++) == '\0') + return(sdst); + while (--n != 0); + + *dst = '\0'; + return (sdst); +} + +#endif + +Char * +s_strchr(str, ch) + register Char *str; + int ch; +{ + do + if (*str == ch) + return (str); + while (*str++); + return (NULL); +} + +Char * +s_strrchr(str, ch) + register Char *str; + int ch; +{ + register Char *rstr; + + rstr = NULL; + do + if (*str == ch) + rstr = str; + while (*str++); + return (rstr); +} + +size_t +s_strlen(str) + register Char *str; +{ + register size_t n; + + for (n = 0; *str++; n++); + return (n); +} + +int +s_strcmp(str1, str2) + register Char *str1, *str2; +{ + for (; *str1 && *str1 == *str2; str1++, str2++); + /* + * The following case analysis is necessary so that characters which look + * negative collate low against normal characters but high against the + * end-of-string NUL. + */ + if (*str1 == '\0' && *str2 == '\0') + return (0); + else if (*str1 == '\0') + return (-1); + else if (*str2 == '\0') + return (1); + else + return (*str1 - *str2); +} + +int +s_scmp(str1, str2, n) + register Char *str1, *str2; + register size_t n; +{ + if (n == 0) + return (0); + do { + if (*str1 != *str2) { + /* + * The following case analysis is necessary so that characters + * which look negative collate low against normal characters + * but high against the end-of-string NUL. + */ + if (*str1 == '\0') + return (-1); + else if (*str2 == '\0') + return (1); + else + return (*str1 - *str2); + break; + } + if (*str1 == '\0') + return(0); + str1++, str2++; + } while (--n != 0); + return(0); +} + +Char * +s_strsave(s) + register Char *s; +{ + Char *n; + register Char *p; + + if (s == 0) + s = STRNULL; + for (p = s; *p++;); + n = p = (Char *) xmalloc((size_t) ((p - s) * sizeof(Char))); + while (*p++ = *s++); + return (n); +} + +Char * +s_strspl(cp, dp) + Char *cp, *dp; +{ + Char *ep; + register Char *p, *q; + + if (!cp) + cp = STRNULL; + if (!dp) + dp = STRNULL; + for (p = cp; *p++;); + for (q = dp; *q++;); + ep = (Char *) xmalloc((size_t) + (((p - cp) + (q - dp) - 1) * sizeof(Char))); + for (p = ep, q = cp; *p++ = *q++;); + for (p--, q = dp; *p++ = *q++;); + return (ep); +} + +Char * +s_strend(cp) + register Char *cp; +{ + if (!cp) + return (cp); + while (*cp) + cp++; + return (cp); +} + +Char * +s_strstr(s, t) + register Char *s, *t; +{ + do { + register Char *ss = s; + register Char *tt = t; + + do + if (*tt == '\0') + return (s); + while (*ss++ == *tt++); + } while (*s++ != '\0'); + return (NULL); +} + +#endif /* SHORT_STRINGS */ diff --git a/bin/tcsh/tc.vers.c b/bin/tcsh/tc.vers.c new file mode 100644 index 0000000..e9931cc --- /dev/null +++ b/bin/tcsh/tc.vers.c @@ -0,0 +1,397 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/tc.vers.c,v 3.0 1991/07/04 21:49:28 christos Exp $ */ +/* + * tc.vers.c: Version dependent stuff + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#include "config.h" +#if !defined(lint) && !defined(pdp11) +static char *rcsid() + { return "$Id: tc.vers.c,v 3.0 1991/07/04 21:49:28 christos Exp $"; } +#endif + +#include "sh.h" +#include "patchlevel.h" + + +Char * +GetHostType() +{ + Char *hosttype; + +#ifdef vax +# define _havehosttype_ + hosttype = str2short("vax"); +#endif /* vax */ + +#ifdef pdp11 +# define _havehosttype_ + hosttype = str2short("pdp11"); +#endif /* pdp */ + +#ifdef hp9000 /* hp9000 running MORE/bsd */ +# ifdef hp300 +# define _havehosttype_ + hosttype = str2short("hp300"); +# endif +# ifdef hp800 +# define _havehosttype_ + hosttype = str2short("hp800"); +# endif +# ifndef _havehosttype_ +# define _havehosttype_ + hosttype = str2short("hp9000"); +# endif +#endif /* hp9000 */ + +#ifdef sun +# ifdef mc68010 +# define _havehosttype_ + hosttype = str2short("sun2"); +# endif /* mc68010 */ +# ifdef mc68020 +# define _havehosttype_ + hosttype = str2short("sun3"); +# endif /* mc68020 */ +# ifdef sparc +# define _havehosttype_ + hosttype = str2short("sun4"); +# endif /* sparc */ +# ifdef i386 +# define _havehosttype_ + hosttype = str2short("sun386i"); +# endif /* i386 */ +# ifndef _havehosttype_ +# define _havehosttype_ + hosttype = str2short("sun"); +# endif +#endif /* sun */ + +#ifdef pyr /* pyramid */ +# define _havehosttype_ + hosttype = str2short("pyramid"); +#endif /* pyr */ + +#ifdef ibm032 /* from Jak Kirman + * . */ +# define _havehosttype_ + hosttype = str2short("rt"); +#endif /* ibm032 */ + +#ifdef aiws /* not to be confused with the above */ +# define _havehosttype_ + hosttype = str2short("rtpc"); +#endif /* aiws */ + +#ifdef _AIX370 +# define _havehosttype_ + hosttype = str2short("aix370"); +#endif /* _AIX370 */ + +#ifdef _IBMR2 +# define _havehosttype_ + hosttype = str2short("rs6000"); +#endif /* _IBMR2 */ + +#ifdef _AIXPS2 /* AIX on a PS/2 */ +# define _havehosttype_ + hosttype = str2short("ps2"); +#endif /* _AIXPS2 */ + +#ifdef OREO +# define _havehosttype_ + hosttype = str2short("mac2"); +#endif /* OREO */ + +#ifdef hpux +# if defined(__hp9000s700) && !defined(_havehosttype_) +# define _havehosttype_ + hosttype = str2short("hp9000s700"); +# endif /* __hp9000s700 */ +# if defined(hp9000s800) && !defined(_havehosttype_) +# define _havehosttype_ + hosttype = str2short("hp9000s800"); /* maybe "spectrum" */ +# endif /* hp9000s800 */ +# if defined(hp9000s300) && !defined(_havehosttype_) +# define _havehosttype_ + hosttype = str2short("hp9000s300"); +# endif /* hp9000s300 */ +# ifndef _havehosttype_ +# define _havehosttype_ + hosttype = str2short("hp"); +# endif /* _havehosttype_ */ +#endif /* hpux */ + +#ifdef apollo +# define _havehosttype_ + hosttype = str2short("apollo"); +#endif + +#ifdef u3b20d +# define _havehosttype_ + hosttype = str2short("att3b20"); +#endif /* u3b20d */ + +#ifdef u3b15 +# define _havehosttype_ + hosttype = str2short("att3b15"); +#endif /* u3b15 */ + +#ifdef u3b5 +# define _havehosttype_ + hosttype = str2short("att3b5"); +#endif /* u3b5 */ + +#ifdef u3b2 +# define _havehosttype_ + hosttype = str2short("att3b2"); +#endif /* u3b2 */ + +#if defined(i386) && SVID > 0 +# define _havehosttype_ + hosttype = str2short("iAPX386"); +#endif + +#ifdef alliant +# define _havehosttype_ + hosttype = str2short("alliant"); /* for Alliant FX Series */ +#endif + +#if defined(i386) && defined(MACH) +# define _havehosttype_ + hosttype = str2short("i386-mach"); +#endif + +#if defined(sequent) || defined(_SEQUENT_) +# define _havehosttype_ +# ifdef i386 +# ifdef sequent + hosttype = str2short("symmetry");/* Sequent Symmetry Dynix/3 */ +# ifndef LOCALSTR +# define LOCALSTR " (Dynix/3)" +# endif /* LOCALSTR */ +# else + hosttype = str2short("ptx"); /* Sequent Symmetry Dynix/ptx */ +# ifndef LOCALSTR +# define LOCALSTR " (Dynix/ptx)" +# endif /* LOCALSTR */ +# endif +# else + hosttype = str2short("balance"); /* for Sequent Balance Series */ +# ifndef LOCALSTR +# define LOCALSTR " (Dynix/3)" +# endif /* LOCALSTR */ +# endif +#else /* !sequent */ +# ifdef ns32000 +# ifdef CMUCS /* hack for Mach (in the true spirit of CMU) */ + hosttype = str2short("multimax"); +# else /* CMUCS */ + hosttype = str2short((!access("/Umax.image", F_OK) ? "multimax" : "ns32000")); +# endif /* CMUCS */ +# endif /* ns32000 */ +#endif /* sequent */ + +#if defined(convex) || defined(__convex__) +# define _havehosttype_ + /* From: Brian Allison */ + hosttype = str2short("convex"); +#endif /* convex */ + +#ifdef butterfly +# define _havehosttype_ + /* this will work _until_ the bfly with 88000s comes out */ + hosttype = str2short("butterfly"); /* BBN Butterfly 1000 */ +#endif /* butterfly */ + +#ifdef NeXT +# define _havehosttype_ + hosttype = str2short("next"); +#endif /* NeXT */ + +/* From Kazuhiro Honda */ +#ifdef sony_news +# define _havehosttype_ +# ifdef mips /* Sony NEWS based on a r3000 */ + hosttype = str2short("news_mips"); +# else + hosttype = str2short("news"); +# endif +#endif /* sony_news */ + +#ifdef mips +# define _havehosttype_ +# ifdef MIPSEL +# ifdef ultrix + /* decstation XXXX */ + hosttype = str2short("decstation"); +# else + hosttype = str2short("mips"); +# endif /* ultrix */ +# endif /* MIPSEL */ +# ifdef MIPSEB +# ifdef sgi /* sgi iris 4d */ + hosttype = str2short("iris4d"); +# else +# ifdef sony_news + hosttype = str2short("news_mips"); +# else + hosttype = str2short("mips"); +# endif /* sony_news */ +# endif /* sgi */ +# endif /* MIPSEB */ +#endif /* mips */ + +#ifdef m88k +# define _havehosttype_ + hosttype = str2short("m88k"); /* Motorola 88100 system */ +#endif + +#ifdef masscomp /* Added, DAS DEC-90. */ +# define _havehosttype_ + hosttype = str2short("masscomp");/* masscomp == concurrent */ +#endif /* masscomp */ + +#ifdef GOULD_NP1 +# define _havehosttype_ + hosttype = str2short("gould_np1"); +#endif /* GOULD_NP1 */ + +#ifdef SXA +# define _havehosttype_ + hosttype = str2short("pfa50"); +# ifdef _BSDX_ +# ifndef LOCALSTR +# define LOCALSTR " (SX/A E60+BSDX)" +# endif /* LOCALSTR */ +# else +# ifndef LOCALSTR +# define LOCALSTR " (SX/A E60)" +# endif /* LOCALSTR */ +# endif +#endif /* PFU/Fujitsu A-xx computer */ + +#ifdef titan +# define _havehosttype_ + /* Ken Laprade */ + hosttype = str2short("titan"); +#endif /* titan */ + +#ifndef _havehosttype_ +# define _havehosttype_ + /* Default to something reasonable */ + hosttype = str2short("unknown"); +#endif +#undef _havehosttype_ + return hosttype; +} /* end GetHostType */ + + +/* fix_version(): + * Print a reasonable version string, printing all comp_ time + * options that might affect the user. + */ +void +fix_version() +{ + char version[BUFSIZ]; + +#ifdef SHORT_STRINGS +# define SSSTR "8b" +#else +# define SSSTR "7b" +#endif +#ifdef NLS +# define NLSSTR ",nls" +#else +# define NLSSTR "" +#endif +#ifdef LOGINFIRST +# define LFSTR ",lf" +#else +# define LFSTR "" +#endif +#ifdef DOTLAST +# define DLSTR ",dl" +#else +# define DLSTR "" +#endif +#ifdef VIDEFAULT +# define VISTR ",vi" +#else +# define VISTR "" +#endif +#ifdef TESLA +# define DTRSTR ",dtr" +#else +# define DTRSTR "" +#endif +#ifdef KAI +# define BYESTR ",bye" +#else +# define BYESTR "" +#endif +#ifdef AUTOLOGOUT +# define ALSTR ",al" +#else +# define ALSTR "" +#endif +#ifdef CSHDIRS +# define DIRSTR ",dir" +#else +# define DIRSTR "" +#endif +#ifdef KANJI +# define KANSTR ",kan" +#else +# define KANSTR "" +#endif +#ifdef SYSMALLOC +# define SMSTR ",sm" +#else +# define SMSTR "" +#endif +/* if you want your local version to say something */ +#ifndef LOCALSTR +# define LOCALSTR "" +#endif /* LOCALSTR */ + + xsprintf(version, + "tcsh %d.%.2d.%.2d (%s) %s options %s%s%s%s%s%s%s%s%s%s%s%s", + REV, VERS, PATCHLEVEL, ORIGIN, DATE, + SSSTR, NLSSTR, LFSTR, DLSTR, VISTR, DTRSTR, + BYESTR, ALSTR, DIRSTR, KANSTR, SMSTR, LOCALSTR); + set(STRversion, SAVE(version)); + xsprintf(version, "%d.%.2d.%.2d", REV, VERS, PATCHLEVEL); + set(STRtcsh, SAVE(version)); +} diff --git a/bin/tcsh/tc.wait.h b/bin/tcsh/tc.wait.h new file mode 100644 index 0000000..89e4520 --- /dev/null +++ b/bin/tcsh/tc.wait.h @@ -0,0 +1,112 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/tc.wait.h,v 3.0 1991/07/04 21:49:28 christos Exp $ */ +/* + * tc.wait.h: Wait.h for machines that don't have it or have it and + * is incorrect. + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#ifndef _h_tc_wait +#define _h_tc_wait + +/* + * This wait is for big-endians and little endians + */ +union wait { + int w_status; +# ifdef _SEQUENT_ + struct { + unsigned short w_Termsig:7; + unsigned short w_Coredump:1; + unsigned short w_Retcode:8; + } w_T; + struct { + unsigned short w_Stopval:8; + unsigned short w_Stopsig:8; + } w_S; +}; + +# define w_termsig w_T.w_Termsig +# define w_coredump w_T.w_Coredump +# define w_retcode w_T.w_Retcode +# define w_stopval w_S.w_Stopval +# define w_stopsig w_S.w_Stopsig +#else /* _SEQUENT_ */ +# if defined(vax) || defined(i386) + union { + struct { + unsigned int w_Termsig:7; + unsigned int w_Coredump:1; + unsigned int w_Retcode:8; + unsigned int w_Dummy:16; + } w_T; + struct { + unsigned int w_Stopval:8; + unsigned int w_Stopsig:8; + unsigned int w_Dummy:16; + } w_S; + } w_P; +# else /* mc68000 || sparc || ??? */ + union { + struct { + unsigned int w_Dummy:16; + unsigned int w_Retcode:8; + unsigned int w_Coredump:1; + unsigned int w_Termsig:7; + } w_T; + struct { + unsigned int w_Dummy:16; + unsigned int w_Stopsig:8; + unsigned int w_Stopval:8; + } w_S; + } w_P; +# endif /* vax || i386 */ +}; + +# define w_termsig w_P.w_T.w_Termsig +# define w_coredump w_P.w_T.w_Coredump +# define w_retcode w_P.w_T.w_Retcode +# define w_stopval w_P.w_S.w_Stopval +# define w_stopsig w_P.w_S.w_Stopsig +#endif /* _SEQUENT_ */ + + +#ifndef WNOHANG +# define WNOHANG 1 /* dont hang in wait */ +#endif +# ifndef WUNTRACED +# define WUNTRACED 2 /* tell about stopped, untraced children */ +# endif +# define WSTOPPED 0177 +# define WIFSTOPPED(x) ((x).w_stopval == WSTOPPED) +# define WIFSIGNALED(x) (((x).w_stopval != WSTOPPED) && ((x).w_termsig != 0)) +#endif /* _h_tc_wait */ diff --git a/bin/tcsh/tc.who.c b/bin/tcsh/tc.who.c new file mode 100644 index 0000000..5fe5a1d --- /dev/null +++ b/bin/tcsh/tc.who.c @@ -0,0 +1,580 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/tc.who.c,v 3.0 1991/07/04 21:49:28 christos Exp $ */ +/* + * tc.who.c: Watch logins and logouts... + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#include "config.h" +#if !defined(lint) && !defined(pdp11) +static char *rcsid() + { return "$Id: tc.who.c,v 3.0 1991/07/04 21:49:28 christos Exp $"; } +#endif + +#include "sh.h" + +/* + * kfk 26 Jan 1984 - for login watch functions. + */ +#include +#include + +#ifndef BROKEN_CC +# define UTNAMLEN sizeof(((struct utmp *) 0)->ut_name) +# define UTLINLEN sizeof(((struct utmp *) 0)->ut_line) +# ifdef UTHOST +# ifdef _SEQUENT_ +# define UTHOSTLEN 100 +# else +# define UTHOSTLEN sizeof(((struct utmp *) 0)->ut_host) +# endif +# endif /* UTHOST */ +#else +/* give poor cc a little help if it needs it */ +struct utmp __ut; + +# define UTNAMLEN sizeof(__ut.ut_name) +# define UTLINLEN sizeof(__ut.ut_line) +# ifdef UTHOST +# ifdef _SEQUENT_ +# define UTHOSTLEN 100 +# else +# define UTHOSTLEN sizeof(__ut.ut_host) +# endif +# endif /* UTHOST */ +#endif /* BROKEN_CC */ + +#ifndef _PATH_UTMP +# ifdef UTMP_FILE +# define _PATH_UTMP UTMP_FILE +# else +# define _PATH_UTMP "/var/run/utmp" +# endif /* UTMP_FILE */ +#endif /* _PATH_UTMP */ + + +struct who { + struct who *w_next; + struct who *w_prev; + char w_name[UTNAMLEN + 1]; + char w_new[UTNAMLEN + 1]; + char w_tty[UTLINLEN + 1]; +#ifdef UTHOST + char w_host[UTHOSTLEN + 1]; +#endif /* UTHOST */ + long w_time; + int w_status; +}; + +static struct who *wholist = NULL; +static int watch_period = 0; +static time_t stlast = 0; +extern char *month_list[]; +#ifdef WHODEBUG +static void debugwholist __P((struct who *, struct who *)); +#endif +static void print_who __P((struct who *)); + + +#define ONLINE 01 +#define OFFLINE 02 +#define CHANGED 04 +#define STMASK 07 +#define ANNOUNCE 010 + +/* + * Karl Kleinpaste, 26 Jan 1984. + * Initialize the dummy tty list for login watch. + * This dummy list eliminates boundary conditions + * when doing pointer-chase searches. + */ +void +initwatch() +{ + register int i; + + wholist = (struct who *) xcalloc(1, sizeof *wholist); + wholist->w_next = (struct who *) xcalloc(1, sizeof *wholist); + wholist->w_next->w_prev = wholist; + for (i = 0; i < UTLINLEN; i++) { + wholist->w_tty[i] = '\01'; + wholist->w_next->w_tty[i] = '~'; + } + wholist->w_tty[i] = '\0'; + wholist->w_next->w_tty[i] = '\0'; + +#ifdef WHODEBUG + debugwholist(NULL, NULL); +#endif /* WHODEBUG */ +} + +void +resetwatch() +{ + watch_period = 0; + stlast = 0; +} + +/* + * Karl Kleinpaste, 26 Jan 1984. + * Watch /var/run/utmp for login/logout changes. + */ +void +watch_login() +{ + int utmpfd, comp, alldone; +#ifdef BSDSIGS + sigmask_t omask; +#endif /* BSDSIGS */ + struct utmp utmp; + struct who *wp, *wpnew; + struct varent *v; + Char **vp; + time_t t, interval = MAILINTVL; + struct stat sta; +#if defined(UTHOST) && defined(_SEQUENT_) + char *host, *ut_find_host(); +#endif + + /* stop SIGINT, lest our login list get trashed. */ +#ifdef BSDSIGS + omask = sigblock(sigmask(SIGINT)); +#else + (void) sighold(SIGINT); +#endif + + v = adrof(STRwatch); + if (v == NULL) { +#ifdef BSDSIGS + (void) sigsetmask(omask); +#else + (void) sigrelse(SIGINT); +#endif + return; /* no names to watch */ + } + vp = v->vec; + if (blklen(vp) % 2) /* odd # args: 1st == # minutes. */ + interval = (number(*vp)) ? getn(*vp++) : MAILINTVL; + (void) time(&t); + if (t - watch_period < interval * 60) { +#ifdef BSDSIGS + (void) sigsetmask(omask); +#else + (void) sigrelse(SIGINT); +#endif + return; /* not long enough yet... */ + } + watch_period = t; + + /* + * From: Michael Schroeder + * Don't open utmp all the time, stat it first... + */ + if (stat(_PATH_UTMP, &sta)) { + xprintf("cannot stat %s. Please \"unset watch\".\n", _PATH_UTMP); +#ifdef BSDSIGS + (void) sigsetmask(omask); +#else + (void) sigrelse(SIGINT); +#endif + return; + } + if (stlast == sta.st_mtime) { +#ifdef BSDSIGS + (void) sigsetmask(omask); +#else + (void) sigrelse(SIGINT); +#endif + return; + } + stlast = sta.st_mtime; + if ((utmpfd = open(_PATH_UTMP, O_RDONLY)) < 0) { + xprintf("%s cannot be opened. Please \"unset watch\".\n", _PATH_UTMP); +#ifdef BSDSIGS + (void) sigsetmask(omask); +#else + (void) sigrelse(SIGINT); +#endif + return; + } + + /* + * xterm clears the entire utmp entry - mark everyone on the status list + * OFFLINE or we won't notice X "logouts" + */ + for (wp = wholist; wp != NULL; wp = wp->w_next) { + wp->w_status = OFFLINE; + wp->w_time = 0; + } + + /* + * Read in the utmp file, sort the entries, and update existing entries or + * add new entries to the status list. + */ + while (read(utmpfd, (char *) &utmp, sizeof utmp) == sizeof utmp) { + +#ifdef DEAD_PROCESS +# ifndef IRIS4D + if (utmp.ut_type != USER_PROCESS) + continue; +# else + /* Why is that? Cause the utmp file is always corrupted??? */ + if (utmp.ut_type != USER_PROCESS && utmp.ut_type != DEAD_PROCESS) + continue; +# endif /* IRIS4D */ +#endif /* DEAD_PROCESS */ + + if (utmp.ut_name[0] == '\0' && utmp.ut_line[0] == '\0') + continue; /* completely void entry */ +#ifdef DEAD_PROCESS + if (utmp.ut_type == DEAD_PROCESS && utmp.ut_line[0] == '\0') + continue; +#endif /* DEAD_PROCESS */ + wp = wholist; + while ((comp = strncmp(wp->w_tty, utmp.ut_line, UTLINLEN)) < 0) + wp = wp->w_next;/* find that tty! */ + + if (comp == 0) { /* found the tty... */ +#ifdef DEAD_PROCESS + if (utmp.ut_type == DEAD_PROCESS) { + wp->w_time = utmp.ut_time; + wp->w_status = OFFLINE; + } + else +#endif /* DEAD_PROCESS */ + if (utmp.ut_name[0] == '\0') { + wp->w_time = utmp.ut_time; + wp->w_status = OFFLINE; + } + else if (strncmp(utmp.ut_name, wp->w_name, UTNAMLEN) == 0) { + /* someone is logged in */ + wp->w_time = utmp.ut_time; + wp->w_status = 0; /* same guy */ + } + else { + (void) strncpy(wp->w_new, utmp.ut_name, UTNAMLEN); +#ifdef UTHOST +# ifdef _SEQUENT_ + host = ut_find_host(wp->w_tty); + if (host) + (void) strncpy(wp->w_host, host, UTHOSTLEN); + else + wp->w_host[0] = 0; +# else + (void) strncpy(wp->w_host, utmp.ut_host, UTHOSTLEN); +# endif +#endif /* UTHOST */ + wp->w_time = utmp.ut_time; + if (wp->w_name[0] == '\0') + wp->w_status = ONLINE; + else + wp->w_status = CHANGED; + } + } + else { /* new tty in utmp */ + wpnew = (struct who *) xcalloc(1, sizeof *wpnew); + (void) strncpy(wpnew->w_tty, utmp.ut_line, UTLINLEN); +#ifdef UTHOST +# ifdef _SEQUENT_ + host = ut_find_host(wpnew->w_tty); + if (host) + (void) strncpy(wpnew->w_host, host, UTHOSTLEN); + else + wpnew->w_host[0] = 0; +# else + (void) strncpy(wpnew->w_host, utmp.ut_host, UTHOSTLEN); +# endif +#endif /* UTHOST */ + wpnew->w_time = utmp.ut_time; +#ifdef DEAD_PROCESS + if (utmp.ut_type == DEAD_PROCESS) + wpnew->w_status = OFFLINE; + else +#endif /* DEAD_PROCESS */ + if (utmp.ut_name[0] == '\0') + wpnew->w_status = OFFLINE; + else { + (void) strncpy(wpnew->w_new, utmp.ut_name, UTNAMLEN); + wpnew->w_status = ONLINE; + } +#ifdef WHODEBUG + debugwholist(wpnew, wp); +#endif /* WHODEBUG */ + + wpnew->w_next = wp; /* link in a new 'who' */ + wpnew->w_prev = wp->w_prev; + wpnew->w_prev->w_next = wpnew; + wp->w_prev = wpnew; /* linked in now */ + } + } + (void) close(utmpfd); +#if defined(UTHOST) && defined(_SEQUENT_) + endutent(); +#endif + + /* + * The state of all logins is now known, so we can search the user's list + * of watchables to print the interesting ones. + */ + for (alldone = 0; !alldone && *vp != NULL && **vp != '\0' && + *(vp + 1) != NULL && **(vp + 1) != '\0'; + vp += 2) { /* args used in pairs... */ + + if (eq(*vp, STRany) && eq(*(vp + 1), STRany)) + alldone = 1; + + for (wp = wholist; wp != NULL; wp = wp->w_next) { + if (wp->w_status & ANNOUNCE || + (!eq(*vp, STRany) && + !eq(*vp, str2short(wp->w_name)) && + !eq(*vp, str2short(wp->w_new))) || + (!eq(*(vp + 1), str2short(wp->w_tty)) && + !eq(*(vp + 1), STRany))) + continue; /* entry doesn't qualify */ + /* already printed or not right one to print */ + + if (wp->w_time == 0)/* utmp entry was cleared */ + wp->w_time = watch_period; + + if ((wp->w_status & OFFLINE) && + (wp->w_name[0] != '\0')) { + print_who(wp); + wp->w_name[0] = '\0'; + wp->w_status |= ANNOUNCE; + continue; + } + if (wp->w_status & ONLINE) { + print_who(wp); + (void) strcpy(wp->w_name, wp->w_new); + wp->w_status |= ANNOUNCE; + continue; + } + if (wp->w_status & CHANGED) { + print_who(wp); + (void) strcpy(wp->w_name, wp->w_new); + wp->w_status |= ANNOUNCE; + continue; + } + } + } +#ifdef BSDSIGS + (void) sigsetmask(omask); +#else + (void) sigrelse(SIGINT); +#endif +} + +#ifdef WHODEBUG +static oid +debugwholist(new, wp) + register struct who *new, *wp; +{ + register struct who *a; + + a = wholist; + while (a != NULL) { + xprintf("%s/%s -> ", a->w_name, a->w_tty); + a = a->w_next; + } + xprintf("NULL\n"); + a = wholist; + xprintf("backward: "); + while (a->w_next != NULL) + a = a->w_next; + while (a != NULL) { + xprintf("%s/%s -> ", a->w_name, a->w_tty); + a = a->w_prev; + } + xprintf("NULL\n"); + if (new) + xprintf("new: %s/%s\n", new->w_name, new->w_tty); + if (wp) + xprintf("wp: %s/%s\n", wp->w_name, wp->w_tty); +} +#endif /* WHODEBUG */ + + +static void +print_who(wp) + struct who *wp; +{ +#ifdef UTHOST + char *cp = "%n has %a %l from %m."; + char *ptr, flg; +#else + char *cp = "%n has %a %l."; +#endif /* UTHOST */ + + struct varent *vp = adrof(STRwho); + struct tm *t; + char ampm = 'a'; + int attributes = 0; + + t = localtime(&wp->w_time); + if (vp && vp->vec[0]) + cp = short2str(vp->vec[0]); + + for (; *cp; cp++) + if (*cp != '%') + xputchar(*cp | attributes); + else + switch (*++cp) { + case 'n': /* user name */ + switch (wp->w_status & STMASK) { + case ONLINE: + case CHANGED: + xprintf("%a%s", attributes, wp->w_new); + break; + case OFFLINE: + xprintf("%a%s", attributes, wp->w_name); + break; + } + break; + case 'a': + switch (wp->w_status & STMASK) { + case ONLINE: + xprintf("%a%s", attributes, "logged on"); + break; + case OFFLINE: + xprintf("%a%s", attributes, "logged off"); + break; + case CHANGED: + xprintf("%areplaced %s on", attributes, wp->w_name); + break; + } + break; + case 'S': /* start standout */ + attributes |= STANDOUT; + break; + case 'B': /* start bold */ + attributes |= BOLD; + break; + case 'U': /* start underline */ + attributes |= UNDER; + break; + case 's': /* end standout */ + attributes &= ~STANDOUT; + break; + case 'b': /* end bold */ + attributes &= ~BOLD; + break; + case 'u': /* end underline */ + attributes &= ~UNDER; + break; + case 't': + case 'T': + case '@': + if (adrof(STRampm) || *cp != 'T') { + int hr = t->tm_hour; + + if (hr >= 12) { + if (hr > 12) + hr -= 12; + ampm = 'p'; + } + else if (hr == 0) + hr = 12; + xprintf("%a%d:%02d%cm", attributes, hr, t->tm_min, ampm); + } + else + xprintf("%a%d:%02d", attributes, t->tm_hour, t->tm_min); + break; + case 'w': + xprintf("%a%s %d", attributes, month_list[t->tm_mon], + t->tm_mday); + break; + case 'W': + xprintf("%a%02d/%02d/%02d", attributes, + t->tm_mon + 1, t->tm_mday, t->tm_year); + break; + case 'D': + xprintf("%a%02d-%02d-%02d", attributes, + t->tm_year, t->tm_mon + 1, t->tm_mday); + break; + case 'l': + xprintf("%a%s", attributes, wp->w_tty); + break; +#ifdef UTHOST + case 'm': + if (wp->w_host[0] == '\0') + xprintf("%alocal", attributes); + else + /* the ':' stuff is for :. */ + for (ptr = wp->w_host, flg = Isdigit(*ptr) ? '\0' : '.'; + *ptr != '\0' && + (*ptr != flg || ((ptr = strchr(ptr, ':')) != 0)); + ptr++) { + if (*ptr == ':') + flg = '\0'; + xputchar((int) + ((Isupper(*ptr) ? Tolower(*ptr) : *ptr) | + attributes)); + } + break; + case 'M': + if (wp->w_host[0] == '\0') + xprintf("%alocal", attributes); + else + for (ptr = wp->w_host; *ptr != '\0'; ptr++) + xputchar((int) + ((Isupper(*ptr) ? Tolower(*ptr) : *ptr) | + attributes)); + break; +#endif /* UTHOST */ + default: + xputchar('%' | attributes); + xputchar(*cp | attributes); + break; + } + xputchar('\n'); +} /* end print_who */ + +void +/*ARGSUSED*/ +dolog(v) +Char **v; +{ + struct who *wp; + struct varent *vp; + + if ((vp = adrof(STRwatch)) == NULL) + stderror(ERR_NOWATCH); + blkpr(vp->vec); + xprintf("\n"); + watch_period = 0; + stlast = 0; + wp = wholist; + while (wp != NULL) { + wp->w_name[0] = '\0'; + wp = wp->w_next; + } +} diff --git a/bin/tcsh/tcsh.man b/bin/tcsh/tcsh.man new file mode 100644 index 0000000..c31de61 --- /dev/null +++ b/bin/tcsh/tcsh.man @@ -0,0 +1,2667 @@ +.\" $Id: tcsh.man,v 3.0 1991/07/04 21:54:11 christos Exp $ +.TH TCSH 1 "27 November 1996" +.SH NAME +tcsh \- C shell with file name completion and command line editing +.SH SYNOPSIS +.B tcsh +[ +.B \-bcdefilmnqstvVxX +] +[ +.I argument .\|.\|. +] +.SH DESCRIPTION +.I Tcsh +is an enhanced version of the Berkeley UNIX C shell +.IR csh (1). +It behaves exactly like the C shell, +except for the added utilities of: +.sp +.RS +.6i +.ti -4 +1) Command line editing using Emacs-style commands. +.sp +.ti -4 +2) Visual step up/down through the history list. +.sp +.ti -4 +3) Terminal mode sanity checking and resetting. +.sp +.ti -4 +4) Interactive command, file name and user name completion. +.sp +.ti -4 +5) File/directory/user list in the middle of a typed command. +.sp +.ti -4 +6) Spelling correction of command, file, and user names. +.sp +.ti -4 +7) Lookup of command documentation in the middle of a typed command. +.sp +.ti -4 +8) Enhanced history mechanism. +.sp +.ti -4 +9) Automatic logout after long periods of idle time. +.sp +.ti -4 +10) Automatic execution of a single command prior to printing each prompt. +.sp +.ti -4 +11) Automatic periodic command execution. +.sp +.ti -4 +12) A new syntax for the prompt, and the ability to set the prompt for +"while" and "for" loops. +.sp +.ti -4 +13) Time stamps in the history list. +.sp +.ti -4 +14) An addition to the syntax of filenames to access entries in the +directory stack, and the ability treat symbolic links in a sane +way when changing directories. +.sp +.ti -4 +15) The ability to watch for logins and logouts by user or terminal +on the machine. +.sp +.ti -4 +16) A scheduled event list, which specifies commands which are to be +executed at given times. +.sp +.ti -4 +17) A new builtin that does a subset of +.IR ls (1). +.sp +.ti -4 +18) An addition to the file expression syntax for a character not +in a set of characters and the ability to negate a regular expression. +.sp +.ti -4 +19) New automatically initialized environment variables \fIHOST\fR and +\fIHOSTTYPE\fR. +.sp +.ti -4 +20) Commands for debugging terminal capabilities. +.sp +.ti -4 +21) Searching for the visual history mechanism. +.sp +.ti -4 +22) A new builtin for the +.IR which (1) +command. +.sp +.ti -4 +23) Restarting a stopped editor with two keystrokes. +.sp +.ti -4 +24) Status line support +.sp +.ti -4 +25) Automatic execution of a command when the current working +directory is changed. +.sp +.ti -4 +26) Native Language System support. +.sp +.ti -4 +27) Automatic process time reporting. +.sp +.ti -4 +28) OS Dependent Builtin Support +.sp +.ti -4 +29) Automatic window size adjustment +.sp +.ti -4 +30) Input files +.sp +.ti -4 +31) Additional/Undocumented Options +.RE +.sp +For a description of standard C-shell features, see the +.I csh +manual page. +.PP +.SH "1. COMMAND LINE EDITING" +Commands that the user types in may be edited using the same control +characters that Gnu Emacs or vi uses. Arrow and function key sequences are +also allowed. +.I Tcsh +allows this by setting the terminal to `CBREAK' mode and reading the input +one character at a time. +.PP +There is a new shell command, +.I bindkey, +that allows the user to redefine what any key does, or find out what +any or all of the keys do. +.PP +Syntax: bindkey [ -a ] [ -s ] [ -v ] [ -e ] [ -d ] [ -l ] [ -r ] [ -- ] [ in-string [ out-string | command ]] +.PP +If no values are given all bindings are listed. If only in-string is given, +bindings for the in-string is listed. +.PP +Otherwise it binds the in-string to the given out-string or command. +If out-string, this is treated as input to +.I tcsh +when in-string is typed. This may be used recursively to currently a level +of 10 deep. +.PP +There are two basic key maps: the normal and alternative one. The alternative +is used by VI command mode. For multi-character input the basic key maps +contains a sequence-lead-in for the first character in the input. +.PP +Options: + -a bind in-string in alternative key map. +.br + -s bind an out-string instead of a command +.br + -v bind for default VI-mode +.br + -e bind for default emacs-mode +.br + -d bind to compiled in default +.br + -l list functions available with short description +.br + -r remove the binding of in-string +.PP +In strings control characters may be written as caret- and +backslash ("\e") is used to escape a character as follows: +.RS +.PD 0 +.TP +.B \ea +bell character +.TP +.B \en +line feed (new line) +.TP +.B \eb +back space +.TP +.B \et +horizontal tab +.TP +.B \ev +vertical tab +.TP +.B \ef +form feed +.TP +.B \er +carriage return +.TP +.B \ee +escape +.TP +.B \ennn +character code in octal +.PD +.RE +In all other cases \e escapes the following character. Needed for +escaping the special meaning of \e and ^. +Delete is written as "^?" (caret-question mark). +.PP +.I Tcsh +always binds the arrow keys as defined by the termcap entry to: +.RS +.6i +.nf +.ta 1.5i +.sp +up arrow up-history +down arrow down-history +right arrow forward-char +left arrow backward-char +.RE +.DT +.fi +.sp +Also the vt100 sequences for arrow keys are always bound. +.PP +The following is a list of the default emacs and vi bindings. +Characters with the 8th bit set are written as M-. +Note however, that unlike with the old +.I bind +command (see below), the syntax M- has no special meaning to the +.I bindkey +command, and the bindings for the sequence escape+ and +M- as given below are handled separately (although the +the default bindings are the same). +The printable ascii characters not mentioned in the list are bound to the +.I self-insert-command +function, which just inserts the given character literally into the input line. +The remaining characters are bound to the +.I undefined-key +function, which only causes a beep (unless +.I nobeep +is set, of course). +.RS +.6i +.nf +.ta 2.5i +.sp +EMACS bindings +.sp +"^@" -> set-mark-command +"^A" -> beginning-of-line +"^B" -> backward-char +"^C" -> tty-sigintr +"^D" -> delete-char-or-list +"^E" -> end-of-line +"^F" -> forward-char +"^G" -> is undefined +"^H" -> backward-delete-char +"^I" -> complete-word +"^J" -> newline +"^K" -> kill-line +"^L" -> clear-screen +"^M" -> newline +"^N" -> down-history +"^O" -> tty-flush-output +"^P" -> up-history +"^Q" -> tty-start-output +"^R" -> redisplay +"^S" -> tty-stop-output +"^T" -> transpose-chars +"^U" -> kill-whole-line +"^V" -> quoted-insert +"^W" -> kill-region +"^X" -> sequence-lead-in +"^Y" -> yank +"^Z" -> tty-sigtsusp +"^[" -> sequence-lead-in +"^\e" -> tty-sigquit +"^]" -> tty-dsusp +" " to "/" -> self-insert-command +"0" to "9" -> digit +":" to "~" -> self-insert-command +"^?" -> backward-delete-char +.PP +EMACS Multi-character and 8 bit bindings +.sp +"^[^D" or "M-^D" -> list-choices +"^[^H" or "M-^H" -> backward-delete-word +"^[^I" or "M-^I" -> complete-word +"^[^L" or "M-^L" -> clear-screen +"^[^Z" or "M-^Z" -> run-fg-editor +"^[^[" or "M-^[" -> complete-word +"^[^_" or "M-^_" -> copy-prev-word +"^[ " or "M- " -> expand-history +"^[!" or "M-!" -> expand-history +"^[$" or "M-$" -> spell-line +"^[0" or "M-0" -> digit-argument +"^[1" or "M-1" -> digit-argument +"^[2" or "M-2" -> digit-argument +"^[3" or "M-3" -> digit-argument +"^[4" or "M-4" -> digit-argument +"^[5" or "M-5" -> digit-argument +"^[6" or "M-6" -> digit-argument +"^[7" or "M-7" -> digit-argument +"^[8" or "M-8" -> digit-argument +"^[9" or "M-9" -> digit-argument +"^[?" or "M-?" -> which-command +"^[B" or "M-B" -> backward-word +"^[C" or "M-C" -> capitalize-word +"^[D" or "M-D" -> delete-word +"^[F" or "M-F" -> forward-word +"^[H" or "M-H" -> run-help +"^[L" or "M-L" -> downcase-word +"^[N" or "M-N" -> history-search-forward +"^[P" or "M-P" -> history-search-backward +"^[R" or "M-R" -> toggle-literal-history +"^[S" or "M-S" -> spell-word +"^[U" or "M-U" -> upcase-word +"^[W" or "M-W" -> copy-region-as-kill +"^[_" or "M-_" -> insert-last-word +"^[b" or "M-b" -> backward-word +"^[c" or "M-c" -> capitalize-word +"^[d" or "M-d" -> delete-word +"^[f" or "M-f" -> forward-word +"^[h" or "M-h" -> run-help +"^[l" or "M-l" -> downcase-word +"^[n" or "M-n" -> history-search-forward +"^[p" or "M-p" -> history-search-backward +"^[r" or "M-r" -> toggle-literal-history +"^[s" or "M-s" -> spell-word +"^[u" or "M-u" -> upcase-word +"^[w" or "M-w" -> copy-region-as-kill +"^[^?" or "M-^?" -> backward-delete-word +"^X^X" -> exchange-point-and-mark +"^X*" -> expand-glob +"^X$" -> expand-variables +"^XG" -> list-glob +"^Xg" -> list-glob +.sp +.PP +VI Insert Mode functions +.sp +"^C" -> tty-sigintr +"^D" -> list-or-eof +"^H" -> backward-delete-char +"^I" -> complete-word +"^J" -> newline +"^K" -> kill-line +"^L" -> clear-screen +"^M" -> newline +"^N" -> is undefined +"^O" -> tty-flush-output +"^P" -> is undefined +"^Q" -> tty-start-output +"^R" -> redisplay +"^S" -> tty-stop-output +"^T" -> is undefined +"^U" -> backward-kill-line +"^V" -> quoted-insert +"^W" -> backward-delete-word +"^X" -> is undefined +"^Y" -> tty-dsusp +"^Z" -> tty-sigtsusp +"^[" -> vi-cmd-mode +"^\e" -> tty-sigquit +" " to "~" -> self-insert-command +"^?" -> backward-delete-char +.PP +VI Command Mode functions +.sp +"^@" -> is undefined +"^A" -> beginning-of-line +"^B" -> is undefined +"^C" -> tty-sigintr +"^D" -> list-choices +"^E" -> end-of-line +"^F" -> is undefined +"^G" -> list-glob +"^H" -> backward-delete-char +"^I" -> vi-cmd-mode-complete +"^J" -> newline +"^K" -> kill-line +"^L" -> clear-screen +"^M" -> newline +"^N" -> down-history +"^O" -> tty-flush-output +"^P" -> up-history +"^Q" -> tty-start-output +"^R" -> redisplay +"^S" -> tty-stop-output +"^T" -> is undefined +"^U" -> backward-kill-line +"^V" -> is undefined +"^W" -> backward-delete-word +"^X" -> expand-line +"^[" -> sequence-lead-in +"^\e" -> tty-sigquit +" " -> forward-char +"!" -> expand-history +"$" -> end-of-line +"*" -> expand-glob +"0" -> vi-zero +"1" to "9" -> digit-argument +"?" -> which-command +"@" -> is undefined +"A" -> vi-add-at-eol +"B" -> backward-word +"C" -> vi-chg-to-eol +"D" -> kill-line +"I" -> vi-insert-at-bol +"J" -> history-search-forward +"K" -> history-search-backward +"O" -> sequence-lead-in +"R" -> vi-replace-mode +"S" -> vi-substitute-line +"T" -> toggle-literal-history +"V" -> expand-variables +"W" -> forward-word +"X" -> backward-delete-char +"[" -> sequence-lead-in +"\e^" -> beginning-of-line +"a" -> vi-add +"b" -> backward-word +"c" -> is undefined +"d" -> delete-word +"h" -> backward-char +"i" -> vi-insert +"j" -> down-history +"k" -> up-history +"l" -> forward-char +"r" -> vi-replace-char +"s" -> vi-substitute-char +"t" -> toggle-literal-history +"v" -> expand-variables +"w" -> vi-beginning-of-next-word +"x" -> delete-char +"~" -> change-case +"^?" -> backward-delete-char +"M-?" -> run-help +"M-[" -> sequence-lead-in +"M-O" -> sequence-lead-in +.PP +VI Multi-character bindings +.sp +"^[?" -> run-help +.RE +.DT +.fi +.sp +.PP +There is also an older version of bindkey called +.I bind, +that allows the user to redefine what any key does, or find out what +any or all of the keys do. This is retained for compatibility reasons. +.PP +If given two arguments +.I bind +binds the function (first argument) to the given key (second +argument). The key may be: the direct character or a caret- +combination, which is converted to control-; M- for an +escaped character; or F- for a function key. For the last of +these, the function key prefix must be bound to the function +"sequence-lead-in" and the string specified to the +.I bind +command must not include this prefix. +.PP +If given one argument +.I bind +takes the argument as the name for a key and tells what that key does. +As a special case, the user can say +.sp +.RS +.6i +bind emacs +.br +.RE +or +.RS +.6i +bind vi +.RE +.sp +to bind all the keys for Emacs or vi mode respectively. +.PP +If given no arguments +.I bind +tells what all of the keys do. If you give bind the single argument +of 'defaults', it resets each key to its default value (see the above +list). +.PP +.SH "2. VISUAL HISTORY" +The keys ^P and ^N are used to step up and down the history list. If +the user has typed in the following: +.RS +.6i +.sp +.nf +> ls +foo bar +> echo mumble +mumble +> +.RE +.fi +.sp +then enters +.I ^P, +the shell will place "echo mumble" into the editing buffer, and will +put the cursor at the end of the line. If another +.I ^P +is entered, then the editing line will change to "ls". More +.IR ^P s +will make the bell ring, since there are no more lines in the history. +.I ^N +works the same way, except it steps down (forward in time). +.PP +An easy way to re-do a command is to type +.I ^P +followed by +.I Return. +Also, pieces of previous commands can be assembled to make a new +command. The commands that work on regions are especially useful for this. +.PP +.I ^P +and +.I ^N +actually only copy commands from out of the history into the edit +buffer; thus the user may step back into the history and then edit +things, but those changes do not affect what is actually in +.I tcsh 's +history. +.PP +Another way to recall (parts of) history commands is via the 'expand-history' +function. A variation of the 'expand-history' function is called 'magic-space'. +This function expands +.I csh +history, and always appends a space. Magic-space +thus can be bound to , to automatically expand +.I csh +history. +Expand-history is normally bound to +.I M- +and magic-space is not bound. +.PP +.SH "3. TTY MODE SANITY" +As part of the editor, +.I tcsh +does a check and reset of the terminal mode bits. If the speed has +been changed, then +.I tcsh +will change to using that speed. +.I Tcsh +will also obey changes in the padding needed by the tty. +Some changes to the command keys will be obeyed, however if a command key +is unset, +.I tcsh +will reset it to what it was. Also, the shell will automatically turn off +RAW and CBREAK modes, and will turn on the tty driver's output processing. +.PP +.SH "4. WORD COMPLETION" +In typing commands, +it is no longer necessary to type a complete name, +only a unique abbreviation is necessary. +When you type a TAB to +.I tcsh +it will complete the name for you, echoing the full name on the +terminal (and entering it into the edit buffer). If the prefix you +typed matches no name, the terminal bell is rung, unless the +variable +.I nobeep +is set. The name may +be partially completed if the prefix matches several longer names. If +this is the case, the name is extended up to the point of ambiguity, +and the bell is rung. This works for file names, command names, shell +variables and the +.I( csh) +\~ user name convention. +The variable +.I fignore +may be set to a list of suffixes to be disregarded during completion. +.PP +.I Example +.PP +Assume the current directory contained the files: +.RS +.6i +.sp +.nf +DSC.TXT bin cmd lib memos +DSC.NEW chaos cmtest mail netnews +bench class dev mbox new +.RE +.fi +.sp +The command: +.sp +.RS +.6i +> gnumacs ch[TAB] +.RE +.sp +would cause +.I tcsh +to complete the command with the file name chaos. If instead, the +user had typed: +.sp +.RS +.6i +> gnumacs D[TAB] +.RE +.sp +.I tcsh +would have extended the name to DSC and rung the terminal bell, +indicating partial completion. However, if +.I fignore +had previously been set to a list containing .NEW as one element, +e.g. ( .o .NEW ), +.I tcsh +would have completed the `D' to DSC.TXT. +.PP +File name completion works equally well when other directories are addressed. +Additionally, +.I tcsh +understands the C shell tilde (~) convention for home directories. +Thus, +.sp +.RS +.6i +> cd ~speech/data/fr[TAB] +.RE +.sp +does what one might expect. This may also be used to expand login names only. +Thus, +.sp +.RS +.6i +> cd ~sy[TAB] +.RE +.sp +expands to +.sp +.RS +.6i +> cd ~synthesis +.RE +.sp +.PP +Command names may also be completed, for example, +.sp +.RS +.6i +> gnum[TAB] +.RE +.sp +will expand to "gnumacs" (assuming that there are no other commands +that begin with "gnum"). +.sp +Shell and environment variables are recognized also and in addition +they can be expanded: +.sp +.RS +.6i +> set local=/usr/local +.br +> echo $lo[TAB] +.RE +.sp +will expand to "$local/". Note that a slash is appended because the +expanded variable points to a directory. Also: +.sp +.RS +.6i +> set local=/usr/local +.br +> echo $local/[^D] +.br +bin/ etc/ lib/ man/ src/ +.RE +.sp +will correctly list the contents of /usr/local. Shell and environment +variables can also be expanded via the expand-variables function: +.sp +.RS +.6i +> echo $local/[^X$] +.br +> echo /usr/local/ +.RE + +.PP +Completion also works when the cursor is in the middle of the line, +rather than just the end. All of the text after the cursor will be +saved, the completion will work (possibly adding to the current name), +and then the saved text will be restored in place, after the cursor. +.PP +The behavior of the completion can be changed by the setting of +several shell variables: +.PP +Setting the +.I recexact +variable makes an exact command be expanded rather than just ringing the bell. +For example, assume the current directory has two subdirectories +called foo and food, then with +.I recexact +set the following could be done: +.sp +.RS +.6i +> cd fo[TAB] +.RE +.br +to ... +.br +.RS +.6i +> cd foo[TAB] +.RE +.br +to ... +.br +.RS +.6i +> cd foo/ +.RE +.sp +rather than beeping on the second TAB. +.PP +If the +.I autolist +variable is set, invoking completion when several choices are possible +will automatically list the choices, effectively merging the functionality +described in the next section into the completion mechanism. +The "noise level" can be controlled by the value that +.I matchbeep +is set to: With matchbeep=nomatch, completion will only beep if there are +no matching names; with matchbeep=ambiguous, completion will +.I also +beep if there are many possible matches; with matchbeep=notunique, +completion will +.I also +beep when there is an exact match but there are other, longer, matches +(see recexact). With matchbeep=never or set to any other value completion +will never beep. If matchbeep is not set it defaults to ambiquous. +.PP +If the +.I autoexpand +variable is set, the expand-history function will be invoked automatically +before the completion attempt, expanding normal +.I csh +history substitutions. +.PP +For covert operation, the variable +.I nobeep +can be set; it will prevent the completion mechanism, +as well as +.I tcsh +in general, from actually beeping. +Finally, if the +.I autocorrect +variable is set, the spelling correction is attempted for any path components +up to the completion point. +.PP +.SH "5. LISTING OF POSSIBLE NAMES" +At any point in typing a command, you may request "what names are +available". Thus, when you have typed, perhaps: +.sp +.RS +.6i +> cd ~speech/data/fritz/ +.RE +.sp +you may wish to know what files or subdirectories exist (in +~speech/data/fritz), without, of course, aborting the command you are +typing. Typing the character Control-D (^D), will list the names +(files, in this case) available. The files are listed in multicolumn +format, sorted column-wise. Directories are indicated with a trailing +`/', executable files with a `*', symbolic links with a '@', sockets +with a '=', FIFOs (named pipes) with a '|', character devices +with a '%', and block devices with a '#'. Once +printed, the command is re-echoed for you to complete. +.PP +Additionally, one may want to know which files match a prefix. +If the user had typed: +.sp +.RS +.6i +> cd ~speech/data/fr[^D] +.RE +.sp +all files and subdirectories whose prefix was +``fr'' would be printed. Notice that the example before was simply +a degenerate case of this with a null trailing file name. +(The null string is a prefix of all strings.) +Notice also, that +a trailing slash is required to pass to a new directory for +both file name completion and listing. +.PP +The degenerate +.sp +.RS +.6i +> ~[^D] +.RE +.sp +will print a full list of login names on the current system. Note, +however, that the degenerate +.sp +.RS +.6i +> [^D] +.RE +.sp +does not list all of the commands, but only beeps. +.PP +Listing/expanding of words that match a name containing wildcard characters +can be done via the list-glob/expand-glob function: +.RS +.6i +.nf +> ls +foo.c bar.c a.out +> vi *.c[^Xg] +foo.c bar.c +> vi *.c[^X*] +> vi foo.c bar.c +.fi +.RE +.PP +.SH "Command Name Recognition" +Command name recognition and completion +works in the same manner as file name recognition +and completion above. +The current value of the environment variable +.I PATH +is used +in searching for the command. +For example +.sp +.RS +.6i +> newa[TAB] +.RE +.sp +might expand to +.sp +.RS +.6i +> newaliases +.RE +.sp +Also, +.sp +.RS +.6i +> new[^D] +.RE +.sp +would list all commands (along PATH) that begin with "new". +.PP +Note that Control-D has three different effects on +.I tcsh. +On an empty line (one that contains nothing, not even spaces), +.I ^D +sends an EOF to +.I tcsh +just as it does for normal programs. When the cursor is in the middle +of a line of text, +.I ^D +deletes the character +that the cursor is under. Finally, a +.I ^D +at the end of a line of text lists the available names at that point. +To get a list of available names when the cursor is in the middle of a +line (or on an empty line), a Meta-Control-D should be typed (Escape +followed by Control-D). +.PP +.SH "6. SPELLING CORRECTION" +If while typing a command, the user mistypes or misspells a file name, +user name, or command name, +.I tcsh +can correct the spelling. When correcting a file name, each part of +the path is individually checked and corrected. +Spelling correction can be invoked in several different ways: +.PP +The +.I spell-word +function, normally bound to M-s (and M-S), will attempt to correct the word +immediately before the cursor. +For example, suppose that +the user has typed: +.sp +.RS +.6i +> cd /uxr/spol/news[ESC s] +.RE +.sp +.I Tcsh +will check the path for spelling, correct the mistakes, and redraw the +line as +.sp +.RS +.6i +> cd /usr/spool/news +.RE +.sp +leaving the cursor at the end of the line. +.PP +Spelling correction of the entire command line (independent of where +the cursor is) can be done with the +.I spell-line +function, normally bound to M-$ (Escape Dollar-sign). +It will check each word independently, but in order to avoid e.g. command +options, no correction is attempted on words whose first character +is found in the string "!.\\^-*%". +.PP +Finally, automatic spelling correction will be done each time the Return +key is hit, if the +.I correct +variable is set to an appropriate value: +correct=cmd will cause the spelling of the command name only to be checked, +while correct=all causes checking of all words on the line, like the +spell-line function. +If any part of the command line is corrected, the user will be given a special +prompt as defined by the +.I prompt3 +variable, followed by the corrected line, e.g. +.sp +.RS +.6i +.nf +> lz /usr/bin +CORRECT>ls /usr/bin (y/n)? +.fi +.RE +.sp +Answering 'y' or at the prompt +will cause the corrected line to be used, +anything else will leave the original line unchanged. +.PP +Automatic correction is not guaranteed to work the way the user intended. +Command line parsing is done in a rudimentary fashion. It is mostly provided +as an experimental feature. Suggestions and improvements are welcome. +.PP +.SH "7. DOCUMENTATION LOOKUP" +The editor function +.I "run-help" +(M-h) prints a help file on the current command (using the same +definition of current as the completion routines use). This help file +is found by searching the path list HPATH for files of the form +foo.help, foo.1, foo.8, or foo.6 in that order (assuming that the +current command is foo). The file is just printed, not paged in any +way. This is because +.I run-help +is meant to be used to look up short help files, +not manual pages (although it can do manual pages also). +.PP +.SH "8. ENHANCED HISTORY MECHANISM" +.I Tcsh +will save the history list between login sessions. It does this by +writing the current list to the file "~/.history" on logout, and +reading it in on login. For example, placing the line +.sp +.RS +.6i +> set history=25 savehist=20 +.RE +.sp +tells +.I tcsh +to save the last 25 commands on the history list, and to +save the last 20 of them between logins. The "savehist" variable may +be set up to the size of history, although it is an error to have +.I savehist +larger than +.I history. +In addition to the above +.I tcsh, +keeps unparsed (literal) versions of the +history if the variable +.I histlit +is set. Also the toggle-history function toggles between +the parsed and literal version of the recalled history in the editor +buffer. For example: +.sp +.RS +.6i +.nf +> set histlit +> echo !:s/foo/bar; ls +Modifier failed. +> ^P +> echo !:s/foo/bar; ls +> unset histlit +> echo !:s/foo/bar; ls +Modifier failed. +> ^P +> echo unset histlit[M-r] +> echo !:s/foo/bar; ls +.fi +.RE +.sp +.I Tcsh +also supports the history escape +.I !#. +This undocumented +.I csh +escape holds the words of the current line. This is useful in renaming +commands: +.sp +.RS +.6i +.nf +> mv foo bar!#:1 +mv foo barfoo +.fi +.RE +.sp +Care should be taken when using this history expansion in +.I csh +since there is no check for recursion. In +.I tcsh +up to 10 levels of recursion are allowed. +.PP +Another difference between +.I tcsh +and +.I csh +history expansion, is the treatment of history arguments. In +.I csh +.I "!3d" +expands to event 3 with the letter "d" appended to it. +There is no way to repeat a command that begins with a number using +the name of the command in the history escape. In +.I tcsh +only numeric arguments are treated as +event numbers; therefore +.I "!3d" +is interpreted as: repeat the last command that +started with the string "3d". To mimick the +.I csh +behavior +.I "!3\ed" +can be used. + +.PP +.SH "9. AUTOMATIC LOGOUT" +The automatic logout time is controlled by the variable +.I autologout, +the value of which is the number of minutes of inactivity will be +allowed before automatically logging the user out. When that many +minutes have been reached, the shell prints "autologout" and dies +(without executing ~/.logout). The default for +.I tcsh +is to set +.I autologout +for 60 minutes on login shells, and when the user is root. To disable +autologout (for instance in a window system), unset the shell variable +.I autologout. +.PP +.SH "10. EXECUTION OF A COMMAND PRIOR TO EACH PROMPT" +.I Tcsh +supports a special alias, +.I precmd, +which if set holds a command that will be executed before printing +each prompt. For example, if the user has done +.sp +.RS +.6i +> alias precmd date +.RE +.sp +then the program +.I date +will be run just before the shell prompts for each command. There are +no limitations on what precmd can be set to do, although discretion +should be used. +.PP +.SH "11. PERIODIC COMMAND EXECUTION" +.I Tcsh +is now capable of providing periodic command execution +through the use of the shell variable +.I tperiod +and the alias +.I periodic. +When these items are set, the alias +.I periodic +will be executed every +.I tperiod +minutes. +This provides a convenient means for checking on common but +infrequent changes, such as new messages. +Example: +.nf +.sp +.RS +.6i +> set tperiod = 30 +> alias periodic checknews +.RE +.sp +.fi +This will cause the \fIchecknews\fR(1) program to be run every 30 minutes. +Having the alias +.I periodic +set but with an unset +.I tperiod +(or a value of 0 for +.I tperiod) +will cause +.I periodic +to degenerate to another form of +.I precmd. +.PP +.SH "12. NEW PROMPT FORMAT" +The format for the +.I prompt +shell variable has been changed to include many new things, such as +the current time of day, current working directory, etc.. The new +format uses "%" to signal an expansion, much like +.I printf(3S). +The available sequences are: +.sp +.RS +.6i +.ta 1.2i 1.7i +.nf +%d or %/ Current working directory. +%~ cwd. If it starts with $HOME, that part is + replaced by a ~. In addition if a directory + name prefix matches a user's home directory, + that part of the directory will be substituted + with ~user. NOTE: The ~user substitution will + only happen if the shell has performed a ~ + expansion for that user name in this session. +%c or %. Trailing component of cwd, may be + followed by by a digit to get more than one + component, if it starts with $HOME, that + part is replaced with a ~. +%C Trailing component of cwd, may be followed + by a digit to get more than one component, no + ~ substitution. +%h, %!, ! Current history event number. +%M The full machine hostname. +%m The hostname up to the first ".". +%S (%s) Start (stop) standout mode. +%B (%b) Start (stop) boldfacing mode. (Only if + tcsh was compiled to be eight bit clean.) +%U (%u) Start (stop) underline mode. (Only if + tcsh was compiled to be eight bit clean.) +%t or %@ Current time of day, in 12-hour, am/pm format. +%T Current time of day, in 24-hour format. + (But see the \fIampm\fP shell variable below.) +\ec `c' is parsed the same way as in bindkey. +^c `c' is parsed the same way as in bindkey. +%% A single %. +%n The user name, contents of $user. +%w The date in dd format. +%W The date in mm/dd/yy format. +%D The date in yy-mm-dd format. +%l The line (tty) the user is logged on. +%L clear from prompt to end of display or end of line. +%# A `#' if tcsh is run as a root shell, + a `>' if not. +%{..%} Include string as a literal escape sequence. + Note that the enclosed escape sequence, should + only be used to change terminal attributes and + should not move the cursor location. Also, this + cannot be the last character in the prompt + string. (Available only if tcsh was compiled to + be eight bit clean.) +%? return code of the last command executed just + before the prompt. +%R In prompt3 this is the corrected string; in + prompt2 it is the status of the parser. +.RE +.DT +.fi +.sp +The sequences for standout are often used to indicate that this is an +enabled (running as root) shell. +An example: +.sp +.RS +.6i +.ta 2i 3i +.nf +.ie t \{\ +> set prompt="%m [%h] %B[%@]%b [%/] you rang? " +tut [37] \fB[2:54pm]\fR [/usr/accts/sys] you rang? _ +.\} +.el \{\ +> set prompt="%m [%h] %U[%@]%u [%/] you rang? " +tut [37] \fI[2:54pm]\fR [/usr/accts/sys] you rang? _ +.\} +.RE +.DT +.fi +.sp +In addition, there is a new variable, +.I prompt2, +which is used to prompt for the body of while and for loops (wherever +normal +.I csh +prompts with a question mark). The default for +.I prompt2 +is "%R? ": the status of the parser followed by a question mark. +This alternate prompt is also used when the parser is waiting for more input; +i.e. when the previous line ended in a \\. +The +.I prompt3 +variable is used when displaying the corrected command line when +automatic spelling correction is in effect; it defaults to +"CORRECT>%R (y|n)? ". + +.PP +.SH "13. TIME-STAMPED HISTORY LIST" +The history list in +.I tcsh +now has a time-of-day stamp attached to +each history list event. +This time stamp is printed whenever the history command is executed. +This allows the user to keep track of when the various events occurred. +The time stamps are not maintained on the saved history list (also +available in \fIcsh\fR); thus, on logging back in, all the saved history +events will be recorded with the login time as their time stamp. +The time stamp printouts can be omitted from the history list by adding the +-t switch to the \fIhistory\fR command. +.PP +.SH "14. DIRECTORY ACCESS" +.I Tcsh +supports three new flags to control directory style printing for +cd, pushd, popd, and dirs: +.TP 4 +.I "-n " +Print entries in new lines so that the screen width is not exceeded +.TP 4 +.I "-l" +Don't print \~ but print the whole path +.TP 4 +.I "-v" +Print the stack entries one in each line, preceeded by the stack number. +.PP +Note that popd +n can be used to pop out stack entries of directories that +do not exist any more. +.PP +.I Tcsh +will now allow the user to access all elements in the directory stack directly. +The syntax "=" is recognized by +.I tcsh +as indicating a particular directory +in the stack. +(This works for the file/command name recognition as well.) +This syntax is analogous to the ~ syntax for access to users' home +directories. +The stack is viewed as zero-based, i.e., =0 is the same as $cwd, which is +the same as ".". +As a special case, the string "=-" is recognized as indicating the last +directory in the stack. +Thus, +.nf +.sp +.RS +.6i +> dirs -v +0 /usr/net/bin +1 /usr/spool/uucp +2 /usr/accts/sys +> echo =2 +/usr/accts/sys +> ls -l =1/LOGFILE +-rw-r--r-- 1 uucp 2594 Jan 19 09:09 /usr/spool/uucp/LOGFILE +> echo =-/.cs* +/usr/accts/sys/.cshrc +> echo =4 +Not that many dir stack entries. +> +.RE +.sp +.fi +.I Tcsh +will complain if you ask for a directory stack item +which does not exist. +.PP +In the normal +.I csh, +saying "pushd +2" would rotate the entire stack +around through 2 stack elements, placing the entry found there +at the top of the stack. +If, however, the new shell variable +.I dextract +is set, then issuing "pushd +n" will cause the nth directory stack +element to be extracted from its current position, which will then be +pushed onto the top of the stack. Example: +.sp +.nf +.RS +.6i +> dirs +~ /usr/spool/uucp /usr/net/bin /sys/src +> set dextract +> pushd +2 +/usr/net/bin ~ /usr/spool/uucp /sys/src +> unset dextract +> pushd +2 +/usr/spool/uucp /sys/src /usr/net/bin ~ +.RE +.fi +.PP +The way symbolic links that point to directories are crossed is +determined by two variables: +.I chase_symlinks +and +.I ignore_symlinks. +If +.I chase_symlinks +is set, then every time the directory changes, +.I $cwd +reflects the real directory name, and not the name through the link. +A notable exception is the user's home directory, but that should +be fixed. If +.I ignore_symlinks +is set, then directory change tries to find where +you came from before you crossed the link to change the directory +relatively. If you chdir through a symbolic link +and then cd .., +you will end .. relatively to where you were before +you crossed the link and not .. relatively to +where the symbolic link points. +.PP +For example: +.sp +.nf +.RS +.6i +> cd /tmp +> mkdir from from/src to +> ln -s ../from/src to/dst +> echo $cwd +/tmp + +> unset ignore_symlinks; unset chase_symlinks +> cd to/dst; echo $cwd +/tmp/to/dst +> cd .. +/tmp/from + +> unset ignore_symlinks; set chase_symlinks +> cd /tmp/to/dst; echo $cwd +/tmp/from/src +> cd ..; echo $cwd +/tmp/from + +> set ignore_symlinks; unset chase_symlinks +> cd /tmp/to/dst; echo $cwd +/tmp/to/dst +> cd ..; echo $pwd +/tmp/to +.RE +.sp +.fi +In case you are wondering what happens when you set both, +.I ignore_symlinks +will override +.I chase_symlinks. +.PP +.SH "15. WATCHING FOR LOGINS AND LOGOUTS" +.I Tcsh +has a mechanism so that the user can watch for login and logout +activity of any user or terminal in the system. +This is accomplished using the new special shell variable +.I watch, +which contains login/terminal name pairs to be checked for activity. +For example: +.nf +.sp +.RS +.6i +> set watch=(sys ttyjd root console) +.RE +.sp +.fi +This setting will allow the user to check on when the user "sys" logs in on +/dev/ttyjd. Similarly, it will inform the user of root's activity on the +console. In order to be more general, the word "any" may be substituted for +either a user's or a terminal's name, thus allowing +.nf +.sp +.RS +.6i +> set watch=(brad any any ttyh0) +.RE +.sp +.fi +which will check for user "brad" logging in or out of the system on any +terminal, as well as anyone logging in to /dev/ttyh0. +Naturally, the completely general case +.nf +.sp +.RS +.6i +> set watch=(any any) +.RE +.sp +.fi +allows the user to check on any and all login/logout activity in the +the system. +.PP +By default, the interval between checks of users on the system is +10 minutes; +this can be changed by making the first element of +.I watch +a number of minutes which should be used instead, as in +.nf +.sp +.RS +.6i +> set watch=(40 any any) +.RE +.sp +.fi +which will check for any users logging in or out every 40 minutes. +.PP +There is also a new command, +.I log, +which is used to cause +.I tcsh +to inform the user of all users/terminals +affected by +.I watch +whether they have been announced before or not. +This is useful if a user has been on for some time and cannot remember +if a particular person/terminal is online right now or not. +.I Log +will reset all indication of previous announcement and give the user +the login list all over again, as well as printing the current value +of +.I watch. +.PP +The first time that +.I watch +is set at +.I tcsh +startup, all affected users and terminals will be +printed as though those users/terminals had just logged on. +This may appear to be a bug, but is generally considered a feature, +since it allows the user to see who is on when he first logs in. +.PP +The format of the printouts can be tailored via setting of the variable +.I who. +The following sequences are available for the format specification: +.sp +.RS +.6i +.ta 1.2i 1.7i +.nf +%n The name of the user that logged in/out. +%a The observed action, i.e. "logged on", + "logged off", or "replaced on". +%l The line (tty) the user is logged on. +%S (%s) Start (stop) standout mode. +%B (%b) Start (stop) boldfacing mode. (Only if + tcsh was compiled to be eight bit clean) +%U (%u) Start (stop) underline mode. (Only if + tcsh was compiled to be eight bit clean) +%M The full hostname of the remote host ("local" + if non-remote). +%m The hostname up to the first ".". If only + the ip address is available or the utmp + field contains the name of an x-windows + display, the whole name is printed. +%t or %@ The time, in 12-hour, am/pm format (logout + time is approximated if unavailable). +%T The time, in 24-hour format. (but see + the "ampm" shell variable below). +%w The date in dd format. +%W The date in mm/dd/yy format. +%D The date in yy-mm-dd format. +.RE +.DT +.fi +.sp +The %M and %m sequences are only available on systems that store the +remote hostname in /var/run/utmp. If +.I who +is not set, the format defaults to "%n has %a %l from %m.", or +"%n has %a %l." on systems that don't store the hostname. +.PP +.SH "16. TIMED EVENT LIST" +.I Tcsh +now supports a scheduled-event list through the use of the command +.I sched. +This command gives the user a mechanism by which to arrange for other +commands to be executed at given times. +An event is added to the scheduled-event list by saying +.nf +.sp +.RS +.6i +> sched [+]hh:mm +.RE +.sp +.fi +as in +.nf +.sp +.RS +.6i +> sched 11:00 echo It\\'s eleven o\\'clock. +.RE +.sp +.fi +This will make an entry in the list at 11am for the echo command +to be run with the given arguments. +The time may be specified in either absolute or relative time, +and absolute times may have a morning/afternoon specification as +well, using "am" or "pm." +For example, +.nf +.sp +.RS +.6i +> sched +2:15 /usr/sbin/uucico -r1 -sother +> sched 5pm set prompt='[%h] It\\'s after 5; go home: >' +> sched +3am echo This syntax doesn\\'t work. +Relative time inconsistent with am/pm. +> +.RE +.sp +.fi +Note that +.I tcsh +will complain if you try to make faulty +time specifications. +.PP +Printing the current time-event list is accomplished by giving the +.I sched +command with no arguments: +.nf +.sp +.RS +.6i +> sched + 1 Wed Apr 4 15:42 /usr/sbin/uucico -r1 -sother + 2 Wed Apr 4 17:00 set prompt=[%h] It's after 5; go home: > +> +.RE +.sp +.fi +There is also a mechanism by which the user can remove an item +from the list: +.nf +.sp +.RS +.6i +> sched --3 +Usage for delete: sched -. +> sched -3 +Not that many scheduled events. +> sched -2 +> sched + 1 Wed Apr 4 15:42 /usr/sbin/uucico -r1 -sother +> +.RE +.sp +.fi +All commands specified on the scheduled-event list will be executed just +prior to printing the first prompt immediately following the time +when the command is to be run. +Hence, it is possible to miss the exact time when the command is +to be run, but +.I tcsh +will definitely get around to all commands +which are overdue at its next prompt. +Scheduled-event list items which come due while +.I tcsh +is waiting for +user input will be executed immediately. +In no case, however, will normal operation of already-running +commands be interrupted so that a scheduled-event list element +may be run. +.PP +This mechanism is similar to, but not the same as, the +.IR at (1) +command on some Unix systems. +Its major disadvantage is that it does not necessarily run a +command at exactly the specified time (but only if another +command is already being run). +Its major advantage is that commands which run directly from +.I tcsh, +as sched commands are, have access to shell variables and other +structures. +This provides a mechanism for changing one's working environment +based on the time of day. +.PP +.SH "17. BUILTIN FOR ls -F" +There is a new builtin command called +.I ls-F +which does the same thing as the command "ls -aF" if the shell +variable +.I showdots +has been set, and acts like "ls -F" otherwise. Ls-F works like +ls, only it is generally faster. If other switches are passed +to +.I ls-F, +then the normal ls is executed. Aliasing ls to ls-F provides +a fast alternative way of listing files. +Note that on non BSD machines, where ls -C is not the default, +.I ls-F, +behaves like ls -CF. +.sp +.I ls-F +appends the following characters depending on the file type: +.sp +.RS +.6i +.ta 1.2i 1.7i +.nf += File is an AF_UNIX domain socket. + [if system supports sockets] +| File is a named pipe (fifo) + [if system supports named pipes] +% File is a character device +# File is a block device +/ File is a directory +* File is executable ++ File is a hidden directory [aix] + or context dependent [hpux] +: File is network special [hpux] +.RE +.DT +.fi +.sp +On systems that support symbolic links the variable +.I listlinks +controls the way symbolic links are identified. If +.I listlinks +is not set then the character '@' is appended to +the file. If +.I listlinks +is set then the following characters are appended to the +filename depending on the type of file the symbolic links +points to: +.sp +.RS +.6i +.ta 1.2i 1.7i +.nf +@ File is a symbolic link pointing + to a non-directory +> File is a symbolic link pointing + to a directory +& File is a symbolic link pointing + to nowhere +.RE +.DT +.fi +.sp +While setting +.I listlinks +can be helpful while navigating around the filesystem, it slows down +.I ls-F +and it causes mounting of filesystems if the symbolic links point +to an NFS automounted partition. +.PP +.SH "18. GLOBBING SYNTAX ADDITIONS" +The syntax for any character in a range (for example ".[a-z]*") has +been extended so as to conform with standard Unix regular expression +syntax (see +.IR ed (1)). +Specifically, after an open bracket ("["), if the first character is a +caret ("^") then the character matched will be any not in the range +specified. For example: +.sp +.nf +.RS +.6i +> cd ~ +> echo .[a-z]* +\&.cshrc .emacs .login .logout .menuwmrc +> echo .[^.]* +\&.Xdefaults .Xinit .cshrc .emacs .login .logout .menuwmrc +> +.RE +.fi +.sp +Note that the second form includes .Xdefaults and .Xinit because 'X' +(and all the lower case letters) are outside of the range of a single '.'. +.PP +Also the ability to negate a regular expression has been added: +.sp +.nf +.RS +.6i +> echo * +foo foobar bar barfoo +> echo ^foo* +bar barfoo +.RE +.fi +.sp +Note that this does not work correctly if the expression does not have +any wildcard characters (?*[]) or if the expression has braces {}. +.PP +.SH "19. NEW ENVIRONMENT AND SHELL VARIABLES" +On startup, +.I tcsh +now automatically initializes the environment variable +.I HOST +to the name of the machine that it is running on. It does this by +doing a +.IR gethostname (2) +system call, and setting +.I HOST +to the result. +.PP +.I Tcsh +also initializes the environment variable +.I HOSTTYPE +to a symbolic name for the type of computer that it is running on. +This is useful when sharing a single +physical directory between several types of machines (running NFS, for +instance). For example, if the following is in +.I .login: +.sp +.RS +.3i +set path = (~/bin.$HOSTTYPE /usr/ucb /bin /usr/bin /usr/games .) +.RE +.sp +and the user has directories named "bin.\fImachine\fR" (where +.I machine +is a name from the above list), then the user can have the same +programs compiled for different machines in the appropriate +"bin.\fImachine\fR" directories and +.I tcsh +will run the binary for the correct machine. +.sp +The current possible values are: +.sp +.ta 1.5i +.nf +\fIaix370\fR an IBM 370, running aix +\fIalliant\fR an Alliant FX series +\fIapollo\fR an Apollo running DomainOS +\fIatt3b15\fR an AT&T 3b15 +\fIatt3b20\fR an AT&T 3b20 +\fIatt3b2\fR an AT&T 3b2 +\fIatt3b5\fR an AT&T 3b5 +\fIbalance\fR a Sequent Balance (32000 based) +\fIbutterfly\fR a BBN Computer Butterfly 1000 +\fIconvex\fR a Convex +\fIdecstation\fR a DecStation XXXX +\fIgould-np1\fR a Gould NP1 +\fIhp300\fR an HP 9000, series 300, running mtXinu +\fIhp800\fR an HP 9000, series 800, running mtXinu +\fIhp9000s300\fR an HP 9000, series 300, running hpux +\fIhp9000s700\fR an HP 9000, series 700, running hpux +\fIhp9000s800\fR an HP 9000, series 800, running hpux +\fIhp\fR an HP, running hpux +\fIi386-mach\fR an Intel 386, running mach +\fIiris4d\fR a Silicon Graphics Iris 4D +\fIm88k\fR an mc88000 CPU machine +\fImac2\fR an Apple Computer Macintosh II, running AUX +\fImasscomp\fR a Concurrent (Masscomp), running RTU +\fImips\fR another mips CPU +\fImultimax\fR an Encore Computer Corp. Multimax (32000 based) +\fInext\fR a NeXT computer +\fInews\fR a Sony NEWS 800 or 1700 workstation +\fInews_mips\fR a NeWS machine with mips CPU +\fIns32000\fR an NS32000 CPU machine +\fIpfa50\fR a PFU/Fujitsu A-xx computer +\fIps2\fR an IBM PS/2, running aix +\fIptx\fR a Sequent Symmetry running DYNIX/ptx (386/486 based) +\fIpyramid\fR a Pyramid Technology computer (of any flavor) +\fIrs6000\fR an IBM RS6000, running aix +\fIrt\fR an IBM PC/RT, running BSD (AOS 4.3) or mach +\fIrtpc\fR an IBM PC/RT, running aix +\fIsun2\fR a Sun Microsystems series 2 workstation (68010 based) +\fIsun386i\fR a Sun Microsystems 386i workstation (386 based) +\fIsun3\fR a Sun Microsystems series 3 workstation (68020 based) +\fIsun4\fR a Sun Microsystems series 4 workstation (SPARC based) +\fIsun\fR a Sun workstation of none of the above types +\fIsymmetry\fR a Sequent Symmetry running DYNIX 3 (386/486 based) +\fItitan\fR an Stardent Titan +\fIvax\fR a Digital Equipment Corp. Vax (of any flavor) +.DT +.fi +.sp +(The names of the machines are usually trade marks of the +corresponding companies.) +.PP +.I Tcsh +also initializes the shell variables +.I uid +and +.I gid +to the value of the current real user ID/GID. This is useful for telling +what user/group the shell is running as. Under Domain/OS +.I tcsh +will also set +.I oid +indicating the current real organization id. +.PP +.SH "20. COMMANDS FOR DEBUGGING" +Only two such commands are available at this point, both concerned with +testing termcap entries. +.br +.I telltc +tells you, politely, what +.I tcsh +thinks of your terminal, and +.I settc +`cap' `value' +tells +.I tcsh +to believe that the termcap capability `cap' ( as defined in +.IR termcap (5) +) has the value `value'. No checking for sanity is performed, so beware of +improper use. +.PP +.SH "21. SEARCHING FOR THE VISUAL HISTORY" +Two new editor functions have been added: history-search-backward, +bound to M-p (and M-P), and history-search-forward, bound to M-n (and +M-N). Each of these search backward (or forward) through the history +list for previous (next) occurrence of the first word in the input +buffer as a command. That is, if the user types: +.sp +.nf +.RS +.6i +> echo foo +foo +> ls +filea fileb +> echo bar +bar +> +.RE +.fi +.sp +and then types "echop", the shell will place "echo bar" in the +editing buffer. If another \fIM-p\fR was entered, the editing buffer +would change to "echo foo". This capability is compatible with the +plain visual history; if the user were to then enter \fI^P\fR the +editing buffer would be changed to "ls". The pattern used to search +through the history is defined by the characters from the beginning of +the line up to the current cursor position and may contain a shell globbing +pattern. Successive history searches use the same pattern. +.PP +.SH "22. BUILTIN WHICH(1) COMMAND" +There is now a builtin version of the +.IR which (1) +command. The builtin version is just like the original, except that +it correctly reports aliases peculiar to this +.I tcsh, +and builtin commands. The only other difference is that the builtin +runs somewhere between 10 and 100 times faster. +There is also a key-function interface to this command: the +.I which-command +function (normally bound to M-?), can be used anywhere on the command line, +and will in effect do a 'which' on the command name. +.PP +.SH "23. RESTARTING A STOPPED EDITOR" +There is another new editor function: run-fg-editor, which is bound to +\fIM-^Z\fR. When typed, it saves away the current input buffer, and +looks for a stopped job with a name equal to the file name part (last +element) of either the EDITOR or VISUAL environment variables (if not +defined, the default names are "ed" and "vi" respectively). If such a +job is found, then it is restarted as if "fg %\fIname\fR" had been +typed. This is used to toggle back and forth between an editor and +the shell easily. Some people bind this function to \fI^Z\fR so they +can do this even more easily. +.PP +.SH "24. STATUS LINE SUPPORT +.I Tcsh +has a new builtin called +.I echotc +that allows the user to access the terminal capabilities from the command +line, similar to the system V +.IR tput (1). +.sp +.RS +.6i +> echotc home +.RE +.sp +Places the cursor at the home position and +.sp +.RS +.6i +> echotc cm 3 10 +.RE +.sp +places the cursor at column 3 row 10. +This command replaces the +.I el +and +.I sl +variables that used contain the escape sequences to begin and end +status line changes. The command: +.sp +.RS +.6i +> echo $sl this is a test $el +.RE +.sp +is replaced by: +.sp +.RS +.6i +> echotc ts 0; echo "this is a test"; echotc fs +.RE +.sp +In addition +.I echotc +understands the arguments +.I baud, +.I lines, +.I cols, +.I meta, +and +.I tabs +And prints the baud rate, the number of lines and columns, and "yes" or +"no" depending if the terminal has tabs or a meta key. +This can be useful in determining how terse the output of commands +will be depending on the baud rate, or +setting limits to commands like history to the highest number +so that the terminal does not scroll: +.sp +.RS +.6i +> set history=`echotc lines` +.RE +.RS +.6i +> @ history-- +.RE +.sp +Note: Termcap strings may contain wildcard characters, and echoing them +will not work correctly. The suggested method of setting shell variables +to terminal capability strings is using double quotes, as in the following +example that places the date in the status line: +.sp +.RS +.6i +> set tosl="`echotc ts 0`" +.RE +.RS +.6i +> set frsl="`echotc fs`" +.RE +.RS +.6i +> echo -n "$tosl";date; echo -n "$frsl" +.RE +.sp +.I Echotc +accepts two flags. The flag +.I \-v +enables verbose messages and the flag +.I \-s +ignores any errors and returns the empty string if the capability is not +found. + +.PP +.SH "25. EXECUTION OF A COMMAND AFTER CHANGING THE CURRENT WORKING DIRECTORY" +.I Tcsh +now supports a special alias, +.I cwdcmd, +which if set holds a command that will be executed after changing the +value of $cwd. For example, if the user is running on an X window +system xterm, and has done +.sp +.RS +.6i +> alias cwdcmd 'echo -n ^[]2 $hostname $cwd ^G' +.RE +.sp +then the shell +will change the title of the running xterm to be the name of the host, +a colon, and the full current working directory. Note that if a user +defines +.I cwdcmd +to contain a +.I cd, +.I pushd, +or +.I popd, +command, an infinite loop may result. In this case, it is the +author's opinion that said user will get what he deserves. +.PP +.SH "26. NATIVE LANGUAGE SYSTEM" +.I Tcsh +is eight bit clean (if so compiled, see the description of the +.I version +shell variable below), and will thus support character sets needing this +capability. +The +.I tcsh +support for NLS differs depending on whether +it was compiled to use the system's NLS (again, see the +.I version +variable) or not. +In either case, the default for character classification +(i.e. which characters are printable etc) and sorting +is 7-bit ascii, and any setting or unsetting of the LANG or LC_CTYPE +environment variables will cause a check for possible changes in these +respects. +.PP +When using the system's NLS, the +.I setlocale +C library function will be called +to determine appropriate character classification and +sorting - this function will typically examine the LANG and LC_CTYPE +variables for this purpose (refer to the system documentation +for further details). +Otherwise, NLS will be simulated, by assuming that the +ISO 8859-1 character set is used +whenever either of the LANG and LC_CTYPE variables are set, regardless of +their values. Sorting is not affected for the simulated NLS. +.PP +In addition, with both real and simulated NLS, all printable +characters in the range \e200-\e377, i.e. those that have +M- bindings, are automatically rebound to +.I self-insert-command +(the corresponding binding for the escape+ sequence, if any, is +left alone). +This automatic rebinding is inhibited if the NOREBIND environment variable +is set - this may be useful for the simulated NLS, or a primitive real NLS +which assumes full ISO 8859-1 (otherwise all M- bindings in the +range \e240-\e377 will effectively be undone in these cases). +Explicitly rebinding the relevant keys, using +.I bindkey, +is of course still possible. +.PP +Unknown characters (i.e. those that are neither printable nor control +characters) will be printed using the \ennn format. +If the tty is not in 8 bit mode, other 8 bit characters will be printed by +converting them to ascii and using standout mode. +.I Tcsh +will never change the 7/8 bit mode of the tty, and will track user-initiated +settings for this - i.e. it may be necessary for NLS users +(or, for that matter, those that want to use a Meta key) to explicitly set +the tty in 8 bit mode through the appropriate +.IR stty (1) +command in e.g. the .login file. +.PP +.SH "27. AUTOMATIC PROCESS TIME REPORTING" +Automatic process time reporting is a feature that exists in +.I csh, +but it is usually not documented. In addition +.I tcsh +provides a slightly enriched syntax. Process time reports are controlled +via the +.I time +shell variable. +The first word of the +.I time +variable indicates the minimum number of CPU seconds the process has to +consume before a time report is produced. The optional second word controls +the format of the report. +The following sequences are available for the format specification: +.sp +.RS +.6i +.ta 1.2i 1.7i +.nf +%U The time the process spent in user mode + in cpu seconds. +%S The time the process spent in kernel mode + in cpu seconds. +%E The elapsed time in seconds. +%P The CPU percentage computed as (%U + %S) / %E. +.RE +.DT +.fi +.sp +The following sequences are supported only in systems that have the +BSD resource limit functions. +.sp +.RS +.6i +.ta 1.2i 1.7i +.nf +%W Number of times the process was swapped. +%X The average amount in (shared) text space used + in Kbytes. +%D The average amount in (unshared) data/stack + space used in Kbytes. +%K The total space used (%X + %D) in Kbytes. +%M The maximum memory the process had in use at + any time in Kbytes. +%F The number of major page faults (page needed to + be brought from disk). +%R The number of minor page faults. +%I The number of input operations. +%O The number of output operations. +%r The number of socket messages received. +%s The number of socket messages sent. +%k The number of signals received. +%w Number of voluntary context switches (waits). +%c Number of involuntary context switches. +.RE +.DT +.fi +.sp +The default time format is "%Uu %Ss %E %P %X+%Dk %I+%Oio %Fpf+%Ww" for +systems that support resource usage reporting and "%Uu %Ss %E %P" for +systems that do not. +.PP +For Sequent's DYNIX/ptx %X, %D, %K, %r and %s are not supported. +However, the following additional sequences are available. +.sp +.RS +.6i +.ta 1.2i 1.7i +.nf +%Y The number of system calls performed. +%Z The number of pages which are zero-filled + on demand. +%i The number of times a process' resident + set size was increased by the kernel. +%d The number of times a process' resident + set size was decreased by the kernel. +%l The number of read system calls performed. +%m The number of write system calls performed. +%p the number of reads from raw disk devices. +%q the number of writes to raw disk devices. +.RE +.DT +.fi +.sp +The default time format for Sequent's DYNIX/ptx is +"%Uu %Ss $E %P %I+%Oio %Fpf+%Ww". Also note that the +CPU percentage can be higher than 100% on multi-processors. +.PP +.SH "28. OS/DEPENDENT BUILTIN SUPPORT" +.sp +.br +.I "TRANSPARENT COMPUTING FACILITY" +.PP +On systems that support TCF (aix-ibm370, aix-ps2) the following builtins +have been added: +.TP 10 +.B getspath +Print the current system execution path. +.TP 10 +.B setspath LOCAL|| ... +Set the current execution path. +.sp +.TP +.B getxvers +Print the current experimental version prefix. +.sp +.TP +.B setxvers [] +If the optional string is ommited, any experimental version prefix is removed. +Otherwise the experimental version prefix is set to string. +.sp +.TP +.B migrate [-] |% ... +.PD 0 +.TP +.B migrate - +.PD +The first form migrates the process or job to the site specified or the +default site determined by the system path. +The second form, is equivalent to 'migrate - $$', i.e. migrates the +current process to the site specified. Note: migrating +.I tcsh +itself can cause unexpected behavior, since the shell +does not like to lose its tty. +.sp +.PP +In addition, jobs will print the site the job is executing. +.PP +.sp +.br +.I "Domain/OS Support" +.PP +.TP +.B inlib ... +Inlib adds shared libraries to the current enviroment. There is no way +to remove them... +.TP +.B rootnode // +Change the name of the current rootnode. From now on, +.I / +will resolve to +.I // +.TP +.B ver [] [] +Without arguments, print +.I $SYSTYPE; +with the +.I +provided, set +.I SYSTYPE +to the one provided. Valid systypes are bsd4.3 and sys5.3. If a +.I +is +argument is given, then +.I +is executed under the +.I +specified. +.PP +.sp +.br +.I "Mach" +.PP +.TP +.B setpath ... +XXX: What does it do? +.PP +.sp +.br +.I "Masscomp/RTU" +.PP +.TP +.B universe ... +Sets the current universe to the specified parameter. +.PP +.sp +.br +.I "Convex/OS" +.PP +.TP +.B warp [] ... +Without arguments prints the current value of the universe. With a universe +argument it sets the current universe to the value of the argument. +.sp +.SH "29. WINDOW SIZE TRACKING" +On systems that support SIGWINCH or SIGWINDOW, +.I tcsh +adapts to window resizing automatically and adjusts the environment +variables LINES and COLUMNS if set. Also if the environment variable +TERMCAP contains li#, and co# fields, these will be adjusted also to +reflect the new window size. + +.SH "30. INPUT FILES" +On startup +.I tcsh +will try to source +.I "/etc/csh.cshrc" +and then +.I "/etc/csh.login" +if the shell is a login shell. Then it will try to source +.I "$HOME/.tcshrc" +and then +.I "$HOME/.cshrc" +if +.I "$HOME/.tcshrc" +is not found. Then it will source +.I "$HOME/.login" +if the shell is a login shell. +On exit +.I tcsh +will source first +.I "/etc/csh.logout" +and then +.I "$HOME/.logout" +if the shell was a login shell. +.sp +Note: On +.I convexos +the names of the system default files are +.I "/etc/cshrc", +.I "/etc/login" +and +.I "/etc/logout" +respectively and on +.I irix +or +.I A/UX +only the file +.I "/etc/cshrc" +is executed if the shell is a login shell. + +.SH "31. COMMAND LINE OPTIONS" +This section describes options that are either undocumented in +.I csh +(*) +or present only in +.I tcsh. +(+) +.sp +.TP 4 +.I \-d +Load ~/.cshdirs (If +.I tcsh +was compiled with CSHDIRS enabled)(+) +.TP 4 +.I \-l +Make +.I tcsh +behave like a login shell. (+) +.TP 4 +.I \-m +Allow reading of a .cshrc that does not belong to the effective +user. Newer versions of +.I su(1) +can pass that to the shell. (some versions of csh have it) (+*) +.TP 4 +.I \-q +Make the shell accept SIGQUIT, and behave when it is used under a debugger. +Job control is disabled. (*) +.sp +.SH FYI +This shell uses cbreak mode but takes typed-ahead characters anyway. +You can still use +.IR stty (1) +to set some of the modes of your terminal (but not bindings). +.PP +This shell will restore your tty to a sane mode if it appears to +return from some command in raw, cbreak, or noecho mode. +.PP +.SH ENVIRONMENT +HPATH -- path to look for command documentation +.br +LANG -- used to give preferred character environment (see NLS) +.br +LC_CTYPE -- used to change only ctype character handling (see NLS) +.br +NOREBIND -- inhibits rebinding of printable characters to self-insert-command +.br +PATH -- path to look for command execution +.br +SHLVL -- current shell level nesting +.br +TERM -- used to tell how to handle the terminal +.br +LINES -- Number of lines in terminal (see WINDOW SIZE) +.br +COLUMNS -- Number of columns in terminal (see WINDOW SIZE) +.br +TERMCAP -- Terminal capability string (see WINDOW SIZE) +.br +SYSTYPE -- The current system type (Domain OS only) +.PP +.SH "NEW SHELL VARIABLES" +.br +.TP 10 +.B addsuffix +add a / for directories, and a space for normal files when +complete matches a name exactly. +If unset don't add anything extra. +.TP 10 +.B ampm +show all times in 12 hour, AM/PM format. +.TP 10 +.B autocorrect +Correct mis-spelled path components automatically before attempting +completion. +.TP 10 +.B autoexpand +invoke the expand-history function automatically on completion. +.TP 10 +.B autolist +list possibilities on an ambiguous completion. +.TP 10 +.B autologout +number of minutes of inactivity before automatic logout. +.TP 10 +.B chase_symlinks +always resolve symbolic links to real names on cd, etc. +.TP 10 +.B correct +automatically try to correct the spelling of commands. +Must be set to either correct=cmd, only command name will be corrected, +or correct=all, the whole line will be corrected. +.TP 10 +.B dextract +extract a directory on pushd rather than rotating. +.TP 10 +.B edit +use the input editor, set by default. +.TP 10 +.B fignore +list of file name suffixes (e.g. .o, ~) to ignore during complete. +.TP 10 +.B gid +the current real group id. +.TP 10 +.B histlit +If set, history lines in the editor will be shown with its literal value (that +is the line as it was input) instead of the shells lexical version. The current +history line can be toggled between literal and lexical with the +toggle-literal-history function. +History lines saved at shell exit are also saved as this variable indicates. +.TP 10 +.B ignore_symlinks +don't resolve symbolic links to real names on cd, etc. +.TP 10 +.B listjobs +list all jobs when suspending. set listjobs=long, produces long +format. +.TP 10 +.B listlinks +Resolve symbolic links when listing files so that the correct filetype +is shown. +.TP 10 +.B listmax +maximum number of items to list without asking first. +.TP 10 +.B matchbeep +control beeping on completion. With matchbeep=nomatch, completion +only beeps when there is no match, with matchbeep=ambiguous, beeps also +when there are multiple matches, with matchbeep=notunique, beeps when +there is one exact and other longer matches, with matchbeep=never, it +never beeps. +.TP 10 +.B nobeep +Disables beeping completely. +.TP 10 +.B oid +The organization id number (Domain OS only). +.TP 10 +.B printexitvalue +if an interactive program exits non-zero, print the +exit value. +.TP 10 +.B prompt +the string to prompt with. +.TP 10 +.B prompt2 +the string to prompt for while and for loops with. +.TP 10 +.B prompt3 +the string to prompt with when automatic spelling correction has +corrected a command line. +.TP 10 +.B pushdtohome +make pushd with no args do a "pushd ~" (like cd does). +.TP 10 +.B pushdsilent +do not print the dir stack on every pushd and popd. +.TP 10 +.B recexact +recognize exact matches even if they are ambiguous. +.TP 10 +.B recognize_only_executables +list choices of commands only displays files +in the path that are executable (slow). +.TP 10 +.B rmstar +Prompt the user before execution of `rm *'. +.TP 10 +.B savehist +number of history items to save between login sessions. +.TP 10 +.B shlvl +Integer value indicating the number +of nested shells. +.TP 10 +.B showdots +show hidden files in list and complete operations. +.TP 10 +.B tcsh +Contains the current version of the shell as R.VV.PP. The +.I R +indicates the major release number, the +.I VV +the current +version and the +.I PP +the patchlevel. +.TP 10 +.B term +the terminal type; see above. +.TP 10 +.B tperiod +periodic command wait period (in minutes). +.TP 10 +.B tty +The name of the tty, or empty if not attached to one. +.TP 10 +.B uid +the current real user ID. +.TP 10 +.B version +the version ID stamp for this +.I tcsh. +It contains, the origin of this version of +.I tcsh, +the date this version +was released and a string containing a comma separated list of the +compile time options enabled: +.ta 0.7i 0.9i +.nf +8b 7b If tcsh was compiled to be eight bit clean + or not. The default is 8b. +nls Set if tcsh uses the system's NLS, should be + the default for systems that have NLS. +lf Set if tcsh should execute .login before + .cshrc on login shells. Default is not set. +dl Set if tcsh should put . last on the path + for security. Default is set. +vi Set if tcsh's default editor is vi. Default + is unset (emacs) +dtr Set if tcsh should drop dtr on login shells + when exiting. Default is unset. +bye Set if tcsh should accept bye in addition + to logout, and rename log to watchlog. + Default is unset. +al Set if tcsh should determine if autologout + should be enabled. The default is set. +dir Set if tcsh should save and restore the directory + stack. +kan Set if tcsh is compiled for Kanji. + (ignore the iso character set.) Default is unset. +sm Set if tcsh was compiled to use the system's malloc. +.RE +.DT +.fi +.sp +In addition to the above strings, administrators can +enter local strings to indicate differences in the local version. + +.TP 10 +.B visiblebell +use the visible bell (screen flash) rather than audible bell. +.TP 10 +.B watch +list of events to watch. +.TP 10 +.B who +format string for the printouts generated when \fIwatch\fR is set. +.TP 10 +.B wordchars +list of nonalphanumeric characters considered part of a word for the purpose +of the forward-word, backward-word etc functions +-- defaults to "*?_-.[]~=". +.PP +.SH "NEW SPECIAL ALIASES" +.TP 10 +.I cwdcmd +the command is run after every change of working directory. +.TP 10 +.I periodic +the command to be run every \fItperiod\fR minutes. +.TP 10 +.I precmd +the command to be run prior to printing each prompt. +.PP +.SH "SEE ALSO" +csh(1), chsh(1), termcap(5) +.SH BUGS +The screen update for lines longer than the screen width is very poor +if the terminal cannot move the cursor up (i.e. terminal type "dumb"). + +I am certain that there are bugs. Bugs (preferably with fixes) +should be sent to Christos Zoulas (christos@ee.cornell.edu). +.PP +.SH VERSION +This man page documents tcsh 6.00.00 (Cornell) 07/04/91. +.PP +.SH AUTHORS +Ken Greer, HP Labs, 1981 +.br +Wrote the command completion. +.sp +Mike Ellis, Fairchild, 1983 +.br +Added command name recognition/completion. +.sp +Paul Placeway, Ohio State CIS dept., 1983 +.br +Added the command line editor. +.sp +Rayan Zachariassen, University of Toronto, 1984 +.br +Added the builtin +.I which +feature to the editor, and the code for +.I "ls-F". +Also numerous bug fixes, modifications, and performance enhancements. +.sp +Chris Kingsley, Caltech +.br +Wrote the fast storage allocator routines (nmalloc.c). +.sp +Karl Kleinpaste, CCI 1983-4 +.br +Added special aliases, directory stack extraction stuff, login/logout watch, +and scheduled events. Also came up with the idea of the new prompt format. +.sp +Paul Placeway, Ohio State CIS dept., 1987 +.br +Re-wrote the editor, cleaned up +other code, and added the prompt routines, added to the syntax for +file name expressions, and sped up the shell some. +.sp +Chris Grevstad, TRW, 1987 +.br +Ported the 4.3 csh sources to tcsh. +.sp +Christos S. Zoulas, Cornell U. EE dept., 1987-90 +.br +ported tcsh to HPUX, and System V rel. 2 and 3 and wrote a SysV version of +getwd.c. Added SHORT_STRINGS support. +.sp +James J Dempsey, BBN, 1988, and Paul Placeway, OSU, 1988 +.br +Re-ported tcsh to A/UX. +.sp +.SH "BUGFIXES AND ENHANCEMENTS" +Eric Schnoebelen, Convex, 1990 +.br +Convex support, lots of csh bug fixes, save and restore of directory stack. +.sp +Jaap Vermeulen, Sequent, 1990-91 +.br +Vi mode fixes, expand-line, window change fixes, ported to symmetry machines. +.sp +Ron Flax, Apple, 1990 +.br +Ported again to A/UX 2.0 +.sp +Dan Oscarsson, LTH Sweden, 1990 +.br +NLS support and simulated for non NLS sites. +Correction of file names also handles the case when +the / is replaced by another character. +The editor does not switch into cbreak mode unless needed. +The shell will not use character attributes when output is not +to a tty. +.sp +Johan Widen, SICS Sweden, 1990 +.br +Shell level variable, mach support, correct-line, 8-bit printing. +.sp +Matthew T. Day, Sanyo/ICON, 1990 +.br +Added POSIX termio support; Fixed limit stuff for SysV. +.sp +Hans J. Albertsson (Sun Sweden) +.br +Added the ampm variable handling, DING!, and the settc and telltc builtins. +.sp +Michael Bloom +.br +Fixed some of the interrupt handling. +.sp +Michael Fine, Digital Equipment Corp +.br +added the extended key support. +.sp +Daniel Long, NNSC, 1988 +.br +Added the wordchars variable. +.sp +George Hartzell, MCD Biology, University of Colorado-Boulder, 1988 +.br +Fixed the always reseting to DEL bug. +.sp +Patrick Wolfe, Kuck and Associates, Inc., 1988 +.br +Cleaned up VI mode and wrote the new editor description (in section +1). +.sp +Jak Kirman, 1988 +.br +Fixed the SunOS 4 giant stack allocation bug. +.sp +Bruce Robertson, Tektronix, 1989 +.br +Fixed setting erase and kill (again). +.sp +David C Lawrence, Rensselaer Polytechnic Institute, 1989 +.br +Added "autolist" variable and code to list possibilities on ambiguous +completion. +.sp +Martin Boyer, Institut de recherche d'Hydro-Quebec, 1991. +.br +Modified "autolist" variable and code to give options on beeping +behavior. Modified the history search to search for the whole string +from the beginning of the line to the cursor. +.sp +Alec Wolman, DEC, 1989 +.br +Added code to allow newlines in the prompt. +.sp +Matt Landau, BBN, 1989 +.br +Fixed YP bugs on Suns, added .tcshrc stuff. +.sp +Ray Moody, Purdue Physics, 1989 +.br +Added the code to do magic spacebar history expansion. +.sp +Mordechai ????, Intel, 1989 +.br +Re-arranged the printprompt() routine to use a switch(*cp) (rather than +a bunch of ifs), and added a few things to it. +.sp +Josh Siegel, dspo.gov, 1989 +.br +Fixed "fg-editor" and added the status line shell variables "sl" and "el". +.sp +Karl Berry, UMB, 1989 +.br +Fixed a bug involving environ (in sh.func.c) on NeXT computers. +.sp +Michael Greim, Universitaet des Saarlandes, Saarbruecken, W-Germany, +.br +Fixed the nested backquote bug (yes, you can do it; think about +aliases) in 4.2 csh. This fix was posted to comp.bugs.4bsd. +.sp +Kazuhiro Honda, Department of Computer Science, Keio University, 1989 +.br +Added the code for automatic spelling correction, the prompt3 stuff +(the autocorrect prompt), and HOSTTYPE symbols for the Sony NEWS. +.sp +Paul Placeway, BBN, 1990 +.br +Fixed character redrawing code insert bugs, and made redrawing code +handle multiple character movement, insert, and delete (if it exists). +Fixed setting of SHELL. +.sp +Per Hedeland, Ellemtel, Sweden, 1990 +.br +Various bugfixes and improvements, e.g. in history expansion, autolist, +added autoexpand, updated the manual. +.SH "THANKS TO" +A special thanks to: Bryan Dunlap, Clayton Elwell, Karl Kleinpaste, +Bob Manson, Steve Romig, +Diana Smetters, Bob Sutterfield, Mark Verber, Elizabeth Zwicky, and +all the other people at Ohio State for suggestions and encouragement. +.sp +Also, thanks to all the people on the net for putting up with, +reporting bugs in, and suggesting new additions to the old tcsh +editor. diff --git a/bin/tcsh/tw.decls.h b/bin/tcsh/tw.decls.h new file mode 100644 index 0000000..15876d0 --- /dev/null +++ b/bin/tcsh/tw.decls.h @@ -0,0 +1,82 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/tw.decls.h,v 3.0 1991/07/04 21:49:28 christos Exp $ */ +/* + * tw.decls.h: Tenex external declarations + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#ifndef _h_tw_decls +#define _h_tw_decls + +/* + * tw.help.c + */ +extern void do_help __P((Char *)); + +/* + * tw.parse.c + */ +extern int tenematch __P((Char *, int, int, + COMMAND)); +extern int t_search __P((Char *, Char *, COMMAND, + int, int, int)); +extern int starting_a_command __P((Char *, Char *)); +extern void copyn __P((Char *, Char *, int)); +extern void catn __P((Char *, Char *, int)); +extern int fcompare __P((Char **, Char **)); +extern void print_by_column __P((Char *, Char *[], int, + int)); +extern int StrQcmp __P((Char *, Char *)); + +/* + * tw.init.c + */ +extern void tw_clear_comm_list __P((void)); +extern void tw_sort_comms __P((void)); +extern void tw_comm_name_add __P((Char *)); +extern void tw_builtins_add __P((void)); +extern void tw_aliases_add __P((void)); +extern struct varent *tw_shell_list_start __P((void)); +extern Char *tw_n_shell_var __P((struct varent **)); +extern Char **tw_env_list_start __P((void)); +extern Char *Getenv __P((Char *)); +extern Char *tw_n_env_var __P((Char ***)); + +/* + * tw.spell.c + */ +extern int spell_me __P((Char *, int, int)); +extern int spdir __P((Char *, Char *, Char *, + Char *)); +extern int spdist __P((Char *, Char *)); + +#endif /* _h_tw_decls */ diff --git a/bin/tcsh/tw.h b/bin/tcsh/tw.h new file mode 100644 index 0000000..aac2470 --- /dev/null +++ b/bin/tcsh/tw.h @@ -0,0 +1,132 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/tw.h,v 3.0 1991/07/04 21:49:28 christos Exp $ */ +/* + * tw.h: TwENEX functions headers + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#ifndef _h_tw +#define _h_tw + +#ifdef BSDSIGS + +# define FREE_ITEMS(items,num)\ +{\ + sigmask_t omask;\ + omask = sighold (SIGINT);\ + free_items (items,num);\ + items = NULL;\ + (void) sigsetmask(omask);\ +} + +# define FREE_DIR(fd)\ +{\ + sigmask_t omask;\ + omask = sighold (SIGINT);\ + (void) closedir (fd);\ + fd = NULL;\ + (void) sigsetmask(omask);\ +} + +#else + +# define FREE_ITEMS(items,num)\ +{\ + sighold (SIGINT);\ + free_items (items,num);\ + items = NULL;\ + (void) sigrelse (SIGINT);\ +} + +# define FREE_DIR(fd)\ +{\ + sighold (SIGINT);\ + (void) closedir (fd);\ + fd = NULL;\ + (void) sigrelse (SIGINT);\ +} + +#endif + +#ifndef TRUE +# define TRUE 1 +#endif +#ifndef FALSE +# define FALSE 0 +#endif +#define ON 1 +#define OFF 0 +#define FILSIZ 256 /* Max reasonable file name length */ +#define ESC '\033' +#define equal(a, b) (strcmp(a, b) == 0) + +#define is_set(var) adrof(var) + +#define BUILTINS "/usr/local/lib/builtins/" /* fake builtin bin */ +#define SEARCHLIST "HPATH" /* Env. param for helpfile searchlist */ +#define DEFAULTLIST ":/usr/man/cat1:/usr/man/cat8:/usr/man/cat6:/usr/local/man/cat1:/usr/local/man/cat8:/usr/local/man/cat6" /* if no HPATH */ + +extern Char PromptBuf[]; + +typedef enum { + LIST, RECOGNIZE, PRINT_HELP, SPELL, GLOB, GLOB_EXPAND, + VARS_EXPAND +} COMMAND; + + +#ifndef pdp11 +#define NUMCMDS_START 512 /* was 800 */ +#define NUMCMDS_INCR 256 +#define ITEMS_START 512 +#define ITEMS_INCR 256 +#else +#define NUMCMDS_START 256 /* was 800 */ +#define NUMCMDS_INCR 128 +#define ITEMS_START 256 +#define ITEMS_INCR 128 +#endif /* pdp11 */ + +#ifndef DONT_EXTERN + +extern Char **com_list; /* the pre-digested list of commands for speed + * and general usefullness */ +extern int numcommands; +extern int have_sorted; +extern int non_unique_match; + +extern Char dirflag[5]; /* ' nn\0' - dir #s - . 1 2 ... */ + + +#endif +#include "tw.decls.h" + +#endif /* _h_tw */ diff --git a/bin/tcsh/tw.help.c b/bin/tcsh/tw.help.c new file mode 100644 index 0000000..f2e2118 --- /dev/null +++ b/bin/tcsh/tw.help.c @@ -0,0 +1,193 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/tw.help.c,v 3.0 1991/07/04 21:49:28 christos Exp $ */ +/* tw.help.c: actually look up and print documentation on a file. + * Look down the path for an appropriate file, then print it. + * Note that the printing is NOT PAGED. This is because the + * function is NOT meant to look at manual pages, it only does so + * if there is no .help file to look in. + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#include "config.h" +#if !defined(lint) && !defined(pdp11) +static char *rcsid() + { return "$Id: tw.help.c,v 3.0 1991/07/04 21:49:28 christos Exp $"; } +#endif + +#include "sh.h" +#include "tw.h" + + +static int f = -1; +static sigret_t cleanf __P((int)); +static Char *skipslist __P((Char *)); +static void nextslist __P((Char *, Char *)); + +static char *h_ext[] = { + ".help", ".1", ".8", ".6", NULL +}; + +void +do_help(command) + Char *command; +{ + Char name[FILSIZ + 1]; + Char *cmd_p, *ep; + char **sp; + + sigret_t(*orig_intr) (); + Char curdir[MAXPATHLEN]; /* Cur_ directory being looked at */ + register Char *hpath; /* The environment parameter */ + Char full[MAXPATHLEN]; + char buf[512]; /* full path name and buffer for read */ + int len; /* length of read buffer */ + Char *thpath; + + + /* copy the string to a safe place */ + copyn(name, command, FILSIZ + 1); + + /* trim off the garbage that may be at the end */ + for (cmd_p = name; *cmd_p != '\0'; cmd_p++) + if (*cmd_p == ' ' || *cmd_p == '\t') + *cmd_p = '\0'; + + /* if nothing left, return */ + if (*name == '\0') + return; + + if (adrof1(STRhelpcommand, &aliases)) { /* if we have an alias */ + jmp_buf osetexit; + + getexit(osetexit); /* make sure to come back here */ + if (setexit() == 0) + aliasrun(2, STRhelpcommand, name); /* then use it. */ + resexit(osetexit); /* and finish up */ + } + else { /* else cat something to them */ + /* got is, now "cat" the file based on the path $HPATH */ + + hpath = str2short(getenv(SEARCHLIST)); + if (hpath == NULL) + hpath = str2short(DEFAULTLIST); + thpath = hpath = Strsave(hpath); + + while (1) { + if (!*hpath) { + xprintf("No help file for %s\n", short2str(name)); + break; + } + nextslist(hpath, curdir); + hpath = skipslist(hpath); + + /* + * now make the full path name - try first /bar/foo.help, then + * /bar/foo.1, /bar/foo.8, then finally /bar/foo.6. This is so + * that you don't spit a binary at the tty when $HPATH == $PATH. + */ + copyn(full, curdir, sizeof(full) / sizeof(Char)); + catn(full, STRslash, sizeof(full) / sizeof(Char)); + catn(full, name, sizeof(full) / sizeof(Char)); + ep = &full[Strlen(full)]; + for (sp = h_ext; *sp; sp++) { + *ep = '\0'; + catn(full, str2short(*sp), sizeof(full) / sizeof(Char)); + if ((f = open(short2str(full), O_RDONLY)) != -1) + break; + } + if (f != -1) { + /* so cat it to the terminal */ + orig_intr = sigset(SIGINT, cleanf); + while (f != -1 && (len = read(f, (char *) buf, 512)) != 0) + (void) write(SHOUT, (char *) buf, (size_t) len); + (void) sigset(SIGINT, orig_intr); + if (f != -1) + (void) close(f); + break; + } + } + xfree((ptr_t) thpath); + } +} + +static sigret_t +/*ARGSUSED*/ +cleanf(snum) +int snum; +{ + if (f != -1) + (void) close(f); + f = -1; +#ifndef SIGVOID + return (snum); +#endif +} + +/* these next two are stolen from CMU's man(1) command for looking down + * paths. they are prety straight forward. */ + +/* + * nextslist takes a search list and copies the next path in it + * to np. A null search list entry is expanded to ".". + * If there are no entries in the search list, then np will point + * to a null string. + */ + +static void +nextslist(sl, np) + register Char *sl; + register Char *np; +{ + if (!*sl) + *np = '\000'; + else if (*sl == ':') { + *np++ = '.'; + *np = '\000'; + } + else { + while (*sl && *sl != ':') + *np++ = *sl++; + *np = '\000'; + } +} + +/* + * skipslist returns the pointer to the next entry in the search list. + */ + +static Char * +skipslist(sl) + register Char *sl; +{ + while (*sl && *sl++ != ':'); + return (sl); +} diff --git a/bin/tcsh/tw.init.c b/bin/tcsh/tw.init.c new file mode 100644 index 0000000..921bcb6 --- /dev/null +++ b/bin/tcsh/tw.init.c @@ -0,0 +1,290 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/tw.init.c,v 3.0 1991/07/04 21:49:28 christos Exp $ */ +/* + * tw.init.c: TwENEX initializations + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#include "config.h" +#if !defined(lint) && !defined(pdp11) +static char *rcsid() + { return "$Id: tw.init.c,v 3.0 1991/07/04 21:49:28 christos Exp $"; } +#endif + +#include "sh.h" +#include "tw.h" + +/* + * Build the command name list (and print the results). This is a HACK until + * I can get the rehash command to include its results in the command list. + */ + +static int maxcommands = 0; + + +void +tw_clear_comm_list() +{ + register int i; + + have_sorted = 0; + if (numcommands != 0) { +/* for (i = 0; com_list[i]; i++) { */ + for (i = 0; i < numcommands; i++) { + xfree((ptr_t) com_list[i]); + com_list[i] = NULL; + } + numcommands = 0; + } +} + +void +tw_sort_comms() +{ /* could be re-written */ + register int i, forward; + + /* sort the list. */ + qsort((ptr_t) com_list, (size_t) numcommands, sizeof(com_list[0]), + (int (*) __P((const void *, const void *))) fcompare); + + /* get rid of multiple entries */ + for (i = 0, forward = 0; i < numcommands - 1; i++) { + if (Strcmp(com_list[i], com_list[i + 1]) == 0) { /* garbage */ + xfree((ptr_t) com_list[i]); + forward++; /* increase the forward ref. count */ + } + else if (forward) { + com_list[i - forward] = com_list[i]; + } + } + /* Fix fencepost error -- Theodore Ts'o */ + if (forward) + com_list[i - forward] = com_list[i]; + numcommands -= forward; + com_list[numcommands] = (Char *) NULL; + + have_sorted = 1; +} + +void +tw_comm_name_add(name) /* this is going to be called a LOT at startup */ + Char *name; +{ + register int length; + register long i; + register Char **ncl, **p1, **p2; + + if (maxcommands == 0) { + com_list = (Char **) xmalloc((size_t) (NUMCMDS_START * + sizeof(com_list[0]))); + maxcommands = NUMCMDS_START; + for (i = 0, p2 = com_list; i < maxcommands; i++) + *p2++ = NULL; /* jpn: if need to loop, might as well do it all */ + } + else if (numcommands >= maxcommands) { + ncl = (Char **) xmalloc((size_t) ((maxcommands + NUMCMDS_INCR) * + sizeof(com_list[0]))); + for (i = 0, p1 = com_list, p2 = ncl; i < numcommands; i++) + *p2++ = *p1++; + for (; i < maxcommands + NUMCMDS_INCR; i++) + *p2++ = NULL; + xfree((ptr_t) com_list); + com_list = ncl; +#ifdef COMMENT + com_list = (Char **) xrealloc(com_list, (maxcommands + + NUMCMDS_INCR) * sizeof(com_list[0])); +#endif + maxcommands += NUMCMDS_INCR; + } + + if (name[0] == '.') + return; /* no dot commands... */ + if (name[0] == '#') + return; /* no Emacs buffer checkpoints */ + + length = Strlen(name) + 1; + + if (name[length - 2] == '~') + return; /* and no Emacs backups either */ + + com_list[numcommands] = (Char *) xmalloc((size_t) (length * + sizeof(Char))); + + copyn(com_list[numcommands], name, MAXNAMLEN); + numcommands++; +} + +void +tw_builtins_add() +{ + register struct biltins *bptr; + + for (bptr = bfunc; bptr < &bfunc[nbfunc]; bptr++) { + if (bptr->bname) + tw_comm_name_add(str2short(bptr->bname)); + } +} + +void +tw_aliases_add() +{ + register struct varent *p; + register struct varent *c; + + p = &aliases; + for (;;) { + while (p->v_left) + p = p->v_left; +x: + if (p->v_parent == 0) /* is it the header? */ + return; + if (p->v_name) + tw_comm_name_add(p->v_name); + if (p->v_right) { + p = p->v_right; + continue; + } + do { + c = p; + p = p->v_parent; + } while (p->v_right == c); + goto x; + } + +} + +struct varent * +tw_shell_list_start() +{ + register struct varent *p; + register struct varent *c; + + p = &shvhed; /* start at beginning of variable list */ + + for (;;) { + while (p->v_left) + p = p->v_left; +x: + if (p->v_parent == 0) /* is it the header? */ + return (NULL); + if (p->v_name) + return (p); /* found first one */ + if (p->v_right) { + p = p->v_right; + continue; + } + do { + c = p; + p = p->v_parent; + } while (p->v_right == c); + goto x; + } +} + +Char * +tw_n_shell_var(vptr) + struct varent **vptr; +{ + register struct varent *p; + register struct varent *c; + register Char *cp; + + if ((p = *vptr) == NULL) + return (NULL); /* just in case */ + + cp = p->v_name; /* we know that this name is here now */ + + /* now find the next one */ + for (;;) { + if (p->v_right) { /* if we can go right */ + p = p->v_right; + while (p->v_left) + p = p->v_left; + } + else { /* else go up */ + do { + c = p; + p = p->v_parent; + } while (p->v_right == c); + } + if (p->v_parent == 0) { /* is it the header? */ + *vptr = NULL; + return (cp); + } + if (p->v_name) { + *vptr = p; /* save state for the next call */ + return (cp); + } + } + +} + +Char ** +tw_env_list_start() +{ + return (STR_environ); +} + +Char * +Getenv(str) + Char *str; +{ + Char **var; + int len, res; + + len = Strlen(str); + for (var = STR_environ; var != NULL && *var != NULL; var++) + if ((*var)[len] == '=') { + (*var)[len] = '\0'; + res = StrQcmp(*var, str); + (*var)[len] = '='; + if (res == 0) + return (&((*var)[len + 1])); + } + return (NULL); +} + +Char * +tw_n_env_var(evp) + Char ***evp; +{ + static Char buffer[MAXVARLEN + 1]; + Char *ps, *pd; + + if (*evp == NULL || **evp == NULL) + return (NULL); + for (ps = **evp, pd = buffer; + *ps && *ps != '=' && pd <= &buffer[MAXVARLEN]; *pd++ = *ps++); + *pd = '\0'; + (*evp)++; + return (buffer); +} diff --git a/bin/tcsh/tw.parse.c b/bin/tcsh/tw.parse.c new file mode 100644 index 0000000..8ba05b5 --- /dev/null +++ b/bin/tcsh/tw.parse.c @@ -0,0 +1,1500 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/tw.parse.c,v 3.0 1991/07/04 21:49:28 christos Exp $ */ +/* + * tw.parse.c: Everyone has taken a shot in this futile effort to + * lexically analyze a csh line... Well we cannot good + * a job as good as sh.lex.c; but we try. Amazing that + * it works considering how many hands have touched this code + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#include "config.h" +#if !defined(lint) && !defined(pdp11) +static char *rcsid() + { return "$Id: tw.parse.c,v 3.0 1991/07/04 21:49:28 christos Exp $"; } +#endif + +#include "sh.h" +#include "tw.h" +#include "ed.h" + +/* #define TENEDEBUG */ + +/* true if the path has relative elements */ +static bool relatives_in_path; + +static int maxitems = 0; +Char **com_list = (Char **) NULL; /* the pre-digested list of commands + * for speed and general usefullness */ +int numcommands = 0; +int have_sorted = 0; + +/* Set to TRUE if recexact is set and an exact match is found + * along with other, longer, matches. + */ +int non_unique_match = FALSE; + +#ifdef notdef +int dirctr = 0; /* -1 0 1 2 ... */ + +#endif +Char dirflag[5]; /* ' nn\0' - dir #s - . 1 2 ... */ + +static bool SearchNoDirErr = 0; /* t_search returns -2 if dir is unreadable */ + +/* do the expand or list on the command line -- SHOULD BE REPLACED */ + +extern Char NeedsRedraw; /* from ed.h */ +extern int TermH; /* from the editor routines */ +extern int lbuffed; /* from sh.print.c */ +extern bool relatives_in_path; /* set true if PATH has relative elements */ + +static void free_items __P((Char **, int)); +static void extract_dir_and_name __P((Char *, Char *, Char *)); +static Char *quote_meta __P((Char *, bool)); +static Char *getentry __P((DIR *, int)); +static Char *dollar __P((Char *, Char *)); +static Char *tilde __P((Char *, Char *)); +static Char filetype __P((Char *, Char *)); +static int t_glob __P((Char ***)); +static int is_prefix __P((Char *, Char *)); +static int is_suffix __P((Char *, Char *)); +static int recognize __P((Char *, Char *, int, int)); +static int ignored __P((Char *)); +static void tw_get_comm_list __P((void)); +static int isadirectory __P((Char *, Char *)); + +/* + * If we find a set command, then we break a=b to a= and word becomes + * b else, we don't break a=b. + */ +#define isaset(c, w) ((w)[-1] == '=' && \ + ((c)[0] == 's' && (c)[1] == 'e' && (c)[2] == 't' && \ + ((c[3] == ' ' || (c)[3] == '\t')))) +/* + * Return value for tenematch(): + * > 1: No. of items found + * = 1: Exactly one match / spelling corrected + * = 0: No match / spelling was correct + * < 0: Error (incl spelling correction impossible) + */ +int +tenematch(in_line, in_li_size, num_read, command) + Char *in_line; /* match string prefix */ + int in_li_size; /* max size of string */ + int num_read; /* # actually in in_line */ + COMMAND command; /* LIST or RECOGNIZE or PRINT_HELP */ + +{ + Char word[FILSIZ + 1]; + register Char *str_end, *word_start, *cmd_start, *wp; + Char *cmd_st; + int space_left; + int is_a_cmd; /* UNIX command rather than filename */ + int search_ret; /* what search returned for debugging */ + int in_single, in_double; /* In single or in_double quotes */ + + str_end = &in_line[num_read]; + + /* + * space backward looking for the beginning of this command + */ + for (cmd_st = str_end; cmd_st > in_line; --cmd_st) + if (iscmdmeta(cmd_st[-1]) + && ((cmd_st - 1 == in_line) || (cmd_st[-2] != '\\'))) + break; + /* step forward over leading spaces */ + while (*cmd_st != '\0' && (*cmd_st == ' ' || *cmd_st == '\t')) + cmd_st++; + + /* + * Find LAST occurence of a delimiter in the in_line. The word start is + * one character past it. + */ + for (word_start = str_end; word_start > in_line; --word_start) { + if ((ismeta(word_start[-1]) || isaset(cmd_st, word_start)) && + (word_start[-1] != '#') && (word_start[-1] != '$') && + ((word_start - 1 == in_line) || (word_start[-2] != '\\'))) + break; + } + + + +#ifdef masscomp + /* + * Avoid a nasty message from the RTU 4.1A & RTU 5.0 comp_r concerning + * the "overuse of registers". According to the comp_r release notes, + * incorrect code may be produced unless the offending expression is + * rewritten. Therefore, we can't just ignore it, DAS DEC-90. + */ + space_left = in_li_size; + space_left -= word_start - in_line + 1; +#else + space_left = in_li_size - (word_start - in_line) - 1; +#endif + + is_a_cmd = starting_a_command(word_start, in_line); +#ifdef TENEDEBUG + xprintf("starting_a_command %d\n", is_a_cmd); +#endif + + /* + * Quote args + */ + in_double = 0; + in_single = 0; + for (cmd_start = word_start, wp = word; cmd_start < str_end && wp <= word + FILSIZ; cmd_start++) + switch (*cmd_start) { + case '\'': + if (!in_double) { + if (in_single) + in_single = 0; + else + in_single = QUOTE; + /* + * Move the word_start further, cause the quotes so far have no + * effect. + */ + if (cmd_start == word_start) + word_start++; + } + else + *wp++ = *cmd_start | QUOTE; + break; + case '"': + if (!in_single) { + if (in_double) + in_double = 0; + else + in_double = QUOTE; + /* + * Move the word_start further, cause the quotes so far have no + * effect. + */ + if (cmd_start == word_start) + word_start++; + } + else + *wp++ = *cmd_start | QUOTE; + break; + case '/': + /* + * This is so that the recognize stuff works easily + */ + *wp++ = *cmd_start; + break; + case '\\': + if (in_single || in_double) + *wp++ = *cmd_start | QUOTE; + else + *wp++ = *++cmd_start | QUOTE; + break; + default: + *wp++ = *cmd_start | in_single; + break; + } + if (wp > word + FILSIZ) + return (-1); + *wp = '\0'; + + +#ifdef TENEDEBUG + xprintf("\ncmd_st:%s:\n", short2str(cmd_st)); + xprintf("word:%s:\n", short2str(word)); + xprintf("word:"); + for (wp = word; *wp; wp++) + xprintf("%c", *wp & QUOTE ? '-' : ' '); + xprintf(":\n"); +#endif + switch ((int) command) { + Char buffer[FILSIZ + 1], *bptr; + Char *slshp; + Char *items[2], **ptr; + int i, count; + + case RECOGNIZE: + if (adrof(STRa_correct)) { + if ((slshp = Strrchr(word, '/')) != NULL && slshp[1] != NULL) { + SearchNoDirErr = 1; + for (bptr = word; bptr < slshp; bptr++) { + /* + * do not try to correct spelling of words containing + * globbing characters + */ + if (isglob(*bptr)) { + SearchNoDirErr = 0; + break; + } + } + } + } + else + slshp = STRNULL; + search_ret = t_search(word, wp, command, space_left, is_a_cmd, 1); + SearchNoDirErr = 0; + + if (search_ret == -2) { + Char rword[FILSIZ + 1]; + + (void) Strcpy(rword, slshp); + if (slshp != STRNULL) + *slshp = NULL; + if ((search_ret = spell_me(word, sizeof(word), is_a_cmd)) == 1) { + DeleteBack(str_end - word_start);/* get rid of old word */ + (void) Strcat(word, rword); + if (InsertStr(word) < 0) /* insert newly spelled word */ + return -1; /* error inserting */ + wp = word + Strlen(word); + search_ret = t_search(word, wp, command, space_left, + is_a_cmd, 1); + } + } + + /* + * Change by Christos Zoulas: if the name has metachars in it, quote + * the metachars, but only if we are outside quotes. + */ + if (*wp && InsertStr((in_single || in_double) ? + wp : quote_meta(wp, + (bool) is_set(STRaddsuffix))) < 0) + /* put it in the input buffer */ + return -1; /* error inserting */ + return search_ret; + + case SPELL: + for (bptr = word_start; bptr < str_end; bptr++) { + /* + * do not try to correct spelling of words containing globbing + * characters + */ + if (isglob(*bptr)) + return 0; + } + if ((search_ret = spell_me(word, sizeof(word), is_a_cmd)) == 1) { + DeleteBack(str_end - word_start); /* get rid of old word */ + if (InsertStr(word) < 0) /* insert newly spelled word */ + return -1; /* error inserting */ + } + return search_ret; + + case PRINT_HELP: + do_help(cmd_st); + return 1; + + case GLOB: + case GLOB_EXPAND: + (void) Strncpy(buffer, word, FILSIZ + 1); + items[0] = buffer; + items[1] = NULL; + ptr = items; + if (is_a_cmd) { + xprintf("Sorry no globbing for commands yet..\n"); + return 0; + } + if ((count = t_glob(&ptr)) > 0) { + if (command == GLOB) + print_by_column(STRNULL, ptr, count, is_a_cmd); + else { + DeleteBack(str_end - word_start);/* get rid of old word */ + for (i = 0; i < count; i++) + if (ptr[i] && *ptr[i]) { + if (InsertStr((in_single || in_double) ? + ptr[i] : quote_meta(ptr[i], 0)) < 0 || + InsertStr(STRspace) < 0) { + blkfree(ptr); + return (-1); + } + } + } + blkfree(ptr); + } + return count; + + case VARS_EXPAND: + if (dollar(buffer, word)) { + DeleteBack(str_end - word_start); + if (InsertStr((in_single || in_double) ? + buffer : quote_meta(buffer, 0)) < 0) + return (-1); + return (1); + } + return (0); + + case LIST: + search_ret = t_search(word, wp, command, space_left, is_a_cmd, 1); + return search_ret; + + default: + xprintf("tcsh: Internal match error.\n"); + return 1; + + } +} + + + + +static int +t_glob(v) + register Char ***v; +{ + jmp_buf osetexit; + + if (**v == 0) + return (0); + gflag = 0, tglob(*v); + if (gflag) { + getexit(osetexit); /* make sure to come back here */ + if (setexit() == 0) + *v = globall(*v); + resexit(osetexit); + gargv = 0; + if (haderr) { + haderr = 0; + NeedsRedraw = 1; + return (-1); + } + if (*v == 0) + return (0); + } + else + return (0); + + return ((int)gargc); +} + + +/* + * quote (\) the meta-characters in a word + * except trailing space if trail_space is set + * return pointer to quoted word in static storage + */ +static Char * +quote_meta(word, trail_space) + Char *word; + bool trail_space; +{ + static Char buffer[2 * FILSIZ + 1], *bptr, *wptr; + + for (bptr = buffer, wptr = word; *wptr != '\0';) { + if ((cmap(*wptr, _META | _DOL | _Q | _ESC | _GLOB) || *wptr == HIST || + *wptr == HISTSUB) && + (*wptr != ' ' || !trail_space || *(wptr + 1) != '\0')) + *bptr++ = '\\'; + *bptr++ = *wptr++; + } + *bptr = '\0'; + return (buffer); +} + + +/* + * return true if check items initial chars in template + * This differs from PWB imatch in that if check is null + * it items anything + */ + +static int +is_prefix(check, template) + register Char *check, *template; +{ + for (; *check; check++, template++) + if ((*check & TRIM) != (*template & TRIM)) + return (FALSE); + return (TRUE); +} + +/* + * Return true if the chars in template appear at the + * end of check, I.e., are it's suffix. + */ +static int +is_suffix(check, template) + register Char *check, *template; +{ + register Char *t, *c; + + for (t = template; *t++;); + for (c = check; *c++;); + for (;;) { + if (t == template) + return 1; + --t; + --c; + if (c == check || (*t & TRIM) != (*c & TRIM)) + return 0; + } +} + +static int +ignored(entry) + register Char *entry; +{ + struct varent *vp; + register Char **cp; + + if ((vp = adrof(STRfignore)) == NULL || (cp = vp->vec) == NULL) + return (FALSE); + for (; *cp != NULL; cp++) + if (is_suffix(entry, *cp)) + return (TRUE); + return (FALSE); +} + +/* return true if the command starting at wordstart is a command */ + +#define EVEN(x) (((x) & 1) != 1) + +int +starting_a_command(wordstart, in_line) + register Char *wordstart, *in_line; +{ + register Char *ptr, *ncmdstart; + int count; + static Char + cmdstart[] = {'`', ';', '&', '(', '|', '\0'}, + cmdalive[] = {' ', '\t', '\'', '"', '<', '>', '\0'}; + + /* + * Find if the number of backquotes is odd or even. + */ + for (ptr = wordstart, count = 0; + ptr >= in_line; + count += (*ptr-- == '`')); + /* + * if the number of backquotes is even don't include the backquote char in + * the list of command starting delimiters [if it is zero, then it does not + * matter] + */ + ncmdstart = cmdstart + EVEN(count); + + /* + * look for the characters previous to this word if we find a command + * starting delimiter we break. if we find whitespace and another previous + * word then we are not a command + * + * count is our state machine: 0 looking for anything 1 found white-space + * looking for non-ws + */ + for (count = 0; wordstart >= in_line; wordstart--) { + if (*wordstart == '\0') + continue; + if (Strchr(ncmdstart, *wordstart)) + break; + /* + * found white space + */ + if (ptr = Strchr(cmdalive, *wordstart)) + count = 1; + if (count == 1 && !ptr) + return (FALSE); + } + + if (wordstart > in_line) + switch (*wordstart) { + case '&': /* Look for >& */ + while (wordstart > in_line && + (*--wordstart == ' ' || *wordstart == '\t')); + if (*wordstart == '>') + return (FALSE); + break; + case '(': /* check for foreach, if etc. */ + while (wordstart > in_line && + (*--wordstart == ' ' || *wordstart == '\t')); + if (!iscmdmeta(*wordstart) && + (*wordstart != ' ' && *wordstart != '\t')) + return (FALSE); + break; + default: + break; + } + return (TRUE); +} + + + +/* + * Object: extend what user typed up to an ambiguity. + * Algorithm: + * On first match, copy full entry (assume it'll be the only match) + * On subsequent matches, shorten extended_name to the first + * character mismatch between extended_name and entry. + * If we shorten it back to the prefix length, stop searching. + */ +static int +recognize(extended_name, entry, name_length, numitems) + Char *extended_name, *entry; + int name_length, numitems; +{ + if (numitems == 1) /* 1st match */ + copyn(extended_name, entry, MAXNAMLEN); + else { /* 2nd and subsequent matches */ + register Char *x, *ent; + register int len = 0; + + for (x = extended_name, ent = entry; + *x && (*x & TRIM) == (*ent & TRIM); x++, len++, ent++); + *x = '\0'; /* Shorten at 1st char diff */ + if (len == name_length) /* Ambiguous to prefix? */ + return (-1); /* So stop now and save time */ + } + return (0); +} + + + +/* + * Perform a RECOGNIZE or LIST command on string "word". + * + * Return value: + * >= 0: SPELL command: "distance" (see spdist()) + * other: No. of items found + * < 0: Error (message or beep is output) + */ + +/*ARGSUSED*/ +int +t_search(word, wp, command, max_word_length, look_command, list_max) + Char *word, *wp; /* original end-of-word */ + COMMAND command; + int max_word_length, look_command, list_max; +{ + register ignoring = 1, nignored = 0; + register name_length, /* Length of prefix (file name) */ + look_lognames; /* True if looking for login names */ + int showpathn; /* True if we want path number */ + Char tilded_dir[FILSIZ + 1], /* dir after ~ expansion */ + dollar_dir[FILSIZ + 1], /* dir after $ expansion */ + dir[FILSIZ + 1], /* /x/y/z/ part in /x/y/z/f */ + name[MAXNAMLEN + 1],/* f part in /d/d/d/f */ + extended_name[MAXNAMLEN + 1], /* the recognized (extended) + * name */ + *entry = NULL, /* single directory entry or logname */ + *target; /* Target to expand/correct/list */ + int next_command = 0; /* the next command to take out of */ + + /* the list of commands */ + int look_shellvar, /* true if looking for $foo */ + look_file; /* true if looking for a file name */ + Char **pathv; /* pointer to PATH elements */ + struct varent *v_ptr = NULL;/* current shell variable position */ + Char **env_ptr = NULL; /* current env. variable position */ + + int d = 4, nd; /* distance and new distance to command for + * SPELL */ + int exec_check = 0, dir_ok = 0; /* need to check + * executability/directory */ + + static Char /* For unset path */ + * pv[2] = {STRNULL, NULL}; + static DIR + * dir_fd = NULL; + static Char + ** items = NULL; /* file names when doing a LIST */ + + /* + * bugfix by Marty Grossman (grossman@CC5.BBN.COM): directory listing can + * dump core when interrupted + */ + static int numitems; + + pathv = (v_ptr = adrof(STRPATH)) == NULL ? pv : v_ptr->vec; + + if (items != NULL) + FREE_ITEMS(items, numitems); + numitems = 0; + if (dir_fd != NULL) + FREE_DIR(dir_fd); + + non_unique_match = FALSE; /* See the recexact code below */ + + extract_dir_and_name(word, dir, name); + look_lognames = (*word == '~') && (Strchr(word, '/') == NULL); + look_shellvar = (target = Strrchr(name, '$')) && + (Strchr(name, '/') == NULL); + look_file = (!look_command && !look_lognames && + !look_shellvar) || Strchr(word, '/'); + + /* PWP: don't even bother when doing ALL of the commands */ + if (look_command && (*word == '\0')) { + Beep(); + return (-1); + } + tilded_dir[0] = '\0'; + dollar_dir[0] = '\0'; + + if (look_shellvar) { /* Looking for a shell var? */ + v_ptr = tw_shell_list_start(); + env_ptr = tw_env_list_start(); + target++; + } + else + target = name; + if (look_shellvar || look_file) { + Char *nd = NULL; + + /* Open the directory */ + /* expand ~user/... and variables stuff */ + if ((dollar(dollar_dir, dir) == 0) || + (tilde(tilded_dir, dollar_dir) == 0) || + !(nd = dnormalize(*tilded_dir ? tilded_dir : STRdot)) || + ((dir_fd = opendir(short2str(nd))) == NULL)) { + xfree((ptr_t) nd); + if (SearchNoDirErr) + return (-2); + xprintf("\n%s unreadable\n", + *tilded_dir ? short2str(tilded_dir) : + (*dollar_dir ? short2str(dollar_dir) : short2str(dir))); + NeedsRedraw = 1; + return (-1); + } + if (nd) { + if (*tilded_dir != '\0') { + Char *s, *d, *p; + + /* + * Copy and append a / if there was one + */ + for (p = tilded_dir; *p; p++); + if (*--p == '/') { + for (p = nd; *p; p++); + if (*--p != '/') + p = NULL; + } + for (d = tilded_dir, s = nd; *d++ = *s++;); + if (!p) { + *d-- = '\0'; + *d = '/'; + } + } + xfree((ptr_t) nd); + } + } + else if (look_lognames) { /* Looking for login names? */ + (void) setpwent(); /* Open passwd file */ + copyn(name, &word[1], MAXNAMLEN); /* name sans ~ */ + } + else if (look_command) { + if (!numcommands) /* if we have no list of commands */ + tw_get_comm_list(); + if (!have_sorted) { /* if we haven't sorted them yet */ + tw_builtins_add(); + tw_aliases_add(); + tw_sort_comms(); /* re-build the command path for twenex.c */ + } + copyn(target, word, MAXNAMLEN); /* so it can match things */ + } + else { + xprintf("\ntcsh internal error: I don't know what I'm looking for!\n"); + NeedsRedraw = 1; + return (-1); + } + + +again: + name_length = Strlen(target); + showpathn = look_command && is_set(STRl_pathnum); + + while (1) { + if (look_shellvar) { + if ((entry = tw_n_shell_var(&v_ptr)) == NULL) + if ((entry = tw_n_env_var(&env_ptr)) == NULL) + break; + } + else if (look_file || look_lognames) { + if ((entry = getentry(dir_fd, look_lognames)) == NULL) { + break; + } + + /* + * Don't match . files on null prefix match + */ + if (name_length == 0 && entry[0] == '.' && + !look_lognames && !is_set(STRshowdots)) + continue; + if (look_command && !look_lognames) { + exec_check = 1; + dir_ok = 1; + } + } + else if (look_command) { +#ifdef NOTDEF /* Not possible */ + if (numcommands == 0) { + dohash(); + } +#endif + /* searching . added by Andreas Luik */ + + if ((next_command < numcommands) && + (entry = com_list[next_command]) == NULL) + next_command = numcommands; + if (next_command >= numcommands) { /* search relative elems */ + if (!relatives_in_path) + break; /* we don't need to do it */ + while ((dir_fd == NULL || + (entry = getentry(dir_fd, FALSE)) == NULL) && + *pathv) { + if (dir_fd != NULL) + FREE_DIR(dir_fd); + entry = NULL; + while (*pathv && pathv[0][0] == '/') + pathv++; + if (*pathv) { + if (pathv[0][0] == '\0' || + (pathv[0][0] == '.' && pathv[0][1] == '\0')) { + *tilded_dir = '\0'; + dir_fd = opendir("."); + } + else { + copyn(tilded_dir, *pathv, FILSIZ); + catn(tilded_dir, STRslash, FILSIZ); + dir_fd = opendir(short2str(*pathv)); + } + pathv++; + } + } + if (entry == NULL) + break; /* end of PATH */ + /* + * executability check for other than "." should perhaps be + * conditional on recognize_only_executables? + */ + exec_check = 1; + dir_ok = 0; + } + else + next_command++; + } + + if (command == SPELL) { /* correct the spelling of the last bit */ + if (name_length == 0) {/* zero-length word can't be misspelled */ + extended_name[0] = '\0';/* (not trying is important for ~) */ + d = 0; + break; + } + nd = spdist(entry, target); /* test the entry against original */ + if (nd <= d && nd != 4) { + if (exec_check && !executable(tilded_dir, entry, dir_ok)) + continue; + (void) Strcpy(extended_name, entry); + d = nd; + if (d == 0) /* if found it exactly */ + break; + } + else if (nd == 4) { + if (spdir(extended_name, tilded_dir, entry, target)) { + if (exec_check && + !executable(tilded_dir, extended_name, dir_ok)) + continue; + d = 0; + break; + } + } + } + else if (command == LIST) { /* LIST command */ + register int length; + register long i; + register Char **ni, **p2; + + if (!is_prefix(target, entry)) + continue; + if (exec_check && !executable(tilded_dir, entry, dir_ok)) + continue; + + if (items == NULL || maxitems == 0) { + items = (Char **) xmalloc((size_t) (sizeof(items[0]) * + (ITEMS_START + 1))); + maxitems = ITEMS_START; + for (i = 0, p2 = items; i < maxitems; i++) + *p2++ = NULL; + } + else if (numitems >= maxitems) { + ni = (Char **) xrealloc((ptr_t) items, (size_t) + (sizeof(items[0])) * (maxitems + ITEMS_INCR)); + items = ni; + maxitems += ITEMS_INCR; + } + + + length = Strlen(entry) + 1; + if (showpathn) + length += Strlen(dirflag); + if (!look_lognames && !look_shellvar) + length++; + + /* safety check */ + items[numitems] = (Char *) xmalloc((size_t) (length * sizeof(Char))); + + copyn(items[numitems], entry, MAXNAMLEN); + + if (!look_lognames && !look_shellvar + && !(look_command && !look_file)) { + Char typestr[2]; + + typestr[0] = filetype(tilded_dir, entry); + typestr[1] = '\0'; + catn(items[numitems], typestr, MAXNAMLEN); + } + + if (showpathn) + catn(items[numitems], dirflag, MAXNAMLEN); + numitems++; + } + else { /* RECOGNIZE command */ + if (!is_prefix(target, entry)) + continue; + if (exec_check && !executable(tilded_dir, entry, dir_ok)) + continue; + + if (ignoring && ignored(entry)) { + nignored++; + continue; + } + if (is_set(STRrecexact)) { + if (StrQcmp(target, entry) == 0) { /* EXACT match */ + copyn(extended_name, entry, MAXNAMLEN); + numitems = 1; /* fake into expanding */ + non_unique_match = TRUE; + break; + } + } + if (recognize(extended_name, entry, name_length, ++numitems)) + break; + } + } + + if (ignoring && numitems == 0 && nignored > 0) { + ignoring = 0; + nignored = 0; + if (look_lognames) + (void) setpwent(); + else + rewinddir(dir_fd); + goto again; + } + if (look_lognames) { +#ifdef YPBUGS + fix_yp_bugs(); +#endif /* YPBUGS */ + (void) endpwent(); + } + else if (look_file || look_shellvar || + (look_command && relatives_in_path)) { + if (dir_fd != NULL) + FREE_DIR(dir_fd); + } + + if (command == RECOGNIZE) { + if (numitems > 0) { + if (look_lognames) + copyn(word, STRtilde, 1); + else if (look_shellvar) { + Char *ptr = Strrchr(word, '$'); + + *++ptr = '\0'; /* Delete after the dollar */ + } + else if (look_file) + copyn(word, dir, max_word_length); /* put back dir part */ + else + word[0] = '\0'; + catn(word, extended_name, max_word_length); /* add extended name */ + if (is_set(STRaddsuffix)) { + if (numitems == 1) { + if (look_lognames) { /* add / */ + catn(word, STRslash, max_word_length); + } + else if (look_shellvar) { + struct varent *vp = adrof(extended_name); + Char *stp; + + /* + * Don't consider array variables or empty variables + */ + if (vp) { + if (!(stp = vp->vec[0]) || vp->vec[0][0] == '\0' || + vp->vec[1]) { + catn(word, STRspace, max_word_length); + stp = NULL; + } + else + stp = vp->vec[0]; + } + else if ((stp = Getenv(extended_name)) == NULL) + catn(word, STRspace, max_word_length); + if (stp != NULL) { + *--target = '\0'; + (void) Strcat(tilded_dir, name); + if (isadirectory(tilded_dir, stp)) + catn(word, STRslash, max_word_length); + else + catn(word, STRspace, max_word_length); + } + } + else if (look_file) { + if (isadirectory(tilded_dir, extended_name)) { + catn(word, STRslash, max_word_length); + } + else { + catn(word, STRspace, max_word_length); + } + } + else { /* prob. looking for a command */ + catn(word, STRspace, max_word_length); + } + } + } + } + return (numitems); /* at the end */ + } + else if (command == LIST) { + register int max_items = 0; + register Char *cp; + + if (cp = value(STRl_max)) { + while (*cp) { + if (!Isdigit(*cp)) { + max_items = 0; + break; + } + max_items = max_items * 10 + *cp++ - '0'; + } + } + + if ((max_items > 0) && (numitems > max_items) && list_max) { + char tc; + + xprintf("There are %d items, list them anyway? [n/y] ", numitems); + flush(); + /* We should be in Rawmode here, so no \n to catch */ + (void) read(SHIN, &tc, 1); + xprintf("%c\r\n", tc); /* echo the char, do a newline */ + if ((tc != 'y') && (tc != 'Y')) + goto done_list; + } + qsort((ptr_t) items, (size_t) numitems, sizeof(items[1]), + (int (*) __P((const void *, const void *))) fcompare); + + print_by_column(STRNULL, items, numitems, TRUE); + +done_list: + if (items != NULL) + FREE_ITEMS(items, numitems); + return (numitems); + } + else if (command == SPELL) { + if (look_lognames) + copyn(word, STRtilde, 1); + else if (look_shellvar) { + Char *ptr = Strrchr(word, '$'); + + *++ptr = '\0'; /* Delete after the dollar */ + } + else if (look_file) + copyn(word, dir, max_word_length); /* put back dir part */ + else + word[0] = '\0'; + catn(word, extended_name, max_word_length); /* add extended name */ + return (d); + } + else { + xprintf("Bad tw_command\n"); + return (0); + } +} + + + +/* stuff for general command line hacking */ + +/* + * Strip next directory from path; return ptr to next unstripped directory. + */ + +#ifdef notdef +Char * extct_dir_from_path(path, dir) + Char *path, dir[]; +{ + register Char *d = dir; + + while (*path && (*path == ' ' || *path == ':')) + path++; + while (*path && (*path != ' ' && *path != ':')) + *(d++) = *(path++); + while (*path && (*path == ' ' || *path == ':')) + path++; + + ++dirctr; + if (*dir == '.') + (void) Strcpy(dirflag, STRdotsp); + else { + dirflag[0] = ' '; + if (dirctr <= 9) { + dirflag[1] = '0' + dirctr; + dirflag[2] = '\0'; + } + else { + dirflag[1] = '0' + dirctr / 10; + dirflag[2] = '0' + dirctr % 10; + dirflag[3] = '\0'; + } + } + *(d++) = '/'; + *d = 0; + + return path; +} + +#endif + + +static void +free_items(items, numitems) + register Char **items; + register int numitems; +{ + register int i; + +/* for (i = 0; items[i] != (Char *)NULL; i++) */ + for (i = 0; i < numitems; i++) + xfree((ptr_t) items[i]); + xfree((ptr_t) items); + maxitems = 0; +} + + +/* + * parse full path in file into 2 parts: directory and file names + * Should leave final slash (/) at end of dir. + */ +static void +extract_dir_and_name(path, dir, name) + Char *path, *dir, *name; +{ + register Char *p; + + p = Strrchr(path, '/'); + if (p == NULL) { + copyn(name, path, MAXNAMLEN); + dir[0] = '\0'; + } + else { + p++; + copyn(name, p, MAXNAMLEN); + copyn(dir, path, p - path); + } +} + +static Char * +getentry(dir_fd, look_lognames) + DIR *dir_fd; + int look_lognames; +{ + register struct passwd *pw; + static Char retname[MAXPATHLEN]; + + register struct dirent *dirp; + + if (look_lognames) { /* Is it login names we want? */ + + pw = getpwent(); + + if (pw == NULL) { +#ifdef YPBUGS + fix_yp_bugs(); +#endif + return (NULL); + } + (void) Strcpy(retname, str2short(pw->pw_name)); + return (retname); + } + else { /* It's a dir entry we want */ + if (dirp = readdir(dir_fd)) { + (void) Strcpy(retname, str2short(dirp->d_name)); + return (retname); + } + return (NULL); + } +} + +/* + * expand "/$old1/$old2/old3/" + * to "/value_of_old1/value_of_old2/old3/" + */ +static Char * +dollar(new, old) + Char *new, *old; +{ + Char *var, *val, *p, save; + int space; + + for (space = FILSIZ, p = new; *old && space > 0;) + if (*old != '$') { + *p++ = *old++; + space--; + } + else { + struct varent *vp; + + /* found a variable, expand it */ + for (var = ++old; alnum(*old); old++); + save = *old; + *old = '\0'; + vp = adrof(var); + val = (!vp) ? Getenv(var) : NULL; + *old = save; + /* + * Don't expand array variables + */ + if (vp) { + if (!vp->vec[0] || vp->vec[1]) { + *new = '\0'; + return (NULL); + } + else + val = vp->vec[0]; + } + else if (!val) { + *new = '\0'; + return (NULL); + } + for (; space > 0 && *val; space--) + *p++ = *val++; + } + *p = '\0'; + return (new); +} + +/* + * expand "old" file name with possible tilde usage + * ~person/mumble + * expands to + * home_directory_of_person/mumble + * into string "new". + */ + +static Char * +tilde(new, old) + Char *new, *old; +{ + register Char *o, *p; + + if ((old[0] != '~') && (old[0] != '=')) { + (void) Strcpy(new, old); + return (new); + } + + new[0] = '\0'; + for (p = new, o = &old[1]; *o && *o != '/'; *p++ = *o++); + *p = '\0'; + + if (old[0] == '~') { + if (gethdir(new)) + return (NULL); + } + else { /* '=' stack expansion */ + if (!Isdigit(old[1]) && old[1] != '-') + return (NULL); + if (!getstakd(new, (old[1] == '-') ? -1 : old[1] - '0')) + return (NULL); + } + (void) Strcat(new, o); + return (new); +} + +static Char +filetype(dir, file) /* symbology from 4.3 ls command */ + Char *dir, *file; +{ + if (dir) { + Char path[512]; + char *ptr; + struct stat statb; + + (void) Strcpy(path, dir); + catn(path, file, sizeof(path) / sizeof(Char)); + + if (lstat(ptr = short2str(path), &statb) != -1) + /* see above #define of lstat */ + { +#ifdef S_ISLNK + if (S_ISLNK(statb.st_mode)) { /* Symbolic link */ + if (adrof(STRl_links)) { + if (stat(ptr, &statb) == -1) + return ('&'); + else if (S_ISDIR(statb.st_mode)) + return ('>'); + else + return ('@'); + } + else + return ('@'); + } +#endif +#ifdef S_ISSOCK + if (S_ISSOCK(statb.st_mode)) /* Socket */ + return ('='); +#endif +#ifdef S_ISFIFO + if (S_ISFIFO(statb.st_mode)) /* Named Pipe */ + return ('|'); +#endif +#ifdef S_ISHIDDEN + if (S_ISHIDDEN(statb.st_mode)) /* Hidden Directory [aix] */ + return ('+'); +#endif +#ifdef S_ISCDF + if (S_ISCDF(statb.st_mode)) /* Context Dependent Files [hpux] */ + return ('+'); +#endif +#ifdef S_ISNWK + if (S_ISNWK(statb.st_mode)) /* Network Special [hpux] */ + return (':'); +#endif + if (S_ISCHR(statb.st_mode)) /* char device */ + return ('%'); + if (S_ISBLK(statb.st_mode)) /* block device */ + return ('#'); + if (S_ISDIR(statb.st_mode)) /* normal Directory */ + return ('/'); + if (statb.st_mode & 0111) + return ('*'); + } + } + return (' '); +} + +static int +isadirectory(dir, file) /* return 1 if dir/file is a directory */ + Char *dir, *file; /* uses stat rather than lstat to get dest. */ +{ + if (dir) { + Char path[MAXPATHLEN]; + struct stat statb; + + (void) Strcpy(path, dir); + catn(path, file, sizeof(path) / sizeof(Char)); + if (stat(short2str(path), &statb) >= 0) { /* resolve through + * symlink */ +#ifdef S_ISSOCK + if (S_ISSOCK(statb.st_mode)) /* Socket */ + return 0; +#endif +#ifdef S_ISFIFO + if (S_ISFIFO(statb.st_mode)) /* Named Pipe */ + return 0; +#endif + if (S_ISDIR(statb.st_mode)) /* normal Directory */ + return 1; + } + } + return 0; +} + +/* + * Print sorted down columns + */ +void +print_by_column(dir, items, count, no_file_suffix) + register Char *dir, *items[]; + int count, no_file_suffix; +{ + register int i, r, c, w, maxwidth = 0, columns, rows; + extern int Tty_raw_mode; + + lbuffed = 0; /* turn off line buffering */ + + for (i = 0; i < count; i++) /* find widest string */ + maxwidth = max(maxwidth, Strlen(items[i])); + + maxwidth += no_file_suffix ? 1 : 2; /* for the file tag and space */ + columns = (TermH + 1) / maxwidth; /* PWP: terminal size change */ + if (!columns) + columns = 1; + rows = (count + (columns - 1)) / columns; + + for (r = 0; r < rows; r++) { + for (c = 0; c < columns; c++) { + i = c * rows + r; + + if (i < count) { + w = Strlen(items[i]); + + if (no_file_suffix) { + /* Print the command name */ + xprintf("%s", short2str(items[i])); + } + else { + /* Print filename followed by '/' or '*' or ' ' */ + xprintf("%s%c", short2str(items[i]), + filetype(dir, items[i])); + w++; + } + + if (c < (columns - 1)) /* Not last column? */ + for (; w < maxwidth; w++) + xputchar(' '); + } + } + if (Tty_raw_mode) + xputchar('\r'); + xputchar('\n'); + } + + lbuffed = 1; /* turn back on line buffering */ + flush(); +} + + +int +StrQcmp(str1, str2) + register Char *str1, *str2; +{ + for (; *str1 && (*str1 & TRIM) == (*str2 & TRIM); str1++, str2++); + /* + * The following case analysis is necessary so that characters which look + * negative collate low against normal characters but high against the + * end-of-string NUL. + */ + if (*str1 == '\0' && *str2 == '\0') + return (0); + else if (*str1 == '\0') + return (-1); + else if (*str2 == '\0') + return (1); + else + return ((*str1 & TRIM) - (*str2 & TRIM)); +} + +/* + * For qsort() + */ +int +fcompare(file1, file2) + Char **file1, **file2; +{ +#if defined(NLS) && !defined(NOSTRCOLL) + char buf[2048]; + + (void) strcpy(buf, short2str(*file1)); + return ((int) strcoll(buf, short2str(*file2))); +#else + return (StrQcmp(*file1, *file2)); +#endif +} + +/* + * Concatenate src onto tail of des. + * Des is a string whose maximum length is count. + * Always null terminate. + */ + +void +catn(des, src, count) + register Char *des, *src; + register count; +{ + while (--count >= 0 && *des) + des++; + while (--count >= 0) + if ((*des++ = *src++) == 0) + return; + *des = '\0'; +} + +/* + * like strncpy but always leave room for trailing \0 + * and always null terminate. + */ +void +copyn(des, src, count) + register Char *des, *src; + register count; +{ + while (--count >= 0) + if ((*des++ = *src++) == 0) + return; + *des = '\0'; +} + +static void +tw_get_comm_list() +{ /* stolen from sh.exec.c dohash() */ + register DIR *dirp; + register struct dirent *dp; + register Char *dir; + register Char **pv; + struct varent *v = adrof(STRpath); + + relatives_in_path = 0; /* set to false until we know better */ + tw_clear_comm_list(); + if (v == 0) /* if no path */ + return; + + if (adrof(STRrecognize_only_executables)) { + for (pv = v->vec; *pv; pv++) { + if (pv[0][0] != '/') { + relatives_in_path = 1; + continue; + } + dirp = opendir(short2str(*pv)); + if (dirp == NULL) + continue; + + dir = Strspl(*pv, STRslash); + while ((dp = readdir(dirp)) != NULL) { + /* the call to executable() may make this a bit slow */ + if (dp->d_ino != 0 && + executable(dir, str2short(dp->d_name), 0)) + tw_comm_name_add(str2short(dp->d_name)); + } + (void) closedir(dirp); + xfree((ptr_t) dir); + } + } + else { + for (pv = v->vec; *pv; pv++) { + if (pv[0][0] != '/') { + relatives_in_path = 1; + continue; + } + dirp = opendir(short2str(*pv)); + if (dirp == NULL) + continue; + + while ((dp = readdir(dirp)) != NULL) { + if (dp->d_ino != 0) + tw_comm_name_add(str2short(dp->d_name)); + } + (void) closedir(dirp); + } + } +} diff --git a/bin/tcsh/tw.spell.c b/bin/tcsh/tw.spell.c new file mode 100644 index 0000000..143a43b --- /dev/null +++ b/bin/tcsh/tw.spell.c @@ -0,0 +1,166 @@ +/* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/tw.spell.c,v 3.0 1991/07/04 21:49:28 christos Exp $ */ +/* + * tw.spell.c: Spell check words + */ +/*- + * Copyright (c) 1980, 1991 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. + */ +#include "config.h" +#if !defined(lint) && !defined(pdp11) +static char *rcsid() + { return "$Id: tw.spell.c,v 3.0 1991/07/04 21:49:28 christos Exp $"; } +#endif + +#include "sh.h" +#include "tw.h" + +extern Char **com_list; +extern int numcommands; + +/* spell_me : return corrrectly spelled filename. From K&P spname */ +int +spell_me(oldname, oldsize, look_cmd) + Char *oldname; + int oldsize, look_cmd; +{ + /* The +1 is to fool hp's optimizer */ + Char guess[FILSIZ + 1], newname[FILSIZ + 1]; + register Char *new = newname, *old = oldname; + register Char *p, *cp, *ws; + bool foundslash = 0; + int retval; + + for (;;) { + while (*old == '/') { /* skip '/' */ + *new++ = *old++; + foundslash = 1; + } + /* do not try to correct spelling of single letter words */ + if (*old != '\0' && old[1] == '\0') + *new++ = *old++; + *new = '\0'; + if (*old == '\0') { + retval = (StrQcmp(oldname, newname) != 0); + copyn(oldname, newname, oldsize); /* shove it back. */ + return retval; + } + p = guess; /* start at beginning of buf */ + if (newname[0]) /* add current dir if any */ + for (cp = newname; *cp; cp++) + if (p < guess + FILSIZ) + *p++ = *cp; + ws = p; + for (; *old != '/' && *old != '\0'; old++)/* add current file name */ + if (p < guess + FILSIZ) + *p++ = *old; + *p = '\0'; /* terminate it */ + + /* + * Don't tell t_search we're looking for cmd if no '/' in the name so + * far but there are later - or it will look for *all* commands + */ + /* (*should* say "looking for directory" whenever '/' is next...) */ + if (t_search(guess, p, SPELL, FILSIZ, + look_cmd && (foundslash || *old != '/'), 1) >= 4) + return -1; /* hopeless */ + for (p = ws; *new = *p++;) + new++; + } +/*NOTREACHED*/ +#ifdef notdef + return (0); /* lint on the vax under mtXinu complains! */ +#endif +} + +#define EQ(s,t) (StrQcmp(s,t) == 0) + +/* + * spdist() is taken from Kernighan & Pike, + * _The_UNIX_Programming_Environment_ + * and adapted somewhat to correspond better to psychological reality. + * (Note the changes to the return values) + * + * According to Pollock and Zamora, CACM April 1984 (V. 27, No. 4), + * page 363, the correct order for this is: + * OMISSION = TRANSPOSITION > INSERTION > SUBSTITUTION + * thus, it was exactly backwards in the old version. -- PWP + */ + +int +spdist(s, t) + register Char *s, *t; +{ + for (; (*s & TRIM) == (*t & TRIM); t++, s++) + if (*t == '\0') + return 0; /* exact match */ + if (*s) { + if (*t) { + if (s[1] && t[1] && (*s & TRIM) == (t[1] & TRIM) && + (*t & TRIM) == (s[1] & TRIM) && EQ(s + 2, t + 2)) + return 1; /* transposition */ + if (EQ(s + 1, t + 1)) + return 3; /* 1 char mismatch */ + } + if (EQ(s + 1, t)) + return 2; /* extra character */ + } + if (*t && EQ(s, t + 1)) + return 1; /* missing character */ + return 4; +} + +int +spdir(extended_name, tilded_dir, entry, name) + Char *extended_name; + Char *tilded_dir; + Char *entry; + Char *name; +{ + Char path[1024]; + Char *s; + Char oldch; + + for (s = name; *s != 0 && (*s & TRIM) == (*entry & TRIM); s++, entry++); + if (*s == 0 || s[1] == 0 || *entry != 0) + return 0; + + (void) Strcpy(path, tilded_dir); + oldch = *s; + *s = '/'; + catn(path, name, sizeof(path) / sizeof(Char)); + if (access(short2str(path), F_OK) == 0) { + (void) Strcpy(extended_name, name); + return 1; + } + *s = oldch; + return 0; +} diff --git a/bin/tee.c b/bin/tee.c new file mode 100644 index 0000000..c31a375 --- /dev/null +++ b/bin/tee.c @@ -0,0 +1,100 @@ +#ifndef lint +static char *sccsid = "@(#)tee.c 5.4 (Berkeley) 12/14/85"; +#endif +/* + * tee-- pipe fitting + */ + +#include +#include +#include +#include + +#define BUFSIZ 8192 +int openf[20] = { 1 }; +int n = 1; +int t = 0; +int aflag; + +char in[BUFSIZ]; + +char out[BUFSIZ]; + +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=w) { + if(t>0&&p>0) break; + w = read(0,in,BUFSIZ); + r = 0; + if(w<=0) { + stash(p); + exit(0); + } + } + out[p++] = in[r++]; + } + stash(p); + } +} + +stash(p) +{ + int k; + int i; + int d; + d = t ? 16 : p; + for(i=0; i test.0 + +install: all + install -s -m 755 -g bin -o bin test ${DESTDIR}/bin + rm -f ${DESTDIR}/bin/[ + ln ${DESTDIR}/bin/test ${DESTDIR}/bin/[ + install -c -m 444 -g bin -o bin test.0 ${DESTDIR}/usr/man/cat1 + +clean: + rm -f *.o test *.core test.0 diff --git a/bin/test/TEST.csh b/bin/test/TEST.csh new file mode 100755 index 0000000..ad2b452 --- /dev/null +++ b/bin/test/TEST.csh @@ -0,0 +1,153 @@ +# @(#)TEST.csh 5.2 (Berkeley) 4/30/93 +# TEST.csh,v 1.3 1994/09/24 02:59:11 davidg Exp + +#alias t '/usr/src/bin/test/obj/test \!*; echo $status' +alias t '/bin/test \!*; echo $status' +#alias t '/u1/robin/progs/test/test \!*; echo $status' + +echo 't -b /dev/ttyp2' +t -b /dev/ttyp2 +echo 't -b /dev/jb1a' +t -b /dev/jb1a + +echo 't -c test.c' +t -c test.c +echo 't -c /dev/tty' +t -c /dev/tty + +echo 't -d test.c' +t -d test.c +echo 't -d /etc' +t -d /etc + +echo 't -e noexist' +t -e noexist +echo 't -e test.c' +t -e test.c + +echo 't -f noexist' +t -f noexist +echo 't -f /dev/tty' +t -f /dev/tty +echo 't -f test.c' +t -f test.c + +echo 't -g test.c' +t -g test.c +echo 't -g /bin/ps' +t -g /bin/ps + +echo 't -n ""' +t -n "" +echo 't -n "hello"' +t -n "hello" + +echo 't -p test.c' +t -p test.c + +echo 't -r noexist' +t -r noexist +echo 't -r /etc/master.passwd' +t -r /etc/master.passwd +echo 't -r test.c' +t -r test.c + +echo 't -s noexist' +t -s noexist +echo 't -s /dev/null' +t -s /dev/null +echo 't -s test.c' +t -s test.c + +echo 't -t 20' +t -t 20 +echo 't -t 0' +t -t 0 + +echo 't -u test.c' +t -u test.c +echo 't -u /bin/rcp' +t -u /bin/rcp + +echo 't -w noexist' +t -w noexist +echo 't -w /etc/master.passwd' +t -w /etc/master.passwd +echo 't -w /dev/null' +t -w /dev/null + +echo 't -x noexist' +t -x noexist +echo 't -x /bin/ps' +t -x /bin/ps +echo 't -x /etc/motd' +t -x /etc/motd + +echo 't -z ""' +t -z "" +echo 't -z "foo"' +t -z "foo" + +echo 't "foo"' +t "foo" +echo 't ""' +t "" + +echo 't "hello" = "hello"' +t "hello" = "hello" +echo 't "hello" = "goodbye"' +t "hello" = "goodbye" + +echo 't "hello" != "hello"' +t "hello" != "hello" +echo 't "hello" != "goodbye"' +t "hello" != "goodbye" + +echo 't 200 -eq 200' +t 200 -eq 200 +echo 't 34 -eq 222' +t 34 -eq 222 + +echo 't 200 -ne 200' +t 200 -ne 200 +echo 't 34 -ne 222' +t 34 -ne 222 + +echo 't 200 -gt 200' +t 200 -gt 200 +echo 't 340 -gt 222' +t 340 -gt 222 + +echo 't 200 -ge 200' +t 200 -ge 200 +echo 't 34 -ge 222' +t 34 -ge 222 + +echo 't 200 -lt 200' +t 200 -lt 200 +echo 't 34 -lt 222' +t 34 -lt 222 + +echo 't 200 -le 200' +t 200 -le 200 +echo 't 340 -le 222' +t 340 -le 222 + +echo 't 700 -le 1000 -a -n "1" -a "20" = "20"' +t 700 -le 1000 -a -n "1" -a "20" = "20" +echo 't ! \( 700 -le 1000 -a -n "1" -a "20" = "20" \)' +t ! \( 700 -le 1000 -a -n "1" -a "20" = "20" \) + +echo 't -5 -eq 5' +t -5 -eq 5 + + +echo 't foo -a ""' +t foo -a "" +echo 't "" -a foo' +t "" -a foo +echo 't "" -a ""' +t "" -a "" +echo 't "" -o ""' +t "" -o "" + diff --git a/bin/test/operators.c b/bin/test/operators.c new file mode 100644 index 0000000..af959a2 --- /dev/null +++ b/bin/test/operators.c @@ -0,0 +1,158 @@ +/*- + * Copyright (c) 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. + * + * operators.c,v 1.3 1994/09/24 02:59:12 davidg Exp + */ + +#if defined(DOSCCS) & !defined(lint) +static char sccsid[] = "@(#)operators.c 8.3 (Berkeley) 4/2/94"; +#endif /* not lint */ + +/* + * Operators used in the test command. + */ + +#include + +#include "operators.h" + +char unary_op[][4] = { + "!", + "-b", + "-c", + "-d", + "-e", + "-f", + "-g", + "-h", + "-k", + "-n", + "-p", + "-r", + "-s", + "-t", + "-u", + "-w", + "-x", + "-z", + "ZZZ" +}; + +char binary_op[][4] = { + "-o", + "|", + "-a", + "&", + "=", + "!=", + "-eq", + "-ne", + "-gt", + "-lt", + "-le", + "-ge", + "ZZZ" +}; + +char andor_op[][4] = { + "-o", + "|", + "-a", + "&", + "ZZZ" +}; + +int op_priority[] = { + 3, + 12, + 12, + 12, + 12, + 12, + 12, + 12, + 12, + 12, + 12, + 12, + 12, + 12, + 12, + 12, + 12, + 12, + 1, + 1, + 2, + 2, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, +}; + +int op_argflag[] = { + 0, + OP_FILE, + OP_FILE, + OP_FILE, + OP_FILE, + OP_FILE, + OP_FILE, + OP_FILE, + OP_FILE, + OP_STRING, + OP_FILE, + OP_FILE, + OP_FILE, + OP_INT, + OP_FILE, + OP_FILE, + OP_FILE, + OP_STRING, + 0, + 0, + 0, + 0, + OP_STRING, + OP_STRING, + OP_INT, + OP_INT, + OP_INT, + OP_INT, + OP_INT, + OP_INT, +}; diff --git a/bin/test/operators.h b/bin/test/operators.h new file mode 100644 index 0000000..b5b6917 --- /dev/null +++ b/bin/test/operators.h @@ -0,0 +1,73 @@ +/*- + * Copyright (c) 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. + * + * @(#)operators.h 8.3 (Berkeley) 4/2/94 + * operators.h,v 1.3 1994/09/24 02:59:13 davidg Exp + */ + +#define NOT 0 +#define ISBLOCK 1 +#define ISCHAR 2 +#define ISDIR 3 +#define ISEXIST 4 +#define ISFILE 5 +#define ISSETGID 6 +#define ISSYMLINK 7 +#define ISSTICKY 8 +#define STRLEN 9 +#define ISFIFO 10 +#define ISREAD 11 +#define ISSIZE 12 +#define ISTTY 13 +#define ISSETUID 14 +#define ISWRITE 15 +#define ISEXEC 16 +#define NULSTR 17 + +#define FIRST_BINARY_OP 18 +#define OR1 18 +#define OR2 19 +#define AND1 20 +#define AND2 21 +#define STREQ 22 +#define STRNE 23 +#define EQ 24 +#define NE 25 +#define GT 26 +#define LT 27 +#define LE 28 +#define GE 29 + + +#define OP_INT 1 /* arguments to operator are integer */ +#define OP_STRING 2 /* arguments to operator are string */ +#define OP_FILE 3 /* argument is a file name */ diff --git a/bin/test/test.1 b/bin/test/test.1 new file mode 100644 index 0000000..58d809d --- /dev/null +++ b/bin/test/test.1 @@ -0,0 +1,284 @@ +.\" Copyright (c) 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the Institute of Electrical and Electronics Engineers, Inc. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)test.1 8.1.2 (2.11BSD) 1995/03/13 +.\" test.1,v 1.2 1994/09/24 02:59:14 davidg Exp +.\" +.TH TEST 1 "March 13, 1995" +.AT 3 +.SH NAME +test \- condition evaluation utility +.SH SYNOPSIS +.B test +.I expression +.SH DESCRIPTION +The +.I test +utility evaluates the expression and, if it evaluates +to true, returns a zero (true) exit status; otherwise +it returns 1 (false). +If there is no expression, test also +returns 1 (false). +.PP +All operators and flags are separate arguments to the +.I test +utility. +.PP +The following primaries are used to construct expression: +.TP +\fB \-b \fP \fI file \fP +True if +.I file +exists and is a block special +file. +.TP +\fB \-c \fP \fI file \fP +True if +.I file +exists and is a character +special file. +.TP +\fB \-d \fP \fI file \fP +True if +.I file +exists and is a directory. +.TP +\fB \-e \fP \fI file \fP +True if +.I file +exists (regardless of type). +.TP +\fB \-f \fP \fI file \fP +True if +.I file +exists and is a regular file. +.TP +\fB \-g \fP \fI file \fP +True if +.I file +exists and its set group ID flag +is set. +.TP +\fB \-h \fP \fI file \fP +True if +.I file +exists and is a symbolic link. +.TP +\fB \-n \fP \fI string \fP +True if the length of +.I string +is nonzero. +.TP +\fB \-p \fP \fI file \fP +True if +.I file +is a named pipe +.Po Tn FIFO Pc . +.TP +\fB \-r \fP \fI file \fP +True if +.I file +exists and is readable. +.TP +\fB \-s \fP \fI file \fP +True if +.I file +exists and has a size greater +than zero. +.TP +\fB \-t \fp \fI [file_descriptor] \fP +True if the file whose file descriptor number +is +.I file_descriptor +(default 1) is open and is +associated with a terminal. +.TP +\fB \-u \fP \fI file \fP +True if +.I file +exists and its set user ID flag +is set. +.TP +\fB \-w \fP \fI file \fP +True if +.I file +exists and is writable. +True indicates only that the write flag is on. +The file is not writable on a read-only file +system even if this test indicates true. +.TP +\fB \-x \fP \fI file \fP +True if +.I file +exists and is executable. +True indicates only that the execute flag is on. +If +.I file +is a directory, true +indicates that +.I file +can be searched. +.TP +\fB \-z \fP \fI string \fP +True if the length of +.I string +is zero. +.TP +\fI string \fP +True if +.I string +is not the null +string. +.TP +\fI s1 \fP \fB = \fP \fI s2 \fP +True if the strings +.I s1 +and +.I s2 +are identical. +.TP +\fI s1 \fP \fB != \fP \fI s2 \fP +True if the strings +.I s1 +and +.I s2 +are not identical. +.TP +\fI n1 \fP \fB \-eq \fP \fI n2 \fP +True if the integers +.I n1 +and +.I n2 +are algebraically +equal. +.TP +\fI n1 \fP \fB \-ne \fP \fI n2 \fP +True if the integers +.I n1 +and +.I n2 +are not +algebraically equal. +.TP +\fI n1 \fP \fB \-gt \fP \fI n2 \fP +True if the integer +.I n1 +is algebraically +greater than the integer +.I n2 . +.TP +\fI n1 \fP \fB \-ge \fP \fI n2 \fP +True if the integer +.I n1 +is algebraically +greater than or equal to the integer +.I n2 . +.TP +\fI n1 \fP \fB \-lt \fP \fI n2 \fP +True if the integer +.I n1 +is algebraically less +than the integer +.I n2 . +.TP +\fI n1 \fP \fB \-le \fP \fI n2 \fP +True if the integer +.I n1 +is algebraically less +than or equal to the integer +.I n2 . +.TP +.PP +These primaries can be combined with the following operators: +.TP +.B ! expression +True if +.I expression +is false. +.TP +\fI expression1 \fP \fB \-a \fP \fI expression2 \fP +True if both +.I expression1 +and +.I expression2 +are true. +.TP +\fI expression1 \fP \fB \-o \fP \fI expression2 \fP +True if either +.I expression1 +or +.I expression2 +are true. +.TP +\fI (expression) \fP +True if expression is true. +.TP +.PP +The +.B \-a +operator has higher precedence than the +.B \-o +operator. +.SH GRAMMAR AMBIGUITY +The +.B test +grammar is inherently ambiguous. In order to assure a degree of consistency, +the cases described in the +IEEE Std 1003.2 ("POSIX"), +section D11.2/4.62.4, standard +are evaluated consistently according to the rules specified in the +standards document. All other cases are subject to the ambiguity in the +command semantics. +.SH RETURN VALUES +The +.B test +utility exits with one of the following values: +.TP +.B 0 +expression evaluated to true. +.TP +.B 1 +expression evaluated to false or expression was +missing. +.TP +.B >1 +An error occurred. +.SH BUGS +Named pipes are not implemented in 2.11BSD. +.SH STANDARDS +The +.B test +function is expected to be +IEEE Std 1003.2 ("POSIX") +compatible. diff --git a/bin/test/test.c b/bin/test/test.c new file mode 100644 index 0000000..ac19d3d --- /dev/null +++ b/bin/test/test.c @@ -0,0 +1,573 @@ +/*- + * Copyright (c) 1992, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Kenneth Almquist. + * + * 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. + * + * test.c,v 1.9 1994/11/05 20:48:06 ache Exp + */ + +#if defined(DOSCCS) & !defined(lint) +static char copyright[] = +"@(#) Copyright (c) 1992, 1993, 1994\n\ + The Regents of the University of California. All rights reserved.\n"; +#endif /* not lint */ + +#if defined(DOSCCS) & !defined(lint) +static char sccsid[] = "@(#)test.c 8.3.1 (2.11BSD) 1995/03/13"; +#endif /* not lint */ + +#include +#include +#include + +#include +#include +#include +#include + +#include "operators.h" + +#define STACKSIZE 12 +#define NESTINCR 16 + +/* data types */ +#define STRING 0 +#define INTEGER 1 +#define BOOLEAN 2 + +#define IS_BANG(s) (s[0] == '!' && s[1] == '\0') + +/* + * This structure hold a value. The type keyword specifies the type of + * the value, and the union u holds the value. The value of a boolean + * is stored in u.num (1 = TRUE, 0 = FALSE). + */ +struct value { + int type; + union { + char *string; + long num; + } u; +}; + +struct operator { + short op; /* Which operator. */ + short pri; /* Priority of operator. */ +}; + +struct filestat { + char *name; /* Name of file. */ + int rcode; /* Return code from stat. */ + struct stat stat; /* Status info on file. */ +}; + +extern char unary_op[][4]; +extern char binary_op[][4]; +extern char andor_op[][4]; +extern int op_priority[]; +extern int op_argflag[]; +extern long atol(); + +main(argc, argv) + int argc; + char *argv[]; +{ + + struct operator opstack[STACKSIZE]; + register struct operator *opsp; + struct value valstack[STACKSIZE + 1]; + register struct value *valsp; + struct filestat fs; + char c, **ap, *opname, *p; + int binary, nest, op, pri, ret_val, skipping; + + if ((p = argv[0]) == NULL) + errx(2, "test: argc is zero"); + + if (*p != '\0' && p[strlen(p) - 1] == '[') { + if (strcmp(argv[--argc], "]")) + errx(2, "missing ]"); + argv[argc] = NULL; + } + ap = argv + 1; + fs.name = NULL; + + /* + * Test(1) implements an inherently ambiguous grammer. In order to + * assure some degree of consistency, we special case the POSIX 1003.2 + * requirements to assure correct evaluation for POSIX scripts. The + * following special cases comply with POSIX P1003.2/D11.2 Section + * 4.62.4. + */ + switch(argc - 1) { + case 0: /* % test */ + return (1); + break; + case 1: /* % test arg */ + return (argv[1] == NULL || *argv[1] == '\0') ? 1 : 0; + break; + case 2: /* % test op arg */ + opname = argv[1]; + if (IS_BANG(opname)) + return (*argv[2] == '\0') ? 0 : 1; + else { + ret_val = posix_unary_op(&argv[1]); + if (ret_val >= 0) + return (ret_val); + } + break; + case 3: /* % test arg1 op arg2 */ + if (IS_BANG(argv[1])) { + ret_val = posix_unary_op(&argv[1]); + if (ret_val >= 0) + return (!ret_val); + } else { + ret_val = posix_binary_op(&argv[1]); + if (ret_val >= 0) + return (ret_val); + } + break; + case 4: /* % test ! arg1 op arg2 */ + if (IS_BANG(argv[1]) && lookup_op(argv[3], andor_op) < 0 ) { + ret_val = posix_binary_op(&argv[2]); + if (ret_val >= 0) + return (!ret_val); + } + break; + default: + break; + } + + /* + * We use operator precedence parsing, evaluating the expression as + * we parse it. Parentheses are handled by bumping up the priority + * of operators using the variable "nest." We use the variable + * "skipping" to turn off evaluation temporarily for the short + * circuit boolean operators. (It is important do the short circuit + * evaluation because under NFS a stat operation can take infinitely + * long.) + */ + opsp = opstack + STACKSIZE; + valsp = valstack; + nest = skipping = 0; + if (*ap == NULL) { + valstack[0].type = BOOLEAN; + valstack[0].u.num = 0; + goto done; + } + for (;;) { + opname = *ap++; + if (opname == NULL) + syntax(); + if (opname[0] == '(' && opname[1] == '\0') { + nest += NESTINCR; + continue; + } else if (*ap && (op = lookup_op(opname, unary_op)) >= 0) { + if (opsp == &opstack[0]) + overflow(); + --opsp; + opsp->op = op; + opsp->pri = op_priority[op] + nest; + continue; + } else { + valsp->type = STRING; + valsp->u.string = opname; + valsp++; + } + for (;;) { + opname = *ap++; + if (opname == NULL) { + if (nest != 0) + syntax(); + pri = 0; + break; + } + if (opname[0] != ')' || opname[1] != '\0') { + if ((op = lookup_op(opname, binary_op)) < 0) + syntax(); + op += FIRST_BINARY_OP; + pri = op_priority[op] + nest; + break; + } + if ((nest -= NESTINCR) < 0) + syntax(); + } + while (opsp < &opstack[STACKSIZE] && opsp->pri >= pri) { + binary = opsp->op; + for (;;) { + valsp--; + c = op_argflag[opsp->op]; + if (c == OP_INT) { + if (valsp->type == STRING) + get_int(valsp->u.string, + &valsp->u.num); + valsp->type = INTEGER; + } else if (c >= OP_STRING) { + /* OP_STRING or OP_FILE */ + if (valsp->type == INTEGER) { + if ((p = (char *)malloc(32)) == NULL) + err(2, NULL); +#ifdef SHELL + fmtstr(p, 32, "%d", + valsp->u.num); +#else + (void)sprintf(p, + "%d", valsp->u.num); +#endif + valsp->u.string = p; + } else if (valsp->type == BOOLEAN) { + if (valsp->u.num) + valsp->u.string = + "true"; + else + valsp->u.string = ""; + } + valsp->type = STRING; + if (c == OP_FILE && (fs.name == NULL || + strcmp(fs.name, valsp->u.string))) { + fs.name = valsp->u.string; + fs.rcode = + stat(valsp->u.string, + &fs.stat); + } + } + if (binary < FIRST_BINARY_OP) + break; + binary = 0; + } + if (!skipping) + expr_operator(opsp->op, valsp, &fs); + else if (opsp->op == AND1 || opsp->op == OR1) + skipping--; + valsp++; /* push value */ + opsp++; /* pop operator */ + } + if (opname == NULL) + break; + if (opsp == &opstack[0]) + overflow(); + if (op == AND1 || op == AND2) { + op = AND1; + if (skipping || expr_is_false(valsp - 1)) + skipping++; + } + if (op == OR1 || op == OR2) { + op = OR1; + if (skipping || !expr_is_false(valsp - 1)) + skipping++; + } + opsp--; + opsp->op = op; + opsp->pri = pri; + } +done: return (expr_is_false(&valstack[0])); +} + +int +expr_is_false(val) + register struct value *val; +{ + + if (val->type == STRING) { + if (val->u.string[0] == '\0') + return (1); + } else { /* INTEGER or BOOLEAN */ + if (val->u.num == 0) + return (1); + } + return (0); +} + + +/* + * Execute an operator. Op is the operator. Sp is the stack pointer; + * sp[0] refers to the first operand, sp[1] refers to the second operand + * (if any), and the result is placed in sp[0]. The operands are converted + * to the type expected by the operator before expr_operator is called. + * Fs is a pointer to a structure which holds the value of the last call + * to stat, to avoid repeated stat calls on the same file. + */ +void +expr_operator(op, sp, fs) + int op; + register struct value *sp; + struct filestat *fs; +{ + register int i; + + switch (op) { + case NOT: + sp->u.num = expr_is_false(sp); + sp->type = BOOLEAN; + break; + case ISEXIST: +exist: + if (fs == NULL || fs->rcode == -1) + goto false; + else + goto true; + case ISREAD: + if (geteuid() == 0) + goto exist; + i = S_IROTH; + goto permission; + case ISWRITE: + if (geteuid() != 0) + i = S_IWOTH; + else { + i = S_IWOTH|S_IWGRP|S_IWUSR; + goto filebit; + } + goto permission; + case ISEXEC: + if (geteuid() != 0) { + i = S_IXOTH; +permission: if (fs->stat.st_uid == geteuid()) + i <<= 6; + else { + gid_t grlist[NGROUPS]; + int ngroups, j; + + ngroups = getgroups(NGROUPS, grlist); + for (j = 0; j < ngroups; j++) + if (fs->stat.st_gid == grlist[j]) { + i <<= 3; + goto filebit; + } + } + } else + i = S_IXOTH|S_IXGRP|S_IXUSR; + goto filebit; /* true if (stat.st_mode & i) != 0 */ + case ISFILE: + i = S_IFREG; + goto filetype; + case ISDIR: + i = S_IFDIR; + goto filetype; + case ISCHAR: + i = S_IFCHR; + goto filetype; + case ISBLOCK: + i = S_IFBLK; + goto filetype; + case ISSYMLINK: + i = S_IFLNK; + (void)lstat(sp->u.string, &fs->stat); + goto filetype; + case ISFIFO: + i = S_IFIFO; + goto filetype; +filetype: if ((fs->stat.st_mode & S_IFMT) == i && fs->rcode >= 0) +true: sp->u.num = 1; + else +false: sp->u.num = 0; + sp->type = BOOLEAN; + break; + case ISSETUID: + i = S_ISUID; + goto filebit; + case ISSETGID: + i = S_ISGID; + goto filebit; + case ISSTICKY: + i = S_ISVTX; +filebit: if (fs->stat.st_mode & i && fs->rcode >= 0) + goto true; + goto false; + case ISSIZE: + sp->u.num = fs->rcode >= 0 ? fs->stat.st_size : 0L; + sp->type = INTEGER; + break; + case ISTTY: + sp->u.num = isatty(sp->u.num); + sp->type = BOOLEAN; + break; + case NULSTR: + if (sp->u.string[0] == '\0') + goto true; + goto false; + case STRLEN: + sp->u.num = strlen(sp->u.string); + sp->type = INTEGER; + break; + case OR1: + case AND1: + /* + * These operators are mostly handled by the parser. If we + * get here it means that both operands were evaluated, so + * the value is the value of the second operand. + */ + *sp = *(sp + 1); + break; + case STREQ: + case STRNE: + i = 0; + if (!strcmp(sp->u.string, (sp + 1)->u.string)) + i++; + if (op == STRNE) + i = 1 - i; + sp->u.num = i; + sp->type = BOOLEAN; + break; + case EQ: + if (sp->u.num == (sp + 1)->u.num) + goto true; + goto false; + case NE: + if (sp->u.num != (sp + 1)->u.num) + goto true; + goto false; + case GT: + if (sp->u.num > (sp + 1)->u.num) + goto true; + goto false; + case LT: + if (sp->u.num < (sp + 1)->u.num) + goto true; + goto false; + case LE: + if (sp->u.num <= (sp + 1)->u.num) + goto true; + goto false; + case GE: + if (sp->u.num >= (sp + 1)->u.num) + goto true; + goto false; + + } +} + +int +lookup_op(name, table) + char *name; + char *table; +{ + char *tp; + char c; + int i; + + c = name[1]; + tp = table; + for(i = 0; strcmp((char *)(tp + i),"ZZZ") ; i=i+4){ + if ((char)(tp + i)[1] == c && !strcmp((char *)(tp + i), name)) + return (i/4); + } + return (-1); +} + +int +posix_unary_op(argv) + char **argv; +{ + struct filestat fs; + struct value valp; + int op, c; + char *opname; + + opname = *argv; + if ((op = lookup_op(opname, unary_op)) < 0) + return (-1); + c = op_argflag[op]; + opname = argv[1]; + valp.u.string = opname; + if (c == OP_FILE) { + fs.name = opname; + fs.rcode = stat(opname, &fs.stat); + } else if (c != OP_STRING) + return (-1); + + expr_operator(op, &valp, &fs); + return (valp.u.num == 0); +} + +int +posix_binary_op(argv) + char **argv; +{ + struct value v[2]; + int op, c; + char *opname; + + opname = argv[1]; + if ((op = lookup_op(opname, binary_op)) < 0) + return (-1); + op += FIRST_BINARY_OP; + c = op_argflag[op]; + + if (c == OP_INT) { + get_int(argv[0], &v[0].u.num); + get_int(argv[2], &v[1].u.num); + } else { + v[0].u.string = argv[0]; + v[1].u.string = argv[2]; + } + expr_operator(op, v, NULL); + return (v[0].u.num == 0); +} + +/* + * Integer type checking. + */ +void +get_int(v, lp) + register char *v; + long *lp; +{ + + for (; *v && isspace(*v); ++v); + + if(!*v) { + *lp = 0; + return; + } + + if (isdigit(*v) || ((*v == '-' || *v == '+') && isdigit(*(v+1)))) { + *lp = atol(v); + return; + } + errx(2, "%s: expected integer", v); +} + +void +syntax() +{ + + err(2, "syntax error"); +} + +void +overflow() +{ + + err(2, "expression is too complex"); +} diff --git a/bin/time.c b/bin/time.c new file mode 100644 index 0000000..618f497 --- /dev/null +++ b/bin/time.c @@ -0,0 +1,60 @@ +#ifndef lint +static char *sccsid = "@(#)time.c 4.5 (Berkeley) 7/1/83"; +#endif + +/* + * time + */ +#include +#include +#include +#include +#include + +main(argc, argv) + int argc; + char **argv; +{ + int status; + register int p; + struct timeval before, after; + struct rusage ru; + + if (argc<=1) + exit(0); + gettimeofday(&before, 0); + p = fork(); + if (p < 0) { + perror("time"); + exit(1); + } + if (p == 0) { + execvp(argv[1], &argv[1]); + perror(argv[1]); + exit(1); + } + signal(SIGINT, SIG_IGN); + signal(SIGQUIT, SIG_IGN); + while (wait3(&status, 0, &ru) != p) + ; + gettimeofday(&after, 0); + if ((status&0377) != 0) + fprintf(stderr, "Command terminated abnormally.\n"); + after.tv_sec -= before.tv_sec; + after.tv_usec -= before.tv_usec; + if (after.tv_usec < 0) + after.tv_sec--, after.tv_usec += 1000000; + printt("real", &after); + printt("user", &ru.ru_utime); + printt("sys ", &ru.ru_stime); + fprintf(stderr, "\n"); + exit (status>>8); +} + +printt(s, tv) + char *s; + struct timeval *tv; +{ + + fprintf(stderr, "%9ld.%01ld %s ", tv->tv_sec, tv->tv_usec/100000, s); +} diff --git a/bin/tp/Makefile b/bin/tp/Makefile new file mode 100644 index 0000000..7e99dbe --- /dev/null +++ b/bin/tp/Makefile @@ -0,0 +1,17 @@ +# @(#)Makefile 4.1 12/18/82 + +CFLAGS=-O +SEPFLAG= -i +h = tp.h tp_defs.h +o = tp0.o tp1.o tp2.o tp3.o + +tp : $o + $(CC) ${SEPFLAG} -o tp $o + +$o : $h + +install : tp + install -s tp ${DESTDIR}/bin + +clean : + rm -f *.o diff --git a/bin/tp/tp.h b/bin/tp/tp.h new file mode 100644 index 0000000..faefd12 --- /dev/null +++ b/bin/tp/tp.h @@ -0,0 +1,83 @@ +/* @(#)tp.h 4.2 6/28/84 */ + +/* 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)(); + +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/bin/tp/tp0.c b/bin/tp/tp0.c new file mode 100644 index 0000000..3e009ce --- /dev/null +++ b/bin/tp/tp0.c @@ -0,0 +1,6 @@ +#ifndef lint +static char sccsid[] = "@(#)tp0.c 4.1 12/18/82"; +#endif + +#include "tp.h" +#include "tp_defs.h" diff --git a/bin/tp/tp1.c b/bin/tp/tp1.c new file mode 100644 index 0000000..7dd682b --- /dev/null +++ b/bin/tp/tp1.c @@ -0,0 +1,196 @@ +#ifndef lint +static char sccsid[] = "@(#)tp1.c 4.2 6/28/84"; +#endif + +#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[8] = c; + continue; + + case 'f': + tname = *parg++; + flags |= flm; + 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(); + (*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); + if (fio < 0) fio = creat(tname,0666); + } 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(); +} + +/* /* 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 + * dptr points to the dir entry */ +char *pname; +struct dent *dptr; +{ + register char *np; + register n; + extern char *malloc(); + + if((n=strlen(pname)) > NAMELEN) { + printf("Pathname too long - %s\nFile ignored\n",pname); + clrent(dptr); + } + else { + dptr->d_namep = np = malloc(n + 1); + if (np == 0) { + printf("Out of core\n"); + done(); + } + 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/bin/tp/tp2.c b/bin/tp/tp2.c new file mode 100644 index 0000000..bbdca17 --- /dev/null +++ b/bin/tp/tp2.c @@ -0,0 +1,352 @@ +#ifndef lint +static char sccsid[] = "@(#)tp2.c 4.1 12/18/82"; +#endif + +#include "tp.h" +#include +#include +#include +#include + +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;ipathnam[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; + } else + printf("\7\7\7Warning: cannot read prototype boot block.\n"); + 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 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; + register DIR *dirp; + struct direct *dirent; + + if ((dirp = opendir(name)) == NULL) fserr(); + for (;;) { + dirent = readdir(dirp); + if (dirent == NULL) { + closedir(dirp); + return; + } + if (dirent->d_ino == 0) /* null entry */ + continue; + p0 = name; + if (dirent->d_name[0] == '.') /* don't save .xxxx */ + continue; + while (*p0++); + save0 = --p0; /* save loc of \0 */ + if (p0[-1] != '/') + *p0++ = '/'; + strcpy(p0, dirent->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/bin/tp/tp3.c b/bin/tp/tp3.c new file mode 100644 index 0000000..5c9731d --- /dev/null +++ b/bin/tp/tp3.c @@ -0,0 +1,252 @@ +#ifndef lint +static char sccsid[] = "@(#)tp3.c 4.1 12/18/82"; +#endif + +#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= 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/bin/tp/tp_defs.h b/bin/tp/tp_defs.h new file mode 100644 index 0000000..64c013f --- /dev/null +++ b/bin/tp/tp_defs.h @@ -0,0 +1,7 @@ +/* @(#)tp_defs.h 4.1 12/18/82 */ + +char mt[] = "/dev/rmt0"; +char tc[] = "/dev/tapx"; +int flags = flu; +char mheader[] = "/usr/mdec/mboot"; +char theader[] = "/usr/mdec/tboot"; diff --git a/bin/true.sh b/bin/true.sh new file mode 100644 index 0000000..ca916d0 --- /dev/null +++ b/bin/true.sh @@ -0,0 +1 @@ +exit 0 diff --git a/bin/wall.c b/bin/wall.c new file mode 100644 index 0000000..06db418 --- /dev/null +++ b/bin/wall.c @@ -0,0 +1,153 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(DOSCCS) && !defined(lint) +char copyright[] = +"@(#) Copyright (c) 1980 Regents of the University of California.\n\ + All rights reserved.\n"; + +static char sccsid[] = "@(#)wall.c 5.3.2 (2.11BSD GTE) 1996/11/16"; +#endif + +/* + * wall.c - Broadcast a message to all users. + * + * This program is not related to David Wall, whose Stanford Ph.D. thesis + * is entitled "Mechanisms for Broadcast and Selective Broadcast". + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#define IGNOREUSER "sleeper" + +char hostname[32]; +char mesg[3000]; +int msize,sline; +struct utmp *utmp; +char *strcpy(); +char *strcat(); +char *malloc(); +char who[UT_NAMESIZE + 1] = "???"; +long clock, time(); +struct tm *localtime(); +struct tm *localclock; + +extern errno; + +main(argc, argv) +char *argv[]; +{ + register int i, c; + register struct utmp *p; + int f; + struct stat statb; + + (void) gethostname(hostname, sizeof (hostname)); + if ((f = open(_PATH_UTMP, O_RDONLY, 0)) < 0) { + fprintf(stderr, "Cannot open %s\n", _PATH_UTMP); + exit(1); + } + clock = time( 0 ); + localclock = localtime( &clock ); + sline = ttyslot(); /* 'utmp' slot no. of sender */ + (void) fstat(f, &statb); + utmp = (struct utmp *)malloc((unsigned)statb.st_size); + c = read(f, (char *)utmp, (int)statb.st_size); + (void) close(f); + c /= sizeof(struct utmp); + if (sline) + strncpy(who, utmp[sline].ut_name, sizeof(utmp[sline].ut_name)); + sprintf(mesg, + "\n\007\007Broadcast Message from %s@%s (%.*s) at %d:%02d ...\r\n\n" + , who + , hostname + , sizeof(utmp[sline].ut_line) + , utmp[sline].ut_line + , localclock -> tm_hour + , localclock -> tm_min + ); + msize = strlen(mesg); + if (argc >= 2) { + /* take message from unix file instead of standard input */ + if (freopen(argv[1], "r", stdin) == NULL) { + perror(argv[1]); + exit(1); + } + } + while ((i = getchar()) != EOF) { + if (i == '\n') + mesg[msize++] = '\r'; + if (msize >= sizeof mesg) { + fprintf(stderr, "Message too long\n"); + exit(1); + } + mesg[msize++] = i; + } + fclose(stdin); + for (i=0; iut_name[0] == 0 || + strncmp(p->ut_name, IGNOREUSER, sizeof(p->ut_name)) == 0) + continue; + sendmes(p->ut_line); + } + exit(0); +} + +sendmes(tty) +char *tty; +{ + register f, flags; + static char t[50] = "/dev/"; + int e, i; + + strcpy(t + 5, tty); + + if ((f = open(t, O_WRONLY|O_NDELAY)) < 0) { + if (errno != EWOULDBLOCK) + perror(t); + return; + } + if ((flags = fcntl(f, F_GETFL, 0)) == -1) { + perror(t); + return; + } + if (fcntl(f, F_SETFL, flags | FNDELAY) == -1) + goto oldway; + i = write(f, mesg, msize); + e = errno; + (void) fcntl(f, F_SETFL, flags); + if (i == msize) { + (void) close(f); + return; + } + if (e != EWOULDBLOCK) { + errno = e; + perror(t); + (void) close(f); + return; + } +oldway: + while ((i = fork()) == -1) + if (wait((int *)0) == -1) { + fprintf(stderr, "Try again\n"); + return; + } + if (i) { + (void) close(f); + return; + } + + (void) write(f, mesg, msize); + exit(0); +} diff --git a/bin/who.c b/bin/who.c new file mode 100644 index 0000000..2a7d553 --- /dev/null +++ b/bin/who.c @@ -0,0 +1,86 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(DOSCCS) && !defined(lint) +char copyright[] = +"@(#) Copyright (c) 1980 Regents of the University of California.\n\ + All rights reserved.\n"; + +static char sccsid[] = "@(#)who.c 5.1.3 (2.11BSD GTE) 1997/7/29"; +#endif + +#include +#include +#include +#include +#include /* for MAXHOSTNAMELEN */ +#include +#include +#include + +#define NMAX sizeof(utmp.ut_name) +#define LMAX sizeof(utmp.ut_line) +#define HMAX sizeof(utmp.ut_host) + +struct utmp utmp; +struct passwd *pw; +char hostname[MAXHOSTNAMELEN]; + +main(argc, argv) + int argc; + char **argv; +{ + register char *tp, *s; + register FILE *fi; + + s = _PATH_UTMP; + if(argc == 2) + s = argv[1]; + if (argc == 3) { + tp = ttyname(0); + if (tp) + tp = rindex(tp, '/') + 1; + else { /* no tty - use best guess from passwd file */ + pw = getpwuid(getuid()); + strncpy(utmp.ut_name, pw ? pw->pw_name : "?", NMAX); + strcpy(utmp.ut_line, "tty??"); + time(&utmp.ut_time); + putline(); + exit(0); + } + } + if ((fi = fopen(s, "r")) == NULL) { + fprintf(stderr, "who: cannot open %s", s); + exit(1); + } + while (fread((char *)&utmp, sizeof(utmp), 1, fi) == 1) { + if (argc == 3) { + gethostname(hostname, sizeof (hostname)); + if (strcmp(utmp.ut_line, tp)) + continue; + printf("%s!", hostname); + putline(); + exit(0); + } + if (utmp.ut_name[0] == '\0' && argc == 1) + continue; + putline(); + } +} + +putline() +{ + register char *cbuf; + + printf("%-*.*s %-*.*s", + NMAX, NMAX, utmp.ut_name, + LMAX, LMAX, utmp.ut_line); + cbuf = ctime(&utmp.ut_time); + printf("%.12s", cbuf+4); + if (utmp.ut_host[0]) + printf("\t(%.*s)", HMAX, utmp.ut_host); + putchar('\n'); +} diff --git a/bin/write.c b/bin/write.c new file mode 100644 index 0000000..d32c5b4 --- /dev/null +++ b/bin/write.c @@ -0,0 +1,245 @@ +#if !defined(lint) && defined(DOSCCS) +static char *sccsid = "@(#)write.c 4.13.2 1996/11/16"; +#endif +/* + * write to another user + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define NMAX sizeof(ubuf.ut_name) +#define LMAX sizeof(ubuf.ut_line) + +struct utmp ubuf; +int signum[] = {SIGHUP, SIGINT, SIGQUIT, 0}; +char me[NMAX + 1] = "???"; +char *him; +char *mytty; +char histty[32]; +char ttybuf[32]; +char *histtya; +int logcnt; +int eof(); +int timout(); +FILE *tf; + +main(argc, argv) + int argc; + char *argv[]; +{ + struct stat stbuf; + register i; + register FILE *uf; + int c1, c2; + time_t clock = time(0); + int suser = getuid() == 0; + int nomesg = 0; + struct tm *localclock = localtime( &clock ); + + if (argc < 2) { + fprintf(stderr, "Usage: write user [ttyname]\n"); + exit(1); + } + him = argv[1]; + if (argc > 2) + histtya = argv[2]; + if ((uf = fopen(_PATH_UTMP, "r")) == NULL) { + fprintf(stderr, "write: %s: %s\n", _PATH_UTMP, strerror(errno)); + if (histtya == 0) + exit(10); + goto cont; + } + mytty = ttyname(2); + if (mytty == NULL) { + fprintf(stderr, "write: Can't find your tty\n"); + exit(1); + } + if (stat(mytty, &stbuf) < 0) { + perror("write: Can't stat your tty"); + exit(1); + } + if ((stbuf.st_mode&020) == 0) { + fprintf(stderr, + "write: You have write permission turned off\n"); + if (!suser) + exit(1); + } + mytty = rindex(mytty, '/') + 1; + if (histtya) { + strcpy(histty, "/dev/"); + strcat(histty, histtya); + } + while (fread((char *)&ubuf, sizeof(ubuf), 1, uf) == 1) { + if (ubuf.ut_name[0] == '\0') + continue; + if (strcmp(ubuf.ut_line, mytty)==0) { + for (i=0; i 1) { + fprintf(stderr, + "write: %s logged in more than once ... writing to %s\n", + him, histty+5); + } +cont: + if (access(histty, 0) < 0) { + fprintf(stderr, "write: No such tty\n"); + exit(1); + } + signal(SIGALRM, timout); + alarm(5); + if ((tf = fopen(histty, "w")) == NULL) { + fprintf(stderr, "write: Permission denied\n"); + exit(1); + } + alarm(0); + sigs(eof); + { char hostname[32]; + gethostname(hostname, sizeof (hostname)); + fprintf(tf, + "\r\nMessage from %s@%s on %s at %d:%02d ...\r\n\007\007\007", + me, hostname, mytty, localclock->tm_hour, localclock->tm_min); + fflush(tf); + } + for (;;) { + char buf[BUFSIZ]; + register char *bp; + i = read(0, buf, sizeof buf); + if (i <= 0) + eof(); + if (buf[0] == '!') { + buf[i] = 0; + ex(buf); + continue; + } + for (bp = buf; --i >= 0; bp++) { + if (*bp == '\n') + putc('\r', tf); + + if (!isascii(*bp)) { + putc('M', tf); + putc('-', tf); + *bp = toascii(*bp); + } + + if (isprint(*bp) || + *bp == ' ' || *bp == '\t' || *bp == '\n') { + putc(*bp, tf); + } else { + putc('^', tf); + putc(*bp ^ 0100, tf); + } + + if (*bp == '\n') + fflush(tf); + + if (ferror(tf) || feof(tf)) { + printf("\n\007Write failed (%s logged out?)\n", + him); + exit(1); + } + } + } +} + +timout() +{ + + fprintf(stderr, "write: Timeout opening their tty\n"); + exit(1); +} + +eof() +{ + + fprintf(tf, "EOF\r\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) { + fclose(tf); /* Close his terminal */ + setgid(getgid()); /* Give up effective group privs */ + sigs((int (*)())0); + execl(getenv("SHELL") ? + getenv("SHELL") : "/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/etc/MAKEDEV b/etc/MAKEDEV new file mode 100755 index 0000000..1ec9386 --- /dev/null +++ b/etc/MAKEDEV @@ -0,0 +1,377 @@ +#!/bin/sh - +# +# Copyright (c) 1980 Regents of the University of California. +# All rights reserved. The Berkeley software License Agreement +# specifies the terms and conditions for redistribution. +# +# @(#)MAKEDEV 4.27.6 (2.11BSD) 1999/2/19 +# +# Device "make" file. Valid arguments: +# std standard devices +# local configuration specific devices +# fd file descriptor driver +# Tapes: +# ht* unibus tu77 & te16 +# tm* unibus tm11 & te10 emulations (e.g. Emulex tc-11) +# ts* unibus ts11 +# tu* tmscp (tk50/tu81) +# Disks: +# br* unibus Eaton br1538 or br1711 +# hk* unibus rk06 and rk07 +# ra* unibus uda50 w/ ra?? +# rk* unibus rk05 +# rl* unibus rl01/rl02 +# rx* unibus rx02 +# si* unibus cdc 9766 w/ si 9500 +# xp* unibus rm02/03/05, rp04/05/06, diva, eagle, cdc9766, fuji 160. +# Terminal multiplexors: +# dl* dl-11 units other than the console +# dz* unibus dz11 and dz32 +# dh* unibus dh11 and emulations (e.g. Able dmax, Emulex cs-11) +# dmf* unibus dmf32 +# dhu* unibus dhu11 +# dmz* unibus dmz32 +# dhv* qbus dhv11 +# Pseudo terminals: +# pty* set of 16 master and slave pseudo terminals +# Printers: +# lp* unibus lp11 parallel interface +# va* unibus varian parallel interface +# vp* unibus versatec parallel interface +# Call units: +# Special purpose devices: +# dr* unibus dr11 +# ram* memory disk +# dn* dn11 dialer +# ingreslock Ingres lock driver. + +PATH=/etc:/sbin:/usr/sbin:/bin:/usr/bin +umask 77 +for i +do +case $i in + +std) + mknod console c 0 0 +# mknod kUmem c 1 3 ; chmod 600 kUmem ;: untested + mknod kmem c 1 1 ; chmod 640 kmem ; chgrp kmem kmem + mknod mem c 1 0 ; chmod 640 mem ; chgrp kmem mem + mknod null c 1 2 ; chmod 666 null + mknod zero c 1 3 ; chmod 444 zero + mknod tty c 9 0 ; chmod 666 tty + mknod klog c 22 0 ; chmod 600 klog + mknod errlog c 22 1 ; chmod 600 errlog + mknod acctlog c 22 2 ; chmod 600 acctlog + ;; + +fd) + umask 0 + rm -rf fd + rm -f stdin stdout stderr + mkdir fd + chmod 755 fd + mknod stdin c 26 0 + mknod stdout c 26 1 + mknod stderr c 26 2 + eval `echo "" | awk '{ for (i = 0; i < 32; i++) + printf("mknod fd/%d c 26 %d; ",i,i); }'` + ;; + +ht*|tm*|ts*|tu*) + umask 0 ; ctlr=`expr $i : '..\(.*\)'` + ctlr=`expr $ctlr '*' 64` + case $i in + ht*) blk=0; chr=6;; + tm*) blk=1; chr=7;; + ts*) blk=2; chr=8;; + tu*) blk=12; chr=23;; + esac +# Maximum of 4 controllers in a system + case $ctlr in + 0|64|128|192) +# Maximum of 4 units per controller +# for unit in 0 1 2 3 + for unit in 0 1 + do + zero=`expr $ctlr + $unit + 0` + four=`expr $zero + 4` ; eight=`expr $zero + 8` + twelve=`expr $zero + 12` + sixteen=`expr $zero + 16` + twenty=`expr $zero + 20` + twentyfour=`expr $zero + 24` + twentyeight=`expr $zero + 28` + mknod mt$zero b $blk $zero + mknod mt$four b $blk $four + mknod mt$eight b $blk $eight + mknod mt$twelve b $blk $twelve + mknod nmt$zero b $blk $four ;: v7 compatibility + mknod nmt$eight b $blk $twelve ;: ditto + mknod nrmt$zero c $chr $four ;: ditto + mknod nrmt$eight c $chr $twelve ;: ditto + mknod rmt$zero c $chr $zero + mknod rmt$four c $chr $four + mknod rmt$eight c $chr $eight + mknod rmt$twelve c $chr $twelve + if [ `expr $i : '\(..\)'` = tu ] + then + mknod mt$sixteen b $blk $sixteen + mknod mt$twenty b $blk $twenty + mknod mt$twentyfour b $blk $twentyfour + mknod mt$twentyeight b $blk $twentyeight + mknod nmt$sixteen b $blk $twenty ;: v7 compatibility + mknod nmt$twentyfour b $blk $twentyeight ;: ditto + mknod nrmt$sixteen c $chr $twenty ;: ditto + mknod nrmt$twentyfour c $chr $twentyeight ;: ditto + mknod rmt$sixteen c $chr $sixteen + mknod rmt$twenty c $chr $twenty + mknod rmt$twentyfour c $chr $twentyfour + mknod rmt$twentyeight c $chr $twentyeight + fi + if [ `expr $i : '\(..\)'` = ut ] + then + mknod mt$twenty b $blk $twenty + mknod rmt$twenty c $chr $twenty + fi + done + ;; + *) + echo bad controller for tape in: $1 + ;; + esac + umask 77 + ;; + +rk*) + # The 2.11BSD rk driver doesn't support partitions. We create + # a single block and charater inode pair for each unit and + # call it rkNh. + umask 2 ; unit=`expr $i : '..\(.*\)'` + case $i in + rk*) name=rk; blk=6; chr=15;; + esac + mknod ${name}${unit}h b ${blk} ${unit} + mknod r${name}${unit}h c ${chr} ${unit} + chgrp operator ${name}${unit}h r${name}${unit}h + chmod 640 ${name}${unit}h r${name}${unit}h + ;; + +rx*) + umask 2 + name=rx; blk=8; chr=17 + mknod ${name}0a b ${blk} 0 + mknod ${name}1a b ${blk} 1 + mknod ${name}0b b ${blk} 2 + mknod ${name}1b b ${blk} 3 + mknod r${name}0a c ${chr} 0 + mknod r${name}1a c ${chr} 1 + mknod r${name}0b c ${chr} 2 + mknod r${name}1b c ${chr} 3 + chgrp operator ${name}[01][ab] r${name}[01][ab] + chmod 640 ${name}[01][ab] r${name}[01][ab] + ;; + +ram*) + # Note, this must come *before* the "ra*". The entry "rram" is for + # auto fscks when ram is mentioned in /etc/fstab. + umask 2 + mknod ram b 3 0 + ln ram rram + chgrp operator ram + chmod 640 ram + umask 77 + ;; + +br*|hk*|ra*|si*|xp*|rl*) + umask 2 ; unit=`expr $i : '..\(.*\)'` + case $i in + br*) name=rp; blk=11; chr=20;; + hk*) name=hk; blk=4; chr=13;; + ra*) name=ra; blk=5; chr=14;; + si*) name=si; blk=9; chr=18;; + xp*) name=xp; blk=10; chr=19;; + rl*) name=rl; blk=7; chr=16;; + esac + case $unit in + 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) + mknod ${name}${unit}a b $blk `expr $unit '*' 8 + 0` + mknod ${name}${unit}b b $blk `expr $unit '*' 8 + 1` + mknod ${name}${unit}c b $blk `expr $unit '*' 8 + 2` + mknod ${name}${unit}d b $blk `expr $unit '*' 8 + 3` + mknod ${name}${unit}e b $blk `expr $unit '*' 8 + 4` + mknod ${name}${unit}f b $blk `expr $unit '*' 8 + 5` + mknod ${name}${unit}g b $blk `expr $unit '*' 8 + 6` + mknod ${name}${unit}h b $blk `expr $unit '*' 8 + 7` + mknod r${name}${unit}a c $chr `expr $unit '*' 8 + 0` + mknod r${name}${unit}b c $chr `expr $unit '*' 8 + 1` + mknod r${name}${unit}c c $chr `expr $unit '*' 8 + 2` + mknod r${name}${unit}d c $chr `expr $unit '*' 8 + 3` + mknod r${name}${unit}e c $chr `expr $unit '*' 8 + 4` + mknod r${name}${unit}f c $chr `expr $unit '*' 8 + 5` + mknod r${name}${unit}h c $chr `expr $unit '*' 8 + 7` + mknod r${name}${unit}g c $chr `expr $unit '*' 8 + 6` + chgrp operator ${name}${unit}[a-h] r${name}${unit}[a-h] + chmod 640 ${name}${unit}[a-h] r${name}${unit}[a-h] + ;; + *) + echo bad unit for disk in: $i + ;; + esac + umask 77 + ;; + +dz*) + unit=`expr $i : 'dz\(.*\)'` + case $unit in + 0|1|2|3|4|5|6|7) + eval `echo $unit | awk ' { u = $1 } END { + for (i = 0; i < 8; i++) + printf("mknod tty%02d c 2 %d; ",u*8+i,u*8+i); }'` + ;; + *) + echo bad unit for dz in: $i + ;; + esac + ;; + +# +# we may want dmz and dmf someday... +# dhu*|dh*|dmf*|dmz*) +dhv*|dhu*|dh*) + case $i in +# dmz*) name=dmz; major=37; count=24; +# unit=`expr $i : "$name\(.*\)"` +# case $unit in +# 0) ch=a ;; 1) ch=b ;; 2) ch=c ;; 3) ch=e ;; +# 4) ch=f ;; 5) ch=g ;; +# *) echo bad unit for $name in: $i ;; +# esac;; +# dmf*) name=dmf; major=22; count=8; +# unit=`expr $i : "$name\(.*\)"` +# case $unit in +# 0) ch=A ;; 1) ch=B ;; 2) ch=C ;; 3) ch=E ;; +# 4) ch=F ;; 5) ch=G ;; 6) ch=H ;; 7) ch=I ;; +# *) echo bad unit for $name in: $i ;; +# esac;; + dhv*) name=dhv; major=24; count=8; + unit=`expr $i : "$name\(.*\)"`; + case $unit in + 0) ch=S ;; 1) ch=T ;; 2) ch=U ;; 3) ch=V ;; + 4) ch=W ;; 5) ch=X ;; 6) ch=Y ;; 7) ch=Z ;; + *) echo bad unit for $name in: $i ;; + esac;; + dhu*) name=dhu; major=4; count=16; + unit=`expr $i : "$name\(.*\)"`; + case $unit in + 0) ch=S ;; 1) ch=T ;; 2) ch=U ;; 3) ch=V ;; + 4) ch=W ;; 5) ch=X ;; 6) ch=Y ;; 7) ch=Z ;; + *) echo bad unit for $name in: $i ;; + esac;; + dh*) name=dh; major=3; count=16; + unit=`expr $i : "$name\(.*\)"` + case $unit in + 0) ch=h ;; 1) ch=i ;; 2) ch=j ;; 3) ch=k ;; + *) echo bad unit for $name in: $i ;; + esac;; + esac + eval `echo $ch $unit $major $count | + awk ' { ch = $1; u = $4 * $2; m = $3; cnt = $4 } END { + for (i = 0; i < cnt; i++) + if (i < 10) + printf("mknod tty%s%x c %d %d; ",ch,i,m,u+i); + else + printf("mknod tty%s%c c %d %d; ",ch,87+i,m,u+i); }'` + ;; + +# extra DL-11 units not including the console. unit numbers start at 1 because +# the console is always unit 0. Seven units (1 - 7) are defined for the 11/93 +# and 11/94. Device name is "ttyl?". The DH range was restricted from 'h'-'o' +# to 'h' - 'k' (very unlikely that more than 64 channels of DH-11 will or could +# be put on an 11. + +dl*) + name=dl; major=0; ch=l + unit=`expr $i : "$name\(.*\)"` + case $unit in + 1|2|3|4|5|6|7) + mknod tty${ch}${unit} c $major $unit; + ;; + *) + echo bad unit for $name in: $i + ;; + esac + ;; + +# we may want va and vp someday... +# lp*|va*|vp*) +lp*|dn*) + case $i in + lp*) name=lp; major=5;; + dn*) name=dn; major=21;; +# va*) name=va; major=10;; +# vp*) name=vp; major=6;; + esac + unit=`expr $i : "$name\(.*\)"` + case $unit in + 0|1|2|3|4|5|6|7) + mknod $i c $major $unit; + chmod 666 $i + ;; + *) + echo bad unit for $name in: $i + ;; + esac + ;; + +pty*) + class=`expr $i : 'pty\(.*\)'` + case $class in + 0) offset=0 name=p;; + 1) offset=16 name=q;; + 2) offset=32 name=r;; + 3) offset=48 name=s;; + 4) offset=64 name=t;; + 5) offset=80 name=u;; + *) echo bad unit for pty in: $i;; + esac + case $class in + 0|1|2|3|4|5) + umask 0 + eval `echo $offset $name | awk ' { b=$1; n=$2 } END { + for (i = 0; i < 16; i++) + printf("mknod tty%s%x c 11 %d; \ + mknod pty%s%x c 10 %d; ", \ + n, i, b+i, n, i, b+i); }'` + umask 77 + ;; + esac + ;; + +dr*) + unit=`expr $i : '..\(.*\)'` + case $i in + dr*) name=dr; chr=12;; + esac + case $unit in + 0|1|2|3|4|5|6|7) + umask 0 + mknod ${name}${unit} c ${chr} ${unit} + umask 77 + ;; + *) + echo bad unit for ${name} in: $i + ;; + esac + ;; + +ingreslock) + mknod ingreslock c 25 0 + chown ingres ingreslock + chmod 200 ingreslock + ;; + +local) + sh MAKEDEV.local + ;; +esac +done diff --git a/etc/MAKEDEV.local b/etc/MAKEDEV.local new file mode 100755 index 0000000..81f36ea --- /dev/null +++ b/etc/MAKEDEV.local @@ -0,0 +1,26 @@ +rm -f swap +ln ra0a swap +chgrp kmem swap +chmod 640 swap + +rm -f ttyi6 ttyd0; mknod ttyd0 c 3 22 +rm -f ttyi7 ttyd1; mknod ttyd1 c 3 23 +rm -f ttyi8 ttyd2; mknod ttyd2 c 3 24 +rm -f ttyi9 ttyd3; mknod ttyd3 c 3 25 +rm -f ttyia ttyd4; mknod ttyd4 c 3 26 +rm -f ttyic ttyd5; mknod ttyd5 c 3 156 + +rm -f ttyh1 dir-shasta; mknod dir-shasta c 3 1 +rm -f ttyh6 dir-rose; mknod dir-rose c 3 6 +rm -f ttyh7 dir-namsan; mknod dir-namsan c 3 7 +rm -f ttyid dir-ps; mknod dir-ps c 3 157 +rm -f ttyie cua0; mknod cua0 c 3 158 +rm -f ttyif dir-scgl; mknod dir-scgl c 3 159 +chown uucp dir-* +chmod 660 dir-* +# Cua* can't be owned by anyone real who wants to use the dialer if the mode +# 060 below and the dialer group is to work. Note that the uucp programs +# must be in the dialer group. +chown 32767 cua* +chgrp dialer cua* +chmod 060 cua* diff --git a/etc/Makefile b/etc/Makefile new file mode 100644 index 0000000..bdc432e --- /dev/null +++ b/etc/Makefile @@ -0,0 +1,80 @@ +# +# Public domain - 1997/1/10 - sms +# +# @(#)Makefile 1.0 (2.11BSD) 1997/1/10 +# +# DESTDIR is defined here to be something which does *NOT* exist - it must be +# specified on the command line when doing a "make DESTDIR=/mnt distribution". +# This is aimed at avoiding overwriting the system disk's /etc files. +# +# Example: +# mount /dev/ra1a /mnt +# make DESTDIR=/mnt distribution + +DESTDIR=/foobar +OWN=root +GRP=wheel + +SUBDIR= root uucp +FILES= aliases crontab disktab dtab fstab ftpusers gettytab group hosts \ + hosts.allow hosts.deny inetd.conf inetd.conf.nowrappers \ + motd netstart networks ntp.conf passwd phones printcap protocols \ + rc rc.local remote services shells syslog.conf ttys + +all install depend lint clean tags: + +distribution: + -@mkdir -p ${DESTDIR}/dev + @chmod 755 ${DESTDIR}/dev + -@mkdir -p ${DESTDIR}/etc + @chmod 755 ${DESTDIR}/etc + @chown ${OWN}.${GRP} ${DESTDIR}/dev ${DESTDIR}/etc + -@mkdir -p ${DESTDIR}/usr/spool/mqueue + @chmod 755 ${DESTDIR}/usr/spool/mqueue + @chown ${OWN}.${GRP} ${DESTDIR}/usr/spool/mqueue + + install -c -o ${OWN} -g ${GRP} -m 644 ${FILES} ${DESTDIR}/etc + install -c -o root -g wheel -m 600 master.passwd ${DESTDIR}/etc + install -c -o ${OWN} -g ${GRP} -m 600 hosts.equiv ${DESTDIR}/etc + install -c -o ${OWN} -g ${GRP} -m 555 MAKEDEV.local MAKEDEV \ + ${DESTDIR}/dev + install -c -o ${OWN} -g operator -m 664 /dev/null \ + ${DESTDIR}/etc/dumpdates + install -c -o ${OWN} -g operator -m 664 /dev/null \ + ${DESTDIR}/etc/sendmail.cw + install -c -o ${OWN} -g operator -m 664 /dev/null \ + ${DESTDIR}/etc/sendmail.fc + -@mkdir -p ${DESTDIR}/usr/adm ${DESTDIR}/var/run ${DESTDIR}/var/db + @chmod 655 ${DESTDIR}/usr/adm ${DESTDIR}/var/run ${DESTDIR}/var/db + @chown ${OWN}.${GRP} ${DESTDIR}/usr/adm ${DESTDIR}/var/run \ + ${DESTDIR}/var/db + install -c -o ${OWN} -g ${GRP} -m 644 /dev/null \ + ${DESTDIR}/usr/adm/messages + install -c -o ${OWN} -g ${GRP} -m 644 /dev/null \ + ${DESTDIR}/usr/adm/daemonlog + install -c -o ${OWN} -g ${GRP} -m 644 /dev/null \ + ${DESTDIR}/usr/adm/debuglog + install -c -o ${OWN} -g operator -m 664 /dev/null \ + ${DESTDIR}/usr/adm/shutdownlog + install -c -o ${OWN} -g ${GRP} -m 644 /dev/null \ + ${DESTDIR}/usr/spool/mqueue/syslog + install -c -o ${OWN} -g ${GRP} -m 644 /dev/null \ + ${DESTDIR}/usr/adm/lpd-errs + install -c -o ${OWN} -g ${GRP} -m 644 /dev/null \ + ${DESTDIR}/var/run/utmp + install -c -o nobody -g ${GRP} -m 644 /dev/null \ + ${DESTDIR}/var/db/find.codes + install -c -o ${OWN} -g ${GRP} -m 644 /dev/null \ + ${DESTDIR}/usr/adm/lastlog + install -c -o ${OWN} -g ${GRP} -m 644 /dev/null \ + ${DESTDIR}/usr/adm/wtmp + install -c -o ${OWN} -g ${GRP} -m 644 /dev/null \ + ${DESTDIR}/usr/adm/acct + install -c -o ${OWN} -g ${GRP} -m 644 /dev/null \ + ${DESTDIR}/usr/adm/usracct + install -c -o ${OWN} -g ${GRP} -m 644 /dev/null \ + ${DESTDIR}/usr/adm/savacct + install -c -o uucp -g daemon -m 600 /dev/null \ + ${DESTDIR}/usr/adm/aculog + -for i in ${SUBDIR}; do \ + (cd $$i; make DESTDIR=${DESTDIR} distribution); done diff --git a/etc/aliases b/etc/aliases new file mode 100644 index 0000000..95c0d45 --- /dev/null +++ b/etc/aliases @@ -0,0 +1,21 @@ +# +# Aliases in this file will NOT be expanded in the header from +# Mail, but WILL be visible over networks or from /bin/mail. +# +# >>>>>>>>>> The program "newaliases" must be run after +# >> NOTE >> this file is updated for any changes to +# >>>>>>>>>> show through to sendmail. +# +# Individual users can forward their mail using a .forward file +# in their home directory; this is preferable to using an alias. +# + +# Basic system aliases -- these MUST be present +MAILER-DAEMON:postmaster +postmaster:root +help:root +sysadmin:root + +# Aliases to handle mail to msgs and news +msgs: "|/usr/ucb/msgs -s" +rnews:"|/usr/local/uurec" diff --git a/etc/crontab b/etc/crontab new file mode 100644 index 0000000..4bd029f --- /dev/null +++ b/etc/crontab @@ -0,0 +1,4 @@ +0,15,30,45 * * * * root /usr/libexec/atrun +5 0 * * * root /bin/sh /usr/adm/daily 2>&1 | mail root +15 0 * * 7 root /bin/sh /usr/adm/weekly 2>&1 | mail root +35 0 1 * * root /bin/sh /usr/adm/monthly 2>&1 | mail root diff --git a/etc/disktab b/etc/disktab new file mode 100644 index 0000000..ec62bca --- /dev/null +++ b/etc/disktab @@ -0,0 +1,616 @@ +# @(#)disktab 1.3 (2.11BSD) 1995/12/05 +# +# Disk geometry and partition layout tables. +# Key: +# dt controller type +# ty type of disk (fixed, removeable, simulated) +# d[0-4] drive-type-dependent parameters +# ns #sectors/track +# nt #tracks/cylinder +# nc #cylinders/disk +# sc #sectors/cylinder, nc*nt default +# su #sectors/unit, sc*nc default +# se sector size, 512 default (getdiskbyname always sets 512) +# rm rpm, 3600 default +# sf supports bad144-style bad sector forwarding +# sk sector skew per track, default 0 +# cs sector skew per cylinder, default 0 +# hs headswitch time, default 0 +# ts one-cylinder seek time, default 0 +# il sector interleave (n:1), 1 default +# bs boot block size, default BBSIZE (getdiskbyname returns BBSIZE) +# sb superblock size, default SBSIZE (getdiskbyname returns SBSIZE) +# b0 block zero dead start primary bootstrap +# o[a-h] partition offsets in sectors +# p[a-h] partition sizes in sectors +# b[a-h] partition block sizes in bytes +# f[a-h] partition fragment sizes in bytes +# t[a-h] partition types (filesystem, swap, etc) +# +# On drives that contain bad-sector replacement areas the 'h' (and in some +# cases 'c') partitions do NOT overlap the bad-sector track. +# +# Entries may also be used for other compatible drives +# with the same geometry. + +# +# Drives on xp +# +# These partition tables are a mess. Several of them overlap the bad +# sector area, others do not overlap but end up with not cylinder sized +# filesystems. Many of these aren't even in use any longer. A couple +# did not even match the tables that were in the kernel. +# +# I've done my best to match these up with the old partition tables in +# the 'xp' driver but a typo or arithmetic error could easily have crept in. +# + +# RM02/03 - 'c' and 'h' partitions are whole drive except bad sector track. +# +rm02|RM02|rm03|RM03|DEC RM02/03:\ + :ty=removable:ns#32:nt#5:nc#823:sf:\ + :b0=/mdec/rm03uboot:\ + :pa#9600:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ + :pb#9600:ob#9600:bb#1024:fb#1024:tb=swap:\ + :pc#131520:oc#0:bc#1024:fc#1024:\ + :pf#121920:of#9600:bf#1024:ff#1024:tf=2.11BSD:\ + :pg#112320:og#19200:bg#1024:fg#1024:tg=2.11BSD:\ + :ph#131520:oh#0:bh#1024:fh#1024:th=2.11BSD + +# RM05: +rm05|RM05|cdc9766|CDC9766|9766|DEC RM05, CDC 9766:\ + :ty=removable:ns#32:nt#19:nc#823:sf:\ + :b0=/mdec/rm05uboot:\ + :pa#9120:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ + :pb#9120:ob#9120:bb#1024:fb#1024:tb=swap:\ + :pc#234080:oc#18240:bc#1024:fc#1024:tc=2.11BSD:\ + :pd#247906:od#252320:bd#1024:fd#1024:td=2.11BSD:\ + :pe#164160:oe#18240:be#1024:fe#1024:te=2.11BSD:\ + :pf#152000:of#182400:bf#1024:ff#1024:tf=2.11BSD:\ + :pg#165826:og#334400:bg#1024:fg#1024:tg=2.11BSD:\ + :ph#500226:oh#0:bh#1024:fh#1024:th=2.11BSD + +9775|CDC 9775:\ + :ty=fixed:ns#32:nt#40:nc#842:sf:\ + :pa#10240:oa#0:ba#1024:fa#1024:ty=2.11BSD:\ + :pb#10240:ob#10240:bb#1024:fb#1024:tb=swap:\ + :pc#510720:oc#20480:bc#1024:fc#1024:tc=2.11BSD:\ + :pd#541440:od#531200:bd#1024:fd#1024:td=2.11BSD:\ + :pe#363520:oe#20480:be#1024:fe#1024:te=2.11BSD:\ + :pf#320000:of#384000:bf#1024:ff#1024:tf=2.11BSD:\ + :pg#368640:og#704000:bg#1024:fg#1024:tg=2.11BSD:\ + :ph#1072640:oh#0:bh#1024:fh#1024:th=2.11BSD + +# EATON BR1537 or 1711 controller. The CSR set looks like an RP03, +# that's about all. +# +br1538d|BR1538D|EATON 1538D, 1711:\ + :ty=removable:ns#32:nt#19:nc#815:so:\ + :b0=/mdec/bruboot:\ + :pa#18240:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ + :pb#12160:ob#18240:bb#1024:fb#1024:tb=swap:\ + :pc#232256:oc#30400:bc#1024:fc#1024:tc=2.11BSD:\ + :pd#232256:od#262656:bd#4096:fd#1024:td=2.11BSD:\ + :ph#494912:oh#0:bh#1024:fh#1024:th=2.11BSD + +rp04|RP04|rp05|RP05|DEC RP04/05:\ + :ty=removable:ns#22:nt#19:nc#411:sf:\ + :b0=/mdec/hpuboot:\ + :pa#9614:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ + :pb#8778:ob#9614:bb#1024:fb#1024:tb=swap:\ + :pc#152988:oc#18392:bc#1024:fc#1024:tc=2.11BSD:\ + :pg#171650:og#0:bg#1024:fg#1024:tg=2.11BSD + +rp06|RP06|DEC RP06:\ + :ty=removable:ns#22:nt#19:nc#815:sf:\ + :b0=/mdec/hpuboot:\ + :pa#9614:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ + :pb#8778:ob#9614:bb#1024:fb#1024:tb=swap:\ + :pc#153406:oc#18392:bc#1024:fc#1024:tc=2.11BSD:\ + :pd#168724:od#171798:bd#1024:fd#1024:td=2.11BSD:\ + :pe#322130:oe#18392:be#1024:fe#1024:te=2.11BSD:\ + :pg#171798:og#0:bg#1024:fg#1024:tg=2.11BSD:\ + :ph#340522:oh#0:bh#1024:fh#1024:th=2.11BSD + +rp07|RP07|DEC RP07:\ + :ty=fixed:ns#50:nt#32:nc#630:sf:\ + :b0=/mdec/hpuboot:\ + :pa#19200:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ + :pb#51200:ob#19200:bb#1024:fb#1024:tb=swap:\ + :pc#1006400:oc#0:bc#1024:fc#1024:\ + :pd#320000:od#70400:bd#1024:fd#1024:td=2.11BSD:\ + :pe#320000:oe#390400:be#1024:fe#1024:te=2.11BSD:\ + :pf#296000:of#710400:bf#1024:ff#1024:tf=2.11BSD:\ + :pg#936000:og#70400:bg#1024:fg#1024:tg=2.11BSD:\ + :ph#1006400:oh#0:bh#1024:fh#1024:th=2.11BSD + +rm2x|160|fuji|fuji160|Fujitsu 160:\ + :ty=fixed:ns#32:nt#10:nc#823:sf:\ + :b0=/mdec/si94uboot:\ + :pa#9600:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ + :pb#9600:ob#9600:bb#1024:fb#1024:tb=swap:\ + :pc#244160:oc#19200:bc#1024:fc#1024:tc=2.11BSD:\ + :pd#164800:od#19200:bd#1024:fd#1024:td=unused:\ + :pe#79360:oe#184000:be#1024:fe#1024:te=unused:\ + :pf#39680:of#184000:bf#1024:ff#1024:tf=unused:\ + :pg#39680:og#223680:bg#1024:fg#1024:tg=unused:\ + :ph#263360:oh#0:bh#1024:fh#1024:th=unused + +diva|DIVA|9300|Diva Comp V, Ampex 9300 (in direct mode):\ + :ty=fixed:ns#33:nt#19:nc#815:sf:\ + :b0=/mdec/dvhpuboot:\ + :pa#9405:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ + :pb#9405:ob#9405:bb#1024:fb#1024:tb=swap:\ + :pc#241395:oc#18810:bc#1024:fc#1024:tc=2.11BSD:\ + :pd#250641:od#260205:bd#1024:fd#1024:td=2.11BSD:\ + :pe#169290:oe#18810:be#1024:fe#1024:te=2.11BSD:\ + :pf#156750:of#188100:bf#1024:ff#1024:tf=2.11BSD:\ + :pg#165996:og#344850:bg#1024:fg#1024:tg=2.11BSD:\ + :ph#510846:oh#0:bh#1024:fh#1024:th=2.11BSD + +330|capricorn|Capricorn|Ampex Capricorn:\ + :ty=fixed:ns#32:nt#16:nc#1024:sf:\ + :pa#16384:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ + :pb#33792:ob#16384:bb#1024:fb#1024:tb=swap:\ + :pc#291840:oc#50176:bc#1024:fc#1024:tc=2.11BSD:\ + :pd#16384:od#342016:bd#4096:fd#1024:td=2.11BSD:\ + :pe#56320:oe#358400:be#1024:fe#1024:te=2.11BSD:\ + :pf#107008:of#414720:bf#1024:ff#1024:tf=2.11BSD:\ + :pg#179712:og#342016:bg#1024:fg#1024:tg=2.11BSD:\ + :ph#521728:bh#1024:fh#1024:th=2.11BSD + +si_eagle|SI_Eagle|2351|2351A|Fujitsu Eagle 2351A (48 sectors):\ + :ty=fixed:ns#48:nt#20:nc#842:rm#3961:sf:\ + :b0=/mdec/si51uboot:\ + :pa#11520:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ + :pb#11520:ob#11520:bb#1024:fb#1024:tb=swap:\ + :pc#474240:oc#23040:bc#1024:fc#1024:tc=2.11BSD:\ + :pd#92160:od#497280:bd#1024:fd#1024:td=2.11BSD:\ + :pe#218880:oe#589440:be#1024:fd#1024:te=2.11BSD:\ + :ph#803520:oh#0:bh#1024:fh#1024:th=2.11BSD + +si9766|si9766|CDC 9766 on SI 9500 controller:\ + :ty=removable:ns#32:nt#19:nc#823:sf:\ + :b0=/mdec/si95uboot:\ + :pa#9120:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ + :pb#9120:ob#9120:bb#1024:fb#1024:tb=swap:\ + :pc#234080:oc#18240:bc#1024:fc#1024:tc=2.11BSD:\ + :pd#244866:od#252320:bd#4096:fd#1024:td=2.11BSD:\ + :pe#164160:oe#18240:be#1024:fe#1024:te=2.11BSD:\ + :pf#152000:of#182400:bf#1024:ff#1024:tf=2.11BSD:\ + :pg#162786:og#334400:bg#1024:fg#1024:tg=2.11BSD:\ + :ph#497344:oh#0:bh#1024:fh#1024:th=2.11BSD + +rk06|RK06|DEC RK06:\ + :ty=removable:ns#22:nt#3:nc#411:sf:\ + :b0=/mdec/hkuboot:\ + :pa#8316:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ + :pb#8316:ob#8316:bb#1024:fb#1024:tb=swap:\ + :pc#27126:oc#0:bc#1024:fc#1024:tc=unused:\ + :pg#10428:og#16632:bg#1024:fg#1024:tg=2.11BSD:\ + :ph#27060:oh#0:bh#1024:fh#1024:th=2.11BSD + +rk07|RK07|DEC RK07:\ + :ty=removable:ns#22:nt#3:nc#815:sf:bt=hkuboot:\ + :b0=/mdec/hkuboot:\ + :pa#8316:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ + :pb#8316:ob#8316:bb#1024:fb#1024:tb=swap:\ + :pc#53790:oc#0:bc#1024:fc#1024:tc=unused:\ + :pg#37092:og#16632:bg#1024:fg#1024:tg=2.11BSD:\ + :ph#53724:oh#0:bh#1024:fh#1024:th=2.11BSD + +# The RL02 and RL01 have 256 byte sectors, getdiskbyname ignores 'se' +# (thankfully) but partitions are still in units of 512-byte sectors. +rl01|RL01|DEC RL01:\ + :ty=removable:se#256:ns#20:nt#2:nc#256:\ + :b0=/mdec/rluboot:\ + :ph#10240:oh#0:bh#1024:fh#1024:th=2.11BSD + +rl02|RL02|DEC RL02:\ + :ty=removable:se#256:ns#20:nt#2:nc#512:\ + :b0=/mdec/rluboot:\ + :pa#15360:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ + :pb#5120:ob#15360:bb#1024:fb#1024:tb=swap:\ + :ph#20480:oh#0:bh#1024:fh#1024:th=2.11BSD + +rk05|RK05|DEC RK05:\ + :ty=removable:ns#12:nt#2:nc#203:bt=rkuboot:\ + :b0=/mdec/rkuboot:\ + :ph#4872:oh#0:bh#1024:fh#1024:th=2.11BSD + +# +# Disks on a UDA50 +# + +ra60|RA60|DEC RA60 Removable|OLD STYLE PARTITIONS:\ + :dt=MSCP:ty=removable:ns#42:nt#4:nc#2382:so:\ + :b0=/mdec/rauboot:\ + :pa#15884:oa#0ba#1024:fa#1024:ta=2.11BSD:\ + :pb#33440:ob#15884:bb#1024:fb#1024:tb=swap:\ + :pc#193282:oc#49324:bc#1024:fc#1024:tc=2.11BSD:\ + :pd#15884:od#242606:bd#1024:fd#1024:td=2.11BSD:\ + :pe#140686:oe#258490:be#1024:fe#1024:te=2.11BSD:\ + :pg#156570:og#242606:bg#1024:fg#1024:tg=2.11BSD:\ + :ph#399176:oh#0:bh#1024:fh#1024:th=2.11BSD + +ra80|RA80|DEC RA80 Winchester|OLD STYLE PARTITIONS:\ + :dt=MSCP:ty=fixed:ns#31:nt#14:nc#559:so:\ + :b0=/mdec/rauboot:\ + :pa#15884:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ + :pb#33440:ob#15884:bb#1024:fb#1024:tb=swap:\ + :pc#186888:oc#49324:bc#1024:fc#1024:tc=2.11BSD:\ + :ph#236212:oh#0:bh#1024:fh#1024:th=2.11BSD + +ra81|RA81|DEC RA81 Winchester|OLD STYLE PARTITIONS:\ + :dt=MSCP:ty=fixed:ns#51:nt#14:nc#1248:so:\ + :b0=/mdec/rauboot:\ + :pa#15884:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ + :pb#33440:ob#15884:bb#1024:fb#1024:tb=swap:\ + :pc#193282:oc#49324:bc#1024:fc#1024:tc=2.11BSD:\ + :pd#15884:od#242606:bd#1024:fd#1024:td=2.11BSD:\ + :pe#307200:oe#258490:be#1024:fe#1024:te=2.11BSD:\ + :pf#324382:of#565690:bf#1024:ff#1024:tf=2.11BSD:\ + :pg#647466:og#242606:bg#1024:fg#1024:tg=2.11BSD:\ + :ph#890072:oh#0:bh#1024:fh#1024:th=2.11BSD + +ra81x|RA81X|Extended DEC RA81 Winchester|OLD STYLE PARTITIONS:\ + :dt=MSCP:ty=fixed:ns#51:nt#14:nc#1815:so:\ + :b0=/mdec/rauboot:\ + :pa#15884:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ + :pb#33440:ob#15884:bb#1024:fb#1024:tb=swap:\ + :pc#193282:oc#49324:bc#1024:fc#1024:tc=2.11BSD:\ + :pd#15884:od#242606:bd#1024:fd#1024:td=2.11BSD:\ + :pe#307200:oe#258490:be#1024:fe#1024:te=2.11BSD:\ + :pf#728952:of#565690:bf#1024:ff#1024:tf=2.11BSD:\ + :pg#1052036:og#242606:bg#1024:fg#1024:\ + :ph#1294642:oh#0:bh#1024:fh#1024:th=2.11BSD + +rd52|RD52|DEC RD52|OLD STYLE PARTITIONS:\ + :dt=MSCP:ty=fixed:ns#18:nt#7:nc#480:so:\ + :b0=/mdec/rauboot:\ + :pa#9700:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ + :pb#17300:ob#9700:bb#1024:fb#1024:tb=2.11BSD:\ + :pc#3100:oc#27000:bc#1024:fc#1024:tc=swap:\ + :pd#30348:od#30100:bd#1024:fd#1024:td=2.11BSD:\ + :pg#50748:og#9700:bg#1024:fg#1024:tg=2.11BSD:\ + :ph#60448:oh#0:bh#1024:fh#1024:th=2.11BSD + +rd53|RD53||DEC RD53|OLD STYLE PARTITIONS:\ + :dt=MSCP:ty=fixed:ns#18:nt#8:nc#963:so:\ + :b0=/mdec/rauboot:\ + :pa#9700:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ + :pb#17300:ob#9700:bb#1024:fb#1024:tb=2.11BSD:\ + :pc#3100:oc#27000:bc#1024:fc#1024:tc=swap:\ + :pd#108540:od#30100:bd#1024:fd#1024:td=2.11BSD:\ + :pg#128940:og#9700:bg#1024:fg#1024:tg=2.11BSD:\ + :ph#138640:oh#0:bh#1024:fh#1024:th=2.11BSD + +rc25|RC25|rcf25|RCF25|DEC RC25 and RC25F:\ + :dt=MSCP:ty=removable:ns#42:nt#4:nc#2382:so:\ + :b0=/mdec/rauboot:\ + :pa#15884:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ + :pb#8360:ob#15884:bb#1024:fb#1024:tb=swap:\ + :pc#50902:oc#0:bc#1024:fc#1024:tc=2.11BSD:\ + :pg#26658:og#24244:bg#1024:fg#1024:tg=2.11BSD + +rd31|RD31|DEC RD31:\ + :dt=MSCP:ty=fixed:ns#17:nt#4:nc#615:so:\ + :b0=/mdec/rauboot:\ + :pa#15884:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ + :pb#8360:ob#15884:bb#1024:fb#1024:tb=swap:\ + :pc#41560:oc#0:bc#1024:fc#1024:tc=2.11BSD:\ + :pg#17316:og#24244:bg#1024:fg#1024:tg=2.11BSD + +rd32|RD32|DEC RD32:\ + :dt=MSCP:ty=fixed:ns#17:nt#6:nc#820:so:\ + :b0=/mdec/rauboot:\ + :pa#15884:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ + :pb#8360:ob#15884:bb#1024:fb#1024:tb=swap:\ + :pc#83236:oc#0:bc#1024:fc#1024:tc=2.11BSD:\ + :pg#58992:og#24244:bg#1024:fg#1024:tg=2.11BSD + +rd33|RD33|DEC RD33:\ + :dt=MSCP:ty=fixed:ns#17:nt#7:nc#1170:so:\ + :b0=/mdec/rauboot:\ + :pa#15884:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ + :pb#8360:ob#15884:bb#1024:fb#1024:tb=swap:\ + :pc#138565:oc#0:bc#1024:fc#1024:tc=2.11BSD:\ + :pg#114321:og#24244:bg#1024:fg#1024:tg=2.11BSD + +rd51|RD51|DEC RD51:\ + :dt=MSCP:ty=fixed:ns#18:nt#4:nc#300:so:\ + :b0=/mdec/rauboot:\ + :pa#15884:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ + :pb#5716:ob#15884:bb#1024:fb#1024:tb=swap:\ + :pc#21600:oc#0:bc#1024:fc#1024:tc=2.11BSD + +rd52new|RD52new|DEC RD52|NEW STYLE PARTITIONS:\ + :dt=MSCP:ty=fixed:ns#18:nt#7:nc#480:so:\ + :b0=/mdec/rauboot:\ + :pa#15884:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ + :pb#8360:ob#15884:bb#1024:fb#1024:tb=swap:\ + :pc#60480:oc#0:bc#1024:fc#1024:tc=2.11BSD:\ + :pg#36236:og#24244:bg#1024:fg#1024:tg=2.11BSD + +rd53new|RD53new|DEC RD53|NEW STYLE PARTITIONS:\ + :dt=MSCP:ty=fixed:ns#17:nt#8:nc#1024:so:\ + :b0=/mdec/rauboot:\ + :pa#15884:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ + :pb#8360:ob#15884:bb#1024:fb#1024:tb=swap:\ + :pc#138672:oc#0:bc#1024:fc#1024:tc=2.11BSD:\ + :pg#114428:og#24244:bg#1024:fg#1024:tg=2.11BSD\ + +rd54|RD54|DEC RD54:\ + :dt=MSCP:ty=fixed:ns#17:nt#15:nc#1221:so:\ + :b0=/mdec/rauboot:\ + :pa#15884:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ + :pb#16720:ob#15884:bb#1024:fb#1024:tb=swap:\ + :pc#311200:oc#0:bc#1024:fc#1024:tc=unused:\ + :pg#278596:og#32604:bg#1024:fg#1024:tg=2.11BSD + +rx23|RX23|DEC RX23:\ + :dt=MSCP:ty=floppy:ns#18:nt#2:nc#80:\ + :b0=/mdec/rauboot:\ + :pa#2880:oa#0:ba#1024:fa#1024:ta=2.11BSD + +rx26|RX26|DEC RX26:\ + :dt=MSCP:ty=floppy:ns#36:nt#2:nc#80:\ + :b0=/mdec/rauboot:\ + :pa#5760:oa#0:ba#1024:fa#1024:ta=2.11BSD + +rx33|RX33|DEC RX33:\ + :dt=MSCP:ty=floppy:ns#15:nt#2:nc#80:\ + :b0=/mdec/rauboot:\ + :pa#2400:oa#0:ba#1024:fa#1024:ta=2.11BSD + +rx50|RX50|DEC RX50:\ + :dt=MSCP:ty=removable:ns#10:nt#1:nc#80:\ + :b0=/mdec/rauboot:\ + :pa#800:oa#0:ba#1024:fa#1024:2.11BSD + +ra60new|RA60new|DEC RA60|NEW STYLE PARTITIONS:\ + :dt=MSCP:ty=removable:ns#42:nt#4:nc#2382:so:\ + :b0=/mdec/rauboot:\ + :pa#15884:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ + :pb#16720:ob#15884:bb#1024:fb#1024:tb=swap:\ + :pc#400176:oc#0:bc#1024:fc#1024:\ + :pd#227136:od#32604:bd#1024:fd#1024:td=2.11BSD:\ + :pe#140436:oe#259740:be#1024:fe#1024:te=2.11BSD:\ + :pg#367572:og#32604:bg#1024:fg#1024:tg=2.11BSD + +ra70|RA70|DEC RA70:\ + :dt=MSCP:ty=fixed:ns#33:nt#11:nc#1507:so:\ + :b0=/mdec/rauboot:\ + :pa#15884:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ + :pb#16720:ob#15884:bb#1024:fb#1024:tb=swap:\ + :pc#547041:oc#0:bc#1024:fc#1024:\ + :pd#227136:od#32604:bd#1024:fd#1024:td=2.11BSD:\ + :pe#287301:oe#259740:be#1024:fe#1024:te=2.11BSD:\ + :pg#514437:og#32604:bg#1024:fg#1024:tg=2.11BSD + +ra71|RA71|DEC RA71:\ + :dt=MSCP:ty=fixed:ns#51:nt#14:nc#1915:so:\ + :b0=/mdec/rauboot:\ + :pa#15884:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ + :pb#16720:ob#15884:bb#1024:fb#1024:tb=swap:\ + :pc#1367310:oc#0:bc#1024:fc#1024:\ + :pd#227136:od#32604:bd#1024:fd#1024:td=2.11BSD:\ + :pe#409600:oe#259740:be#1024:fe#1024:te=2.11BSD:\ + :pf#182464:of#669340:bf#1024:ff#1024:tf=2.11BSD:\ + :pg#819200:og#32604:bg#1024:fg#1024:tg=2.11BSD:\ + :ph#515506:oh#851804:bh#1024:fh#1024:th=2.11BSD + +ra72|RA72|DEC RA72:\ + :dt=MSCP:ty=fixed:ns#51:nt#20:nc#1915:so:\ + :b0=/mdec/rauboot:\ + :pa#15884:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ + :pb#16720:ob#15884:bb#1024:fb#1024:tb=swap:\ + :pc#1953300:oc#0:bc#1024:fc#1024:\ + :pd#227136:od#32604:bd#1024:fd#1024:td=2.11BSD:\ + :pe#409600:oe#259740:be#1024:fe#1024:te=2.11BSD:\ + :pf#182464:of#669340:bf#1024:ff#1024:tf=2.11BSD:\ + :pg#819200:og#32604:bg#1024:fg#1024:tg=2.11BSD:\ + :ph#1101496:oh#851804:bh#1024:fh#1024:th=2.11BSD + +ra73|RA73|DEC RA73:\ + :dt=MSCP:ty=fixed:ns#70:nt#21:nc#2667:so:\ + :b0=/mdec/rauboot:\ + :pa#15884:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ + :pb#16720:ob#15884:bb#1024:fb#1024:tb=swap:\ + :pc#3920490:oc#0:bc#1024:fc#1024:\ + :pd#227136:od#32604:bd#1024:fd#1024:td=2.11BSD:\ + :pe#409600:oe#259740:be#1024:fe#1024:te=2.11BSD:\ + :pf#182464:of#669340:bf#1024:ff#1024:tf=2.11BSD:\ + :pg#819200:og#32604:bg#1024:fg#1024:tg=2.11BSD:\ + :ph#3068686:oh#851804:bh#1024:fh#1024:th=2.11BSD + +ra80new|RA80new|DEC RA80|NEW STYLE PARTITIONS:\ + :dt=MSCP:ty=fixed:ns#31:nt#14:nc#546:so:\ + :b0=/mdec/rauboot:\ + :pa#15884:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ + :pb#16720:ob#15884:bb#1024:fb#1024:tb=swap:\ + :pc#237212:oc#0:bc#1024:fc#1024:\ + :pg#204608:og#32604:bg#1024:fg#1024:tg=2.11BSD + +ra81new|RA81new|DEC RA81|NEW STYLE PARTITIONS:\ + :dt=MSCP:ty=fixed:ns#51:nt#14:nc#1248:so:\ + :b0=/mdec/rauboot:\ + :pa#15884:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ + :pb#16720:ob#15884:bb#1024:fb#1024:tb=swap:\ + :pc#891072:oc#0:bc#1024:fc#1024:\ + :pd#227136:od#32604:bd#1024:fd#1024:td=2.11BSD:\ + :pe#409600:oe#259740:be#1024:fe#1024:te=2.11BSD:\ + :pf#182464:of#669340:bf#1024:ff#1024:tf=2.11BSD:\ + :pg#819200:og#32604:bg#1024:fg#1024:tg=2.11BSD:\ + :ph#39268:oh#851804:bh#1024:fh#1024:th=2.11BSD + +ra82|RA82|DEC RA82:\ + :dt=MSCP:ty=fixed:ns#57:nt#15:nc#1423:so:\ + :b0=/mdec/rauboot:\ + :pa#15884:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ + :pb#16720:ob#15884:bb#1024:fb#1024:tb=swap:\ + :pc#1216665:oc#0:bc#1024:fc#1024:\ + :pd#227136:od#32604:bd#1024:fd#1024:td=2.11BSD:\ + :pe#409600:oe#259740:be#1024:fe#1024:te=2.11BSD:\ + :pf#182464:of#669340:bf#1024:ff#1024:tf=2.11BSD:\ + :pg#819200:og#32604:bg#1024:fg#1024:tg=2.11BSD:\ + :ph#364861:oh#851804:bh#1024:fh#1024:th=2.11BSD + +ra90|RA90|DEC RA90:\ + :dt=MSCP:ty=fixed:ns#69:nt#13:nc#2649:so:\ + :b0=/mdec/rauboot:\ + :pa#15884:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ + :pb#16720:ob#15884:bb#1024:fb#1024:tb=swap:\ + :pc#2376153:oc#0:bc#1024:fc#1024:\ + :pd#227136:od#32604:bd#1024:fd#1024:td=2.11BSD:\ + :pe#409600:oe#259740:be#1024:fe#1024:te=2.11BSD:\ + :pf#182464:of#669340:bf#1024:ff#1024:tf=2.11BSD:\ + :pg#819200:og#32604:bg#1024:fg#1024:tg=2.11BSD:\ + :ph#1524349:oh#851804:bh#1024:fh#1024:th=2.11BSD + +ra92|RA92|DEC RA92:\ + :dt=MSCP:ty=fixed:ns#69:nt#13:nc#3279:so:\ + :b0=/mdec/rauboot:\ + :pa#15884:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ + :pb#16720:ob#15884:bb#1024:fb#1024:tb=swap:\ + :pc#2940951:oc#0:bc#1024:fc#1024:\ + :pd#227136:od#32604:bd#1024:fd#1024:td=2.11BSD:\ + :pe#409600:oe#259740:be#1024:fe#1024:te=2.11BSD:\ + :pf#182464:of#669340:bf#1024:ff#1024:tf=2.11BSD:\ + :pg#819200:og#32604:bg#1024:fg#1024:tg=2.11BSD:\ + :ph#2089147:oh#851804:bh#1024:fh#1024:th=2.11BSD + +rz22|RZ22|DEC RZ22:\ + :dt=MSCP:ty=fixed:ns#33:nt#4:nc#776:so:\ + :b0=/mdec/rauboot:\ + :pa#15884:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ + :pb#8360:ob#15884:bb#1024:fb#1024:tb=swap:\ + :pc#102432:oc#0:bc#1024:fc#1024:\ + :pg#78188:og#24244:bg#1024:fg#1024:tg=2.11BSD + +rz23|RZ23|DEC RZ23:\ + :dt=MSCP:ty=fixed:ns#33:nt#8:nc#776:so:\ + :b0=/mdec/rauboot:\ + :pa#15884:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ + :pb#8360:ob#15884:bb#1024:fb#1024:tb=swap:\ + :pc#204864:oc#0:bc#1024:fc#1024:\ + :pg#180620:og#24244:bg#1024:fg#1024:tg=2.11BSD + +rz23l|RZ23L|DEC RZ23L:\ + :dt=MSCP:ty=fixed:ns#39:nt#4:nc#1524:so:\ + :b0=/mdec/rauboot:\ + :pa#15884:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ + :pb#8360:ob#15884:bb#1024:fb#1024:tb=swap:\ + :pc#237588:oc#0:bc#1024:fc#1024:\ + :pg#213344:og#24244:bg#1024:fg#1024:tg=2.11BSD + +rz24|RZ24|DEC RZ24:\ + :dt=MSCP:ty=fixed:ns#38:nt#8:nc#1348:so:\ + :b0=/mdec/rauboot:\ + :pa#15884:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ + :pb#16720:ob#15884:bb#1024:fb#1024:tb=swap:\ + :pc#409792:oc#0:bc#1024:fc#1024:\ + :pd#227136:od#32604:bd#1024:fd#1024:td=2.11BSD:\ + :pe#150052:oe#259740:be#1024:fe#1024:te=2.11BSD:\ + :pg#377188:og#32604:bg#1024:fg#1024:tg=2.11BSD + +rz24l|RZ24L|DEC RZ24L:\ + :dt=MSCP:ty=fixed:ns#65:nt#4:nc#1818:so:\ + :b0=/mdec/rauboot:\ + :pa#15884:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ + :pb#16720:ob#15884:bb#1024:fb#1024:tb=swap:\ + :pc#479350:oc#0:bc#1024:fc#1024:\ + :pd#227136:od#32604:bd#1024:fd#1024:td=2.11BSD:\ + :pe#219610:oe#259740:be#1024:fe#1024:te=2.11BSD:\ + :pg#446746:og#32604:bg#1024:fg#1024:tg=2.11BSD + +rz25|RZ25|DEC RZ25:\ + :dt=MSCP:ty=fixed:ns#62:nt#9:nc#1476:so:\ + :b0=/mdec/rauboot:\ + :pa#15884:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ + :pb#16720:ob#15884:bb#1024:fb#1024:tb=swap:\ + :pc#832527:oc#0:bc#1024:fc#1024:\ + :pd#227136:od#32604:bd#1024:fd#1024:td=2.11BSD:\ + :pe#409600:oe#259740:be#1024:fe#1024:te=2.11BSD:\ + :pf#130590:of#669340:bf#1024:ff#1024:tf=2.11BSD:\ + :pg#799923:og#32604:bg#1024:fg#1024:tg=2.11BSD: + +rz26|RZ26|DEC RZ26:\ + :dt=MSCP:ty=fixed:ns#57:nt#14:nc#2570:so:\ + :b0=/mdec/rauboot:\ + :pa#15884:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ + :pb#16720:ob#15884:bb#1024:fb#1024:tb=swap:\ + :pc#2050860:oc#0:bc#1024:fc#1024:\ + :pd#227136:od#32604:bd#1024:fd#1024:td=2.11BSD:\ + :pe#409600:oe#259740:be#1024:fe#1024:te=2.11BSD:\ + :pf#182464:of#669340:bf#1024:ff#1024:tf=2.11BSD:\ + :pg#819200:og#32604:bg#1024:fg#1024:tg=2.11BSD:\ + :ph#1199056:oh#851804:bh#1024:fh#1024:th=2.11BSD + +rz55|RZ55|DEC RZ55:\ + :dt=MSCP:ty=fixed:ns#36:nt#15:nc#1224:so:\ + :b0=/mdec/rauboot:\ + :pa#15884:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ + :pb#16720:ob#15884:bb#1024:fb#1024:tb=swap:\ + :pc#649040:oc#0:bc#1024:fc#1024:\ + :pd#227136:od#32604:bd#1024:fd#1024:td=2.11BSD:\ + :pe#389300:oe#259740:be#1024:fe#1024:te=2.11BSD:\ + :pg#616436:og#32604:bg#1024:fg#1024:tg=2.11BSD + +rz56|RZ56|DEC RZ56:\ + :dt=MSCP:ty=fixed:ns#54:nt#15:nc#1632:so:\ + :b0=/mdec/rauboot:\ + :pa#15884:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ + :pb#16720:ob#15884:bb#1024:fb#1024:tb=swap:\ + :pc#1299174:oc#0:bc#1024:fc#1024:\ + :pd#227136:od#32604:bd#1024:fd#1024:td=2.11BSD:\ + :pe#409600:oe#259740:be#1024:fe#1024:te=2.11BSD:\ + :pf#182464:of#669340:bf#1024:ff#1024:tf=2.11BSD:\ + :pg#819200:og#32604:bg#1024:fg#1024:tg=2.11BSD:\ + :ph#447370:oh#851804:bh#1024:fh#1024:th=2.11BSD + +rz57|RZ57|DEC RZ57:\ + :dt=MSCP:ty=fixed:ns#71:nt#15:nc#1854:so:\ + :b0=/mdec/rauboot:\ + :pa#15884:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ + :pb#16720:ob#15884:bb#1024:fb#1024:tb=swap:\ + :pc#1954050:oc#0:bc#1024:fc#1024:\ + :pd#227136:od#32604:bd#1024:fd#1024:td=2.11BSD:\ + :pe#409600:oe#259740:be#1024:fe#1024:te=2.11BSD:\ + :pf#182464:of#669340:bf#1024:ff#1024:tf=2.11BSD:\ + :pg#819200:og#32604:bg#1024:fg#1024:tg=2.11BSD:\ + :ph#1102246:oh#851804:bh#1024:fh#1024:th=2.11BSD + +rz58|RZ58|DEC RZ58:\ + :dt=MSCP:ty=fixed:ns#85:nt#15:nc#2112:so:\ + :b0=/mdec/rauboot:\ + :pa#15884:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ + :pb#16270:ob#15884:bb#1024:fb#1024:tb=swap:\ + :pc#2698061:oc#0:bc#1024:fc#1024:\ + :pd#227136:od#32604:bd#1024:fd#1024:td=2.11BSD:\ + :pe#409600:oe#259740:be#1024:fe#1024:te=2.11BSD:\ + :pf#182464:of#669340:bf#1024:ff#1024:tf=2.11BSD:\ + :pg#819200:og#32604:bg#1024:fg#1024:tg=2.11BSD:\ + :ph#1846257:oh#851804:bh#1024:fh#1024:th=2.11BSD + +# The RX driver uses partition 'a' to select single density and 'b' to +# select double density. Partition sizes are in units of 512-byte sectors +# even though the rx01 uses 128 byte hardware sectors and the rx02 256 byte +# sectors. This really doesn't work too well for the RX01 due to the odd +# number of sectors - are there any of them still running? + +rx01|RX01|DEC RX01:\ + :ty=floppy:se#128:ns#13:nt#1:nc#77:\ + :b0=/mdec/rx01uboot:\ + :pa#500:ba#1024:fa#1024:\ + +rx02|RX02|DEC RX02:\ + :ty=floppy:se#256:ns#13:nt#1:nc#77:\ + :b0=/mdec/rx02uboot:\ + :pb#1001:bb#1024:fb#1024: + +# +# RAM disk +# +ram|RAM|Ram disk:\ + :ty=simulated:ns#2:nt#1024:nc#4096: diff --git a/etc/dtab b/etc/dtab new file mode 100644 index 0000000..f291799 --- /dev/null +++ b/etc/dtab @@ -0,0 +1,46 @@ +# Device Configuration Table + +#Name Unit# Addr Vector Br Handler(s) # Comments + +# dr ? 172410 124 5 drintr # dr11-w (b-bus emulator) +# dr ? 172430 130 5 drintr # dr11-w (gc-bus emulator) +# dr ? 172450 134 5 drintr # dr11-w (em-2 interface) +# du ? 160020 310 5 dhurint dhuxint # dhu11 terminal mux +# dhv ? 160020 310 5 dhvrint dhvxint # dhv terminal mux +# dm ? 170500 310 4 dmintr # dm11 dh modem control +# dh ? 160020 320 5 dhrint dhxint # dh11 terminal mux +# dz ? 160100 310 5 dzrint dzdma # dz11 terminal mux +hk ? 177440 210 5 hkintr # rk611/711 rk06/07 +# hp ? 176700 254 5 hpintr # rjp04/06, rwp04/06 +ht ? 172440 224 5 htintr # tu 16 massbus tape +# vp ? 177500 174 4 vpintr # Versatec; should be before lp +# lp ? 177514 200 4 lpintr # lp-11 line printer +ra ? 172150 154 5 raintr # uda50, rqdx1/2/3 +rk ? 177400 220 5 rkintr # rk05 +rl ? 174400 160 5 rlintr # rl-01/02 +# rm ? 176700 254 5 rmintr # rjm02/rwm03, rm02/03/05 +# br ? 176710 254 5 brintr # Eaton br1537/br1711 +# rx ? 177170 264 5 rxintr # rx01/02 +# si ? 176700 170 5 siintr # si9500 +tm ? 172520 224 5 tmintr # tm11 driver +tms ? 174500 260 5 tmsintr # tmscp driver +ts ? 172520 224 5 tsintr # ts11 driver +xp ? 176700 254 5 xpintr # xp driver + +# If you have DL11s, you must give each line an explicit unit number instead +# of using a '?' as above. If you use a '?', autoconfig(8) will start +# assigning unit numbers starting at 0 which will effectively move your +# console to that first line. Start your unit numbers with '1'. +# +# cn 1 176500 300 5 cnrint cnxint # kl/dl-11 (on mvx11-aa) + +# The following entries are provided for information only, actual +# configuration is done elsewhere. + +# acc ? 167600 5 accin accout # lhdh driver +# de ? 120 5 deintr # deuna +# qe ? 174440 400 5 qeintr # deqna ethernet +# il ? 163000 340 5 ilrint ilcint # interlan ethernet +# kw ? 172540 100 6 hardclock # kw11-p clock +# sr ? 500 5 srirint srixint # sri dr11-c arpanet imp +# vv ? 161000 350 5 vvrint vvxint # pronet diff --git a/etc/fstab b/etc/fstab new file mode 100644 index 0000000..b5c0b40 --- /dev/null +++ b/etc/fstab @@ -0,0 +1,6 @@ +/dev/ra0a / ufs rw 1 1 +/dev/ra0b none swap sw 0 0 +/dev/ra0d /usr ufs rw 1 2 +/dev/ra0e /tmp ufs rw,async 1 3 +/dev/ra0f /user ufs rw,quotas 1 4 +/dev/ra0g /xxx ufs rw 1 5 diff --git a/etc/ftpusers b/etc/ftpusers new file mode 100644 index 0000000..f530492 --- /dev/null +++ b/etc/ftpusers @@ -0,0 +1,3 @@ +uucp +ingres +root diff --git a/etc/gettytab b/etc/gettytab new file mode 100644 index 0000000..dfab38d --- /dev/null +++ b/etc/gettytab @@ -0,0 +1,129 @@ +# Copyright (c) 1980 Regents of the University of California. +# All rights reserved. The Berkeley software License Agreement +# specifies the terms and conditions for redistribution. +# +# @(#)gettytab 5.7.2 (2.11BSD GTE) 1997/3/28 +# +# +# Most of the table entries here are just copies of the +# old getty table, it is by no means certain, or even likely, +# then any of them are optimal for any purpose whatever. +# Nor is it likely that more than a couple are even correct +# + +# +# The default gettytab entry, used to set defaults for all other +# entries, and in cases where getty is called with no table name +# +default:\ + :ap:im=\r\n\r\n2.11 BSD UNIX (%h) (%t)\r\n\r\r\n\r:sp#1200: + +# +# Fixed speed entries +# +# The "std.NNN" names are known to the special case +# portselector code in getty, however they can +# be assigned to any table desired. +# The "NNN-baud" names are known to the special case +# autobaud code in getty, and likewise can +# be assigned to any table desired (hopefully the same speed). +# +a|std.110|110-baud:\ + :sp#110: +b|std.134|134.5-baud:\ + :ep:sp#134:ht:nl: +1|std.150|150-baud:\ + :ep:sp#150:ht:nl:lm=\E\72\6\6\17login\72 : +c|std.300|300-baud:\ + :sp#300: +d|std.600|600-baud:\ + :sp#600: +f|std.1200|1200-baud:\ + :sp#1200: +6|std.2400|2400-baud:\ + :sp#2400:ht: +7|std.4800|4800-baud:\ + :sp#4800:ht: +2|std.9600|9600-baud:\ + :sp#9600: +g|std.19200|19200-baud:\ + :sp#19200: + +# +# Hardware flow control lines +# +t9600-hf:hf:sp#9600 +t19200-hf:hf:sp#19200 +t38400-hf:hf:sp#38400 + +# +# Dial in rotary tables, speed selection via 'break' +# +0|d300|Dial-300:\ + :nx=d1200:sp#300: +d1200|Dial-1200:\ + :nx=d150:sp#1200: +d150|Dial-150:\ + :nx=d110:lm@:tc=150-baud: +d110|Dial-110:\ + :nx=d300:tc=300-baud: + +# +# Odd special case terminals +# +-|tty33|asr33|Pity the poor user of this beast:\ + :tc=110-baud: + +4|Console|Console Decwriter II:\ + :rw:tc=300-baud: + +e|Console-1200|Console Decwriter III:\ + :rw:tc=1200-baud: + +l|lsi chess terminal:\ + :sp#300: + +X|Xwindow|X window system:\ + :rw:sp#9600: + +# +# Fast dialup terminals, 2400/1200/300 rotary (can start either way) +# +D2400|Fast-Dial-2400:\ + :nx=D1200:tc=2400-baud: +3|D1200|Fast-Dial-1200:\ + :nx=D300:tc=1200-baud: +5|D300|Fast-Dial-300:\ + :nx=D2400:tc=300-baud: + +# +# Wierdo special case for fast crt's with hardcopy devices +# +8|T9600|CRT with hardcopy:\ + :nx=T300:tc=9600-baud: +9|T300|CRT with hardcopy (300):\ + :nx=T9600:tc=300-baud: + +# +# Plugboard, and misc other terminals +# +p|P9600|Plugboard-9600:\ + :nx=P300:tc=9600-baud: +q|P300|Plugboard-300:\ + :nx=P1200:tc=300-baud: +r|P1200|Plugboard-1200:\ + :nx=P9600:tc=1200-baud: + +# +# XXXX Port selector +# +s|DSW|Port Selector:\ + :ps:sp#2400: + +# +# Auto-baud speed detect entry for Micom 600. +# Special code in getty will switch this out +# to one of the NNN-baud entries. +# +A|Auto-baud:\ + :ab:sp#2400:f0#040: diff --git a/etc/group b/etc/group new file mode 100644 index 0000000..b9fffc8 --- /dev/null +++ b/etc/group @@ -0,0 +1,10 @@ +wheel:*:0:root +daemon:*:1:daemon +kmem:*:2: +sys:*:3: +tty:*:4: +operator:*:5: +staff:*:10: +bin:*:20: +guest:*:31: +ingres:*:74: diff --git a/etc/hosts b/etc/hosts new file mode 100644 index 0000000..5c72bce --- /dev/null +++ b/etc/hosts @@ -0,0 +1 @@ +127.0.0.1 localhost.2bsd.com localhost.arpa localhost diff --git a/etc/hosts.allow b/etc/hosts.allow new file mode 100644 index 0000000..50fe67c --- /dev/null +++ b/etc/hosts.allow @@ -0,0 +1,4 @@ +tftpd: LOCAL +rshd: LOCAL +zyncd: LOCAL +popper: LOCAL diff --git a/etc/hosts.deny b/etc/hosts.deny new file mode 100644 index 0000000..45bc5eb --- /dev/null +++ b/etc/hosts.deny @@ -0,0 +1 @@ +ALL: ALL diff --git a/etc/hosts.equiv b/etc/hosts.equiv new file mode 100644 index 0000000..f1f9542 --- /dev/null +++ b/etc/hosts.equiv @@ -0,0 +1 @@ +localhost.2bsd.com diff --git a/etc/inetd.conf b/etc/inetd.conf new file mode 100644 index 0000000..7613f39 --- /dev/null +++ b/etc/inetd.conf @@ -0,0 +1,28 @@ +# +# Internet server configuration database +# +ftp stream tcp nowait root /usr/libexec/tcpd ftpd -l +telnet stream tcp nowait root /usr/libexec/tcpd telnetd +shell stream tcp nowait root /usr/libexec/tcpd rshd +login stream tcp nowait root /usr/libexec/tcpd rlogind +#exec stream tcp nowait root /usr/libexec/rexecd rexecd +uucpd stream tcp nowait root /usr/libexec/uucpd uucpd +#nntp stream tcp nowait usenet /usr/libexec/nntpd nntpd +finger stream tcp nowait nobody /usr/libexec/fingerd fingerd -s -l +tftp dgram udp wait nobody /usr/libexec/tcpd tftpd +comsat dgram udp wait root /usr/libexec/comsat comsat +#talk dgram udp wait root /usr/libexec/talkd talkd +#ntalk dgram udp wait root /usr/libexec/ntalkd ntalkd +ident stream tcp wait sys /usr/libexec/identd identd -l -w -t120 +echo stream tcp nowait root internal +discard stream tcp nowait root internal +#chargen stream tcp nowait root internal +#daytime stream tcp nowait root internal +tcpmux stream tcp nowait root internal +tcpmux/+date stream tcp nowait nobody /bin/date date +#time stream tcp nowait root internal +echo dgram udp wait root internal +#discard dgram udp wait root internal +#chargen dgram udp wait root internal +#daytime dgram udp wait root internal +time dgram udp wait root internal diff --git a/etc/inetd.conf.nowrappers b/etc/inetd.conf.nowrappers new file mode 100644 index 0000000..b7efb8f --- /dev/null +++ b/etc/inetd.conf.nowrappers @@ -0,0 +1,28 @@ +# +# Internet server configuration database +# +ftp stream tcp nowait root /usr/libexec/ftpd -l +telnet stream tcp nowait root /usr/libexec/telnetd +shell stream tcp nowait root /usr/libexec/rshd +login stream tcp nowait root /usr/libexec/rlogind +#exec stream tcp nowait root /usr/libexec/rexecd +uucpd stream tcp nowait root /usr/libexec/uucpd uucpd +#nntp stream tcp nowait usenet /usr/libexec/nntpd nntpd +finger stream tcp nowait nobody /usr/libexec/fingerd fingerd -s -l +#tftp dgram udp wait nobody /usr/libexec/tftpd +comsat dgram udp wait root /usr/libexec/comsat comsat +#talk dgram udp wait root /usr/libexec/talkd talkd +#ntalk dgram udp wait root /usr/libexec/ntalkd ntalkd +ident stream tcp wait sys /usr/libexec/identd identd -l -w -t120 +echo stream tcp nowait root internal +discard stream tcp nowait root internal +#chargen stream tcp nowait root internal +#daytime stream tcp nowait root internal +tcpmux stream tcp nowait root internal +tcpmux/+date stream tcp nowait nobody /bin/date date +#time stream tcp nowait root internal +echo dgram udp wait root internal +#discard dgram udp wait root internal +#chargen dgram udp wait root internal +#daytime dgram udp wait root internal +time dgram udp wait root internal diff --git a/etc/master.passwd b/etc/master.passwd new file mode 100644 index 0000000..1f63c10 --- /dev/null +++ b/etc/master.passwd @@ -0,0 +1,8 @@ +root::0:1::0:0:The Man:/:/bin/sh +daemon:*:1:1::::The devil himself:/:/bin/sh +sys:*:4:2::::Operating System:/tmp:nologin +operator:*:2:5::::System &:/usr/guest/operator:/bin/csh +bin:*:3:20::::Binaries Commands and Source:/:/bin/csh +nobody:*:32767:31::::Nobody:/nonexistent:/bin/sh +uucp:*:66:1::0:0:UNIX-to-UNIX Copy:/usr/spool/uucppublic:/usr/sbin/uucico +ingres:*:39:74::0:0:INGRES Owner:/usr/ingres:/bin/csh diff --git a/etc/motd b/etc/motd new file mode 100644 index 0000000..474c8da --- /dev/null +++ b/etc/motd @@ -0,0 +1 @@ +2.11 BSD UNIX #9: Fri Dec 13 23:40:33 PST 1996 diff --git a/etc/netstart b/etc/netstart new file mode 100755 index 0000000..561faa7 --- /dev/null +++ b/etc/netstart @@ -0,0 +1,46 @@ +#!/bin/sh - + +# @(#)netstart 5.2.1 (2.11BSD) 1996/11/16 + +INET=`testnet` +if [ $INET = YES ]; then + echo Assuming NETWORKING system ... >/dev/console 2>&1 +else + echo Assuming non-networking system ... >/dev/console 2>&1 +fi +export INET + +# DON'T EVEN THINK ABOUT RUNNING ROUTED ON A PDP-11!!! Just set routedflags +# to "NO" and set up a default gateway below. +# +routedflags=NO +rwhod=YES +named=NO + +# myname is my symbolic name +# my-netmask is specified in /etc/networks +# my-default-address should be set to some machine where you +# want to send all your packets, by default. +# + +hostname=localhost.2bsd.com +netmask=255.255.255.0 +broadcast=127.255.255.255 +default=127.0.0.1 + +hostname $hostname >/dev/console 2>&1 +hostid $hostname >/dev/console 2>&1 + +if [ $INET = YES ]; then + # ifconfig imp0 inet netmask $netmask $hostname broadcast $broadcast up -trailers >/dev/console 2>&1 + # ifconfig en0 inet netmask $netmask $hostname broadcast $broadcast up -trailers >/dev/console 2>&1 + # ifconfig ec0 inet netmask $netmask $hostname broadcast $broadcast up -trailers arp >/dev/console 2>&1 + # ifconfig il0 inet netmask $netmask $hostname broadcast $broadcast up -trailers >/dev/console 2>&1 + # ifconfig qe0 inet netmask $netmask $hostname broadcast $broadcast up -trailers >/dev/console 2>&1 + # ifconfig sl0 inet 192.254.254.2 192.254.254.1 -arp -trailers >/dev/console 2>&1 + # slattach /dev/ttyS6 9600 + ifconfig lo0 inet localhost up -trailers >/dev/console 2>&1 + + route add $hostname localhost 0 >/dev/console 2>&1 + route add default $default 1 >/dev/console 2>&1 +fi diff --git a/etc/networks b/etc/networks new file mode 100644 index 0000000..405c610 --- /dev/null +++ b/etc/networks @@ -0,0 +1 @@ +localnet 127 diff --git a/etc/ntp.conf b/etc/ntp.conf new file mode 100644 index 0000000..8a1da17 --- /dev/null +++ b/etc/ntp.conf @@ -0,0 +1,17 @@ +# +# Local clock parameters +# +# Stratum MUST only be defined if you are a primary clock +# If so, include the 4 char clock type +#stratum 1 WWVB +# +# Precision of the local clock to the nearest power of 2 +# ex. +# 60-HZ = 2**-6 +# 100-HZ = 2**-7 +# 1000-HZ = 2**-10 +precision -6 +# +# Peers Type Name +# +peer 127.0.0.1 diff --git a/etc/passwd b/etc/passwd new file mode 100644 index 0000000..008f3bc --- /dev/null +++ b/etc/passwd @@ -0,0 +1,8 @@ +root:*:0:1:The Man:/:/bin/sh +daemon:*:1:1:The devil himself:/:/bin/sh +sys:*:4:2:Operating System:/tmp:nologin +operator:*:2:5:System &:/usr/guest/operator:/bin/csh +bin:*:3:20:Binaries Commands and Source:/:/bin/csh +nobody:*:32767:31:Nobody:/nonexistent:/bin/sh +uucp:*:66:1:UNIX-to-UNIX Copy:/usr/spool/uucppublic:/usr/sbin/uucico +ingres:*:39:74:INGRES Owner:/usr/ingres:/bin/csh diff --git a/etc/phones b/etc/phones new file mode 100644 index 0000000..15ea2b2 --- /dev/null +++ b/etc/phones @@ -0,0 +1,2 @@ +information 5221212 +wlbr 18188894490 diff --git a/etc/printcap b/etc/printcap new file mode 100644 index 0000000..98e5cbf --- /dev/null +++ b/etc/printcap @@ -0,0 +1,30 @@ +# +# Copyright (c) 1983 Regents of the University of California. +# All rights reserved. The Berkeley software License Agreement +# specifies the terms and conditions for redistribution. +# +# @(#)etc.printcap 5.1.1 (2.11BSD) 1996/10/25 +# +# This is a sample of printcap entries used by various printers/plotters +# +# DecWriter over a tty line. +lp|B300:\ + :lp=/dev/ttyS5:\ + :sd=/usr/spool/lpd:\ + :lf=/usr/spool/lpd/errs:\ + :af=/usr/spool/lpd/acct:\ + :of=/usr/libexec/lpr/lpf:\ + :if=/usr/libexec/lpr/lpf:\ + :br#9600:xc#0:xs#040040:fc#077777:fs#06320:\ + :pw#132:\ + :pl#66 +# :tr=\f:\ + +# Postscript printer, a HP4M with a Jetdirect 2552A installed. + +ps0|HP4MX:sd=/usr/spool/lpr/ps0:rp=raw:rm=dogbert:lp=:sf:sh:mx#0:\ + :lf=/usr/adm/lpd-errs:\ + :af=/usr/spool/lpr/ps0/acct + +# Text printer, a HP4m with a JetDirect 2552A installed. +lz0|d630|HP4MX|Home:sd=/usr/spool/lpr/lz0:rp=text:rm=dogbert:if=if.laserjet diff --git a/etc/protocols b/etc/protocols new file mode 100644 index 0000000..ac9248f --- /dev/null +++ b/etc/protocols @@ -0,0 +1,13 @@ +# +# Internet (IP) protocols +# +ip 0 IP # internet protocol, pseudo protocol number +icmp 1 ICMP # internet control message protocol +ggp 3 GGP # gateway-gateway protocol +tcp 6 TCP # transmission control protocol +egp 8 EGP # exterior gateway protocol +pup 12 PUP # PARC universal packet protocol +udp 17 UDP # user datagram protocol +hmp 20 HMP # host monitoring protocol +xns-idp 22 XNS-IDP # Xerox NS IDP +rdp 27 RDP # "reliable datagram" protocol diff --git a/etc/rc b/etc/rc new file mode 100755 index 0000000..f066e37 --- /dev/null +++ b/etc/rc @@ -0,0 +1,165 @@ + +# +# @(#)rc 2.1 (2.111BSD) 1996/10/21 +# +HOME=/; export HOME +PATH=/bin:/sbin:/usr/sbin:/usr/ucb:/usr/bin; export PATH + +# If you have a ram disk configured into your system which is listed in +# /etc/fstab, you'll have to do a mkfs on it here and probably change the +# ownership and modes below after the standard file systems have been +# mounted. +# +RAMSIZE=0 +RAMFS=/tmp +RAMOWNER=root +RAMGROUP=wheel +RAMMODE=1777 + +if [ ${RAMSIZE} != 0 ] +then + mkfs /dev/ram ${RAMSIZE} 1 2 +fi + +if [ "$2" = powerfail ] +then + echo REBOOTING AFTER POWER FAILURE >/dev/console 2>&1 +fi +if [ "$1" = fastboot ] +then + echo '' + echo Fast boot ... skipping disk checks >/dev/console 2>&1 +elif [ "$1" = autoboot ] +then + echo Automatic reboot in progress... >/dev/console 2>&1 + date >/dev/console 2>&1 + # this will *only* work if fsck can do your root file system + # without a temporary file, and if the root file system is + # checked alone in a pass by itself -- be careful! This can + # *seriously* mess you up. + fsck -p -t /_FSCK_TMP_FILE >/dev/console 2>&1 + case $? in + 0) + date >/dev/console 2>&1 + ;; + 2) + exit 1 + ;; + 4) + reboot -n + ;; + 8) + echo "Automatic reboot failed... help!" >/dev/console 2>&1 + exit 1 + ;; + 12) + echo "Reboot interrupted" >/dev/console 2>&1 + exit 1 + ;; + *) + echo "Unknown error in reboot" >/dev/console 2>&1 + exit 1 + ;; + esac +else + date >/dev/console 2>&1 +fi + +# attempt to rationally recover the passwd file if needed +if [ -s /etc/ptmp ] +then + echo 'password file may be incorrect' > /dev/console +fi + +# +# First umount everything in case the system is going back into multiuser +# mode. If the system is being booted for the first time nothing is mounted +# except the root filesystem and umount ignores attempts to unmount /. +# +umount -a +# +# Now mount everything mentioned in /etc/fstab *except* filesystems with the +# 'na' (noauto) option. +# +mount -a >/dev/console 2>&1 + +if [ ${RAMSIZE} != 0 ] +then + chown ${RAMOWNER}.${RAMGROUP} ${RAMFS} + chmod ${RAMMODE} ${RAMFS} +fi + + echo -n 'checking quotas:' >/dev/console 2>&1 + quotacheck -a >/dev/console 2>&1 + echo ' done.' >/dev/console 2>&1 +quotaon -a + +dev_mkdb + +ps -U >/dev/console 2>&1 +rm -f /etc/nologin +rm -f /usr/spool/uucp/LCK.* +rm -f /usr/spool/uucp/STST/* +chmod 666 /dev/tty[pqrs]* + +# set hostname and INET, turn on network +. /etc/netstart + +if [ $INET = YES ]; then + echo 'starting system logger' >/dev/console 2>&1 + rm -f /dev/log + syslogd +fi + +# /etc/crash should be a symbolic link to the crash directory +# if core dumps are to be saved. +if [ -d /etc/crash ]; then + echo 'checking for core dump... ' >/dev/console 2>&1 + savecore /etc/crash >/dev/console 2>&1 +fi + + echo preserving editor files >/dev/console 2>&1 + (cd /tmp; /usr/sbin/expreserve -a) + echo clearing /tmp >/dev/console 2>&1 +(cd /tmp; find . ! -name . ! -name lost+found ! -name quotas -exec rm -r {} \; ) + + echo -n standard daemons: >/dev/console 2>&1 +update; echo -n ' update' >/dev/console 2>&1 +cron; echo -n ' cron' >/dev/console 2>&1 +accton /usr/adm/acct; echo -n ' accounting' >/dev/console 2>&1 + echo '.' >/dev/console 2>&1 + +if [ $INET = YES ]; then + echo -n starting network daemons: >/dev/console 2>&1 + + # $routedflags is imported from /etc/netstart; + # if $routedflags == NO, routed isn't run. + if [ "${routedflags-NO}" != NO ]; then + routed $routedflags; echo -n ' routed' >/dev/console 2>&1 + fi + + # $named is imported from /etc/netstart; + # if $named is set to something other than NO, named is run. + if [ "${named-NO}" != NO ]; then + named; echo -n ' named'>/dev/console 2>&1 + fi + /usr/sbin/inetd; echo -n ' inetd'>/dev/console 2>&1 + + # $rwhod is imported from /etc/netstart; + # if $rwhod is set to something other than NO, rwhod is run. + if [ "${rwhod}" != NO ]; then + rwhod; echo -n ' rwhod' >/dev/console 2>&1 + fi + rm -f /dev/printer + /usr/sbin/lpd; echo -n ' printer' >/dev/console 2>&1 + echo '.' >/dev/console 2>&1 +else + # lpd will run even with out networking. + echo starting lpd >/dev/console 2>&1 + /usr/sbin/lpd +fi + +/etc/rc.local + +date >/dev/console 2>&1 +exit 0 diff --git a/etc/rc.local b/etc/rc.local new file mode 100755 index 0000000..c085796 --- /dev/null +++ b/etc/rc.local @@ -0,0 +1,23 @@ +#! /bin/sh - +# site-specific startup actions, daemons + +strings /vmunix | grep UNIX >/tmp/t1 +tail +2 /etc/motd >>/tmp/t1 +mv /tmp/t1 /etc/motd +chmod 666 /etc/motd + +echo -n starting local daemons: >/dev/console 2>&1 +#if [ $INET = YES -a -f /usr/sbin/timed ]; then +# timed & echo -n ' timed' >/dev/console 2>&1 +#fi +if [ -f /usr/sbin/sendmail ]; then + (cd /usr/spool/mqueue; rm -f lf*) + if [ $INET = YES ]; then + /usr/sbin/sendmail -bd -q1h; echo -n ' sendmail'>/dev/console 2>&1 + else + /usr/sbin/sendmail -q1h; echo -n ' sendmail' >/dev/console 2>&1 + fi +fi + echo '.' >/dev/console 2>&1 + +ntpd diff --git a/etc/remote b/etc/remote new file mode 100644 index 0000000..df5a2cb --- /dev/null +++ b/etc/remote @@ -0,0 +1,39 @@ +# +# General dialer definitions used below +# +dial9600|9600 Baud Hayes attributes:\ + :br#9600:at=hayes:du: +dial1200|1200 Baud DN11 attributes:\ + :dv=/dev/ttyi8:br#1200:cu=/dev/dn1:at=dn11:du: +dial300|300 Ventel attributes:\ + :dv=/dev/cul0:br#300:cu=/dev/cul0:at=ventel:du: +# +# UNIX system definitions +# +UNIX-1200|1200 Baud dial-out to another UNIX system:\ + :el=^U^C^R^O^D^S^Q@:ie=#%$:oe=^D:tc=dial1200: +UNIX-300|300 Baud dial-out to another UNIX system:\ + :el=^U^C^R^O^D^S^Q@:ie=#%$:oe=^D:tc=dial300: +tip0|tip1200:tc=UNIX-1200: +tip300:tc=UNIX-300: +cu0|cu300:tc=UNIX-300: +cu1200:tc=UNIX-1200: +dialer:dv=/dev/cul0:br#1200: +wlbr:dv=/dev/ttyS7:cu=/dev/ttyS7:pn=@:tc=dial9600: + +#-------------------------------------------------------------------- +#The attributes are: +# +#dv device to use for the tty +#el EOL marks (default is NULL) +#du make a call flag (dial up) +#pn phone numbers (@ =>'s search phones file; possibly taken from +# PHONES environment variable) +#at ACU type +#ie input EOF marks (default is NULL) +#oe output EOF string (default is NULL) +#cu call unit (default is dv) +#br baud rate (defaults to 300) +#fs frame size (default is BUFSIZ) -- used in buffering writes +# on receive operations +#tc to continue a capability diff --git a/etc/root/Makefile b/etc/root/Makefile new file mode 100644 index 0000000..ac881a4 --- /dev/null +++ b/etc/root/Makefile @@ -0,0 +1,19 @@ +# +# Public domain - 1997/1/10 - sms +# +# @(#)Makefile 1.0 (2.11BSD) 1997/1/10 +# +# DESTDIR is defined here to be something which does *NOT* exist - it must be +# specified on the command line when doing a "make DESTDIR=/mnt distribution". +# This is aimed at avoiding overwriting the system disk's /etc files. + +DESTDIR=/foobar +OWN=root +GRP=wheel + +all install depend lint clean tags: + +distribution: + install -c -o ${OWN} -g ${GRP} -m 644 dot.cshrc ${DESTDIR}/.cshrc + install -c -o ${OWN} -g ${GRP} -m 644 dot.login ${DESTDIR}/.login + install -c -o ${OWN} -g ${GRP} -m 644 dot.profile ${DESTDIR}/.profile diff --git a/etc/root/dot.cshrc b/etc/root/dot.cshrc new file mode 100644 index 0000000..48788b6 --- /dev/null +++ b/etc/root/dot.cshrc @@ -0,0 +1,14 @@ +set history=30 +set path=(/bin /sbin /etc /usr/sbin /usr/ucb /usr/bin /usr/new /usr/local) +if ($?prompt) then + set prompt="\!% " +endif + +set filec +set mail=( 0 /usr/spool/mail/$USER ) +set cdpath=( ~ /usr/spool/mqueue) +set prompt="\!% root--> " +alias mail /usr/ucb/Mail +alias pwd 'echo $cwd' +alias h history +alias q5 'tail -5 /usr/spool/mqueue/syslog' diff --git a/etc/root/dot.login b/etc/root/dot.login new file mode 100644 index 0000000..6efc4fc --- /dev/null +++ b/etc/root/dot.login @@ -0,0 +1,14 @@ +unset noglob +set path=(/bin /etc /sbin /usr/sbin /usr/ucb /usr/bin /usr/local /usr/new) +umask 26 +stty dec erase ^H kill ^U eof ^D +set prompt="[\!] root--> " + +if ( "$TERM" == dialup || "$TERM" == network) then + setenv TERM vt100 + echo -n "Terminal ($TERM)? " + set argv = "$<" + if ( "$argv" != '' ) setenv TERM "$argv" +endif + +biff y diff --git a/etc/root/dot.profile b/etc/root/dot.profile new file mode 100644 index 0000000..b08cb22 --- /dev/null +++ b/etc/root/dot.profile @@ -0,0 +1,8 @@ +echo 'erase, kill ^U, intr ^C' +stty dec +stty erase +PATH=/bin:/sbin:/usr/sbin:/etc:/usr/ucb:/usr/bin:/usr/new +export PATH +HOME=/ +export HOME +export TERM diff --git a/etc/services b/etc/services new file mode 100644 index 0000000..5cca2b7 --- /dev/null +++ b/etc/services @@ -0,0 +1,68 @@ +# @(#)services 1.16.2 (2.11BSD) 1996/12/13 +# +# Network services, Internet style +# +tcpmux 1/tcp # TCP port multiplexer (RFC1078) +echo 7/tcp +echo 7/udp +discard 9/tcp sink null +discard 9/udp sink null +systat 11/tcp users +daytime 13/tcp +daytime 13/udp +netstat 15/tcp +qotd 17/tcp quote +chargen 19/tcp ttytst source +chargen 19/udp ttytst source +ftp 21/tcp +telnet 23/tcp +smtp 25/tcp mail +time 37/tcp timserver +time 37/udp timserver +rlp 39/udp resource # resource location +nameserver 42/tcp name # IEN 116 +whois 43/tcp nicname +domain 53/tcp nameserver # name-domain server +domain 53/udp nameserver +mtp 57/tcp # deprecated +tftp 69/udp +rje 77/tcp netrjs +finger 79/tcp +link 87/tcp ttylink +supdup 95/tcp +hostnames 101/tcp hostname # usually from sri-nic +#csnet-cs 105/? +pop 109/tcp postoffice +sunrpc 111/tcp +sunrpc 111/udp +ident 113/tcp auth tap authentication +sftp 115/tcp +uucp-path 117/tcp +nntp 119/tcp readnews untp # USENET News Transfer Protocol +ntp 123/udp ntpd ntp # network time protocol (exp) +# +# UNIX specific services +# +exec 512/tcp +biff 512/udp comsat +login 513/tcp +who 513/udp whod +shell 514/tcp cmd # no passwords used +syslog 514/udp +printer 515/tcp spooler # line printer spooler +talk 517/udp +ntalk 518/udp +efs 520/tcp # for LucasFilm +route 520/udp router routed +timed 525/udp timeserver +tempo 526/tcp newdate +courier 530/tcp rpc +conference 531/tcp chat +netnews 532/tcp readnews +netwall 533/udp # -for emergency broadcasts +uucp 540/tcp uucpd # uucp daemon +remotefs 556/tcp rfs_server rfs # Brunhoff remote filesystem + +ingreslock 1524/tcp + +# local definitions follow diff --git a/etc/shells b/etc/shells new file mode 100644 index 0000000..f7a4354 --- /dev/null +++ b/etc/shells @@ -0,0 +1,6 @@ +# List of acceptable shells for chsh/passwd -s +# Ftpd will not allow users to connect who do not have one of these shells +# +/bin/sh +/bin/csh +/bin/tcsh diff --git a/etc/syslog.conf b/etc/syslog.conf new file mode 100644 index 0000000..90163fb --- /dev/null +++ b/etc/syslog.conf @@ -0,0 +1,14 @@ +local7.debug /dev/null +*.crit;*.err;kern.debug;auth.notice,local7.none /dev/console + +*.err;auth.notice;*.info;kern.debug;local3,local7,mail,daemon,lpr.none /usr/adm/messages + +cron.debug /usr/adm/cron +lpr.debug /usr/adm/lpd-errs +mail.debug /usr/spool/mqueue/syslog +mark.debug;daemon.debug /usr/adm/daemonlog +user.debug /usr/adm/debuglog + +*.alert;kern.err operator,root + +*.emerg * diff --git a/etc/ttys b/etc/ttys new file mode 100644 index 0000000..dbe8250 --- /dev/null +++ b/etc/ttys @@ -0,0 +1,29 @@ +# +# name getty type status comments +# +console "/usr/libexec/getty std.9600" vt100 on secure #special +ttyS0 "/usr/libexec/getty std.9600" vt100 off secure +ttyS1 "/usr/libexec/getty std.9600" vt100 off secure +ttyS2 "/usr/libexec/getty std.9600" vt100 off secure +ttyS3 "/usr/libexec/getty std.9600" vt100 off secure +ttyS4 "/usr/libexec/getty std.9600" vt100 off secure +ttyS5 "/usr/libexec/getty std.9600" vt100 off secure #printer +ttyS6 "/usr/libexec/getty std.9600" vt100 off secure +ttyS7 "/usr/libexec/getty std.9600" vt100 off secure +ttyl1 "/usr/libexec/getty std.9600" vt100 off secure +ttyp0 none network secure +ttyp1 none network secure +ttyp2 none network secure +ttyp3 none network secure +ttyp4 none network secure +ttyp5 none network +ttyp6 none network +ttyp7 none network +ttyp8 none network +ttyp9 none network +ttypa none network +ttypb none network +ttypc none network +ttypd none network +ttype none network +ttypf none network diff --git a/etc/uucp/L-devices b/etc/uucp/L-devices new file mode 100644 index 0000000..c81eafd --- /dev/null +++ b/etc/uucp/L-devices @@ -0,0 +1 @@ +ACU ttyS7 unused 2400 hayestone "" AT OK "" diff --git a/etc/uucp/L-dialcodes b/etc/uucp/L-dialcodes new file mode 100644 index 0000000..d00e6fd --- /dev/null +++ b/etc/uucp/L-dialcodes @@ -0,0 +1,2 @@ +nj 1-201- +bostn 1-617 diff --git a/etc/uucp/L.cmds b/etc/uucp/L.cmds new file mode 100644 index 0000000..c6fd3eb --- /dev/null +++ b/etc/uucp/L.cmds @@ -0,0 +1,4 @@ +rmail +who +uucp +uucico diff --git a/etc/uucp/L.sys b/etc/uucp/L.sys new file mode 100644 index 0000000..f89d1ee --- /dev/null +++ b/etc/uucp/L.sys @@ -0,0 +1,2 @@ +moe Any TCP uucp moe.iipo.gtegsc.com login: usms assword: fizzbin +moe Polled TCP uucp moe.iipo.gtegsc.com diff --git a/etc/uucp/L_stat b/etc/uucp/L_stat new file mode 100644 index 0000000..e69de29 diff --git a/etc/uucp/L_sub b/etc/uucp/L_sub new file mode 100644 index 0000000..e69de29 diff --git a/etc/uucp/Makefile b/etc/uucp/Makefile new file mode 100644 index 0000000..bfac951 --- /dev/null +++ b/etc/uucp/Makefile @@ -0,0 +1,29 @@ +# +# Public domain - 1997/1/10 - sms +# +# @(#)Makefile 1.0 (2.11BSD) 1997/1/10 +# +# DESTDIR is defined here to be something which does *NOT* exist - it must be +# specified on the command line when doing a "make DESTDIR=/mnt distribution". +# This is aimed at avoiding overwriting the system disk's /etc files. + +DESTDIR=/foobar + +OWN=uucp +GRP=daemon + +FILES= L-devices L-dialcodes L.cmds L.sys L_stat L_sub SEQF USERFILE \ + clean.daily clean.weekly uucp-map + +all install depend lint clean tags: + +distribution: + -rm -rf ${DESTDIR}/etc/uucp + mkdir ${DESTDIR}/etc/uucp + chown uucp.daemon ${DESTDIR}/etc/uucp + chmod 755 ${DESTDIR}/etc/uucp + install -c -o ${OWN} -g ${GRP} -m 644 ${FILES} ${DESTDIR}/etc/uucp + chmod 600 ${DESTDIR}/etc/uucp/L.sys + chmod 640 ${DESTDIR}/etc/uucp/L_stat ${DESTDIR}/etc/uucp/L_sub + chmod 640 ${DESTDIR}/etc/uucp/SEQF + chmod 755 ${DESTDIR}/etc/uucp/clean.* diff --git a/etc/uucp/SEQF b/etc/uucp/SEQF new file mode 100644 index 0000000..6695d40 --- /dev/null +++ b/etc/uucp/SEQF @@ -0,0 +1,2 @@ +3Qf0 + diff --git a/etc/uucp/USERFILE b/etc/uucp/USERFILE new file mode 100644 index 0000000..5c0063c --- /dev/null +++ b/etc/uucp/USERFILE @@ -0,0 +1 @@ +, /usr/spool/uucppublic diff --git a/etc/uucp/clean.daily b/etc/uucp/clean.daily new file mode 100755 index 0000000..560042b --- /dev/null +++ b/etc/uucp/clean.daily @@ -0,0 +1,46 @@ +#!/bin/csh -f +# +# Once a day, move the log files to the archive directory, +# keep them for 30 days, and then get rid of them. +# +set files=( SYSLOG LOGFILE ERRLOG ) +set days=30 +set spooldir=/usr/spool/uucp +set archdir=uucplog.archives +# +if ( ! -e $archdir ) mkdir $archdir +cd $spooldir +# +# get today's files out of the way immediately +# +foreach file ( $files ) + mv $file o$file + cp /dev/null $file + chmod 664 $file +end +# +# now move things around in the archive directory +# +foreach file ( $files ) + set x=$days + while($x > 0) + @ y = $x - 1 + if ($x == $days) rm $archdir/$file.$x + mv -f $archdir/$file.$y $archdir/$file.$x + @ x -- + end + mv o$file $archdir/$file.0 +end + +# this assumes you have subdirectories. +# If you do not have them, delete the '-d....' options below. +# someone should use shell variables to do this +# Much better to have subdirectories, however. + +/usr/sbin/uuclean -pLTMP. -n24 +/usr/sbin/uuclean -d/usr/spool/uucp/TM. -pTM. -n240 +/usr/sbin/uuclean -d/usr/spool/uucp/X. -pX. -n240 +/usr/sbin/uuclean -d/usr/spool/uucp/C. -pC. -n240 +/usr/sbin/uuclean -d/usr/spool/uucp/D. -pD. -n240 +/usr/sbin/uuclean -d/usr/spool/uucp/D.`uuname -l` -pD. -n240 +/usr/sbin/uuclean -d/usr/spool/uucp/D.`uuname -l`X -pD. -n240 diff --git a/etc/uucp/clean.weekly b/etc/uucp/clean.weekly new file mode 100755 index 0000000..0c9e169 --- /dev/null +++ b/etc/uucp/clean.weekly @@ -0,0 +1,11 @@ +#!/bin/csh -f +# +# Once a week, produce a report and mail to people +# +set people=( sms ) +set spooldir=/usr/spool/uucp +set archdir=uucplog.archives + +cd $spooldir/$archdir +nice +5 awk -f /etc/uucp/sys_awk SYSLOG.[0-6] >& weekly_report +Mail -s "Weekly UUCP Report" $people < weekly_report diff --git a/etc/uucp/uucp-map b/etc/uucp/uucp-map new file mode 100644 index 0000000..e69de29 diff --git a/games/Makefile b/games/Makefile new file mode 100644 index 0000000..9fc47ad --- /dev/null +++ b/games/Makefile @@ -0,0 +1,94 @@ +# +# Copyright (c) 1980 Regents of the University of California. +# All rights reserved. The Berkeley software License Agreement +# specifies the terms and conditions for redistribution. +# +# @(#)Makefile 5.5 (2.11BSD) 1997/7/26 +# +DESTDIR= +CFLAGS= -O +SEPFLAG= -i + +# Programs that live in subdirectories, and have makefiles of their own. +# +SUBDIR= adventure backgammon battlestar boggle btlgammon cribbage fortune \ + hack \ + hangman hunt mille monop pdp phantasia quiz robots sail snake \ + trek warp words + +# Shell scripts that need only be installed and are never removed. +# +SCRIPT= wargames + +# C programs that live in the current directory and do not need +# explicit make lines. +# +STD= arithmetic banner bcd cfscores factor fish morse number ppt \ + wump + +# C programs that live in the current directory and need explicit make lines. +# +NSTD= canfield primes rain worm worms + +all: ${SUBDIR} ${STD} ${NSTD} + +${SUBDIR}: FRC + cd $@; make ${MFLAGS} SEPFLAG=${SEPFLAG} + +FRC: + +${STD}: + cc ${CFLAGS} ${SEPFLAG} -o $@ $@.c + +install: ${STD} ${NSTD} + -for i in ${SUBDIR}; do \ + (cd $$i; make ${MFLAGS} DESTDIR=${DESTDIR} install); done + -for i in ${SCRIPT}; do \ + (install -c -m 755 $$i.sh ${DESTDIR}/usr/games/$$i); done + -for i in ${STD} ${NSTD}; do \ + (install -s -m 755 $$i ${DESTDIR}/usr/games/$$i); done + cat >${DESTDIR}/usr/games/lib/cfscores 78) { print rec; rec = $$0; } \ + else rec = rec " " $$2 } } \ + END { print rec } ' >> makedep; done + echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep + echo '$$r makedep' >>eddep + echo 'w' >>eddep + cp Makefile Makefile.bak + ed - Makefile < eddep + rm eddep makedep + echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile + echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile + echo '# see make depend above' >> Makefile + +# Files listed in ${NSTD} have explicit make lines given below. + +canfield: + cc -o canfield ${CFLAGS} ${SEPFLAG} canfield.c -lcurses -ltermcap + +primes: + cc -o primes ${CFLAGS} ${SEPFLAG} primes.c -lm + +rain: + cc -o rain ${CFLAGS} ${SEPFLAG} rain.c -lcurses -ltermcap + +worm: + cc -o worm ${CFLAGS} ${SEPFLAG} worm.c -lcurses -ltermcap + +worms: + cc -o worms ${CFLAGS} ${SEPFLAG} worms.c -lcurses -ltermcap + +# DO NOT DELETE THIS LINE -- make depend uses it + diff --git a/games/PORT/aard.tar.Z b/games/PORT/aard.tar.Z new file mode 100644 index 0000000000000000000000000000000000000000..9bc5f78928c1e0a0378100f9c08cff420bf4e197 GIT binary patch literal 34069 zcmZsB1yq#X_caW|3?e8E!w@qxDAJ9{05fzqA~JM`bVzqM2!fQf3ep17DcvDT2?!`4 zsEC5!gYmxa|F^!iSS}aObI(2ZoW1wicNoUpIBeGd@(2{v8A?FTWjs(_&>cy_%mhXq z_Qlg8a5P>MFt1}`=!F947D#)D;38)8S+1dd#4xz+d>O86QBRJj+s^C3+S0K{(xHU( zN_8APL3nosFV&XBJrHylqRHiQFCvBuN(K-qYV9hJ=qu-?;TH7~!T8KNikm)FsaCkG z59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yEf3H+ZDR`_37%Kvle z|1$9ZkpcMcwIF&f?Hh$1CumWkcKtVsx)S01hw`+mi+fVoqz_N`S6}Ko%U+I+T);w3 z@t}=J*`^6+xZ!>(L)6C5Zf*) zbL5ifRLKSD;30On)O2&y8E5<^7{#T914mP&GCC>dUiwT=lZ=+F3@DOntD1u z$wWXmOVVw$Hfi&<$d?>64ylTmUN(CFwv<{m_{`lSE|0F*ga(aO+21nY&iU|Svfh8O zvrKp0Z*~~}9m-?<*7bI#m}76A^*i^w`TGf98EnRd-3HM)2Odsmtv?^VYZx4_sI|{S z(SN0u7+l|C(^TzvFViPCig70H2rKkV#D??YnR60Zd980ppJp5PO@xBqCNk66`1Wzw zFyuVphzclYwY7g0?@kllg7`2+>=d!EbLl7aav6Uk2yuHx&ycJ=rHx82FyO2_IO47l z+{WUT83l+Z;Wde@p>j_0+5QQTEVjT@?vL3)X)@u3N!g4VGoBEnyi1&P6Xtxfd_C~j z3~Q>i=Fb+*qf4SWIlLYx9(q2GO)~r*&KG)-+ABZx8&M}S%OQ?#CA(oQv+Du}i}l4s zofVjGEHsRFLyM6O%A7dMrjv2^CSyz_mClxce8b=itM9a!&Ufd7* zT+Gl>7U_Alw|U}us*%)@nG~Ewq}%C-lVDhFbJT5@%agAKPB_N&SUxT9t|=F;X!zVv znest%%BO?c)Vu10V(XOi^_bU1o!w}LSak%!h&qnR&nN?5nox==)**uG!Q1V)Nyb&xj@$Y1pJ5?y>Nw( ziG}|o36KBY;H6Gi_@% literal 0 HcmV?d00001 diff --git a/games/PORT/doctor.tar.Z b/games/PORT/doctor.tar.Z new file mode 100644 index 0000000000000000000000000000000000000000..5bfe15ce76137a3e1904a462d861051f131e3256 GIT binary patch literal 11258 zcmZX22UJsCvo?kVkfI`jR6*et6p$tm5^*ztd1el4MwIDnRMxKS00j{l&3#mNc@{eC z8oOe8__g2;CQ)mDBBRgjQPC{CzDx99mgKGp* zF*+t>JqBIYu3RwYb)RT6afK!^`EX5eVy(X9wT9A*dSh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Rr9!IyAC?SBiJM7hM)6%k2)UcmC6ST;l^>KW4rW+;4`&lQL4hy$7c2= zm5H_iXAaKK?!m94h?Sec-!bbZo`@n$w-UBf1}mQRq`=}gpU9GH^NK!hF1Q@pP|S+T z#rO4S4o2V4+_wDrbWeSS+wH=&lbrq12t3+i0j}V-{s$i&#kRJcoIe00M$>@nw^>Z9Q-tUNiM@;-5 DC0KY- literal 0 HcmV?d00001 diff --git a/games/adventure/FILES b/games/adventure/FILES new file mode 100644 index 0000000..d8af2ef --- /dev/null +++ b/games/adventure/FILES @@ -0,0 +1,12 @@ +Makefile +done.c +glorkz +hdr.h +init.c +io.c +main.c +okplay.c +save.c +subr.c +vocab.c +wizard.c diff --git a/games/adventure/Makefile b/games/adventure/Makefile new file mode 100644 index 0000000..f4f1c7d --- /dev/null +++ b/games/adventure/Makefile @@ -0,0 +1,53 @@ +# Makefile 4.3 85/09/07 + +DESTDIR= +SEPFLAG= -i +CFILES= done.c init.c io.c main.c save.c subr.c vocab.c wizard.c +OBJS= done.o init.o io.o main.o save.o subr.o vocab.o wizard.o +HFILES = hdr.h +SRCS = $(CFILES) $(HFILES) glorkz +CFLAGS= -O +LDFLAGS=-n # should be -i on small machines, -n on a vax + +advent: a.out + rm -f advent + echo y | ./a.out + +a.out: ${OBJS} + ${CC} ${SEPFLAG} ${LDFLAGS} ${CFLAGS} ${OBJS} + +save.o: save.c # vax C optimizer bug - infinite loop + cc -c save.c + +# always recomple okplay +okplay.o: /tmp + +install: advent + install -s advent ${DESTDIR}/usr/games/adventure +# cp okplay /usr/games/adventure +# cp advsaver /usr/games/lib +# dd if=/usr/games/lib/adventure of=/usr/games/lib/advheader bs=1 count=16 +# chmod 711 /usr/games/lib +# chmod 700 /usr/games/lib/adventure +# chmod 755 /usr/games/lib/advheader +# chmod 755 /usr/games/lib/advsaver +# chmod 4711 /usr/games/adventure +# chown games /usr/games/adventure /usr/games/lib/adventure /usr/games/lib/advheader /usr/games/lib/advsaver +# rm advent a.out okplay + +okplay: okplay.c + ${CC} ${SEPFLAG} ${CFLAGS} -o okplay okplay.c + +advsaver: advsaver.s + ${AS} -o advsaver advsaver.s + +lint: + lint $(CFILES) >& lint.out + +clean: + rm -f ${OBJS} a.out advent core errs + +sources: $(SRCS) + +$(SRCS): + sccs get $@ diff --git a/games/adventure/done.c b/games/adventure/done.c new file mode 100644 index 0000000..2bed7ec --- /dev/null +++ b/games/adventure/done.c @@ -0,0 +1,101 @@ +# +/* Re-coding of advent in C: termination routines */ + +static char sccsid[] = " done.c 4.1 82/05/11 "; + + +# include "hdr.h" + +score() /* sort of like 20000 */ +{ register int scor,i; + mxscor=scor=0; + for (i=50; i<=maxtrs; i++) + { if (ptext[i].txtlen==0) continue; + k=12; + if (i==chest) k=14; + if (i>chest) k=16; + if (prop[i]>=0) scor += 2; + if (place[i]==3&&prop[i]==0) scor += k-2; + mxscor += k; + } + scor += (maxdie-numdie)*10; + mxscor += maxdie*10; + if (!(scorng||gaveup)) scor += 4; + mxscor += 4; + if (dflag!=0) scor += 25; + mxscor += 25; + if (closng) scor += 25; + mxscor += 25; + if (closed) + { if (bonus==0) scor += 10; + if (bonus==135) scor += 25; + if (bonus==134) scor += 30; + if (bonus==133) scor += 45; + } + mxscor += 45; + if (place[magzin]==108) scor++; + mxscor++; + scor += 2; + mxscor += 2; + for (i=1; i<=hntmax; i++) + if (hinted[i]) scor -= hints[i][2]; + return(scor); +} + +done(entry) /* entry=1 means goto 13000 */ /* game is over */ +int entry; /* entry=2 means goto 20000 */ /* 3=19000 */ +{ register int i,sc; + if (entry==1) mspeak(1); + if (entry==3) rspeak(136); + printf("\n\n\nYou scored %d out of a ",(sc=score())); + printf("possible %d using %d turns.\n",mxscor,turns); + for (i=1; i<=clsses; i++) + if (cval[i]>=sc) + { speak(&ctext[i]); + if (i==clsses-1) + { printf("To achieve the next higher rating"); + printf(" would be a neat trick!\n\n"); + printf("Congratulations!!\n"); + exit(0); + } + k=cval[i]+1-sc; + printf("To achieve the next higher rating, you need"); + printf(" %d more point",k); + if (k==1) printf(".\n"); + else printf("s.\n"); + exit(0); + } + printf("You just went off my scale!!!\n"); + exit(0); +} + + +die(entry) /* label 90 */ +int entry; +{ register int i; + if (entry != 99) + { rspeak(23); + oldlc2=loc; + } + if (closng) /* 99 */ + { rspeak(131); + numdie++; + done(2); + } + yea=yes(81+numdie*2,82+numdie*2,54); + numdie++; + if (numdie==maxdie || !yea) done(2); + place[water]=0; + place[oil]=0; + if (toting(lamp)) prop[lamp]=0; + for (i=100; i>=1; i--) + { if (!toting(i)) continue; + k=oldlc2; + if (i==lamp) k=1; + drop(i,k); + } + loc=3; + oldloc=loc; + return(2000); +} + diff --git a/games/adventure/glorkz b/games/adventure/glorkz new file mode 100644 index 0000000..a57bedd --- /dev/null +++ b/games/adventure/glorkz @@ -0,0 +1,1813 @@ +1 +1 You are standing at the end of a road before a small brick building. +1 Around you is a forest. A small stream flows out of the building and +1 down a gully. +2 You have walked up a hill, still in the forest. The road slopes back +2 down the other side of the hill. There is a building in the distance. +3 You are inside a building, a well house for a large spring. +4 You are in a valley in the forest beside a stream tumbling along a +4 rocky bed. +5 You are in open forest, with a deep valley to one side. +6 You are in open forest near both a valley and a road. +7 At your feet all the water of the stream splashes into a 2-inch slit +7 in the rock. Downstream the streambed is bare rock. +8 You are in a 20-foot depression floored with bare dirt. Set into the +8 dirt is a strong steel grate mounted in concrete. A dry streambed +8 leads into the depression. +9 You are in a small chamber beneath a 3x3 steel grate to the surface. +9 A low crawl over cobbles leads inward to the west. +10 You are crawling over cobbles in a low passage. There is a dim light +10 at the east end of the passage. +11 You are in a debris room filled with stuff washed in from the surface. +11 A low wide passage with cobbles becomes plugged with mud and debris +11 here, but an awkward canyon leads upward and west. A note on the wall +11 says "magic word xyzzy". +12 You are in an awkward sloping east/west canyon. +13 You are in a splendid chamber thirty feet high. The walls are frozen +13 rivers of orange stone. An awkward canyon and a good passage exit +13 From east and west sides of the chamber. +14 At your feet is a small pit breathing traces of white mist. An east +14 passage ends here except for a small crack leading on. +15 You are at one end of a vast hall stretching forward out of sight to +15 the west. There are openings to either side. Nearby, a wide stone +15 staircase leads downward. The hall is filled with wisps of white mist +15 swaying to and fro almost as if alive. A cold wind blows up the +15 staircase. There is a passage at the top of a dome behind you. +16 The crack is far too small for you to follow. +17 You are on the east bank of a fissure slicing clear across the hall. +17 The mist is quite thick here, and the fissure is too wide to jump. +18 This is a low room with a crude note on the wall. The note says, +18 "You won't get it up the steps". +19 You are in the hall of the mountain king, with passages off in all +19 directions. +20 You are at the bottom of the pit with a broken neck. +21 You didn't make it. +22 The dome is unclimbable. +23 You are at the west end of the twopit room. There is a large hole in +23 the wall above the pit at this end of the room. +24 You are at the bottom of the eastern pit in the twopit room. There is +24 a small pool of oil in one corner of the pit. +25 You are at the bottom of the western pit in the twopit room. There is +25 a large hole in the wall about 25 feet above you. +26 You clamber up the plant and scurry through the hole at the top. +27 You are on the west side of the fissure in the hall of mists. +28 You are in a low n/s passage at a hole in the floor. The hole goes +28 down to an e/w passage. +29 You are in the south side chamber. +30 You are in the west side chamber of the hall of the mountain king. +30 A passage continues west and up here. +31 >$< +32 You can't get by the snake. +33 You are in a large room, with a passage to the south, a passage to the +33 west, and a wall of broken rock to the east. There is a large "y2" on +33 A rock in the room's center. +34 You are in a jumble of rock, with cracks everywhere. +35 You're at a low window overlooking a huge pit, which extends up out of +35 sight. A floor is indistinctly visible over 50 feet below. Traces of +35 White mist cover the floor of the pit, becoming thicker to the right. +35 Marks in the dust around the window would seem to indicate that +35 someone has been here recently. Directly across the pit from you and +35 25 Feet away there is a similar window looking into a lighted room. A +35 shadowy figure can be seen there peering back at you. +36 You are in a dirty broken passage. To the east is a crawl. To the +36 west is a large passage. Above you is a hole to another passage. +37 You are on the brink of a small clean climbable pit. A crawl leads +37 west. +38 You are in the bottom of a small pit with a little stream, which +38 Enters and exits through tiny slits. +39 You are in a large room full of dusty rocks. There is a big hole in +39 the floor. There are cracks everywhere, and a passage leading east. +40 You have crawled through a very low wide passage parallel to and north +40 of the hall of mists. +41 You are at the west end of hall of mists. A low wide crawl continues +41 west and another goes north. To the south is a little passage 6 feet +41 Off the floor. +42 You are in a maze of twisty little passages, all alike. +43 You are in a maze of twisty little passages, all alike. +44 You are in a maze of twisty little passages, all alike. +45 You are in a maze of twisty little passages, all alike. +46 Dead end +47 Dead end +48 Dead end +49 You are in a maze of twisty little passages, all alike. +50 You are in a maze of twisty little passages, all alike. +51 You are in a maze of twisty little passages, all alike. +52 You are in a maze of twisty little passages, all alike. +53 You are in a maze of twisty little passages, all alike. +54 Dead end +55 You are in a maze of twisty little passages, all alike. +56 Dead end +57 You are on the brink of a thirty foot pit with a massive orange column +57 down one wall. You could climb down here but you could not get back +57 up. The maze continues at this level. +58 Dead end +59 You have crawled through a very low wide passage parallel to and north +59 of the hall of mists. +60 You are at the east end of a very long hall apparently without side +60 chambers. To the east a low wide crawl slants up. To the north a +60 round two foot hole slants down. +61 You are at the west end of a very long featureless hall. The hall +61 joins up with a narrow north/south passage. +62 You are at a crossover of a high n/s passage and a low e/w one. +63 Dead end +64 You are at a complex junction. A low hands and knees passage from the +64 north joins a higher crawl from the east to make a walking passage +64 going west. There is also a large room above. The air is damp here. +65 You are in bedquilt, a long east/west passage with holes everywhere. +65 To explore at random select north, south, up, or down. +66 You are in a room whose walls resemble swiss cheese. Obvious passages +66 go west, east, ne, and nw. Part of the room is occupied by a large +66 bedrock block. +67 You are at the east end of the twopit room. The floor here is +67 littered with thin rock slabs, which make it easy to descend the pits. +67 There is a path here bypassing the pits to connect passages from east +67 and west. There are holes all over, but the only big one is on the +67 wall directly over the west pit where you can't get to it. +68 You are in a large low circular chamber whose floor is an immense slab +68 fallen from the ceiling (slab room). East and west there once were +68 large passages, but they are now filled with boulders. Low small +68 passages go north and south, and the south one quickly bends west +68 around the boulders. +69 You are in a secret n/s canyon above a large room. +70 You are in a secret n/s canyon above a sizable passage. +71 You are in a secret canyon at a junction of three canyons, bearing +71 north, south, and se. The north one is as tall as the other two +71 combined. +72 You are in a large low room. Crawls lead north, se, and sw. +73 Dead end crawl. +74 You are in a secret canyon which here runs e/w. It crosses over a +74 very tight canyon 15 feet below. If you go down you may not be able +74 to get back up. +75 You are at a wide place in a very tight n/s canyon. +76 The canyon here becomes too tight to go further south. +77 You are in a tall e/w canyon. A low tight crawl goes 3 feet north and +77 seems to open up. +78 The canyon runs into a mass of boulders -- dead end. +79 The stream flows out through a pair of 1 foot diameter sewer pipes. +79 It would be advisable to use the exit. +80 You are in a maze of twisty little passages, all alike. +81 Dead end +82 Dead end +83 You are in a maze of twisty little passages, all alike. +84 You are in a maze of twisty little passages, all alike. +85 Dead end +86 Dead end +87 You are in a maze of twisty little passages, all alike. +88 You are in a long, narrow corridor stretching out of sight to the +88 west. At the eastern end is a hole through which you can see a +88 profusion of leaves. +89 There is nothing here to climb. Use "up" or "out" to leave the pit. +90 You have climbed up the plant and out of the pit. +91 You are at the top of a steep incline above a large room. You could +91 climb down here, but you would not be able to climb up. There is a +91 passage leading back to the north. +92 You are in the giant room. The ceiling here is too high up for your +92 lamp to show it. Cavernous passages lead east, north, and south. On +92 the west wall is scrawled the inscription, "fee fie foe foo" [sic]. +93 The passage here is blocked by a recent cave-in. +94 You are at one end of an immense north/south passage. +95 You are in a magnificent cavern with a rushing stream, which cascades +95 over a sparkling waterfall into a roaring whirlpool which disappears +95 through a hole in the floor. Passages exit to the south and west. +96 You are in the soft room. The walls are covered with heavy curtains, +96 the floor with a thick pile carpet. Moss covers the ceiling. +97 This is the oriental room. Ancient oriental cave drawings cover the +97 walls. A gently sloping passage leads upward to the north, another +97 passage leads se, and a hands and knees crawl leads west. +98 You are following a wide path around the outer edge of a large cavern. +98 Far below, through a heavy white mist, strange splashing noises can be +98 heard. The mist rises up through a fissure in the ceiling. The path +98 exits to the south and west. +99 You are in an alcove. A small nw path seems to widen after a short +99 distance. An extremely tight tunnel leads east. It looks like a very +99 tight squeeze. An eerie light can be seen at the other end. +100 You're in a small chamber lit by an eerie green light. An extremely +100 narrow tunnel exits to the west. A dark corridor leads ne. +101 You're in the dark-room. A corridor leading south is the only exit. +102 You are in an arched hall. A coral passage once continued up and east +102 from here, but is now blocked by debris. The air smells of sea water. +103 You're in a large room carved out of sedimentary rock. The floor and +103 walls are littered with bits of shells imbedded in the stone. A +103 shallow passage proceeds downward, and a somewhat steeper one leads +103 up. A low hands and knees passage enters from the south. +104 You are in a long sloping corridor with ragged sharp walls. +105 You are in a cul-de-sac about eight feet across. +106 You are in an anteroom leading to a large passage to the east. Small +106 passages go west and up. The remnants of recent digging are evident. +106 A sign in midair here says "Cave under construction beyond this point. +106 Proceed at own risk. [Witt construction company]" +107 You are in a maze of twisty little passages, all different. +108 You are at Witt's end. Passages lead off in *all* directions. +109 You are in a north/south canyon about 25 feet across. The floor is +109 covered by white mist seeping in from the north. The walls extend +109 upward for well over 100 feet. Suspended from some unseen point far +109 above you, an enormous two-sided mirror is hanging parallel to and +109 Midway between the canyon walls. (The mirror is obviously provided +109 for the use of the dwarves, who as you know, are extremely vain.) A +109 Small window can be seen in either wall, some fifty feet up. +110 You're at a low window overlooking a huge pit, which extends up out of +110 sight. A floor is indistinctly visible over 50 feet below. Traces of +110 white mist cover the floor of the pit, becoming thicker to the left. +110 Marks in the dust around the window would seem to indicate that +110 someone has been here recently. Directly across the pit from you and +110 25 Feet away there is a similar window looking into a lighted room. A +110 shadowy figure can be seen there peering back at you. +111 A large stalactite extends from the roof and almost reaches the floor +111 below. You could climb down it, and jump from it to the floor, but +111 having done so you would be unable to reach it to climb back up. +112 You are in a little maze of twisting passages, all different. +113 You are at the edge of a large underground reservoir. An opaque cloud +113 of white mist fills the room and rises rapidly upward. The lake is +113 fed by a stream, which tumbles out of a hole in the wall about 10 feet +113 overhead and splashes noisily into the water somewhere within the +113 Mist. The only passage goes back toward the south. +114 Dead end +115 You are at the northeast end of an immense room, even larger than the +115 giant room. It appears to be a repository for the "adventure" +115 program. Massive torches far overhead bathe the room with smoky +115 yellow light. Scattered about you can be seen a pile of bottles (all +115 of them empty), a nursery of young beanstalks murmuring quietly, a bed +115 of oysters, a bundle of black rods with rusty stars on their ends, and +115 a collection of brass lanterns. Off to one side a great many dwarves +115 are sleeping on the floor, snoring loudly. A sign nearby reads: "Do +115 not disturb the dwarves!" An immense mirror is hanging against one +115 wall, and stretches to the other end of the room, where various other +115 sundry objects can be glimpsed dimly in the distance. +116 You are at the southwest end of the repository. To one side is a pit +116 full of fierce green snakes. On the other side is a row of small +116 wicker cages, each of which contains a little sulking bird. In one +116 corner is a bundle of black rods with rusty marks on their ends. A +116 large number of velvet pillows are scattered about on the floor. A +116 vast mirror stretches off to the northeast. At your feet is a large +116 steel grate, next to which is a sign which reads, "Treasure vault. +116 Keys in main office." +117 You are on one side of a large, deep chasm. A heavy white mist rising +117 up from below obscures all view of the far side. A sw path leads away +117 from the chasm into a winding corridor. +118 You are in a long winding corridor sloping out of sight in both +118 directions. +119 You are in a secret canyon which exits to the north and east. +120 You are in a secret canyon which exits to the north and east. +121 You are in a secret canyon which exits to the north and east. +122 You are on the far side of the chasm. A ne path leads away from the +122 chasm on this side. +123 You're in a long east/west corridor. A faint rumbling noise can be +123 heard in the distance. +124 The path forks here. The left fork leads northeast. A dull rumbling +124 seems to get louder in that direction. The right fork leads southeast +124 down a gentle slope. The main corridor enters from the west. +125 The walls are quite warm here. From the north can be heard a steady +125 roar, so loud that the entire cave seems to be trembling. Another +125 passage leads south, and a low crawl goes east. +126 You are on the edge of a breath-taking view. Far below you is an +126 active volcano, from which great gouts of molten lava come surging +126 out, cascading back down into the depths. The glowing rock fills the +126 farthest reaches of the cavern with a blood-red glare, giving every- +126 thing an eerie, macabre appearance. The air is filled with flickering +126 sparks of ash and a heavy smell of brimstone. The walls are hot to +126 the touch, and the thundering of the volcano drowns out all other +126 sounds. Embedded in the jagged roof far overhead are myriad twisted +126 formations composed of pure white alabaster, which scatter the murky +126 light into sinister apparitions upon the walls. To one side is a deep +126 gorge, filled with a bizarre chaos of tortured rock which seems to +126 have been crafted by the devil himself. An immense river of fire +126 crashes out from the depths of the volcano, burns its way through the +126 gorge, and plummets into a bottomless pit far off to your left. To +126 the right, an immense geyser of blistering steam erupts continuously +126 from a barren island in the center of a sulfurous lake, which bubbles +126 ominously. The far right wall is aflame with an incandescence of its +126 own, which lends an additional infernal splendor to the already +126 hellish scene. A dark, foreboding passage exits to the south. +127 You are in a small chamber filled with large boulders. The walls are +127 very warm, causing the air in the room to be almost stifling from the +127 heat. The only exit is a crawl heading west, through which is coming +127 a low rumbling. +128 You are walking along a gently sloping north/south passage lined with +128 oddly shaped limestone formations. +129 You are standing at the entrance to a large, barren room. A sign +129 posted above the entrance reads: "Caution! Bear in room!" +130 You are inside a barren room. The center of the room is completely +130 empty except for some dust. Marks in the dust lead away toward the +130 far end of the room. The only exit is the way you came in. +131 You are in a maze of twisting little passages, all different. +132 You are in a little maze of twisty passages, all different. +133 You are in a twisting maze of little passages, all different. +134 You are in a twisting little maze of passages, all different. +135 You are in a twisty little maze of passages, all different. +136 You are in a twisty maze of little passages, all different. +137 You are in a little twisty maze of passages, all different. +138 You are in a maze of little twisting passages, all different. +139 You are in a maze of little twisty passages, all different. +140 Dead end +-1 End +2 +1 You're at end of road again. +2 You're at hill in road. +3 You're inside building. +4 You're in valley. +5 You're in forest. +6 You're in forest. +7 You're at slit in streambed. +8 You're outside grate. +9 You're below the grate. +10 You're in cobble crawl. +11 You're in debris room. +13 You're in bird chamber. +14 You're at top of small pit. +15 You're in hall of mists. +17 You're on east bank of fissure. +18 You're in nugget of gold room. +19 You're in hall of mt king. +23 You're at west end of twopit room. +24 You're in east pit. +25 You're in west pit. +33 You're at "y2". +35 You're at window on pit. +36 You're in dirty passage. +39 You're in dusty rock room. +41 You're at west end of hall of mists. +57 You're at brink of pit. +60 You're at east end of long hall. +61 You're at west end of long hall. +64 You're at complex junction. +66 You're in swiss cheese room. +67 You're at east end of twopit room. +68 You're in slab room. +71 You're at junction of three secret canyons. +74 You're in secret e/w canyon above tight canyon. +88 You're in narrow corridor. +91 You're at steep incline above large room. +92 You're in giant room. +95 You're in cavern with waterfall. +96 You're in soft room. +97 You're in oriental room. +98 You're in misty cavern. +99 You're in alcove. +100 You're in plover room. +101 You're in dark-room. +102 You're in arched hall. +103 You're in shell room. +106 You're in anteroom. +108 You're at witt's end. +109 You're in mirror canyon. +110 You're at window on pit. +111 You're at top of stalactite. +113 You're at reservoir. +115 You're at ne end. +116 You're at sw end. +117 You're on sw side of chasm. +118 You're in sloping corridor. +122 You're on ne side of chasm. +123 You're in corridor. +124 You're at fork in path. +125 You're at junction with warm walls. +126 You're at breath-taking view. +127 You're in chamber of boulders. +128 You're in limestone passage. +129 You're in front of barren room. +130 You're in barren room. +-1 +3 +1 2 2 44 29 +1 3 3 12 19 43 +1 4 5 13 14 46 30 +1 5 6 45 43 +1 8 63 +2 1 2 12 7 43 45 30 +2 5 6 45 46 +3 1 3 11 32 44 +3 11 62 +3 33 65 +3 79 5 14 +4 1 4 12 45 +4 5 6 43 44 29 +4 7 5 46 30 +4 8 63 +5 4 9 43 30 +5 50005 6 7 45 +5 6 6 +5 5 44 46 +6 1 2 45 +6 4 9 43 44 30 +6 5 6 46 +7 1 12 +7 4 4 45 +7 5 6 43 44 +7 8 5 15 16 46 +7 595 60 14 30 +8 5 6 43 44 46 +8 1 12 +8 7 4 13 45 +8 303009 3 19 30 +8 593 3 +9 303008 11 29 +9 593 11 +9 10 17 18 19 44 +9 14 31 +9 11 51 +10 9 11 20 21 43 +10 11 19 22 44 51 +10 14 31 +11 303008 63 +11 9 64 +11 10 17 18 23 24 43 +11 12 25 19 29 44 +11 3 62 +11 14 31 +12 303008 63 +12 9 64 +12 11 30 43 51 +12 13 19 29 44 +12 14 31 +13 303008 63 +13 9 64 +13 11 51 +13 12 25 43 +13 14 23 31 44 +14 303008 63 +14 9 64 +14 11 51 +14 13 23 43 +14 150020 30 31 34 +14 15 30 +14 16 33 44 +15 18 36 46 +15 17 7 38 44 +15 19 10 30 45 +15 150022 29 31 34 35 23 43 +15 14 29 +15 34 55 +16 14 1 +17 15 38 43 +17 312596 39 +17 412021 7 +17 412597 41 42 44 69 +17 27 41 +18 15 38 11 45 +19 15 10 29 43 +19 311028 45 36 +19 311029 46 37 +19 311030 44 7 +19 32 45 +19 35074 49 +19 211032 49 +19 74 66 +20 0 1 +21 0 1 +22 15 1 +23 67 43 42 +23 68 44 61 +23 25 30 31 +23 648 52 +24 67 29 11 +25 23 29 11 +25 724031 56 +25 26 56 +26 88 1 +27 312596 39 +27 412021 7 +27 412597 41 42 43 69 +27 17 41 +27 40 45 +27 41 44 +28 19 38 11 46 +28 33 45 55 +28 36 30 52 +29 19 38 11 45 +30 19 38 11 43 +30 62 44 29 +31 524089 1 +31 90 1 +32 19 1 +33 3 65 +33 28 46 +33 34 43 53 54 +33 35 44 +33 159302 71 +33 100 71 +34 33 30 55 +34 15 29 +35 33 43 55 +35 20 39 +36 37 43 17 +36 28 29 52 +36 39 44 +36 65 70 +37 36 44 17 +37 38 30 31 56 +38 37 56 29 11 +38 595 60 14 30 4 5 +39 36 43 23 +39 64 30 52 58 +39 65 70 +40 41 1 +41 42 46 29 23 56 +41 27 43 +41 59 45 +41 60 44 17 +42 41 29 +42 42 45 +42 43 43 +42 45 46 +42 80 44 +43 42 44 +43 44 46 +43 45 43 +44 43 43 +44 48 30 +44 50 46 +44 82 45 +45 42 44 +45 43 45 +45 46 43 +45 47 46 +45 87 29 30 +46 45 44 11 +47 45 43 11 +48 44 29 11 +49 50 43 +49 51 44 +50 44 43 +50 49 44 +50 51 30 +50 52 46 +51 49 44 +51 50 29 +51 52 43 +51 53 46 +52 50 44 +52 51 43 +52 52 46 +52 53 29 +52 55 45 +52 86 30 +53 51 44 +53 52 45 +53 54 46 +54 53 44 11 +55 52 44 +55 55 45 +55 56 30 +55 57 43 +56 55 29 11 +57 13 30 56 +57 55 44 +57 58 46 +57 83 45 +57 84 43 +58 57 43 11 +59 27 1 +60 41 43 29 17 +60 61 44 +60 62 45 30 52 +61 60 43 +61 62 45 +61 100107 46 +62 60 44 +62 63 45 +62 30 43 +62 61 46 +63 62 46 11 +64 39 29 56 59 +64 65 44 70 +64 103 45 74 +64 106 43 +65 64 43 +65 66 44 +65 80556 46 +65 68 61 +65 80556 29 +65 50070 29 +65 39 29 +65 60556 45 +65 75072 45 +65 71 45 +65 80556 30 +65 106 30 +66 65 47 +66 67 44 +66 80556 46 +66 77 25 +66 96 43 +66 50556 50 +66 97 72 +67 66 43 +67 23 44 42 +67 24 30 31 +68 23 46 +68 69 29 56 +68 65 45 +69 68 30 61 +69 331120 46 +69 119 46 +69 109 45 +69 113 75 +70 71 45 +70 65 30 23 +70 111 46 +71 65 48 +71 70 46 +71 110 45 +72 65 70 +72 118 49 +72 73 45 +72 97 48 72 +73 72 46 17 11 +74 19 43 +74 331120 44 +74 121 44 +74 75 30 +75 76 46 +75 77 45 +76 75 45 +77 75 43 +77 78 44 +77 66 45 17 +78 77 46 +79 3 1 +80 42 45 +80 80 44 +80 80 46 +80 81 43 +81 80 44 11 +82 44 46 11 +83 57 46 +83 84 43 +83 85 44 +84 57 45 +84 83 44 +84 114 50 +85 83 43 11 +86 52 29 11 +87 45 29 30 +88 25 30 56 43 +88 20 39 +88 92 44 27 +89 25 1 +90 23 1 +91 95 45 73 23 +91 72 30 56 +92 88 46 +92 93 43 +92 94 45 +93 92 46 27 11 +94 92 46 27 23 +94 309095 45 3 73 +94 611 45 +95 94 46 11 +95 92 27 +95 91 44 +96 66 44 11 +97 66 48 +97 72 44 17 +97 98 29 45 73 +98 97 46 72 +98 99 44 +99 98 50 73 +99 301 43 23 +99 100 43 +100 301 44 23 11 +100 99 44 +100 159302 71 +100 33 71 +100 101 47 22 +101 100 46 71 11 +102 103 30 74 11 +103 102 29 38 +103 104 30 +103 114618 46 +103 115619 46 +103 64 46 +104 103 29 74 +104 105 30 +105 104 29 11 +105 103 74 +106 64 29 +106 65 44 +106 108 43 +107 131 46 +107 132 49 +107 133 47 +107 134 48 +107 135 29 +107 136 50 +107 137 43 +107 138 44 +107 139 45 +107 61 30 +108 95556 43 45 46 47 48 49 50 29 30 +108 106 43 +108 626 44 +109 69 46 +109 113 45 75 +110 71 44 +110 20 39 +111 70 45 +111 40050 30 39 56 +111 50053 30 +111 45 30 +112 131 49 +112 132 45 +112 133 43 +112 134 50 +112 135 48 +112 136 47 +112 137 44 +112 138 30 +112 139 29 +112 140 46 +113 109 46 11 109 +114 84 48 +115 116 49 +116 115 47 +116 593 30 +117 118 49 +117 233660 41 42 69 47 +117 332661 41 +117 303 41 +117 332021 39 +117 596 39 +118 72 30 +118 117 29 +119 69 45 11 +119 653 43 7 +120 69 45 +120 74 43 +121 74 43 11 +121 653 45 7 +122 123 47 +122 233660 41 42 69 49 +122 303 41 +122 596 39 +122 124 77 +122 126 28 +122 129 40 +123 122 44 +123 124 43 77 +123 126 28 +123 129 40 +124 123 44 +124 125 47 36 +124 128 48 37 30 +124 126 28 +124 129 40 +125 124 46 77 +125 126 45 28 +125 127 43 17 +126 125 46 23 11 +126 124 77 +126 610 30 39 +127 125 44 11 17 +127 124 77 +127 126 28 +128 124 45 29 77 +128 129 46 30 40 +128 126 28 +129 128 44 29 +129 124 77 +129 130 43 19 40 3 +129 126 28 +130 129 44 11 +130 124 77 +130 126 28 +131 107 44 +131 132 48 +131 133 50 +131 134 49 +131 135 47 +131 136 29 +131 137 30 +131 138 45 +131 139 46 +131 112 43 +132 107 50 +132 131 29 +132 133 45 +132 134 46 +132 135 44 +132 136 49 +132 137 47 +132 138 43 +132 139 30 +132 112 48 +133 107 29 +133 131 30 +133 132 44 +133 134 47 +133 135 49 +133 136 43 +133 137 45 +133 138 50 +133 139 48 +133 112 46 +134 107 47 +134 131 45 +134 132 50 +134 133 48 +134 135 43 +134 136 30 +134 137 46 +134 138 29 +134 139 44 +134 112 49 +135 107 45 +135 131 48 +135 132 30 +135 133 46 +135 134 43 +135 136 44 +135 137 49 +135 138 47 +135 139 50 +135 112 29 +136 107 43 +136 131 44 +136 132 29 +136 133 49 +136 134 30 +136 135 46 +136 137 50 +136 138 48 +136 139 47 +136 112 45 +137 107 48 +137 131 47 +137 132 46 +137 133 30 +137 134 29 +137 135 50 +137 136 45 +137 138 49 +137 139 43 +137 112 44 +138 107 30 +138 131 43 +138 132 47 +138 133 29 +138 134 44 +138 135 45 +138 136 46 +138 137 48 +138 139 49 +138 112 50 +139 107 49 +139 131 50 +139 132 43 +139 133 44 +139 134 45 +139 135 30 +139 136 48 +139 137 29 +139 138 46 +139 112 47 +140 112 45 11 +-1 +4 +2 road +2 hill +3 enter +4 upstr +5 downs +6 fores +7 forwa +7 conti +7 onwar +8 back +8 retur +8 retre +9 valle +10 stair +11 out +11 outsi +11 exit +11 leave +12 build +12 house +13 gully +14 strea +15 rock +16 bed +17 crawl +18 cobbl +19 inwar +19 insid +19 in +20 surfa +21 null +21 nowhe +22 dark +23 passa +23 tunne +24 low +25 canyo +26 awkwa +27 giant +28 view +29 upwar +29 up +29 u +29 above +29 ascen +30 d +30 downw +30 down +30 desce +31 pit +32 outdo +33 crack +34 steps +35 dome +36 left +37 right +38 hall +39 jump +40 barre +41 over +42 acros +43 east +43 e +44 west +44 w +45 north +45 n +46 south +46 s +47 ne +48 se +49 sw +50 nw +51 debri +52 hole +53 wall +54 broke +55 y2 +56 climb +57 look +57 exami +57 touch +57 descr +58 floor +59 room +60 slit +61 slab +61 slabr +62 xyzzy +63 depre +64 entra +65 plugh +66 secre +67 cave +69 cross +70 bedqu +71 plove +72 orien +73 caver +74 shell +75 reser +76 main +76 offic +77 fork +1001 keys +1001 key +1002 lamp +1002 headl +1002 lante +1003 grate +1004 cage +1005 wand +1005 rod +1006 wand +1006 rod (must be next object after "real" rod) +1007 steps +1008 bird +1009 door +1010 pillo +1010 velve +1011 snake +1012 fissu +1013 table +1014 clam +1015 oyste +1016 magaz +1016 issue +1016 spelu +1016 "spel +1017 dwarf +1017 dwarv +1018 knife +1018 knive +1019 food +1019 ratio +1020 bottl +1020 jar +1021 water +1021 h2o +1022 oil +1023 mirro +1024 plant +1024 beans +1025 plant (must be next object after "real" plant) +1026 stala +1027 shado +1027 figur +1028 axe +1029 drawi +1030 pirat +1031 drago +1032 chasm +1033 troll +1034 troll (must be next object after "real" troll) +1035 bear +1036 messa +1037 volca +1037 geyse (same as volcano) +1038 machi +1038 vendi +1039 batte +1040 carpe +1040 moss +1050 gold +1050 nugge +1051 diamo +1052 silve +1052 bars +1053 jewel +1054 coins +1055 chest +1055 box +1055 treas +1056 eggs +1056 egg +1056 nest +1057 tride +1058 vase +1058 ming +1058 shard +1058 potte +1059 emera +1060 plati +1060 pyram +1061 pearl +1062 rug +1062 persi +1063 spice +1064 chain +2001 carry +2001 take +2001 keep +2001 catch +2001 steal +2001 captu +2001 get +2001 tote +2002 drop +2002 relea +2002 free +2002 disca +2002 dump +2003 say +2003 chant +2003 sing +2003 utter +2003 mumbl +2004 unloc +2004 open +2005 nothi +2006 lock +2006 close +2007 light +2007 on +2008 extin +2008 off +2009 wave +2009 shake +2009 swing +2010 calm +2010 placa +2010 tame +2011 walk +2011 run +2011 trave +2011 go +2011 proce +2011 conti +2011 explo +2011 goto +2011 follo +2011 turn +2012 attac +2012 kill +2012 slay +2012 fight +2012 hit +2012 strik +2013 pour +2014 eat +2014 devou +2015 drink +2016 rub +2017 throw +2017 toss +2018 quit +2019 find +2019 where +2020 inven +2021 feed +2022 fill +2023 blast +2023 deton +2023 ignit +2023 blowu +2024 score +2025 fee +2025 fie +2025 foe +2025 foo +2025 fum +2026 brief +2027 read +2027 perus +2028 break +2028 shatt +2028 smash +2029 wake +2029 distu +2030 suspe +2030 pause +2030 save +2031 hours +3001 fee +3002 fie +3003 foe +3004 foo +3005 fum +3050 sesam +3050 opens +3050 abra +3050 abrac +3050 shaza +3050 hocus +3050 pocus +3051 help +3051 ? +3064 tree +3064 trees +3066 dig +3066 excav +3068 lost +3069 mist +3079 fuck +3139 stop +3142 info +3142 infor +3147 swim +-1 +5 +1 Set of keys +000 There are some keys on the ground here. +2 Brass lantern +000 There is a shiny brass lamp nearby. +100 There is a lamp shining nearby. +3 *Grate +000 The grate is locked. +100 The grate is open. +4 Wicker cage +000 There is a small wicker cage discarded nearby. +5 Black rod +000 A three foot black rod with a rusty star on an end lies nearby. +6 Black rod +000 A three foot black rod with a rusty mark on an end lies nearby. +7 *Steps +000 Rough stone steps lead down the pit. +100 Rough stone steps lead up the dome. +8 Little bird in cage +000 A cheerful little bird is sitting here singing. +100 There is a little bird in the cage. +9 *Rusty door +000 The way north is barred by a massive, rusty, iron door. +100 The way north leads through a massive, rusty, iron door. +10 Velvet pillow +000 A small velvet pillow lies on the floor. +11 *Snake +000 A huge green fierce snake bars the way! +100 >$< (Chased away) +12 *Fissure +000 >$< +100 A crystal bridge now spans the fissure. +200 The crystal bridge has vanished! +13 *Stone tablet +000 A massive stone tablet imbedded in the wall reads: +000 "Congratulations on bringing light into the dark-room!" +14 Giant clam >grunt!< +000 There is an enormous clam here with its shell tightly closed. +15 Giant oyster >groan!< +000 There is an enormous oyster here with its shell tightly closed. +100 Interesting. There seems to be something written on the underside of +100 The oyster. +16 "Spelunker today" +000 There are a few recent issues of "Spelunker today" magazine here. +19 Tasty food +000 There is food here. +20 Small bottle +000 There is a bottle of water here. +100 There is an empty bottle here. +200 There is a bottle of oil here. +21 Water in the bottle +22 Oil in the bottle +23 *Mirror +000 >$< +24 *Plant +000 There is a tiny little plant in the pit, murmuring "water, water, ..." +100 The plant spurts into furious growth for a few seconds. +200 There is a 12-foot-tall beanstalk stretching up out of the pit, +200 Bellowing "water!! water!!" +300 The plant grows explosively, almost filling the bottom of the pit. +400 There is a gigantic beanstalk stretching all the way up to the hole. +500 You've over-watered the plant! It's shriveling up! It's, it's... +25 *Phony plant (seen in twopit room only when tall enough) +000 >$< +100 The top of a 12-foot-tall beanstalk is poking out of the west pit. +200 There is a huge beanstalk growing out of the west pit up to the hole. +26 *Stalactite +000 >$< +27 *Shadowy figure +000 The shadowy figure seems to be trying to attract your attention. +28 Dwarf's axe +000 There is a little axe here. +100 There is a little axe lying beside the bear. +29 *Cave drawings +000 >$< +30 *Pirate +000 >$< +31 *Dragon +000 A huge green fierce dragon bars the way! +100 Congratulations! You have just vanquished a dragon with your bare +100 Hands! (unbelievable, isn't it?) +200 The body of a huge green dead dragon is lying off to one side. +32 *Chasm +000 A rickety wooden bridge extends across the chasm, vanishing into the +000 Mist. A sign posted on the bridge reads, "stop! pay troll!" +100 The wreckage of a bridge (and a dead bear) can be seen at the bottom +100 Of the chasm. +33 *Troll +000 A burly troll stands by the bridge and insists you throw him a +000 Treasure before you may cross. +100 The troll steps out from beneath the bridge and blocks your way. +200 >$< (Chased away) +34 *Phony troll +000 The troll is nowhere to be seen. +35 >$< (Bear uses rtext 141) +000 There is a ferocious cave bear eying you from the far end of the room! +100 There is a gentle cave bear sitting placidly in one corner. +200 There is a contented-looking bear wandering about nearby. +300 >$< (Dead) +36 *Message in second maze +000 There is a message scrawled in the dust in a flowery script, reading: +000 "This is not the maze where the pirate leaves his treasure chest." +37 *Volcano and/or geyser +000 >$< +38 *Vending machine +000 There is a massive vending machine here. The instructions on it read: +000 "Drop coins here to receive fresh batteries." +39 Batteries +000 There are fresh batteries here. +100 Some worn-out batteries have been discarded nearby. +40 *Carpet and/or moss +000 >$< +50 Large gold nugget +000 There is a large sparkling nugget of gold here! +51 Several diamonds +000 There are diamonds here! +52 Bars of silver +000 There are bars of silver here! +53 Precious jewelry +000 There is precious jewelry here! +54 Rare coins +000 There are many coins here! +55 Treasure chest +000 The pirate's treasure chest is here! +56 Golden eggs +000 There is a large nest here, full of golden eggs! +100 The nest of golden eggs has vanished! +200 Done! +57 Jeweled trident +000 There is a jewel-encrusted trident here! +58 Ming vase +000 There is a delicate, precious, ming vase here! +100 The vase is now resting, delicately, on a velvet pillow. +200 The floor is littered with worthless shards of pottery. +300 The ming vase drops with a delicate crash. +59 Egg-sized emerald +000 There is an emerald here the size of a plover's egg! +60 Platinum pyramid +000 There is a platinum pyramid here, 8 inches on a side! +61 Glistening pearl +000 Off to one side lies a glistening pearl! +62 Persian rug +000 There is a persian rug spread out on the floor! +100 The dragon is sprawled out on a persian rug!! +63 Rare spices +000 There are rare spices here! +64 Golden chain +000 There is a golden chain lying in a heap on the floor! +100 The bear is locked to the wall with a golden chain! +200 There is a golden chain locked to the wall! +-1 +6 +1 Somewhere nearby is colossal cave, where others have found fortunes in +1 treasure and gold, though it is rumored that some who enter are never +1 seen again. Magic is said to work in the cave. I will be your eyes +1 and hands. Direct me with commands of 1 or 2 words. I should warn +1 you that I look at only the first five letters of each word, so you'll +1 have to enter "northeast" as "ne" to distinguish it from "north". +1 (Should you get stuck, type "help" for some general hints. For infor- +1 mation on how to end your adventure, etc., type "info".) +1 - - - +1 This program was originally developed by willie crowther. Most of the +1 features of the current program were added by don woods (don @ su-ai). +1 contact don if you have any questions, comments, etc. +1 Address complaints about the unix version to jim @ rand-unix. +2 A little dwarf with a big knife blocks your way. +3 A little dwarf just walked around a corner, saw you, threw a little +3 axe at you which missed, cursed, and ran away. +4 There is a threatening little dwarf in the room with you! +5 One sharp nasty knife is thrown at you! +6 None of them hit you! +7 One of them gets you! +8 A hollow voice says "plugh". +9 There is no way to go that direction. +10 I am unsure how you are facing. Use compass points or nearby objects. +11 I don't know in from out here. Use compass points or name something +11 in the general direction you want to go. +12 I don't know how to apply that word here. +13 I don't understand that! +14 I'm game. Would you care to explain how? +15 Sorry, but I am not allowed to give more detail. I will repeat the +15 long description of your location. +16 It is now pitch dark. If you proceed you will likely fall into a pit. +17 If you prefer, simply type w rather than west. +18 Are you trying to catch the bird? +19 The bird is frightened right now and you cannot catch it no matter +19 what you try. Perhaps you might try later. +20 Are you trying to somehow deal with the snake? +21 You can't kill the snake, or drive it away, or avoid it, or anything +21 like that. There is a way to get by, but you don't have the necessary +21 resources right now. +22 Do you really want to quit now? +23 You fell into a pit and broke every bone in your body! +24 You are already carrying it! +25 You can't be serious! +26 The bird was unafraid when you entered, but as you approach it becomes +26 disturbed and you cannot catch it. +27 You can catch the bird, but you cannot carry it. +28 There is nothing here with a lock! +29 You aren't carrying it! +30 The little bird attacks the green snake, and in an astounding flurry +30 drives the snake away. +31 You have no keys! +32 It has no lock. +33 I don't know how to lock or unlock such a thing. +34 It was already locked. +35 The grate is now locked. +36 The grate is now unlocked. +37 It was already unlocked. +38 You have no source of light. +39 Your lamp is now on. +40 Your lamp is now off. +41 There is no way to get past the bear to unlock the chain, which is +41 probably just as well. +42 Nothing happens. +43 Where? +44 There is nothing here to attack. +45 The little bird is now dead. Its body disappears. +46 Attacking the snake both doesn't work and is very dangerous. +47 You killed a little dwarf. +48 You attack a little dwarf, but he dodges out of the way. +49 With what? Your bare hands? +50 Good try, but that is an old worn-out magic word. +51 I know of places, actions, and things. Most of my vocabulary +51 describes places and is used to move you there. To move, try words +51 like forest, building, downstream, enter, east, west, north, south, +51 up, or down. I know about a few special objects, like a black rod +51 hidden in the cave. These objects can be manipulated using some of +51 the action words that I know. Usually you will need to give both the +51 object and action words (in either order), but sometimes I can infer +51 the object from the verb alone. Some objects also imply verbs; in +51 particular, "inventory" implies "take inventory", which causes me to +51 give you a list of what you're carrying. The objects have side +51 effects; for instance, the rod scares the bird. Usually people having +51 trouble moving just need to try a few more words. Usually people +51 trying unsuccessfully to manipulate an object are attempting something +51 beyond their (or my!) capabilities and should try a completely +51 different tack. To speed the game you can sometimes move long +51 distances with a single word. For example, "building" usually gets +51 you to the building from anywhere above ground except when lost in the +51 forest. Also, note that cave passages turn a lot, and that leaving a +51 room to the north does not guarantee entering the next from the south. +51 Good luck! +52 It misses! +53 It gets you! +54 OK +55 You can't unlock the keys. +56 You have crawled around in some little holes and wound up back in the +56 main passage. +57 I don't know where the cave is, but hereabouts no stream can run on +57 the surface for long. I would try the stream. +58 I need more detailed instructions to do that. +59 I can only tell you what you see as you move about and manipulate +59 things. I cannot tell you where remote things are. +60 I don't know that word. +61 What? +62 Are you trying to get into the cave? +63 The grate is very solid and has a hardened steel lock. You cannot +63 enter without a key, and there are no keys nearby. I would recommend +63 looking elsewhere for the keys. +64 The trees of the forest are large hardwood oak and maple, with an +64 occasional grove of pine or spruce. There is quite a bit of under- +64 growth, largely birch and ash saplings plus nondescript bushes of +64 various sorts. This time of year visibility is quite restricted by +64 all the leaves, but travel is quite easy if you detour around the +64 spruce and berry bushes. +65 Welcome to adventure!! Would you like instructions? +66 Digging without a shovel is quite impractical. Even with a shovel +66 progress is unlikely. +67 Blasting requires dynamite. +68 I'm as confused as you are. +69 Mist is a white vapor, usually water, seen from time to time in +69 caverns. It can be found anywhere but is frequently a sign of a deep +69 pit leading down to water. +70 Your feet are now wet. +71 I think I just lost my appetite. +72 Thank you, it was delicious! +73 You have taken a drink from the stream. The water tastes strongly of +73 minerals, but is not unpleasant. It is extremely cold. +74 The bottle of water is now empty. +75 Rubbing the electric lamp is not particularly rewarding. Anyway, +75 nothing exciting happens. +76 Peculiar. Nothing unexpected happens. +77 Your bottle is empty and the ground is wet. +78 You can't pour that. +79 Watch it! +80 Which way? +81 Oh dear, you seem to have gotten yourself killed. I might be able to +81 help you out, but i've never really done this before. Do you want me +81 to try to reincarnate you? +82 All right. But don't blame me if something goes wr...... +82 --- Poof!! --- +82 You are engulfed in a cloud of orange smoke. Coughing and gasping, +82 you emerge from the smoke and find.... +83 You clumsy oaf, you've done it again! I don't know how long I can +83 keep this up. Do you want me to try reincarnating you again? +84 Okay, now where did I put my orange smoke?.... >poof!< +84 Everything disappears in a dense cloud of orange smoke. +85 Now you've really done it! I'm out of orange smoke! You don't expect +85 me to do a decent reincarnation without any orange smoke, do you? +86 Okay, if you're so smart, do it yourself! I'm leaving! +90 >>> Messages 81 thru 90 are reserved for "obituaries". <<< +91 Sorry, but I no longer seem to remember how it was you got here. +92 You can't carry anything more. You'll have to drop something first. +93 You can't go through a locked steel grate! +94 I believe what you want is right here with you. +95 You don't fit through a two-inch slit! +96 I respectfully suggest you go across the bridge instead of jumping. +97 There is no way across the fissure. +98 You're not carrying anything. +99 You are currently holding the following: +100 It's not hungry (it's merely pinin' for the fjords). Besides, you +100 have no bird seed. +101 The snake has now devoured your bird. +102 There's nothing here it wants to eat (except perhaps you). +103 You fool, dwarves eat only coal! Now you've made him *really* mad!! +104 You have nothing in which to carry it. +105 Your bottle is already full. +106 There is nothing here with which to fill the bottle. +107 Your bottle is now full of water. +108 Your bottle is now full of oil. +109 You can't fill that. +110 Don't be ridiculous! +111 The door is extremely rusty and refuses to open. +112 The plant indignantly shakes the oil off its leaves and asks, "water?" +113 The hinges are quite thoroughly rusted now and won't budge. +114 The oil has freed up the hinges so that the door will now move, +114 although it requires some effort. +115 The plant has exceptionally deep roots and cannot be pulled free. +116 The dwarves' knives vanish as they strike the walls of the cave. +117 Something you're carrying won't fit through the tunnel with you. +117 You'd best take inventory and drop something. +118 You can't fit this five-foot clam through that little passage! +119 You can't fit this five-foot oyster through that little passage! +120 I advise you to put down the clam before opening it. >strain!< +121 I advise you to put down the oyster before opening it. >wrench!< +122 You don't have anything strong enough to open the clam. +123 You don't have anything strong enough to open the oyster. +124 A glistening pearl falls out of the clam and rolls away. Goodness, +124 this must really be an oyster. (I never was very good at identifying +124 bivalves.) Whatever it is, it has now snapped shut again. +125 The oyster creaks open, revealing nothing but oyster inside. It +125 promptly snaps shut again. +126 You have crawled around in some little holes and found your way +126 blocked by a recent cave-in. You are now back in the main passage. +127 There are faint rustling noises from the darkness behind you. +128 Out from the shadows behind you pounces a bearded pirate! "Har, har," +128 he chortles, "I'll just take all this booty and hide it away with me +128 chest deep in the maze!" He snatches your treasure and vanishes into +128 the gloom. +129 A sepulchral voice reverberating through the cave, says, "Cave closing +129 soon. All adventurers exit immediately through main office." +130 A mysterious recorded voice groans into life and announces: +130 "This exit is closed. Please leave via main office." +131 It looks as though you're dead. Well, seeing as how it's so close to +131 closing time anyway, I think we'll just call it a day. +132 The sepulchral voice entones, "The cave is now closed." As the echoes +132 fade, there is a blinding flash of light (and a small puff of orange +132 Smoke). . . . As your eyes refocus, you look around and find... +133 there is a loud explosion, and a twenty-foot hole appears in the far +133 wall, burying the dwarves in the rubble. You march through the hole +133 and find yourself in the main office, where a cheering band of +133 friendly elves carry the conquering adventurer off into the sunset. +134 There is a loud explosion, and a twenty-foot hole appears in the far +134 wall, burying the snakes in the rubble. A river of molten lava pours +134 in through the hole, destroying everything in its path, including you! +135 There is a loud explosion, and you are suddenly splashed across the +135 walls of the room. +136 The resulting ruckus has awakened the dwarves. There are now several +136 threatening little dwarves in the room with you! Most of them throw +136 knives at you! All of them get you! +137 Oh, leave the poor unhappy bird alone. +138 I daresay whatever you want is around here somewhere. +139 I don't know the word "stop". Use "quit" if you want to give up. +140 You can't get there from here. +141 You are being followed by a very large, tame bear. +142 If you want to end your adventure early, say "quit". To suspend your +142 adventure such that you can continue later, say "suspend" (or "pause" +142 Or "save"). To see what hours the cave is normally open, say "hours". +142 To see how well you're doing, say "score". To get full credit for a +142 treasure, you must have left it safely in the building, though you get +142 partial credit just for locating it. You lose points for getting +142 killed, or for quitting, though the former costs you more. There are +142 also points based on how much (if any) of the cave you've managed to +142 explore; in particular, there is a large bonus just for getting in (to +142 distinguish the beginners from the rest of the pack), and there are +142 other ways to determine whether you've been through some of the more +142 harrowing sections. If you think you've found all the treasures, just +142 keep exploring for a while. If nothing interesting happens, you +142 haven't found them all yet. If something interesting *does* happen, +142 it means you're getting a bonus and have an opportunity to garner many +142 more points in the master's section. I may occasionally offer hints +142 if you seem to be having trouble. If I do, I'll warn you in advance +142 how much it will affect your score to accept the hints. Finally, to +142 save paper, you may specify "brief", which tells me never to repeat +142 the full description of a place unless you explicitly ask me to. +143 Do you indeed wish to quit now? +144 There is nothing here with which to fill the vase. +145 The sudden change in temperature has delicately shattered the vase. +146 It is beyond your power to do that. +147 I don't know how. +148 It is too far up for you to reach. +149 You killed a little dwarf. The body vanishes in a cloud of greasy +149 black smoke. +150 The shell is very strong and is impervious to attack. +151 What's the matter, can't you read? Now you'd best start over. +152 The axe bounces harmlessly off the dragon's thick scales. +153 The dragon looks rather nasty. You'd best not try to get by. +154 The little bird attacks the green dragon, and in an astounding flurry +154 gets burnt to a cinder. The ashes blow away. +155 On what? +156 Okay, from now on i'll only describe a place in full the first time +156 you come to it. To get the full description, say "look". +157 Trolls are close relatives with the rocks and have skin as tough as +157 that of a rhinoceros. The troll fends off your blows effortlessly. +158 The troll deftly catches the axe, examines it carefully, and tosses it +158 back, declaring, "good workmanship, but it's not valuable enough." +159 The troll catches your treasure and scurries away out of sight. +160 The troll refuses to let you cross. +161 There is no longer any way across the chasm. +162 Just as you reach the other side, the bridge buckles beneath the +162 weight of the bear, which was still following you around. You +162 scrabble desperately for support, but as the bridge collapses you +162 stumble back and fall into the chasm. +163 The bear lumbers toward the troll, who lets out a startled shriek and +163 scurries away. The bear soon gives up the pursuit and wanders back. +164 The axe misses and lands near the bear where you can't get at it. +165 With what? Your bare hands? Against *his* bear hands?? +166 The bear is confused; he only wants to be your friend. +167 For crying out loud, the poor thing is already dead! +168 The bear eagerly wolfs down your food, after which he seems to calm +168 Down considerably and even becomes rather friendly. +169 The bear is still chained to the wall. +170 The chain is still locked. +171 The chain is now unlocked. +172 The chain is now locked. +173 There is nothing here to which the chain can be locked. +174 There is nothing here to eat. +175 Do you want the hint? +176 Do you need help getting out of the maze? +177 You can make the passages look less alike by dropping things. +178 Are you trying to explore beyond the plover room? +179 There is a way to explore that region without having to worry about +179 falling into a pit. None of the objects available is immediately +179 useful in discovering the secret. +180 Do you need help getting out of here? +181 Don't go west. +182 Gluttony is not one of the troll's vices. Avarice, however, is. +183 Your lamp is getting dim. You'd best start wrapping this up, unless +183 You can find some fresh batteries. I seem to recall there's a vending +183 machine in the maze. Bring some coins with you. +184 Your lamp has run out of power. +185 There's not much point in wandering around out here, and you can't +185 explore the cave without a lamp. So let's just call it a day. +186 There are faint rustling noises from the darkness behind you. As you +186 turn toward them, the beam of your lamp falls across a bearded pirate. +186 He is carrying a large chest. "Shiver me timbers!" he cries, "I've +186 been spotted! I'd best hie meself off to the maze to hide me chest!" +186 With that, he vanishes into the gloom. +187 Your lamp is getting dim. You'd best go back for those batteries. +188 Your lamp is getting dim. I'm taking the liberty of replacing the +188 batteries. +189 Your lamp is getting dim, and you're out of spare batteries. You'd +189 best start wrapping this up. +190 I'm afraid the magazine is written in dwarvish. +191 "This is not the maze where the pirate leaves his treasure chest." +192 Hmmm, this looks like a clue, which means it'll cost you 10 points to +192 read it. Should I go ahead and read it anyway? +193 It says, "there is something strange about this place, such that one +193 Of the words i've always known now has a new effect." +194 It says the same thing it did before. +195 I'm afraid I don't understand. +196 "Congratulations on bringing light into the dark-room!" +197 You strike the mirror a resounding blow, whereupon it shatters into a +197 myriad tiny fragments. +198 You have taken the vase and hurled it delicately to the ground. +199 You prod the nearest dwarf, who wakes up grumpily, takes one look at +199 you, curses, and grabs for his axe. +200 Is this acceptable? +201 There's no point in suspending a demonstration game. +-1 +7 +1 3 +2 3 +3 8 9 +4 10 +5 11 +6 0 +7 14 15 +8 13 +9 94 -1 +10 96 +11 19 -1 +12 17 27 +13 101 -1 +14 103 +15 0 +16 106 +17 0 -1 +18 0 +19 3 +20 3 +21 0 +22 0 +23 109 -1 +24 25 -1 +25 23 67 +26 111 -1 +27 35 110 +28 0 +29 97 -1 +30 0 -1 +31 119 121 +32 117 122 +33 117 122 +34 0 0 +35 130 -1 +36 0 -1 +37 126 -1 +38 140 -1 +39 0 +40 96 -1 +50 18 +51 27 +52 28 +53 29 +54 30 +55 0 +56 92 +57 95 +58 97 +59 100 +60 101 +61 0 +62 119 121 +63 127 +64 130 -1 +-1 +8 +1 24 +2 29 +3 0 +4 33 +5 0 +6 33 +7 38 +8 38 +9 42 +10 14 +11 43 +12 110 +13 29 +14 110 +15 73 +16 75 +17 29 +18 13 +19 59 +20 59 +21 174 +22 109 +23 67 +24 13 +25 147 +26 155 +27 195 +28 146 +29 110 +30 13 +31 13 +-1 +9 +0 1 2 3 4 5 6 7 8 9 10 +0 100 115 116 126 +2 1 3 4 7 38 95 113 24 +1 24 +3 46 47 48 54 56 58 82 85 86 +3 122 123 124 125 126 127 128 129 130 +4 8 +5 13 +6 19 +7 42 43 44 45 46 47 48 49 50 51 +7 52 53 54 55 56 80 81 82 86 87 +8 99 100 101 +9 108 +-1 +10 +35 You are obviously a rank amateur. Better luck next time. +100 Your score qualifies you as a novice class adventurer. +130 You have achieved the rating: "experienced adventurer". +200 You may now consider yourself a "seasoned adventurer". +250 You have reached "junior master" status. +300 Your score puts you in master adventurer class c. +330 Your score puts you in master adventurer class b. +349 Your score puts you in master adventurer class a. +9999 All of adventuredom gives tribute to you, adventurer grandmaster! +-1 +11 +2 9999 10 0 0 +3 9999 5 0 0 +4 4 2 62 63 +5 5 2 18 19 +6 8 2 20 21 +7 75 4 176 177 +8 25 5 178 179 +9 20 3 180 181 +-1 +12 +1 A large cloud of green smoke appears in front of you. It clears away +1 to reveal a tall wizard, clothed in grey. He fixes you with a steely +1 glare and declares, "this adventure has lasted too long." With that +1 he makes a single pass over you with his hands, and everything around +1 You fades away into a grey nothingness. +2 Even wizards have to wait longer than that! +3 I'm terribly sorry, but colossal cave is closed. Our hours are: +4 Only wizards are permitted within the cave right now. +5 We do allow visitors to make short explorations during our off hours. +5 Would you like to do that? +6 Colossal cave is open to regular adventurers at the following hours: +7 Very well. +8 Only a wizard may continue an adventure this soon. +9 I suggest you resume your adventure at a later time. +10 Do you wish to see the hours? +11 Do you wish to change the hours? +12 New magic word (null to leave unchanged): +13 New magic number (null to leave unchanged): +14 Do you wish to change the message of the day? +15 Okay. You can save this version now. +16 Are you a wizard? +17 Prove it! Say the magic word! +18 That is not what I thought it was. Do you know what I thought it was? +19 Oh dear, you really *are* a wizard! Sorry to have bothered you . . . +20 Foo, you are nothing but a charlatan! +21 New hours specified by defining "prime time". Give only the hour +21 (E.g. 14, not 14:00 or 2pm). Enter a negative number after last pair. +22 New hours for colossal cave: +23 Limit lines to 70 chars. End with null line. +24 Line too long, retype: +25 Not enough room for another line. Ending message here. +26 Do you wish to (re)schedule the next holiday? +27 To begin how many days from today? +28 To last how many days (zero if no holiday)? +29 To be called what (up to 20 characters)? +30 Too small! Assuming minimum value (45 minutes). +31 Break out of this and save your core-image. +32 Be sure to save your core-image... +-1 +0 + glorkz 4.1 82/05/11 diff --git a/games/adventure/hdr.h b/games/adventure/hdr.h new file mode 100644 index 0000000..3aa2499 --- /dev/null +++ b/games/adventure/hdr.h @@ -0,0 +1,119 @@ +# +/* ADVENTURE -- Jim Gillogly, Jul 1977 + * This program is a re-write of ADVENT, written in FORTRAN mostly by + * Don Woods of SAIL. In most places it is as nearly identical to the + * original as possible given the language and word-size differences. + * A few places, such as the message arrays and travel arrays were changed + * to reflect the smaller core size and word size. The labels of the + * original are reflected in this version, so that the comments of the + * fortran are still applicable here. + * + * The data file distributed with the fortran source is assumed to be called + * "glorkz" in the directory where the program is first run. + */ + +static char hdr_sccsid[] = " hdr.h 4.1 82/05/11 "; + +/* hdr.h */ +/* hdr.h: included by c advent files */ + +extern int setup; /* changed by savec & init */ +int datfd; /* message file descriptor */ +int delhit; +int yea; + +#define TAB 011 +#define LF 012 +#define FLUSHLINE while (getchar()!='\n') +#define FLUSHLF while (next()!=LF) + +int loc,newloc,oldloc,oldlc2,wzdark,SHORT,gaveup,kq,k,k2; +char *wd1,*wd2; /* the complete words */ +int verb,obj,spk; +extern int blklin; +int saved,savet,mxscor,latncy; + +#define MAXSTR 20 /* max length of user's words */ + +#define HTSIZE 512 /* max number of vocab words */ +struct hashtab /* hash table for vocabulary */ +{ int val; /* word type &index (ktab) */ + char *atab; /* pointer to actual string */ +} voc[HTSIZE]; + +#define DATFILE "glorkz" /* all the original msgs */ +#define TMPFILE "tmp.foo.baz" /* just the text msgs */ + + +struct text +{ int seekadr; /* DATFILE must be < 2**16 */ + int txtlen; /* length of msg starting here */ +}; + +#define RTXSIZ 205 +struct text rtext[RTXSIZ]; /* random text messages */ + +#define MAGSIZ 35 +struct text mtext[MAGSIZ]; /* magic messages */ + +int clsses; +#define CLSMAX 12 +struct text ctext[CLSMAX]; /* classes of adventurer */ +int cval[CLSMAX]; + +struct text ptext[101]; /* object descriptions */ + +#define LOCSIZ 141 /* number of locations */ +struct text ltext[LOCSIZ]; /* long loc description */ +struct text stext[LOCSIZ]; /* short loc descriptions */ + +struct travlist /* direcs & conditions of travel*/ +{ struct travlist *next; /* ptr to next list entry */ + int conditions; /* m in writeup (newloc / 1000) */ + int tloc; /* n in writeup (newloc % 1000) */ + int tverb; /* the verb that takes you there*/ +} *travel[LOCSIZ],*tkk; /* travel is closer to keys(...)*/ + +int atloc[LOCSIZ]; + +int plac[101]; /* initial object placement */ +int fixd[101],fixed[101]; /* location fixed? */ + +int actspk[35]; /* rtext msg for verb */ + +int cond[LOCSIZ]; /* various condition bits */ + +extern int setbit[16]; /* bit defn masks 1,2,4,... */ + +int hntmax; +int hints[20][5]; /* info on hints */ +int hinted[20],hintlc[20]; + +int place[101], prop[101],link[201]; +int abb[LOCSIZ]; + +int maxtrs,tally,tally2; /* treasure values */ + +#define FALSE 0 +#define TRUE 1 + +int keys,lamp,grate,cage,rod,rod2,steps,/* mnemonics */ + bird,door,pillow,snake,fissur,tablet,clam,oyster,magzin, + dwarf,knife,food,bottle,water,oil,plant,plant2,axe,mirror,dragon, + chasm,troll,troll2,bear,messag,vend,batter, + nugget,coins,chest,eggs,tridnt,vase,emrald,pyram,pearl,rug,chain, + spices, + back,look,cave,null,entrnc,dprssn, + say,lock,throw,find,invent; + +int chloc,chloc2,dseen[7],dloc[7], /* dwarf stuff */ + odloc[7],dflag,daltlc; + +int tk[21],stick,dtotal,attack; +int turns,lmwarn,iwest,knfloc,detail, /* various flags & counters */ + abbnum,maxdie,numdie,holdng,dkill,foobar,bonus,clock1,clock2, + saved,closng,panic,closed,scorng; + +int demo,newloc,limit; + +char *malloc(); diff --git a/games/adventure/init.c b/games/adventure/init.c new file mode 100644 index 0000000..44773a8 --- /dev/null +++ b/games/adventure/init.c @@ -0,0 +1,181 @@ +# +/* Re-coding of advent in C: data initialization */ + +static char sccsid[] = " init.c 4.1 82/05/11 "; + +# include "hdr.h" + +int blklin = TRUE; +int setup = 0; + +int setbit[16] = {1,2,4,010,020,040,0100,0200,0400,01000,02000,04000, + 010000,020000,040000,0100000}; + + +init(command) /* everything for 1st time run */ +char *command; /* command we were called with */ +{ int stat,adfd; + rdata(); /* read data from orig. file */ + linkdata(); + poof(); + setup=1; /* indicate that data is in */ + if (confirm("got the data. save as \"advent\"? ")) + { if (save(command,"advent")<0) /* save core image */ + { printf("Save failed\n"); + exit(0); + } + } + else exit(0); + printf("Save succeeded. Adding messages.\n"); + adfd=open("advent",1); + lseek(adfd,0L,2); + close(datfd); + if (fork()==0) /* child process */ + { close(1); + dup(adfd); /* output goes to advent file */ + execl("/bin/cat","cat",TMPFILE,0); + printf("unable to find /bin/cat\n"); + } + wait(&stat); + unlink(TMPFILE); + printf("Advent is ready.\n"); + exit(0); +} + + +linkdata() /* secondary data manipulation */ +{ register int i,j; + /* array linkages */ + for (i=1; i<=LOCSIZ; i++) + if (ltext[i].seekadr!=0 && travel[i] != 0) + if ((travel[i]->tverb)==1) cond[i]=2; + for (j=100; j>0; j--) + if (fixd[j]>0) + { drop(j+100,fixd[j]); + drop(j,plac[j]); + } + for (j=100; j>0; j--) + { fixed[j]=fixd[j]; + if (plac[j]!=0 && fixd[j]<=0) drop(j,plac[j]); + } + + maxtrs=79; + tally=0; + tally2=0; + + for (i=50; i<=maxtrs; i++) + { if (ptext[i].seekadr!=0) prop[i] = -1; + tally -= prop[i]; + } + + /* define mnemonics */ + keys=vocab("keys",1); + lamp=vocab("lamp",1); + grate=vocab("grate",1); + cage=vocab("cage",1); + rod=vocab("rod",1); + rod2=rod+1; + steps=vocab("steps",1); + bird=vocab("bird",1); + door=vocab("door",1); + pillow=vocab("pillow",1); + snake=vocab("snake",1); + fissur=vocab("fissu",1); + tablet=vocab("table",1); + clam=vocab("clam",1); + oyster=vocab("oyster",1); + magzin=vocab("magaz",1); + dwarf=vocab("dwarf",1); + knife=vocab("knife",1); + food=vocab("food",1); + bottle=vocab("bottl",1); + water=vocab("water",1); + oil=vocab("oil",1); + plant=vocab("plant",1); + plant2=plant+1; + axe=vocab("axe",1); + mirror=vocab("mirro",1); + dragon=vocab("drago",1); + chasm=vocab("chasm",1); + troll=vocab("troll",1); + troll2=troll+1; + bear=vocab("bear",1); + messag=vocab("messa",1); + vend=vocab("vendi",1); + batter=vocab("batte",1); + + nugget=vocab("gold",1); + coins=vocab("coins",1); + chest=vocab("chest",1); + eggs=vocab("eggs",1); + tridnt=vocab("tride",1); + vase=vocab("vase",1); + emrald=vocab("emera",1); + pyram=vocab("pyram",1); + pearl=vocab("pearl",1); + rug=vocab("rug",1); + chain=vocab("chain",1); + + back=vocab("back",0); + look=vocab("look",0); + cave=vocab("cave",0); + null=vocab("null",0); + entrnc=vocab("entra",0); + dprssn=vocab("depre",0); + + say=vocab("say",2); + lock=vocab("lock",2); + throw=vocab("throw",2); + find=vocab("find",2); + invent=vocab("inven",2); + /* initialize dwarves */ + chloc=114; + chloc2=140; + for (i=1; i<=6; i++) + dseen[i]=FALSE; + dflag=0; + dloc[1]=19; + dloc[2]=27; + dloc[3]=33; + dloc[4]=44; + dloc[5]=64; + dloc[6]=chloc; + daltlc=18; + + /* random flags & ctrs */ + turns=0; + lmwarn=FALSE; + iwest=0; + knfloc=0; + detail=0; + abbnum=5; + for (i=0; i<=4; i++) + if (rtext[2*i+81].seekadr!=0) maxdie=i+1; + numdie=holdng=dkill=foobar=bonus=0; + clock1=30; + clock2=50; + saved=0; + closng=panic=closed=scorng=FALSE; +} + + + +trapdel() /* come here if he hits a del */ +{ delhit++; /* main checks, treats as QUIT */ + signal(2,trapdel); /* catch subsequent DELs */ +} + + +startup() +{ int tvec[2]; + demo=start(0); + time(tvec); + srand(tvec[1]|1); /* random odd seed */ +/* srand(371); */ /* non-random seed */ + hinted[3]=yes(65,1,0); + newloc=1; + setup=3; + limit=330; + if (hinted[3]) limit=1000; /* better batteries if instrucs */ +} + diff --git a/games/adventure/io.c b/games/adventure/io.c new file mode 100644 index 0000000..0411ffe --- /dev/null +++ b/games/adventure/io.c @@ -0,0 +1,501 @@ +# +/* Re-coding of advent in C: file i/o and user i/o */ + +static char sccsid[] = " io.c 4.1 82/05/11 "; + +#include "hdr.h" +#include + + +getin(wrd1,wrd2) /* get command from user */ +char **wrd1,**wrd2; /* no prompt, usually */ +{ register char *s; + static char wd1buf[MAXSTR],wd2buf[MAXSTR]; + int first, numch; + + *wrd1=wd1buf; /* return ptr to internal string*/ + *wrd2=wd2buf; + wd2buf[0]=0; /* in case it isn't set here */ + for (s=wd1buf, first=1, numch=0;;) + { if ((*s=getchar())>='A' && *s <='Z') *s = *s - ('A' -'a'); + /* convert to upper case */ + if (feof(stdin)) { + clearerr(stdin); + continue; + } + switch(*s) /* start reading from user */ + { case '\n': + *s=0; + return; + case ' ': + if (s==wd1buf||s==wd2buf) /* initial blank */ + continue; + *s=0; + if (first) /* finished 1st wd; start 2nd */ + { first=numch=0; + s=wd2buf; + break; + } + else /* finished 2nd word */ + { FLUSHLINE; + *s=0; + return; + } + default: + if (++numch>=MAXSTR) /* string too long */ + { printf("Give me a break!!\n"); + wd1buf[0]=wd2buf[0]=0; + FLUSHLINE; + return; + } + s++; + } + } +} + + +confirm(mesg) /* confirm irreversible action */ +char *mesg; +{ register int result; + printf("%s",mesg); /* tell him what he did */ + if (getchar()=='y') /* was his first letter a 'y'? */ + result=1; + else result=0; + FLUSHLINE; + return(result); +} + +yes(x,y,z) /* confirm with rspeak */ +int x,y,z; +{ register int result; + register char ch; + for (;;) + { rspeak(x); /* tell him what we want*/ + if ((ch=getchar())=='y') + result=TRUE; + else if (ch=='n') result=FALSE; + FLUSHLINE; + if (ch=='y'|| ch=='n') break; + printf("Please answer the question.\n"); + } + if (result==TRUE) rspeak(y); + if (result==FALSE) rspeak(z); + return(result); +} + +yesm(x,y,z) /* confirm with mspeak */ +int x,y,z; +{ register int result; + register char ch; + for (;;) + { mspeak(x); /* tell him what we want*/ + if ((ch=getchar())=='y') + result=TRUE; + else if (ch=='n') result=FALSE; + FLUSHLINE; + if (ch=='y'|| ch=='n') break; + printf("Please answer the question.\n"); + } + if (result==TRUE) mspeak(y); + if (result==FALSE) mspeak(z); + return(result); +} + +FILE *inbuf,*outbuf; + +int adrptr; /* current seek adr ptr */ +int outsw = 0; /* putting stuff to data file? */ + +char iotape[] = "Ax3F'tt$8hqer*hnGKrX:!l"; +char *tape = iotape; /* pointer to encryption tape */ + +next() /* next char frm file, bump adr */ +{ register char ch,t; + adrptr++; /* seek address in file */ + ch=getc(inbuf); + if (outsw) /* putting data in tmp file */ + { if (*tape==0) tape=iotape; /* rewind encryption tape */ + putc(ch ^ *tape++,outbuf); /* encrypt & output char */ + } + return(ch); +} + + +char breakch; /* tell which char ended rnum */ + + +rdata() /* read all data from orig file */ +{ register int sect; + register char ch; + if ((inbuf=fopen(DATFILE,"r"))==NULL) /* all the data lives in here */ + { printf("Cannot open data file %s\n",DATFILE); + exit(0); + } + if ((outbuf=fopen(TMPFILE,"w"))==NULL) /* the text lines will go here */ + { printf("Cannot create output file %s\n",TMPFILE); + exit(0); + } + setup=clsses=1; + for (;;) /* read data sections */ + { sect=next()-'0'; /* 1st digit of section number */ + printf("Section %c",sect+'0'); + if ((ch=next())!=LF) /* is there a second digit? */ + { FLUSHLF; + putchar(ch); + sect=10*sect+ch-'0'; + } + putchar('\n'); + switch(sect) + { case 0: /* finished reading database */ + fclose(inbuf); + fclose(outbuf); + return; + case 1: /* long form descriptions */ + rdesc(1); + break; + case 2: /* short form descriptions */ + rdesc(2); + break; + case 3: /* travel table */ + rtrav(); break; + case 4: /* vocabulary */ + rvoc(); + break; + case 5: /* object descriptions */ + rdesc(5); + break; + case 6: /* arbitrary messages */ + rdesc(6); + break; + case 7: /* object locations */ + rlocs(); break; + case 8: /* action defaults */ + rdflt(); break; + case 9: /* liquid assets */ + rliq(); break; + case 10: /* class messages */ + rdesc(10); + break; + case 11: /* hints */ + rhints(); break; + case 12: /* magic messages */ + rdesc(12); + break; + default: + printf("Invalid data section number: %d\n",sect); + for (;;) putchar(next()); + } + if (breakch!=LF) /* routines return after "-1" */ + FLUSHLF; + } +} + +char nbf[12]; + + +rnum() /* read initial location num */ +{ register char *s; + tape = iotape; /* restart encryption tape */ + for (s=nbf,*s=0;; s++) + if ((*s=next())==TAB || *s=='\n' || *s==LF) + break; + breakch= *s; /* save char for rtrav() */ + *s=0; /* got the number as ascii */ + if (nbf[0]=='-') return(-1); /* end of data */ + return(atoi(nbf)); /* convert it to integer */ +} + +int seekhere = 1; /* initial seek for output file */ + +rdesc(sect) /* read description-format msgs */ +int sect; +{ register char *s,*t; + register int locc; + int seekstart, maystart, adrstart; + char *entry; + outsw=1; /* these msgs go into tmp file */ + if (sect==1) putc('X',outbuf); /* so seekadr > 0 */ + adrptr=0; + for (oldloc= -1, seekstart=seekhere;;) + { maystart=adrptr; /* maybe starting new entry */ + if ((locc=rnum())!=oldloc && oldloc>=0 /* finished msg */ + && ! (sect==5 && (locc==0 || locc>=100)))/* unless sect 5*/ + { switch(sect) /* now put it into right table */ + { case 1: /* long descriptions */ + ltext[oldloc].seekadr=seekhere; + ltext[oldloc].txtlen=maystart-seekstart; + break; + case 2: /* short descriptions */ + stext[oldloc].seekadr=seekhere; + stext[oldloc].txtlen=maystart-seekstart; + break; + case 5: /* object descriptions */ + ptext[oldloc].seekadr=seekhere; + ptext[oldloc].txtlen=maystart-seekstart; + break; + case 6: /* random messages */ + if (oldloc>RTXSIZ) + { printf("Too many random msgs\n"); + exit(0); + } + rtext[oldloc].seekadr=seekhere; + rtext[oldloc].txtlen=maystart-seekstart; + break; + case 10: /* class messages */ + ctext[clsses].seekadr=seekhere; + ctext[clsses].txtlen=maystart-seekstart; + cval[clsses++]=oldloc; + break; + case 12: /* magic messages */ + if (oldloc>MAGSIZ) + { printf("Too many magic msgs\n"); + exit(0); + } + mtext[oldloc].seekadr=seekhere; + mtext[oldloc].txtlen=maystart-seekstart; + break; + default: + printf("rdesc called with bad section\n"); + exit(0); + } + seekhere += maystart-seekstart; + } + if (locc<0) + { outsw=0; /* turn off output */ + seekhere += 3; /* -1 */ + return; + } + if (sect!=5 || (locc>0 && locc<100)) + { if (oldloc!=locc)/* starting a new message */ + seekstart=maystart; + oldloc=locc; + } + FLUSHLF; /* scan the line */ + } +} + + +rtrav() /* read travel table */ +{ register int locc; + register struct travlist *t; + register char *s; + char buf[12]; + int len,m,n,entries; + for (oldloc= -1;;) /* get another line */ + { if ((locc=rnum())!=oldloc && oldloc>=0) /* end of entry */ + { + t->next = 0; /* terminate the old entry */ + /* printf("%d:%d entries\n",oldloc,entries); */ + /* twrite(oldloc); */ + } + if (locc== -1) return; + if (locc!=oldloc) /* getting a new entry */ + { t=travel[locc]=(struct travlist *) malloc(sizeof (struct travlist)); + /* printf("New travel list for %d\n",locc); */ + entries=0; + oldloc=locc; + } + for (s=buf;; *s++) /* get the newloc number /ASCII */ + if ((*s=next())==TAB || *s==LF) break; + *s=0; + len=length(buf)-1; /* quad long number handling */ + /* printf("Newloc: %s (%d chars)\n",buf,len); */ + if (len<4) /* no "m" conditions */ + { m=0; + n=atoi(buf); /* newloc mod 1000 = newloc */ + } + else /* a long integer */ + { n=atoi(buf+len-3); + buf[len-3]=0; /* terminate newloc/1000 */ + m=atoi(buf); + } + while (breakch!=LF) /* only do one line at a time */ + { if (entries++) t=t->next=(struct travlist *) malloc(sizeof (struct travlist)); + t->tverb=rnum();/* get verb from the file */ + t->tloc=n; /* table entry mod 1000 */ + t->conditions=m;/* table entry / 1000 */ + /* printf("entry %d for %d\n",entries,locc); */ + } + } +} + + +twrite(loq) /* travel options from this loc */ +int loq; +{ register struct travlist *t; + printf("If"); + speak(<ext[loq]); + printf("then\n"); + for (t=travel[loq]; t!=0; t=t->next) + { printf("verb %d takes you to ",t->tverb); + if (t->tloc<=300) + speak(<ext[t->tloc]); + else if (t->tloc<=500) + printf("special code %d\n",t->tloc-300); + else + rspeak(t->tloc-500); + printf("under conditions %d\n",t->conditions); + } +} + + + +rvoc() +{ register char *s; /* read the vocabulary */ + register int index; + char buf[6]; + for (;;) + { index=rnum(); + if (index<0) break; + for (s=buf,*s=0;; s++) /* get the word */ + if ((*s=next())==TAB || *s=='\n' || *s==LF + || *s==' ') break; + /* terminate word with newline, LF, tab, blank */ + if (*s!='\n' && *s!=LF) FLUSHLF; /* can be comments */ + *s=0; + /* printf("\"%s\"=%d\n",buf,index);*/ + vocab(buf,-2,index); + } +/* prht(); */ +} + + +rlocs() /* initial object locations */ +{ for (;;) + { if ((obj=rnum())<0) break; + plac[obj]=rnum(); /* initial loc for this obj */ + if (breakch==TAB) /* there's another entry */ + fixd[obj]=rnum(); + else fixd[obj]=0; + } +} + +rdflt() /* default verb messages */ +{ for (;;) + { if ((verb=rnum())<0) break; + actspk[verb]=rnum(); + } +} + +rliq() /* liquid assets &c: cond bits */ +{ register int bitnum; + for (;;) /* read new bit list */ + { if ((bitnum=rnum())<0) break; + for (;;) /* read locs for bits */ + { cond[rnum()] |= setbit[bitnum]; + if (breakch==LF) break; + } + } +} + +rhints() +{ register int hintnum,i; + hntmax=0; + for (;;) + { if ((hintnum=rnum())<0) break; + for (i=1; i<5; i++) + hints[hintnum][i]=rnum(); + if (hintnum>hntmax) hntmax=hintnum; + } +} + + +rspeak(msg) +int msg; +{ if (msg!=0) speak(&rtext[msg]); +} + + +mspeak(msg) +int msg; +{ if (msg!=0) speak(&mtext[msg]); +} + + +doseek(offset) /* do 2 seeks to get to right place in the file */ +unsigned offset; +{ + extern unsigned filesize; + lseek(datfd,(long)offset+(long)filesize, 0); +#ifdef notdef + blockadr=chadr=0; + if (offset<0) /* right place is offset+filesize*/ + { blockadr += 64; /* take off 32768 bytes */ + chadr += offset+32768; /* & make them into 64 blocks */ + } + else chadr += offset; + if (filesize<0) /* data starts after file */ + { blockadr += 64; /* which may also be large */ + chadr += filesize+32768; + } + else chadr += filesize; + if (chadr<0) /* and the leftovers may be lge */ + { blockadr += 64; + chadr += 32768; + } + seek(datfd,blockadr,3); /* get within 32767 */ + seek(datfd,chadr,1); /* then the rest of the way */ +#endif +} + + +speak(msg) /* read, decrypt, and print a message (not ptext) */ +struct text *msg;/* msg is a pointer to seek address and length of mess */ +{ register char *s,nonfirst; + register char *tbuf; + doseek(msg->seekadr); + if ((tbuf=(char *) malloc(msg->txtlen+1))<0) bug(109); + read(datfd,tbuf,msg->txtlen); + s=tbuf; + nonfirst=0; + while (s-tbuftxtlen) /* read a line at a time */ + { tape=iotape; /* restart decryption tape */ + while ((*s++^*tape++)!=TAB); /* read past loc num */ + /* assume tape is longer than location number */ + /* plus the lookahead put together */ + if ((*s^*tape)=='>' && + (*(s+1)^*(tape+1))=='$' && + (*(s+2)^*(tape+2))=='<') break; + if (blklin&&!nonfirst++) putchar('\n'); + do + { if (*tape==0) tape=iotape;/* rewind decryp tape */ + putchar(*s^*tape); + } while ((*s++^*tape++)!=LF); /* better end with LF */ + } + free(tbuf); +} + + +pspeak(msg,skip) /* read, decrypt an print a ptext message */ +int msg; /* msg is the number of all the p msgs for this place */ +int skip; /* assumes object 1 doesn't have prop 1, obj 2 no prop 2 &c*/ +{ register char *s,nonfirst; + register char *tbuf; + char *numst; + int lstr; + doseek(ptext[msg].seekadr); + if ((tbuf=(char *) malloc((lstr=ptext[msg].txtlen)+1))<0) bug(108); + read(datfd,tbuf,lstr); + s=tbuf; + nonfirst=0; + while (s-tbuf=0) + { while ((*s++^*tape++)!=LF) /* flush the line */ + if (*tape==0) tape=iotape; + continue; + } + if ((*s^*tape)=='>' && (*(s+1)^*(tape+1))=='$' && + (*(s+2)^*(tape+2))=='<') break; + if (blklin && ! nonfirst++) putchar('\n'); + do + { if (*tape==0) tape=iotape; + putchar(*s^*tape); + } while ((*s++^*tape++)!=LF); /* better end with LF */ + if (skip<0) break; + } + free(tbuf); +} + diff --git a/games/adventure/main.c b/games/adventure/main.c new file mode 100644 index 0000000..c6c8c8b --- /dev/null +++ b/games/adventure/main.c @@ -0,0 +1,532 @@ +/* Re-coding of advent in C: main program */ + +#include "hdr.h" + +static char sccsid[] = " main.c 4.1 82/05/11 "; + +int datfd = -1; +main(argc,argv) +int argc; +char **argv; +{ register int i; + int rval,ll; + struct text *kk; + extern trapdel(); + static reenter; + if ((datfd = getcmd(argv[0])) < 0) { + write(2, "No adventure just now\n", 22); + exit(1); + } + reenter++; + setuid(getuid()); + switch (setup) { + case 0: + init(argv[0]); /* set up initial variables */ + /* NOTREACHED */ + case 1: + startup(); /* prepare for a user */ + signal(2,trapdel); + break; + case -1: /* restarting game : 8305 */ + yea=start(0); + setup=3; + k=null; + goto l8; + default: + printf("Your forged file dissappears in a puff of greasy black smoke! (poof)\n"); + unlink(argv[0]); + exit(1); + } + + for (;;) /* main command loop (label 2) */ + { if (newloc<9 && newloc!=0 && closng) + { rspeak(130); /* if closing leave only by */ + newloc=loc; /* main office */ + if (!panic) clock2=15; + panic=TRUE; + } + + rval=fdwarf(); /* dwarf stuff */ + if (rval==99) die(99); + + l2000: if (loc==0) die(99); /* label 2000 */ + kk = &stext[loc]; + if ((abb[loc]%abbnum)==0 || kk->seekadr==0) + kk = <ext[loc]; + if (!forced(loc) && dark(0)) + { if (wzdark && pct(35)) + { die(90); + goto l2000; + } + kk = &rtext[16]; + } + l2001: if (toting(bear)) rspeak(141); /* 2001 */ + speak(kk); + k=1; + if (forced(loc)) + goto l8; + if (loc==33 && pct(25)&&!closng) rspeak(8); + if (!dark(0)) + { abb[loc]++; + for (i=atloc[loc]; i!=0; i=link[i]) /*2004 */ + { obj=i; + if (obj>100) obj -= 100; + if (obj==steps && toting(nugget)) continue; + if (prop[obj]<0) + { if (closed) continue; + prop[obj]=0; + if (obj==rug||obj==chain) + prop[obj]=1; + tally--; + if (tally==tally2 && tally != 0) + if (limit>35) limit=35; + } + kk=(struct text *) prop[obj]; /* 2006 */ + if (obj==steps && loc==fixed[steps])kk=(struct text *)1; + pspeak(obj,kk); + } /* 2008 */ + goto l2012; + l2009: k=54; /* 2009 */ + l2010: spk=k; + l2011: rspeak(spk); + } + l2012: verb=0; /* 2012 */ + obj=0; + l2600: checkhints(); /* to 2600-2602 */ + if (closed) + { if (prop[oyster]<0 && toting(oyster)) + pspeak(oyster,1); + for (i=1; i<100; i++) + if (toting(i)&&prop[i]<0) /*2604 */ + prop[i] = -1-prop[i]; + } + wzdark=dark(0); /* 2605 */ + if (knfloc>0 && knfloc!=loc) knfloc=1; + getin(&wd1,&wd2); + if (delhit) /* user typed a DEL */ + { delhit=0; /* reset counter */ + copystr("quit",wd1); /* pretend he's quitting*/ + *wd2=0; + } + l2608: if ((foobar = -foobar)>0) foobar=0; /* 2608 */ + /* should check here for "magic mode" */ + turns++; + if (demo && turns>=SHORT) done(1); /* to 13000 */ + + if (verb==say && *wd2!=0) verb=0; + if (verb==say) + goto l4090; + if (tally==0 && loc>=15 && loc!=33) clock1--; + if (clock1==0) + { closing(); /* to 10000 */ + goto l19999; + } + if (clock1<0) clock2--; + if (clock2==0) + { caveclose(); /* to 11000 */ + continue; /* back to 2 */ + } + if (prop[lamp]==1) limit--; + if (limit<=30 && here(batter) && prop[batter]==0 + && here(lamp)) + { rspeak(188); /* 12000 */ + prop[batter]=1; + if (toting(batter)) drop(batter,loc); + limit=limit+2500; + lmwarn=FALSE; + goto l19999; + } + if (limit==0) + { limit = -1; /* 12400 */ + prop[lamp]=0; + rspeak(184); + goto l19999; + } + if (limit<0&&loc<=8) + { rspeak(185); /* 12600 */ + gaveup=TRUE; + done(2); /* to 20000 */ + } + if (limit<=30) + { if (lmwarn|| !here(lamp)) goto l19999; /*12200*/ + lmwarn=TRUE; + spk=187; + if (place[batter]==0) spk=183; + if (prop[batter]==1) spk=189; + rspeak(spk); + } + l19999: k=43; + if (liqloc(loc)==water) k=70; + if (weq(wd1,"enter") && + (weq(wd2,"strea")||weq(wd2,"water"))) + goto l2010; + if (weq(wd1,"enter") && *wd2!=0) goto l2800; + if ((!weq(wd1,"water")&&!weq(wd1,"oil")) + || (!weq(wd2,"plant")&&!weq(wd2,"door"))) + goto l2610; + if (at(vocab(wd2,1))) copystr("pour",wd2); + l2610: if (weq(wd1,"west")) + if (++iwest==10) rspeak(17); + l2630: i=vocab(wd1,-1); + if (i== -1) + { spk=60; /* 3000 */ + if (pct(20)) spk=61; + if (pct(20)) spk=13; + rspeak(spk); + goto l2600; + } + k=i%1000; + kq=i/1000+1; + switch(kq) + { case 1: goto l8; + case 2: goto l5000; + case 3: goto l4000; + case 4: goto l2010; + default: + printf("Error 22\n"); + exit(0); + } + + l8: + switch(march()) + { case 2: continue; /* i.e. goto l2 */ + case 99: + switch(die(99)) + { case 2000: goto l2000; + default: bug(111); + } + default: bug(110); + } + + l2800: copystr(wd2,wd1); + *wd2=0; + goto l2610; + + l4000: verb=k; + spk=actspk[verb]; + if (*wd2!=0 && verb!=say) goto l2800; + if (verb==say) obj= *wd2; + if (obj!=0) goto l4090; + l4080: + switch(verb) + { case 1: /* take = 8010 */ + if (atloc[loc]==0||link[atloc[loc]]!=0) goto l8000; + for (i=1; i<=5; i++) + if (dloc[i]==loc&&dflag>=2) goto l8000; + obj=atloc[loc]; + goto l9010; + case 2: case 3: case 9: /* 8000 : drop,say,wave */ + case 10: case 16: case 17: /* calm,rub,toss */ + case 19: case 21: case 28: /* find,feed,break */ + case 29: /* wake */ + l8000: printf("%s what?\n",wd1); + obj=0; + goto l2600; + case 4: case 6: /* 8040 open,lock */ + spk=28; + if (here(clam)) obj=clam; + if (here(oyster)) obj=oyster; + if (at(door)) obj=door; + if (at(grate)) obj=grate; + if (obj!=0 && here(chain)) goto l8000; + if (here(chain)) obj=chain; + if (obj==0) goto l2011; + goto l9040; + case 5: goto l2009; /* nothing */ + case 7: goto l9070; /* on */ + case 8: goto l9080; /* off */ + case 11: goto l8000; /* walk */ + case 12: goto l9120; /* kill */ + case 13: goto l9130; /* pour */ + case 14: /* eat: 8140 */ + if (!here(food)) goto l8000; + l8142: dstroy(food); + spk=72; + goto l2011; + case 15: goto l9150; /* drink */ + case 18: /* quit: 8180 */ + gaveup=yes(22,54,54); + if (gaveup) done(2); /* 8185 */ + goto l2012; + case 20: /* invent=8200 */ + spk=98; + for (i=1; i<=100; i++) + { if (i!=bear && toting(i)) + { if (spk==98) rspeak(99); + blklin=FALSE; + pspeak(i,-1); + blklin=TRUE; + spk=0; + } + } + if (toting(bear)) spk=141; + goto l2011; + case 22: goto l9220; /* fill */ + case 23: goto l9230; /* blast */ + case 24: /* score: 8240 */ + scorng=TRUE; + printf("If you were to quit now, you would score"); + printf(" %d out of a possible ",score()); + printf("%d.",mxscor); + scorng=FALSE; + gaveup=yes(143,54,54); + if (gaveup) done(2); + goto l2012; + case 25: /* foo: 8250 */ + k=vocab(wd1,3); + spk=42; + if (foobar==1-k) goto l8252; + if (foobar!=0) spk=151; + goto l2011; + l8252: foobar=k; + if (k!=4) goto l2009; + foobar=0; + if (place[eggs]==plac[eggs] + ||(toting(eggs)&&loc==plac[eggs])) goto l2011; + if (place[eggs]==0&&place[troll]==0&&prop[troll]==0) + prop[troll]=1; + k=2; + if (here(eggs)) k=1; + if (loc==plac[eggs]) k=0; + move(eggs,plac[eggs]); + pspeak(eggs,k); + goto l2012; + case 26: /* brief=8260 */ + spk=156; + abbnum=10000; + detail=3; + goto l2011; + case 27: /* read=8270 */ + if (here(magzin)) obj=magzin; + if (here(tablet)) obj=obj*100+tablet; + if (here(messag)) obj=obj*100+messag; + if (closed&&toting(oyster)) obj=oyster; + if (obj>100||obj==0||dark(0)) goto l8000; + goto l9270; + case 30: /* suspend=8300 */ + spk=201; + if (demo) goto l2011; + printf("I can suspend your adventure for you so"); + printf(" you can resume later, but\n"); + printf("you will have to wait at least"); + printf(" %d minutes before continuing.",latncy); + if (!yes(200,54,54)) goto l2012; + datime(&saved,&savet); + setup = -1; + ciao(argv[0]); + continue; + case 31: /* hours=8310 */ + printf("Colossal cave is closed 9am-5pm Mon "); + printf("through Fri except holidays.\n"); + goto l2012; + default: bug(23); + } + + l4090: + switch(verb) + { case 1: /* take = 9010 */ + l9010: switch(trtake()) + { case 2011: goto l2011; + case 9220: goto l9220; + case 2009: goto l2009; + case 2012: goto l2012; + default: bug(102); + } + l9020: case 2: /* drop = 9020 */ + switch(trdrop()) + { case 2011: goto l2011; + case 19000: done(3); + case 2012: goto l2012; + default: bug(105); + } + l9030: case 3: + switch(trsay()) + { case 2012: goto l2012; + case 2630: goto l2630; + default: bug(107); + } + l9040: case 4: case 6: /* open, close */ + switch(tropen()) + { case 2011: goto l2011; + case 2010: goto l2010; + default: bug(106); + } + case 5: goto l2009; /* nothing */ + case 7: /* on 9070 */ + l9070: if (!here(lamp)) goto l2011; + spk=184; + if (limit<0) goto l2011; + prop[lamp]=1; + rspeak(39); + if (wzdark) goto l2000; + goto l2012; + + case 8: /* off */ + l9080: if (!here(lamp)) goto l2011; + prop[lamp]=0; + rspeak(40); + if (dark(0)) rspeak(16); + goto l2012; + + case 9: /* wave */ + if ((!toting(obj))&&(obj!=rod||!toting(rod2))) + spk=29; + if (obj!=rod||!at(fissur)||!toting(obj)||closng) + goto l2011; + prop[fissur]=1-prop[fissur]; + pspeak(fissur,2-prop[fissur]); + goto l2012; + case 10: case 11: case 18: /* calm, walk, quit */ + case 24: case 25: case 26: /* score, foo, brief */ + case 30: case 31: /* suspend, hours */ + goto l2011; + l9120: case 12: /* kill */ + switch(trkill()) + { case 8000: goto l8000; + case 8: goto l8; + case 2011: goto l2011; + case 2608: goto l2608; + case 19000: done(3); + default: bug(112); + } + l9130: case 13: /* pour */ + if (obj==bottle||obj==0) obj=liq(0); + if (obj==0) goto l8000; + if (!toting(obj)) goto l2011; + spk=78; + if (obj!=oil&&obj!=water) goto l2011; + prop[bottle]=1; + place[obj]=0; + spk=77; + if (!(at(plant)||at(door))) goto l2011; + if (at(door)) + { prop[door]=0; /* 9132 */ + if (obj==oil) prop[door]=1; + spk=113+prop[door]; + goto l2011; + } + spk=112; + if (obj!=water) goto l2011; + pspeak(plant,prop[plant]+1); + prop[plant]=(prop[plant]+2)% 6; + prop[plant2]=prop[plant]/2; + k=null; + goto l8; + case 14: /* 9140 - eat */ + if (obj==food) goto l8142; + if (obj==bird||obj==snake||obj==clam||obj==oyster + ||obj==dwarf||obj==dragon||obj==troll + ||obj==bear) spk=71; + goto l2011; + l9150: case 15: /* 9150 - drink */ + if (obj==0&&liqloc(loc)!=water&&(liq(0)!=water + ||!here(bottle))) goto l8000; + if (obj!=0&&obj!=water) spk=110; + if (spk==110||liq(0)!=water||!here(bottle)) + goto l2011; + prop[bottle]=1; + place[water]=0; + spk=74; + goto l2011; + case 16: /* 9160: rub */ + if (obj!=lamp) spk=76; + goto l2011; + case 17: /* 9170: throw */ + switch(trtoss()) + { case 2011: goto l2011; + case 9020: goto l9020; + case 9120: goto l9120; + case 8: goto l8; + case 9210: goto l9210; + default: bug(113); + } + case 19: case 20: /* 9190: find, invent */ + if (at(obj)||(liq(0)==obj&&at(bottle)) + ||k==liqloc(loc)) spk=94; + for (i=1; i<=5; i++) + if (dloc[i]==loc&&dflag>=2&&obj==dwarf) + spk=94; + if (closed) spk=138; + if (toting(obj)) spk=24; + goto l2011; + l9210: case 21: /* feed */ + switch(trfeed()) + { case 2011: goto l2011; + default: bug(114); + } + l9220: case 22: /* fill */ + switch(trfill()) + { case 2011: goto l2011; + case 8000: goto l8000; + case 9020: goto l9020; + default: bug(115); + } + l9230: case 23: /* blast */ + if (prop[rod2]<0||!closed) goto l2011; + bonus=133; + if (loc==115) bonus=134; + if (here(rod2)) bonus=135; + rspeak(bonus); + done(2); + l9270: case 27: /* read */ + if (dark(0)) goto l5190; + if (obj==magzin) spk=190; + if (obj==tablet) spk=196; + if (obj==messag) spk=191; + if (obj==oyster&&hinted[2]&&toting(oyster)) spk=194; + if (obj!=oyster||hinted[2]||!toting(oyster) + ||!closed) goto l2011; + hinted[2]=yes(192,193,54); + goto l2012; + l9280: case 28: /* break */ + if (obj==mirror) spk=148; + if (obj==vase&&prop[vase]==0) + { spk=198; + if (toting(vase)) drop(vase,loc); + prop[vase]=2; + fixed[vase]= -1; + goto l2011; + } + if (obj!=mirror||!closed) goto l2011; + rspeak(197); + done(3); + + l9290: case 29: /* wake */ + if (obj!=dwarf||!closed) goto l2011; + rspeak(199); + done(3); + + default: bug(24); + } + + l5000: + obj=k; + if (fixed[k]!=loc && !here(k)) goto l5100; + l5010: if (*wd2!=0) goto l2800; + if (verb!=0) goto l4090; + printf("What do you want to do with the %s?\n",wd1); + goto l2600; + l5100: if (k!=grate) goto l5110; + if (loc==1||loc==4||loc==7) k=dprssn; + if (loc>9&&loc<15) k=entrnc; + if (k!=grate) goto l8; + l5110: if (k!=dwarf) goto l5120; + for (i=1; i<=5; i++) + if (dloc[i]==loc&&dflag>=2) goto l5010; + l5120: if ((liq(0)==k&&here(bottle))||k==liqloc(loc)) goto l5010; + if (obj!=plant||!at(plant2)||prop[plant2]==0) goto l5130; + obj=plant2; + goto l5010; + l5130: if (obj!=knife||knfloc!=loc) goto l5140; + knfloc = -1; + spk=116; + goto l2011; + l5140: if (obj!=rod||!here(rod2)) goto l5190; + obj=rod2; + goto l5010; + l5190: if ((verb==find||verb==invent)&&*wd2==0) goto l5010; + printf("I see no %s here\n",wd1); + goto l2012; + } +} + diff --git a/games/adventure/okplay.c b/games/adventure/okplay.c new file mode 100644 index 0000000..a1141e7 --- /dev/null +++ b/games/adventure/okplay.c @@ -0,0 +1,64 @@ +static char sccsid[] = " okplay.c 4.1 82/05/11 "; + +main(argc, argv) +int argc; char *argv[]; +{ + argv[argc] = 0; + okplay(); + if (argc == 1) + advmotd(); + execv("/usr/games/lib/adventure", argv); + write(2, "No adventure just now\n", 22); + exit(1); +} + +okplay() +{ + int tvec[2]; + register struct local { + int seconds,minutes,hours,daymo,month,year,daywk,dayyr,dst; + } *local; + + return; + time(tvec); + local = localtime(tvec); + local->month++; + if (local->daywk == 6||local->daywk == 0) + return; + if (local->hours>=9&&local->hours<18) + if (!holiday(local->month, local->daymo)) + notinprime(); +} + +holiday(mo,da) + int mo,da; +{ + int stbuf[30]; + char *np, *op; + + np = "/usr/games/holiday/XXXX"; + for(op=np;*op;op++); + *--op=(da%10)|'0'; + *--op=(da/10)|'0'; + *--op=(mo%10)|'0'; + *--op=(mo/10)|'0'; + return(stat(np,stbuf) == 0); +} +char notinm[] "No adventure in prime time (M-F 9am-5pm) except on holidays\n"; + +notinprime() +{ + write(2, notinm, sizeof notinm); + exit(1); +} + +advmotd() +{ + char ch; + int fd; + + fd = open("/usr/games/lib/advmotd", 0); + if (fd < 0) return; + while(read(fd,&ch,1) ==1) write(1,&ch,1); + close(fd); +} diff --git a/games/adventure/save.c b/games/adventure/save.c new file mode 100644 index 0000000..fb50dde --- /dev/null +++ b/games/adventure/save.c @@ -0,0 +1,137 @@ +/* save (III) J. Gillogly + * save user core image for restarting + * usage: save(,) + * bugs + * - impure code (i.e. changes in instructions) is not handled + * (but people that do that get what they deserve) + */ + +static char sccsid[] = " save.c 4.1 82/05/11 "; + +#include +int filesize; /* accessible to caller */ + +char *sbrk(); + +save(cmdfile,outfile) /* save core image */ +char *cmdfile,*outfile; +{ register char *c; + register int i,fd; + int fdaout; + struct exec header; + int counter; + char buff[512],pwbuf[120]; + fdaout=getcmd(cmdfile); /* open command wherever it is */ + if (fdaout<0) return(-1); /* can do nothing without text */ + if ((fd=open(outfile,0))>0) /* this restriction is so that */ + { printf("Can't use an existing file\n"); /* we don't try */ + close(fd); /* to write over the commnd file*/ + return(-1); + } + if ((fd=creat(outfile,0755))== -1) + { printf("Cannot create %s\n",outfile); + return(-1); + } + /* can get the text segment from the command that we were + * called with, and change all data from uninitialized to + * initialized. It will start at the top again, so the user + * is responsible for checking whether it was restarted + * could ignore sbrks and breaks for the first pass + */ + read(fdaout,&header,sizeof header);/* get the header */ + header.a_bss = 0; /* no data uninitialized */ + header.a_syms = 0; /* throw away symbol table */ + switch (header.a_magic) /* find data segment */ + { case 0407: /* non sharable code */ + c = (char *) header.a_text;/* data starts right after text */ + header.a_data=sbrk(0)-c; /* current size (incl allocs) */ + break; + case 0410: /* sharable code */ + c = (char *) +#ifdef pdp11 + (header.a_text /* starts after text */ + & 0160000) /* on an 8K boundary */ + + 020000; /* i.e. the next one up */ +#endif +#ifdef vax + (header.a_text /* starts after text */ + & 037777776000) /* on an 1K boundary */ + + 02000; /* i.e. the next one up */ +#endif +#ifdef z8000 + (header.a_text /* starts after text */ + & 0174000) /* on an 2K boundary */ + + 004000; /* i.e. the next one up */ +#endif + header.a_data=sbrk(0)-c; /* current size (incl allocs) */ + break; + case 0411: /* sharable with split i/d */ + c = 0; /* can't reach text */ + header.a_data=(int)sbrk(0);/* current size (incl allocs) */ + break; + case 0413: + c = (char *) header.a_text;/* starts after text */ + lseek(fdaout, 1024L, 0); /* skip unused part of 1st block*/ + } + if (header.a_data<0) /* data area very big */ + return(-1); /* fail for now */ + + filesize=sizeof header+header.a_text+header.a_data; + write(fd,&header,sizeof header); /* make the new header */ + if (header.a_magic==0413) + lseek(fd, 1024L, 0); /* Start on 1K boundary */ + counter=header.a_text; /* size of text */ + while (counter>512) /* copy 512-byte blocks */ + { read(fdaout,buff,512); /* as long as possible */ + write(fd,buff,512); + counter -= 512; + } + read(fdaout,buff,counter); /* then pick up the rest */ + write(fd,buff,counter); + write(fd,c,header.a_data); /* write all data in 1 glob */ + close(fd); +} + +#define NULL 0 + +char *execat(), *getenv(); + +getcmd(command) /* get command name (wherever it is) like shell */ +char *command; +{ + char *pathstr; + register char *cp; + char fname[128]; + int fd; + + if ((pathstr = getenv("PATH")) == NULL) + pathstr = ":/bin:/usr/bin"; + cp = index(command, '/')? "": pathstr; + + do { + cp = execat(cp, command, fname); + if ((fd=open(fname,0))>0) + return(fd); + } while (cp); + + printf("Couldn't open %s\n",command); + 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/games/adventure/subr.c b/games/adventure/subr.c new file mode 100644 index 0000000..d214878 --- /dev/null +++ b/games/adventure/subr.c @@ -0,0 +1,789 @@ +# +/* Re-coding of advent in C: subroutines from main */ + +static char sccsid[] = " subr.c 4.1 82/05/11 "; + +# include "hdr.h" + +/* Statement functions */ +toting(objj) +int objj; +{ if (place[objj] == -1) return(TRUE); + else return(FALSE); +} + +here(objj) +int objj; +{ if (place[objj]==loc || toting(objj)) return(TRUE); + else return(FALSE); +} + +at(objj) +int objj; +{ if (place[objj]==loc || fixed[objj]==loc) return(TRUE); + else return (FALSE); +} + +liq2(pbotl) +int pbotl; +{ return((1-pbotl)*water+(pbotl/2)*(water+oil)); +} + +liq(foo) +{ register int i; + i=prop[bottle]; + if (i>-1-i) return(liq2(i)); + else return(liq2(-1-i)); +} + +liqloc(locc) /* may want to clean this one up a bit */ +int locc; +{ register int i,j,l; + i=cond[locc]/2; + j=((i*2)%8)-5; + l=cond[locc]/4; + l=l%2; + return(liq2(j*l+1)); +} + +bitset(l,n) +int l,n; +{ if (cond[l] & setbit[n]) return(TRUE); + return(FALSE); +} + +forced(locc) +int locc; +{ if (cond[locc]==2) return(TRUE); + return(FALSE); +} + +dark(foo) +{ if ((cond[loc]%2)==0 && (prop[lamp]==0 || !here(lamp))) + return(TRUE); + return(FALSE); +} + +pct(n) +int n; +{ if (ran(100)=15) dflag=1; + return(2000); + } + if (dflag==1) /* 6000 */ + { if (loc<15||pct(95)) return(2000); + dflag=2; + for (i=1; i<=2; i++) + { j=1+ran(5); + if (pct(50)&&saved== -1) dloc[j]=0; /* 6001 */ + } + for (i=1; i<=5; i++) + { if (dloc[i]==loc) dloc[i]=daltlc; + odloc[i]=dloc[i]; /* 6002 */ + } + rspeak(3); + drop(axe,loc); + return(2000); + } + dtotal=attack=stick=0; /* 6010 */ + for (i=1; i<=6; i++) /* loop to 6030 */ + { if (dloc[i]==0) continue; + j=1; + for (kk=travel[dloc[i]]; kk!=0; kk=kk->next) + { newloc=kk->tloc; + if (newloc>300||newloc<15||newloc==odloc[i] + ||(j>1&&newloc==tk[j-1])||j>=20 + ||newloc==dloc[i]||forced(newloc) + ||(i==6&&bitset(newloc,3)) + ||kk->conditions==100) continue; + tk[j++]=newloc; + } + tk[j]=odloc[i]; /* 6016 */ + if (j>=2) j--; + j=1+ran(j); + odloc[i]=dloc[i]; + dloc[i]=tk[j]; + dseen[i]=(dseen[i]&&loc>=15)||(dloc[i]==loc||odloc[i]==loc); + if (!dseen[i]) continue; /* i.e. goto 6030 */ + dloc[i]=loc; + if (i==6) /* pirate's spotted him */ + { if (loc==chloc||prop[chest]>=0) continue; + k=0; + for (j=50; j<=maxtrs; j++) /* loop to 6020 */ + { if (j==pyram&&(loc==plac[pyram] + || loc==plac[emrald])) goto l6020; + if (toting(j)) goto l6022; + l6020: if (here(j)) k=1; + } /* 6020 */ + if (tally==tally2+1 && k==0 && place[chest]==0 + &&here(lamp) && prop[lamp]==1) goto l6025; + if (odloc[6]!=dloc[6]&&pct(20)) + rspeak(127); + continue; /* to 6030 */ + l6022: rspeak(128); + if (place[messag]==0) move(chest,chloc); + move(messag,chloc2); + for (j=50; j<=maxtrs; j++) /* loop to 6023 */ + { if (j==pyram && (loc==plac[pyram] + || loc==plac[emrald])) continue; + if (at(j)&&fixed[j]==0) carry(j,loc); + if (toting(j)) drop(j,chloc); + } + l6024: dloc[6]=odloc[6]=chloc; + dseen[6]=FALSE; + continue; + l6025: rspeak(186); + move(chest,chloc); + move(messag,chloc2); + goto l6024; + } + dtotal++; /* 6027 */ + if (odloc[i]!=dloc[i]) continue; + attack++; + if (knfloc>=0) knfloc=loc; + if (ran(1000)<95*(dflag-2)) stick++; + } /* 6030 */ + if (dtotal==0) return(2000); + if (dtotal!=1) + { printf("There are %d threatening little dwarves ",dtotal); + printf("in the room with you.\n"); + } + else rspeak(4); + if (attack==0) return(2000); + if (dflag==2) dflag=3; + if (saved!= -1) dflag=20; + if (attack!=1) + { printf("%d of them throw knives at you!\n",attack); + k=6; + l82: if (stick<=1) /* 82 */ + { rspeak(k+stick); + if (stick==0) return(2000); + } + else + printf("%d of them get you!\n",stick); /* 83 */ + oldlc2=loc; + return(99); + } + rspeak(5); + k=52; + goto l82; +} + + +march() /* label 8 */ +{ register int ll1,ll2; + + if ((tkk=travel[newloc=loc])==0) bug(26); + if (k==null) return(2); + if (k==cave) /* 40 */ + { if (loc<8) rspeak(57); + if (loc>=8) rspeak(58); + return(2); + } + if (k==look) /* 30 */ + { if (detail++<3) rspeak(15); + wzdark=FALSE; + abb[loc]=0; + return(2); + } + if (k==back) /* 20 */ + { switch(mback()) + { case 2: return(2); + case 9: goto l9; + default: bug(100); + } + } + oldlc2=oldloc; + oldloc=loc; +l9: + for (; tkk!=0; tkk=tkk->next) + if (tkk->tverb==1 || tkk->tverb==k) break; + if (tkk==0) + { badmove(); + return(2); + } +l11: ll1=tkk->conditions; /* 11 */ + ll2=tkk->tloc; + newloc=ll1; /* newloc=conditions */ + k=newloc%100; /* k used for prob */ + if (newloc<=300) + { if (newloc<=100) /* 13 */ + { if (newloc!=0&&!pct(newloc)) goto l12; /* 14 */ + l16: newloc=ll2; /* newloc=location */ + if (newloc<=300) return(2); + if (newloc<=500) + switch(specials())/* to 30000 */ + { case 2: return(2); + case 12: goto l12; + case 99: return(99); + default: bug(101); + } + rspeak(newloc-500); + newloc=loc; + return(2); + } + if (toting(k)||(newloc>200&&at(k))) goto l16; + goto l12; + } + if (prop[k]!=(newloc/100)-3) goto l16; /* newloc still conditions*/ +l12: /* alternative to probability move */ + for (; tkk!=0; tkk=tkk->next) + if (tkk->tloc!=ll2 || tkk->conditions!=ll1) break; + if (tkk==0) bug(25); + goto l11; +} + + + +mback() /* 20 */ +{ register struct travlist *tk2,*j; + register int ll; + if (forced(k=oldloc)) k=oldlc2; /* k=location */ + oldlc2=oldloc; + oldloc=loc; + tk2=0; + if (k==loc) + { rspeak(91); + return(2); + } + for (; tkk!=0; tkk=tkk->next) /* 21 */ + { ll=tkk->tloc; + if (ll==k) + { k=tkk->tverb; /* k back to verb */ + tkk=travel[loc]; + return(9); + } + if (ll<=300) + { j=travel[loc]; + if (forced(ll) && k==j->tloc) tk2=tkk; + } + } + tkk=tk2; /* 23 */ + if (tkk!=0) + { k=tkk->tverb; + tkk=travel[loc]; + return(9); + } + rspeak(140); + return(2); +} + + +specials() /* 30000 */ +{ switch(newloc -= 300) + { case 1: /* 30100 */ + newloc = 99+100-loc; + if (holdng==0||(holdng==1&&toting(emrald))) return(2); + newloc=loc; + rspeak(117); + return(2); + case 2: /* 30200 */ + drop(emrald,loc); + return(12); + case 3: /* to 30300 */ + return(trbridge()); + default: bug(29); + } +} + + +trbridge() /* 30300 */ +{ if (prop[troll]==1) + { pspeak(troll,1); + prop[troll]=0; + move(troll2,0); + move(troll2+100,0); + move(troll,plac[troll]); + move(troll+100,fixd[troll]); + juggle(chasm); + newloc=loc; + return(2); + } + newloc=plac[troll]+fixd[troll]-loc; /* 30310 */ + if (prop[troll]==0) prop[troll]=1; + if (!toting(bear)) return(2); + rspeak(162); + prop[chasm]=1; + prop[troll]=2; + drop(bear,newloc); + fixed[bear] = -1; + prop[bear]=3; + if (prop[spices]<0) tally2++; + oldlc2=newloc; + return(99); +} + + +badmove() /* 20 */ +{ spk=12; + if (k>=43 && k<=50) spk=9; + if (k==29||k==30) spk=9; + if (k==7||k==36||k==37) spk=10; + if (k==11||k==19) spk=11; + if (verb==find||verb==invent) spk=59; + if (k==62||k==65) spk=42; + if (k==17) spk=80; + rspeak(spk); + return(2); +} + +bug(n) +int n; +{ printf("Please tell jim@rand-unix that fatal bug %d happened.\n",n); + exit(0); +} + + +checkhints() /* 2600 &c */ +{ register int hint; + for (hint=4; hint<=hntmax; hint++) + { if (hinted[hint]) continue; + if (!bitset(loc,hint)) hintlc[hint]= -1; + hintlc[hint]++; + if (hintlc[hint]1) goto l40010; + goto l40020; + case 8: /* 40800 */ + if (prop[emrald]!= -1&&prop[pyram]== -1) goto l40010; + goto l40020; + case 9: + goto l40010; /* 40900 */ + default: bug(27); + } + l40010: hintlc[hint]=0; + if (!yes(hints[hint][3],0,54)) continue; + printf("I am prepared to give you a hint, but it will "); + printf("cost you %d points.\n",hints[hint][2]); + hinted[hint]=yes(175,hints[hint][4],54); + l40020: hintlc[hint]=0; + } +} + + +trsay() /* 9030 */ +{ register int i; + if (*wd2!=0) copystr(wd2,wd1); + i=vocab(wd1,-1); + if (i==62||i==65||i==71||i==2025) + { *wd2=0; + obj=0; + return(2630); + } + printf("\nOkay, \"%s\".\n",wd2); + return(2012); +} + + +trtake() /* 9010 */ +{ register int i; + if (toting(obj)) return(2011); /* 9010 */ + spk=25; + if (obj==plant&&prop[plant]<=0) spk=115; + if (obj==bear&&prop[bear]==1) spk=169; + if (obj==chain&&prop[bear]!=0) spk=170; + if (fixed[obj]!=0) return(2011); + if (obj==water||obj==oil) + { if (here(bottle)&&liq(0)==obj) + { obj=bottle; + goto l9017; + } + obj=bottle; + if (toting(bottle)&&prop[bottle]==1) + return(9220); + if (prop[bottle]!=1) spk=105; + if (!toting(bottle)) spk=104; + return(2011); + } +l9017: if (holdng>=7) + { rspeak(92); + return(2012); + } + if (obj==bird) + { if (prop[bird]!=0) goto l9014; + if (toting(rod)) + { rspeak(26); + return(2012); + } + if (!toting(cage)) /* 9013 */ + { rspeak(27); + return(2012); + } + prop[bird]=1; /* 9015 */ + } +l9014: if ((obj==bird||obj==cage)&&prop[bird]!=0) + carry(bird+cage-obj,loc); + carry(obj,loc); + k=liq(0); + if (obj==bottle && k!=0) place[k] = -1; + return(2009); +} + + +dropper() /* 9021 */ +{ k=liq(0); + if (k==obj) obj=bottle; + if (obj==bottle&&k!=0) place[k]=0; + if (obj==cage&&prop[bird]!=0) drop(bird,loc); + if (obj==bird) prop[bird]=0; + drop(obj,loc); + return(2012); +} + +trdrop() /* 9020 */ +{ + if (toting(rod2)&&obj==rod&&!toting(rod)) obj=rod2; + if (!toting(obj)) return(2011); + if (obj==bird&&here(snake)) + { rspeak(30); + if (closed) return(19000); + dstroy(snake); + prop[snake]=1; + return(dropper()); + } + if (obj==coins&&here(vend)) /* 9024 */ + { dstroy(coins); + drop(batter,loc); + pspeak(batter,0); + return(2012); + } + if (obj==bird&&at(dragon)&&prop[dragon]==0) /* 9025 */ + { rspeak(154); + dstroy(bird); + prop[bird]=0; + if (place[snake]==plac[snake]) tally2--; + return(2012); + } + if (obj==bear&&at(troll)) /* 9026 */ + { rspeak(163); + move(troll,0); + move(troll+100,0); + move(troll2,plac[troll]); + move(troll2+100,fixd[troll]); + juggle(chasm); + prop[troll]=2; + return(dropper()); + } + if (obj!=vase||loc==plac[pillow]) /* 9027 */ + { rspeak(54); + return(dropper()); + } + prop[vase]=2; /* 9028 */ + if (at(pillow)) prop[vase]=0; + pspeak(vase,prop[vase]+1); + if (prop[vase]!=0) fixed[vase] = -1; + return(dropper()); +} + + +tropen() /* 9040 */ +{ if (obj==clam||obj==oyster) + { k=0; /* 9046 */ + if (obj==oyster) k=1; + spk=124+k; + if (toting(obj)) spk=120+k; + if (!toting(tridnt)) spk=122+k; + if (verb==lock) spk=61; + if (spk!=124) return(2011); + dstroy(clam); + drop(oyster,loc); + drop(pearl,105); + return(2011); + } + if (obj==door) spk=111; + if (obj==door&&prop[door]==1) spk=54; + if (obj==cage) spk=32; + if (obj==keys) spk=55; + if (obj==grate||obj==chain) spk=31; + if (spk!=31||!here(keys)) return(2011); + if (obj==chain) + { if (verb==lock) + { spk=172; /* 9049: lock */ + if (prop[chain]!=0) spk=34; + if (loc!=plac[chain]) spk=173; + if (spk!=172) return(2011); + prop[chain]=2; + if (toting(chain)) drop(chain,loc); + fixed[chain]= -1; + return(2011); + } + spk=171; + if (prop[bear]==0) spk=41; + if (prop[chain]==0) spk=37; + if (spk!=171) return(2011); + prop[chain]=0; + fixed[chain]=0; + if (prop[bear]!=3) prop[bear]=2; + fixed[bear]=2-prop[bear]; + return(2011); + } + if (closng) + { k=130; + if (!panic) clock2=15; + panic=TRUE; + return(2010); + } + k=34+prop[grate]; /* 9043 */ + prop[grate]=1; + if (verb==lock) prop[grate]=0; + k=k+2*prop[grate]; + return(2010); +} + + +trkill() /* 9120 */ +{ register int i; + for (i=1; i<=5; i++) + if (dloc[i]==loc&&dflag>=2) break; + if (i==6) i=0; + if (obj==0) /* 9122 */ + { if (i!=0) obj=dwarf; + if (here(snake)) obj=obj*100+snake; + if (at(dragon)&&prop[dragon]==0) obj=obj*100+dragon; + if (at(troll)) obj=obj*100+troll; + if (here(bear)&&prop[bear]==0) obj=obj*100+bear; + if (obj>100) return(8000); + if (obj==0) + { if (here(bird)&&verb!=throw) obj=bird; + if (here(clam)||here(oyster)) obj=100*obj+clam; + if (obj>100) return(8000); + } + } + if (obj==bird) /* 9124 */ + { spk=137; + if (closed) return(2011); + dstroy(bird); + prop[bird]=0; + if (place[snake]==plac[snake]) tally2++; + spk=45; + } + if (obj==0) spk=44; /* 9125 */ + if (obj==clam||obj==oyster) spk=150; + if (obj==snake) spk=46; + if (obj==dwarf) spk=49; + if (obj==dwarf&&closed) return(19000); + if (obj==dragon) spk=147; + if (obj==troll) spk=157; + if (obj==bear) spk=165+(prop[bear]+1)/2; + if (obj!=dragon||prop[dragon]!=0) return(2011); + rspeak(49); + verb=0; + obj=0; + getin(&wd1,&wd2); + if (!weq(wd1,"y")&&!weq(wd1,"yes")) return(2608); + pspeak(dragon,1); + prop[dragon]=2; + prop[rug]=0; + k=(plac[dragon]+fixd[dragon])/2; + move(dragon+100,-1); + move(rug+100,0); + move(dragon,k); + move(rug,k); + for (obj=1; obj<=100; obj++) + if (place[obj]==plac[dragon]||place[obj]==fixd[dragon]) + move(obj,k); + loc=k; + k=null; + return(8); +} + + +trtoss() /* 9170: throw */ +{ register int i; + if (toting(rod2)&&obj==rod&&!toting(rod)) obj=rod2; + if (!toting(obj)) return(2011); + if (obj>=50&&obj<=maxtrs&&at(troll)) + { spk=159; /* 9178 */ + drop(obj,0); + move(troll,0); + move(troll+100,0); + drop(troll2,plac[troll]); + drop(troll2+100,fixd[troll]); + juggle(chasm); + return(2011); + } + if (obj==food&&here(bear)) + { obj=bear; /* 9177 */ + return(9210); + } + if (obj!=axe) return(9020); + for (i=1; i<=5; i++) + { if (dloc[i]==loc) + { spk=48; /* 9172 */ + if (ran(3)==0||saved!= -1) + l9175: { rspeak(spk); + drop(axe,loc); + k=null; + return(8); + } + dseen[i]=FALSE; + dloc[i]=0; + spk=47; + dkill++; + if (dkill==1) spk=149; + goto l9175; + } + } + spk=152; + if (at(dragon)&&prop[dragon]==0) + goto l9175; + spk=158; + if (at(troll)) goto l9175; + if (here(bear)&&prop[bear]==0) + { spk=164; + drop(axe,loc); + fixed[axe]= -1; + prop[axe]=1; + juggle(bear); + return(2011); + } + obj=0; + return(9120); +} + + +trfeed() /* 9210 */ +{ if (obj==bird) + { spk=100; + return(2011); + } + if (obj==snake||obj==dragon||obj==troll) + { spk=102; + if (obj==dragon&&prop[dragon]!=0) spk=110; + if (obj==troll) spk=182; + if (obj!=snake||closed||!here(bird)) return(2011); + spk=101; + dstroy(bird); + prop[bird]=0; + tally2++; + return(2011); + } + if (obj==dwarf) + { if (!here(food)) return(2011); + spk=103; + dflag++; + return(2011); + } + if (obj==bear) + { if (prop[bear]==0) spk=102; + if (prop[bear]==3) spk=110; + if (!here(food)) return(2011); + dstroy(food); + prop[bear]=1; + fixed[axe]=0; + prop[axe]=0; + spk=168; + return(2011); + } + spk=14; + return(2011); +} + + +trfill() /* 9220 */ +{ if (obj==vase) + { spk=29; + if (liqloc(loc)==0) spk=144; + if (liqloc(loc)==0||!toting(vase)) return(2011); + rspeak(145); + prop[vase]=2; + fixed[vase]= -1; + return(9020); /* advent/10 goes to 9024 */ + } + if (obj!=0&&obj!=bottle) return(2011); + if (obj==0&&!here(bottle)) return(8000); + spk=107; + if (liqloc(loc)==0) spk=106; + if (liq(0)!=0) spk=105; + if (spk!=107) return(2011); + prop[bottle]=((cond[loc]%4)/2)*2; + k=liq(0); + if (toting(bottle)) place[k]= -1; + if (k==oil) spk=108; + return(2011); +} + + +closing() /* 10000 */ +{ register int i; + prop[grate]=prop[fissur]=0; + for (i=1; i<=6; i++) + { dseen[i]=FALSE; + dloc[i]=0; + } + move(troll,0); + move(troll+100,0); + move(troll2,plac[troll]); + move(troll2+100,fixd[troll]); + juggle(chasm); + if(prop[bear]!=3) dstroy(bear); + prop[chain]=0; + fixed[chain]=0; + prop[axe]=0; + fixed[axe]=0; + rspeak(129); + clock1 = -1; + closng=TRUE; + return(19999); +} + + +caveclose() /* 11000 */ +{ register int i; + prop[bottle]=put(bottle,115,1); + prop[plant]=put(plant,115,0); + prop[oyster]=put(oyster,115,0); + prop[lamp]=put(lamp,115,0); + prop[rod]=put(rod,115,0); + prop[dwarf]=put(dwarf,115,0); + loc=115; + oldloc=115; + newloc=115; + + put(grate,116,0); + prop[snake]=put(snake,116,1); + prop[bird]=put(bird,116,1); + prop[cage]=put(cage,116,0); + prop[rod2]=put(rod2,116,0); + prop[pillow]=put(pillow,116,0); + + prop[mirror]=put(mirror,115,0); + fixed[mirror]=116; + + for (i=1; i<=100; i++) + if (toting(i)) dstroy(i); + rspeak(132); + closed=TRUE; + return(2); +} + diff --git a/games/adventure/vocab.c b/games/adventure/vocab.c new file mode 100644 index 0000000..cf10493 --- /dev/null +++ b/games/adventure/vocab.c @@ -0,0 +1,185 @@ +# +/* Re-coding of advent in C: data structure routines */ + +static char sccsid[] = " vocab.c 4.1 82/05/11 "; + +# include "hdr.h" + +dstroy(object) +int object; +{ move(object,0); +} + +juggle(object) +int object; +{ register int i,j; + i=place[object]; + j=fixed[object]; + move(object,i); + move(object+100,j); +} + + +move(object,where) +int object,where; +{ register int from; + if (object<=100) + from=place[object]; + else + from=fixed[object-100]; + if (from>0 && from<=300) carry(object,from); + drop(object,where); +} + + +put(object,where,pval) +int object,where,pval; +{ move(object,where); + return(-1-pval); +} + + + +carry(object,where) +int object,where; +{ register int temp; + if (object<=100) + { if (place[object]== -1) return; + place[object] = -1; + holdng++; + } + if (atloc[where]==object) + { atloc[where]=link[object]; + return; + } + for (temp=atloc[where]; link[temp]!=object; temp=link[temp]); + link[temp]=link[object]; +} + + + + +drop(object,where) +int object,where; +{ if (object>100) fixed[object-100]=where; + else + { if (place[object]== -1) holdng--; + place[object]=where; + } + if (where<=0) return; + link[object]=atloc[where]; + atloc[where]=object; +} + + +vocab(word,type,value) /* look up or store a word */ +char *word; +int type; /* -2 for store, -1 for user word, >=0 for canned lookup*/ +int value; /* used for storing only */ +{ register int adr; + register char *s,*t; + int hash, i; + struct hashtab *h; + for (hash=0,s=word,i=0; i<5 &&*s; i++) /* some kind of hash */ + hash += *s++; /* add all chars in the word */ + hash = (hash*3719)&077777; /* pulled that one out of a hat */ + hash %= HTSIZE; /* put it into range of table */ + + for(adr=hash;; adr++) /* look for entry in table */ + { if (adr==HTSIZE) adr=0; /* wrap around */ + h = &voc[adr]; /* point at the entry */ + switch(type) + { case -2: /* fill in entry */ + if (h->val) /* already got an entry? */ + goto exitloop2; + h->val=value; + h->atab=malloc(length(word)); + for (s=word,t=h->atab; *s;) + *t++ = *s++ ^ '='; + *t=0^'='; + /* encrypt slightly to thwart core reader */ + /* printf("Stored \"%s\" (%d ch) as entry %d\n", */ + /* word, length(word), adr); */ + return(0); /* entry unused */ + case -1: /* looking up user word */ + if (h->val==0) return(-1); /* not found */ + for (s=word, t=h->atab;*t ^ '=';) + if ((*s++ ^ '=') != *t++) + goto exitloop2; + if ((*s ^ '=') != *t && s-word<5) goto exitloop2; + /* the word matched o.k. */ + return(h->val); + default: /* looking up known word */ + if (h->val==0) + { printf("Unable to find %s in vocab\n",word); + exit(0); + } + for (s=word, t=h->atab;*t ^ '=';) + if ((*s++ ^ '=') != *t++) goto exitloop2; + /* the word matched o.k. */ + if (h->val/1000 != type) continue; + return(h->val%1000); + } + + exitloop2: /* hashed entry does not match */ + if (adr+1==hash || (adr==HTSIZE && hash==0)) + { printf("Hash table overflow\n"); + exit(0); + } + } +} + + +copystr(w1,w2) /* copy one string to another */ +char *w1,*w2; +{ register char *s,*t; + for (s=w1,t=w2; *s;) + *t++ = *s++; + *t=0; +} + +weq(w1,w2) /* compare words */ +char *w1,*w2; /* w1 is user, w2 is system */ +{ register char *s,*t; + register int i; + s=w1; + t=w2; + for (i=0; i<5; i++) /* compare at most 5 chars */ + { if (*t==0 && *s==0) + return(TRUE); + if (*s++ != *t++) return(FALSE); + } + return(TRUE); +} + + +length(str) /* includes 0 at end */ +char *str; +{ register char *s; + register int n; + for (n=0,s=str; *s++;) n++; + return(n+1); +} + +prht() /* print hash table */ +{ register int i,j,l; + char *c; + struct hashtab *h; + for (i=0; i=HTSIZE) break; + h= &voc[i*10+j]; + putchar(' '); + if (h->val==0) + { printf("-----"); + continue; + } + for (l=0, c=h->atab; l<5; l++) + if ((*c ^ '=')) putchar(*c++ ^ '='); + else putchar(' '); + } + putchar('\n'); + } +} + diff --git a/games/adventure/wizard.c b/games/adventure/wizard.c new file mode 100644 index 0000000..2e3e182 --- /dev/null +++ b/games/adventure/wizard.c @@ -0,0 +1,98 @@ +# +/* Re-coding of advent in C: privileged operations */ + +static char sccsid[] = " wizard.c 4.1 82/05/11 "; + +# include "hdr.h" + +datime(d,t) +int *d,*t; +{ int tvec[2],*tptr; + int *localtime(); + time(tvec); + tptr=localtime(tvec); + *d=tptr[7]+365*(tptr[5]-77); /* day since 1977 (mod leap) */ + /* bug: this will overflow in the year 2066 AD */ + /* it will be attributed to Wm the C's millenial celebration */ + *t=tptr[2]*60+tptr[1]; /* and minutes since midnite */ +} /* pretty painless */ + + +char *magic; + +poof() +{ magic="dwarf"; + latncy=45; +} + +start(n) +{ int d,t,delay; + datime(&d,&t); + delay=(d-saved)*1440+(t-savet); /* good for about a month */ + if (delay>=latncy || delay < 0 || setup >= 0) + { saved= -1; + return(FALSE); + } + printf("This adventure was suspended a mere %d minutes ago.",delay); + if (delay<=latncy/3) + { mspeak(2); + exit(0); + } + mspeak(8); + if (!wizard()) + { mspeak(9); + exit(0); + } + saved = -1; + return(FALSE); +} + +wizard() /* not as complex as advent/10 (for now) */ +{ register int wiz; + char *word,*x; + if (!yesm(16,0,7)) return(FALSE); + mspeak(17); + getin(&word,&x); + if (!weq(word,magic)) + { mspeak(20); + return(FALSE); + } + mspeak(19); + return(TRUE); +} + +ciao(cmdfile) +char *cmdfile; +{ register char *c; + register int outfd, size; + char fname[80], buf[512]; + extern unsigned filesize; + + lseek(datfd,(long)filesize,0); + for (;;) + { printf("What would you like to call the saved version?\n"); + for (c=fname;; c++) + if ((*c=getchar())=='\n') break; + *c=0; + if (save(cmdfile,fname)>=0) break; + printf("I can't use that one.\n"); + return; + } + outfd=open(fname,1); + lseek(outfd,0L,2); /* end of executable file */ + while ((size=read(datfd,buf,512))>0) + write(outfd,buf,size); /* copy the message data */ + printf(" ^\n"); + printf("That should do it. Gis revido.\n"); + exit(0); +} + + +ran(range) /* uses unix rng */ +int range; /* can't div by 32768 because */ +{ + long rand(), i; + i = rand() % range; + return(i); +} + diff --git a/games/arithmetic.c b/games/arithmetic.c new file mode 100644 index 0000000..c03a6a1 --- /dev/null +++ b/games/arithmetic.c @@ -0,0 +1,218 @@ + +static char sccsid[] = " arithmetic.c 4.1 82/10/24 "; + +#include +#include +#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; + char dir,sense; + 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(); + } + + 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(); + else if(rs >= &s[99]) { + while((*rs = getchar()) != '\n') + if(*rs == '\0') exit(); + } + 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); +} + +int arand; + +srand(n) +{ + arand = n&077774 | 01; +} + +rand() /*uniform on 0 to 2**13-1*/ +{ + + arand *= 3125; + arand &= 077777; + return(arand/4); +} + +random(range) +{ + return(hmul(rand(), 8*range)); +} + +skrand(range){ +int temp; + temp = rand() + rand(); + if(temp >017777) temp = 040000 - temp; + return(hmul(temp,8*range)); + } + +/* 'hmul' returns the upper 16 bits of the product, where the operands + are assumed to be 16-bit integers. It replaces an old PDP-11 + assembler language subroutine. -- dks. +*/ +hmul(a,b) { return((long)a*b >> 16); } +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; + return(0); +} + +delete() +{ + if(rights + wrongs == 0.) { + printf("\n"); + exit(); + } + score(); + exit(); +} + diff --git a/games/atc/BUGS b/games/atc/BUGS new file mode 100644 index 0000000..7d2af29 --- /dev/null +++ b/games/atc/BUGS @@ -0,0 +1,4 @@ +log restarts if interrupted +Still refreshes after exit +Should ^Z be disabled? +does not exit after hup diff --git a/games/atc/Makefile b/games/atc/Makefile new file mode 100644 index 0000000..1aa6876 --- /dev/null +++ b/games/atc/Makefile @@ -0,0 +1,108 @@ +# +# Copyright (c) 1987 Regents of the University of California. +# All rights reserved. The Berkeley software License Agreement +# specifies the terms and conditions for redistribution. +# +# @(#)Makefile 5.1.2 (2.11BSD) 1999/10/25 +# + +DESTDIR= +CFLAGS= -O -DBSD -DDEST=\"${DESTDIR}/usr/games/lib/atc/\" +SEPFLAG= -i +YFLAGS= -d +LIBS= -ll -lm -lcurses -ltermcap +SRCS= extern.c grammar.c graphics.c input.c lex.c list.c log.c \ + main.c tunable.c update.c +OBJS= extern.o grammar.o input.o lex.o list.o log.o main.o tunable.o \ + graphics.o update.o + +all: atc + +atc: ${OBJS} + ${CC} ${SEPFLAG} ${OBJS} ${LIBS} -o $@ + +clean: FRC + rm -f ${OBJS} core atc grammar.c y.tab.h y.tab.c lex.yy.c lex.c + +depend: lex.c grammar.c FRC + mkdep ${CFLAGS} ${SRCS} + +install: FRC + -[ -d ${DESTDIR}/usr/games/lib/atc ] || mkdir ${DESTDIR}/usr/games/lib/atc + chmod 700 ${DESTDIR}/usr/games/lib/atc + chown games.bin ${DESTDIR}/usr/games/lib/atc + (cd games; install -c -o games -g bin -m 600 * ${DESTDIR}/usr/games/lib/atc) + install -s -o games -g bin -m 4700 atc ${DESTDIR}/usr/games/hide/atc + (cd ${DESTDIR}/usr/games; rm -f atc; ln -s dm atc; chown games.bin atc) + +lint: lex.c grammar.c FRC + lint ${CFLAGS} ${SRCS} + +tags: lex.c grammar.c FRC + ctags ${SRCS} + +FRC: + +# DO NOT DELETE THIS LINE -- mkdep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. + +extern.o: extern.c include.h /usr/include/stdio.h /usr/include/ctype.h +extern.o: /usr/include/pwd.h /usr/include/sgtty.h /usr/include/sys/ioctl.h +extern.o: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h +extern.o: /usr/include/sys/time.h /usr/include/time.h /usr/include/sys/file.h +extern.o: /usr/include/signal.h /usr/include/machine/trap.h /usr/include/math.h +extern.o: /usr/include/curses.h /usr/include/stdio.h /usr/include/sgtty.h def.h +extern.o: struct.h extern.h tunable.h +grammar.o: grammar.c include.h /usr/include/stdio.h /usr/include/ctype.h +grammar.o: /usr/include/pwd.h /usr/include/sgtty.h /usr/include/sys/ioctl.h +grammar.o: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h +grammar.o: /usr/include/sys/time.h /usr/include/time.h /usr/include/sys/file.h +grammar.o: /usr/include/signal.h /usr/include/machine/trap.h +grammar.o: /usr/include/math.h /usr/include/curses.h /usr/include/stdio.h +grammar.o: /usr/include/sgtty.h def.h struct.h extern.h tunable.h +graphics.o: graphics.c include.h /usr/include/stdio.h /usr/include/ctype.h +graphics.o: /usr/include/pwd.h /usr/include/sgtty.h /usr/include/sys/ioctl.h +graphics.o: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h +graphics.o: /usr/include/sys/time.h /usr/include/time.h /usr/include/sys/file.h +graphics.o: /usr/include/signal.h /usr/include/machine/trap.h +graphics.o: /usr/include/math.h /usr/include/curses.h /usr/include/stdio.h +graphics.o: /usr/include/sgtty.h def.h struct.h extern.h tunable.h +input.o: input.c include.h /usr/include/stdio.h /usr/include/ctype.h +input.o: /usr/include/pwd.h /usr/include/sgtty.h /usr/include/sys/ioctl.h +input.o: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h +input.o: /usr/include/sys/time.h /usr/include/time.h /usr/include/sys/file.h +input.o: /usr/include/signal.h /usr/include/machine/trap.h /usr/include/math.h +input.o: /usr/include/curses.h /usr/include/stdio.h /usr/include/sgtty.h def.h +input.o: struct.h extern.h tunable.h +lex.o: lex.c /usr/include/stdio.h y.tab.h +list.o: list.c include.h /usr/include/stdio.h /usr/include/ctype.h +list.o: /usr/include/pwd.h /usr/include/sgtty.h /usr/include/sys/ioctl.h +list.o: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h +list.o: /usr/include/sys/time.h /usr/include/time.h /usr/include/sys/file.h +list.o: /usr/include/signal.h /usr/include/machine/trap.h /usr/include/math.h +list.o: /usr/include/curses.h /usr/include/stdio.h /usr/include/sgtty.h def.h +list.o: struct.h extern.h tunable.h +log.o: log.c include.h /usr/include/stdio.h /usr/include/ctype.h +log.o: /usr/include/pwd.h /usr/include/sgtty.h /usr/include/sys/ioctl.h +log.o: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h +log.o: /usr/include/sys/time.h /usr/include/time.h /usr/include/sys/file.h +log.o: /usr/include/signal.h /usr/include/machine/trap.h /usr/include/math.h +log.o: /usr/include/curses.h /usr/include/stdio.h /usr/include/sgtty.h def.h +log.o: struct.h extern.h tunable.h +main.o: main.c include.h /usr/include/stdio.h /usr/include/ctype.h +main.o: /usr/include/pwd.h /usr/include/sgtty.h /usr/include/sys/ioctl.h +main.o: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h +main.o: /usr/include/sys/time.h /usr/include/time.h /usr/include/sys/file.h +main.o: /usr/include/signal.h /usr/include/machine/trap.h /usr/include/math.h +main.o: /usr/include/curses.h /usr/include/stdio.h /usr/include/sgtty.h def.h +main.o: struct.h extern.h tunable.h +tunable.o: tunable.c +update.o: update.c include.h /usr/include/stdio.h /usr/include/ctype.h +update.o: /usr/include/pwd.h /usr/include/sgtty.h /usr/include/sys/ioctl.h +update.o: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h +update.o: /usr/include/sys/time.h /usr/include/time.h /usr/include/sys/file.h +update.o: /usr/include/signal.h /usr/include/machine/trap.h /usr/include/math.h +update.o: /usr/include/curses.h /usr/include/stdio.h /usr/include/sgtty.h def.h +update.o: struct.h extern.h tunable.h + +# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/games/atc/def.h b/games/atc/def.h new file mode 100644 index 0000000..9cc2749 --- /dev/null +++ b/games/atc/def.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 1987 by Ed James, UC Berkeley. All rights reserved. + * + * Copy permission is hereby granted provided that this notice is + * retained on all partial or complete copies. + * + * For more info on this and all of my stuff, mail edjames@berkeley.edu. + */ + +#define AUTHOR_STR "ATC - by Ed James" + +#define PI 3.14159654 + +#define LOWFUEL 15 + +#define REALLOC 10 + +#define SGN(x) ((x < 0) ? -1 : ((x > 0) ? 1 : 0)) +#define ABS(x) ((x < 0) ? -(x) : (x)) +#define DIR_FROM_DXDY(dx,dy) ((int) (atan2((double)(dy), (double)(dx)) \ + * MAXDIR / (2 * PI) + 2.5 + MAXDIR) % MAXDIR) + +#define MAXDIR 8 + +#define D_LEFT 1 +#define D_RIGHT 2 +#define D_UP 3 +#define D_DOWN 4 + +#define T_NODEST 0 +#define T_BEACON 1 +#define T_EXIT 2 +#define T_AIRPORT 3 + +#define S_NONE 0 +#define S_GONE 1 +#define S_MARKED 2 +#define S_UNMARKED 3 +#define S_IGNORED 4 + +#define INPUT_LINES 3 +#define PLANE_COLS 20 diff --git a/games/atc/extern.c b/games/atc/extern.c new file mode 100644 index 0000000..203ee8b --- /dev/null +++ b/games/atc/extern.c @@ -0,0 +1,36 @@ +/* + * Copyright (c) 1987 by Ed James, UC Berkeley. All rights reserved. + * + * Copy permission is hereby granted provided that this notice is + * retained on all partial or complete copies. + * + * For more info on this and all of my stuff, mail edjames@berkeley.edu. + */ + +#include "include.h" + +char GAMES[] = "Game_List", + LOG[] = "ATC_scores"; + +int clock, safe_planes, start_time, test_mode; + +char *file; + +FILE *filein, *fileout; + +C_SCREEN screen, *sp = &screen; + +LIST air, ground; + +struct sgttyb tty_start, tty_new; + +DISPLACEMENT displacement[MAXDIR] = { + { 0, -1 }, + { 1, -1 }, + { 1, 0 }, + { 1, 1 }, + { 0, 1 }, + { -1, 1 }, + { -1, 0 }, + { -1, -1 } +}; diff --git a/games/atc/extern.h b/games/atc/extern.h new file mode 100644 index 0000000..c4ef642 --- /dev/null +++ b/games/atc/extern.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 1987 by Ed James, UC Berkeley. All rights reserved. + * + * Copy permission is hereby granted provided that this notice is + * retained on all partial or complete copies. + * + * For more info on this and all of my stuff, mail edjames@berkeley.edu. + */ + +extern char GAMES[], LOG[], *file; + +extern int clock, safe_planes, start_time, test_mode; + +extern FILE *filein, *fileout; + +extern C_SCREEN screen, *sp; + +extern LIST air, ground; + +extern struct sgttyb tty_start, tty_new; + +extern DISPLACEMENT displacement[MAXDIR]; + +extern PLANE *findplane(), *newplane(); diff --git a/games/atc/games/ATC_scores b/games/atc/games/ATC_scores new file mode 100644 index 0000000..bbffeb2 --- /dev/null +++ b/games/atc/games/ATC_scores @@ -0,0 +1,5 @@ +schumann puff game_2 171 1414 195 +schumann puff default 18 220 59 +schumann puff easy 13 182 146 +schumann puff crossover 11 74 448 +schumann puff Killer 0 38 27 diff --git a/games/atc/games/Game_List b/games/atc/games/Game_List new file mode 100644 index 0000000..0117385 --- /dev/null +++ b/games/atc/games/Game_List @@ -0,0 +1,5 @@ +default +easy +crossover +Killer +game_2 diff --git a/games/atc/games/Killer b/games/atc/games/Killer new file mode 100644 index 0000000..f15d060 --- /dev/null +++ b/games/atc/games/Killer @@ -0,0 +1,21 @@ +update = 1; +newplane = 4; +width = 30; +height = 21; + +exit: ( 29 7 a ) ( 29 17 a ) + ( 0 7 d ) ( 0 0 c ) ; + +beacon: ( 12 7 ) ( 12 17 ) ( 14 10 ) ( 20 15 ) ; + +airport: ( 20 18 d ) ; + +line: [ ( 1 1 ) ( 6 6 ) ] + [ ( 12 1 ) ( 12 6 ) ] + [ ( 13 7 ) ( 28 7 ) ] + [ ( 28 1 ) ( 13 16 ) ] + [ ( 1 13 ) ( 11 13 ) ] + [ ( 12 8 ) ( 12 16 ) ] + [ ( 11 18 ) ( 10 19 ) ] + [ ( 13 17 ) ( 28 17 ) ] + [ ( 1 7 ) ( 11 7 ) ] ; diff --git a/games/atc/games/crossover b/games/atc/games/crossover new file mode 100644 index 0000000..d2689ff --- /dev/null +++ b/games/atc/games/crossover @@ -0,0 +1,14 @@ +update = 5; +newplane = 5; +width = 29; +height = 21; + +exit: ( 0 0 c ) ( 8 0 c ) ( 20 0 z ) ( 28 0 z ) + ( 28 20 q ) ( 20 20 q ) ( 8 20 e ) ( 0 20 e ); + +beacon: ( 14 6 ) ( 18 10 ) ( 14 14 ) ( 10 10 ); + +line: [ ( 0 0 ) ( 20 20 ) ] + [ ( 8 0 ) ( 28 20 ) ] + [ ( 20 0 ) ( 0 20 ) ] + [ ( 28 0 ) ( 8 20 ) ]; diff --git a/games/atc/games/default b/games/atc/games/default new file mode 100644 index 0000000..e19ef9d --- /dev/null +++ b/games/atc/games/default @@ -0,0 +1,21 @@ +update = 5; +newplane = 10; +width = 30; +height = 21; + +exit: ( 12 0 x ) ( 29 0 z ) ( 29 7 a ) ( 29 17 a ) + ( 9 20 e ) ( 0 13 d ) ( 0 7 d ) ( 0 0 c ) ; + +beacon: ( 12 7 ) ( 12 17 ) ; + +airport: ( 20 15 w ) ( 20 18 d ) ; + +line: [ ( 1 1 ) ( 6 6 ) ] + [ ( 12 1 ) ( 12 6 ) ] + [ ( 13 7 ) ( 28 7 ) ] + [ ( 28 1 ) ( 13 16 ) ] + [ ( 1 13 ) ( 11 13 ) ] + [ ( 12 8 ) ( 12 16 ) ] + [ ( 11 18 ) ( 10 19 ) ] + [ ( 13 17 ) ( 28 17 ) ] + [ ( 1 7 ) ( 11 7 ) ] ; diff --git a/games/atc/games/easy b/games/atc/games/easy new file mode 100644 index 0000000..4ab8eac --- /dev/null +++ b/games/atc/games/easy @@ -0,0 +1,15 @@ +update = 7; +newplane = 12; +width = 15; +height = 15; + +exit: ( 7 0 x ) ( 14 0 z ) ( 12 14 q ) ( 0 14 e ) ; + +beacon: ( 12 7 ) ; + +airport: ( 7 8 w ) ; + +line: [ ( 1 1 ) ( 6 6 ) ] + [ ( 7 9 ) ( 12 14 ) ] + [ ( 7 0 ) ( 7 14 ) ] + [ ( 1 7 ) ( 11 7 ) ] ; diff --git a/games/atc/games/game_2 b/games/atc/games/game_2 new file mode 100644 index 0000000..5788c8a --- /dev/null +++ b/games/atc/games/game_2 @@ -0,0 +1,22 @@ +update = 5; +newplane = 8; +width = 30; +height = 21; + +exit: ( 12 0 x ) ( 29 0 z ) ( 29 6 a ) ( 29 13 a ) + ( 9 20 e ) ( 0 13 d ) ( 0 6 d ) ( 0 0 c ) ; + +beacon: ( 12 17 ) ( 23 6 ) ( 23 13 ) ( 25 17 ) + ( 12 6 ) ( 12 13 ) ( 6 6 ) ; + +airport: ( 18 17 d ) ; + +line: [ ( 1 1 ) ( 16 16 ) ] + [ ( 1 6 ) ( 28 6 ) ] + [ ( 12 1 ) ( 12 17 ) ] + [ ( 10 19 ) ( 28 1 ) ] + [ ( 13 17 ) ( 17 17 ) ] + [ ( 1 13 ) ( 28 13 ) ] + [ ( 19 17 ) ( 24 17 ) ] + [ ( 19 17 ) ( 22 14 ) ] + [ ( 26 16 ) ( 28 14 ) ] ; diff --git a/games/atc/grammar.y b/games/atc/grammar.y new file mode 100644 index 0000000..519bfd7 --- /dev/null +++ b/games/atc/grammar.y @@ -0,0 +1,349 @@ +/* + * Copyright (c) 1987 by Ed James, UC Berkeley. All rights reserved. + * + * Copy permission is hereby granted provided that this notice is + * retained on all partial or complete copies. + * + * For more info on this and all of my stuff, mail edjames@berkeley.edu. + */ + +%token HeightOp +%token WidthOp +%token UpdateOp +%token NewplaneOp +%token DirOp +%token ConstOp +%token LineOp +%token AirportOp +%token BeaconOp +%token ExitOp +%union { + int ival; + char cval; +} + +%{ +#include "include.h" + +int errors = 0; +int line = 1; +%} + +%% +file: + bunch_of_defs { if (checkdefs() < 0) return (errors); } bunch_of_lines + { + if (sp->num_exits + sp->num_airports < 2) + yyerror("Need at least 2 airports and/or exits."); + return (errors); + } + ; + +bunch_of_defs: + def bunch_of_defs + | def + ; + +def: + udef + | ndef + | wdef + | hdef + ; + +udef: + UpdateOp '=' ConstOp ';' + { + if (sp->update_secs != 0) + return (yyerror("Redefinition of 'update'.")); + else if ($3 < 1) + return (yyerror("'update' is too small.")); + else + sp->update_secs = $3; + } + ; + +ndef: + NewplaneOp '=' ConstOp ';' + { + if (sp->newplane_time != 0) + return (yyerror("Redefinition of 'newplane'.")); + else if ($3 < 1) + return (yyerror("'newplane' is too small.")); + else + sp->newplane_time = $3; + } + ; + +hdef: + HeightOp '=' ConstOp ';' + { + if (sp->height != 0) + return (yyerror("Redefinition of 'height'.")); + else if ($3 < 3) + return (yyerror("'height' is too small.")); + else + sp->height = $3; + } + ; + +wdef: + WidthOp '=' ConstOp ';' + { + if (sp->height != 0) + return (yyerror("Redefinition of 'width'.")); + else if ($3 < 3) + return (yyerror("'width' is too small.")); + else + sp->width = $3; + } + ; + +bunch_of_lines: + line bunch_of_lines + {} + | line + {} + ; + +line: + BeaconOp ':' Bpoint_list ';' + {} + | ExitOp ':' Epoint_list ';' + {} + | LineOp ':' Lline_list ';' + {} + | AirportOp ':' Apoint_list ';' + {} + ; + +Bpoint_list: + Bpoint Bpoint_list + {} + | Bpoint + {} + ; + +Bpoint: + '(' ConstOp ConstOp ')' + { + if (sp->num_beacons % REALLOC == 0) { + if (sp->beacon == NULL) + sp->beacon = (BEACON *) malloc((sp->num_beacons + + REALLOC) * sizeof (BEACON)); + else + sp->beacon = (BEACON *) realloc(sp->beacon, + (sp->num_beacons + REALLOC) * + sizeof (BEACON)); + if (sp->beacon == NULL) + return (yyerror("No memory available.")); + } + sp->beacon[sp->num_beacons].x = $2; + sp->beacon[sp->num_beacons].y = $3; + check_point($2, $3); + sp->num_beacons++; + } + ; + +Epoint_list: + Epoint Epoint_list + {} + | Epoint + {} + ; + +Epoint: + '(' ConstOp ConstOp DirOp ')' + { + int dir; + + if (sp->num_exits % REALLOC == 0) { + if (sp->exit == NULL) + sp->exit = (EXIT *) malloc((sp->num_exits + + REALLOC) * sizeof (EXIT)); + else + sp->exit = (EXIT *) realloc(sp->exit, + (sp->num_exits + REALLOC) * + sizeof (EXIT)); + if (sp->exit == NULL) + return (yyerror("No memory available.")); + } + dir = dir_no($4); + sp->exit[sp->num_exits].x = $2; + sp->exit[sp->num_exits].y = $3; + sp->exit[sp->num_exits].dir = dir; + check_edge($2, $3); + check_edir($2, $3, dir); + sp->num_exits++; + } + ; + +Apoint_list: + Apoint Apoint_list + {} + | Apoint + {} + ; + +Apoint: + '(' ConstOp ConstOp DirOp ')' + { + int dir; + + if (sp->num_airports % REALLOC == 0) { + if (sp->airport == NULL) + sp->airport=(AIRPORT *)malloc((sp->num_airports + + REALLOC) * sizeof(AIRPORT)); + else + sp->airport = (AIRPORT *) realloc(sp->airport, + (sp->num_airports + REALLOC) * + sizeof(AIRPORT)); + if (sp->airport == NULL) + return (yyerror("No memory available.")); + } + dir = dir_no($4); + sp->airport[sp->num_airports].x = $2; + sp->airport[sp->num_airports].y = $3; + sp->airport[sp->num_airports].dir = dir; + check_point($2, $3); + check_adir($2, $3, dir); + sp->num_airports++; + } + ; + +Lline_list: + Lline Lline_list + {} + | Lline + {} + ; + +Lline: + '[' '(' ConstOp ConstOp ')' '(' ConstOp ConstOp ')' ']' + { + if (sp->num_lines % REALLOC == 0) { + if (sp->line == NULL) + sp->line = (LINE *) malloc((sp->num_lines + + REALLOC) * sizeof (LINE)); + else + sp->line = (LINE *) realloc(sp->line, + (sp->num_lines + REALLOC) * + sizeof (LINE)); + if (sp->line == NULL) + return (yyerror("No memory available.")); + } + sp->line[sp->num_lines].p1.x = $3; + sp->line[sp->num_lines].p1.y = $4; + sp->line[sp->num_lines].p2.x = $7; + sp->line[sp->num_lines].p2.y = $8; + check_line($3, $4, $7, $8); + sp->num_lines++; + } + ; +%% + +check_edge(x, y) +{ + if (!(x == 0) && !(x == sp->width - 1) && + !(y == 0) && !(y == sp->height - 1)) + yyerror("edge value not on edge."); +} + +check_point(x, y) +{ + if (x < 1 || x >= sp->width - 1) + yyerror("X value out of range."); + if (y < 1 || y >= sp->height - 1) + yyerror("Y value out of range."); +} + +check_linepoint(x, y) +{ + if (x < 0 || x >= sp->width) + yyerror("X value out of range."); + if (y < 0 || y >= sp->height) + yyerror("Y value out of range."); +} + +check_line(x1, y1, x2, y2) +{ + int d1, d2; + + check_linepoint(x1, y1); + check_linepoint(x2, y2); + + d1 = ABS(x2 - x1); + d2 = ABS(y2 - y1); + + if (!(d1 == d2) && !(d1 == 0) && !(d2 == 0)) + yyerror("Bad line endpoints."); +} + +yyerror(s) +{ + fprintf(stderr, "\"%s\": line %d: %s\n", file, line, s); + errors++; + + return (errors); +} + +check_edir(x, y, dir) +{ + int bad = 0; + + if (x == sp->width - 1) + x = 2; + else if (x != 0) + x = 1; + if (y == sp->height - 1) + y = 2; + else if (y != 0) + y = 1; + + switch (x * 10 + y) { + case 00: if (dir != 3) bad++; break; + case 01: if (dir < 1 || dir > 3) bad++; break; + case 02: if (dir != 1) bad++; break; + case 10: if (dir < 3 || dir > 5) bad++; break; + case 11: break; + case 12: if (dir > 1 && dir < 7) bad++; break; + case 20: if (dir != 5) bad++; break; + case 21: if (dir < 5) bad++; break; + case 22: if (dir != 7) bad++; break; + default: + yyerror("Unknown value in checkdir! Get help!"); + break; + } + if (bad) + yyerror("Bad direction for entrance at exit."); +} + +check_adir(x, y, dir) +{ +} + +checkdefs() +{ + int err = 0; + + if (sp->width == 0) { + yyerror("'width' undefined."); + err++; + } + if (sp->height == 0) { + yyerror("'height' undefined."); + err++; + } + if (sp->update_secs == 0) { + yyerror("'update' undefined."); + err++; + } + if (sp->newplane_time == 0) { + yyerror("'newplane' undefined."); + err++; + } + if (err) + return (-1); + else + return (0); +} diff --git a/games/atc/graphics.c b/games/atc/graphics.c new file mode 100644 index 0000000..f655f89 --- /dev/null +++ b/games/atc/graphics.c @@ -0,0 +1,378 @@ +/* + * Copyright (c) 1987 by Ed James, UC Berkeley. All rights reserved. + * + * Copy permission is hereby granted provided that this notice is + * retained on all partial or complete copies. + * + * For more info on this and all of my stuff, mail edjames@berkeley.edu. + */ + +#include "include.h" +#ifdef SYSV +#include +#endif + +#define C_TOPBOTTOM '-' +#define C_LEFTRIGHT '|' +#define C_AIRPORT '=' +#define C_LINE '+' +#define C_BACKROUND '.' +#define C_BEACON '*' +#define C_CREDIT '*' + +WINDOW *radar, *cleanradar, *credit, *input, *planes; + +getAChar() +{ +#ifdef BSD + return (getchar()); +#endif +#ifdef SYSV + int c; + + while ((c = getchar()) == -1 && errno == EINTR) ; + return(c); +#endif +} + +erase_all() +{ + PLANE *pp; + + for (pp = air.head; pp != NULL; pp = pp->next) { + wmove(cleanradar, pp->ypos, pp->xpos * 2); + wmove(radar, pp->ypos, pp->xpos * 2); + waddch(radar, winch(cleanradar)); + wmove(cleanradar, pp->ypos, pp->xpos * 2 + 1); + wmove(radar, pp->ypos, pp->xpos * 2 + 1); + waddch(radar, winch(cleanradar)); + } +} + +draw_all() +{ + PLANE *pp; + + for (pp = air.head; pp != NULL; pp = pp->next) { + if (pp->status == S_MARKED) + wstandout(radar); + wmove(radar, pp->ypos, pp->xpos * 2); + waddch(radar, name(pp)); + waddch(radar, '0' + pp->altitude); + if (pp->status == S_MARKED) + wstandend(radar); + } + wrefresh(radar); + planewin(); + wrefresh(input); /* return cursor */ + fflush(stdout); +} + +init_gr() +{ + static char buffer[BUFSIZ]; + + initscr(); + setbuf(stdout, buffer); + input = newwin(INPUT_LINES, COLS - PLANE_COLS, LINES - INPUT_LINES, 0); + credit = newwin(INPUT_LINES, PLANE_COLS, LINES - INPUT_LINES, + COLS - PLANE_COLS); + planes = newwin(LINES - INPUT_LINES, PLANE_COLS, 0, COLS - PLANE_COLS); +} + +setup_screen(scp) + C_SCREEN *scp; +{ + register int i, j; + char str[3], *airstr; + + str[2] = '\0'; + + if (radar != NULL) + delwin(radar); + radar = newwin(scp->height, scp->width * 2, 0, 0); + + if (cleanradar != NULL) + delwin(cleanradar); + cleanradar = newwin(scp->height, scp->width * 2, 0, 0); + + /* minus one here to prevent a scroll */ + for (i = 0; i < PLANE_COLS - 1; i++) { + wmove(credit, 0, i); + waddch(credit, C_CREDIT); + wmove(credit, INPUT_LINES - 1, i); + waddch(credit, C_CREDIT); + } + wmove(credit, INPUT_LINES / 2, 1); + waddstr(credit, AUTHOR_STR); + + for (i = 1; i < scp->height - 1; i++) { + for (j = 1; j < scp->width - 1; j++) { + wmove(radar, i, j * 2); + waddch(radar, C_BACKROUND); + } + } + + /* + * Draw the lines first, since people like to draw lines + * through beacons and exit points. + */ + str[0] = C_LINE; + for (i = 0; i < scp->num_lines; i++) { + str[1] = ' '; + draw_line(radar, scp->line[i].p1.x, scp->line[i].p1.y, + scp->line[i].p2.x, scp->line[i].p2.y, str); + } + + str[0] = C_TOPBOTTOM; + str[1] = C_TOPBOTTOM; + wmove(radar, 0, 0); + for (i = 0; i < scp->width - 1; i++) + waddstr(radar, str); + waddch(radar, C_TOPBOTTOM); + + str[0] = C_TOPBOTTOM; + str[1] = C_TOPBOTTOM; + wmove(radar, scp->height - 1, 0); + for (i = 0; i < scp->width - 1; i++) + waddstr(radar, str); + waddch(radar, C_TOPBOTTOM); + + for (i = 1; i < scp->height - 1; i++) { + wmove(radar, i, 0); + waddch(radar, C_LEFTRIGHT); + wmove(radar, i, (scp->width - 1) * 2); + waddch(radar, C_LEFTRIGHT); + } + + str[0] = C_BEACON; + for (i = 0; i < scp->num_beacons; i++) { + str[1] = '0' + i; + wmove(radar, scp->beacon[i].y, scp->beacon[i].x * 2); + waddstr(radar, str); + } + + for (i = 0; i < scp->num_exits; i++) { + wmove(radar, scp->exit[i].y, scp->exit[i].x * 2); + waddch(radar, '0' + i); + } + + airstr = "^?>?v?num_airports; i++) { + str[0] = airstr[scp->airport[i].dir]; + str[1] = '0' + i; + wmove(radar, scp->airport[i].y, scp->airport[i].x * 2); + waddstr(radar, str); + } + + overwrite(radar, cleanradar); + wrefresh(radar); + wrefresh(credit); + fflush(stdout); +} + +draw_line(w, x, y, lx, ly, s) + WINDOW *w; + char *s; +{ + int dx, dy; + + dx = SGN(lx - x); + dy = SGN(ly - y); + for (;;) { + wmove(w, y, x * 2); + waddstr(w, s); + if (x == lx && y == ly) + break; + x += dx; + y += dy; + } +} + +ioclrtoeol(pos) +{ + wmove(input, 0, pos); + wclrtoeol(input); + wrefresh(input); + fflush(stdout); +} + +iomove(pos) +{ + wmove(input, 0, pos); + wrefresh(input); + fflush(stdout); +} + +ioaddstr(pos, str) + char *str; +{ + wmove(input, 0, pos); + waddstr(input, str); + wrefresh(input); + fflush(stdout); +} + +ioclrtobot() +{ + wclrtobot(input); + wrefresh(input); + fflush(stdout); +} + +ioerror(pos, len, str) + char *str; +{ + int i; + + wmove(input, 1, pos); + for (i = 0; i < len; i++) + waddch(input, '^'); + wmove(input, 2, 0); + waddstr(input, str); + wrefresh(input); + fflush(stdout); +} + +quit() +{ + int c, y, x; +#ifdef BSD + struct itimerval itv; +#endif + + getyx(input, y, x); + wmove(input, 2, 0); + waddstr(input, "Really quit? (y/n) "); + wclrtobot(input); + wrefresh(input); + fflush(stdout); + + c = getchar(); + if (c == EOF || c == 'y') { + /* disable timer */ +#ifdef BSD + itv.it_value.tv_sec = 0; + itv.it_value.tv_usec = 0; + setitimer(ITIMER_REAL, &itv, NULL); +#endif +#ifdef SYSV + alarm(0); +#endif + fflush(stdout); + clear(); + refresh(); + endwin(); + log_score(0); + exit(0); + } + wmove(input, 2, 0); + wclrtobot(input); + wmove(input, y, x); + wrefresh(input); + fflush(stdout); + return; +} + +planewin() +{ + PLANE *pp; + char *command(); + int warning = 0; + +#ifdef BSD + wclear(planes); +#endif + + wmove(planes, 0,0); + +#ifdef SYSV + wclrtobot(planes); +#endif + wprintw(planes, "Time: %-4d Safe: %d", clock, safe_planes); + wmove(planes, 2, 0); + + waddstr(planes, "pl dt comm"); + for (pp = air.head; pp != NULL; pp = pp->next) { + if (waddch(planes, '\n') == ERR) { + warning++; + break; + } + waddstr(planes, command(pp)); + } + waddch(planes, '\n'); + for (pp = ground.head; pp != NULL; pp = pp->next) { + if (waddch(planes, '\n') == ERR) { + warning++; + break; + } + waddstr(planes, command(pp)); + } + if (warning) { + wmove(planes, LINES - INPUT_LINES - 1, 0); + waddstr(planes, "---- more ----"); + wclrtoeol(planes); + } + wrefresh(planes); + fflush(stdout); +} + +loser(p, s) + PLANE *p; + char *s; +{ + int c; +#ifdef BSD + struct itimerval itv; +#endif + + /* disable timer */ +#ifdef BSD + itv.it_value.tv_sec = 0; + itv.it_value.tv_usec = 0; + setitimer(ITIMER_REAL, &itv, NULL); +#endif +#ifdef SYSV + alarm(0); +#endif + + wmove(input, 0, 0); + wclrtobot(input); + wprintw(input, "Plane '%c' %s\n\nHit space for top players list...", + name(p), s); + wrefresh(input); + fflush(stdout); + while ((c = getchar()) != EOF && c != ' ') + ; + clear(); /* move to top of screen */ + refresh(); + endwin(); + log_score(0); + exit(0); +} + +redraw() +{ + clear(); + refresh(); + + touchwin(radar); + wrefresh(radar); + touchwin(planes); + wrefresh(planes); + touchwin(credit); + wrefresh(credit); + + /* refresh input last to get cursor in right place */ + touchwin(input); + wrefresh(input); + fflush(stdout); +} + + +done_screen() +{ + clear(); + refresh(); + endwin(); /* clean up curses */ +} diff --git a/games/atc/include.h b/games/atc/include.h new file mode 100644 index 0000000..084a3e5 --- /dev/null +++ b/games/atc/include.h @@ -0,0 +1,50 @@ +/* + * Copyright (c) 1987 by Ed James, UC Berkeley. All rights reserved. + * + * Copy permission is hereby granted provided that this notice is + * retained on all partial or complete copies. + * + * For more info on this and all of my stuff, mail edjames@berkeley.edu. + */ + +#include +#include +#ifdef SYSV +#include +#endif +#include + +#ifdef BSD +#include +#include +#include +#endif + +#ifdef SYSV +#include +#include +#include +#include +#endif + +#include +#include + +#include + +#ifdef SYSV +#define index strchr +#define rindex strrchr +#define bcopy(a,b,c) memcpy((b), (a), (c)) +#define bzero(a,b) memset((a), '\0', (b)) +#define srandom srand +#define random rand +#define sgttyb termio +#define sg_erase c_cc[2] +#define sg_kill c_cc[3] +#endif + +#include "def.h" +#include "struct.h" +#include "extern.h" +#include "tunable.h" diff --git a/games/atc/input.c b/games/atc/input.c new file mode 100644 index 0000000..7a31b54 --- /dev/null +++ b/games/atc/input.c @@ -0,0 +1,626 @@ +/* + * Copyright (c) 1987 by Ed James, UC Berkeley. All rights reserved. + * + * Copy permission is hereby granted provided that this notice is + * retained on all partial or complete copies. + * + * For more info on this and all of my stuff, mail edjames@berkeley.edu. + */ + +#ifndef lint +static char sccsid[] = "@(#)input.c 1.2 (Berkeley) 10/22/87"; +#endif not lint + +#include "include.h" + +#define MAXRULES 6 +#define MAXDEPTH 15 + +#define RETTOKEN '\n' +#ifdef SYSV +#define CRTOKEN '\r' +#endif +#define REDRAWTOKEN '\014' /* CTRL(L) */ +#define SHELLTOKEN '!' +#define HELPTOKEN '?' +#define ALPHATOKEN 256 +#define NUMTOKEN 257 + +typedef struct { + int token; + int to_state; + char *str; + char *(*func)(); +} RULE; + +typedef struct { + int num_rules; + RULE *rule; +} STATE; + +typedef struct { + char str[20]; + int state; + int rule; + int ch; + int pos; +} STACK; + +#define T_RULE stack[level].rule +#define T_STATE stack[level].state +#define T_STR stack[level].str +#define T_POS stack[level].pos +#define T_CH stack[level].ch + +#define NUMELS(a) (sizeof (a) / sizeof (*(a))) + +#define NUMSTATES NUMELS(st) + +char *setplane(), *circle(), *left(), *right(), *Left(), *Right(), + *beacon(), *ex_it(), *climb(), *descend(), *setalt(), *setrelalt(), + *benum(), *to_dir(), *rel_dir(), *delayb(), *mark(), *unmark(), + *airport(), *turn(), *ignore(); + +RULE state0[] = { { ALPHATOKEN, 1, "%c:", setplane}, + { RETTOKEN, -1, "", NULL }, +#ifdef SYSV + { CRTOKEN, -1, "", NULL }, +#endif + { HELPTOKEN, 12, " [a-z]", NULL }}, + state1[] = { { 't', 2, " turn", turn }, + { 'a', 3, " altitude:", NULL }, + { 'c', 4, " circle", circle }, + { 'm', 7, " mark", mark }, + { 'u', 7, " unmark", unmark }, + { 'i', 7, " ignore", ignore }, + { HELPTOKEN, 12, " tacmui", NULL }}, + state2[] = { { 'l', 6, " left", left }, + { 'r', 6, " right", right }, + { 'L', 4, " left 90", Left }, + { 'R', 4, " right 90", Right }, + { 't', 11, " towards", NULL }, + { 'w', 4, " to 0", to_dir }, + { 'e', 4, " to 45", to_dir }, + { 'd', 4, " to 90", to_dir }, + { 'c', 4, " to 135", to_dir }, + { 'x', 4, " to 180", to_dir }, + { 'z', 4, " to 225", to_dir }, + { 'a', 4, " to 270", to_dir }, + { 'q', 4, " to 315", to_dir }, + { HELPTOKEN, 12, " lrLRt", NULL }}, + state3[] = { { '+', 10, " climb", climb }, + { 'c', 10, " climb", climb }, + { '-', 10, " descend", descend }, + { 'd', 10, " descend", descend }, + { NUMTOKEN, 7, " %c000 feet", setalt }, + { HELPTOKEN, 12, " +-cd[0-9]", NULL }}, + state4[] = { { '@', 9, " at", NULL }, + { 'a', 9, " at", NULL }, + { RETTOKEN, -1, "", NULL }, +#ifdef SYSV + { CRTOKEN, -1, "", NULL }, +#endif + { HELPTOKEN, 12, " @a", NULL }}, + state5[] = { { NUMTOKEN, 7, "%c", delayb }, + { HELPTOKEN, 12, " [0-9]", NULL }}, + state6[] = { { '@', 9, " at", NULL }, + { 'a', 9, " at", NULL }, + { 'w', 4, " 0", rel_dir }, + { 'e', 4, " 45", rel_dir }, + { 'd', 4, " 90", rel_dir }, + { 'c', 4, " 135", rel_dir }, + { 'x', 4, " 180", rel_dir }, + { 'z', 4, " 225", rel_dir }, + { 'a', 4, " 270", rel_dir }, + { 'q', 4, " 315", rel_dir }, + { RETTOKEN, -1, "", NULL }, +#ifdef SYSV + { CRTOKEN, -1, "", NULL }, +#endif + { HELPTOKEN, 12, " @a",NULL }}, + state7[] = { { RETTOKEN, -1, "", NULL }, +#ifdef SYSV + { CRTOKEN, -1, "", NULL }, +#endif + { HELPTOKEN, 12, " ", NULL }}, + state8[] = { { NUMTOKEN, 4, "%c", benum }, + { HELPTOKEN, 12, " [0-9]", NULL }}, + state9[] = { { 'b', 5, " beacon #", NULL }, + { '*', 5, " beacon #", NULL }, + { HELPTOKEN, 12, " b*", NULL }}, + state10[] = { { NUMTOKEN, 7, " %c000 ft", setrelalt}, + { HELPTOKEN, 12, " [0-9]", NULL }}, + state11[] = { { 'b', 8, " beacon #", beacon }, + { '*', 8, " beacon #", beacon }, + { 'e', 8, " exit #", ex_it }, + { 'a', 8, " airport #", airport }, + { HELPTOKEN, 12, " b*ea", NULL }}, + state12[] = { { -1, -1, "", NULL }}; + +#define DEF_STATE(s) { NUMELS(s), (s) } + +STATE st[] = { + DEF_STATE(state0), DEF_STATE(state1), DEF_STATE(state2), + DEF_STATE(state3), DEF_STATE(state4), DEF_STATE(state5), + DEF_STATE(state6), DEF_STATE(state7), DEF_STATE(state8), + DEF_STATE(state9), DEF_STATE(state10), DEF_STATE(state11), + DEF_STATE(state12) +}; + +PLANE p; +STACK stack[MAXDEPTH]; +int level; +int tval; +int dest_type, dest_no, dir; + +pop() +{ + if (level == 0) + return (-1); + level--; + + ioclrtoeol(T_POS); + + strcpy(T_STR, ""); + T_RULE = -1; + T_CH = -1; + return (0); +} + +rezero() +{ + iomove(0); + + level = 0; + T_STATE = 0; + T_RULE = -1; + T_CH = -1; + T_POS = 0; + strcpy(T_STR, ""); +} + +push(ruleno, ch) +{ + int newstate, newpos; + + (void)sprintf(T_STR, st[T_STATE].rule[ruleno].str, tval); + T_RULE = ruleno; + T_CH = ch; + newstate = st[T_STATE].rule[ruleno].to_state; + newpos = T_POS + strlen(T_STR); + + ioaddstr(T_POS, T_STR); + + if (level == 0) + ioclrtobot(); + level++; + T_STATE = newstate; + T_POS = newpos; + T_RULE = -1; + strcpy(T_STR, ""); +} + +getcommand() +{ + int c, i, done; + char *s, *(*func)(); + PLANE *pp; + + rezero(); + + do { + c = gettoken(); + if (c == tty_new.sg_erase) { + if (pop() < 0) + noise(); + } else if (c == tty_new.sg_kill) { + while (pop() >= 0) + ; + } else { + done = 0; + for (i = 0; i < st[T_STATE].num_rules; i++) { + if (st[T_STATE].rule[i].token == c || + st[T_STATE].rule[i].token == tval) { + push(i, (c >= ALPHATOKEN) ? tval : c); + done = 1; + break; + } + } + if (!done) + noise(); + } + } while (T_STATE != -1); + + if (level == 1) + return (1); /* forced update */ + + dest_type = T_NODEST; + + for (i = 0; i < level; i++) { + func = st[stack[i].state].rule[stack[i].rule].func; + if (func != NULL) + if ((s = (*func)(stack[i].ch)) != NULL) { + ioerror(stack[i].pos, strlen(stack[i].str), s); + return (-1); + } + } + + pp = findplane(p.plane_no); + if (pp->new_altitude != p.new_altitude) + pp->new_altitude = p.new_altitude; + else if (pp->status != p.status) + pp->status = p.status; + else { + pp->new_dir = p.new_dir; + pp->delayd = p.delayd; + pp->delayd_no = p.delayd_no; + } + return (0); +} + +noise() +{ + putchar('\07'); + fflush(stdout); +} + +gettoken() +{ + while ((tval = getAChar()) == REDRAWTOKEN || tval == SHELLTOKEN) + { + if (tval == SHELLTOKEN) + { +#ifdef BSD + struct itimerval itv; + itv.it_value.tv_sec = 0; + itv.it_value.tv_usec = 0; + setitimer(ITIMER_REAL, &itv, NULL); +#endif +#ifdef SYSV + int aval; + aval = alarm(0); +#endif + if (fork() == 0) /* child */ + { + char *shell, *base, *getenv(), *strrchr(); + + setuid(getuid()); /* turn off setuid bit */ + done_screen(); + + /* run user's favorite shell */ + if ((shell = getenv("SHELL")) != NULL) + { + base = strrchr(shell, '/'); + if (base == NULL) + base = shell; + else + base++; + execl(shell, base, 0); + } + else + execl("/bin/sh", "sh", 0); + + exit(0); /* oops */ + } + + wait(0); +#ifdef BSD + ioctl(fileno(stdin), TIOCSETP, &tty_new); + itv.it_value.tv_sec = 0; + itv.it_value.tv_usec = 1; + itv.it_interval.tv_sec = sp->update_secs; + itv.it_interval.tv_usec = 0; + setitimer(ITIMER_REAL, &itv, NULL); +#endif +#ifdef SYSV + ioctl(fileno(stdin), TCSETAW, &tty_new); + alarm(aval); +#endif + } + redraw(); + } + + if (isdigit(tval)) + return (NUMTOKEN); + else if (isalpha(tval)) + return (ALPHATOKEN); + else + return (tval); +} + +char * +setplane(c) +{ + PLANE *pp; + + pp = findplane(number(c)); + if (pp == NULL) + return ("Unknown Plane"); + bcopy(pp, &p, sizeof (p)); + p.delayd = 0; + return (NULL); +} + +char * +turn(c) +{ + if (p.altitude == 0) + return ("Planes at airports may not change direction"); + return (NULL); +} + +char * +circle(c) +{ + if (p.altitude == 0) + return ("Planes cannot circle on the ground"); + p.new_dir = MAXDIR; + return (NULL); +} + +char * +left(c) +{ + dir = D_LEFT; + p.new_dir = p.dir - 1; + if (p.new_dir < 0) + p.new_dir += MAXDIR; + return (NULL); +} + +char * +right(c) +{ + dir = D_RIGHT; + p.new_dir = p.dir + 1; + if (p.new_dir > MAXDIR) + p.new_dir -= MAXDIR; + return (NULL); +} + +char * +Left(c) +{ + p.new_dir = p.dir - 2; + if (p.new_dir < 0) + p.new_dir += MAXDIR; + return (NULL); +} + +char * +Right(c) +{ + p.new_dir = p.dir + 2; + if (p.new_dir > MAXDIR) + p.new_dir -= MAXDIR; + return (NULL); +} + +char * +delayb(c) +{ + int xdiff, ydiff; + + c -= '0'; + + if (c >= sp->num_beacons) + return ("Unknown beacon"); + xdiff = sp->beacon[c].x - p.xpos; + xdiff = SGN(xdiff); + ydiff = sp->beacon[c].y - p.ypos; + ydiff = SGN(ydiff); + if (xdiff != displacement[p.dir].dx || ydiff != displacement[p.dir].dy) + return ("Beacon is not in flight path"); + p.delayd = 1; + p.delayd_no = c; + + if (dest_type != T_NODEST) { + switch (dest_type) { + case T_BEACON: + xdiff = sp->beacon[dest_no].x - sp->beacon[c].x; + ydiff = sp->beacon[dest_no].y - sp->beacon[c].y; + break; + case T_EXIT: + xdiff = sp->exit[dest_no].x - sp->beacon[c].x; + ydiff = sp->exit[dest_no].y - sp->beacon[c].y; + break; + case T_AIRPORT: + xdiff = sp->airport[dest_no].x - sp->beacon[c].x; + ydiff = sp->airport[dest_no].y - sp->beacon[c].y; + break; + default: + return ("Bad case in delayb! Get help!"); + break; + } + if (xdiff == 0 && ydiff == 0) + return ("Would already be there"); + p.new_dir = DIR_FROM_DXDY(xdiff, ydiff); + if (p.new_dir == p.dir) + return ("Already going in that direction"); + } + return (NULL); +} + +char * +beacon(c) +{ + dest_type = T_BEACON; + return (NULL); +} + +char * +ex_it(c) +{ + dest_type = T_EXIT; + return (NULL); +} + +char * +airport(c) +{ + dest_type = T_AIRPORT; + return (NULL); +} + +char * +climb(c) +{ + dir = D_UP; + return (NULL); +} + +char * +descend(c) +{ + dir = D_DOWN; + return (NULL); +} + +char * +setalt(c) +{ + if ((p.altitude == c - '0') && (p.new_altitude == p.altitude)) + return ("Already at that altitude"); + p.new_altitude = c - '0'; + return (NULL); +} + +char * +setrelalt(c) +{ + if (c == 0) + return ("altitude not changed"); + + switch (dir) { + case D_UP: + p.new_altitude = p.altitude + c - '0'; + break; + case D_DOWN: + p.new_altitude = p.altitude - (c - '0'); + break; + default: + return ("Unknown case in setrelalt! Get help!"); + break; + } + if (p.new_altitude < 0) + return ("Altitude would be too low"); + else if (p.new_altitude > 9) + return ("Altitude would be too high"); + return (NULL); +} + +char * +benum(c) +{ + dest_no = c -= '0'; + + switch (dest_type) { + case T_BEACON: + if (c >= sp->num_beacons) + return ("Unknown beacon"); + p.new_dir = DIR_FROM_DXDY(sp->beacon[c].x - p.xpos, + sp->beacon[c].y - p.ypos); + break; + case T_EXIT: + if (c >= sp->num_exits) + return ("Unknown exit"); + p.new_dir = DIR_FROM_DXDY(sp->exit[c].x - p.xpos, + sp->exit[c].y - p.ypos); + break; + case T_AIRPORT: + if (c >= sp->num_airports) + return ("Unknown airport"); + p.new_dir = DIR_FROM_DXDY(sp->airport[c].x - p.xpos, + sp->airport[c].y - p.ypos); + break; + default: + return ("Unknown case in benum! Get help!"); + break; + } + return (NULL); +} + +char * +to_dir(c) +{ + p.new_dir = dir_no(c); + return (NULL); +} + +char * +rel_dir(c) +{ + int angle; + + angle = dir_no(c); + switch (dir) { + case D_LEFT: + p.new_dir = p.dir - angle; + if (p.new_dir < 0) + p.new_dir += MAXDIR; + break; + case D_RIGHT: + p.new_dir = p.dir + angle; + if (p.new_dir >= MAXDIR) + p.new_dir -= MAXDIR; + break; + default: + return ("Bizarre direction in rel_dir! Get help!"); + break; + } + return (NULL); +} + +char * +mark(c) +{ + if (p.altitude == 0) + return ("Cannot mark planes on the ground"); + if (p.status == S_MARKED) + return ("Already marked"); + p.status = S_MARKED; + return (NULL); +} + +char * +unmark(c) +{ + if (p.altitude == 0) + return ("Cannot unmark planes on the ground"); + if (p.status == S_UNMARKED) + return ("Already unmarked"); + p.status = S_UNMARKED; + return (NULL); +} + +char * +ignore(c) +{ + if (p.altitude == 0) + return ("Cannot ignore planes on the ground"); + if (p.status == S_IGNORED) + return ("Already ignored"); + p.status = S_IGNORED; + return (NULL); +} + +dir_no(ch) + char ch; +{ + int dir; + + switch (ch) { + case 'w': dir = 0; break; + case 'e': dir = 1; break; + case 'd': dir = 2; break; + case 'c': dir = 3; break; + case 'x': dir = 4; break; + case 'z': dir = 5; break; + case 'a': dir = 6; break; + case 'q': dir = 7; break; + default: + fprintf(stderr, "bad character in dir_no\n"); + break; + } + return (dir); +} diff --git a/games/atc/lex.l b/games/atc/lex.l new file mode 100644 index 0000000..dde6315 --- /dev/null +++ b/games/atc/lex.l @@ -0,0 +1,28 @@ +%{ +/* + * Copyright (c) 1987 by Ed James, UC Berkeley. All rights reserved. + * + * Copy permission is hereby granted provided that this notice is + * retained on all partial or complete copies. + * + * For more info on this and all of my stuff, mail edjames@berkeley.edu. + */ + +#include "y.tab.h" +extern int line; +%} +%% +[0-9]+ { yylval.ival = atoi(yytext); return(ConstOp); } +height { return(HeightOp); } +width { return(WidthOp); } +newplane { return(NewplaneOp); } +update { return(UpdateOp); } +airport { return(AirportOp); } +line { return(LineOp); } +exit { return(ExitOp); } +beacon { return(BeaconOp); } +[wedcxzaq] { yylval.cval = *yytext; return (DirOp); } +[ \t]+ { } +#[^\n]*\n { line++; } +\n { line++; } +. { return *yytext; } diff --git a/games/atc/list.c b/games/atc/list.c new file mode 100644 index 0000000..5498e59 --- /dev/null +++ b/games/atc/list.c @@ -0,0 +1,75 @@ +/* + * Copyright (c) 1987 by Ed James, UC Berkeley. All rights reserved. + * + * Copy permission is hereby granted provided that this notice is + * retained on all partial or complete copies. + * + * For more info on this and all of my stuff, mail edjames@berkeley.edu. + */ + +#include "include.h" + +PLANE * +newplane() +{ + return ((PLANE *) calloc(1, sizeof (PLANE))); +} + +append(l, p) + LIST *l; + PLANE *p; +{ + PLANE *q = NULL, *r = NULL; + + if (l->head == NULL) { + p->next = p->prev = NULL; + l->head = l->tail = p; + } else { + q = l -> head; + + while (q != NULL && q->plane_no < p->plane_no) { + r = q; + q = q -> next; + } + + if (q) { + if (r) { + p->prev = r; + r->next = p; + p->next = q; + q->prev = p; + } else { + p->next = q; + p->prev = NULL; + q->prev = p; + l->head = p; + } + } else { + l->tail->next = p; + p->next = NULL; + p->prev = l->tail; + l->tail = p; + } + } +} + +delete(l, p) + LIST *l; + PLANE *p; +{ + if (l->head == NULL) + loser(p, "deleted a non-existant plane! Get help!"); + + if (l->head == p && l->tail == p) + l->head = l->tail = NULL; + else if (l->head == p) { + l->head = p->next; + l->head->prev = NULL; + } else if (l->tail == p) { + l->tail = p->prev; + l->tail->next = NULL; + } else { + p->prev->next = p->next; + p->next->prev = p->prev; + } +} diff --git a/games/atc/log.c b/games/atc/log.c new file mode 100644 index 0000000..cf92d85 --- /dev/null +++ b/games/atc/log.c @@ -0,0 +1,213 @@ +/* + * Copyright (c) 1987 by Ed James, UC Berkeley. All rights reserved. + * + * Copy permission is hereby granted provided that this notice is + * retained on all partial or complete copies. + * + * For more info on this and all of my stuff, mail edjames@berkeley.edu. + */ + +#ifndef lint +static char sccsid[] = "@(#)log.c 1.4 (Berkeley) 12/26/87"; +#endif not lint + +#include "include.h" + +compar(a, b) + SCORE *a, *b; +{ + if (b->planes == a->planes) + return (b->time - a->time); + else + return (b->planes - a->planes); +} + +#define SECAMIN 60 +#define MINAHOUR 60 +#define HOURADAY 24 +#define SECAHOUR (SECAMIN * MINAHOUR) +#define SECADAY (SECAHOUR * HOURADAY) +#define DAY(t) ((t) / SECADAY) +#define HOUR(t) (((t) % SECADAY) / SECAHOUR) +#define MIN(t) (((t) % SECAHOUR) / SECAMIN) +#define SEC(t) ((t) % SECAMIN) + +char * +timestr(t) +{ + static char s[80]; + + if (DAY(t) > 0) + (void)sprintf(s, "%dd+%02dhrs", DAY(t), HOUR(t)); + else if (HOUR(t) > 0) + (void)sprintf(s, "%d:%02d:%02d", HOUR(t), MIN(t), SEC(t)); + else if (MIN(t) > 0) + (void)sprintf(s, "%d:%02d", MIN(t), SEC(t)); + else if (SEC(t) > 0) + (void)sprintf(s, ":%02d", SEC(t)); + else + *s = '\0'; + + return (s); +} + +log_score(list_em) +{ + register int i, fd, num_scores = 0, good, changed = 0, found = 0; + struct passwd *pw; + FILE *fp; + char *cp, logstr[BUFSIZ], *index(), *rindex(); + SCORE score[100], thisscore; +#ifdef SYSV + struct utsname name; +#endif + + strcpy(logstr, SPECIAL_DIR); + strcat(logstr, LOG); + + umask(0); + fd = open(logstr, O_CREAT|O_RDWR, 0644); + if (fd < 0) { + perror(logstr); + return (-1); + } + /* + * This is done to take advantage of stdio, while still + * allowing a O_CREAT during the open(2) of the log file. + */ + fp = fdopen(fd, "r+"); + if (fp == NULL) { + perror(logstr); + return (-1); + } +#ifdef BSD + if (flock(fileno(fp), LOCK_EX) < 0) +#endif +#ifdef SYSV + while (lockf(fileno(fp), F_LOCK, 1) < 0) +#endif + { + perror("flock"); + return (-1); + } + for (;;) { + good = fscanf(fp, "%s %s %s %d %d %d", + score[num_scores].name, + score[num_scores].host, + score[num_scores].game, + &score[num_scores].planes, + &score[num_scores].time, + &score[num_scores].real_time); + if (good != 6 || ++num_scores >= NUM_SCORES) + break; + } + if (!test_mode && !list_em) { + if ((pw = (struct passwd *) getpwuid(getuid())) == NULL) { + fprintf(stderr, + "getpwuid failed for uid %d. Who are you?\n", + getuid()); + return (-1); + } + strcpy(thisscore.name, pw->pw_name); +#ifdef BSD + if (gethostname(thisscore.host, sizeof (thisscore.host)) < 0) { + perror("gethostname"); + return (-1); + } +#endif +#ifdef SYSV + uname(&name); + strcpy(thisscore.host, name.sysname); +#endif + + cp = rindex(file, '/'); + if (cp == NULL) { + fprintf(stderr, "log: where's the '/' in %s?\n", file); + return (-1); + } + cp++; + strcpy(thisscore.game, cp); + + thisscore.time = clock; + thisscore.planes = safe_planes; + thisscore.real_time = time(0) - start_time; + + for (i = 0; i < num_scores; i++) { + if (strcmp(thisscore.name, score[i].name) == 0 && + strcmp(thisscore.host, score[i].host) == 0 && + strcmp(thisscore.game, score[i].game) == 0) { + if (thisscore.time > score[i].time) { + score[i].time = thisscore.time; + score[i].planes = thisscore.planes; + score[i].real_time = + thisscore.real_time; + changed++; + } + found++; + break; + } + } + if (!found) { + for (i = 0; i < num_scores; i++) { + if (thisscore.time > score[i].time) { + if (num_scores < NUM_SCORES) + num_scores++; + bcopy(&score[i], + &score[num_scores - 1], + sizeof (score[i])); + bcopy(&thisscore, &score[i], + sizeof (score[i])); + changed++; + break; + } + } + } + if (!found && !changed && num_scores < NUM_SCORES) { + bcopy(&thisscore, &score[num_scores], + sizeof (score[num_scores])); + num_scores++; + changed++; + } + + if (changed) { + if (found) + puts("You beat your previous score!"); + else + puts("You made the top players list!"); + qsort(score, num_scores, sizeof (*score), compar); + rewind(fp); + for (i = 0; i < num_scores; i++) + fprintf(fp, "%s %s %s %d %d %d\n", + score[i].name, score[i].host, + score[i].game, score[i].planes, + score[i].time, score[i].real_time); + } else { + if (found) + puts("You didn't beat your previous score."); + else + puts("You didn't make the top players list."); + } + putchar('\n'); + } +#ifdef BSD + flock(fileno(fp), LOCK_UN); +#endif +#ifdef SYSV + /* lock will evaporate upon close */ +#endif + fclose(fp); + printf("%2s: %-8s %-8s %-18s %4s %9s %4s\n", "#", "name", "host", + "game", "time", "real time", "planes safe"); + puts("-------------------------------------------------------------------------------"); + for (i = 0; i < num_scores; i++) { + cp = index(score[i].host, '.'); + if (cp != NULL) + *cp = '\0'; + printf("%2d: %-8s %-8s %-18s %4d %9s %4d\n", i + 1, + score[i].name, score[i].host, score[i].game, + score[i].time, timestr(score[i].real_time), + score[i].planes); + } + putchar('\n'); + return (0); +} diff --git a/games/atc/main.c b/games/atc/main.c new file mode 100644 index 0000000..24218d7 --- /dev/null +++ b/games/atc/main.c @@ -0,0 +1,279 @@ +/* + * Copyright (c) 1987 by Ed James, UC Berkeley. All rights reserved. + * + * Copy permission is hereby granted provided that this notice is + * retained on all partial or complete copies. + * + * For more info on this and all of my stuff, mail edjames@berkeley.edu. + */ + +#include "include.h" + +main(ac, av) + char *av[]; +{ + int seed; + int f_usage = 0, f_list = 0, f_showscore = 0; + int f_printpath = 0; + char *file = NULL; + char *name, *ptr; +#ifdef BSD + struct itimerval itv; +#endif + extern int update(), quit(), log_score(); + extern char *default_game(), *okay_game(); + + start_time = seed = time(0); + + name = *av++; + while (*av) { +#ifndef SAVEDASH + if (**av == '-') + *++*av; + else + break; +#endif + ptr = *av++; + while (*ptr) { + switch (*ptr) { + case '?': + case 'u': + f_usage++; + break; + case 'l': + f_list++; + break; + case 's': + case 't': + f_showscore++; + break; + case 'p': + f_printpath++; + break; + case 'r': + seed = atoi(*av); + av++; + break; + case 'f': + case 'g': + file = *av; + av++; + break; + default: + fprintf(stderr, "Unknown option '%c'\n", *ptr, + name); + f_usage++; + break; + } + ptr++; + } + } + srandom(seed); + + if (f_usage) + fprintf(stderr, + "Usage: %s -[u?lstp] [-[gf] game_name] [-r random seed]\n", + name); + if (f_showscore) + log_score(1); + if (f_list) + list_games(); + if (f_printpath) { + char buf[100]; + + strcpy(buf, SPECIAL_DIR); + buf[strlen(buf) - 1] = '\0'; + puts(buf); + } + + if (f_usage || f_showscore || f_list || f_printpath) + exit(0); + + if (file == NULL) + file = default_game(); + else + file = okay_game(file); + + if (file == NULL || read_file(file) < 0) + exit(1); + + init_gr(); + setup_screen(sp); + + addplane(); + + signal(SIGINT, quit); + signal(SIGQUIT, quit); +#ifdef BSD + signal(SIGTSTP, SIG_IGN); + signal(SIGSTOP, SIG_IGN); +#endif + signal(SIGHUP, log_score); + signal(SIGTERM, log_score); + +#ifdef BSD + ioctl(fileno(stdin), TIOCGETP, &tty_start); + bcopy(&tty_start, &tty_new, sizeof(tty_new)); + tty_new.sg_flags |= CBREAK; + tty_new.sg_flags &= ~ECHO; + ioctl(fileno(stdin), TIOCSETP, &tty_new); +#endif + +#ifdef SYSV + ioctl(fileno(stdin), TCGETA, &tty_start); + bcopy(&tty_start, &tty_new, sizeof(tty_new)); + tty_new.c_lflag &= ~ICANON; + tty_new.c_lflag &= ~ECHO; + tty_new.c_cc[VMIN] = 1; + tty_new.c_cc[VTIME] = 0; + ioctl(fileno(stdin), TCSETAW, &tty_new); +#endif + + signal(SIGALRM, update); + +#ifdef BSD + itv.it_value.tv_sec = 0; + itv.it_value.tv_usec = 1; + itv.it_interval.tv_sec = sp->update_secs; + itv.it_interval.tv_usec = 0; + setitimer(ITIMER_REAL, &itv, NULL); +#endif +#ifdef SYSV + alarm(sp->update_secs); +#endif + + for (;;) { + if (getcommand() != 1) + planewin(); + else { +#ifdef BSD + itv.it_value.tv_sec = 0; + itv.it_value.tv_usec = 0; + setitimer(ITIMER_REAL, &itv, NULL); +#endif +#ifdef SYSV + alarm(0); +#endif + + update(); + +#ifdef BSD + itv.it_value.tv_sec = sp->update_secs; + itv.it_value.tv_usec = 0; + itv.it_interval.tv_sec = sp->update_secs; + itv.it_interval.tv_usec = 0; + setitimer(ITIMER_REAL, &itv, NULL); +#endif +#ifdef SYSV + alarm(sp->update_secs); +#endif + } + } +} + +read_file(s) + char *s; +{ + extern FILE *yyin; + int retval; + + file = s; + yyin = fopen(s, "r"); + if (yyin == NULL) { + perror(s); + return (-1); + } + retval = yyparse(); + fclose(yyin); + + if (retval != 0) + return (-1); + else + return (0); +} + +char * +default_game() +{ + FILE *fp; + static char file[256]; + char line[256], games[256]; + + strcpy(games, SPECIAL_DIR); + strcat(games, GAMES); + + if ((fp = fopen(games, "r")) == NULL) { + perror(games); + return (NULL); + } + if (fgets(line, sizeof(line), fp) == NULL) { + fprintf(stderr, "%s: no default game available\n", games); + return (NULL); + } + fclose(fp); + line[strlen(line) - 1] = '\0'; + strcpy(file, SPECIAL_DIR); + strcat(file, line); + return (file); +} + +char * +okay_game(s) + char *s; +{ + FILE *fp; + static char file[256]; + char *ret = NULL, line[256], games[256]; + + strcpy(games, SPECIAL_DIR); + strcat(games, GAMES); + + if ((fp = fopen(games, "r")) == NULL) { + perror(games); + return (NULL); + } + while (fgets(line, sizeof(line), fp) != NULL) { + line[strlen(line) - 1] = '\0'; + if (strcmp(s, line) == 0) { + strcpy(file, SPECIAL_DIR); + strcat(file, line); + ret = file; + break; + } + } + fclose(fp); + if (ret == NULL) { + test_mode = 1; + ret = s; + fprintf(stderr, "%s: %s: game not found\n", games, s); + fprintf(stderr, "Your score will not be logged.\n"); + sleep(2); /* give the guy time to read it */ + } + return (ret); +} + +list_games() +{ + FILE *fp; + char line[256], games[256]; + int num_games = 0; + + strcpy(games, SPECIAL_DIR); + strcat(games, GAMES); + + if ((fp = fopen(games, "r")) == NULL) { + perror(games); + return (-1); + } + puts("available games:"); + while (fgets(line, sizeof(line), fp) != NULL) { + printf(" %s", line); + num_games++; + } + fclose(fp); + if (num_games == 0) { + fprintf(stderr, "%s: no games available\n", games); + return (-1); + } + return (0); +} diff --git a/games/atc/struct.h b/games/atc/struct.h new file mode 100644 index 0000000..1a02e08 --- /dev/null +++ b/games/atc/struct.h @@ -0,0 +1,73 @@ +/* + * Copyright (c) 1987 by Ed James, UC Berkeley. All rights reserved. + * + * Copy permission is hereby granted provided that this notice is + * retained on all partial or complete copies. + * + * For more info on this and all of my stuff, mail edjames@berkeley.edu. + */ + +typedef struct { + int x, y; + int dir; /* used only sometimes */ +} SCREEN_POS; + +typedef struct { + SCREEN_POS p1, p2; +} LINE; + +typedef SCREEN_POS EXIT; +typedef SCREEN_POS BEACON; +typedef SCREEN_POS AIRPORT; + +typedef struct { + int width, height; + int update_secs; + int newplane_time; + int num_exits; + int num_lines; + int num_beacons; + int num_airports; + EXIT *exit; + LINE *line; + BEACON *beacon; + AIRPORT *airport; +} C_SCREEN; + +typedef struct plane { + struct plane *next, *prev; + int status; + int plane_no; + int plane_type; + int orig_no; + int orig_type; + int dest_no; + int dest_type; + int altitude; + int new_altitude; + int dir; + int new_dir; + int fuel; + int xpos; + int ypos; + int delayd; + int delayd_no; +} PLANE; + +typedef struct { + PLANE *head, *tail; +} LIST; + +typedef struct { + char name[10]; + char host[256]; + char game[256]; + int planes; + int time; + int real_time; +} SCORE; + +typedef struct displacement { + int dx; + int dy; +} DISPLACEMENT; diff --git a/games/atc/tunable.c b/games/atc/tunable.c new file mode 100644 index 0000000..52241f7 --- /dev/null +++ b/games/atc/tunable.c @@ -0,0 +1,24 @@ +/* + * Copyright (c) 1987 by Ed James, UC Berkeley. All rights reserved. + * + * Copy permission is hereby granted provided that this notice is + * retained on all partial or complete copies. + * + * For more info on this and all of my stuff, mail edjames@berkeley.edu. + */ + +/* + * SPECIAL_DIR - Where the special files are kept. + * Change this to whatever you want. Be sure to have to path end + * with a '/', like "/usr/games/lib/atc/". + */ + +char SPECIAL_DIR[] = DEST; + +/* + * NUM_SCORES - Number of scores that are kept track of. + * Keep this greater than 0, but less than 100. + * 4 lines are printed above the score, one below + your prompt, so + * to prevent scrolling: 6 + NUM_SCORES <= 24 (lines on an average terminal). + */ +int NUM_SCORES = 18; diff --git a/games/atc/tunable.h b/games/atc/tunable.h new file mode 100644 index 0000000..685da72 --- /dev/null +++ b/games/atc/tunable.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) 1987 by Ed James, UC Berkeley. All rights reserved. + * + * Copy permission is hereby granted provided that this notice is + * retained on all partial or complete copies. + * + * For more info on this and all of my stuff, mail edjames@berkeley.edu. + */ + +extern char SPECIAL_DIR[]; + +extern int NUM_SCORES; diff --git a/games/atc/update.c b/games/atc/update.c new file mode 100644 index 0000000..cd8713a --- /dev/null +++ b/games/atc/update.c @@ -0,0 +1,365 @@ +/* + * Copyright (c) 1987 by Ed James, UC Berkeley. All rights reserved. + * + * Copy permission is hereby granted provided that this notice is + * retained on all partial or complete copies. + * + * For more info on this and all of my stuff, mail edjames@berkeley.edu. + */ + +#if !defined(lint) && defined(DOSCCS) +static char sccsid[] = "@(#)update.c 1.3.1 (2.11BSD) 1999/10/25"; +#endif + +#include "include.h" + +update() +{ + int i, dir_diff, unclean; + PLANE *pp, *p1, *p2, *p; + sigset_t set, oset; + + sigemptyset(&set); + sigaddset(&set, SIGINT); + (void)sigprocmask(SIG_BLOCK, &set, &oset); + + clock++; + erase_all(); + + /* put some planes in the air */ + do { + unclean = 0; + for (pp = ground.head; pp != NULL; pp = pp->next) { + if (pp->new_altitude > 0) { + delete(&ground, pp); + append(&air, pp); + unclean = 1; + break; + } + } + } while (unclean); + + /* do altitude change and basic movement */ + for (pp = air.head; pp != NULL; pp = pp->next) { + /* type 0 only move every other turn */ + if (pp->plane_type == 0 && clock & 1) + continue; + + pp->fuel--; + if (pp->fuel < 0) + loser(pp, "ran out of fuel."); + + pp->altitude += SGN(pp->new_altitude - pp->altitude); + + if (!pp->delayd) { + dir_diff = pp->new_dir - pp->dir; + /* + * Allow for circle commands + */ + if (pp->new_dir >= 0 && pp->new_dir < MAXDIR) { + if (dir_diff > MAXDIR/2) + dir_diff -= MAXDIR; + else if (dir_diff < -(MAXDIR/2)) + dir_diff += MAXDIR; + } + if (dir_diff > 2) + dir_diff = 2; + else if (dir_diff < -2) + dir_diff = -2; + pp->dir += dir_diff; + if (pp->dir >= MAXDIR) + pp->dir -= MAXDIR; + else if (pp->dir < 0) + pp->dir += MAXDIR; + } + pp->xpos += displacement[pp->dir].dx; + pp->ypos += displacement[pp->dir].dy; + + if (pp->delayd && pp->xpos == sp->beacon[pp->delayd_no].x && + pp->ypos == sp->beacon[pp->delayd_no].y) { + pp->delayd = 0; + if (pp->status == S_UNMARKED) + pp->status = S_MARKED; + } + + switch (pp->dest_type) { + case T_AIRPORT: + if (pp->xpos == sp->airport[pp->dest_no].x && + pp->ypos == sp->airport[pp->dest_no].y && + pp->altitude == 0) { + if (pp->dir != sp->airport[pp->dest_no].dir) + loser(pp, "landed in the wrong direction."); + else { + pp->status = S_GONE; + continue; + } + } + break; + case T_EXIT: + if (pp->xpos == sp->exit[pp->dest_no].x && + pp->ypos == sp->exit[pp->dest_no].y) { + if (pp->altitude != 9) + loser(pp, "exited at the wrong altitude."); + else { + pp->status = S_GONE; + continue; + } + } + break; + default: + loser(pp, "has a bizarre destination, get help!"); + } + if (pp->altitude > 9) + /* "this is impossible" */ + loser(pp, "exceded flight ceiling."); + if (pp->altitude <= 0) { + for (i = 0; i < sp->num_airports; i++) + if (pp->xpos == sp->airport[i].x && + pp->ypos == sp->airport[i].y) { + if (pp->dest_type == T_AIRPORT) + loser(pp, + "landed at the wrong airport."); + else + loser(pp, + "landed instead of exited."); + } + loser(pp, "crashed on the ground."); + } + if (pp->xpos < 1 || pp->xpos >= sp->width - 1 || + pp->ypos < 1 || pp->ypos >= sp->height - 1) { + for (i = 0; i < sp->num_exits; i++) + if (pp->xpos == sp->exit[i].x && + pp->ypos == sp->exit[i].y) { + if (pp->dest_type == T_EXIT) + loser(pp, + "exited via the wrong exit."); + else + loser(pp, + "exited instead of landed."); + } + loser(pp, "illegally left the flight arena."); + } + } + + /* + * Traverse the list once, deleting the planes that are gone. + */ + for (pp = air.head; pp != NULL; pp = p2) { + p2 = pp->next; + if (pp->status == S_GONE) { + safe_planes++; + delete(&air, pp); + } + } + + draw_all(); + + for (p1 = air.head; p1 != NULL; p1 = p1->next) + for (p2 = p1->next; p2 != NULL; p2 = p2->next) + if (too_close(p1, p2, 1)) { + static char buf[80]; + + (void)sprintf(buf, "collided with plane '%c'.", + name(p2)); + loser(p1, buf); + } + /* + * Check every other update. Actually, only add on even updates. + * Otherwise, prop jobs show up *on* entrance. Remember that + * we don't update props on odd updates. + */ + if ((rand() % sp->newplane_time) == 0) + addplane(); + + (void)sigprocmask(SIG_SETMASK, &oset, NULL); +} + +char * +command(pp) + PLANE *pp; +{ + static char buf[50], *bp, *comm_start; + char *index(); + + buf[0] = '\0'; + bp = buf; + (void)sprintf(bp, "%c%d%c%c%d: ", name(pp), pp->altitude, + (pp->fuel < LOWFUEL) ? '*' : ' ', + (pp->dest_type == T_AIRPORT) ? 'A' : 'E', pp->dest_no); + + comm_start = bp = index(buf, '\0'); + if (pp->altitude == 0) + (void)sprintf(bp, "Holding @ A%d", pp->orig_no); + else if (pp->new_dir >= MAXDIR || pp->new_dir < 0) + strcpy(bp, "Circle"); + else if (pp->new_dir != pp->dir) + (void)sprintf(bp, "%d", dir_deg(pp->new_dir)); + + bp = index(buf, '\0'); + if (pp->delayd) + (void)sprintf(bp, " @ B%d", pp->delayd_no); + + bp = index(buf, '\0'); + if (*comm_start == '\0' && + (pp->status == S_UNMARKED || pp->status == S_IGNORED)) + strcpy(bp, "---------"); + return (buf); +} + +/* char */ +name(p) + PLANE *p; +{ + if (p->plane_type == 0) + return ('A' + p->plane_no); + else + return ('a' + p->plane_no); +} + +number(l) +{ + if (l < 'a' && l > 'z' && l < 'A' && l > 'Z') + return (-1); + else if (l >= 'a' && l <= 'z') + return (l - 'a'); + else + return (l - 'A'); +} + +next_plane() +{ + static int last_plane = -1; + PLANE *pp; + int found, start_plane = last_plane; + + do { + found = 0; + last_plane++; + if (last_plane >= 26) + last_plane = 0; + for (pp = air.head; pp != NULL; pp = pp->next) + if (pp->plane_no == last_plane) { + found++; + break; + } + if (!found) + for (pp = ground.head; pp != NULL; pp = pp->next) + if (pp->plane_no == last_plane) { + found++; + break; + } + } while (found && last_plane != start_plane); + if (last_plane == start_plane) + return (-1); + return (last_plane); +} + +addplane() +{ + PLANE p, *pp, *p1; + int i, num_starts, close, rnd, rnd2, pnum; + + bzero(&p, sizeof (p)); + + p.status = S_MARKED; + p.plane_type = random() % 2; + + num_starts = sp->num_exits + sp->num_airports; + rnd = random() % num_starts; + + if (rnd < sp->num_exits) { + p.dest_type = T_EXIT; + p.dest_no = rnd; + } else { + p.dest_type = T_AIRPORT; + p.dest_no = rnd - sp->num_exits; + } + + /* loop until we get a plane not near another */ + for (i = 0; i < num_starts; i++) { + /* loop till we get a different start point */ + while ((rnd2 = random() % num_starts) == rnd) + ; + if (rnd2 < sp->num_exits) { + p.orig_type = T_EXIT; + p.orig_no = rnd2; + p.xpos = sp->exit[rnd2].x; + p.ypos = sp->exit[rnd2].y; + p.new_dir = p.dir = sp->exit[rnd2].dir; + p.altitude = p.new_altitude = 7; + close = 0; + for (p1 = air.head; p1 != NULL; p1 = p1->next) + if (too_close(p1, &p, 4)) { + close++; + break; + } + if (close) + continue; + } else { + p.orig_type = T_AIRPORT; + p.orig_no = rnd2 - sp->num_exits; + p.xpos = sp->airport[p.orig_no].x; + p.ypos = sp->airport[p.orig_no].y; + p.new_dir = p.dir = sp->airport[p.orig_no].dir; + p.altitude = p.new_altitude = 0; + } + p.fuel = sp->width + sp->height; + break; + } + if (i >= num_starts) + return (-1); + pnum = next_plane(); + if (pnum < 0) + return (-1); + p.plane_no = pnum; + + pp = newplane(); + bcopy(&p, pp, sizeof (p)); + + if (pp->orig_type == T_AIRPORT) + append(&ground, pp); + else + append(&air, pp); + + return (pp->dest_type); +} + +PLANE * +findplane(n) +{ + PLANE *pp; + + for (pp = air.head; pp != NULL; pp = pp->next) + if (pp->plane_no == n) + return (pp); + for (pp = ground.head; pp != NULL; pp = pp->next) + if (pp->plane_no == n) + return (pp); + return (NULL); +} + +too_close(p1, p2, dist) + PLANE *p1, *p2; +{ + if (ABS(p1->altitude - p2->altitude) <= dist && + ABS(p1->xpos - p2->xpos) <= dist && ABS(p1->ypos - p2->ypos) <= dist) + return (1); + else + return (0); +} + +dir_deg(d) +{ + switch (d) { + case 0: return (0); + case 1: return (45); + case 2: return (90); + case 3: return (135); + case 4: return (180); + case 5: return (225); + case 6: return (270); + case 7: return (315); + default: + return (-1); + } +} diff --git a/games/backgammon/Makefile b/games/backgammon/Makefile new file mode 100644 index 0000000..b712f17 --- /dev/null +++ b/games/backgammon/Makefile @@ -0,0 +1,51 @@ +# +# Copyright (c) 1980 Regents of the University of California. +# All rights reserved. The Berkeley software License Agreement +# specifies the terms and conditions for redistribution. +# +# @(#)Makefile 5.4 (Berkeley) 1/11/86 +# +DESTDIR= +SEPFLAG= -i +CFLAGS= -O -DV7 -w +OBJS= allow.o board.o check.o extra.o fancy.o init.o main.o move.o\ + odds.o one.o save.o subs.o table.o text.o message.o +TOBJS= allow.o board.o check.o data.o fancy.o init.o odds.o one.o save.o subs.o\ + table.o teach.o ttext1.o ttext2.o tutor.o +SRCS= allow.c board.c check.c data.c extra.c fancy.c init.c main.c\ + move.c odds.c one.c save.c subs.c table.c teach.c text.c ttext1.c\ + ttext2.c tutor.c message.c + +all: backgammon teachgammon backgammon.doc + +# Backgammon program +backgammon: $(OBJS) + -rm -f backgammon + cc ${SEPFLAG} -o backgammon $(OBJS) -ltermlib + +# Backgammon rules and tutorial +teachgammon: ${TOBJS} + -rm -f teachgammon + cc ${SEPFLAG} -o teachgammon $(TOBJS) -ltermlib + +# Header files back.h and tutor.h +allow.o board.o check.o extra.o fancy.o main.o move.o odds.o one.o save.o\ + subs.o table.o teach.o text.o ttext1.o ttext2.o: back.h +data.o tutor.o: back.h tutor.h + +# Update message. /tmp is always changing, so use it to ensure execution +message.c: /tmp + ex - message.c < Mesgfix + +# Documentation +backgammon.doc: backgammon.src + -rm -f backgammon.doc + nroff -man -Tcrt backgammon.src > backgammon.doc + +# Installation +install: all + install -s backgammon ${DESTDIR}/usr/games/backgammon + install -s teachgammon ${DESTDIR}/usr/games/teachgammon + +clean: + rm -f ${OBJS} ${TOBJS} backgammon teachgammon backgammon.doc errs diff --git a/games/backgammon/Mesgfix b/games/backgammon/Mesgfix new file mode 100644 index 0000000..7380a32 --- /dev/null +++ b/games/backgammon/Mesgfix @@ -0,0 +1,36 @@ +1,5c +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ +. +/Msccsid/c +static char Msccsid[] = "@(#)Mesgfix 5.2 (Berkeley) 1/8/86"; +. +/Last update/!date +mark a +g/Sun /s//Sunday, / +g/Mon /s//Monday, / +g/Tue /s//Tuesday, / +g/Wed /s//Wednesday, / +g/Thu /s//Thursday, / +g/Fri /s//Friday, / +g/Sat /s//Saturday, / +g/Jan /s//January / +g/Feb /s//February / +g/Mar /s//March / +g/Apr /s//April / +g/Jun /s//June / +g/Jul /s//July / +g/Aug /s//August / +g/Sep /s//September / +g/Oct /s//October / +g/Nov /s//November / +g/Dec /s//December / +g/ /s// / +'as/ ..:..:.. .../,/ +'as/^/ "Last update on / +'as/$/.",/ +w! +q diff --git a/games/backgammon/allow.c b/games/backgammon/allow.c new file mode 100644 index 0000000..e4f07b3 --- /dev/null +++ b/games/backgammon/allow.c @@ -0,0 +1,82 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#ifndef lint +static char sccsid[] = "@(#)allow.c 5.1 (Berkeley) 5/29/85"; +#endif not lint + +#include "back.h" + +movallow () { + + register int i, m, iold; + int r; + + if (d0) + swap; + m = (D0 == D1? 4: 2); + for (i = 0; i < 4; i++) + p[i] = bar; + i = iold = 0; + while (i < m) { + if (*offptr == 15) + break; + h[i] = 0; + if (board[bar]) { + if (i == 1 || m == 4) + g[i] = bar+cturn*D1; + else + g[i] = bar+cturn*D0; + if (r = makmove(i)) { + if (d0 || m == 4) + break; + swap; + movback (i); + if (i > iold) + iold = i; + for (i = 0; i < 4; i++) + p[i] = bar; + i = 0; + } else + i++; + continue; + } + if ((p[i] += cturn) == home) { + if (i > iold) + iold = i; + if (m == 2 && i) { + movback(i); + p[i--] = bar; + if (p[i] != bar) + continue; + else + break; + } + if (d0 || m == 4) + break; + swap; + movback (i); + for (i = 0; i < 4; i++) + p[i] = bar; + i = 0; + continue; + } + if (i == 1 || m == 4) + g[i] = p[i]+cturn*D1; + else + g[i] = p[i]+cturn*D0; + if (g[i]*cturn > home) { + if (*offptr >= 0) + g[i] = home; + else + continue; + } + if (board[p[i]]*cturn > 0 && (r = makmove(i)) == 0) + i++; + } + movback (i); + return (iold > i? iold: i); +} diff --git a/games/backgammon/back.h b/games/backgammon/back.h new file mode 100644 index 0000000..00acec0 --- /dev/null +++ b/games/backgammon/back.h @@ -0,0 +1,101 @@ + +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + * + * @(#)back.h 5.1 (Berkeley) 5/29/85 + */ + +#include + +#define rnum(r) (random()%r) +#define D0 dice[0] +#define D1 dice[1] +#define swap {D0 ^= D1; D1 ^= D0; D0 ^= D1; d0 = 1-d0;} + +/* + * + * Some numerical conventions: + * + * Arrays have white's value in [0], red in [1]. + * Numeric values which are one color or the other use + * -1 for white, 1 for red. + * Hence, white will be negative values, red positive one. + * This makes a lot of sense since white is going in decending + * order around the board, and red is ascending. + * + */ + +char EXEC[]; /* object for main program */ +char TEACH[]; /* object for tutorial program */ + +int pnum; /* color of player: + -1 = white + 1 = red + 0 = both + 2 = not yet init'ed */ +char args[100]; /* args passed to teachgammon and back */ +int acnt; /* length of args */ +int aflag; /* flag to ask for rules or instructions */ +int bflag; /* flag for automatic board printing */ +int cflag; /* case conversion flag */ +int hflag; /* flag for cleaning screen */ +int mflag; /* backgammon flag */ +int raflag; /* 'roll again' flag for recovered game */ +int rflag; /* recovered game flag */ +int tflag; /* cursor addressing flag */ +int rfl; /* saved value of rflag */ +int iroll; /* special flag for inputting rolls */ +int board[26]; /* board: negative values are white, + positive are red */ +int dice[2]; /* value of dice */ +int mvlim; /* 'move limit': max. number of moves */ +int mvl; /* working copy of mvlim */ +int p[5]; /* starting position of moves */ +int g[5]; /* ending position of moves (goals) */ +int h[4]; /* flag for each move if a man was hit */ +int cturn; /* whose turn it currently is: + -1 = white + 1 = red + 0 = just quitted + -2 = white just lost + 2 = red just lost */ +int d0; /* flag if dice have been reversed from + original position */ +int table[6][6]; /* odds table for possible rolls */ +int rscore; /* red's score */ +int wscore; /* white's score */ +int gvalue; /* value of game (64 max.) */ +int dlast; /* who doubled last (0 = neither) */ +int bar; /* position of bar for current player */ +int home; /* position of home for current player */ +int off[2]; /* number of men off board */ +int *offptr; /* pointer to off for current player */ +int *offopp; /* pointer to off for opponent */ +int in[2]; /* number of men in inner table */ +int *inptr; /* pointer to in for current player */ +int *inopp; /* pointer to in for opponent */ + +int ncin; /* number of characters in cin */ +char cin[100]; /* input line of current move + (used for reconstructing input after + a backspace) */ + +char *color[]; + /* colors as strings */ +char **colorptr; /* color of current player */ +char **Colorptr; /* color of current player, capitalized */ +int colen; /* length of color of current player */ + +struct sgttyb tty; /* tty information buffer */ +int old; /* original tty status */ +int noech; /* original tty status without echo */ +int raw; /* raw tty status, no echo */ + +int curr; /* row position of cursor */ +int curc; /* column position of cursor */ +int begscr; /* 'beginning' of screen + (not including board) */ + +int getout(); /* function to exit backgammon cleanly */ diff --git a/games/backgammon/backgammon.src b/games/backgammon/backgammon.src new file mode 100644 index 0000000..b68d945 --- /dev/null +++ b/games/backgammon/backgammon.src @@ -0,0 +1,195 @@ +.\" Copyright (c) 1980 Regents of the University of California. +.\" All rights reserved. The Berkeley software License Agreement +.\" specifies the terms and conditions for redistribution. +.\" +.\" @(#)backgammon.src 5.2 (Berkeley) 1/11/86 +.\" +.th BACKGAMMON PUBLIC \n(mo/\n(dy/\n(yr +.sh NAME +backgammon - the game of backgammon +.sh SYNOPSIS +.bd backgammon +[ - ] [ n r w b pr pw pb t\c +.it term +s\c +.it file +] +.sh DESCRIPTION +This program lets you play backgammon against the computer +or against a "friend". +All commands only are one letter, +so you don't need to type a carriage return, +except at the end of a move. +The program is mostly self documenting, +so that a question mark (?) will usually get some help. +If you answer `y' when the program asks if you want the rules, +you will get text explaining the rules of the game, +some hints on strategy, +instruction on how to use the program, +and a tutorial consisting of a practice game against the computer. +A description of how to use the program can be +obtained by answering `y' when it asks if you want instructions. +.s3 +The possible arguments for backgammon +(most are unnecesary but some are very convenient) +consist of: +.ne 11 +.s3 +.na +.lp 16 8 +.bn n +don't ask for rules or instructions +.lp 16 8 +.bn r +player is red (implies n) +.lp 16 8 +.bn w +player is white (implies n) +.lp 16 8 +.bn b +two players, red and white (implies n) +.lp 16 8 +.bn pr +print the board before red's turn +.lp 16 8 +.bn pw +print the board before white's turn +.lp 16 8 +.bn pb +print the board before both player's turn +.lp 16 8 +.bn t\fiterm +terminal is type +.it term, +uses /etc/termcap +.lp 16 8 +.bn s\fifile +recover previously saved game from +.it file. +(This can also be done by executing the saved file, +i.e., typing its name in as a command) +.s3 +.ad +.i0 +Arguments may be optionally preceded by a `-'. +Several arguments may be concatenated together, +but not after `s' or `t' arguments, +since they can be followed by an arbitrary string. +Any unrecognized arguments are ignored. +An argument of a lone `-' gets a description of possible arguments. +.s3 +If +.it term +has capabilities for direct cursor movement (see ttycap(VII)), +.it backgammon +"fixes" the board after each move, +so the board does not need to be reprinted, +unless the screen suffers some horrendous malady. +Also, any `p' option will be ignored. +(The `t' option is not necessary unless the terminal type does not match +the entry in the /etc/htmp data base.) +.sh QUICK\ REFERENCE +When the program prompts by typing only your color, +type a space or carriage return to roll, or +.ne 5 +.s3 +.na +.lp 16 8 +.bn d +to double +.lp 16 8 +.bn p +to print the board +.lp 16 8 +.bn q +to quit +.lp 16 8 +.bn s +to save the game for later +.s3 +.i0 +.ad +When the program prompts with 'Move:', type +.ne 4 +.s3 +.na +.lp 16 8 +.bn p +to print the board +.lp 16 8 +.bn q +to quit +.lp 16 8 +.bn s +to save the game +.ad +.i0 +.s3 +or a +.it move, +which is a sequence of +.ne 4 +.s3 +.na +.lp 16 8 +.bn s-f +move from +.bd s +to +.bd f +.lp 16 8 +.bn s/r +move one man on +.bd s +the roll +.bd r +.ad +.i0 +.s3 +separated by commas or spaces and ending with a newline. +Available abbreviations are +.ne 4 +.s3 +.na +.lp 18 10 +.bn s-f1-f2 +means +.bd s-f1,f1-f2 +.lp 18 10 +.bn s/r1r2 +means +.bd s/r1,s/r2 +.ad +.i0 +.s3 +Use `b' for bar and `h' for home, +or 0 or 25 as appropriate. +.sh AUTHOR +Alan Char +.sh FILES +.lp 30 25 +.bn /mnt/alan/:toys/teachgammon +- rules and tutorial +.br +.lp 30 25 +.bn /etc/htmp +- data base on user's environment +.br +.lp 30 25 +.bn /etc/termcap +- terminal capabilities +.i0 +.sh BUGS +The program's strategy needs much work. +.s3 +/mnt/alan/:toys/teachgammon was removed to preserve space in /usr/public +.sh COMMENTS +The program is still under development, +so a description of any bugs found should be mailed to +.bd alan. +.s3 +Because of the dynamic state of the program +(constantly changing), +the file +.it /mnt/alan/:toys/gammon.news +lists current modifications to the program. diff --git a/games/backgammon/board.c b/games/backgammon/board.c new file mode 100644 index 0000000..b981a15 --- /dev/null +++ b/games/backgammon/board.c @@ -0,0 +1,149 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#ifndef lint +static char sccsid[] = "@(#)board.c 5.1 (Berkeley) 5/29/85"; +#endif not lint + +#include "back.h" + +static int i, j, k; +static char ln[60]; + +wrboard () { + register int l; + static char bl[] = + "| | | |\n"; + static char sv[] = + "| | | | \n"; + + fixtty (noech); + clear(); + + if (tflag) { + fboard(); + goto lastline; + } + + writel ("_____________________________________________________\n"); + writel (bl); + strcpy (ln,bl); + for (j = 1; j < 50; j += 4) { + k = j/4+(j > 24? 12: 13); + ln[j+1] = k%10+'0'; + ln[j] = k/10+'0'; + if (j == 21) + j += 4; + } + writel (ln); + for (i = 0; i < 5; i++) { + strcpy (ln,sv); + for (j = 1; j < 50; j += 4) { + k = j/4+(j > 24? 12: 13); + wrbsub (); + if (j == 21) + j += 4; + } + if (-board[25] > i) + ln[26] = 'w'; + if (-board[25] > i+5) + ln[25] = 'w'; + if (-board[25] > i+10) + ln[27] = 'w'; + l = 53; + if (off[1] > i || (off[1] < 0 && off[1]+15 > i)) { + ln[54] = 'r'; + l = 55; + } + if (off[1] > i+5 || (off[1] < 0 && off[1]+15 > i+5)) { + ln[55] = 'r'; + l = 56; + } + if (off[1] > i+10 || (off[1] < 0 && off[1]+15 > i+10)) { + ln[56] = 'r'; + l = 57; + } + ln[l++] = '\n'; + ln[l] = '\0'; + writel (ln); + } + strcpy (ln,bl); + ln[25] = 'B'; + ln[26] = 'A'; + ln[27] = 'R'; + writel (ln); + strcpy (ln,sv); + for (i = 4; i > -1; i--) { + for (j = 1; j < 50; j += 4) { + k = ((j > 24? 53: 49)-j)/4; + wrbsub(); + if (j == 21) + j += 4; + } + if (board[0] > i) + ln[26] = 'r'; + if (board[0] > i+5) + ln[25] = 'r'; + if (board[0] > i+10) + ln[27] = 'r'; + l = 53; + if (off[0] > i || (off[0] < 0 && off[0]+15 > i)) { + ln[54] = 'w'; + l = 55; + } + if (off[0] > i+5 || (off[0] < 0 && off[0]+15 > i+5)) { + ln[55] = 'w'; + l = 56; + } + if (off[0] > i+10 || (off[0] < 0 && off[0]+15 > i+10)) { + ln[56] = 'w'; + l = 57; + } + ln[l++] = '\n'; + ln[l] = '\0'; + writel (ln); + } + strcpy (ln,bl); + for (j = 1; j < 50; j += 4) { + k = ((j > 24? 53: 49)-j)/4; + ln[j+1] = k%10+'0'; + if (k > 9) + ln[j] = k/10+'0'; + if (j == 21) + j += 4; + } + writel (ln); + writel ("|_______________________|___|_______________________|\n"); + +lastline: + gwrite (); + if (tflag) + curmove (18,0); + else { + writec ('\n'); + writec ('\n'); + } + fixtty(raw); +} + +wrbsub () { + register int m; + register char d; + + if (board[k] > 0) { + m = board[k]; + d = 'r'; + } else { + m = -board[k]; + d = 'w'; + } + if (m>i) + ln[j+1] = d; + if (m>i+5) + ln[j] = d; + if (m>i+10) + ln[j+2] = d; +} diff --git a/games/backgammon/check.c b/games/backgammon/check.c new file mode 100644 index 0000000..bde3db0 --- /dev/null +++ b/games/backgammon/check.c @@ -0,0 +1,131 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#ifndef lint +static char sccsid[] = "@(#)check.c 5.1 (Berkeley) 5/29/85"; +#endif not lint + +#include "back.h" + +getmove () { + register int i, c; + + c = 0; + for (;;) { + i = checkmove(c); + + switch (i) { + case -1: + if (movokay(mvlim)) { + if (tflag) + curmove (20,0); + else + writec ('\n'); + for (i = 0; i < mvlim; i++) + if (h[i]) + wrhit(g[i]); + nexturn(); + if (*offopp == 15) + cturn *= -2; + if (tflag && pnum) + bflag = pnum; + return; + } + + case -4: + case 0: + if (tflag) + refresh(); + if (i != 0 && i != -4) + break; + if (tflag) + curmove (20,0); + else + writec ('\n'); + writel (*Colorptr); + if (i == -4) + writel (" must make "); + else + writel (" can only make "); + writec (mvlim+'0'); + writel (" move"); + if (mvlim > 1) + writec ('s'); + writec ('.'); + writec ('\n'); + break; + + case -3: + if (quit()) + return; + } + + if (! tflag) + proll (); + else { + curmove (cturn == -1? 18: 19,39); + cline (); + c = -1; + } + } +} + +movokay (mv) +register int mv; + +{ + register int i, m; + + if (d0) + swap; + + for (i = 0; i < mv; i++) { + + if (p[i] == g[i]) { + moverr (i); + curmove (20,0); + writel ("Attempt to move to same location.\n"); + return (0); + } + + if (cturn*(g[i]-p[i]) < 0) { + moverr (i); + curmove (20,0); + writel ("Backwards move.\n"); + return (0); + } + + if (abs(board[bar]) && p[i] != bar) { + moverr (i); + curmove (20,0); + writel ("Men still on bar.\n"); + return (0); + } + + if ( (m = makmove(i)) ) { + moverr (i); + switch (m) { + + case 1: + writel ("Move not rolled.\n"); + break; + + case 2: + writel ("Bad starting position.\n"); + break; + + case 3: + writel ("Destination occupied.\n"); + break; + + case 4: + writel ("Can't remove men yet.\n"); + } + return (0); + } + } + return (1); +} diff --git a/games/backgammon/data.c b/games/backgammon/data.c new file mode 100644 index 0000000..18d56fe --- /dev/null +++ b/games/backgammon/data.c @@ -0,0 +1,288 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#ifndef lint +static char sccsid[] = "@(#)data.c 5.1 (Berkeley) 5/29/85"; +#endif not lint + +#include "tutor.h" + +int maxmoves = 23; + +char *text0[] = { + "To start the game, I roll a 3, and you roll a 1. This means", + "that I get to start first. I move 8-5,6-5 since this makes a", + "new point and helps to trap your back men on 1. You should be", + "able to do a similar move with your roll.", + 0 +}; + +char *text1[] = { + "Now you shall see a move using doubles. I just rolled double", + "5's. I will move two men from position 13 to position 3. The", + "notation for this is 13-8,13-8,8-3,8-3. You will also roll dou-", + "bles, but you will be able to make a much stronger move.", + 0 +}; + +char *text2[] = { + "Excellent! As you can see, you are beginning to develop a wall", + "which is trapping my men on position 24. Also, moving your back", + "men forward not only improves your board position safely, but it", + "thwarts my effort to make a wall.", + "", + "My roll now is 5 6. Normally, I would use that roll to move from", + "position 24 to position 13 (24-18-13), but your new point prevents", + "that. Instead, I am forced to move from 13 to 2, where my man is", + "open but cannot be hit.", + 0 +}; + +char *text3[] = { + "As you can see, although you left a man open, it is a rela-", + "tively safe move to an advantageous position, which might help", + "you make a point later. Only two rolls (4 5 or 5 4) will allow", + "me to hit you. With an unprecedented amount of luck, I happen", + "to roll a 4 5 and hit you as just mentioned.", + 0 +}; + +char *text4[] = { + "You're pretty lucky yourself, you know. I follow by rolling 2 3", + "and moving 25-22,24-22, forming a new point.", + 0 +}; + +char *text5[] = { + "Not a spectacular move, but a safe one. I follow by rolling 6 1.", + "I decide to use this roll to move 22-16,16-17. It leaves me with", + "one man still open, but the blot is farther back on the board, and", + "would suffer less of a loss by being hit.", + 0 +}; + +char *text6[] = { + "By moving your two men from 17 to 20, you lessen my chance of", + "getting my man off the board. In fact, the odds are 5 to 4", + "against me getting off. I roll with the odds and helplessly", + "receive a 3 5.", + 0 +}; + +char *text7[] = { + "Note that the blot on 7 cannot be hit unless I get off the bar", + "and have a 1 or a 6 left over, and doing so will leave two of", + "my men open. Also, the blot on 16 cannot be hit at all! With", + "a sigh of frustration, I roll double 6's and remain immobile.", + 0 +}; + +char *text8[] = { + "See, you did not get hit and, you got to 'cover up' your open men.", + "Quite an accomplishment. Finally, I get off the bar by rolling", + "6 2 and moving 25-23,23-17.", + 0 +}; + +char *text9[] = { + "My venture off the bar did not last long. However, I got lucky", + "and rolled double 1's, allowing me to move 0-1,1-2,15-14,15-14.", + 0 +}; + +char *text10[] = { + "You are improving your position greatly and safely, and are well", + "on the way to winning the game. I roll a 6 2 and squeak past", + "your back man. Now the game becomes a race to the finish.", + 0 +}; + +char *text11[] = { + "Now that it is merely a race, you are trying to get as many men", + "as possible into the inner table, so you can start removing them.", + "I roll a 3 4 and move my two men farthest back to position 11", + "(15-11,14-11).", + 0 +}; + +char *text12[] = { + "The race is still on, and you have seem to be doing all right.", + "I roll 6 1 and move 14-8,13-12.", + 0 +}; + +char *text13[] = { + "Notice that you get to remove men the instant you have all of", + "them at your inner table, even if it is the middle of a turn.", + "I roll 1 2 and move 13-11,12-11.", + 0 +}; + +char *text14[] = { + "Although you could have removed a man, this move illustrates two", + "points: 1) You never have to remove men, and 2) You should try", + "to spread out your men on your inner table. Since you have one", + "man on each position, you should be able to remove at least two", + "men next turn. I roll 2 5 and move 8-6,11-6.", + 0 +}; + +char *text15[] = { + "This time you were able to remove men. I roll 3 4 and move", + "11-7,11-8. The race continues.", + 0 +}; + +char *text16[] = { + "More holes are opening up in your inner table, but you are", + "still very much ahead. If we were doubling, you would have", + "doubled long ago. I roll 2 6 and move 8-6,11-5.", + 0 +}; + +char *text17[] = { + "It pays to spread out your men. I roll 3 5 and move 7-4,8-3.", + 0 +}; + +char *text18[] = { + "You can only remove some men, but you spread out more and", + "more, in order to be able to remove men more efficiently.", + "I roll double 3's, which help, but not that much. I move", + "8-5,3-0,3-0,3-0.", + 0 +}; + +char *text19[] = { + "I roll 1 4 and move 5-4,4-0.", + 0 +}; + +char *text20[] = { + "You are now nicely spread out to win a game. I roll 5 6 and", + "move 5-0,6-0.", + 0 +}; + +char *text21[] = { + "Any minute now. Just a few short steps from victory. I roll", + "2 4 and move 6-4,4-0.", + 0 +}; + +char *text22[] = { + "It looks pretty hopeless for me, but I play on, rolling 1 3 and", + "moving 4-3,3-0.", + 0 +}; + +char *text23[] = { + "Congratulations! You just won a game of backgammon against the", + "computer! You will now be able to play a game, but remember,", + "when you start playing, that doubling will be enabled, which", + "will add another factor to the game... Good luck!!", + "", + 0 +}; + +struct situatn test[] = { + { + {0,2,0,0,0,0,-5,0,-3,0,0,0,5,-5,0,0,0,3,0,5,0,0,0,0,-2,0}, + 3, 1, {8,6,0,0}, {5,5,0,0}, 4, 2, &text0 + }, + { + {0,2,0,0,0,-2,-4,0,-2,0,0,0,5,-5,0,0,0,2,0,4,0,2,0,0,-2,0}, + 5, 5, {13,13,8,8}, {8,8,3,3}, 6, 6, &text1 + }, + { + {0,0,0,-2,0,-2,-4,2,-2,0,0,0,3,-3,0,0,0,2,2,4,0,2,0,0,-2,0}, + 6, 5, {13,8,0,0}, {8,2,0,0}, 1, 2, &text2 + }, + { + {0,0,-1,-2,0,-2,-4,2,-2,0,0,0,2,-2,0,1,0,2,2,4,0,2,0,0,-2,0}, + 4, 5, {24,20,0,0}, {20,15,0,0}, 2, 5, &text3 + }, + { + {0,0,0,-2,0,-2,-4,3,-2,0,0,0,2,-2,0,-1,0,2,2,4,0,2,0,0,-1,-1}, + 2, 3, {25,24,0,0}, {22,22,0,0}, 4, 1, &text4 + }, + { + {0,0,0,-2,0,-2,-4,2,-2,0,0,0,3,-2,0,-1,0,2,2,4,0,2,-2,0,0,0}, + 6, 1, {22,16,0,0}, {16,15,0,0}, 3, 3, &text5 + }, + { + {0,0,0,-2,0,-2,-4,2,-2,0,0,0,3,-2,0,-2,0,0,2,2,2,2,2,0,0,-1}, + 3, 5, {0,0,0,0}, {0,0,0,0}, 5, 4, &text6 + }, + { + {0,0,0,-2,0,-2,-4,1,-2,0,0,0,3,-2,0,-2,1,0,2,2,2,2,2,0,0,-1}, + 6, 6, {0,0,0,0}, {0,0,0,0}, 3, 6, &text7 + }, + { + {0,0,0,-2,0,-2,-4,0,-2,0,0,0,3,-2,0,-2,2,0,2,2,2,2,2,0,0,-1}, + 2, 6, {25,23,0,0}, {23,17,0,0}, 5, 1, &text8 + }, + { + {0,0,0,-2,0,-2,-4,0,-2,0,0,0,2,-2,0,-2,2,0,3,2,2,2,2,0,0,-1}, + 1, 1, {25,24,15,15}, {24,23,14,14}, 4, 6, &text9 + }, + { + {0,0,0,-2,0,-2,-4,0,-2,0,0,0,0,-2,-2,0,3,0,4,2,2,2,2,-1,0,0}, + 6, 2, {23,17,0,0}, {17,15,0,0}, 1, 3, &text10 + }, + { + {0,0,0,-2,0,-2,-4,0,-2,0,0,0,0,-2,-2,-1,2,0,3,4,2,2,2,0,0,0}, + 4, 3, {15,14,0,0}, {11,11,0,0}, 5, 3, &text11 + }, + { + {0,0,0,-2,0,-2,-4,0,-2,0,0,-2,0,-2,-1,0,0,0,3,5,2,3,2,0,0,0}, + 6, 1, {14,13,0,0}, {8,12,0,0}, 4, 4, &text12 + }, + { + {0,0,0,-2,0,-2,-4,0,-3,0,0,-2,-1,-1,0,0,0,0,0,5,2,2,5,0,0,0}, + 2, 1, {13,12,0,0}, {11,11,0,0}, 2, 1, &text13 + }, + { + {0,0,0,-2,0,-2,-4,0,-3,0,0,-4,0,0,0,0,0,0,0,5,2,2,3,1,1,0}, + 2, 5, {8,11,0,0}, {6,6,0,0}, 6, 3, &text14 + }, + { + {0,0,0,-2,0,-2,-6,0,-2,0,0,-3,0,0,0,0,0,0,0,4,2,2,2,1,1,0}, + 4, 3, {11,11,0,0}, {7,8,0,0}, 2, 5, &text15 + }, + { + {0,0,0,-2,0,-2,-6,-1,-3,0,0,-1,0,0,0,0,0,0,0,4,1,2,2,0,1,0}, + 2, 6, {8,11,0,0}, {6,5,0,0}, 6, 1, &text16 + }, + { + {0,0,0,-2,0,-3,-7,-1,-2,0,0,0,0,0,0,0,0,0,0,3,1,2,2,0,0,0}, + 5, 3, {8,7,0,0}, {3,4,0,0}, 5, 2, &text17 + }, + { + {0,0,0,-3,-1,-3,-7,0,-1,0,0,0,0,0,0,0,0,0,0,3,0,1,2,1,0,0}, + 3, 3, {8,3,3,3}, {5,0,0,0}, 1, 6, &text18 + }, + { + {0,0,0,0,-1,-4,-7,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,2,1,0,0}, + 1, 4, {4,5,0,0}, {0,4,0,0}, 2, 3, &text19 + }, + { + {0,0,0,0,-1,-3,-7,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0}, + 5, 6, {6,5,0,0}, {0,0,0,0}, 1, 4, &text20 + }, + { + {0,0,0,0,-1,-2,-6,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,0,0}, + 2, 4, {4,6,0,0}, {0,4,0,0}, 6, 2, &text21 + }, + { + {0,0,0,0,-1,-2,-5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0}, + 3, 1, {4,3,0,0}, {3,0,0,0}, 4, 3, &text22 + }, + { + {0,0,0,0,0,-2,-5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + 0, 0, {0,0,0,0}, {0,0,0,0}, 0, 0, &text23 + } +}; diff --git a/games/backgammon/extra.c b/games/backgammon/extra.c new file mode 100644 index 0000000..f9010c4 --- /dev/null +++ b/games/backgammon/extra.c @@ -0,0 +1,226 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#ifndef lint +static char sccsid[] = "@(#)extra.c 5.1 (Berkeley) 5/29/85"; +#endif not lint + +#include "back.h" + +#ifdef DEBUG +#include +FILE *trace; +#endif + +/* + * dble() + * Have the current player double and ask opponent to accept. + */ + +dble () { + register int resp; /* response to y/n */ + + for (;;) { + writel (" doubles."); /* indicate double */ + + if (cturn == -pnum) { /* see if computer accepts */ + if (dblgood()) { /* guess not */ + writel (" Declined.\n"); + nexturn(); + cturn *= -2; /* indicate loss */ + return; + } else { /* computer accepts */ + writel (" Accepted.\n"); + gvalue *= 2; /* double game value */ + dlast = cturn; + if (tflag) + gwrite(); + return; + } + } + + /* ask if player accepts */ + writel (" Does "); + writel (cturn == 1? color[2]: color[3]); + writel (" accept?"); + + /* get response from yorn, + * a "2" means he said "p" + * for print board. */ + if ((resp = yorn ('R')) == 2) { + writel (" Reprint.\n"); + buflush(); + wrboard(); + writel (*Colorptr); + continue; + } + + /* check response */ + if (resp) { + /* accepted */ + gvalue *= 2; + dlast = cturn; + if (tflag) + gwrite(); + return; + } + + nexturn (); /* declined */ + cturn *= -2; + return; + } +} + +/* + * dblgood () + * Returns 1 if the computer would double in this position. This + * is not an exact science. The computer will decline a double that he + * would have made. Accumulated judgments are kept in the variable n, + * which is in "pips", i.e., the position of each man summed over all + * men, with opponent's totals negative. Thus, n should have a positive + * value of 7 for each move ahead, or a negative value of 7 for each one + * behind. + */ + +dblgood () { + register int n; /* accumulated judgment */ + register int OFFC = *offptr; /* no. of computer's men off */ + register int OFFO = *offopp; /* no. of player's men off */ + +#ifdef DEBUG + register int i; + if (trace == NULL) + trace = fopen ("bgtrace","w"); +#endif + + /* get real pip value */ + n = eval()*cturn; +#ifdef DEBUG + fputs ("\nDoubles:\nBoard: ",trace); + for (i = 0; i < 26; i++) + fprintf (trace," %d",board[i]); + fprintf (trace,"\n\tpip = %d, ",n); +#endif + + /* below adjusts pip value + * according to position + * judgments */ + + /* check men moving off + * board */ + if (OFFC > -15 || OFFO > -15) { + if (OFFC < 0 && OFFO < 0) { + OFFC += 15; + OFFO += 15; + n +=((OFFC-OFFO)*7)/2; + } else if (OFFC < 0) { + OFFC += 15; + n -= OFFO*7/2; + } else if (OFFO < 0) { + OFFO += 15; + n += OFFC*7/2; + } + if (OFFC < 8 && OFFO > 8) + n -= 7; + if (OFFC < 10 && OFFO > 10) + n -= 7; + if (OFFC < 12 && OFFO > 12) + n -= 7; + if (OFFO < 8 && OFFC > 8) + n += 7; + if (OFFO < 10 && OFFC > 10) + n += 7; + if (OFFO < 12 && OFFC > 12) + n += 7; + n += ((OFFC-OFFO)*7)/2; + } + +#ifdef DEBUG + fprintf (trace,"off = %d, ",n); +#endif + + /* see if men are trapped */ + n -= freemen(bar); + n += freemen(home); + n += trapped(home,-cturn); + n -= trapped(bar,cturn); + +#ifdef DEBUG + fprintf (trace,"free = %d\n",n); + fprintf (trace,"\tOFFC = %d, OFFO = %d\n",OFFC,OFFO); + fflush (trace); +#endif + + /* double if 2-3 moves ahead */ + if (n > 10+rnum(7)) + return(1); + return (0); +} + +freemen (b) +int b; + +{ + register int i, inc, lim; + + odds(0,0,0); + if (board[b] == 0) + return (0); + inc = (b == 0? 1: -1); + lim = (b == 0? 7: 18); + for (i = b+inc; i != lim; i += inc) + if (board[i]*inc < -1) + odds(abs(b-i),0,abs(board[b])); + if (abs(board[b]) == 1) + return ((36-count())/5); + return (count()/5); +} + +trapped (n,inc) +int n, inc; + +{ + register int i, j, k; + int c, l, ct; + + ct = 0; + l = n+7*inc; + for (i = n+inc; i != l; i += inc) { + odds (0,0,0); + c = abs(i-l); + if (board[i]*inc > 0) { + for (j = c; j < 13; j++) + if (board[i+inc*j]*inc < -1) { + if (j < 7) + odds (j,0,1); + for (k = 1; k < 7 && k < j; k++) + if (j-k < 7) + odds (k,j-k,1); + } + ct += abs(board[i])*(36-count()); + } + } + return (ct/5); +} + +eval () { + + register int i, j; + + for (j = i = 0; i < 26; i++) + j += (board[i] >= 0 ? i*board[i] : (25-i)*board[i]); + + if (off[1] >= 0) + j += 25*off[1]; + else + j += 25*(off[1]+15); + + if (off[0] >= 0) + j -= 25*off[0]; + else + j -= 25*(off[0]+15); + return (j); +} diff --git a/games/backgammon/fancy.c b/games/backgammon/fancy.c new file mode 100644 index 0000000..a2a6038 --- /dev/null +++ b/games/backgammon/fancy.c @@ -0,0 +1,723 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#ifndef lint +static char sccsid[] = "@(#)fancy.c 5.1 (Berkeley) 5/29/85"; +#endif not lint + +#include "back.h" + +char PC; /* padding character */ +char *BC; /* backspace sequence */ +char *CD; /* clear to end of screen sequence */ +char *CE; /* clear to end of line sequence */ +char *CL; /* clear screen sequence */ +char *CM; /* cursor movement instructions */ +char *HO; /* home cursor sequence */ +char *MC; /* column cursor movement map */ +char *ML; /* row cursor movement map */ +char *ND; /* forward cursor sequence */ +char *UP; /* up cursor sequence */ + +int lHO; /* length of HO */ +int lBC; /* length of BC */ +int lND; /* length of ND */ +int lUP; /* length of UP */ +int CO; /* number of columns */ +int LI; /* number of lines */ +int *linect; /* array of lengths of lines on screen + (the actual screen is not stored) */ + + /* two letter codes */ +char tcap[] = "bccdceclcmhomcmlndup"; + /* corresponding strings */ +char **tstr[] = { &BC, &CD, &CE, &CL, &CM, &HO, &MC, &ML, &ND, &UP }; + +int buffnum; /* pointer to output buffer */ + +char tbuf[1024]; /* buffer for decoded termcap entries */ + +int oldb[] = {0,0,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 oldr; +int oldw; + /* "real" cursor positions, so + * it knows when to reposition. + * These are -1 if curr and curc + * are accurate */ +int realr; +int realc; + +fboard () { + register int i, j, l; + + curmove (0,0); /* do top line */ + for (i = 0; i < 53; i++) + fancyc ('_'); + + curmove (15,0); /* do botttom line */ + for (i = 0; i < 53; i++) + fancyc ('_'); + + l = 1; /* do vertical lines */ + for (i = 52; i > -1; i -= 28) { + curmove ( (l == 1? 1: 15) ,i); + fancyc ('|'); + for (j = 0; j < 14; j++) { + curmove (curr+l,curc-1); + fancyc ('|'); + } + if (i == 24) + i += 32; + l = -l; /* alternate directions */ + } + + curmove (2,1); /* label positions 13-18 */ + for (i = 13; i < 18; i++) { + fancyc ('1'); + fancyc ((i % 10)+'0'); + curmove (curr,curc+2); + } + fancyc ('1'); + fancyc ('8'); + + curmove (2,29); /* label positions 19-24 */ + fancyc ('1'); + fancyc ('9'); + for (i = 20; i < 25; i++) { + curmove (curr,curc+2); + fancyc ('2'); + fancyc ((i % 10)+'0'); + } + + curmove (14,1); /* label positions 12-7 */ + fancyc ('1'); + fancyc ('2'); + for (i = 11; i > 6; i--) { + curmove (curr,curc+2); + fancyc (i > 9? '1': ' '); + fancyc ((i % 10)+'0'); + } + + curmove (14,30); /* label positions 6-1 */ + fancyc ('6'); + for (i = 5; i > 0; i--) { + curmove (curr,curc+3); + fancyc (i+'0'); + } + + for (i = 12; i > 6; i--) /* print positions 12-7 */ + if (board[i]) + bsect (board[i],13,1+4*(12-i),-1); + + if (board[0]) /* print red men on bar */ + bsect (board[0],13,25,-1); + + for (i = 6; i > 0; i--) /* print positions 6-1 */ + if (board[i]) + bsect (board[i],13,29+4*(6-i),-1); + + l = (off[1] < 0? off[1]+15: off[1]); /* print white's home */ + bsect (l,3,54,1); + + curmove (8,25); /* print the word BAR */ + fancyc ('B'); + fancyc ('A'); + fancyc ('R'); + + for (i = 13; i < 19; i++) /* print positions 13-18 */ + if (board[i]) + bsect (board[i],3,1+4*(i-13),1); + + if (board[25]) /* print white's men on bar */ + bsect (board[25],3,25,1); + + for (i = 19; i < 25; i++) /* print positions 19-24 */ + if (board[i]) + bsect (board[i],3,29+4*(i-19),1); + + l = (off[0] < 0? off[0]+15: off[0]); /* print red's home */ + bsect (-l,13,54,-1); + + for (i = 0; i < 26; i++) /* save board position + * for refresh later */ + oldb[i] = board[i]; + oldr = (off[1] < 0? off[1]+15: off[1]); + oldw = -(off[0] < 0? off[0]+15: off[0]); +} + +/* + * bsect (b,rpos,cpos,cnext) + * Print the contents of a board position. "b" has the value of the + * position, "rpos" is the row to start printing, "cpos" is the column to + * start printing, and "cnext" is positive if the position starts at the top + * and negative if it starts at the bottom. The value of "cpos" is checked + * to see if the position is a player's home, since those are printed + * differently. + */ + +bsect (b,rpos,cpos,cnext) +int b; /* contents of position */ +int rpos; /* row of position */ +int cpos; /* column of position */ +int cnext; /* direction of position */ + +{ + register int j; /* index */ + register int n; /* number of men on position */ + register int bct; /* counter */ + int k; /* index */ + char pc; /* color of men on position */ + + n = abs(b); /* initialize n and pc */ + pc = (b > 0? 'r': 'w'); + + if (n < 6 && cpos < 54) /* position cursor at start */ + curmove (rpos,cpos+1); + else + curmove (rpos,cpos); + + for (j = 0; j < 5; j++) { /* print position row by row */ + + for (k = 0; k < 15; k += 5) /* print men */ + if (n > j+k) + fancyc (pc); + + if (j < 4) { /* figure how far to + * back up for next + * row */ + if (n < 6) { /* stop if none left */ + if (j+1 == n) + break; + bct = 1; /* single column */ + } else { + if (n < 11) { /* two columns */ + if (cpos == 54) { /* home pos */ + if (j+5 >= n) + bct = 1; + else + bct = 2; + } + if (cpos < 54) { /* not home */ + if (j+6 >= n) + bct = 1; + else + bct = 2; + } + } else { /* three columns */ + if (j+10 >= n) + bct = 2; + else + bct = 3; + } + } + curmove (curr+cnext,curc-bct); /* reposition cursor */ + } + } +} + +refresh() { + register int i, r, c; + + r = curr; /* save current position */ + c = curc; + + for (i = 12; i > 6; i--) /* fix positions 12-7 */ + if (board[i] != oldb[i]) { + fixpos (oldb[i],board[i],13,1+(12-i)*4,-1); + oldb[i] = board[i]; + } + + if (board[0] != oldb[0]) { /* fix red men on bar */ + fixpos (oldb[0],board[0],13,25,-1); + oldb[0] = board[0]; + } + + for (i = 6; i > 0; i--) /* fix positions 6-1 */ + if (board[i] != oldb[i]) { + fixpos (oldb[i],board[i],13,29+(6-i)*4,-1); + oldb[i] = board[i]; + } + + i = -(off[0] < 0? off[0]+15: off[0]); /* fix white's home */ + if (oldw != i) { + fixpos (oldw,i,13,54,-1); + oldw = i; + } + + for (i = 13; i < 19; i++) /* fix positions 13-18 */ + if (board[i] != oldb[i]) { + fixpos (oldb[i],board[i],3,1+(i-13)*4,1); + oldb[i] = board[i]; + } + + if (board[25] != oldb[25]) { /* fix white men on bar */ + fixpos (oldb[25],board[25],3,25,1); + oldb[25] = board[25]; + } + + for (i = 19; i < 25; i++) /* fix positions 19-24 */ + if (board[i] != oldb[i]) { + fixpos (oldb[i],board[i],3,29+(i-19)*4,1); + oldb[i] = board[i]; + } + + i = (off[1] < 0? off[1]+15: off[1]); /* fix red's home */ + if (oldr != i) { + fixpos (oldr,i,3,54,1); + oldr = i; + } + + curmove (r,c); /* return to saved position */ + newpos(); + buflush(); +} + +fixpos (old,new,r,c,inc) +int old, new, r, c, inc; + +{ + register int o, n, nv; + int ov, nc; + char col; + + if (old*new >= 0) { + ov = abs(old); + nv = abs(new); + col = (old+new > 0? 'r': 'w'); + o = (ov-1)/5; + n = (nv-1)/5; + if (o == n) { + if (o == 2) + nc = c+2; + if (o == 1) + nc = c < 54? c: c+1; + if (o == 0) + nc = c < 54? c+1: c; + if (ov > nv) + fixcol (r+inc*(nv-n*5),nc,abs(ov-nv),' ',inc); + else + fixcol (r+inc*(ov-o*5),nc,abs(ov-nv),col,inc); + return; + } else { + if (c < 54) { + if (o+n == 1) { + if (n) { + fixcol (r,c,abs(nv-5),col,inc); + if (ov != 5) + fixcol (r+inc*ov,c+1,abs(ov-5),col,inc); + } else { + fixcol (r,c,abs(ov-5),' ',inc); + if (nv != 5) + fixcol (r+inc*nv,c+1,abs(nv-5),' ',inc); + } + return; + } + if (n == 2) { + if (ov != 10) + fixcol (r+inc*(ov-5),c,abs(ov-10),col,inc); + fixcol (r,c+2,abs(nv-10),col,inc); + } else { + if (nv != 10) + fixcol (r+inc*(nv-5),c,abs(nv-10),' ',inc); + fixcol (r,c+2,abs(ov-10),' ',inc); + } + return; + } + if (n > o) { + fixcol (r+inc*(ov%5),c+o,abs(5*n-ov),col,inc); + if (nv != 5*n) + fixcol (r,c+n,abs(5*n-nv),col,inc); + } else { + fixcol (r+inc*(nv%5),c+n,abs(5*n-nv),' ',inc); + if (ov != 5*o) + fixcol (r,c+o,abs(5*o-ov),' ',inc); + } + return; + } + } + nv = abs(new); + fixcol (r,c+1,nv,new > 0? 'r': 'w',inc); + if (abs(old) <= abs(new)) + return; + fixcol (r+inc*new,c+1,abs(old+new),' ',inc); +} + +fixcol (r,c,l,ch,inc) +register int l, ch; +int r, c, inc; + +{ + register int i; + + curmove (r,c); + fancyc (ch); + for (i = 1; i < l; i++) { + curmove (curr+inc,curc-1); + fancyc (ch); + } +} + +curmove (r,c) +register int r, c; + +{ + if (curr == r && curc == c) + return; + if (realr == -1) { + realr = curr; + realc = curc; + } + curr = r; + curc = c; +} + +newpos () { + register int r; /* destination row */ + register int c; /* destination column */ + register int mode = -1; /* mode of movement */ + + int count = 1000; /* character count */ + int i; /* index */ + int j; /* index */ + int n; /* temporary variable */ + char *m; /* string containing CM movement */ + int addbuf(); /* add a char to the output buffer */ + + + if (realr == -1) /* see if already there */ + return; + + r = curr; /* set current and dest. positions */ + c = curc; + curr = realr; + curc = realc; + + /* double check position */ + if (curr == r && curc == c) { + realr = realc = -1; + return; + } + + if (CM) { /* try CM to get there */ + mode = 0; + m = tgoto (CM,c,r); + count = strlen (m); + } + + /* try HO and local movement */ + if (HO && (n = r+c*lND+lHO) < count) { + mode = 1; + count = n; + } + + /* try various LF combinations */ + if (r >= curr) { + /* CR, LF, and ND */ + if ((n = (r-curr)+c*lND+1) < count) { + mode = 2; + count = n; + } + /* LF, ND */ + if (c >= curc && (n = (r-curr)+(c-curc)*lND) < count) { + mode = 3; + count = n; + } + /* LF, BS */ + if (c < curc && (n = (r-curr)+(curc-c)*lBC) < count) { + mode = 4; + count = n; + } + } + + /* try corresponding UP combinations */ + if (r < curr) { + /* CR, UP, and ND */ + if ((n = (curr-r)*lUP+c*lND+1) < count) { + mode = 5; + count = n; + } + /* UP and ND */ + if (c >= curc && (n = (curr-r)*lUP+(c-curc)*lND) < count) { + mode = 6; + count = n; + } + /* UP and BS */ + if (c < curc && (n = (curr-r)*lUP+(curc-c)*lBC) < count) { + mode = 7; + count = n; + } + } + + /* space over */ + if (curr == r && c > curc && linect[r] < curc && c-curc < count) + mode = 8; + + switch (mode) { + + case -1: /* error! */ + write (2,"\r\nInternal cursor error.\r\n",26); + getout(); + + /* direct cursor motion */ + case 0: + tputs (m,abs(curr-r),addbuf); + break; + + /* relative to "home" */ + case 1: + tputs (HO,r,addbuf); + for (i = 0; i < r; i++) + addbuf ('\012'); + for (i = 0; i < c; i++) + tputs (ND,1,addbuf); + break; + + /* CR and down and over */ + case 2: + addbuf ('\015'); + for (i = 0; i < r-curr; i++) + addbuf ('\012'); + for (i = 0; i < c; i++) + tputs (ND,1,addbuf); + break; + + /* down and over */ + case 3: + for (i = 0; i < r-curr; i++) + addbuf ('\012'); + for (i = 0; i < c-curc; i++) + tputs (ND,1,addbuf); + break; + + /* down and back */ + case 4: + for (i = 0; i < r-curr; i++) + addbuf ('\012'); + for (i = 0; i < curc-c; i++) + addbuf ('\010'); + break; + + /* CR and up and over */ + case 5: + addbuf ('\015'); + for (i = 0; i < curr-r; i++) + tputs (UP,1,addbuf); + for (i = 0; i < c; i++) + tputs (ND,1,addbuf); + break; + + /* up and over */ + case 6: + for (i = 0; i < curr-r; i++) + tputs (UP,1,addbuf); + for (i = 0; i < c-curc; i++) + tputs (ND,1,addbuf); + break; + + /* up and back */ + case 7: + for (i = 0; i < curr-r; i++) + tputs (UP,1,addbuf); + for (i = 0; i < curc-c; i++) { + if (BC) + tputs (BC,1,addbuf); + else + addbuf ('\010'); + } + break; + + /* safe space */ + case 8: + for (i = 0; i < c-curc; i++) + addbuf (' '); + } + + /* fix positions */ + curr = r; + curc = c; + realr = -1; + realc = -1; +} + +clear () { + register int i; + int addbuf(); + + /* double space if can't clear */ + if (CL == 0) { + writel ("\n\n"); + return; + } + + curr = curc = 0; /* fix position markers */ + realr = realc = -1; + for (i = 0; i < 24; i++) /* clear line counts */ + linect[i] = -1; + buffnum = -1; /* ignore leftover buffer contents */ + tputs (CL,CO,addbuf); /* put CL in buffer */ +} + +tos () { /* home cursor */ + curmove (0,0); +} + +fancyc (c) +register char c; /* character to output */ +{ + register int sp; /* counts spaces in a tab */ + + if (c == '\007') { /* bells go in blindly */ + addbuf (c); + return; + } + + /* process tabs, use spaces if the + * the tab should be erasing things, + * otherwise use cursor movement + * routines. Note this does not use + * hardware tabs at all. */ + if (c == '\t') { + sp = (curc+8) & (~ 7); /* compute spaces */ + /* check line length */ + if (linect[curr] >= curc || sp < 4) { + for (; sp > curc; sp--) + addbuf (' '); + curc = sp; /* fix curc */ + } else + curmove (curr,sp); + return; + } + + /* do newline be calling newline */ + if (c == '\n') { + newline(); + return; + } + + /* ignore any other control chars */ + if (c < ' ') + return; + + /* if an erasing space or non-space, + * just add it to buffer. Otherwise + * use cursor movement routine, so that + * multiple spaces will be grouped + * together */ + if (c > ' ' || linect[curr] >= curc) { + newpos (); /* make sure position correct */ + addbuf (c); /* add character to buffer */ + /* fix line length */ + if (c == ' ' && linect[curr] == curc) + linect[curr]--; + else if (linect[curr] < curc) + linect[curr] = curc; + curc++; /* fix curc */ + } else + /* use cursor movement routine */ + curmove (curr,curc+1); +} + +clend() { + register int i; + register char *s; + int addbuf(); + + + if (CD) { + tputs (CD,CO-curr,addbuf); + for (i = curr; i < LI; i++) + linect[i] = -1; + return; + } + + curmove (i = curr,0); + cline(); + while (curr < LI-1) { + curmove (curr+1,0); + if (linect[curr] > -1) + cline (); + } + curmove (i,0); +} + +cline () { + register int i; + register int c; + register char *s; + int addbuf(); + + if (curc > linect[curr]) + return; + newpos (); + if (CE) { + tputs (CE,1,addbuf); + linect[curr] = curc-1; + } else { + c = curc-1; + while (linect[curr] > c) { + addbuf (' '); + curc++; + linect[curr]--; + } + curmove (curr,c+1); + } +} + +newline () { + cline(); + if (curr == LI-1) + curmove (begscr,0); + else + curmove (curr+1,0); +} + +getcaps (s) +register char *s; + +{ + register char *code; /* two letter code */ + register char ***cap; /* pointer to cap string */ + char *bufp; /* pointer to cap buffer */ + char tentry[1024]; /* temporary uncoded caps buffer */ + + tgetent (tentry,s); /* get uncoded termcap entry */ + + LI = tgetnum ("li"); /* get number of lines */ + if (LI == -1) + LI = 12; + CO = tgetnum ("co"); /* get number of columns */ + if (CO == -1) + CO = 65; + + bufp = tbuf; /* get padding character */ + tgetstr ("pc",&bufp); + if (bufp != tbuf) + PC = *tbuf; + else + PC = 0; + + bufp = tbuf; /* get string entries */ + cap = tstr; + for (code = tcap; *code; code += 2) + **cap++ = tgetstr (code,&bufp); + + /* get pertinent lengths */ + if (HO) + lHO = strlen (HO); + if (BC) + lBC = strlen (BC); + else + lBC = 1; + if (UP) + lUP = strlen (UP); + if (ND) + lND = strlen (ND); + if (LI < 24 || CO < 72 || !(CL && UP && ND)) + return (0); + linect = calloc (LI+1,sizeof(int)); + return (1); +} diff --git a/games/backgammon/init.c b/games/backgammon/init.c new file mode 100644 index 0000000..680525b --- /dev/null +++ b/games/backgammon/init.c @@ -0,0 +1,38 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#ifndef lint +static char sccsid[] = "@(#)init.c 5.1 (Berkeley) 5/29/85"; +#endif not lint + +#include + +/* + * variable initialization. + */ + + /* name of executable object programs */ +char EXEC[] = "/usr/games/backgammon"; +char TEACH[] = "/usr/games/teachgammon"; + +int pnum = 2; /* color of player: + -1 = white + 1 = red + 0 = both + 2 = not yet init'ed */ +int acnt = 0; /* length of args */ +int aflag = 1; /* flag to ask for rules or instructions */ +int bflag = 0; /* flag for automatic board printing */ +int cflag = 0; /* case conversion flag */ +int hflag = 1; /* flag for cleaning screen */ +int mflag = 0; /* backgammon flag */ +int raflag = 0; /* 'roll again' flag for recovered game */ +int rflag = 0; /* recovered game flag */ +int tflag = 0; /* cursor addressing flag */ +int iroll = 0; /* special flag for inputting rolls */ +int rfl = 0; + +char *color[] = {"White","Red","white","red"}; diff --git a/games/backgammon/main.c b/games/backgammon/main.c new file mode 100644 index 0000000..10ee09d --- /dev/null +++ b/games/backgammon/main.c @@ -0,0 +1,564 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#ifndef lint +char copyright[] = +"@(#) Copyright (c) 1980 Regents of the University of California.\n\ + All rights reserved.\n"; +#endif not lint + +#ifndef lint +static char sccsid[] = "@(#)main.c 5.1 (Berkeley) 5/29/85"; +#endif not lint + +#include +#include "back.h" + +#define MVPAUSE 5 /* time to sleep when stuck */ +#define MAXUSERS 35 /* maximum number of users */ + +char *instr[]; /* text of instructions */ +char *message[]; /* update message */ +char ospeed; /* tty output speed */ + +char *helpm[] = { /* help message */ + "Enter a space or newline to roll, or", + " R to reprint the board\tD to double", + " S to save the game\tQ to quit", + 0 +}; + +char *contin[] = { /* pause message */ + "(Type a newline to continue.)", + "", + 0 +}; + +static char user1a[] = + "Sorry, you cannot play backgammon when there are more than "; +static char user1b[] = + " users\non the system."; +static char user2a[] = + "\nThere are now more than "; +static char user2b[] = + " users on the system, so you cannot play\nanother game. "; +static char rules[] = "\nDo you want the rules of the game?"; +static char noteach[] = "Teachgammon not available!\n\007"; +static char need[] = "Do you need instructions for this program?"; +static char askcol[] = + "Enter 'r' to play red, 'w' to play white, 'b' to play both:"; +static char rollr[] = "Red rolls a "; +static char rollw[] = ". White rolls a "; +static char rstart[] = ". Red starts.\n"; +static char wstart[] = ". White starts.\n"; +static char toobad1[] = "Too bad, "; +static char unable[] = " is unable to use that roll.\n"; +static char toobad2[] = ". Too bad, "; +static char cantmv[] = " can't move.\n"; +static char bgammon[] = "Backgammon! "; +static char gammon[] = "Gammon! "; +static char again[] = ".\nWould you like to play again?"; +static char svpromt[] = "Would you like to save this game?"; + +static char password[] = "losfurng"; +static char pbuf[10]; + +main (argc,argv) +int argc; +char **argv; + +{ + register int i; /* non-descript index */ + register int l; /* non-descript index */ + register char c; /* non-descript character storage */ + long t,time(); /* time for random num generator */ + + /* initialization */ + bflag = 2; /* default no board */ + signal (2,getout); /* trap interrupts */ + if (gtty (0,&tty) == -1) /* get old tty mode */ + errexit ("backgammon(gtty)"); + old = tty.sg_flags; +#ifdef V7 + raw = ((noech = old & ~ECHO) | CBREAK); /* set up modes */ +#else + raw = ((noech = old & ~ECHO) | RAW); /* set up modes */ +#endif + ospeed = old.sg_ospeed; /* for termlib */ + + /* check user count */ +# ifdef CORY + if (ucount() > MAXUSERS) { + writel (user1a); + wrint (MAXUSERS); + writel (user1b); + getout(); + } +# endif + + /* get terminal + * capabilities, and + * decide if it can + * cursor address */ + tflag = getcaps (getenv ("TERM")); + /* use whole screen + * for text */ + if (tflag) + begscr = 0; + t = time(0); + srandom(t); /* 'random' seed */ + +#ifdef V7 + while (*++argv != 0) /* process arguments */ +#else + while (*++argv != -1) /* process arguments */ +#endif + getarg (&argv); + args[acnt] = '\0'; + if (tflag) { /* clear screen */ + noech &= ~(CRMOD|XTABS); + raw &= ~(CRMOD|XTABS); + clear(); + } + fixtty (raw); /* go into raw mode */ + + /* check if restored + * game and save flag + * for later */ + if (rfl = rflag) { + text (message); /* print message */ + text (contin); + wrboard(); /* print board */ + /* if new game, pretend + * to be a non-restored + * game */ + if (cturn == 0) + rflag = 0; + } else { + rscore = wscore = 0; /* zero score */ + text (message); /* update message + * without pausing */ + + if (aflag) { /* print rules */ + writel (rules); + if (yorn(0)) { + + fixtty (old); /* restore tty */ + execl (TEACH,"backgammon",args,0); + + tflag = 0; /* error! */ + writel (noteach); + exit(); + } else { /* if not rules, then + * instructions */ + writel (need); + if (yorn(0)) { /* print instructions */ + clear(); + text (instr); + } + } + } + + init(); /* initialize board */ + + if (pnum == 2) { /* ask for color(s) */ + writec ('\n'); + writel (askcol); + while (pnum == 2) { + c = readc(); + switch (c) { + + case 'R': /* red */ + pnum = -1; + break; + + case 'W': /* white */ + pnum = 1; + break; + + case 'B': /* both */ + pnum = 0; + break; + + case 'P': + if (iroll) + break; + if (tflag) + curmove (curr,0); + else + writec ('\n'); + writel ("Password:"); + signal (14,getout); + cflag = 1; + alarm (10); + for (i = 0; i < 10; i++) { + pbuf[i] = readc(); + if (pbuf[i] == '\n') + break; + } + if (i == 10) + while (readc() != '\n'); + alarm (0); + cflag = 0; + if (i < 10) + pbuf[i] = '\0'; + for (i = 0; i < 9; i++) + if (pbuf[i] != password[i]) + getout(); + iroll = 1; + if (tflag) + curmove (curr,0); + else + writec ('\n'); + writel (askcol); + break; + + default: /* error */ + writec ('\007'); + } + } + } else if (!aflag) + /* pause to read + * message */ + text (contin); + + wrboard(); /* print board */ + + if (tflag) + curmove (18,0); + else + writec ('\n'); + } + /* limit text to bottom + * of screen */ + if (tflag) + begscr = 17; + + for (;;) { /* begin game! */ + /* initial roll if + * needed */ + if ((! rflag) || raflag) + roll(); + + /* perform ritual of + * first roll */ + if (! rflag) { + if (tflag) + curmove (17,0); + while (D0 == D1) /* no doubles */ + roll(); + + /* print rolls */ + writel (rollr); + writec (D0+'0'); + writel (rollw); + writec (D1+'0'); + + /* winner goes first */ + if (D0 > D1) { + writel (rstart); + cturn = 1; + } else { + writel (wstart); + cturn = -1; + } + } + + /* initalize variables + * according to whose + * turn it is */ + + if (cturn == 1) { /* red */ + home = 25; + bar = 0; + inptr = &in[1]; + inopp = &in[0]; + offptr = &off[1]; + offopp = &off[0]; + Colorptr = &color[1]; + colorptr = &color[3]; + colen = 3; + } else { /* white */ + home = 0; + bar = 25; + inptr = &in[0]; + inopp = &in[1]; + offptr = &off[0]; + offopp = &off[1]; + Colorptr = &color[0]; + colorptr = &color[2]; + colen = 5; + } + + /* do first move + * (special case) */ + if (! (rflag && raflag)) { + if (cturn == pnum) /* computer's move */ + move (0); + else { /* player's move */ + mvlim = movallow(); + /* reprint roll */ + if (tflag) + curmove (cturn == -1? 18: 19,0); + proll(); + getmove(); /* get player's move */ + } + } + if (tflag) { + curmove (17,0); + cline(); + begscr = 18; + } + + /* no longer any diff- + * erence between normal + * game and recovered + * game. */ + rflag = 0; + + /* move as long as it's + * someone's turn */ + while (cturn == 1 || cturn == -1) { + + /* board maintainence */ + if (tflag) + refresh(); /* fix board */ + else + /* redo board if -p */ + if (cturn == bflag || bflag == 0) + wrboard(); + + /* do computer's move */ + if (cturn == pnum) { + move (1); + + /* see if double + * refused */ + if (cturn == -2 || cturn == 2) + break; + + /* check for winning + * move */ + if (*offopp == 15) { + cturn *= -2; + break; + } + continue; + + } + + /* (player's move) */ + + /* clean screen if + * safe */ + if (tflag && hflag) { + curmove (20,0); + clend (); + hflag = 1; + } + + /* if allowed, give him + * a chance to double */ + if (dlast != cturn && gvalue < 64) { + if (tflag) + curmove (cturn == -1? 18: 19,0); + writel (*Colorptr); + c = readc(); + + /* character cases */ + switch (c) { + + /* reprint board */ + case 'R': + wrboard(); + break; + + /* save game */ + case 'S': + raflag = 1; + save (1); + break; + + /* quit */ + case 'Q': + quit(); + break; + + /* double */ + case 'D': + dble(); + break; + + /* roll */ + case ' ': + case '\n': + roll(); + writel (" rolls "); + writec (D0+'0'); + writec (' '); + writec (D1+'0'); + writel (". "); + + /* see if he can move */ + if ( (mvlim = movallow()) == 0) { + + /* can't move */ + writel (toobad1); + writel (*colorptr); + writel (unable); + if (tflag) { + if (pnum) { + buflush(); + sleep (MVPAUSE); + } + } + nexturn(); + break; + } + + /* get move */ + getmove(); + + /* okay to clean + * screen */ + hflag = 1; + break; + + /* invalid character */ + default: + + /* print help message */ + if (tflag) + curmove (20,0); + else + writec ('\n'); + text (helpm); + if (tflag) + curmove (cturn == -1? 18: 19,0); + else + writec ('\n'); + + /* don't erase */ + hflag = 0; + } + } else { /* couldn't double */ + + /* print roll */ + roll(); + if (tflag) + curmove (cturn == -1? 18: 19,0); + proll (); + + /* can he move? */ + if ((mvlim = movallow()) == 0) { + + /* he can't */ + writel (toobad2); + writel (*colorptr); + writel (cantmv); + buflush(); + sleep (MVPAUSE); + nexturn(); + continue; + } + + /* get move */ + getmove(); + } + } + + /* don't worry about who + * won if quit */ + if (cturn == 0) + break; + + /* fix cturn = winner */ + cturn /= -2; + + /* final board pos. */ + if (tflag) + refresh(); + + /* backgammon? */ + mflag = 0; + l = bar+7*cturn; + for (i = bar; i != l; i += cturn) + if (board[i]*cturn) mflag++; + + /* compute game value */ + if (tflag) + curmove (20,0); + if (*offopp == 15) { + if (mflag) { + writel (bgammon); + gvalue *= 3; + } + else if (*offptr <= 0) { + writel (gammon); + gvalue *= 2; + } + } + + /* report situation */ + if (cturn == -1) { + writel ("Red wins "); + rscore += gvalue; + } else { + writel ("White wins "); + wscore += gvalue; + } + wrint (gvalue); + writel (" point"); + if (gvalue > 1) + writec ('s'); + writel (".\n"); + + /* write score */ + wrscore(); + + /* check user count */ +# ifdef CORY + if (ucount() > MAXUSERS) { + writel (user2a); + wrint (MAXUSERS); + writel (user2b); + rfl = 1; + break; + } +# endif + + /* see if he wants + * another game */ + writel (again); + if ((i = yorn ('S')) == 0) + break; + + init(); + if (i == 2) { + writel (" Save.\n"); + cturn = 0; + save (0); + } + + /* yes, reset game */ + wrboard(); + } + + /* give him a chance to save if game was recovered */ + if (rfl && cturn) { + writel (svpromt); + if (yorn (0)) { + /* re-initialize for + * recovery */ + init(); + cturn = 0; + save(0); + } + } + + /* leave peacefully */ + getout (); +} diff --git a/games/backgammon/message.c b/games/backgammon/message.c new file mode 100644 index 0000000..313a735 --- /dev/null +++ b/games/backgammon/message.c @@ -0,0 +1,15 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#ifndef lint +static char Msccsid[] = "@(#)Mesgfix 5.2 (Berkeley) 1/8/86"; +static char sccsid[] = "@(#)message.c 4.3 (Berkeley) 1/11/86"; +#endif not lint + +char *message[] = { + "Last update on Friday, November 26, 1999.", + 0 +}; diff --git a/games/backgammon/move.c b/games/backgammon/move.c new file mode 100644 index 0000000..f7f9e08 --- /dev/null +++ b/games/backgammon/move.c @@ -0,0 +1,524 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#ifndef lint +static char sccsid[] = "@(#)move.c 5.1 (Berkeley) 5/29/85"; +#endif not lint + +#include "back.h" + +#ifdef DEBUG +#include +FILE *trace; +static char tests[20]; +#endif + +struct BOARD { /* structure of game position */ + int b_board[26]; /* board position */ + int b_in[2]; /* men in */ + int b_off[2]; /* men off */ + int b_st[4], b_fn[4]; /* moves */ + + struct BOARD *b_next; /* forward queue pointer */ +}; + +struct BOARD *freeq = -1; +struct BOARD *checkq = -1; +struct BOARD *bsave(); +struct BOARD *nextfree(); + + /* these variables are values for the + * candidate move */ +static int ch; /* chance of being hit */ +static int op; /* computer's open men */ +static int pt; /* comp's protected points */ +static int em; /* farthest man back */ +static int frc; /* chance to free comp's men */ +static int frp; /* chance to free pl's men */ + + /* these values are the values for the + * move chosen (so far) */ +static int chance; /* chance of being hit */ +static int openmen; /* computer's open men */ +static int points; /* comp's protected points */ +static int endman; /* farthest man back */ +static int barmen; /* men on bar */ +static int menin; /* men in inner table */ +static int menoff; /* men off board */ +static int oldfrc; /* chance to free comp's men */ +static int oldfrp; /* chance to free pl's men */ + +static int cp[5]; /* candidate start position */ +static int cg[5]; /* candidate finish position */ + +static int race; /* game reduced to a race */ + +move (okay) +int okay; /* zero if first move */ +{ + register int i; /* index */ + register int l; /* last man */ + + if (okay) { + /* see if comp should double */ + if (gvalue < 64 && dlast != cturn && dblgood()) { + writel (*Colorptr); + dble(); /* double */ + /* return if declined */ + if (cturn != 1 && cturn != -1) + return; + } + roll(); + } + + race = 0; + for (i = 0; i < 26; i++) { + if (board[i] < 0) + l = i; + } + for (i = 0; i < l; i++) { + if (board[i] > 0) + break; + } + if (i == l) + race = 1; + + /* print roll */ + if (tflag) + curmove (cturn == -1? 18: 19,0); + writel (*Colorptr); + writel (" rolls "); + writec (D0+'0'); + writec (' '); + writec (D1+'0'); + /* make tty interruptable + * while thinking */ + if (tflag) + cline(); + fixtty (noech); + + /* find out how many moves */ + mvlim = movallow(); + if (mvlim == 0) { + writel (" but cannot use it.\n"); + nexturn(); + fixtty (raw); + return; + } + + /* initialize */ + for (i = 0; i < 4; i++) + cp[i] = cg[i] = 0; + + /* strategize */ + trymove (0,0); + pickmove(); + + /* print move */ + writel (" and moves "); + for (i = 0; i < mvlim; i++) { + if (i > 0) + writec (','); + wrint (p[i] = cp[i]); + writec ('-'); + wrint (g[i] = cg[i]); + makmove (i); + } + writec ('.'); + + /* print blots hit */ + if (tflag) + curmove (20,0); + else + writec ('\n'); + for (i = 0; i < mvlim; i++) + if (h[i]) + wrhit(g[i]); + /* get ready for next move */ + nexturn(); + if (!okay) { + buflush(); + sleep (3); + } + fixtty (raw); /* no more tty interrupt */ +} + +trymove (mvnum,swapped) +register int mvnum; /* number of move (rel zero) */ +int swapped; /* see if swapped also tested */ + +{ + register int pos; /* position on board */ + register int rval; /* value of roll */ + + /* if recursed through all dice + * values, compare move */ + if (mvnum == mvlim) { + binsert (bsave()); + return; + } + + /* make sure dice in always + * same order */ + if (d0 == swapped) + swap; + /* choose value for this move */ + rval = dice[mvnum != 0]; + + /* find all legitimate moves */ + for (pos = bar; pos != home; pos += cturn) { + /* fix order of dice */ + if (d0 == swapped) + swap; + /* break if stuck on bar */ + if (board[bar] != 0 && pos != bar) + break; + /* on to next if not occupied */ + if (board[pos]*cturn <= 0) + continue; + /* set up arrays for move */ + p[mvnum] = pos; + g[mvnum] = pos+rval*cturn; + if (g[mvnum]*cturn >= home) { + if (*offptr < 0) + break; + g[mvnum] = home; + } + /* try to move */ + if (makmove (mvnum)) + continue; + else + trymove (mvnum+1,2); + /* undo move to try another */ + backone (mvnum); + } + + /* swap dice and try again */ + if ((!swapped) && D0 != D1) + trymove (0,1); +} + +struct BOARD * +bsave () { + register int i; /* index */ + struct BOARD *now; /* current position */ + + now = nextfree (); /* get free BOARD */ + + /* store position */ + for (i = 0; i < 26; i++) + now->b_board[i] = board[i]; + now->b_in[0] = in[0]; + now->b_in[1] = in[1]; + now->b_off[0] = off[0]; + now->b_off[1] = off[1]; + for (i = 0; i < mvlim; i++) { + now->b_st[i] = p[i]; + now->b_fn[i] = g[i]; + } + return (now); +} + +binsert (new) +struct BOARD *new; /* item to insert */ +{ + register struct BOARD *p = checkq; /* queue pointer */ + register int result; /* comparison result */ + + if (p == -1) { /* check if queue empty */ + checkq = p = new; + p->b_next = -1; + return; + } + + result = bcomp (new,p); /* compare to first element */ + if (result < 0) { /* insert in front */ + new->b_next = p; + checkq = new; + return; + } + if (result == 0) { /* duplicate entry */ + mvcheck (p,new); + makefree (new); + return; + } + + while (p->b_next != -1) { /* traverse queue */ + result = bcomp (new,p->b_next); + if (result < 0) { /* found place */ + new->b_next = p->b_next; + p->b_next = new; + return; + } + if (result == 0) { /* duplicate entry */ + mvcheck (p->b_next,new); + makefree (new); + return; + } + p = p->b_next; + } + /* place at end of queue */ + p->b_next = new; + new->b_next = -1; +} + +bcomp (a,b) +struct BOARD *a; +struct BOARD *b; +{ + register int *aloc = a->b_board; /* pointer to board a */ + register int *bloc = b->b_board; /* pointer to board b */ + register int i; /* index */ + int result; /* comparison result */ + + for (i = 0; i < 26; i++) { /* compare boards */ + result = cturn*(aloc[i]-bloc[i]); + if (result) + return (result); /* found inequality */ + } + return (0); /* same position */ +} + +mvcheck (incumbent,candidate) +register struct BOARD *incumbent; +register struct BOARD *candidate; +{ + register int i; + register int result; + + for (i = 0; i < mvlim; i++) { + result = cturn*(candidate->b_st[i]-incumbent->b_st[i]); + if (result > 0) + return; + if (result < 0) + break; + } + if (i == mvlim) + return; + for (i = 0; i < mvlim; i++) { + incumbent->b_st[i] = candidate->b_st[i]; + incumbent->b_fn[i] = candidate->b_fn[i]; + } +} + +makefree (dead) +struct BOARD *dead; /* dead position */ +{ + dead->b_next = freeq; /* add to freeq */ + freeq = dead; +} + +struct BOARD * +nextfree () { + struct BOARD *new; + + if (freeq == -1) { + new = calloc (1,sizeof (struct BOARD)); + if (new == 0) { + writel ("\nOut of memory\n"); + getout(); + } + new->b_next = -1; + return (new); + } + + new = freeq; + freeq = freeq->b_next; +} + +pickmove () { + /* current game position */ + register struct BOARD *now = bsave(); + register struct BOARD *next; /* next move */ + +#ifdef DEBUG + if (trace == NULL) + trace = fopen ("bgtrace","w"); + fprintf (trace,"\nRoll: %d %d%s\n",D0,D1,race? " (race)": ""); + fflush (trace); +#endif + do { /* compare moves */ + bcopy (checkq); + next = checkq->b_next; + makefree (checkq); + checkq = next; + movcmp(); + } while (checkq != -1); + + bcopy (now); +} + +bcopy (s) +register struct BOARD *s; /* game situation */ +{ + register int i; /* index */ + + for (i = 0; i < 26; i++) + board[i] = s->b_board[i]; + for (i = 0; i < 2; i++) { + in[i] = s->b_in[i]; + off[i] = s->b_off[i]; + } + for (i = 0; i < mvlim; i++) { + p[i] = s->b_st[i]; + g[i] = s->b_fn[i]; + } +} + +movcmp () { + register int i; + register int c; + +#ifdef DEBUG + if (trace == NULL) + trace = fopen ("bgtrace","w"); +#endif + + odds (0,0,0); + if (!race) { + ch = op = pt = 0; + for (i = 1; i < 25; i++) { + if (board[i] == cturn) + ch = canhit (i,1); + op += abs (bar-i); + } + for (i = bar+cturn; i != home; i += cturn) + if (board[i]*cturn > 1) + pt += abs(bar-i); + frc = freemen (bar)+trapped (bar,cturn); + frp = freemen (home)+trapped (home,-cturn); + } + for (em = bar; em != home; em += cturn) + if (board[em]*cturn > 0) + break; + em = abs(home-em); +#ifdef DEBUG + fputs ("Board: ",trace); + for (i = 0; i < 26; i++) + fprintf (trace, " %d",board[i]); + if (race) + fprintf (trace,"\n\tem = %d\n",em); + else + fprintf (trace, + "\n\tch = %d, pt = %d, em = %d, frc = %d, frp = %d\n", + ch,pt,em,frc,frp); + fputs ("\tMove: ",trace); + for (i = 0; i < mvlim; i++) + fprintf (trace," %d-%d",p[i],g[i]); + fputs ("\n",trace); + fflush (trace); + strcpy (tests,""); +#endif + if ((cp[0] == 0 && cg[0] == 0) || movegood()) { +#ifdef DEBUG + fprintf (trace,"\t[%s] ... wins.\n",tests); + fflush (trace); +#endif + for (i = 0; i < mvlim; i++) { + cp[i] = p[i]; + cg[i] = g[i]; + } + if (!race) { + chance = ch; + openmen = op; + points = pt; + endman = em; + barmen = abs(board[home]); + oldfrc = frc; + oldfrp = frp; + } + menin = *inptr; + menoff = *offptr; + } +#ifdef DEBUG + else { + fprintf (trace,"\t[%s] ... loses.\n",tests); + fflush (trace); + } +#endif +} + +movegood () { + register int n; + + if (*offptr == 15) + return (1); + if (menoff == 15) + return (0); + if (race) { +#ifdef DEBUG + strcat (tests,"o"); +#endif + if (*offptr-menoff) + return (*offptr > menoff); +#ifdef DEBUG + strcat (tests,"e"); +#endif + if (endman-em) + return (endman > em); +#ifdef DEBUG + strcat (tests,"i"); +#endif + if (menin == 15) + return (0); + if (*inptr == 15) + return (1); +#ifdef DEBUG + strcat (tests,"i"); +#endif + if (*inptr-menin) + return (*inptr > menin); + return (rnum(2)); + } else { + n = barmen-abs(board[home]); +#ifdef DEBUG + strcat (tests,"c"); +#endif + if (abs(chance-ch)+25*n > rnum(150)) + return (n? (n < 0): (ch < chance)); +#ifdef DEBUG + strcat (tests,"o"); +#endif + if (*offptr-menoff) + return (*offptr > menoff); +#ifdef DEBUG + strcat (tests,"o"); +#endif + if (abs(openmen-op) > 7+rnum(12)) + return (openmen > op); +#ifdef DEBUG + strcat (tests,"b"); +#endif + if (n) + return (n < 0); +#ifdef DEBUG + strcat (tests,"e"); +#endif + if (abs(endman-em) > rnum(2)) + return (endman > em); +#ifdef DEBUG + strcat (tests,"f"); +#endif + if (abs(frc-oldfrc) > rnum(2)) + return (frc < oldfrc); +#ifdef DEBUG + strcat (tests,"p"); +#endif + if (abs(n = pt-points) > rnum(4)) + return (n > 0); +#ifdef DEBUG + strcat (tests,"i"); +#endif + if (*inptr-menin) + return (*inptr > menin); +#ifdef DEBUG + strcat (tests,"f"); +#endif + if (abs(frp-oldfrp) > rnum(2)) + return (frp > oldfrp); + return (rnum(2)); + } +} diff --git a/games/backgammon/odds.c b/games/backgammon/odds.c new file mode 100644 index 0000000..e729604 --- /dev/null +++ b/games/backgammon/odds.c @@ -0,0 +1,86 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#ifndef lint +static char sccsid[] = "@(#)odds.c 5.1 (Berkeley) 5/29/85"; +#endif not lint + +#include "back.h" + +odds (r1,r2,val) +register int r1; +int r2, val; +{ + register int i, j; + + if (r1 == 0) { + for (i = 0; i < 6; i++) + for (j = 0; j < 6; j++) + table[i][j] = 0; + return; + } else { + r1--; + if (r2-- == 0) + for (i = 0; i < 6; i++) { + table[i][r1] += val; + table[r1][i] += val; + } + else { + table[r2][r1] += val; + table[r1][r2] += val; + } + } +} + +count () { + register int i; + register int j; + register int total; + + total = 0; + for (i = 0; i < 6; i++) + for (j = 0; j < 6; j++) + total += table[i][j]; + return (total); +} + +canhit (i,c) +int i, c; + +{ + register int j, k, b; + int a, d, diff, place, addon, menstuck; + + if (c == 0) + odds (0,0,0); + if (board[i] > 0) { + a = -1; + b = 25; + } else { + a = 1; + b = 0; + } + place = abs (25-b-i); + menstuck = abs (board[b]); + for (j = b; j != i; j += a) { + if (board[j]*a > 0) { + diff = abs(j-i); + addon = place+((board[j]*a > 2 || j == b)? 5: 0); + if ((j == b && menstuck == 1) && + (j != b && menstuck == 0)) + for (k = 1; k < diff; k++) + if (k < 7 && diff-k < 7 && + (board[i+a*k]*a >= 0 || + board[i+a*(diff-k)] >= 0)) + odds (k,diff-k,addon); + if ((j == b || menstuck < 2) && diff < 7) + odds (diff,0,addon); + } + if (j == b && menstuck > 1) + break; + } + return (count()); +} diff --git a/games/backgammon/one.c b/games/backgammon/one.c new file mode 100644 index 0000000..c73b103 --- /dev/null +++ b/games/backgammon/one.c @@ -0,0 +1,142 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#ifndef lint +static char sccsid[] = "@(#)one.c 5.1 (Berkeley) 5/29/85"; +#endif not lint + +#include "back.h" + +makmove (i) +register int i; + +{ + register int n, d; + int max; + + d = d0; + n = abs(g[i]-p[i]); + max = (*offptr < 0? 7: last()); + if (board[p[i]]*cturn <= 0) + return (checkd(d)+2); + if (g[i] != home && board[g[i]]*cturn < -1) + return (checkd(d)+3); + if (i || D0 == D1) { + if (n == max? D1 < n: D1 != n) + return (checkd(d)+1); + } else { + if (n == max? D0 < n && D1 < n: D0 != n && D1 != n) + return (checkd(d)+1); + if (n == max? D0 < n: D0 != n) { + if (d0) + return (checkd(d)+1); + swap; + } + } + if (g[i] == home && *offptr < 0) + return (checkd(d)+4); + h[i] = 0; + board[p[i]] -= cturn; + if (g[i] != home) { + if (board[g[i]] == -cturn) { + board[home] -= cturn; + board[g[i]] = 0; + h[i] = 1; + if (abs(bar-g[i]) < 7) { + (*inopp)--; + if (*offopp >= 0) + *offopp -= 15; + } + } + board[g[i]] += cturn; + if (abs(home-g[i]) < 7 && abs(home-p[i]) > 6) { + (*inptr)++; + if (*inptr+*offptr == 0) + *offptr += 15; + } + } else { + (*offptr)++; + (*inptr)--; + } + return (0); +} + +moverr (i) +register int i; + +{ + register int j; + + if (tflag) + curmove (20,0); + else + writec ('\n'); + writel ("Error: "); + for (j = 0; j <= i; j++) { + wrint (p[j]); + writec ('-'); + wrint (g[j]); + if (j < i) + writec (','); + } + writel ("... "); + movback (i); +} + + +checkd (d) +register int d; + +{ + if (d0 != d) + swap; + return (0); +} + +last () { + register int i; + + for (i = home-6*cturn; i != home; i += cturn) + if (board[i]*cturn > 0) + return (abs(home-i)); +} + +movback (i) +register int i; + +{ + register int j; + + for (j = i-1; j >= 0; j--) + backone(j); +} + +backone (i) +register int i; + +{ + board[p[i]] += cturn; + if (g[i] != home) { + board[g[i]] -= cturn; + if (abs(g[i]-home) < 7 && abs(p[i]-home) > 6) { + (*inptr)--; + if (*inptr+*offptr < 15 && *offptr >= 0) + *offptr -= 15; + } + } else { + (*offptr)--; + (*inptr)++; + } + if (h[i]) { + board[home] += cturn; + board[g[i]] = -cturn; + if (abs(bar-g[i]) < 7) { + (*inopp)++; + if (*inopp+*offopp == 0) + *offopp += 15; + } + } +} diff --git a/games/backgammon/save.c b/games/backgammon/save.c new file mode 100644 index 0000000..a127c1f --- /dev/null +++ b/games/backgammon/save.c @@ -0,0 +1,153 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#ifndef lint +static char sccsid[] = "@(#)save.c 5.1 (Berkeley) 5/29/85"; +#endif not lint + +#include "back.h" + +extern int errno; + +static char confirm[] = "Are you sure you want to leave now?"; +static char prompt[] = "Enter a file name: "; +static char exist1[] = "The file '"; +static char exist2[] = + "' already exists.\nAre you sure you want to use this file?"; +static char cantuse[] = "\nCan't use "; +static char saved[] = "This game has been saved on the file '"; +static char type[] = "'.\nType \"backgammon "; +static char rec[] = "\" to recover your game.\n\n"; +static char cantrec[] = "Can't recover file: "; + +save (n) +register int n; + +{ + register int fdesc; + register char *fs; + char fname[50]; + + if (n) { + if (tflag) { + curmove (20,0); + clend(); + } else + writec ('\n'); + writel (confirm); + if (! yorn(0)) + return; + } + cflag = 1; + for (;;) { + writel (prompt); + fs = fname; + while ((*fs = readc()) != '\n') { + if (*fs == tty.sg_erase) { + if (fs > fname) { + fs--; + if (tflag) + curmove (curr,curc-1); + else + writec (*fs); + } else + writec ('\007'); + continue; + } + writec (*fs++); + } + *fs = '\0'; + if ((fdesc = open(fname,2)) == -1 && errno == 2) { + if ((fdesc = creat (fname,0700)) != -1) + break; + } + if (fdesc != -1) { + if (tflag) { + curmove (18,0); + clend(); + } else + writec ('\n'); + writel (exist1); + writel (fname); + writel (exist2); + cflag = 0; + close (fdesc); + if (yorn (0)) { + unlink (fname); + fdesc = creat (fname,0700); + break; + } else { + cflag = 1; + continue; + } + } + writel (cantuse); + writel (fname); + writel (".\n"); + close (fdesc); + cflag = 1; + } + write (fdesc,board,sizeof board); + write (fdesc,off,sizeof off); + write (fdesc,in,sizeof in); + write (fdesc,dice,sizeof dice); + write (fdesc,&cturn,sizeof cturn); + write (fdesc,&dlast,sizeof dlast); + write (fdesc,&pnum,sizeof pnum); + write (fdesc,&rscore,sizeof rscore); + write (fdesc,&wscore,sizeof wscore); + write (fdesc,&gvalue,sizeof gvalue); + write (fdesc,&raflag,sizeof raflag); + close (fdesc); + if (tflag) + curmove (18,0); + writel (saved); + writel (fname); + writel (type); + writel (fname); + writel (rec); + if (tflag) + clend(); + getout (); +} + +recover (s) +char *s; + +{ + register int i; + int fdesc; + + if ((fdesc = open (s,0)) == -1) + norec (s); + read (fdesc,board,sizeof board); + read (fdesc,off,sizeof off); + read (fdesc,in,sizeof in); + read (fdesc,dice,sizeof dice); + read (fdesc,&cturn,sizeof cturn); + read (fdesc,&dlast,sizeof dlast); + read (fdesc,&pnum,sizeof pnum); + read (fdesc,&rscore,sizeof rscore); + read (fdesc,&wscore,sizeof wscore); + read (fdesc,&gvalue,sizeof gvalue); + read (fdesc,&raflag,sizeof raflag); + close (fdesc); + rflag = 1; +} + +norec (s) +register char *s; + +{ + register char *c; + + tflag = 0; + writel (cantrec); + c = s; + while (*c != '\0') + writec (*c++); + getout (); +} diff --git a/games/backgammon/subs.c b/games/backgammon/subs.c new file mode 100644 index 0000000..1d51c5e --- /dev/null +++ b/games/backgammon/subs.c @@ -0,0 +1,448 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#ifndef lint +static char sccsid[] = "@(#)subs.c 5.1 (Berkeley) 5/29/85"; +#endif not lint + +#include +#include "back.h" + +int buffnum; +char outbuff[BUFSIZ]; + +static char plred[] = "Player is red, computer is white."; +static char plwhite[] = "Player is white, computer is red."; +static char nocomp[] = "(No computer play.)"; + +char *descr[] = { + "Usage: backgammon [-] [n r w b pr pw pb t3a]\n", + "\t-\tgets this list\n\tn\tdon't ask for rules or instructions", + "\tr\tplayer is red (implies n)\n\tw\tplayer is white (implies n)", + "\tb\ttwo players, red and white (implies n)", + "\tpr\tprint the board before red's turn", + "\tpw\tprint the board before white's turn", + "\tpb\tprint the board before both player's turn", + "\tterm\tterminal is a term", + "\tsfile\trecover saved game from file", + 0 +}; + +errexit (s) +register char *s; +{ + write (2,"\n",1); + perror (s); + getout(); +} + +strset (s1,s2) +register char *s1, *s2; +{ + while ( (*s1++ = *s2++) != '\0'); +} + +addbuf (c) +register char c; + +{ + buffnum++; + if (buffnum == BUFSIZ) { + if (write(1,outbuff,BUFSIZ) != BUFSIZ) + errexit ("addbuf (write):"); + buffnum = 0; + } + outbuff[buffnum] = c; +} + +buflush () { + if (buffnum < 0) + return; + buffnum++; + if (write (1,outbuff,buffnum) != buffnum) + errexit ("buflush (write):"); + buffnum = -1; +} + +readc () { + char c; + + if (tflag) { + cline(); + newpos(); + } + buflush(); + if (read(0,&c,1) != 1) + errexit ("readc"); + if (c == '\177') + getout(); + if (c == '\033' || c == '\015') + return ('\n'); + if (cflag) + return (c); + if (c == '\014') + return ('R'); + if (c >= 'a' && c <= 'z') + return (c & 0137); + return (c); +} + +writec (c) +char c; +{ + if (tflag) + fancyc (c); + else + addbuf (c); +} + +writel (l) +register char *l; +{ +#ifdef DEBUG + register char *s; + + if (trace == NULL) + trace = fopen ("bgtrace","w"); + + fprintf (trace,"writel: \""); + for (s = l; *s; s++) { + if (*s < ' ' || *s == '\177') + fprintf (trace,"^%c",(*s)^0100); + else + putc (*s,trace); + } + fprintf (trace,"\"\n"); + fflush (trace); +#endif + + while (*l) + writec (*l++); +} + +proll () { + if (d0) + swap; + if (cturn == 1) + writel ("Red's roll: "); + else + writel ("White's roll: "); + writec (D0+'0'); + writec ('\040'); + writec (D1+'0'); + if (tflag) + cline(); +} + +wrint (n) +int n; +{ + register int i, j, t; + + for (i = 4; i > 0; i--) { + t = 1; + for (j = 0; j t-1) + writec ((n/t)%10+'0'); + } + writec (n%10+'0'); +} + +gwrite() { + register int r, c; + + if (tflag) { + r = curr; + c = curc; + curmove (16,0); + } + + if (gvalue > 1) { + writel ("Game value: "); + wrint (gvalue); + writel (". "); + if (dlast == -1) + writel (color[0]); + else + writel (color[1]); + writel (" doubled last."); + } else { + switch (pnum) { + case -1: /* player is red */ + writel (plred); + break; + case 0: /* player is both colors */ + writel (nocomp); + break; + case 1: /* player is white */ + writel (plwhite); + } + } + + if (rscore || wscore) { + writel (" "); + wrscore(); + } + + if (tflag) { + cline(); + curmove (r,c); + } +} + +quit () { + register int i; + + if (tflag) { + curmove (20,0); + clend(); + } else + writec ('\n'); + writel ("Are you sure you want to quit?"); + if (yorn (0)) { + if (rfl) { + writel ("Would you like to save this game?"); + if (yorn(0)) + save(0); + } + cturn = 0; + return (1); + } + return (0); +} + +yorn (special) +register char special; /* special response */ +{ + register char c; + register int i; + + i = 1; + while ( (c = readc()) != 'Y' && c != 'N') { + if (special && c == special) + return (2); + if (i) { + if (special) { + writel (" (Y, N, or "); + writec (special); + writec (')'); + } else + writel (" (Y or N)"); + i = 0; + } else + writec ('\007'); + } + if (c == 'Y') + writel (" Yes.\n"); + else + writel (" No.\n"); + if (tflag) + buflush(); + return (c == 'Y'); +} + +wrhit (i) +register int i; +{ + writel ("Blot hit on "); + wrint (i); + writec ('.'); + writec ('\n'); +} + +nexturn () { + register int c; + + cturn = -cturn; + c = cturn/abs(cturn); + home = bar; + bar = 25-bar; + offptr += c; + offopp -= c; + inptr += c; + inopp -= c; + Colorptr += c; + colorptr += c; +} + +getarg (arg) +register char ***arg; + +{ + register char **s; + + /* process arguments here. dashes are ignored, nbrw are ignored + if the game is being recovered */ + + s = *arg; + while (s[0][0] == '-') { + switch (s[0][1]) { + + /* don't ask if rules or instructions needed */ + case 'n': + if (rflag) + break; + aflag = 0; + args[acnt++] = 'n'; + break; + + /* player is both read and white */ + case 'b': + if (rflag) + break; + pnum = 0; + aflag = 0; + args[acnt++] = 'b'; + break; + + /* player is red */ + case 'r': + if (rflag) + break; + pnum = -1; + aflag = 0; + args[acnt++] = 'r'; + break; + + /* player is white */ + case 'w': + if (rflag) + break; + pnum = 1; + aflag = 0; + args[acnt++] = 'w'; + break; + + /* print board after move according to following character */ + case 'p': + if (s[0][2] != 'r' && s[0][2] != 'w' && s[0][2] != 'b') + break; + args[acnt++] = 'p'; + args[acnt++] = s[0][2]; + if (s[0][2] == 'r') + bflag = 1; + if (s[0][2] == 'w') + bflag = -1; + if (s[0][2] == 'b') + bflag = 0; + break; + + case 't': + if (s[0][2] == '\0') { /* get terminal caps */ + s++; + tflag = getcaps (*s); + } else + tflag = getcaps (&s[0][2]); + break; + + case 's': + s++; + /* recover file */ + recover (s[0]); + break; + } + s++; + } + if (s[0] != 0) + recover(s[0]); +} + +init () { + register int i; + for (i = 0; i < 26;) + board[i++] = 0; + board[1] = 2; + board[6] = board[13] = -5; + board[8] = -3; + board[12] = board[19] = 5; + board[17] = 3; + board[24] = -2; + off[0] = off[1] = -15; + in[0] = in[1] = 5; + gvalue = 1; + dlast = 0; +} + +wrscore () { + writel ("Score: "); + writel (color[1]); + writec (' '); + wrint (rscore); + writel (", "); + writel (color[0]); + writec (' '); + wrint (wscore); +} + +fixtty (mode) +int mode; +{ + if (tflag) + newpos(); + buflush(); + tty.sg_flags = mode; + if (stty (0,&tty) < 0) + errexit("fixtty"); +} + +getout () { + /* go to bottom of screen */ + if (tflag) { + curmove (23,0); + cline(); + } else + writec ('\n'); + + /* fix terminal status */ + fixtty (old); + exit(); +} +roll () { + register char c; + register int row; + register int col; + + if (iroll) { + if (tflag) { + row = curr; + col = curc; + curmove (17,0); + } else + writec ('\n'); + writel ("ROLL: "); + c = readc(); + if (c != '\n') { + while (c < '1' || c > '6') + c = readc(); + D0 = c-'0'; + writec (' '); + writec (c); + c = readc(); + while (c < '1' || c > '6') + c = readc(); + D1 = c-'0'; + writec (' '); + writec (c); + if (tflag) { + curmove (17,0); + cline(); + curmove (row,col); + } else + writec ('\n'); + return; + } + if (tflag) { + curmove (17,0); + cline(); + curmove (row,col); + } else + writec ('\n'); + } + D0 = rnum(6)+1; + D1 = rnum(6)+1; + d0 = 0; +} diff --git a/games/backgammon/table.c b/games/backgammon/table.c new file mode 100644 index 0000000..7f6891a --- /dev/null +++ b/games/backgammon/table.c @@ -0,0 +1,281 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#ifndef lint +static char sccsid[] = "@(#)table.c 5.1 (Berkeley) 5/29/85"; +#endif not lint + +#include "back.h" + +char *help2[] = { + " Enter moves as - or / where is the starting", + "position, is the finishing position, and is the roll.", + "Remember, each die roll must be moved separately.", + 0 +}; + +struct state { + char ch; + int fcode; + int newst; +}; + +struct state atmata[] = { + + 'R', 1, 0, '?', 7, 0, 'Q', 0, -3, 'B', 8, 25, + '9', 2, 25, '8', 2, 25, '7', 2, 25, '6', 2, 25, + '5', 2, 25, '4', 2, 25, '3', 2, 25, '2', 2, 19, + '1', 2, 15, '0', 2, 25, '.', 0, 0, '9', 2, 25, + '8', 2, 25, '7', 2, 25, '6', 2, 25, '5', 2, 25, + + '4', 2, 25, '3', 2, 25, '2', 2, 25, '1', 2, 25, + '0', 2, 25, '/', 0, 32, '-', 0, 39, '.', 0, 0, + '/', 5, 32, ' ', 6, 3, ',', 6, 3, '\n', 0, -1, + '6', 3, 28, '5', 3, 28, '4', 3, 28, '3', 3, 28, + '2', 3, 28, '1', 3, 28, '.', 0, 0, 'H', 9, 61, + + '9', 4, 61, '8', 4, 61, '7', 4, 61, '6', 4, 61, + '5', 4, 61, '4', 4, 61, '3', 4, 61, '2', 4, 53, + '1', 4, 51, '0', 4, 61, '.', 0, 0, '9', 4, 61, + '8', 4, 61, '7', 4, 61, '6', 4, 61, '5', 4, 61, + '4', 4, 61, '3', 4, 61, '2', 4, 61, '1', 4, 61, + + '0', 4, 61, ' ', 6, 3, ',', 6, 3, '-', 5, 39, + '\n', 0, -1, '.', 0, 0 +}; + +checkmove (ist) + +int ist; + +{ + register int j, n; + register char c; + char a; + +domove: + if (ist == 0) { + if (tflag) + curmove (curr,32); + else + writel ("\t\t"); + writel ("Move: "); + } + ist = mvl = ncin = 0; + for (j = 0; j < 5; j++) + p[j] = g[j] = -1; + +dochar: + c = readc(); + + if (c == 'S') { + raflag = 0; + save (1); + if (tflag) { + curmove (cturn == -1? 18: 19,39); + ist = -1; + goto domove; + } else { + proll (); + ist = 0; + goto domove; + } + } + + if (c == tty.sg_erase && ncin > 0) { + if (tflag) + curmove (curr,curc-1); + else { + if (tty.sg_erase == '\010') + writel ("\010 \010"); + else + writec (cin[ncin-1]); + } + ncin--; + n = rsetbrd(); + if (n == 0) { + n = -1; + if (tflag) + refresh(); + } + if ((ist = n) > 0) + goto dochar; + goto domove; + } + + if (c == tty.sg_kill && ncin > 0) { + if (tflag) { + refresh(); + curmove (curr,39); + ist = -1; + goto domove; + } else if (tty.sg_erase == '\010') { + for (j = 0; j < ncin; j++) + writel ("\010 \010"); + ist = -1; + goto domove; + } else { + writec ('\\'); + writec ('\n'); + proll (); + ist = 0; + goto domove; + } + } + + n = dotable(c,ist); + if (n >= 0) { + cin[ncin++] = c; + if (n > 2) + if ((! tflag) || c != '\n') + writec (c); + ist = n; + if (n) + goto dochar; + else + goto domove; + } + + if (n == -1 && mvl >= mvlim) + return(0); + if (n == -1 && mvl < mvlim-1) + return(-4); + + if (n == -6) { + if (! tflag) { + if (movokay(mvl+1)) { + wrboard(); + movback (mvl+1); + } + proll (); + writel ("\t\tMove: "); + for (j = 0; j < ncin;) + writec (cin[j++]); + } else { + if (movokay(mvl+1)) { + refresh(); + movback (mvl+1); + } else + curmove (cturn == -1? 18:19,ncin+39); + } + ist = n = rsetbrd(); + goto dochar; + } + + if (n != -5) + return(n); + writec ('\007'); + goto dochar; +} + +dotable (c,i) +char c; +register int i; + +{ + register int a, j; + int test; + + test = (c == 'R'); + + while ( (a = atmata[i].ch) != '.') { + if (a == c || (test && a == '\n')) { + switch (atmata[i].fcode) { + + case 1: + wrboard(); + if (tflag) { + curmove (cturn == -1? 18: 19,0); + proll (); + writel ("\t\t"); + } else + proll (); + break; + + case 2: + if (p[mvl] == -1) + p[mvl] = c-'0'; + else + p[mvl] = p[mvl]*10+c-'0'; + break; + + case 3: + if (g[mvl] != -1) { + if (mvl < mvlim) + mvl++; + p[mvl] = p[mvl-1]; + } + g[mvl] = p[mvl]+cturn*(c-'0'); + if (g[mvl] < 0) + g[mvl] = 0; + if (g[mvl] > 25) + g[mvl] = 25; + break; + + case 4: + if (g[mvl] == -1) + g[mvl] = c-'0'; + else + g[mvl] = g[mvl]*10+c-'0'; + break; + + case 5: + if (mvl < mvlim) + mvl++; + p[mvl] = g[mvl-1]; + break; + + case 6: + if (mvl < mvlim) + mvl++; + break; + + case 7: + if (tflag) + curmove (20,0); + else + writec ('\n'); + text (help2); + if (tflag) { + curmove (cturn == -1? 18: 19,39); + } else { + writec ('\n'); + proll(); + writel ("\t\tMove: "); + } + break; + + case 8: + p[mvl] = bar; + break; + + case 9: + g[mvl] = home; + } + + if (! test || a != '\n') + return (atmata[i].newst); + else + return (-6); + } + + i++; + } + + return (-5); +} + +rsetbrd () { + register int i, j, n; + + n = 0; + mvl = 0; + for (i = 0; i < 4; i++) + p[i] = g[i] = -1; + for (j = 0; j < ncin; j++) + n = dotable (cin[j],n); + return (n); +} diff --git a/games/backgammon/teach.c b/games/backgammon/teach.c new file mode 100644 index 0000000..cd10c82 --- /dev/null +++ b/games/backgammon/teach.c @@ -0,0 +1,134 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#ifndef lint +static char sccsid[] = "@(#)teach.c 5.1 (Berkeley) 5/29/85"; +#endif not lint + +#include "back.h" + +char *hello[]; +char *list[]; +char *intro1[]; +char *intro2[]; +char *moves[]; +char *remove[]; +char *hits[]; +char *endgame[]; +char *doubl[]; +char *stragy[]; +char *prog[]; +char *lastch[]; + +extern char ospeed; /* tty output speed for termlib */ + +char *helpm[] = { + "\nEnter a space or newline to roll, or", + " b to display the board", + " d to double", + " q to quit\n", + 0 +}; + +char *contin[] = { + "", + 0 +}; + +main (argc,argv) +int argc; +char **argv; + +{ + register char *s, *ts[]; + register int i; + + signal (2,getout); + if (gtty (0,&tty) == -1) /* get old tty mode */ + errexit ("teachgammon(gtty)"); + old = tty.sg_flags; +#ifdef V7 + raw = ((noech = old & ~ECHO) | CBREAK); /* set up modes */ +#else + raw = ((noech = old & ~ECHO) | RAW); /* set up modes */ +#endif + ospeed = old.sg_ospeed; /* for termlib */ + tflag = getcaps (getenv ("TERM")); +#ifdef V7 + while (*++argv != 0) +#else + while (*++argv != -1) +#endif + getarg (&argv); + if (tflag) { + noech &= ~(CRMOD|XTABS); + raw &= ~(CRMOD|XTABS); + clear(); + } + text (hello); + text (list); + i = text (contin); + if (i == 0) + i = 2; + init(); + while (i) + switch (i) { + + case 1: + leave(); + + case 2: + if (i = text(intro1)) + break; + wrboard(); + if (i = text(intro2)) + break; + + case 3: + if (i = text(moves)) + break; + + case 4: + if (i = text(remove)) + break; + + case 5: + if (i = text(hits)) + break; + + case 6: + if (i = text(endgame)) + break; + + case 7: + if (i = text(doubl)) + break; + + case 8: + if (i = text(stragy)) + break; + + case 9: + if (i = text(prog)) + break; + + case 10: + if (i = text(lastch)) + break; + } + tutor(); +} + +leave() { + if (tflag) + clear(); + else + writec ('\n'); + fixtty(old); + execl (EXEC,"backgammon",args,"n",0); + writel ("Help! Backgammon program is missing\007!!\n"); + exit (-1); +} diff --git a/games/backgammon/text.c b/games/backgammon/text.c new file mode 100644 index 0000000..d920b21 --- /dev/null +++ b/games/backgammon/text.c @@ -0,0 +1,105 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#ifndef lint +static char sccsid[] = "@(#)text.c 5.1 (Berkeley) 5/29/85"; +#endif not lint + +#include "back.h" + +char *instr[] = { + " If you did not notice by now, this program reacts to things as", + "soon as you type them, without waiting for a newline. This means that", + "the special characters RUBOUT, ESC, and CONTROL-D, will not perform", + "their special functions during most of this program. The program", + "should usually stop when a RUBOUT is typed, but occasionally it will", + "ignore RUBOUTs until it is waiting for input.\n", + " These instructions are presented in small chunks designed not to", + "roll off the top of your screen. When the characters '-->' are print-", + "ed, no more data will be printed until a space or newline is typed.", + "In this way, you can finish one section before continuing to another.", + "Like this:", + "", + " The two sides are colored 'red' and 'white.' The computer may play", + "one side, or if there are two players, the computer can merely act as", + "a gamekeeper, letting the players make the moves. Once you tell the", + "computer what color(s) you want to play, the decision remains in ef-", + "fect until you quit the program, even if you play more than one game,", + "since the program keeps a running score.\n", + " The program will prompt for a move in one of two ways. If the", + "player has the opportunity to double, then merely his color will be", + "typed out. The player can now do one of several things. He can dou-", + "ble by typing a 'd', he can roll by typing a space (' ') or newline,", + "or if he is not sure, he can reprint the board by typing a 'r'.\n", + " If the player cannot double, his roll will be thrust in front of", + "him, followed by the request 'Move:', asking for a move but not giving", + "him the chance to double. He can still ask for the board by typing", + "'r'. In either of these two states, the player can quit by typing 'q'", + "or save the game by typing 's'. In either case, the player will be", + "asked to verify, in case there was some error. The program then ends", + "immediately, after first saving the file if so requested.", + "", + " A player can move one of his men using two forms of input. The", + "first form is -, where is the starting position, and is", + "the finishing position of the player's man. For example, if white", + "wanted to move a piece from position 13 to position 8, his move could", + "be entered as 13-8. The second form is / where is the", + "starting position, an is the roll actually made. Hence, white", + "could have entered as 13/5 instead of 13-8.\n", + " A player must move each roll of the dice separately. For example,", + "if a player rolled 4 3, and wanted to move from 13 to 6, he could", + "enter it as 13/4,9/3 or 13/3,10/4 or 13-10,10-6 or 13-9,9-6, but not", + "13-6. The last two entries can be shortened to 13-10-6 and 13-9-6.", + "If you want to move more than one piece from the same position, such", + "as 13-10,13-9, you can abbreviate this using the / format as by", + "entering more than one , or 13/34. A player can use both forms for", + "the same roll, e.g. 13/3,13-9, and separates individual moves by ei-", + "ther a comma or a space. The letter 'b' represents the bar, and the", + "letter 'h' represents a player's home. You could also enter the", + "number that would be in the position of the bar, 25 or 0 as appropri-", + "ate. Use a newline at the end of your moves for a turn.", + "", + " As you type in your move, if a character does not make sense under", + "the above constrictions, a bell will sound instead of the character,", + "and it will be ignored. You may kill lines and erase characters as", + "you would normally, but don't be surprised if they look different than", + "usual. Also, if you have entered one or more of your rolls, and you", + "wish to see what the move looks like so far, type a 'r' to see what it", + "looks like. This cannot be done in the middle of a move (e.g., after", + "a '-' or '/'). After the printing board, the program will go back to", + "inputting your move and you can backspace or kill just as if you had", + "just typed in your input.\n", + " Now you should be ready to begin the game. Good luck!", + "", + 0}; + + +text (t) +char **t; + +{ + register int i; + register char *s, *a; + + fixtty (noech); + while (*t != 0) { + s = a = *t; + for (i = 0; *a != '\0'; i--) + a++; + if (i) { + writel (s); + writec ('\n'); + } else { + writel ("-->"); + fixtty (raw); + while ((i = readc()) != ' ' && i != '\n'); + fixtty (noech); + clear(); + } + t++; + } + fixtty (raw); +} diff --git a/games/backgammon/ttext1.c b/games/backgammon/ttext1.c new file mode 100644 index 0000000..2f21856 --- /dev/null +++ b/games/backgammon/ttext1.c @@ -0,0 +1,157 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#ifndef lint +static char sccsid[] = "@(#)ttext1.c 5.1 (Berkeley) 5/29/85"; +#endif not lint + +#include "back.h" + +char *opts = " QIMRHEDSPT"; +char *prompt = "-->"; + +char *list[] = { + "\n\n\tI\tIntroduction to Backgammon", + "\tM\tMoves and Points", + "\tR\tRemoving Men from the Board", + "\tH\tHitting Blots", + "\tE\tEnding the Game and Scoring", + "\tD\tDoubling", + "\tS\tStrategy", + "\tP\tThe Program and How to Use It", + "\nalso, you can type:", + "\t?\tto get this list", + "\tQ\tto go start playing", + "\tT\tto go straight to the tutorial", + 0 +}; + +char *hello[] = { + "\n\032 These rules consist of text describing how to play Backgammon", + "followed by a tutorial session where you play a practice game", + "against the computer. When using this program, think carefuly", + "before typing, since it reacts as soon as you type something. In", + "addition, the program presents text output, such as these rules,", + "in small blocks that will not roll off the top of the screen.", + "Frequently, you will see the characters '-->' indicating that the", + "program is waiting for you to finish reading, and will continue", + "printing when you type a space or newline. Also, the rules are", + "divided into sections, and although you should read them in or-", + "der, you can go directly to any of them by typing one of the fol-", + "lowing letters:", + "(Remember to hit a space or a newline to continue.)", + "", + 0 +}; + +char *intro1[] = { + "\nIntroduction:", + "\n Backgammon is a game involving the skill of two players and", + "the luck of two dice. There are two players, red and white, and", + "each player gets fifteen men. The object of the game is to re-", + "move all your men from the board before the opponent does. The", + "board consists of twenty-four positions, a 'bar' and a 'home' for", + "each player. It looks like this:", + "", + 0}; + +char *intro2[] = { + "", + "\n Although not indicated on the board, the players' homes are", + "located just to the right of the board. A player's men are placed", + "there when they are removed from the board. The board you just", + "saw was in it's initial position. All games start with the board", + "looking like this. Notice that red's pieces are represented by the", + "letter 'r' and white's pieces are represented by the letter 'w'.", + "Also, a position may have zero or more pieces on it, e.g. posi-", + "tion 12 has five red pieces on it, while position 11 does not", + "have any pieces of either color.", + "", + 0}; + +char *moves[] = { + "\nMoves and Points:", + "\n Moves are made along the positions on the board according to", + "their numbers. Red moves in the positive direction (clockwise", + "from 1 to 24), and white moves in the negative direction (coun-", + "terclockwise from 24 to 1).", + "\n A turn consists of rolling the dice, and moving the number of", + "positions indicated on each die. The two numbers can be used to", + "move one man the sum of the two rolls, or two men the number on", + "each individual die. For example, if red rolled 6 3 at the start", + "of the game, he might move a man from 1 to 7 to 10, using both", + "dice for one man, or he might move two men from position 12, one", + "to 15 and one to 18. (Red did not have to choose two men start-", + "ing from the same position.) In addition, doubles are treated", + "specially in backgammon. When a player rolls doubles, he gets to", + "move as if he had four dice instead of two. For instance, if you", + "rolled double 2's, you could move one man eight positions, four", + "men two positions each, or any permutation in between.", + "", + "\n However, there are certain limitations, called 'points.' A", + "player has a point when he has two or more men on the same posi-", + "tion. This gives him custody of that position, and his opponent", + "cannot place his men there, even if passing through on the way to", + "another position. When a player has six points in a row, it is", + "called a 'wall,' since any of his opponent's men behind the wall", + "cannot pass it and are trapped, at least for the moment. Notice", + "that this could mean that a player could not use part or all of", + "his roll. However, he must use as much of his roll as possible.", + "", + 0}; + +char *remove[] = { + "\nRemoving Men from the Board:", + "\n The most important part of the game is removing men, since", + "that is how you win the game. Once a man is removed, he stays", + "off the board for the duration of the game. However, a player", + "cannot remove men until all his men are on his 'inner table,' or", + "the last six positions of the board (19-24 for red, 6-1 for", + "white).", + "\n To get off the board, a player must roll the exact number to", + "get his man one position past the last position on the board, or", + "his 'home.' Hence, if red wanted to remove a man from position", + "23, he would have to roll a 2, anything else would be used for", + "another man, or for another purpose. However, there is one ex-", + "ception. If the player rolling has no men far enough to move the", + "roll made, he may move his farthest man off the board. For exam-", + "ple, if red's farthest man back was on position 21, he could re-", + "move men from that position if he rolled a 5 or a 6, as well as a", + "4. Since he does not have men on 20 (where he could use a 5) or", + "on 19 (where he could use a 6), he can use these rolls for posi-", + "tion 21. A player never has to remove men, but he must make as", + "many moves as possible.", + "", + 0}; + +char *hits[] = { + "\nHitting Blots:", + "\n Although two men on a position form an impenetrable point, a", + "lone man is not so secure. Such a man is called a 'blot' and has", + "the potential of getting hit by an opposing man. When a player's", + "blot is hit, he is placed on the bar, and the first thing that", + "player must do is move the man off the bar. Such moves are", + "counted as if the bar is one position behind the first position", + "on the board. Thus if red has a man on the bar and rolls 2 3, he", + "must move the man on the bar to position 2 or 3 before moving any", + "other man. If white had points on positions 2 and 3, then red", + "would forfeit his turn. Being on the bar is a very bad position,", + "for often a player can lose many turns trying to move off the", + "bar, as well as being set back the full distance of the board.", + "", + 0}; + +char *endgame[] = { + "\nEnding the Game and Scoring:", + "\n Winning a game usually wins one point, the normal value of a", + "game. However, if the losing player has not removed any men yet,", + "then the winning player wins double the game value, called a", + "'gammon.' If the losing player has a player on the bar or on the", + "winner's inner table, then the winner gets triple the game value,", + "which is called a 'backgammon.' (So that's where the name comes", + "from!)", + "", + 0}; diff --git a/games/backgammon/ttext2.c b/games/backgammon/ttext2.c new file mode 100644 index 0000000..d4fe439 --- /dev/null +++ b/games/backgammon/ttext2.c @@ -0,0 +1,166 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#ifndef lint +static char sccsid[] = "@(#)ttext2.c 5.1 (Berkeley) 5/29/85"; +#endif not lint + +#include "back.h" + +char *prompt, *list, *opts; + +char *doubl[] = { + "\nDoubling:", + "\n If a player thinks he is in a good position, he may double the", + "value of the game. However, his opponent may not accept the pro-", + "posal and forfeit the game before the price gets too high. A", + "player must double before he rolls, and once his double has been", + "accepted, he cannot double again, until his opponent has doubled.", + "Thus, unless the game swings back and forth in advantage between", + "the two players a great deal, the value of the game should be", + "low. At any rate, the value of the game will never go above 64,", + "or six doubles. However, if a player wins a backgammon at 64", + "points, he wins 192 points!", + "", + 0}; + +char *stragy[] = { + "\nStrategy:", + "\n Some general hints when playing: Try not to leave men open", + "unless absolutely necessary. Also, it is good to make as many", + "points as possible. Often, two men from different positions can", + "be brought together to form a new point. Although walls (six", + "points in a row) are difficult to form, many points nestled close-", + "ly together produce a formidable barrier. Also, while it is good", + "to move back men forward, doing so lessens the opportunity for you", + "to hit men. Finally, remember that once the two player's have", + "passed each other on the board, there is no chance of either team", + "being hit, so the game reduces to a race off the board. Addi-", + "tional hints on strategy are presented in the practice game.", + "", + 0}; + +char *prog[] = { + "\nThe Program and How It Works:", + "\n A general rule of thumb is when you don't know what to do,", + "type a question mark, and you should get some help. When it is", + "your turn, only your color will be printed out, with nothing", + "after it. You may double by typing a 'd', but if you type a", + "space or newline, you will get your roll. (Remember, you must", + "double before you roll.) Also, typing a 'r' will reprint the", + "board, and a 'q' will quit the game. The program will type", + "'Move:' when it wants your move, and you may indicate each die's", + "move with -, where is the starting position and is", + "the finishing position, or / where is the roll made.", + "-- is short for -,- and / is", + "short for /,/. Moves may be separated by a comma", + "or a space.", + "", + "\n While typing, any input which does not make sense will not be", + "echoed, and a bell will sound instead. Also, backspacing and", + "killing lines will echo differently than normal. You may examine", + "the board by typing a 'r' if you have made a partial move, or be-", + "fore you type a newline, to see what the board looks like. You", + "must end your move with a newline. If you cannot double, your", + "roll will always be printed, and you will not be given the oppor-", + "tunity to double. Home and bar are represented by the appropri-", + "ate number, 0 or 25 as the case may be, or by the letters 'h' or", + "'b' as appropriate. You may also type 'r' or 'q' when the program", + "types 'Move:', which has the same effect as above. Finally, you", + "will get to decide if you want to play red or white (or both if you", + "want to play a friend) at the beginning of the session, and you", + "will not get to change your mind later, since the computer keeps", + "score.", + "", + 0}; + +char *lastch[] = { + "\nTutorial (Practice Game):", + "\n This tutorial, for simplicity's sake, will let you play one", + "predetermined game. All the rolls have been pre-arranged, and", + "only one response will let you advance to the next move.", + "Although a given roll will may have several legal moves, the tu-", + "torial will only accept one (not including the same moves in a", + "different order), claiming that that move is 'best.' Obviously,", + "a subjective statement. At any rate, be patient with it and have", + "fun learning about backgammon. Also, to speed things up a lit-", + "tle, doubling will not take place in the tutorial, so you will", + "never get that opportunity, and quitting only leaves the tutori-", + "al, not the game. You will still be able to play backgammon", + "after quitting.", + "\n This is your last chance to look over the rules before the tu-", + "torial starts.", + "", + 0}; + +text (txt) +char **txt; + +{ + char **begin; + char *a; + char b; + char *c; + int i; + + fixtty (noech); + begin = txt; + while (*txt) { + a = *(txt++); + if (*a != '\0') { + c = a; + for (i = 0; *(c++) != '\0'; i--); + writel (a); + writec ('\n'); + } else { + fixtty (raw); + writel (prompt); + for (;;) { + if ((b = readc()) == '?') { + if (tflag) { + if (begscr) { + curmove (18,0); + clend(); + } else + clear(); + } else + writec ('\n'); + text (list); + writel (prompt); + continue; + } + i = 0; + if (b == '\n') + break; + while (i < 11) { + if (b == opts[i]) + break; + i++; + } + if (i == 11) + writec ('\007'); + else + break; + } + if (tflag) { + if (begscr) { + curmove (18,0); + clend(); + } else + clear(); + } else + writec ('\n'); + if (i) + return(i); + fixtty (noech); + if (tflag) + curmove (curr,0); + begin = txt; + } + } + fixtty (raw); + return (0); +} diff --git a/games/backgammon/tutor.c b/games/backgammon/tutor.c new file mode 100644 index 0000000..4725d0d --- /dev/null +++ b/games/backgammon/tutor.c @@ -0,0 +1,128 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#ifndef lint +static char sccsid[] = "@(#)tutor.c 5.1 (Berkeley) 5/29/85"; +#endif not lint + +#include "back.h" +#include "tutor.h" + +extern int maxmoves; +extern char *finis[]; + +extern struct situatn test[]; + +static char better[] = "That is a legal move, but there is a better one.\n"; + +tutor () { + register int i, j; + + i = 0; + begscr = 18; + cturn = -1; + home = 0; + bar = 25; + inptr = &in[0]; + inopp = &in[1]; + offptr = &off[0]; + offopp = &off[1]; + Colorptr = &color[0]; + colorptr = &color[2]; + colen = 5; + wrboard(); + + while (1) { + if (! brdeq(test[i].brd,board)) { + if (tflag && curr == 23) + curmove (18,0); + writel (better); + nexturn(); + movback (mvlim); + if (tflag) { + refresh(); + clrest (); + } + if ((! tflag) || curr == 19) { + proll(); + writec ('\t'); + } + else + curmove (curr > 19? curr-2: curr+4,25); + getmove(); + if (cturn == 0) + leave(); + continue; + } + if (tflag) + curmove (18,0); + text (*test[i].com); + if (! tflag) + writec ('\n'); + if (i == maxmoves) + break; + D0 = test[i].roll1; + D1 = test[i].roll2; + d0 = 0; + mvlim = 0; + for (j = 0; j < 4; j++) { + if (test[i].mp[j] == test[i].mg[j]) + break; + p[j] = test[i].mp[j]; + g[j] = test[i].mg[j]; + mvlim++; + } + if (mvlim) + for (j = 0; j < mvlim; j++) + if (makmove(j)) + writel ("AARGH!!!\n"); + if (tflag) + refresh(); + nexturn(); + D0 = test[i].new1; + D1 = test[i].new2; + d0 = 0; + i++; + mvlim = movallow(); + if (mvlim) { + if (tflag) + clrest(); + proll(); + writec('\t'); + getmove(); + if (tflag) + refresh(); + if (cturn == 0) + leave(); + } + } + leave(); +} + +clrest () { + register int r, c, j; + + r = curr; + c = curc; + for (j = r+1; j < 24; j++) { + curmove (j,0); + cline(); + } + curmove (r,c); +} + +brdeq (b1,b2) +register int *b1, *b2; + +{ + register int *e; + + e = b1+26; + while (b1 < e) + if (*b1++ != *b2++) + return(0); + return(1); +} diff --git a/games/backgammon/tutor.h b/games/backgammon/tutor.h new file mode 100644 index 0000000..5d4fbd6 --- /dev/null +++ b/games/backgammon/tutor.h @@ -0,0 +1,18 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + * + * @(#)tutor.h 5.1 (Berkeley) 5/29/85 + */ + +struct situatn { + int brd[26]; + int roll1; + int roll2; + int mp[4]; + int mg[4]; + int new1; + int new2; + char *(*com[8]); +}; diff --git a/games/banner.c b/games/banner.c new file mode 100644 index 0000000..6d3cb8a --- /dev/null +++ b/games/banner.c @@ -0,0 +1,1132 @@ + +static char sccsid[] = " banner.c 4.1 82/10/24 "; + +/* + * banner - prints large signs + * banner [-w#] [-d] [-t] message ... + */ + +#include +#define dir(f) "/e1/mrh/ucb/lib/f" +#define INDTBL dir(ban.dat.indtbl) +#define OBJECT dir(ban.dat.object) +#define MAXMSG 100 +#define DWIDTH 132 +#define NCHARS 128 +#define NBYTES 9271 + +/* Pointers into data_table for each ASCII char */ +int asc_ptr[NCHARS] = { +/* ^@ */ 0, 0, 0, 0, 0, 0, 0, 0, +/* ^H */ 0, 0, 0, 0, 0, 0, 0, 0, +/* ^P */ 0, 0, 0, 0, 0, 0, 0, 0, +/* ^X */ 0, 0, 0, 0, 0, 0, 0, 0, +/* */ 1, 3, 50, 81, 104, 281, 483, 590, +/* ( */ 621, 685, 749, 851, 862, 893, 898, 921, +/* 0 */1019, 1150, 1200, 1419, 1599, 1744, 1934, 2111, +/* 8 */2235, 2445, 2622, 2659, 0, 2708, 0, 2715, +/* @ */2857, 3072, 3273, 3403, 3560, 3662, 3730, 3785, +/* H */3965, 4000, 4015, 4115, 4281, 4314, 4432, 4548, +/* P */4709, 4790, 4999, 5188, 5397, 5448, 5576, 5710, +/* X */5892, 6106, 6257, 0, 0, 0, 0, 0, +/* ` */ 50, 6503, 6642, 6733, 6837, 6930, 7073, 7157, +/* h */7380, 7452, 7499, 7584, 7689, 7702, 7797, 7869, +/* p */7978, 8069, 8160, 8222, 8381, 8442, 8508, 8605, +/* x */8732, 8888, 9016, 0, 0, 0, 0, 0 +}; + +/* + * Table of stuff to print. Format: + * 128+n -> print current line n times. + * 64+n -> this is last byte of char. + * else, put m chars at position n (where m + * is the next elt in array) and goto second + * next element in array. + */ +char data_table[NBYTES] = { +/* 0 1 2 3 4 5 6 7 8 9 */ +/* 0 */ 129, 227, 130, 34, 6, 90, 19, 129, 32, 10, +/* 10 */ 74, 40, 129, 31, 12, 64, 53, 129, 30, 14, +/* 20 */ 54, 65, 129, 30, 14, 53, 67, 129, 30, 14, +/* 30 */ 54, 65, 129, 31, 12, 64, 53, 129, 32, 10, +/* 40 */ 74, 40, 129, 34, 6, 90, 19, 129, 194, 130, +/* 50 */ 99, 9, 129, 97, 14, 129, 96, 18, 129, 95, +/* 60 */ 22, 129, 95, 16, 117, 2, 129, 95, 14, 129, +/* 70 */ 96, 11, 129, 97, 9, 129, 99, 6, 129, 194, +/* 80 */ 129, 87, 4, 101, 4, 131, 82, 28, 131, 87, +/* 90 */ 4, 101, 4, 133, 82, 28, 131, 87, 4, 101, +/* 100 */ 4, 131, 193, 129, 39, 1, 84, 27, 129, 38, +/* 110 */ 3, 81, 32, 129, 37, 5, 79, 35, 129, 36, +/* 120 */ 5, 77, 38, 129, 35, 5, 76, 40, 129, 34, +/* 130 */ 5, 75, 21, 103, 14, 129, 33, 5, 74, 19, +/* 140 */ 107, 11, 129, 32, 5, 73, 17, 110, 9, 129, +/* 150 */ 32, 4, 73, 16, 112, 7, 129, 31, 4, 72, +/* 160 */ 15, 114, 6, 129, 31, 4, 72, 14, 115, 5, +/* 170 */ 129, 30, 4, 71, 15, 116, 5, 129, 27, 97, +/* 180 */ 131, 30, 4, 69, 14, 117, 4, 129, 30, 4, +/* 190 */ 68, 15, 117, 4, 132, 30, 4, 68, 14, 117, +/* 200 */ 4, 129, 27, 97, 131, 30, 5, 65, 15, 116, +/* 210 */ 5, 129, 31, 4, 65, 14, 116, 4, 129, 31, +/* 220 */ 6, 64, 15, 116, 4, 129, 32, 7, 62, 16, +/* 230 */ 115, 4, 129, 32, 9, 61, 17, 114, 5, 129, +/* 240 */ 33, 11, 58, 19, 113, 5, 129, 34, 14, 55, +/* 250 */ 21, 112, 5, 129, 35, 40, 111, 5, 129, 36, +/* 260 */ 38, 110, 5, 129, 37, 35, 109, 5, 129, 38, +/* 270 */ 32, 110, 3, 129, 40, 27, 111, 1, 129, 193, +/* 280 */ 129, 30, 4, 103, 9, 129, 30, 7, 100, 15, +/* 290 */ 129, 30, 10, 99, 17, 129, 33, 10, 97, 6, +/* 300 */ 112, 6, 129, 36, 10, 96, 5, 114, 5, 129, +/* 310 */ 39, 10, 96, 4, 115, 4, 129, 42, 10, 95, +/* 320 */ 4, 116, 4, 129, 45, 10, 95, 3, 117, 3, +/* 330 */ 129, 48, 10, 95, 3, 117, 3, 129, 51, 10, +/* 340 */ 95, 4, 116, 4, 129, 54, 10, 96, 4, 115, +/* 350 */ 4, 129, 57, 10, 96, 5, 114, 5, 129, 60, +/* 360 */ 10, 97, 6, 112, 6, 129, 63, 10, 99, 17, +/* 370 */ 129, 66, 10, 100, 15, 129, 69, 10, 103, 9, +/* 380 */ 129, 39, 9, 72, 10, 129, 36, 15, 75, 10, +/* 390 */ 129, 35, 17, 78, 10, 129, 33, 6, 48, 6, +/* 400 */ 81, 10, 129, 32, 5, 50, 5, 84, 10, 129, +/* 410 */ 32, 4, 51, 4, 87, 10, 129, 31, 4, 52, +/* 420 */ 4, 90, 10, 129, 31, 3, 53, 3, 93, 10, +/* 430 */ 129, 31, 3, 53, 3, 96, 10, 129, 31, 4, +/* 440 */ 52, 4, 99, 10, 129, 32, 4, 51, 4, 102, +/* 450 */ 10, 129, 32, 5, 50, 5, 105, 10, 129, 33, +/* 460 */ 6, 48, 6, 108, 10, 129, 35, 17, 111, 10, +/* 470 */ 129, 36, 15, 114, 7, 129, 40, 9, 118, 4, +/* 480 */ 129, 193, 129, 48, 18, 129, 43, 28, 129, 41, +/* 490 */ 32, 129, 39, 36, 129, 37, 40, 129, 35, 44, +/* 500 */ 129, 34, 46, 129, 33, 13, 68, 13, 129, 32, +/* 510 */ 9, 73, 9, 129, 32, 7, 75, 7, 129, 31, +/* 520 */ 6, 77, 6, 129, 31, 5, 78, 5, 129, 30, +/* 530 */ 5, 79, 5, 129, 20, 74, 132, 30, 4, 80, +/* 540 */ 4, 129, 31, 3, 79, 4, 129, 31, 4, 79, +/* 550 */ 4, 129, 32, 3, 78, 4, 129, 32, 4, 76, +/* 560 */ 6, 129, 33, 4, 74, 7, 129, 34, 4, 72, +/* 570 */ 8, 129, 35, 5, 72, 7, 129, 37, 5, 73, +/* 580 */ 4, 129, 39, 4, 74, 1, 129, 129, 193, 130, +/* 590 */ 111, 6, 129, 109, 10, 129, 108, 12, 129, 107, +/* 600 */ 14, 129, 97, 2, 105, 16, 129, 99, 22, 129, +/* 610 */ 102, 18, 129, 105, 14, 129, 108, 9, 129, 194, +/* 620 */ 130, 63, 25, 129, 57, 37, 129, 52, 47, 129, +/* 630 */ 48, 55, 129, 44, 63, 129, 41, 69, 129, 38, +/* 640 */ 75, 129, 36, 79, 129, 34, 83, 129, 33, 28, +/* 650 */ 90, 28, 129, 32, 23, 96, 23, 129, 32, 17, +/* 660 */ 102, 17, 129, 31, 13, 107, 13, 129, 30, 9, +/* 670 */ 112, 9, 129, 30, 5, 116, 5, 129, 30, 1, +/* 680 */ 120, 1, 129, 194, 130, 30, 1, 120, 1, 129, +/* 690 */ 30, 5, 116, 5, 129, 30, 9, 112, 9, 129, +/* 700 */ 31, 13, 107, 13, 129, 32, 17, 102, 17, 129, +/* 710 */ 32, 23, 96, 23, 129, 33, 28, 90, 28, 129, +/* 720 */ 34, 83, 129, 36, 79, 129, 38, 75, 129, 41, +/* 730 */ 69, 129, 44, 63, 129, 48, 55, 129, 52, 47, +/* 740 */ 129, 57, 37, 129, 63, 25, 129, 194, 129, 80, +/* 750 */ 4, 130, 80, 4, 129, 68, 2, 80, 4, 94, +/* 760 */ 2, 129, 66, 6, 80, 4, 92, 6, 129, 67, +/* 770 */ 7, 80, 4, 90, 7, 129, 69, 7, 80, 4, +/* 780 */ 88, 7, 129, 71, 6, 80, 4, 87, 6, 129, +/* 790 */ 72, 20, 129, 74, 16, 129, 76, 12, 129, 62, +/* 800 */ 40, 131, 76, 12, 129, 74, 16, 129, 72, 20, +/* 810 */ 129, 71, 6, 80, 4, 87, 6, 129, 69, 7, +/* 820 */ 80, 4, 88, 7, 129, 67, 7, 80, 4, 90, +/* 830 */ 7, 129, 66, 6, 80, 4, 92, 6, 129, 68, +/* 840 */ 2, 80, 4, 94, 2, 129, 80, 4, 130, 193, +/* 850 */ 129, 60, 4, 139, 41, 42, 131, 60, 4, 139, +/* 860 */ 193, 130, 34, 6, 129, 32, 10, 129, 31, 12, +/* 870 */ 129, 30, 14, 129, 20, 2, 28, 16, 129, 22, +/* 880 */ 22, 129, 24, 19, 129, 27, 15, 129, 31, 9, +/* 890 */ 129, 194, 129, 60, 4, 152, 193, 130, 34, 6, +/* 900 */ 129, 32, 10, 129, 31, 12, 129, 30, 14, 131, +/* 910 */ 31, 12, 129, 32, 10, 129, 34, 6, 129, 194, +/* 920 */ 129, 30, 4, 129, 30, 7, 129, 30, 10, 129, +/* 930 */ 33, 10, 129, 36, 10, 129, 39, 10, 129, 42, +/* 940 */ 10, 129, 45, 10, 129, 48, 10, 129, 51, 10, +/* 950 */ 129, 54, 10, 129, 57, 10, 129, 60, 10, 129, +/* 960 */ 63, 10, 129, 66, 10, 129, 69, 10, 129, 72, +/* 970 */ 10, 129, 75, 10, 129, 78, 10, 129, 81, 10, +/* 980 */ 129, 84, 10, 129, 87, 10, 129, 90, 10, 129, +/* 990 */ 93, 10, 129, 96, 10, 129, 99, 10, 129, 102, +/* 1000 */ 10, 129, 105, 10, 129, 108, 10, 129, 111, 10, +/* 1010 */ 129, 114, 7, 129, 117, 4, 129, 193, 129, 60, +/* 1020 */ 31, 129, 53, 45, 129, 49, 53, 129, 46, 59, +/* 1030 */ 129, 43, 65, 129, 41, 69, 129, 39, 73, 129, +/* 1040 */ 37, 77, 129, 36, 79, 129, 35, 15, 101, 15, +/* 1050 */ 129, 34, 11, 106, 11, 129, 33, 9, 109, 9, +/* 1060 */ 129, 32, 7, 112, 7, 129, 31, 6, 114, 6, +/* 1070 */ 129, 31, 5, 115, 5, 129, 30, 5, 116, 5, +/* 1080 */ 129, 30, 4, 117, 4, 132, 30, 5, 116, 5, +/* 1090 */ 129, 31, 5, 115, 5, 129, 31, 6, 114, 6, +/* 1100 */ 129, 32, 7, 112, 7, 129, 33, 9, 109, 9, +/* 1110 */ 129, 34, 11, 106, 11, 129, 35, 15, 101, 15, +/* 1120 */ 129, 36, 79, 129, 37, 77, 129, 39, 73, 129, +/* 1130 */ 41, 69, 129, 43, 65, 129, 46, 59, 129, 49, +/* 1140 */ 53, 129, 53, 45, 129, 60, 31, 129, 193, 129, +/* 1150 */ 30, 4, 129, 30, 4, 100, 1, 129, 30, 4, +/* 1160 */ 100, 3, 129, 30, 4, 100, 5, 129, 30, 76, +/* 1170 */ 129, 30, 78, 129, 30, 80, 129, 30, 82, 129, +/* 1180 */ 30, 83, 129, 30, 85, 129, 30, 87, 129, 30, +/* 1190 */ 89, 129, 30, 91, 129, 30, 4, 132, 193, 129, +/* 1200 */ 30, 3, 129, 30, 7, 129, 30, 10, 112, 1, +/* 1210 */ 129, 30, 13, 112, 2, 129, 30, 16, 112, 3, +/* 1220 */ 129, 30, 18, 111, 5, 129, 30, 21, 111, 6, +/* 1230 */ 129, 30, 23, 112, 6, 129, 30, 14, 47, 8, +/* 1240 */ 113, 6, 129, 30, 14, 49, 8, 114, 5, 129, +/* 1250 */ 30, 14, 51, 8, 115, 5, 129, 30, 14, 53, +/* 1260 */ 8, 116, 4, 129, 30, 14, 55, 8, 116, 5, +/* 1270 */ 129, 30, 14, 56, 9, 117, 4, 129, 30, 14, +/* 1280 */ 57, 9, 117, 4, 129, 30, 14, 58, 10, 117, +/* 1290 */ 4, 129, 30, 14, 59, 10, 117, 4, 129, 30, +/* 1300 */ 14, 60, 11, 117, 4, 129, 30, 14, 61, 11, +/* 1310 */ 116, 5, 129, 30, 14, 62, 11, 116, 5, 129, +/* 1320 */ 30, 14, 63, 12, 115, 6, 129, 30, 14, 64, +/* 1330 */ 13, 114, 7, 129, 30, 14, 65, 13, 113, 8, +/* 1340 */ 129, 30, 14, 65, 15, 111, 9, 129, 30, 14, +/* 1350 */ 66, 16, 109, 11, 129, 30, 14, 67, 17, 107, +/* 1360 */ 12, 129, 30, 14, 68, 20, 103, 16, 129, 30, +/* 1370 */ 14, 69, 49, 129, 30, 14, 70, 47, 129, 30, +/* 1380 */ 14, 71, 45, 129, 30, 14, 73, 42, 129, 30, +/* 1390 */ 15, 75, 38, 129, 33, 12, 77, 34, 129, 36, +/* 1400 */ 10, 79, 30, 129, 40, 6, 82, 23, 129, 44, +/* 1410 */ 3, 86, 15, 129, 47, 1, 129, 193, 129, 129, +/* 1420 */ 38, 3, 129, 37, 5, 111, 1, 129, 36, 7, +/* 1430 */ 111, 2, 129, 35, 9, 110, 5, 129, 34, 8, +/* 1440 */ 110, 6, 129, 33, 7, 109, 8, 129, 32, 7, +/* 1450 */ 110, 8, 129, 32, 6, 112, 7, 129, 31, 6, +/* 1460 */ 113, 6, 129, 31, 5, 114, 6, 129, 30, 5, +/* 1470 */ 115, 5, 129, 30, 5, 116, 4, 129, 30, 4, +/* 1480 */ 117, 4, 131, 30, 4, 117, 4, 129, 30, 4, +/* 1490 */ 79, 2, 117, 4, 129, 30, 5, 78, 4, 117, +/* 1500 */ 4, 129, 30, 5, 77, 6, 116, 5, 129, 30, +/* 1510 */ 6, 76, 8, 115, 6, 129, 30, 7, 75, 11, +/* 1520 */ 114, 6, 129, 30, 8, 73, 15, 112, 8, 129, +/* 1530 */ 31, 9, 71, 19, 110, 9, 129, 31, 11, 68, +/* 1540 */ 26, 107, 12, 129, 32, 13, 65, 14, 82, 36, +/* 1550 */ 129, 32, 16, 61, 17, 83, 34, 129, 33, 44, +/* 1560 */ 84, 32, 129, 34, 42, 85, 30, 129, 35, 40, +/* 1570 */ 87, 27, 129, 36, 38, 89, 23, 129, 38, 34, +/* 1580 */ 92, 17, 129, 40, 30, 95, 11, 129, 42, 26, +/* 1590 */ 129, 45, 20, 129, 49, 11, 129, 193, 129, 49, +/* 1600 */ 1, 129, 49, 4, 129, 49, 6, 129, 49, 8, +/* 1610 */ 129, 49, 10, 129, 49, 12, 129, 49, 14, 129, +/* 1620 */ 49, 17, 129, 49, 19, 129, 49, 21, 129, 49, +/* 1630 */ 23, 129, 49, 14, 65, 9, 129, 49, 14, 67, +/* 1640 */ 9, 129, 49, 14, 69, 9, 129, 49, 14, 71, +/* 1650 */ 10, 129, 49, 14, 74, 9, 129, 49, 14, 76, +/* 1660 */ 9, 129, 49, 14, 78, 9, 129, 49, 14, 80, +/* 1670 */ 9, 129, 49, 14, 82, 9, 129, 49, 14, 84, +/* 1680 */ 9, 129, 30, 4, 49, 14, 86, 10, 129, 30, +/* 1690 */ 4, 49, 14, 89, 9, 129, 30, 4, 49, 14, +/* 1700 */ 91, 9, 129, 30, 4, 49, 14, 93, 9, 129, +/* 1710 */ 30, 74, 129, 30, 76, 129, 30, 78, 129, 30, +/* 1720 */ 81, 129, 30, 83, 129, 30, 85, 129, 30, 87, +/* 1730 */ 129, 30, 89, 129, 30, 91, 129, 30, 4, 49, +/* 1740 */ 14, 132, 193, 129, 37, 1, 129, 36, 3, 77, +/* 1750 */ 3, 129, 35, 5, 78, 11, 129, 34, 7, 78, +/* 1760 */ 21, 129, 33, 7, 79, 29, 129, 32, 7, 79, +/* 1770 */ 38, 129, 32, 6, 80, 4, 92, 29, 129, 31, +/* 1780 */ 6, 80, 5, 102, 19, 129, 31, 5, 80, 6, +/* 1790 */ 107, 14, 129, 31, 4, 81, 5, 107, 14, 129, +/* 1800 */ 30, 5, 81, 6, 107, 14, 129, 30, 4, 81, +/* 1810 */ 6, 107, 14, 130, 30, 4, 81, 7, 107, 14, +/* 1820 */ 129, 30, 4, 80, 8, 107, 14, 130, 30, 5, +/* 1830 */ 80, 8, 107, 14, 129, 30, 5, 79, 9, 107, +/* 1840 */ 14, 129, 31, 5, 79, 9, 107, 14, 129, 31, +/* 1850 */ 6, 78, 10, 107, 14, 129, 32, 6, 76, 11, +/* 1860 */ 107, 14, 129, 32, 8, 74, 13, 107, 14, 129, +/* 1870 */ 33, 10, 71, 16, 107, 14, 129, 33, 15, 67, +/* 1880 */ 19, 107, 14, 129, 34, 51, 107, 14, 129, 35, +/* 1890 */ 49, 107, 14, 129, 36, 47, 107, 14, 129, 37, +/* 1900 */ 45, 107, 14, 129, 39, 41, 107, 14, 129, 41, +/* 1910 */ 37, 107, 14, 129, 44, 32, 107, 14, 129, 47, +/* 1920 */ 25, 111, 10, 129, 51, 16, 115, 6, 129, 119, +/* 1930 */ 2, 129, 193, 129, 56, 39, 129, 51, 49, 129, +/* 1940 */ 47, 57, 129, 44, 63, 129, 42, 67, 129, 40, +/* 1950 */ 71, 129, 38, 75, 129, 37, 77, 129, 35, 81, +/* 1960 */ 129, 34, 16, 74, 5, 101, 16, 129, 33, 11, +/* 1970 */ 76, 5, 107, 11, 129, 32, 9, 77, 5, 110, +/* 1980 */ 9, 129, 32, 7, 79, 4, 112, 7, 129, 31, +/* 1990 */ 6, 80, 4, 114, 6, 129, 31, 5, 81, 4, +/* 2000 */ 115, 5, 129, 30, 5, 82, 4, 116, 5, 129, +/* 2010 */ 30, 4, 82, 4, 116, 5, 129, 30, 4, 82, +/* 2020 */ 5, 117, 4, 131, 30, 5, 82, 5, 117, 4, +/* 2030 */ 129, 31, 5, 81, 6, 117, 4, 129, 31, 6, +/* 2040 */ 80, 7, 117, 4, 129, 32, 7, 79, 8, 117, +/* 2050 */ 4, 129, 32, 9, 77, 9, 116, 5, 129, 33, +/* 2060 */ 11, 75, 11, 116, 4, 129, 34, 16, 69, 16, +/* 2070 */ 115, 5, 129, 35, 49, 114, 5, 129, 37, 46, +/* 2080 */ 113, 5, 129, 38, 44, 112, 6, 129, 40, 41, +/* 2090 */ 112, 5, 129, 42, 37, 113, 3, 129, 44, 33, +/* 2100 */ 114, 1, 129, 47, 27, 129, 51, 17, 129, 193, +/* 2110 */ 129, 103, 2, 129, 103, 6, 129, 104, 9, 129, +/* 2120 */ 105, 12, 129, 106, 15, 129, 107, 14, 135, 30, +/* 2130 */ 10, 107, 14, 129, 30, 17, 107, 14, 129, 30, +/* 2140 */ 25, 107, 14, 129, 30, 31, 107, 14, 129, 30, +/* 2150 */ 37, 107, 14, 129, 30, 42, 107, 14, 129, 30, +/* 2160 */ 46, 107, 14, 129, 30, 50, 107, 14, 129, 30, +/* 2170 */ 54, 107, 14, 129, 30, 58, 107, 14, 129, 59, +/* 2180 */ 32, 107, 14, 129, 64, 30, 107, 14, 129, 74, +/* 2190 */ 23, 107, 14, 129, 81, 18, 107, 14, 129, 86, +/* 2200 */ 16, 107, 14, 129, 91, 14, 107, 14, 129, 96, +/* 2210 */ 25, 129, 100, 21, 129, 104, 17, 129, 107, 14, +/* 2220 */ 129, 111, 10, 129, 114, 7, 129, 117, 4, 129, +/* 2230 */ 120, 1, 129, 193, 129, 48, 13, 129, 44, 21, +/* 2240 */ 129, 42, 26, 129, 40, 30, 92, 12, 129, 38, +/* 2250 */ 34, 88, 20, 129, 36, 37, 86, 25, 129, 35, +/* 2260 */ 39, 84, 29, 129, 34, 13, 63, 12, 82, 33, +/* 2270 */ 129, 33, 11, 67, 9, 80, 36, 129, 32, 9, +/* 2280 */ 70, 7, 79, 38, 129, 31, 8, 72, 46, 129, +/* 2290 */ 30, 7, 74, 22, 108, 11, 129, 30, 6, 75, +/* 2300 */ 19, 111, 9, 129, 30, 5, 75, 17, 113, 7, +/* 2310 */ 129, 30, 5, 74, 16, 114, 6, 129, 30, 4, +/* 2320 */ 73, 16, 115, 6, 129, 30, 4, 72, 16, 116, +/* 2330 */ 5, 129, 30, 4, 72, 15, 117, 4, 129, 30, +/* 2340 */ 4, 71, 16, 117, 4, 129, 30, 5, 70, 16, +/* 2350 */ 117, 4, 129, 30, 5, 70, 15, 117, 4, 129, +/* 2360 */ 30, 6, 69, 15, 116, 5, 129, 30, 7, 68, +/* 2370 */ 17, 115, 5, 129, 30, 9, 67, 19, 114, 6, +/* 2380 */ 129, 30, 10, 65, 22, 113, 6, 129, 31, 12, +/* 2390 */ 63, 27, 110, 9, 129, 32, 14, 60, 21, 84, +/* 2400 */ 9, 106, 12, 129, 33, 47, 85, 32, 129, 34, +/* 2410 */ 45, 86, 30, 129, 35, 43, 88, 26, 129, 36, +/* 2420 */ 40, 90, 22, 129, 38, 36, 93, 17, 129, 40, +/* 2430 */ 32, 96, 10, 129, 42, 28, 129, 44, 23, 129, +/* 2440 */ 48, 15, 129, 193, 129, 83, 17, 129, 77, 27, +/* 2450 */ 129, 36, 1, 74, 33, 129, 35, 3, 72, 37, +/* 2460 */ 129, 34, 5, 70, 41, 129, 33, 6, 69, 44, +/* 2470 */ 129, 33, 5, 68, 46, 129, 32, 5, 67, 49, +/* 2480 */ 129, 31, 5, 66, 17, 101, 16, 129, 31, 5, +/* 2490 */ 66, 11, 108, 10, 129, 30, 4, 65, 9, 110, +/* 2500 */ 9, 129, 30, 4, 64, 8, 112, 7, 129, 30, +/* 2510 */ 4, 64, 7, 114, 6, 129, 30, 4, 64, 6, +/* 2520 */ 115, 5, 129, 30, 4, 64, 5, 116, 5, 129, +/* 2530 */ 30, 4, 64, 5, 117, 4, 131, 30, 4, 65, +/* 2540 */ 4, 117, 4, 129, 30, 5, 65, 4, 116, 5, +/* 2550 */ 129, 31, 5, 66, 4, 115, 5, 129, 31, 6, +/* 2560 */ 67, 4, 114, 6, 129, 32, 7, 68, 4, 112, +/* 2570 */ 7, 129, 32, 9, 69, 5, 110, 9, 129, 33, +/* 2580 */ 11, 70, 5, 107, 11, 129, 34, 16, 72, 5, +/* 2590 */ 101, 16, 129, 35, 81, 129, 37, 77, 129, 38, +/* 2600 */ 75, 129, 40, 71, 129, 42, 67, 129, 44, 63, +/* 2610 */ 129, 47, 57, 129, 51, 49, 129, 56, 39, 129, +/* 2620 */ 193, 130, 34, 6, 74, 6, 129, 32, 10, 72, +/* 2630 */ 10, 129, 31, 12, 71, 12, 129, 30, 14, 70, +/* 2640 */ 14, 131, 31, 12, 71, 12, 129, 32, 10, 72, +/* 2650 */ 10, 129, 34, 6, 74, 6, 129, 194, 130, 34, +/* 2660 */ 6, 74, 6, 129, 32, 10, 72, 10, 129, 31, +/* 2670 */ 12, 71, 12, 129, 30, 14, 70, 14, 129, 20, +/* 2680 */ 2, 28, 16, 70, 14, 129, 22, 22, 70, 14, +/* 2690 */ 129, 24, 19, 71, 12, 129, 27, 15, 72, 10, +/* 2700 */ 129, 31, 9, 74, 6, 129, 194, 129, 53, 4, +/* 2710 */ 63, 4, 152, 193, 130, 99, 7, 129, 97, 13, +/* 2720 */ 129, 96, 16, 129, 96, 18, 129, 96, 19, 129, +/* 2730 */ 97, 19, 129, 99, 6, 110, 7, 129, 112, 6, +/* 2740 */ 129, 114, 5, 129, 34, 6, 57, 5, 115, 4, +/* 2750 */ 129, 32, 10, 54, 12, 116, 4, 129, 31, 12, +/* 2760 */ 53, 16, 117, 3, 129, 30, 14, 52, 20, 117, +/* 2770 */ 4, 129, 30, 14, 52, 23, 117, 4, 129, 30, +/* 2780 */ 14, 52, 25, 117, 4, 129, 31, 12, 52, 27, +/* 2790 */ 117, 4, 129, 32, 10, 53, 10, 70, 11, 116, +/* 2800 */ 5, 129, 34, 6, 55, 5, 73, 10, 115, 6, +/* 2810 */ 129, 74, 11, 114, 7, 129, 75, 12, 112, 9, +/* 2820 */ 129, 76, 13, 110, 10, 129, 77, 16, 106, 14, +/* 2830 */ 129, 78, 41, 129, 80, 38, 129, 81, 36, 129, +/* 2840 */ 82, 34, 129, 84, 30, 129, 86, 26, 129, 88, +/* 2850 */ 22, 129, 92, 14, 129, 194, 129, 55, 15, 129, +/* 2860 */ 50, 25, 129, 47, 32, 129, 45, 13, 70, 12, +/* 2870 */ 129, 43, 9, 76, 10, 129, 42, 6, 79, 8, +/* 2880 */ 129, 41, 5, 81, 7, 129, 40, 4, 84, 6, +/* 2890 */ 129, 39, 4, 59, 12, 85, 6, 129, 38, 4, +/* 2900 */ 55, 19, 87, 5, 129, 37, 4, 53, 23, 88, +/* 2910 */ 4, 129, 36, 4, 51, 8, 71, 6, 89, 4, +/* 2920 */ 129, 36, 4, 51, 6, 73, 4, 89, 4, 129, +/* 2930 */ 36, 4, 50, 6, 74, 4, 90, 3, 129, 35, +/* 2940 */ 4, 50, 5, 75, 3, 90, 4, 129, 35, 4, +/* 2950 */ 50, 4, 75, 4, 90, 4, 131, 35, 4, 50, +/* 2960 */ 5, 75, 4, 90, 4, 129, 36, 4, 51, 5, +/* 2970 */ 75, 4, 90, 4, 129, 36, 4, 51, 6, 75, +/* 2980 */ 4, 90, 4, 129, 36, 4, 53, 26, 90, 4, +/* 2990 */ 129, 37, 4, 54, 25, 90, 4, 129, 37, 4, +/* 3000 */ 52, 27, 90, 3, 129, 38, 4, 52, 4, 89, +/* 3010 */ 4, 129, 39, 4, 51, 4, 88, 4, 129, 40, +/* 3020 */ 4, 50, 4, 87, 5, 129, 41, 4, 50, 4, +/* 3030 */ 86, 5, 129, 42, 4, 50, 4, 85, 5, 129, +/* 3040 */ 43, 3, 50, 4, 83, 6, 129, 44, 2, 51, +/* 3050 */ 5, 80, 7, 129, 46, 1, 52, 6, 76, 9, +/* 3060 */ 129, 54, 28, 129, 56, 23, 129, 60, 16, 129, +/* 3070 */ 193, 129, 30, 4, 132, 30, 5, 129, 30, 8, +/* 3080 */ 129, 30, 12, 129, 30, 16, 129, 30, 4, 37, +/* 3090 */ 12, 129, 30, 4, 41, 12, 129, 30, 4, 44, +/* 3100 */ 13, 129, 30, 4, 48, 13, 129, 52, 13, 129, +/* 3110 */ 56, 12, 129, 58, 14, 129, 58, 4, 64, 12, +/* 3120 */ 129, 58, 4, 68, 12, 129, 58, 4, 72, 12, +/* 3130 */ 129, 58, 4, 75, 13, 129, 58, 4, 79, 13, +/* 3140 */ 129, 58, 4, 83, 13, 129, 58, 4, 87, 13, +/* 3150 */ 129, 58, 4, 91, 12, 129, 58, 4, 95, 12, +/* 3160 */ 129, 58, 4, 96, 15, 129, 58, 4, 93, 22, +/* 3170 */ 129, 58, 4, 89, 30, 129, 58, 4, 85, 36, +/* 3180 */ 129, 58, 4, 81, 38, 129, 58, 4, 77, 38, +/* 3190 */ 129, 58, 4, 73, 38, 129, 58, 4, 70, 37, +/* 3200 */ 129, 58, 4, 66, 37, 129, 58, 41, 129, 58, +/* 3210 */ 37, 129, 54, 38, 129, 30, 4, 50, 38, 129, +/* 3220 */ 30, 4, 46, 38, 129, 30, 4, 42, 38, 129, +/* 3230 */ 30, 4, 38, 39, 129, 30, 43, 129, 30, 39, +/* 3240 */ 129, 30, 35, 129, 30, 31, 129, 30, 27, 129, +/* 3250 */ 30, 24, 129, 30, 20, 129, 30, 16, 129, 30, +/* 3260 */ 12, 129, 30, 8, 129, 30, 5, 129, 30, 4, +/* 3270 */ 132, 193, 129, 30, 4, 117, 4, 132, 30, 91, +/* 3280 */ 137, 30, 4, 80, 4, 117, 4, 138, 30, 4, +/* 3290 */ 80, 5, 116, 5, 129, 30, 5, 79, 6, 116, +/* 3300 */ 5, 130, 30, 6, 78, 8, 115, 6, 129, 31, +/* 3310 */ 6, 77, 9, 115, 6, 129, 31, 7, 76, 11, +/* 3320 */ 114, 6, 129, 31, 8, 75, 14, 112, 8, 129, +/* 3330 */ 32, 8, 74, 16, 111, 9, 129, 32, 9, 73, +/* 3340 */ 19, 109, 10, 129, 33, 10, 71, 24, 106, 13, +/* 3350 */ 129, 33, 13, 68, 12, 83, 35, 129, 34, 16, +/* 3360 */ 64, 15, 84, 33, 129, 35, 43, 85, 31, 129, +/* 3370 */ 36, 41, 86, 29, 129, 37, 39, 88, 25, 129, +/* 3380 */ 38, 37, 90, 21, 129, 40, 33, 93, 15, 129, +/* 3390 */ 42, 29, 96, 9, 129, 45, 24, 129, 49, 16, +/* 3400 */ 129, 193, 129, 63, 25, 129, 57, 37, 129, 53, +/* 3410 */ 45, 129, 50, 51, 129, 47, 57, 129, 45, 61, +/* 3420 */ 129, 43, 65, 129, 41, 69, 129, 39, 73, 129, +/* 3430 */ 38, 25, 92, 21, 129, 36, 21, 97, 18, 129, +/* 3440 */ 35, 18, 102, 14, 129, 34, 16, 106, 11, 129, +/* 3450 */ 33, 14, 108, 10, 129, 32, 12, 111, 8, 129, +/* 3460 */ 32, 10, 113, 6, 129, 31, 10, 114, 6, 129, +/* 3470 */ 31, 8, 115, 5, 129, 30, 8, 116, 5, 129, +/* 3480 */ 30, 7, 116, 5, 129, 30, 6, 117, 4, 130, +/* 3490 */ 30, 5, 117, 4, 131, 31, 4, 116, 5, 129, +/* 3500 */ 32, 4, 116, 4, 129, 32, 5, 115, 5, 129, +/* 3510 */ 33, 4, 114, 5, 129, 34, 4, 112, 6, 129, +/* 3520 */ 35, 4, 110, 7, 129, 37, 4, 107, 9, 129, +/* 3530 */ 39, 4, 103, 12, 129, 41, 4, 103, 18, 129, +/* 3540 */ 43, 4, 103, 18, 129, 45, 5, 103, 18, 129, +/* 3550 */ 48, 5, 103, 18, 129, 51, 1, 129, 193, 129, +/* 3560 */ 30, 4, 117, 4, 132, 30, 91, 137, 30, 4, +/* 3570 */ 117, 4, 135, 30, 5, 116, 5, 130, 30, 6, +/* 3580 */ 115, 6, 130, 31, 6, 114, 6, 129, 31, 7, +/* 3590 */ 113, 7, 129, 32, 7, 112, 7, 129, 32, 8, +/* 3600 */ 111, 8, 129, 33, 9, 109, 9, 129, 33, 12, +/* 3610 */ 106, 12, 129, 34, 13, 104, 13, 129, 35, 15, +/* 3620 */ 101, 15, 129, 36, 19, 96, 19, 129, 37, 24, +/* 3630 */ 90, 24, 129, 39, 73, 129, 40, 71, 129, 42, +/* 3640 */ 67, 129, 44, 63, 129, 46, 59, 129, 49, 53, +/* 3650 */ 129, 52, 47, 129, 56, 39, 129, 61, 29, 129, +/* 3660 */ 193, 129, 30, 4, 117, 4, 132, 30, 91, 137, +/* 3670 */ 30, 4, 80, 4, 117, 4, 140, 30, 4, 79, +/* 3680 */ 6, 117, 4, 129, 30, 4, 77, 10, 117, 4, +/* 3690 */ 129, 30, 4, 73, 18, 117, 4, 132, 30, 4, +/* 3700 */ 117, 4, 130, 30, 5, 116, 5, 130, 30, 7, +/* 3710 */ 114, 7, 129, 30, 8, 113, 8, 129, 30, 11, +/* 3720 */ 110, 11, 129, 30, 18, 103, 18, 132, 193, 129, +/* 3730 */ 30, 4, 117, 4, 132, 30, 91, 137, 30, 4, +/* 3740 */ 80, 4, 117, 4, 132, 80, 4, 117, 4, 136, +/* 3750 */ 79, 6, 117, 4, 129, 77, 10, 117, 4, 129, +/* 3760 */ 73, 18, 117, 4, 132, 117, 4, 130, 116, 5, +/* 3770 */ 130, 114, 7, 129, 113, 8, 129, 110, 11, 129, +/* 3780 */ 103, 18, 132, 193, 129, 63, 25, 129, 57, 37, +/* 3790 */ 129, 53, 45, 129, 50, 51, 129, 47, 57, 129, +/* 3800 */ 45, 61, 129, 43, 65, 129, 41, 69, 129, 39, +/* 3810 */ 73, 129, 38, 25, 92, 21, 129, 36, 21, 97, +/* 3820 */ 18, 129, 35, 18, 102, 14, 129, 34, 16, 106, +/* 3830 */ 11, 129, 33, 14, 108, 10, 129, 32, 12, 111, +/* 3840 */ 8, 129, 32, 10, 113, 6, 129, 31, 10, 114, +/* 3850 */ 6, 129, 31, 8, 115, 5, 129, 30, 8, 116, +/* 3860 */ 5, 129, 30, 7, 116, 5, 129, 30, 6, 117, +/* 3870 */ 4, 130, 30, 5, 117, 4, 131, 30, 5, 75, +/* 3880 */ 4, 116, 5, 129, 31, 5, 75, 4, 116, 4, +/* 3890 */ 129, 31, 6, 75, 4, 115, 5, 129, 32, 7, +/* 3900 */ 75, 4, 114, 5, 129, 32, 9, 75, 4, 112, +/* 3910 */ 6, 129, 33, 11, 75, 4, 110, 7, 129, 34, +/* 3920 */ 15, 75, 4, 107, 9, 129, 35, 44, 103, 12, +/* 3930 */ 129, 36, 43, 103, 18, 129, 38, 41, 103, 18, +/* 3940 */ 129, 39, 40, 103, 18, 129, 41, 38, 103, 18, +/* 3950 */ 129, 44, 35, 129, 48, 31, 129, 52, 27, 129, +/* 3960 */ 61, 18, 129, 193, 129, 30, 4, 117, 4, 132, +/* 3970 */ 30, 91, 137, 30, 4, 80, 4, 117, 4, 132, +/* 3980 */ 80, 4, 140, 30, 4, 80, 4, 117, 4, 132, +/* 3990 */ 30, 91, 137, 30, 4, 117, 4, 132, 193, 129, +/* 4000 */ 30, 4, 117, 4, 132, 30, 91, 137, 30, 4, +/* 4010 */ 117, 4, 132, 193, 129, 44, 7, 129, 40, 13, +/* 4020 */ 129, 37, 17, 129, 35, 20, 129, 34, 22, 129, +/* 4030 */ 33, 23, 129, 32, 24, 129, 32, 23, 129, 31, +/* 4040 */ 6, 41, 13, 129, 31, 5, 42, 11, 129, 30, +/* 4050 */ 5, 44, 7, 129, 30, 4, 132, 30, 5, 130, +/* 4060 */ 31, 5, 129, 31, 6, 117, 4, 129, 31, 8, +/* 4070 */ 117, 4, 129, 32, 9, 117, 4, 129, 33, 11, +/* 4080 */ 117, 4, 129, 34, 87, 129, 35, 86, 129, 36, +/* 4090 */ 85, 129, 37, 84, 129, 38, 83, 129, 40, 81, +/* 4100 */ 129, 42, 79, 129, 45, 76, 129, 50, 71, 129, +/* 4110 */ 117, 4, 132, 193, 129, 30, 4, 117, 4, 132, +/* 4120 */ 30, 91, 137, 30, 4, 76, 8, 117, 4, 129, +/* 4130 */ 30, 4, 73, 13, 117, 4, 129, 30, 4, 70, +/* 4140 */ 18, 117, 4, 129, 30, 4, 67, 23, 117, 4, +/* 4150 */ 129, 65, 26, 129, 62, 31, 129, 59, 35, 129, +/* 4160 */ 56, 29, 89, 7, 129, 53, 29, 91, 7, 129, +/* 4170 */ 50, 29, 93, 7, 129, 47, 29, 95, 6, 129, +/* 4180 */ 30, 4, 45, 29, 96, 7, 129, 30, 4, 42, +/* 4190 */ 29, 98, 7, 129, 30, 4, 39, 30, 100, 6, +/* 4200 */ 129, 30, 4, 36, 30, 101, 7, 129, 30, 33, +/* 4210 */ 103, 7, 117, 4, 129, 30, 30, 105, 6, 117, +/* 4220 */ 4, 129, 30, 27, 106, 7, 117, 4, 129, 30, +/* 4230 */ 25, 108, 7, 117, 4, 129, 30, 22, 110, 11, +/* 4240 */ 129, 30, 19, 111, 10, 129, 30, 16, 113, 8, +/* 4250 */ 129, 30, 13, 115, 6, 129, 30, 11, 116, 5, +/* 4260 */ 129, 30, 8, 117, 4, 129, 30, 5, 117, 4, +/* 4270 */ 129, 30, 4, 117, 4, 130, 30, 4, 130, 193, +/* 4280 */ 129, 30, 4, 117, 4, 132, 30, 91, 137, 30, +/* 4290 */ 4, 117, 4, 132, 30, 4, 144, 30, 5, 130, +/* 4300 */ 30, 7, 129, 30, 8, 129, 30, 11, 129, 30, +/* 4310 */ 18, 132, 193, 129, 30, 4, 117, 4, 132, 30, +/* 4320 */ 91, 132, 30, 4, 103, 18, 129, 30, 4, 97, +/* 4330 */ 24, 129, 30, 4, 92, 29, 129, 30, 4, 87, +/* 4340 */ 34, 129, 81, 40, 129, 76, 45, 129, 70, 49, +/* 4350 */ 129, 65, 49, 129, 60, 49, 129, 55, 49, 129, +/* 4360 */ 50, 48, 129, 44, 49, 129, 39, 48, 129, 33, +/* 4370 */ 49, 129, 30, 47, 129, 34, 37, 129, 40, 26, +/* 4380 */ 129, 46, 19, 129, 52, 19, 129, 58, 19, 129, +/* 4390 */ 64, 19, 129, 70, 19, 129, 76, 19, 129, 82, +/* 4400 */ 19, 129, 30, 4, 88, 18, 129, 30, 4, 94, +/* 4410 */ 18, 129, 30, 4, 100, 18, 129, 30, 4, 106, +/* 4420 */ 15, 129, 30, 91, 137, 30, 4, 117, 4, 132, +/* 4430 */ 193, 129, 30, 4, 117, 4, 132, 30, 91, 132, +/* 4440 */ 30, 4, 107, 14, 129, 30, 4, 104, 17, 129, +/* 4450 */ 30, 4, 101, 20, 129, 30, 4, 99, 22, 129, +/* 4460 */ 96, 25, 129, 93, 28, 129, 91, 28, 129, 88, +/* 4470 */ 29, 129, 85, 29, 129, 82, 29, 129, 79, 29, +/* 4480 */ 129, 76, 29, 129, 74, 29, 129, 71, 29, 129, +/* 4490 */ 68, 29, 129, 65, 29, 129, 62, 29, 129, 60, +/* 4500 */ 29, 129, 57, 29, 129, 54, 29, 129, 51, 29, +/* 4510 */ 129, 49, 28, 129, 46, 29, 129, 43, 29, 129, +/* 4520 */ 40, 29, 117, 4, 129, 37, 29, 117, 4, 129, +/* 4530 */ 35, 29, 117, 4, 129, 32, 29, 117, 4, 129, +/* 4540 */ 30, 91, 132, 117, 4, 132, 193, 129, 63, 25, +/* 4550 */ 129, 57, 37, 129, 53, 45, 129, 50, 51, 129, +/* 4560 */ 47, 57, 129, 45, 61, 129, 43, 65, 129, 41, +/* 4570 */ 69, 129, 39, 73, 129, 38, 21, 92, 21, 129, +/* 4580 */ 36, 18, 97, 18, 129, 35, 14, 102, 14, 129, +/* 4590 */ 34, 11, 106, 11, 129, 33, 10, 108, 10, 129, +/* 4600 */ 32, 8, 111, 8, 129, 32, 6, 113, 6, 129, +/* 4610 */ 31, 6, 114, 6, 129, 31, 5, 115, 5, 129, +/* 4620 */ 30, 5, 116, 5, 130, 30, 4, 117, 4, 132, +/* 4630 */ 30, 5, 116, 5, 130, 31, 5, 115, 5, 129, +/* 4640 */ 31, 6, 114, 6, 129, 32, 6, 113, 6, 129, +/* 4650 */ 32, 8, 111, 8, 129, 33, 10, 108, 10, 129, +/* 4660 */ 34, 11, 106, 11, 129, 35, 14, 102, 14, 129, +/* 4670 */ 36, 18, 97, 18, 129, 38, 21, 92, 21, 129, +/* 4680 */ 39, 73, 129, 41, 69, 129, 43, 65, 129, 45, +/* 4690 */ 61, 129, 47, 57, 129, 50, 51, 129, 53, 45, +/* 4700 */ 129, 57, 37, 129, 63, 25, 129, 193, 129, 30, +/* 4710 */ 4, 117, 4, 132, 30, 91, 137, 30, 4, 80, +/* 4720 */ 4, 117, 4, 132, 80, 4, 117, 4, 134, 80, +/* 4730 */ 5, 116, 5, 131, 80, 6, 115, 6, 130, 81, +/* 4740 */ 6, 114, 6, 129, 81, 8, 112, 8, 129, 81, +/* 4750 */ 9, 111, 9, 129, 82, 10, 109, 10, 129, 82, +/* 4760 */ 13, 106, 13, 129, 83, 35, 129, 84, 33, 129, +/* 4770 */ 85, 31, 129, 86, 29, 129, 88, 25, 129, 90, +/* 4780 */ 21, 129, 93, 15, 129, 96, 9, 129, 193, 129, +/* 4790 */ 63, 25, 129, 57, 37, 129, 53, 45, 129, 50, +/* 4800 */ 51, 129, 47, 57, 129, 45, 61, 129, 43, 65, +/* 4810 */ 129, 41, 69, 129, 39, 73, 129, 38, 21, 92, +/* 4820 */ 21, 129, 36, 18, 97, 18, 129, 35, 14, 102, +/* 4830 */ 14, 129, 34, 11, 106, 11, 129, 33, 10, 108, +/* 4840 */ 10, 129, 32, 8, 111, 8, 129, 32, 6, 113, +/* 4850 */ 6, 129, 31, 6, 114, 6, 129, 31, 5, 115, +/* 4860 */ 5, 129, 30, 5, 116, 5, 130, 30, 4, 39, +/* 4870 */ 2, 117, 4, 129, 30, 4, 40, 4, 117, 4, +/* 4880 */ 129, 30, 4, 41, 5, 117, 4, 129, 30, 4, +/* 4890 */ 41, 6, 117, 4, 129, 30, 5, 40, 8, 116, +/* 4900 */ 5, 129, 30, 5, 39, 10, 116, 5, 129, 31, +/* 4910 */ 5, 38, 11, 115, 5, 129, 31, 18, 114, 6, +/* 4920 */ 129, 32, 17, 113, 6, 129, 32, 16, 111, 8, +/* 4930 */ 129, 33, 15, 108, 10, 129, 33, 14, 106, 11, +/* 4940 */ 129, 32, 17, 102, 14, 129, 31, 23, 97, 18, +/* 4950 */ 129, 31, 28, 92, 21, 129, 30, 82, 129, 30, +/* 4960 */ 80, 129, 30, 11, 43, 65, 129, 30, 10, 45, +/* 4970 */ 61, 129, 31, 8, 47, 57, 129, 32, 6, 50, +/* 4980 */ 51, 129, 33, 5, 53, 45, 129, 35, 4, 57, +/* 4990 */ 37, 129, 38, 2, 63, 25, 129, 193, 129, 30, +/* 5000 */ 4, 117, 4, 132, 30, 91, 137, 30, 4, 76, +/* 5010 */ 8, 117, 4, 129, 30, 4, 73, 11, 117, 4, +/* 5020 */ 129, 30, 4, 70, 14, 117, 4, 129, 30, 4, +/* 5030 */ 67, 17, 117, 4, 129, 65, 19, 117, 4, 129, +/* 5040 */ 62, 22, 117, 4, 129, 59, 25, 117, 4, 129, +/* 5050 */ 56, 28, 117, 4, 129, 53, 31, 117, 4, 129, +/* 5060 */ 50, 34, 117, 4, 129, 47, 29, 80, 5, 116, +/* 5070 */ 5, 129, 30, 4, 45, 29, 80, 5, 116, 5, +/* 5080 */ 129, 30, 4, 42, 29, 80, 5, 116, 5, 129, +/* 5090 */ 30, 4, 39, 30, 80, 6, 115, 6, 129, 30, +/* 5100 */ 4, 36, 30, 80, 6, 115, 6, 129, 30, 33, +/* 5110 */ 81, 6, 114, 6, 129, 30, 30, 81, 8, 112, +/* 5120 */ 8, 129, 30, 27, 81, 9, 111, 9, 129, 30, +/* 5130 */ 25, 82, 10, 109, 10, 129, 30, 22, 82, 13, +/* 5140 */ 106, 13, 129, 30, 19, 83, 35, 129, 30, 16, +/* 5150 */ 84, 33, 129, 30, 13, 85, 31, 129, 30, 11, +/* 5160 */ 86, 29, 129, 30, 8, 88, 25, 129, 30, 5, +/* 5170 */ 90, 21, 129, 30, 4, 93, 15, 129, 30, 4, +/* 5180 */ 96, 9, 129, 30, 4, 130, 193, 129, 30, 18, +/* 5190 */ 130, 30, 18, 89, 15, 129, 30, 18, 85, 23, +/* 5200 */ 129, 34, 11, 83, 27, 129, 34, 9, 81, 31, +/* 5210 */ 129, 33, 8, 79, 35, 129, 33, 6, 78, 16, +/* 5220 */ 106, 9, 129, 32, 6, 77, 15, 109, 7, 129, +/* 5230 */ 32, 5, 76, 14, 111, 6, 129, 31, 5, 75, +/* 5240 */ 14, 113, 5, 129, 31, 4, 74, 15, 114, 5, +/* 5250 */ 129, 31, 4, 74, 14, 115, 4, 129, 30, 4, +/* 5260 */ 73, 15, 116, 4, 129, 30, 4, 73, 14, 116, +/* 5270 */ 4, 129, 30, 4, 73, 14, 117, 4, 129, 30, +/* 5280 */ 4, 72, 15, 117, 4, 130, 30, 4, 71, 15, +/* 5290 */ 117, 4, 130, 30, 4, 70, 15, 117, 4, 129, +/* 5300 */ 30, 5, 70, 15, 117, 4, 129, 30, 5, 69, +/* 5310 */ 15, 116, 5, 129, 30, 6, 68, 16, 115, 5, +/* 5320 */ 129, 31, 6, 67, 16, 114, 6, 129, 31, 7, +/* 5330 */ 66, 17, 113, 6, 129, 32, 7, 64, 18, 111, +/* 5340 */ 8, 129, 32, 8, 62, 19, 109, 9, 129, 33, +/* 5350 */ 9, 60, 20, 107, 10, 129, 34, 11, 57, 22, +/* 5360 */ 103, 13, 129, 35, 43, 103, 18, 129, 36, 41, +/* 5370 */ 103, 18, 129, 38, 38, 103, 18, 129, 39, 35, +/* 5380 */ 103, 18, 129, 41, 31, 129, 43, 27, 129, 46, +/* 5390 */ 22, 129, 49, 14, 129, 193, 129, 103, 18, 132, +/* 5400 */ 110, 11, 129, 113, 8, 129, 114, 7, 129, 116, +/* 5410 */ 5, 130, 117, 4, 132, 30, 4, 117, 4, 132, +/* 5420 */ 30, 91, 137, 30, 4, 117, 4, 132, 117, 4, +/* 5430 */ 132, 116, 5, 130, 114, 7, 129, 113, 8, 129, +/* 5440 */ 110, 11, 129, 103, 18, 132, 193, 129, 117, 4, +/* 5450 */ 132, 56, 65, 129, 50, 71, 129, 46, 75, 129, +/* 5460 */ 44, 77, 129, 42, 79, 129, 40, 81, 129, 38, +/* 5470 */ 83, 129, 36, 85, 129, 35, 86, 129, 34, 20, +/* 5480 */ 117, 4, 129, 33, 17, 117, 4, 129, 32, 15, +/* 5490 */ 117, 4, 129, 32, 13, 117, 4, 129, 31, 12, +/* 5500 */ 129, 31, 10, 129, 31, 9, 129, 30, 9, 129, +/* 5510 */ 30, 8, 130, 30, 7, 132, 31, 6, 130, 31, +/* 5520 */ 7, 129, 32, 6, 129, 32, 7, 129, 33, 7, +/* 5530 */ 129, 34, 7, 129, 35, 8, 129, 36, 9, 117, +/* 5540 */ 4, 129, 38, 9, 117, 4, 129, 40, 10, 117, +/* 5550 */ 4, 129, 42, 12, 117, 4, 129, 44, 77, 129, +/* 5560 */ 46, 75, 129, 50, 71, 129, 56, 43, 100, 21, +/* 5570 */ 129, 117, 4, 132, 193, 129, 117, 4, 132, 115, +/* 5580 */ 6, 129, 110, 11, 129, 105, 16, 129, 101, 20, +/* 5590 */ 129, 96, 25, 129, 92, 29, 129, 87, 34, 129, +/* 5600 */ 83, 38, 129, 78, 43, 129, 74, 47, 129, 70, +/* 5610 */ 42, 117, 4, 129, 65, 42, 117, 4, 129, 60, +/* 5620 */ 43, 117, 4, 129, 56, 42, 129, 51, 42, 129, +/* 5630 */ 46, 43, 129, 42, 43, 129, 37, 44, 129, 33, +/* 5640 */ 43, 129, 30, 42, 129, 33, 34, 129, 38, 25, +/* 5650 */ 129, 42, 16, 129, 47, 15, 129, 52, 15, 129, +/* 5660 */ 57, 15, 129, 61, 16, 129, 66, 16, 129, 71, +/* 5670 */ 16, 129, 76, 16, 129, 80, 16, 129, 85, 16, +/* 5680 */ 117, 4, 129, 90, 16, 117, 4, 129, 95, 16, +/* 5690 */ 117, 4, 129, 100, 21, 129, 105, 16, 129, 110, +/* 5700 */ 11, 129, 114, 7, 129, 117, 4, 132, 193, 129, +/* 5710 */ 117, 4, 132, 115, 6, 129, 110, 11, 129, 105, +/* 5720 */ 16, 129, 101, 20, 129, 96, 25, 129, 92, 29, +/* 5730 */ 129, 87, 34, 129, 83, 38, 129, 78, 43, 129, +/* 5740 */ 74, 47, 129, 70, 42, 117, 4, 129, 65, 42, +/* 5750 */ 117, 4, 129, 60, 43, 117, 4, 129, 56, 42, +/* 5760 */ 129, 51, 42, 129, 46, 43, 129, 42, 43, 129, +/* 5770 */ 37, 44, 129, 33, 43, 129, 30, 42, 129, 33, +/* 5780 */ 34, 129, 38, 25, 129, 42, 16, 129, 47, 15, +/* 5790 */ 129, 52, 15, 129, 57, 15, 129, 61, 16, 129, +/* 5800 */ 65, 17, 129, 60, 27, 129, 56, 36, 129, 51, +/* 5810 */ 42, 129, 46, 43, 129, 42, 43, 129, 37, 44, +/* 5820 */ 129, 33, 43, 129, 30, 42, 129, 33, 34, 129, +/* 5830 */ 38, 25, 129, 42, 16, 129, 47, 15, 129, 52, +/* 5840 */ 15, 129, 57, 15, 129, 61, 16, 129, 66, 16, +/* 5850 */ 129, 71, 16, 129, 76, 16, 129, 80, 16, 129, +/* 5860 */ 85, 16, 117, 4, 129, 90, 16, 117, 4, 129, +/* 5870 */ 95, 16, 117, 4, 129, 100, 21, 129, 105, 16, +/* 5880 */ 129, 110, 11, 129, 114, 7, 129, 117, 4, 132, +/* 5890 */ 193, 129, 30, 4, 117, 4, 132, 30, 4, 115, +/* 5900 */ 6, 129, 30, 4, 112, 9, 129, 30, 6, 109, +/* 5910 */ 12, 129, 30, 9, 106, 15, 129, 30, 11, 103, +/* 5920 */ 18, 129, 30, 14, 100, 21, 129, 30, 4, 38, +/* 5930 */ 9, 98, 23, 129, 30, 4, 40, 10, 95, 26, +/* 5940 */ 129, 30, 4, 43, 9, 92, 29, 129, 46, 9, +/* 5950 */ 89, 32, 129, 49, 8, 86, 28, 117, 4, 129, +/* 5960 */ 51, 9, 83, 28, 117, 4, 129, 54, 9, 80, +/* 5970 */ 28, 117, 4, 129, 57, 8, 77, 28, 117, 4, +/* 5980 */ 129, 59, 9, 74, 28, 129, 62, 37, 129, 64, +/* 5990 */ 33, 129, 66, 28, 129, 63, 28, 129, 60, 28, +/* 6000 */ 129, 57, 28, 129, 54, 33, 129, 51, 39, 129, +/* 6010 */ 48, 29, 83, 9, 129, 30, 4, 45, 29, 86, +/* 6020 */ 9, 129, 30, 4, 42, 29, 89, 9, 129, 30, +/* 6030 */ 4, 39, 29, 92, 8, 129, 30, 4, 36, 29, +/* 6040 */ 94, 9, 129, 30, 32, 97, 9, 129, 30, 29, +/* 6050 */ 100, 8, 117, 4, 129, 30, 26, 103, 8, 117, +/* 6060 */ 4, 129, 30, 23, 105, 9, 117, 4, 129, 30, +/* 6070 */ 20, 108, 13, 129, 30, 18, 111, 10, 129, 30, +/* 6080 */ 15, 113, 8, 129, 30, 12, 116, 5, 129, 30, +/* 6090 */ 9, 117, 4, 129, 30, 6, 117, 4, 129, 30, +/* 6100 */ 4, 117, 4, 132, 193, 129, 117, 4, 132, 114, +/* 6110 */ 7, 129, 111, 10, 129, 108, 13, 129, 105, 16, +/* 6120 */ 129, 102, 19, 129, 100, 21, 129, 96, 25, 129, +/* 6130 */ 93, 28, 129, 90, 31, 129, 87, 34, 129, 84, +/* 6140 */ 30, 117, 4, 129, 30, 4, 81, 30, 117, 4, +/* 6150 */ 129, 30, 4, 78, 30, 117, 4, 129, 30, 4, +/* 6160 */ 75, 30, 117, 4, 129, 30, 4, 72, 30, 129, +/* 6170 */ 30, 69, 129, 30, 66, 129, 30, 63, 129, 30, +/* 6180 */ 60, 129, 30, 57, 129, 30, 54, 129, 30, 51, +/* 6190 */ 129, 30, 48, 129, 30, 51, 129, 30, 4, 73, +/* 6200 */ 12, 129, 30, 4, 76, 12, 129, 30, 4, 80, +/* 6210 */ 12, 129, 30, 4, 83, 12, 129, 87, 12, 129, +/* 6220 */ 90, 12, 117, 4, 129, 94, 11, 117, 4, 129, +/* 6230 */ 97, 12, 117, 4, 129, 101, 12, 117, 4, 129, +/* 6240 */ 104, 17, 129, 108, 13, 129, 111, 10, 129, 115, +/* 6250 */ 6, 129, 117, 4, 134, 193, 129, 30, 1, 103, +/* 6260 */ 18, 129, 30, 4, 103, 18, 129, 30, 7, 103, +/* 6270 */ 18, 129, 30, 9, 103, 18, 129, 30, 12, 110, +/* 6280 */ 11, 129, 30, 15, 113, 8, 129, 30, 18, 114, +/* 6290 */ 7, 129, 30, 21, 116, 5, 129, 30, 24, 116, +/* 6300 */ 5, 129, 30, 27, 117, 4, 129, 30, 30, 117, +/* 6310 */ 4, 129, 30, 33, 117, 4, 129, 30, 4, 37, +/* 6320 */ 28, 117, 4, 129, 30, 4, 40, 28, 117, 4, +/* 6330 */ 129, 30, 4, 42, 29, 117, 4, 129, 30, 4, +/* 6340 */ 45, 29, 117, 4, 129, 30, 4, 48, 29, 117, +/* 6350 */ 4, 129, 30, 4, 51, 29, 117, 4, 129, 30, +/* 6360 */ 4, 54, 29, 117, 4, 129, 30, 4, 57, 29, +/* 6370 */ 117, 4, 129, 30, 4, 59, 30, 117, 4, 129, +/* 6380 */ 30, 4, 62, 30, 117, 4, 129, 30, 4, 65, +/* 6390 */ 30, 117, 4, 129, 30, 4, 68, 30, 117, 4, +/* 6400 */ 129, 30, 4, 71, 30, 117, 4, 129, 30, 4, +/* 6410 */ 74, 30, 117, 4, 129, 30, 4, 77, 30, 117, +/* 6420 */ 4, 129, 30, 4, 80, 30, 117, 4, 129, 30, +/* 6430 */ 4, 83, 30, 117, 4, 129, 30, 4, 86, 35, +/* 6440 */ 129, 30, 4, 89, 32, 129, 30, 4, 91, 30, +/* 6450 */ 129, 30, 4, 94, 27, 129, 30, 5, 97, 24, +/* 6460 */ 129, 30, 5, 100, 21, 129, 30, 7, 103, 18, +/* 6470 */ 129, 30, 8, 106, 15, 129, 30, 11, 109, 12, +/* 6480 */ 129, 30, 18, 112, 9, 129, 30, 18, 115, 6, +/* 6490 */ 129, 30, 18, 117, 4, 129, 30, 18, 120, 1, +/* 6500 */ 129, 193, 129, 42, 8, 129, 38, 16, 129, 36, +/* 6510 */ 20, 129, 34, 24, 71, 5, 129, 33, 26, 69, +/* 6520 */ 10, 129, 32, 28, 68, 13, 129, 31, 30, 68, +/* 6530 */ 14, 129, 31, 9, 52, 9, 68, 15, 129, 30, +/* 6540 */ 8, 54, 8, 69, 14, 129, 30, 7, 55, 7, +/* 6550 */ 71, 4, 78, 6, 129, 30, 6, 56, 6, 79, +/* 6560 */ 5, 129, 30, 6, 56, 6, 80, 4, 130, 31, +/* 6570 */ 5, 56, 5, 80, 4, 129, 31, 5, 56, 5, +/* 6580 */ 79, 5, 129, 32, 5, 55, 5, 78, 6, 129, +/* 6590 */ 33, 5, 54, 5, 77, 7, 129, 34, 6, 52, +/* 6600 */ 6, 74, 9, 129, 35, 48, 129, 33, 49, 129, +/* 6610 */ 32, 49, 129, 31, 49, 129, 30, 49, 129, 30, +/* 6620 */ 47, 129, 30, 45, 129, 30, 41, 129, 30, 6, +/* 6630 */ 129, 30, 4, 129, 30, 3, 129, 30, 2, 129, +/* 6640 */ 193, 129, 30, 4, 117, 4, 130, 31, 90, 136, +/* 6650 */ 37, 5, 72, 5, 129, 35, 5, 74, 5, 129, +/* 6660 */ 33, 5, 76, 5, 129, 32, 5, 77, 5, 129, +/* 6670 */ 31, 5, 78, 5, 129, 31, 4, 79, 4, 129, +/* 6680 */ 30, 5, 79, 5, 131, 30, 6, 78, 6, 129, +/* 6690 */ 30, 7, 77, 7, 129, 31, 8, 75, 8, 129, +/* 6700 */ 31, 11, 72, 11, 129, 32, 15, 67, 15, 129, +/* 6710 */ 33, 48, 129, 34, 46, 129, 35, 44, 129, 37, +/* 6720 */ 40, 129, 39, 36, 129, 42, 30, 129, 46, 22, +/* 6730 */ 129, 193, 129, 48, 18, 129, 43, 28, 129, 41, +/* 6740 */ 32, 129, 39, 36, 129, 37, 40, 129, 35, 44, +/* 6750 */ 129, 34, 46, 129, 33, 13, 68, 13, 129, 32, +/* 6760 */ 9, 73, 9, 129, 32, 7, 75, 7, 129, 31, +/* 6770 */ 6, 77, 6, 129, 31, 5, 78, 5, 129, 30, +/* 6780 */ 5, 79, 5, 129, 30, 4, 80, 4, 133, 31, +/* 6790 */ 3, 79, 4, 129, 31, 4, 79, 4, 129, 32, +/* 6800 */ 3, 78, 4, 129, 32, 4, 76, 6, 129, 33, +/* 6810 */ 4, 74, 7, 129, 34, 4, 72, 8, 129, 35, +/* 6820 */ 5, 72, 7, 129, 37, 5, 73, 4, 129, 39, +/* 6830 */ 4, 74, 1, 129, 129, 193, 129, 46, 22, 129, +/* 6840 */ 42, 30, 129, 39, 36, 129, 37, 40, 129, 35, +/* 6850 */ 44, 129, 34, 46, 129, 33, 48, 129, 32, 15, +/* 6860 */ 67, 15, 129, 31, 11, 72, 11, 129, 31, 8, +/* 6870 */ 75, 8, 129, 30, 7, 77, 7, 129, 30, 6, +/* 6880 */ 78, 6, 129, 30, 5, 79, 5, 131, 31, 4, +/* 6890 */ 79, 4, 129, 31, 5, 78, 5, 129, 32, 5, +/* 6900 */ 77, 5, 129, 33, 5, 76, 5, 129, 35, 5, +/* 6910 */ 74, 5, 117, 4, 129, 37, 5, 72, 5, 117, +/* 6920 */ 4, 129, 30, 91, 136, 30, 4, 130, 193, 129, +/* 6930 */ 48, 18, 129, 43, 28, 129, 41, 32, 129, 39, +/* 6940 */ 36, 129, 37, 40, 129, 35, 44, 129, 34, 46, +/* 6950 */ 129, 33, 13, 55, 4, 68, 13, 129, 32, 9, +/* 6960 */ 55, 4, 73, 9, 129, 32, 7, 55, 4, 75, +/* 6970 */ 7, 129, 31, 6, 55, 4, 77, 6, 129, 31, +/* 6980 */ 5, 55, 4, 78, 5, 129, 30, 5, 55, 4, +/* 6990 */ 79, 5, 129, 30, 4, 55, 4, 80, 4, 132, +/* 7000 */ 30, 4, 55, 4, 79, 5, 129, 31, 3, 55, +/* 7010 */ 4, 78, 5, 129, 31, 4, 55, 4, 77, 6, +/* 7020 */ 129, 32, 3, 55, 4, 75, 7, 129, 32, 4, +/* 7030 */ 55, 4, 73, 9, 129, 33, 4, 55, 4, 68, +/* 7040 */ 13, 129, 34, 4, 55, 25, 129, 35, 5, 55, +/* 7050 */ 24, 129, 37, 5, 55, 22, 129, 39, 4, 55, +/* 7060 */ 20, 129, 55, 18, 129, 55, 16, 129, 55, 11, +/* 7070 */ 129, 193, 129, 80, 4, 129, 30, 4, 80, 4, +/* 7080 */ 130, 30, 78, 129, 30, 82, 129, 30, 85, 129, +/* 7090 */ 30, 87, 129, 30, 88, 129, 30, 89, 129, 30, +/* 7100 */ 90, 130, 30, 4, 80, 4, 115, 6, 129, 30, +/* 7110 */ 4, 80, 4, 117, 4, 129, 80, 4, 105, 6, +/* 7120 */ 117, 4, 129, 80, 4, 103, 10, 116, 5, 129, +/* 7130 */ 80, 4, 102, 19, 129, 80, 4, 101, 19, 129, +/* 7140 */ 101, 19, 129, 101, 18, 129, 102, 16, 129, 103, +/* 7150 */ 12, 129, 105, 6, 129, 193, 129, 12, 10, 59, +/* 7160 */ 11, 129, 9, 16, 55, 19, 129, 7, 20, 53, +/* 7170 */ 23, 129, 6, 7, 23, 5, 32, 6, 51, 27, +/* 7180 */ 129, 4, 7, 25, 16, 50, 29, 129, 3, 6, +/* 7190 */ 27, 16, 49, 31, 129, 2, 6, 28, 16, 48, +/* 7200 */ 33, 129, 1, 6, 27, 18, 47, 35, 129, 1, +/* 7210 */ 6, 27, 31, 71, 12, 129, 1, 5, 26, 15, +/* 7220 */ 44, 10, 75, 8, 129, 1, 5, 25, 14, 45, +/* 7230 */ 7, 77, 7, 129, 1, 5, 25, 13, 45, 5, +/* 7240 */ 79, 5, 129, 1, 5, 24, 14, 45, 4, 80, +/* 7250 */ 4, 129, 1, 5, 24, 13, 45, 4, 80, 4, +/* 7260 */ 129, 1, 5, 23, 14, 45, 4, 80, 4, 129, +/* 7270 */ 1, 5, 23, 13, 45, 4, 80, 4, 129, 1, +/* 7280 */ 6, 22, 13, 45, 5, 79, 5, 129, 1, 6, +/* 7290 */ 21, 14, 45, 7, 77, 7, 129, 1, 7, 21, +/* 7300 */ 13, 46, 8, 75, 8, 129, 1, 8, 20, 13, +/* 7310 */ 46, 12, 71, 12, 129, 1, 10, 18, 15, 47, +/* 7320 */ 35, 129, 2, 30, 48, 33, 129, 3, 29, 49, +/* 7330 */ 32, 129, 4, 27, 50, 31, 129, 5, 25, 51, +/* 7340 */ 27, 80, 2, 86, 4, 129, 7, 21, 53, 23, +/* 7350 */ 80, 3, 85, 6, 129, 9, 17, 55, 19, 80, +/* 7360 */ 12, 129, 12, 12, 59, 11, 81, 11, 129, 82, +/* 7370 */ 10, 129, 84, 7, 129, 86, 4, 129, 193, 129, +/* 7380 */ 30, 4, 117, 4, 130, 30, 91, 136, 30, 4, +/* 7390 */ 72, 5, 129, 30, 4, 74, 5, 129, 75, 5, +/* 7400 */ 129, 76, 5, 129, 76, 6, 129, 77, 6, 130, +/* 7410 */ 77, 7, 130, 76, 8, 129, 30, 4, 75, 9, +/* 7420 */ 129, 30, 4, 72, 12, 129, 30, 54, 129, 30, +/* 7430 */ 53, 130, 30, 52, 129, 30, 51, 129, 30, 49, +/* 7440 */ 129, 30, 46, 129, 30, 42, 129, 30, 4, 130, +/* 7450 */ 193, 129, 30, 4, 80, 4, 129, 30, 4, 80, +/* 7460 */ 4, 100, 6, 129, 30, 54, 98, 10, 129, 30, +/* 7470 */ 54, 97, 12, 129, 30, 54, 96, 14, 131, 30, +/* 7480 */ 54, 97, 12, 129, 30, 54, 98, 10, 129, 30, +/* 7490 */ 54, 100, 6, 129, 30, 4, 130, 193, 129, 7, +/* 7500 */ 6, 129, 4, 11, 129, 3, 13, 129, 2, 14, +/* 7510 */ 129, 1, 15, 130, 1, 3, 6, 9, 129, 1, +/* 7520 */ 3, 7, 6, 129, 1, 3, 130, 1, 4, 129, +/* 7530 */ 1, 5, 80, 4, 129, 1, 7, 80, 4, 100, +/* 7540 */ 6, 129, 2, 82, 98, 10, 129, 3, 81, 97, +/* 7550 */ 12, 129, 4, 80, 96, 14, 129, 5, 79, 96, +/* 7560 */ 14, 129, 7, 77, 96, 14, 129, 10, 74, 97, +/* 7570 */ 12, 129, 14, 70, 98, 10, 129, 19, 65, 100, +/* 7580 */ 6, 129, 193, 129, 30, 4, 117, 4, 130, 30, +/* 7590 */ 91, 136, 30, 4, 57, 9, 129, 30, 4, 55, +/* 7600 */ 12, 129, 52, 17, 129, 50, 20, 129, 48, 24, +/* 7610 */ 129, 46, 27, 129, 44, 21, 69, 6, 129, 41, +/* 7620 */ 22, 70, 6, 80, 4, 129, 30, 4, 39, 21, +/* 7630 */ 72, 6, 80, 4, 129, 30, 4, 36, 22, 73, +/* 7640 */ 11, 129, 30, 26, 75, 9, 129, 30, 23, 76, +/* 7650 */ 8, 129, 30, 21, 78, 6, 129, 30, 19, 79, +/* 7660 */ 5, 129, 30, 16, 80, 4, 129, 30, 14, 80, +/* 7670 */ 4, 129, 30, 12, 129, 30, 10, 129, 30, 7, +/* 7680 */ 129, 30, 5, 129, 30, 4, 130, 193, 129, 30, +/* 7690 */ 4, 117, 4, 130, 30, 91, 136, 30, 4, 130, +/* 7700 */ 193, 129, 30, 4, 80, 4, 130, 30, 54, 136, +/* 7710 */ 30, 4, 72, 5, 129, 30, 4, 74, 5, 129, +/* 7720 */ 75, 5, 129, 76, 5, 129, 30, 4, 75, 7, +/* 7730 */ 129, 30, 4, 74, 9, 129, 30, 54, 132, 30, +/* 7740 */ 53, 129, 30, 52, 129, 30, 51, 129, 30, 48, +/* 7750 */ 129, 30, 4, 72, 5, 129, 30, 4, 74, 5, +/* 7760 */ 129, 75, 5, 129, 76, 5, 129, 30, 4, 75, +/* 7770 */ 7, 129, 30, 4, 74, 9, 129, 30, 54, 132, +/* 7780 */ 30, 53, 129, 30, 52, 129, 30, 51, 129, 30, +/* 7790 */ 48, 129, 30, 4, 130, 193, 129, 30, 4, 80, +/* 7800 */ 4, 130, 30, 54, 136, 30, 4, 72, 5, 129, +/* 7810 */ 30, 4, 74, 5, 129, 75, 5, 129, 76, 5, +/* 7820 */ 129, 76, 6, 129, 77, 6, 130, 77, 7, 130, +/* 7830 */ 76, 8, 129, 30, 4, 75, 9, 129, 30, 4, +/* 7840 */ 72, 12, 129, 30, 54, 129, 30, 53, 130, 30, +/* 7850 */ 52, 129, 30, 51, 129, 30, 49, 129, 30, 46, +/* 7860 */ 129, 30, 42, 129, 30, 4, 130, 193, 129, 48, +/* 7870 */ 18, 129, 43, 28, 129, 41, 32, 129, 39, 36, +/* 7880 */ 129, 37, 40, 129, 35, 44, 129, 34, 46, 129, +/* 7890 */ 33, 13, 68, 13, 129, 32, 9, 73, 9, 129, +/* 7900 */ 32, 7, 75, 7, 129, 31, 6, 77, 6, 129, +/* 7910 */ 31, 5, 78, 5, 129, 30, 5, 79, 5, 129, +/* 7920 */ 30, 4, 80, 4, 132, 30, 5, 79, 5, 130, +/* 7930 */ 31, 5, 78, 5, 129, 31, 6, 77, 6, 129, +/* 7940 */ 32, 7, 75, 7, 129, 32, 9, 73, 9, 129, +/* 7950 */ 33, 13, 68, 13, 129, 34, 46, 129, 35, 44, +/* 7960 */ 129, 37, 40, 129, 39, 36, 129, 41, 32, 129, +/* 7970 */ 43, 28, 129, 48, 18, 129, 193, 129, 1, 3, +/* 7980 */ 80, 4, 130, 1, 83, 137, 37, 5, 72, 5, +/* 7990 */ 129, 35, 5, 74, 5, 129, 33, 5, 76, 5, +/* 8000 */ 129, 32, 5, 77, 5, 129, 31, 5, 78, 5, +/* 8010 */ 129, 31, 4, 79, 4, 129, 30, 5, 79, 5, +/* 8020 */ 131, 30, 6, 78, 6, 129, 30, 7, 77, 7, +/* 8030 */ 129, 31, 8, 75, 8, 129, 31, 11, 72, 11, +/* 8040 */ 129, 32, 15, 67, 15, 129, 33, 48, 129, 34, +/* 8050 */ 46, 129, 35, 44, 129, 37, 40, 129, 39, 36, +/* 8060 */ 129, 42, 30, 129, 46, 22, 129, 193, 129, 46, +/* 8070 */ 22, 129, 42, 30, 129, 39, 36, 129, 37, 40, +/* 8080 */ 129, 35, 44, 129, 34, 46, 129, 33, 48, 129, +/* 8090 */ 32, 15, 67, 15, 129, 31, 11, 72, 11, 129, +/* 8100 */ 31, 8, 75, 8, 129, 30, 7, 77, 7, 129, +/* 8110 */ 30, 6, 78, 6, 129, 30, 5, 79, 5, 131, +/* 8120 */ 31, 4, 79, 4, 129, 31, 5, 78, 5, 129, +/* 8130 */ 32, 5, 77, 5, 129, 33, 5, 76, 5, 129, +/* 8140 */ 35, 5, 74, 5, 129, 37, 5, 72, 5, 129, +/* 8150 */ 1, 83, 136, 1, 3, 80, 4, 130, 193, 129, +/* 8160 */ 30, 4, 80, 4, 130, 30, 54, 136, 30, 4, +/* 8170 */ 68, 6, 129, 30, 4, 70, 6, 129, 71, 7, +/* 8180 */ 129, 72, 7, 129, 73, 7, 129, 74, 7, 129, +/* 8190 */ 74, 8, 129, 75, 8, 130, 69, 15, 129, 67, +/* 8200 */ 17, 129, 66, 18, 129, 65, 19, 130, 65, 18, +/* 8210 */ 130, 66, 16, 129, 67, 13, 129, 69, 8, 129, +/* 8220 */ 193, 129, 30, 13, 64, 8, 129, 30, 13, 61, +/* 8230 */ 14, 129, 30, 13, 59, 18, 129, 30, 13, 57, +/* 8240 */ 22, 129, 33, 8, 56, 24, 129, 32, 7, 55, +/* 8250 */ 26, 129, 32, 6, 54, 28, 129, 31, 6, 53, +/* 8260 */ 16, 77, 6, 129, 31, 5, 53, 14, 79, 4, +/* 8270 */ 129, 30, 5, 52, 14, 80, 4, 129, 30, 5, +/* 8280 */ 52, 13, 80, 4, 129, 30, 4, 52, 13, 80, +/* 8290 */ 4, 129, 30, 4, 52, 12, 80, 4, 129, 30, +/* 8300 */ 4, 51, 13, 80, 4, 130, 30, 4, 50, 13, +/* 8310 */ 79, 5, 129, 30, 4, 50, 13, 78, 5, 129, +/* 8320 */ 30, 5, 49, 14, 77, 6, 129, 31, 4, 49, +/* 8330 */ 13, 76, 6, 129, 31, 5, 48, 14, 75, 7, +/* 8340 */ 129, 32, 5, 47, 14, 73, 8, 129, 32, 6, +/* 8350 */ 45, 16, 71, 13, 129, 33, 27, 71, 13, 129, +/* 8360 */ 34, 26, 71, 13, 129, 35, 24, 71, 13, 129, +/* 8370 */ 37, 20, 129, 39, 16, 129, 43, 9, 129, 193, +/* 8380 */ 129, 80, 4, 131, 41, 56, 129, 37, 60, 129, +/* 8390 */ 35, 62, 129, 33, 64, 129, 32, 65, 129, 31, +/* 8400 */ 66, 129, 30, 67, 130, 30, 11, 80, 4, 129, +/* 8410 */ 30, 9, 80, 4, 129, 30, 8, 80, 4, 129, +/* 8420 */ 31, 7, 80, 4, 129, 31, 6, 129, 32, 5, +/* 8430 */ 129, 33, 5, 129, 35, 4, 129, 38, 3, 129, +/* 8440 */ 193, 129, 80, 4, 130, 42, 42, 129, 38, 46, +/* 8450 */ 129, 35, 49, 129, 33, 51, 129, 32, 52, 129, +/* 8460 */ 31, 53, 130, 30, 54, 129, 30, 12, 129, 30, +/* 8470 */ 9, 129, 30, 8, 129, 30, 7, 130, 31, 6, +/* 8480 */ 130, 32, 6, 129, 33, 5, 129, 34, 5, 129, +/* 8490 */ 35, 5, 80, 4, 129, 37, 5, 80, 4, 129, +/* 8500 */ 30, 54, 136, 30, 4, 130, 193, 129, 80, 4, +/* 8510 */ 130, 77, 7, 129, 74, 10, 129, 70, 14, 129, +/* 8520 */ 66, 18, 129, 62, 22, 129, 59, 25, 129, 55, +/* 8530 */ 29, 129, 51, 33, 129, 47, 37, 129, 44, 32, +/* 8540 */ 80, 4, 129, 40, 32, 80, 4, 129, 36, 32, +/* 8550 */ 129, 32, 33, 129, 30, 31, 129, 33, 24, 129, +/* 8560 */ 36, 17, 129, 40, 12, 129, 44, 12, 129, 48, +/* 8570 */ 12, 129, 51, 13, 129, 55, 13, 129, 59, 13, +/* 8580 */ 80, 4, 129, 63, 13, 80, 4, 129, 67, 17, +/* 8590 */ 129, 71, 13, 129, 74, 10, 129, 78, 6, 129, +/* 8600 */ 80, 4, 131, 193, 129, 80, 4, 130, 77, 7, +/* 8610 */ 129, 74, 10, 129, 70, 14, 129, 66, 18, 129, +/* 8620 */ 62, 22, 129, 59, 25, 129, 55, 29, 129, 51, +/* 8630 */ 33, 129, 47, 37, 129, 44, 32, 80, 4, 129, +/* 8640 */ 40, 32, 80, 4, 129, 36, 32, 129, 32, 33, +/* 8650 */ 129, 30, 31, 129, 33, 24, 129, 36, 17, 129, +/* 8660 */ 40, 12, 129, 44, 12, 129, 47, 13, 129, 44, +/* 8670 */ 20, 129, 40, 28, 129, 36, 31, 129, 32, 32, +/* 8680 */ 129, 30, 30, 129, 33, 24, 129, 36, 17, 129, +/* 8690 */ 40, 12, 129, 44, 12, 129, 48, 12, 129, 51, +/* 8700 */ 13, 129, 55, 13, 129, 59, 13, 80, 4, 129, +/* 8710 */ 63, 13, 80, 4, 129, 67, 17, 129, 71, 13, +/* 8720 */ 129, 74, 10, 129, 78, 6, 129, 80, 4, 131, +/* 8730 */ 193, 129, 30, 4, 80, 4, 130, 30, 4, 79, +/* 8740 */ 5, 129, 30, 5, 77, 7, 129, 30, 6, 74, +/* 8750 */ 10, 129, 30, 8, 72, 12, 129, 30, 11, 69, +/* 8760 */ 15, 129, 30, 13, 67, 17, 129, 30, 4, 37, +/* 8770 */ 8, 64, 20, 129, 30, 4, 39, 8, 62, 22, +/* 8780 */ 129, 41, 8, 59, 25, 129, 43, 8, 57, 27, +/* 8790 */ 129, 45, 8, 55, 22, 80, 4, 129, 47, 27, +/* 8800 */ 80, 4, 129, 49, 23, 129, 47, 22, 129, 44, +/* 8810 */ 23, 129, 42, 22, 129, 30, 4, 39, 27, 129, +/* 8820 */ 30, 4, 37, 31, 129, 30, 27, 62, 8, 129, +/* 8830 */ 30, 25, 64, 8, 129, 30, 22, 66, 8, 80, +/* 8840 */ 4, 129, 30, 20, 68, 8, 80, 4, 129, 30, +/* 8850 */ 17, 70, 8, 80, 4, 129, 30, 15, 73, 11, +/* 8860 */ 129, 30, 12, 75, 9, 129, 30, 10, 77, 7, +/* 8870 */ 129, 30, 7, 79, 5, 129, 30, 5, 80, 4, +/* 8880 */ 129, 30, 4, 80, 4, 130, 193, 129, 4, 5, +/* 8890 */ 80, 4, 129, 2, 9, 80, 4, 129, 1, 11, +/* 8900 */ 77, 7, 129, 1, 12, 74, 10, 129, 1, 12, +/* 8910 */ 70, 14, 129, 1, 12, 66, 18, 129, 1, 11, +/* 8920 */ 62, 22, 129, 2, 9, 59, 25, 129, 4, 11, +/* 8930 */ 55, 29, 129, 7, 12, 51, 33, 129, 10, 12, +/* 8940 */ 47, 37, 129, 14, 12, 44, 32, 80, 4, 129, +/* 8950 */ 17, 13, 40, 32, 80, 4, 129, 21, 13, 36, +/* 8960 */ 32, 129, 25, 40, 129, 29, 32, 129, 33, 24, +/* 8970 */ 129, 36, 17, 129, 40, 12, 129, 44, 12, 129, +/* 8980 */ 48, 12, 129, 51, 13, 129, 55, 13, 129, 59, +/* 8990 */ 13, 80, 4, 129, 63, 13, 80, 4, 129, 67, +/* 9000 */ 17, 129, 71, 13, 129, 74, 10, 129, 78, 6, +/* 9010 */ 129, 80, 4, 131, 193, 129, 30, 1, 71, 13, +/* 9020 */ 129, 30, 3, 71, 13, 129, 30, 6, 71, 13, +/* 9030 */ 129, 30, 9, 75, 9, 129, 30, 11, 77, 7, +/* 9040 */ 129, 30, 14, 79, 5, 129, 30, 17, 79, 5, +/* 9050 */ 129, 30, 19, 80, 4, 129, 30, 22, 80, 4, +/* 9060 */ 129, 30, 25, 80, 4, 129, 30, 27, 80, 4, +/* 9070 */ 129, 30, 4, 36, 24, 80, 4, 129, 30, 4, +/* 9080 */ 38, 25, 80, 4, 129, 30, 4, 41, 24, 80, +/* 9090 */ 4, 129, 30, 4, 44, 24, 80, 4, 129, 30, +/* 9100 */ 4, 46, 25, 80, 4, 129, 30, 4, 49, 25, +/* 9110 */ 80, 4, 129, 30, 4, 52, 24, 80, 4, 129, +/* 9120 */ 30, 4, 54, 30, 129, 30, 4, 57, 27, 129, +/* 9130 */ 30, 4, 59, 25, 129, 30, 4, 62, 22, 129, +/* 9140 */ 30, 4, 65, 19, 129, 30, 5, 67, 17, 129, +/* 9150 */ 30, 5, 70, 14, 129, 30, 7, 73, 11, 129, +/* 9160 */ 30, 9, 76, 8, 129, 30, 13, 78, 6, 129, +/* 9170 */ 30, 13, 81, 3, 129, 30, 13, 129, 193, 2, +/* 9180 */ 9, 59, 25, 129, 4, 11, 55, 29, 129, 7, +/* 9190 */ 12, 51, 33, 129, 10, 12, 47, 37, 129, 14, +/* 9200 */ 12, 44, 32, 80, 4, 129, 17, 13, 40, 32, +/* 9210 */ 80, 4, 129, 21, 13, 36, 32, 129, 25, 40, +/* 9220 */ 129, 29, 32, 129, 33, 24, 129, 36, 17, 129, +/* 9230 */ 40, 12, 129, 44, 12, 129, 48, 12, 129, 51, +/* 9240 */ 13, 129, 55, 13, 129, 59, 13, 80, 4, 129, +/* 9250 */ 63, 13, 80, 4, 129, 67, 17, 129, 71, 13, +/* 9260 */ 129, 74, 10, 129, 78, 6, 129, 80, 4, 131, +/* 9270 */ 193 +}; + +FILE *fd; +int i,j,k; +char c; +int width = DWIDTH; /* -w option: scrunch letters to 80 columns */ +int debug; +int trace; +char line[DWIDTH]; +char print[DWIDTH]; +char message[MAXMSG]; +char *messp; +int nchars; +int linen; +int x,y; +int term,dup; +int pc; +int max; + +main(argc,argv) +int argc; +char **argv; +{ + if (argc > 1 && argv[1][0] == '-') { + switch(argv[1][1]) { + case 'w': + width = atoi(&argv[1][2]); + if (width==0) + width = 80; + break; + case 'd': + debug++; + break; + case 't': + trace++; + break; + default: + printf("bad switch %s\n",argv[1]); + break; + } + argc--; + argv++; + } + + for (i=0; i 1) { + strcpy(message, argv[1]); + for (i=2; i NBYTES) { + printf("bad pc: %d\n",pc); + exit(1); + } + x = data_table[pc] & 0377; + if (trace) + printf("pc=%d, term=%d, max=%d, linen=%d, x=%d\n",pc,term,max,linen,x); + if (x >= 128) { + if (x>192) term++; + x = x & 63; + while (x--) { + if (print[linen++]) { + for (j=0; j<=max; j++) + if (print[j]) + putchar(line[j]); + putchar('\n'); + } + } + for (j=0; j battlestar.0 + +clean: + rm -f $(OBJS) $(JUNKFILES) xx* mkstr battle_strings core a.out ${MAN} diff --git a/games/battlestar/battlestar.6 b/games/battlestar/battlestar.6 new file mode 100644 index 0000000..95da1c6 --- /dev/null +++ b/games/battlestar/battlestar.6 @@ -0,0 +1,140 @@ +.\" +.\" Copyright (c) 1983 Regents of the University of California, +.\" All rights reserved. Redistribution permitted subject to +.\" the terms of the Berkeley Software License Agreement. +.\" + +.\" @(#)battlestar.6 1.2 4/24/85 + +.TH BATTLESTAR 6 +.UC 4 +.SH NAME +battlestar \- a tropical adventure game +.SH SYNOPSIS +.B battlestar +[ +.B -r (recover a saved game) +] +.br +.fi +.SH DESCRIPTION +.I Battlestar +is an adventure game in the classic style. However, It's slightly less +of a +puzzle and more a game of exploration. There are a few magical words +in the game, but on the whole, simple English +should suffice to make one's desires understandable to the parser. +.SH "THE SETTING" +In the days before the darkness came, when battlestars ruled the +heavens... +.br +.nf + + Three He made and gave them to His daughters, + Beautiful nymphs, the goddesses of the waters. + One to bring good luck and simple feats of wonder, + Two to wash the lands and churn the waves asunder, + Three to rule the world and purge the skies with thunder. + +.fi +.PP +In those times great wizards were known and their powers were beyond +belief. They could take any object from thin air, and, uttering the +word +'su,' could disappear. +.PP +In those times men were known for their lust of gold and desire to +wear fine weapons. Swords and coats of mail were fashioned that could +withstand a laser blast. +.PP +But when the darkness fell, the rightful reigns were toppled. Swords +and helms and heads of state went rolling across the grass. The entire +fleet of battlestars was reduced to a single ship. +.SH "SAMPLE COMMANDS" +.nf + + take --- take an object + drop --- drop an object + + wear --- wear an object you are holding + draw --- carry an object you are wearing + + puton --- take an object and wear it + take off -- draw an object and drop it + + throw + + ! + +.fi +.SH "IMPLIED OBJECTS" +.nf + + >-: take watermellon + watermellon: + Taken. + >-: eat + watermellon: + Eaten. + >-: take knife and sword and apple, drop all + knife: + Taken. + broadsword: + Taken. + apple: + Taken. + knife: + Dropped. + broadsword: + Dropped. + apple: + Dropped. + >-: get + knife: + Taken. + +.fi +.PP +Notice that the "shadow" of the next word stays around if you +want to take advantage of it. That is, saying "take knife" and then +"drop" +will drop the knife you just took. +.SH "SCORE & INVEN" +The two commands "score" and "inven" will print out your current status +in +the game. +.SH "SAVING A GAME" +The command "save" will save your game in a file called "Bstar." You +can +recover a saved game by using the "-r" option when you start up the +game. +.SH DIRECTIONS +The compass directions N, S, E, and W can be used if you have a compass. +If you don't have a compass, you'll have to say R, L, A, or B, which +stand for +Right, Left, Ahead, and Back. Directions printed in room descriptions +are +always printed in R, L, A, & B relative directions. +.SH HISTORY +I wrote Battlestar in 1979 in order to experiment with the niceties of +the C Language. +Most interesting things that happen in the game are hardwired into the +code, so don't +send me any hate mail about it! Instead, enjoy art for art's sake! +.SH AUTHOR +David Riggle +.SH "INSPIRATION & ASSISTANCE" +Chris Guthrie +.br +Peter Da Silva +.br +Kevin Brown +.br +Edward Wang +.br +Ken Arnold & Company +.SH BUGS +Countless. +.SH "FAN MAIL" +Send to edward%ucbarpa@Berkeley.arpa, chris%ucbcory@berkeley.arpa, +riggle.pa@xerox.arpa. diff --git a/games/battlestar/battlestar.c b/games/battlestar/battlestar.c new file mode 100644 index 0000000..208ddc7 --- /dev/null +++ b/games/battlestar/battlestar.c @@ -0,0 +1,63 @@ +/* + * Copyright (c) 1983 Regents of the University of California, + * All rights reserved. Redistribution permitted subject to + * the terms of the Berkeley Software License Agreement. + */ + +#if !defined(lint) && !defined(pdp11) +static char sccsid[] = "@(#)battlestar.c 1.3 4/24/85"; +#endif + +/* + * Battlestar - a stellar-tropical adventure game + * + * Originally written by His Lordship, Admiral David W. Horatio Riggle, + * on the Cory PDP-11/70, University of California, Berkeley. + */ + +#include "externs.h" + +main(argc,argv) +int argc; +char **argv; +{ + char mainbuf[LINELENGTH]; + char instackbuf[BUFSIZ]; + char outstackbuf[BUFSIZ]; + char *next; + + setbuf(stdin, instackbuf); + setbuf(stdout, outstackbuf); + setlinebuf(stdout); + initialize(argc < 2 || strcmp(argv[1], "-r")); +start: + news(); + beenthere[position]++; + if (notes[LAUNCHED]) + crash(); /* decrements fuel & crash */ + if (matchlight) { + puts("Your match splutters out."); + matchlight = 0; + } + if (!notes[CANTSEE] || testbit(inven,LAMPON) || + testbit(location[position].objects, LAMPON)) { + writedes(); + printobjs(); + } else + puts("It's too dark to see anything in here!"); + whichway(location[position]); +run: + next = getcom(mainbuf, sizeof mainbuf, ">-: ", + "Please type in something."); + for (wordcount = 0; next && wordcount < 20; wordcount++) + next = getword(next, words[wordcount], -1); + parse(); + switch (cypher()) { + case -1: + goto run; + case 0: + goto start; + default: + exit(); + } +} diff --git a/games/battlestar/com1.c b/games/battlestar/com1.c new file mode 100644 index 0000000..b3020b1 --- /dev/null +++ b/games/battlestar/com1.c @@ -0,0 +1,235 @@ +/* + * Copyright (c) 1983 Regents of the University of California, + * All rights reserved. Redistribution permitted subject to + * the terms of the Berkeley Software License Agreement. + */ + +#if !defined(lint) && !defined(pdp11) +static char sccsid[] = "@(#)com1.c 1.3.1 1996/10/26"; +#endif + +#include "externs.h" + +move(thataway, token) +int thataway, token; +{ + wordnumber++; + if ((!notes[CANTMOVE] && !notes[LAUNCHED]) || testbit(location[position].objects, LAND) || fuel > 0 && notes[LAUNCHED]) + if (thataway) { + position = thataway; + newway(token); + Time++; + } + else { + puts("You can't go this way."); + newway(token); + whichway(location[position]); + return(0); + } + else if (notes[CANTMOVE] && !notes[LAUNCHED]) + puts("You aren't able to move; you better drop something."); + else + puts("You are out of fuel; now you will rot in space forever!"); + return(1); +} + +convert(tothis) /* Converts day to night and vice versa. */ +int tothis; /* Day objects are permanent. Night objects are added*/ +{ /* at dusk, and subtracted at dawn. */ + register struct objs *p; + register i, j; + + if (tothis == TONIGHT) { + for (i = 1; i <= NUMOFROOMS; i++) + for (j = 0; j < NUMOFWORDS; j++) + nightfile[i].objects[j] = dayfile[i].objects[j]; + for (p = nightobjs; p->room != 0; p++) + setbit(nightfile[p->room].objects, p->obj); + location = nightfile; + } else { + for (i = 1; i <= NUMOFROOMS; i++) + for (j = 0; j < NUMOFWORDS; j++) + dayfile[i].objects[j] = nightfile[i].objects[j]; + for (p = nightobjs; p->room != 0; p++) + clearbit(dayfile[p->room].objects, p->obj); + location = dayfile; + } +} + +news() +{ + register int n; + int hurt; + + if (Time > 30 && position < 32){ + puts("An explosion of shuddering magnitude splinters bulkheads and"); + puts("ruptures the battlestar's hull. You are sucked out into the"); + puts("frozen void of space and killed."); + die(); + } + if (Time > 20 && position < 32) + puts("Explosions rock the battlestar."); + if (Time > snooze){ + puts("You drop from exhaustion..."); + zzz(); + } + if (Time > snooze - 5) + puts("You're getting tired."); + if (Time > (rythmn + CYCLE)) { + if (location == nightfile) { + convert(TODAY); + if (OUTSIDE && Time - rythmn - CYCLE < 10) { + puts("Dew lit sunbeams stretch out from a watery sunrise and herald the dawn."); + puts("You awake from a misty dream-world into stark reality."); + puts("It is day."); + } + } else { + convert(TONIGHT); + clearbit(location[POOLS].objects, BATHGOD); + if (OUTSIDE && Time - rythmn - CYCLE < 10) { + puts("The dying sun sinks into the ocean, leaving a blood stained sunset."); + puts("The sky slowly fades from orange to violet to black. A few stars"); + puts("flicker on, and it is night."); + puts("The world seems completly different at night."); + } + } + rythmn = Time - Time % CYCLE; + } + if (!wiz && !tempwiz) + if ((testbit(inven,TALISMAN) || testbit(wear,TALISMAN)) && (testbit(inven,MEDALION) || testbit(wear,MEDALION)) && (testbit(inven,AMULET) || testbit(wear,AMULET))){ + tempwiz = 1; + puts("The three amulets glow and reenforce each other in power.\nYou are now a wizard."); + } + if (testbit(location[position].objects,ELF)){ +#ifdef pdp11 + strprt(ELF); +#else + printf("%s\n",objdes[ELF]); +#endif + fight(ELF,rnd(30)); + } + if (testbit(location[position].objects,DARK)){ +#ifdef pdp11 + strprt(DARK); +#else + printf("%s\n",objdes[DARK]); +#endif + fight(DARK,100); + } + if (testbit(location[position].objects,WOODSMAN)){ +#ifdef pdp11 + strprt(WOODSMAN); +#else + printf("%s\n",objdes[WOODSMAN]); +#endif + fight(WOODSMAN,50); + } + switch(position){ + + case 267: + case 257: /* entering a cave */ + case 274: + case 246: + notes[CANTSEE] = 1; + break; + case 160: + case 216: /* leaving a cave */ + case 230: + case 231: + case 232: + notes[CANTSEE] = 0; + break; + } + if (testbit(location[position].objects, GIRL)) + meetgirl = 1; + if (meetgirl && CYCLE * 1.5 - Time < 10){ + setbit(location[GARDEN].objects,GIRLTALK); + setbit(location[GARDEN].objects,LAMPON); + setbit(location[GARDEN].objects,ROPE); + } + if (position == DOCK && (beenthere[position] || Time > CYCLE)){ + clearbit(location[DOCK].objects, GIRL); + clearbit(location[DOCK].objects,MAN); + } + if (meetgirl && Time - CYCLE * 1.5 > 10){ + clearbit(location[GARDEN].objects,GIRLTALK); + clearbit(location[GARDEN].objects,LAMPON); + clearbit(location[GARDEN].objects,ROPE); + meetgirl = 0; + } + if (testbit(location[position].objects,CYLON)){ + puts("Oh my God, you're being shot at by an alien spacecraft!"); + printf("The targeting computer says we have %d seconds to attack!\n",clock); + fflush(stdout); + sleep(1); + if (!visual()){ + hurt = rnd(NUMOFINJURIES); + injuries[hurt] = 1; + puts("Laser blasts sear the cockpit, and the alien veers off in a victory roll."); + puts("The viper shudders under a terrible explosion."); + printf("I'm afraid you have suffered %s.\n", ouch[hurt]); + } + else + clearbit(location[position].objects,CYLON); + } + if (injuries[SKULL] && injuries[INCISE] && injuries[NECK]){ + puts("I'm afraid you have suffered fatal injuries."); + die(); + } + for (n=0; n < NUMOFINJURIES; n++) + if (injuries[n] == 1){ + injuries[n] = 2; + if (WEIGHT > 5) + WEIGHT -= 5; + else + WEIGHT = 0; + } + if (injuries[ARM] == 2){ + CUMBER -= 5; + injuries[ARM]++; + } + if (injuries[RIBS] == 2){ + CUMBER -= 2; + injuries[RIBS]++; + } + if (injuries[SPINE] == 2){ + WEIGHT = 0; + injuries[SPINE]++; + } + if (carrying > WEIGHT || encumber > CUMBER) + notes[CANTMOVE] = 1; + else + notes[CANTMOVE] = 0; +} + +crash() +{ + int hurt1,hurt2; + + fuel--; + if (!location[position].flyhere || (testbit(location[position].objects,LAND) && fuel <= 0)){ + if (!location[position].flyhere) + puts("You're flying too low. We're going to crash!"); + else{ + puts("You're out of fuel. We'll have to crash land!"); + if (!location[position].down){ + puts("Your viper strikes the ground and explodes into firey fragments."); + puts("Thick black smoke billows up from the wreckage."); + die(); + } + position = location[position].down; + } + notes[LAUNCHED] = 0; + setbit(location[position].objects,CRASH); + Time += rnd(CYCLE/4); + puts("The viper explodes into the ground and you lose consciousness..."); + zzz(); + hurt1 = rnd(NUMOFINJURIES - 2) + 2; + hurt2 = rnd(NUMOFINJURIES - 2) + 2; + injuries[hurt1] = 1; + injuries[hurt2] = 1; + injuries[0] = 1; /* abrasions */ + injuries[1] = 1; /* lacerations */ + printf("I'm afraid you have suffered %s and %s.\n",ouch[hurt1],ouch[hurt2]); + } +} diff --git a/games/battlestar/com2.c b/games/battlestar/com2.c new file mode 100644 index 0000000..9ea1543 --- /dev/null +++ b/games/battlestar/com2.c @@ -0,0 +1,269 @@ +/* + * Copyright (c) 1983 Regents of the University of California, + * All rights reserved. Redistribution permitted subject to + * the terms of the Berkeley Software License Agreement. + */ + +#if !defined(lint) && !defined(pdp11) +static char sccsid[] = "@(#)com2.c 1.3.1 1996/10/26"; +#endif + +#include "externs.h" + +wearit() /* synonyms = {sheathe, sheath} */ +{ + register int n; + int firstnumber, value; + + firstnumber = wordnumber; + while(wordtype[++wordnumber] == ADJS); + while(wordnumber <= wordcount){ + value = wordvalue[wordnumber]; + for (n=0; objsht[value][n]; n++); + switch(value){ + + case -1: + puts("Wear what?"); + return(firstnumber); + + default: + printf("You can't wear%s%s!\n",(objsht[value][n-1] == 's' ? " " : " a "),objsht[value]); + return(firstnumber); + + case KNIFE: + /* case SHIRT: */ + case ROBE: + case LEVIS: /* wearable things */ + case SWORD: + case MAIL: + case HELM: + case SHOES: + case PAJAMAS: + case COMPASS: + case LASER: + case AMULET: + case TALISMAN: + case MEDALION: + case ROPE: + case RING: + case BRACELET: + case GRENADE: + + if (testbit(inven,value)){ + clearbit(inven,value); + setbit(wear,value); + carrying -= objwt[value]; + encumber -= objcumber[value]; + Time++; + printf("You are now wearing %s %s.\n",(objsht[value][n-1] == 's' ? "the" : "a"), objsht[value]); + } + else if (testbit(wear,value)) + printf("You are already wearing the %s.\n", objsht[value]); + else + printf("You aren't holding the %s.\n", objsht[value]); + if (wordnumber < wordcount - 1 && wordvalue[++wordnumber] == AND) + wordnumber++; + else + return(firstnumber); + } /* end switch */ + } /* end while */ + puts("Don't be ridiculous."); + return(firstnumber); +} + +put() /* synonyms = {buckle, strap, tie} */ +{ + if (wordvalue[wordnumber + 1] == ON){ + wordvalue[++wordnumber] = PUTON; + return(cypher()); + } + if (wordvalue[wordnumber + 1] == DOWN){ + wordvalue[++wordnumber] = DROP; + return(cypher()); + } + puts("I don't understand what you want to put."); + return(-1); + +} + +draw() /* synonyms = {pull, carry} */ +{ + return(take(wear)); +} + +use() +{ + while (wordtype[++wordnumber] == ADJS && wordnumber < wordcount); + if (wordvalue[wordnumber] == AMULET && testbit(inven,AMULET) && position != FINAL){ + puts("The amulet begins to glow."); + if (testbit(inven,MEDALION)){ + puts("The medallion comes to life too."); + if (position == 114){ + location[position].down = 160; + whichway(location[position]); + puts("The waves subside and it is possible to descend to the sea cave now."); + Time++; + return(-1); + } + } + puts("A light mist falls over your eyes and the sound of purling water trickles in"); + puts("your ears. When the mist lifts you are standing beside a cool stream."); + if (position == 229) + position = 224; + else + position = 229; + Time++; + return(0); + } + else if (position == FINAL) + puts("The amulet won't work in here."); + else if (wordvalue[wordnumber] == COMPASS && testbit(inven,COMPASS)) + printf("Your compass points %s.\n",truedirec(NORTH,'-')); + else if (wordvalue[wordnumber] == COMPASS) + puts("You aren't holding the compass."); + else if (wordvalue[wordnumber] == AMULET) + puts("You aren't holding the amulet."); + else + puts("There is no apparent use."); + return(-1); +} + +murder() +{ + register int n; + + for (n=0; !((n == SWORD || n == KNIFE || n == TWO_HANDED || n == MACE || n == CLEAVER || n == BROAD || n == CHAIN || n == SHOVEL || n == HALBERD) && testbit(inven,n)) && n < NUMOFOBJECTS; n++); + if (n == NUMOFOBJECTS) + puts("You don't have suitable weapons to kill."); + else { + printf("Your %s should do the trick.\n",objsht[n]); + while (wordtype[++wordnumber] == ADJS); + switch(wordvalue[wordnumber]){ + + case NORMGOD: + if (testbit(location[position].objects,BATHGOD)){ + puts("The goddess's head slices off. Her corpse floats in the water."); + clearbit(location[position].objects,BATHGOD); + setbit(location[position].objects,DEADGOD); + power += 5; + notes[JINXED]++; + } else if (testbit(location[position].objects,NORMGOD)){ + puts("The goddess pleads but you strike her mercilessly. Her broken body lies in a\npool of blood."); + clearbit(location[position].objects,NORMGOD); + setbit(location[position].objects,DEADGOD); + power += 5; + notes[JINXED]++; + if (wintime) + live(); + } else puts("I dont see her anywhere."); + break; + case TIMER: + if (testbit(location[position].objects,TIMER)){ + puts("The old man offers no resistance."); + clearbit(location[position].objects,TIMER); + setbit(location[position].objects,DEADTIME); + power++; + notes[JINXED]++; + } else puts("Who?"); + break; + case NATIVE: + if (testbit(location[position].objects,NATIVE)){ + puts("The girl screams as you cut her body to shreds. She is dead."); + clearbit(location[position].objects,NATIVE); + setbit(location[position].objects,DEADNATIVE); + power += 5; + notes[JINXED]++; + } else puts("What girl?"); + break; + case MAN: + if (testbit(location[position].objects,MAN)){ + puts("You strike him to the ground, and he coughs up blood."); + puts("Your fantasy is over."); + die(); + } + case -1: + puts("Kill what?"); + break; + + default: + if (wordtype[wordnumber] != NOUNS) + puts("Kill what?"); + else + printf("You can't kill the %s!\n",objsht[wordvalue[wordnumber]]); + } + } +} + +ravage() +{ + while (wordtype[++wordnumber] != NOUNS && wordnumber <= wordcount); + if (wordtype[wordnumber] == NOUNS && testbit(location[position].objects,wordvalue[wordnumber])){ + Time++; + switch(wordvalue[wordnumber]){ + case NORMGOD: + puts("You attack the goddess, and she screams as you beat her. She falls down"); + puts("crying and tries to hold her torn and bloodied dress around her."); + power += 5; + pleasure += 8; + ego -= 10; + wordnumber--; + godready = -30000; + murder(); + win = -30000; + break; + case NATIVE: + puts("The girl tries to run, but you catch her and throw her down. Her face is"); + puts("bleeding, and she screams as you tear off her clothes."); + power += 3; + pleasure += 5; + ego -= 10; + wordnumber--; + murder(); + if (rnd(100) < 50){ + puts("Her screams have attracted attention. I think we are surrounded."); + setbit(location[ahead].objects,WOODSMAN); + setbit(location[ahead].objects,DEADWOOD); + setbit(location[ahead].objects,MALLET); + setbit(location[back].objects,WOODSMAN); + setbit(location[back].objects,DEADWOOD); + setbit(location[back].objects,MALLET); + setbit(location[left].objects,WOODSMAN); + setbit(location[left].objects,DEADWOOD); + setbit(location[left].objects,MALLET); + setbit(location[right].objects,WOODSMAN); + setbit(location[right].objects,DEADWOOD); + setbit(location[right].objects,MALLET); + } + break; + default: + puts("You are perverted."); + } + } + else + puts("Who?"); +} + +follow() +{ + if (followfight == Time){ + puts("The Dark Lord leaps away and runs down secret tunnels and corridoors."); + puts("You chase him through the darkness and splash in pools of water."); + puts("You have cornered him. His laser sword extends as he steps forward."); + position = FINAL; + fight(DARK,75); + setbit(location[position].objects,TALISMAN); + setbit(location[position].objects,AMULET); + return(0); + } + else if (followgod == Time){ + puts("The goddess leads you down a steamy tunnel and into a high, wide chamber."); + puts("She sits down on a throne."); + position = 268; + setbit(location[position].objects,NORMGOD); + notes[CANTSEE] = 1; + return(0); + } + else + puts("There is no one to follow."); + return(-1); +} diff --git a/games/battlestar/com3.c b/games/battlestar/com3.c new file mode 100644 index 0000000..defdd13 --- /dev/null +++ b/games/battlestar/com3.c @@ -0,0 +1,285 @@ +/* + * Copyright (c) 1983 Regents of the University of California, + * All rights reserved. Redistribution permitted subject to + * the terms of the Berkeley Software License Agreement. + */ + +#if !defined(lint) && !defined(pdp11) +static char sccsid[] = "@(#)com3.c 1.2.1 1996/10/26"; +#endif + +#include "externs.h" + +dig() +{ + if (testbit(inven,SHOVEL)){ + puts("OK"); + Time++; + switch(position){ + case 144: /* copse near beach */ + if (!notes[DUG]){ + setbit(location[position].objects,DEADWOOD); + setbit(location[position].objects,COMPASS); + setbit(location[position].objects,KNIFE); + setbit(location[position].objects,MACE); + notes[DUG] = 1; + } + break; + + default: + puts("Nothing happens."); + } + } + else + puts("You don't have a shovel."); +} + +jump() +{ + register int n; + + switch(position){ + default: + puts("Nothing happens."); + return(-1); + + case 242: + position = 133; + break; + case 214: + case 215: + case 162: + case 159: + position = 145; + break; + case 232: + position = 275; + break; + case 3: + position = 1; + break; + case 172: + position = 201; + } + puts("Ahhhhhhh..."); + injuries[12] = injuries[8] = injuries[7] = injuries[6] = 1; + for (n=0; n < NUMOFOBJECTS; n++) + if (testbit(inven,n)){ + clearbit(inven,n); + setbit(location[position].objects,n); + } + carrying = 0; + encumber = 0; + return(0); +} + +bury() +{ + int value; + + if (testbit(inven,SHOVEL)){ + while(wordtype[++wordnumber] != OBJECT && wordtype[wordnumber] != NOUNS && wordnumber < wordcount); + value = wordvalue[wordnumber]; + if (wordtype[wordnumber] == NOUNS && (testbit(location[position].objects,value) || value == BODY)) + switch(value){ + case BODY: + wordtype[wordnumber] = OBJECT; + if (testbit(inven,MAID) || testbit(location[position].objects,MAID)) + value = MAID; + if (testbit(inven,DEADWOOD) || testbit(location[position].objects,DEADWOOD)) + value = DEADWOOD; + if (testbit(inven,DEADGOD) || testbit(location[position].objects,DEADGOD)) + value = DEADGOD; + if (testbit(inven,DEADTIME) || testbit(location[position].objects,DEADTIME)) + value = DEADTIME; + if (testbit(inven,DEADNATIVE) || testbit(location[position].objects,DEADNATIVE)) + value = DEADNATIVE; + break; + + case NATIVE: + case NORMGOD: + puts("She screams as you wrestle her into the hole."); + case TIMER: + power += 7; + ego -= 10; + case AMULET: + case MEDALION: + case TALISMAN: + wordtype[wordnumber] = OBJECT; + break; + + default: + puts("Wha..?"); + } + if (wordtype[wordnumber] == OBJECT && position > 88 && (testbit(inven,value) || testbit(location[position].objects,value))){ + puts("Buried."); + if (testbit(inven,value)){ + clearbit(inven,value); + carrying -= objwt[value]; + encumber -= objcumber[value]; + } + clearbit(location[position].objects,value); + switch(value){ + case MAID: + case DEADWOOD: + case DEADNATIVE: + case DEADTIME: + case DEADGOD: + ego += 2; + printf("The %s should rest easier now.\n",objsht[value]); + } + } + else + puts("It doesn't seem to work."); + } + else + puts("You aren't holding a shovel."); +} + +drink() +{ + register int n; + + if (testbit(inven,POTION)){ + puts("The cool liquid runs down your throat but turns to fire and you choke."); + puts("The heat reaches your limbs and tingles your spirit. You feel like falling"); + puts("asleep."); + clearbit(inven, POTION); + WEIGHT = MAXWEIGHT; + CUMBER = MAXCUMBER; + for (n=0; n < NUMOFINJURIES; n++) + injuries[n] = 0; + Time++; + zzz(); + } + else + puts("I'm not thirsty."); +} + +shoot() +{ + int firstnumber, value; + register int n; + + if (!testbit(inven,LASER)) + puts("You aren't holding a blaster."); + else { + firstnumber = wordnumber; + while(wordtype[++wordnumber] == ADJS); + while(wordnumber<=wordcount && wordtype[wordnumber] == OBJECT){ + value = wordvalue[wordnumber]; + printf("%s:\n", objsht[value]); + for (n=0; objsht[value][n]; n++); + if (testbit(location[position].objects,value)){ + clearbit(location[position].objects,value); + Time++; + printf("The %s explode%s\n",objsht[value],(objsht[value][n-1]=='s' ? (objsht[value][n-2]=='s' ? "s." : ".") : "s.")); + if (value == BOMB) + die(); + } + else + printf("I dont see any %s around here.\n", objsht[value]); + if (wordnumber < wordcount - 1 && wordvalue[++wordnumber] == AND) + wordnumber++; + else + return(firstnumber); + } + /* special cases with their own return()'s */ + + if (wordnumber <= wordcount && wordtype[wordnumber] == NOUNS){ + Time++; + switch(wordvalue[wordnumber]){ + + case DOOR: + switch(position){ + case 189: + case 231: + puts("The door is unhinged."); + location[189].north = 231; + location[231].south = 189; + whichway(location[position]); + break; + case 30: + puts("The wooden door splinters."); + location[30].west = 25; + whichway(location[position]); + break; + case 31: + puts("The laser blast has no effect on the door."); + break; + case 20: + puts("The blast hits the door and it explodes into flame. The magnesium burns"); + puts("so rapidly that we have no chance to escape."); + die(); + default: + puts("Nothing happens."); + } + break; + + case NORMGOD: + if (testbit(location[position].objects,BATHGOD)){ + puts("The goddess is hit in the chest and splashes back against the rocks."); + puts("Dark blood oozes from the charred blast hole. Her naked body floats in the"); + puts("pools and then off downstream."); + clearbit(location[position].objects,BATHGOD); + setbit(location[180].objects,DEADGOD); + power += 5; + ego -= 10; + notes[JINXED]++; + } else if (testbit(location[position].objects,NORMGOD)){ + puts("The blast catches the goddess in the stomach, knocking her to the ground."); + puts("She writhes in the dirt as the agony of death taunts her."); + puts("She has stopped moving."); + clearbit(location[position].objects,NORMGOD); + setbit(location[position].objects,DEADGOD); + power += 5; + ego -= 10; + notes[JINXED]++; + if (wintime) + live(); + break; + } else + puts("I don't see any goddess around here."); + break; + + case TIMER: + if (testbit(location[position].objects,TIMER)){ + puts("The old man slumps over the bar."); + power++; + ego -= 2; + notes[JINXED]++; + clearbit(location[position].objects,TIMER); + setbit(location[position].objects,DEADTIME); + } + else puts("What old timer?"); + break; + case MAN: + if (testbit(location[position].objects,MAN)){ + puts("The man falls to the ground with blood pouring all over his white suit."); + puts("Your fantasy is over."); + die(); + } + else puts("What man?"); + break; + case NATIVE: + if (testbit(location[position].objects,NATIVE)){ + puts("The girl is blown backwards several feet and lies in a pool of blood."); + clearbit(location[position].objects,NATIVE); + setbit(location[position].objects,DEADNATIVE); + power += 5; + ego -= 2; + notes[JINXED]++; + } else puts("There is no girl here."); + break; + case -1: + puts("Shoot what?"); + break; + + default: + printf("You can't shoot the %s.\n",objsht[wordvalue[wordnumber]]); + } + } + else puts("You must be a looney."); + } + return(firstnumber); +} diff --git a/games/battlestar/com4.c b/games/battlestar/com4.c new file mode 100644 index 0000000..42c8881 --- /dev/null +++ b/games/battlestar/com4.c @@ -0,0 +1,349 @@ +/* + * Copyright (c) 1983 Regents of the University of California, + * All rights reserved. Redistribution permitted subject to + * the terms of the Berkeley Software License Agreement. + */ + +#if !defined(lint) && !defined(pdp11) +static char sccsid[] = "@(#)com4.c 1.3.1 1996/10/26"; +#endif + +#include "externs.h" + +take(from) +unsigned int from[]; +{ + int firstnumber, heavy, bulky, value; + register int n; + + firstnumber = wordnumber; + if (wordnumber < wordcount && wordvalue[wordnumber+1] == OFF){ + wordnumber++; + wordvalue[wordnumber] = TAKEOFF; + return(cypher()); + } + else { + while(wordtype[++wordnumber] == ADJS); + while(wordnumber<=wordcount && wordtype[wordnumber] == OBJECT){ + value = wordvalue[wordnumber]; + printf("%s:\n", objsht[value]); + for (n=0; objsht[value][n]; n++); + heavy = (carrying + objwt[value]) <= WEIGHT; + bulky = (encumber + objcumber[value]) <= CUMBER; + if ((testbit(from,value) || wiz || tempwiz) && heavy && bulky && !testbit(inven,value)){ + setbit(inven,value); + carrying += objwt[value]; + encumber += objcumber[value]; + Time++; + if (testbit(from,value)) + printf("Taken.\n"); + else + printf("Zap! Taken from thin air.\n"); + clearbit(from,value); + if (value == MEDALION) + win--; + } + else if (testbit(inven,value)) + printf("You're already holding%s%s.\n", (objsht[value][n-1] == 's' ? " " : " a "),objsht[value]); + else if (!heavy) + printf("The %s %s too heavy.\n", objsht[value],(objsht[value][n-1] == 's' ? "are" : "is")); + else if (!bulky) + printf("The %s %s too cumbersome to hold.\n", objsht[value],(objsht[value][n-1] == 's' ? "are" : "is")); + else + printf("I dont see any %s around here.\n", objsht[value]); + if (wordnumber < wordcount -1 && wordvalue[++wordnumber] == AND) + wordnumber++; + else + return(firstnumber); + } + } + /* special cases with their own return()'s */ + + if (wordnumber <= wordcount && wordtype[wordnumber] == NOUNS) + switch(wordvalue[wordnumber]){ + + case SWORD: + if (testbit(from, SWORD)){ + wordtype[wordnumber--] = OBJECT; + return(take(from)); + } + if (testbit(from, TWO_HANDED)){ + wordvalue[wordnumber] = TWO_HANDED; + wordtype[wordnumber--] = OBJECT; + return(take(from)); + } + wordvalue[wordnumber] = BROAD; + wordtype[wordnumber--] = OBJECT; + return(take(from)); + + case BODY: + if (testbit(from,MAID)){ + wordvalue[wordnumber] = MAID; + wordtype[wordnumber--] = OBJECT; + return(take(from)); + } + else if (testbit(from,DEADWOOD)){ + wordvalue[wordnumber] = DEADWOOD; + wordtype[wordnumber--] = OBJECT; + return(take(from)); + } + else if (testbit(from,DEADNATIVE)){ + wordvalue[wordnumber] = DEADNATIVE; + wordtype[wordnumber--] = OBJECT; + return(take(from)); + } + else if (testbit(from,DEADGOD)){ + wordvalue[wordnumber] = DEADGOD; + wordtype[wordnumber--] = OBJECT; + return(take(from)); + } + else { + wordvalue[wordnumber] = DEADTIME; + wordtype[wordnumber--] = OBJECT; + return(take(from)); + } + break; + + case AMULET: + if (testbit(location[position].objects,AMULET)){ + puts("The amulet is warm to the touch, and its beauty catches your breath."); + puts("A mist falls over your eyes, but then it is gone. Sounds seem clearer"); + puts("and sharper but far away as if in a dream. The sound of purling water reaches"); + puts("you from afar. The mist falls again, and your heart leaps in horror. The gold"); + puts("freezes your hands and fathomless darkness engulfs your soul."); + } + wordtype[wordnumber--] = OBJECT; + return(take(from)); + + case MEDALION: + if (testbit(location[position].objects, MEDALION)){ + puts("The medallion is warm, and it rekindles your spirit with the warmth of life."); + puts("Your amulet begins to glow as the medallion is brought near to it, and together\nthey radiate."); + } + wordtype[wordnumber--] = OBJECT; + return(take(from)); + + case TALISMAN: + if (testbit(location[position].objects,TALISMAN)){ + puts("The talisman is cold to the touch, and it sends a chill down your spine."); + } + wordtype[wordnumber--] = OBJECT; + return(take(from)); + + case NORMGOD: + if (testbit(location[position].objects,BATHGOD) && (testbit(wear,AMULET) || testbit(inven,AMULET))){ + puts("She offers a delicate hand, and you help her out of the sparkling springs."); + puts("Water droplets like liquid silver bedew her golden skin, but when they part"); + puts("from her, they fall as teardrops. She wraps a single cloth around her and"); + puts("ties it at the waist. Around her neck hangs a golden amulet."); + puts("She bids you to follow her."); + pleasure++; + followgod = Time; + clearbit(location[position].objects,BATHGOD); + } else if (!testbit(location[position].objects,BATHGOD)) + puts("You're in no position to take her."); + else + puts("She moves away from you."); + break; + + default: + puts("It doesn't seem to work."); + } + else + puts("You've got to be kidding."); + return(firstnumber); +} + +throw(name) + char *name; +{ + int n; + int deposit = 0; + int first, value; + + first = wordnumber; + if (drop(name) != -1){ + switch(wordvalue[wordnumber]){ + + case AHEAD: + deposit = ahead; + break; + + case BACK: + deposit = back; + break; + + case LEFT: + deposit = left; + break; + + case RIGHT: + deposit = right; + break; + + case UP: + deposit = location[position].up * (location[position].access || position == FINAL); + break; + + case DOWN: + deposit = location[position].down; + break; + } + wordnumber = first; + while (wordtype[++wordnumber] == ADJS); + while (wordnumber <= wordcount){ + value = wordvalue[wordnumber]; + if (deposit && testbit(location[position].objects,value)){ + clearbit(location[position].objects,value); + if (value != GRENADE) + setbit(location[deposit].objects,value); + else{ + puts("A thundering explosion nearby sends up a cloud of smoke and shrapnel."); + for (n = 0; n < NUMOFWORDS; n ++) + location[deposit].objects[n] = 0; + setbit(location[deposit].objects,CHAR); + } + if (value == ROPE && position == FINAL) + location[position].access = 1; + switch(deposit){ + case 189: + case 231: + puts("The stone door is unhinged."); + location[189].north = 231; + location[231].south = 189; + break; + case 30: + puts("The wooden door is blown open."); + location[30].west = 25; + break; + case 31: + puts("The door is not damaged."); + } + } + else if (value == GRENADE && testbit(location[position].objects,value)){ + puts("You are blown into shreds when your grenade explodes."); + die(); + } + if (wordnumber < wordcount - 1 && wordvalue[++wordnumber] == AND) + wordnumber++; + else + return(first); + } + return(first); + } + return(first); +} + +drop(name) +char *name; +{ + + int firstnumber, value; + + firstnumber = wordnumber; + while (wordtype[++wordnumber] == ADJS) + ; + while (wordnumber<=wordcount && (wordtype[wordnumber] == OBJECT || wordtype[wordnumber] == NOUNS)) { + value = wordvalue[wordnumber]; + printf("%s:\n", objsht[value]); + if (testbit(inven,value)){ + clearbit(inven,value); + carrying -= objwt[value]; + encumber -= objcumber[value]; + if (value == BOMB){ + puts("The bomb explodes. A blinding white light and immense concussion obliterate us."); + die(); + } + if (value != AMULET && value != MEDALION && value != TALISMAN) + setbit(location[position].objects,value); + else + tempwiz = 0; + Time++; + if (*name == 'K') + puts("Drop kicked."); + else + printf("%s.\n", name); + } + else { + if (*name != 'K') { + printf("You aren't holding the %s.\n", objsht[value]); + if (testbit(location[position].objects,value)) { + if (*name == 'T') + puts("Kicked instead."); + else if (*name == 'G') + puts("Given anyway."); + } + } else + puts("Kicked."); + } + if (wordnumber < wordcount - 1 && wordvalue[++wordnumber] == AND) + wordnumber++; + else + return(firstnumber); + } + puts("Do what?"); + return(-1); +} + +takeoff() +{ + wordnumber = take(wear); + return(drop("Dropped")); +} + +puton() +{ + wordnumber = take(location[position].objects); + return(wearit()); +} + +eat() +{ + register int n; + int firstnumber, value; + + firstnumber = wordnumber; + while(wordtype[++wordnumber] == ADJS); + while(wordnumber <= wordcount){ + value = wordvalue[wordnumber]; + for (n=0; objsht[value][n]; n++); + switch(value){ + + case -1: + puts("Eat what?"); + return(firstnumber); + + default: + printf("You can't eat%s%s!\n",(objsht[value][n-1] == 's' ? " " : " a "),objsht[value]); + return(firstnumber); + + case PAPAYAS: + case PINEAPPLE: + case KIWI: + case COCONUTS: /* eatable things */ + case MANGO: + + printf("%s:\n",objsht[value]); + if (testbit(inven,value) && Time > ate - CYCLE && testbit(inven,KNIFE)){ + clearbit(inven,value); + carrying -= objwt[value]; + encumber -= objcumber[value]; + ate = max(Time,ate) + CYCLE/3; + snooze += CYCLE/10; + Time++; + puts("Eaten. You can explore a little longer now."); + } + else if (Time < ate - CYCLE) + puts("You're stuffed."); + else if (!testbit(inven,KNIFE)) + puts("You need a knife."); + else + printf("You aren't holding the %s.\n", objsht[value]); + if (wordnumber < wordcount - 1 && wordvalue[++wordnumber] == AND) + wordnumber++; + else + return(firstnumber); + } /* end switch */ + } /* end while */ + return(firstnumber); +} diff --git a/games/battlestar/com5.c b/games/battlestar/com5.c new file mode 100644 index 0000000..298cd58 --- /dev/null +++ b/games/battlestar/com5.c @@ -0,0 +1,297 @@ +/* + * Copyright (c) 1983 Regents of the University of California, + * All rights reserved. Redistribution permitted subject to + * the terms of the Berkeley Software License Agreement. + */ + +#if !defined(lint) && !defined(pdp11) +static char sccsid[] = "@(#)com5.c 1.3.1 1996/10/26"; +#endif + +#include "externs.h" + +kiss() +{ + while (wordtype[++wordnumber] != NOUNS && wordnumber <= wordcount); + if (wordtype[wordnumber] == NOUNS && testbit(location[position].objects,wordvalue[wordnumber])){ + pleasure++; + printf("Kissed.\n"); + switch (wordvalue[wordnumber]){ + case NORMGOD: + switch(godready++){ + case 0: + puts("She squirms and avoids your advances."); + break; + case 1: + puts("She is coming around; she didn't fight it as much."); + break; + case 2: + puts("She's begining to like it."); + break; + default: + puts("She's gone limp."); + + } + break; + case NATIVE: + puts("The lips are warm and her body robust. She pulls you down to the ground."); + break; + case TIMER: + puts("The old man blushes."); + break; + case MAN: + puts("The dwarf punches you in the kneecap."); + break; + default: + pleasure--; + } + } + else puts("I'd prefer not to."); +} + +love() +{ + register int n; + + while (wordtype[++wordnumber] != NOUNS && wordnumber <= wordcount); + if (wordtype[wordnumber] == NOUNS && testbit(location[position].objects,wordvalue[wordnumber])){ + if (wordvalue[wordnumber] == NORMGOD && !loved) + if (godready >= 2){ + puts("She cuddles up to you, and her mouth starts to work:\n'That was my sister's amulet. The lovely goddess, Purl, was she. The Empire\ncaptured her just after the Darkness came. My other sister, Vert, was killed\nby the Dark Lord himself. He took her amulet and warped its power.\nYour quest was foretold by my father before he died, but to get the Dark Lord's\namulet you must use cunning and skill. I will leave you my amulet."); + puts("which you may use as you wish. As for me, I am the last goddess of the\nwaters. My father was the Island King, and the rule is rightfully mine.'\n\nShe pulls the throne out into a large bed."); + power++; + pleasure += 15; + ego++; + if (card(injuries, NUMOFINJURIES)){ + puts("Her kisses revive you; your wounds are healed.\n"); + for (n=0; n < NUMOFINJURIES; n++) + injuries[n] = 0; + WEIGHT = MAXWEIGHT; + CUMBER = MAXCUMBER; + } + printf("Goddess:\n"); + if (!loved) + setbit(location[position].objects,MEDALION); + loved = 1; + Time += 10; + zzz(); + } + else { + puts("You wish!"); + return; + } + if (wordvalue[wordnumber] == NATIVE){ + puts("The girl is easy prey. She peals off her sarong and indulges you."); + power++; + pleasure += 5; + printf("Girl:\n"); + Time += 10; + zzz(); + } + printf("Loved.\n"); + } + else puts("I't doesn't seem to work."); +} + +zzz() +{ + int oldtime; + register int n; + + oldtime = Time; + if ((snooze - Time) < (0.75 * CYCLE)){ + Time += 0.75 * CYCLE - (snooze - Time); + printf(""); + for (n = 0; n < Time - oldtime; n++) + printf("."); + printf("\n"); + snooze += 3 * (Time - oldtime); + if (notes[LAUNCHED]){ + fuel -= (Time - oldtime); + if (location[position].down){ + position = location[position].down; + crash(); + } + else + notes[LAUNCHED] = 0; + } + if (OUTSIDE && rnd(100) < 50){ + puts("You are awakened abruptly by the sound of someone nearby."); + switch(rnd(4)){ + case 0: + if (ucard(inven)){ + n = rnd(NUMOFOBJECTS); + while(!testbit(inven,n)) + n = rnd(NUMOFOBJECTS); + clearbit(inven,n); + if (n != AMULET && n != MEDALION && n != TALISMAN) + setbit(location[position].objects,n); + carrying -= objwt[n]; + encumber -= objcumber[n]; + } + puts("A fiendish little Elf is stealing your treasures!"); + fight(ELF,10); + break; + case 1: + setbit(location[position].objects,DEADWOOD); + break; + case 2: + setbit(location[position].objects,HALBERD); + break; + default: + break; + } + } + } + else + return(0); + return(1); +} + +chime() +{ + if ((Time / CYCLE + 1) % 2 && OUTSIDE) + switch((Time % CYCLE)/(CYCLE / 7)){ + case 0: + puts("It is just after sunrise."); + break; + case 1: + puts("It is early morning."); + break; + case 2: + puts("It is late morning."); + break; + case 3: + puts("It is near noon."); + break; + case 4: + puts("It is early afternoon."); + break; + case 5: + puts("It is late afternoon."); + break; + case 6: + puts("It is near sunset."); + break; + } + else if (OUTSIDE) + switch((Time % CYCLE)/(CYCLE / 7)){ + case 0: + puts("It is just after sunset."); + break; + case 1: + puts("It is early evening."); + break; + case 2: + puts("The evening is getting old."); + break; + case 3: + puts("It is near midnight."); + break; + case 4: + puts("These are the wee hours of the morning."); + break; + case 5: + puts("The night is waning."); + break; + case 6: + puts("It is almost morning."); + break; + } + else + puts("I can't tell the time in here."); +} + +give() +{ + int obj = -1, result = -1, person = 0, firstnumber, last1, last2; + + firstnumber = wordnumber; + while (wordtype[++wordnumber] != OBJECT && wordvalue[wordnumber] != AMULET && wordvalue[wordnumber] != MEDALION && wordvalue[wordnumber] != TALISMAN && wordnumber <= wordcount); + if (wordnumber <= wordcount){ + obj = wordvalue[wordnumber]; + if (obj == EVERYTHING) + wordtype[wordnumber] = -1; + last1 = wordnumber; + } + wordnumber = firstnumber; + while ((wordtype[++wordnumber] != NOUNS || wordvalue[wordnumber] == obj) && wordnumber <= wordcount); + if (wordtype[wordnumber] == NOUNS){ + person = wordvalue[wordnumber]; + last2 = wordnumber; + } + wordnumber = last1 - 1; + if (person && testbit(location[position].objects,person)) + if (person == NORMGOD && godready < 2 && !(obj == RING || obj == BRACELET)) + puts("The goddess won't look at you."); + else + result = drop("Given"); + else { + puts("I don't think that is possible."); + return(0); + } + if (result != -1 && (testbit(location[position].objects,obj) || obj == AMULET || obj == MEDALION || obj == TALISMAN)){ + clearbit(location[position].objects,obj); + Time++; + ego++; + switch(person){ + case NATIVE: + puts("She accepts it shyly."); + ego += 2; + break; + case NORMGOD: + if (obj == RING || obj == BRACELET){ + puts("She takes the charm and puts it on. A little kiss on the cheek is"); + puts("your reward."); + ego += 5; + godready += 3; + } + if (obj == AMULET || obj == MEDALION || obj == TALISMAN){ + win++; + ego += 5; + power -= 5; + if (win >= 3){ + puts("The powers of the earth are now legitimate. You have destroyed the Darkness"); + puts("and restored the goddess to her thrown. The entire island celebrates with"); + puts("dancing and spring feasts. As a measure of her gratitude, the goddess weds you"); + puts("in the late summer and crowns you Prince Liverwort, Lord of Fungus."); + puts("\nBut, as the year wears on and autumn comes along, you become restless and"); + puts("yearn for adventure. The goddess, too, realizes that the marriage can't last."); + puts("She becomes bored and takes several more natives as husbands. One evening,"); + puts("after having been out drinking with the girls, she kicks the throne particulary"); + puts("hard and wakes you up. (If you want to win this game, you're going to have to\nshoot her!)"); + clearbit(location[position].objects,MEDALION); + wintime = Time; + } + } + break; + case TIMER: + if (obj == COINS){ + puts("He fingers the coins for a moment and then looks up agape. `Kind you are and"); + puts("I mean to repay you as best I can.' Grabbing a pencil and cocktail napkin...\n"); + printf( "+-----------------------------------------------------------------------------+\n"); + printf( "| xxxxxxxx\\ |\n"); + printf( "| xxxxx\\ CLIFFS |\n"); + printf( "| FOREST xxx\\ |\n"); + printf( "| \\\\ x\\ OCEAN |\n"); + printf( "| || x\\ |\n"); + printf( "| || ROAD x\\ |\n"); + printf( "| || x\\ |\n"); + printf( "| SECRET || ......... |\n"); + printf( "| - + - || ........ |\n"); + printf( "| ENTRANCE || ... BEACH |\n"); + printf( "| || ... E |\n"); + printf( "| || ... | |\n"); + printf( "| // ... N <-- + --- S |\n"); + printf( "| PALM GROVE // ... | |\n"); + printf( "| // ... W |\n"); + printf( "+-----------------------------------------------------------------------------+\n"); + puts("\n`This map shows a secret entrance to the catacombs."); + puts("You will know when you arrive because I left an old pair of shoes there.'"); + } + break; + } + } + wordnumber = max(last1,last2); + return(firstnumber); +} diff --git a/games/battlestar/com6.c b/games/battlestar/com6.c new file mode 100644 index 0000000..1b1501e --- /dev/null +++ b/games/battlestar/com6.c @@ -0,0 +1,182 @@ +/* + * Copyright (c) 1983 Regents of the University of California, + * All rights reserved. Redistribution permitted subject to + * the terms of the Berkeley Software License Agreement. + */ + +#if !defined(lint) && !defined(pdp11) +static char sccsid[] = "@(#)com6.c 1.3.2 1999/10/25"; +#endif + +#include "externs.h" + +launch() +{ + if (testbit(location[position].objects,VIPER) && !notes[CANTLAUNCH]){ + if (fuel > 4){ + clearbit(location[position].objects,VIPER); + position = location[position].up; + notes[LAUNCHED] = 1; + Time++; + fuel -= 4; + puts("You climb into the viper and prepare for launch."); + puts("With a touch of your thumb the turbo engines ignite, thrusting you back into\nyour seat."); + return(1); + } + else + puts("Not enough fuel to launch."); + } + else + puts("Can't launch."); + return(0); +} + +land() +{ + if (notes[LAUNCHED] && testbit(location[position].objects,LAND) && location[position].down){ + notes[LAUNCHED] = 0; + position = location[position].down; + setbit(location[position].objects,VIPER); + fuel -= 2; + Time++; + puts("You are down."); + return(1); + } + else + puts("You can't land here."); + return(0); +} + +die() /* endgame */ +{ + printf("bye.\nYour rating was %s.\n", rate()); + post(' '); + exit(0); +} + +live() +{ + puts("\nYou win!"); + post('!'); + exit(0); +} + +#include + +post(ch) +char ch; +{ + FILE *fp; + struct timeval tv; + char *date; + sigset_t s, oset; + + sigemptyset(&s); + sigaddset(&s, SIGINT); + (void)sigprocmask(SIG_BLOCK, &s, &oset); + gettimeofday(&tv, (struct timezone *)0); + date = ctime(&tv.tv_sec); + date[24] = '\0'; + if (fp = fopen(logfile,"a")) { + fprintf(fp, "%s %8s %c%20s", date, uname, ch, rate()); + if (wiz) + fprintf(fp, " wizard\n"); + else if (tempwiz) + fprintf(fp, " WIZARD!\n"); + else + fprintf(fp, "\n"); + } else + perror(logfile); + (void)sigprocmask(SIG_SETMASK, &oset, NULL); +} + +char * +rate() +{ + int score; + + score = max(max(pleasure,power),ego); + if (score == pleasure){ + if (score < 5) + return("novice"); + else if (score < 20) + return("junior voyeur"); + else if (score < 35) + return("Don Juan"); + else return("Marquis De Sade"); + } + else if (score == power){ + if (score < 5) + return("serf"); + else if (score < 8) + return("Samurai"); + else if (score < 13) + return("Klingon"); + else if (score < 22) + return("Darth Vader"); + else return("Sauron the Great"); + } + else{ + if (score < 5) + return("Polyanna"); + else if (score < 10) + return("philanthropist"); + else if (score < 20) + return("Tattoo"); + else return("Mr. Roarke"); + } +} + +drive() +{ + if (testbit(location[position].objects,CAR)){ + puts("You hop in the car and turn the key. There is a perceptible grating noise,"); + puts("and an explosion knocks you unconscious..."); + clearbit(location[position].objects,CAR); + setbit(location[position].objects,CRASH); + injuries[5] = injuries[6] = injuries[7] = injuries[8] = 1; + Time += 15; + zzz(); + return(0); + } + else + puts("There is nothing to drive here."); + return(-1); +} + +ride() +{ + if (testbit(location[position].objects,HORSE)){ + puts("You climb onto the stallion and kick it in the guts. The stupid steed launches"); + puts("forward through bush and fern. You are thrown and the horse gallups off."); + clearbit(location[position].objects,HORSE); + while (!(position = rnd(NUMOFROOMS+1)) || !OUTSIDE || !beenthere[position] || location[position].flyhere); + setbit(location[position].objects,HORSE); + if (location[position].north) + position = location[position].north; + else if (location[position].south) + position = location[position].south; + else if (location[position].east) + position = location[position].east; + else + position = location[position].west; + return(0); + } + else puts("There is no horse here."); + return(-1); +} + +light() /* synonyms = {strike, smoke} */ +{ /* for matches, cigars */ + if (testbit(inven,MATCHES) && matchcount){ + puts("Your match splutters to life."); + Time++; + matchlight = 1; + matchcount--; + if (position == 217){ + puts("The whole bungalow explodes with an intense blast."); + die(); + } + } + else puts("You're out of matches."); +} diff --git a/games/battlestar/com7.c b/games/battlestar/com7.c new file mode 100644 index 0000000..d82901b --- /dev/null +++ b/games/battlestar/com7.c @@ -0,0 +1,241 @@ +/* + * Copyright (c) 1983 Regents of the University of California, + * All rights reserved. Redistribution permitted subject to + * the terms of the Berkeley Software License Agreement. + */ + +#if !defined(lint) && !defined(pdp11) +static char sccsid[] = "@(#)com7.c 1.3.1 1996/10/26"; +#endif + +#include "externs.h" + +fight(enemy,strength) +int enemy,strength; +{ + int lifeline = 0; + int hurt; + char auxbuf[LINELENGTH]; + char *next; + int i; + int exhaustion; + +fighton: + Time++; + snooze -= 5; + if (snooze > Time) + exhaustion = CYCLE/(snooze - Time); + else { + puts("You collapse exhausted, and he pulverizes your skull."); + die(); + } + if (snooze - Time < 20) + puts("You look tired! I hope you're able to fight."); + next = getcom(auxbuf, LINELENGTH, "-: ", 0); + for (i=0; next && i < 10; i++) + next = getword(next, words[i], -1); + parse(); + switch(wordvalue[wordnumber]){ + + case KILL: + case SMITE: + if (testbit(inven,TWO_HANDED)) + hurt = rnd(70) - 2 * card(injuries,NUMOFINJURIES) - ucard(wear) - exhaustion; + else if (testbit(inven,SWORD) || testbit(inven, BROAD)) + hurt = rnd(50)%(WEIGHT-carrying)-card(injuries,NUMOFINJURIES)-encumber - exhaustion; + else if (testbit(inven,KNIFE) || testbit(inven,MALLET) || testbit(inven,CHAIN) || testbit(inven,MACE) || testbit(inven,HALBERD)) + hurt = rnd(15) - card(injuries,NUMOFINJURIES) - exhaustion; + else + hurt = rnd(7) - encumber; + if (hurt < 5) + switch(rnd(3)){ + + case 0: + puts("You swung wide and missed."); + break; + case 1: + puts("He checked your blow. CLASH! CLANG!"); + break; + case 2: + puts("His filthy tunic hangs by one less thread."); + break; + } + else if (hurt < 10){ + switch(rnd(3)){ + case 0: + puts("He's bleeding."); + break; + case 1: + puts("A trickle of blood runs down his face."); + break; + case 2: + puts("A huge purple bruise is forming on the side of his face."); + break; + } + lifeline++; + } + else if (hurt < 20){ + switch(rnd(3)){ + case 0: + puts("He staggers back quavering."); + break; + case 1: + puts("He jumps back with his hand over the wound."); + break; + case 2: + puts("His shirt falls open with a swath across the chest."); + break; + } + lifeline += 5; + } + else if (hurt < 30){ + switch(rnd(3)){ + case 0: + printf("A bloody gash opens up on his %s side.\n",(rnd(2) ? "left" : "right")); + break; + case 1: + puts("The steel bites home and scrapes along his ribs."); + break; + case 2: + puts("You pierce him, and his breath hisses through clenched teeth."); + break; + } + lifeline += 10; + } + else if (hurt < 40){ + switch(rnd(3)){ + case 0: + puts("You smite him to the ground."); + if (strength - lifeline > 20) + puts("But in a flurry of steel he regains his feet!"); + break; + case 1: + puts("The force of your blow sends him to his knees."); + puts("His arm swings lifeless at his side."); + break; + case 2: + puts("Clutching his blood drenched shirt, he collapses stunned."); + break; + } + lifeline += 20; + } + else { + switch(rnd(3)){ + case 0: + puts("His ribs crack under your powerful swing, flooding his lungs with blood."); + break; + case 1: + puts("You shatter his upheld arm in a spray of blood. The blade continues deep"); + puts("into his back, severing the spinal cord."); + lifeline += 25; + break; + case 2: + puts("With a mighty lunge the steel slides in, and gasping, he falls to the ground."); + lifeline += 25; + break; + } + lifeline += 30; + } + break; + + case BACK: + if (enemy == DARK && lifeline > strength * 0.33){ + puts("He throws you back against the rock and pummels your face."); + if (testbit(inven,AMULET) || testbit(wear,AMULET)){ + printf("Lifting the amulet from you, "); + if (testbit(inven,MEDALION) || testbit(wear,MEDALION)){ + puts("his power grows and the walls of\nthe earth tremble."); + puts("When he touches the medallion, your chest explodes and the foundations of the\nearth collapse."); + puts("The planet is consumed by darkness."); + die(); + } + if (testbit(inven,AMULET)){ + clearbit(inven,AMULET); + carrying -= objwt[AMULET]; + encumber -= objcumber[AMULET]; + } + else + clearbit(wear,AMULET); + puts("he flees down the dark caverns."); + clearbit(location[position].objects,DARK); + injuries[SKULL] = 1; + followfight = Time; + return (0); + } + else{ + puts("I'm afraid you have been killed."); + die(); + } + } + else{ + puts("You escape stunned and disoriented from the fight."); + puts("A victorious bellow echoes from the battlescene."); + if (back && position != back) + move(back,BACK); + else if (ahead &&position != ahead) + move(ahead,AHEAD); + else if (left && position != left) + move(left,LEFT); + else if (right && position != right) + move(right,RIGHT); + else + move(location[position].down,AHEAD); + return(0); + } + + case SHOOT: + if (testbit(inven,LASER)){ + if (strength - lifeline <= 50){ + printf("The %s took a direct hit!\n",objsht[enemy]); + lifeline += 50; + } + else { + puts("With his bare hand he deflects the laser blast and whips the pistol from you!"); + clearbit(inven,LASER); + setbit(location[position].objects,LASER); + carrying -= objwt[LASER]; + encumber -= objcumber[LASER]; + } + } + else + puts("Unfortunately, you don't have a blaster handy."); + break; + + case DROP: + case DRAW: + cypher(); + Time--; + break; + + default: + puts("You don't have a chance, he is too quick."); + break; + + } + if (lifeline >= strength){ + printf("You have killed the %s.\n", objsht[enemy]); + if (enemy == ELF || enemy == DARK) + puts("A watery black smoke consumes his body and then vanishes with a peal of thunder!"); + clearbit(location[position].objects,enemy); + power += 2; + notes[JINXED]++; + return(0); + } + puts("He attacks..."); + /* some embellisments */ + hurt = rnd(NUMOFINJURIES) - (testbit(inven,SHIELD) != 0) - (testbit(wear,MAIL) != 0) - (testbit(wear,HELM) != 0); + hurt += (testbit(wear,AMULET) != 0) + (testbit(wear,MEDALION) != 0) + (testbit(wear,TALISMAN) != 0); + hurt = hurt < 0 ? 0 : hurt; + hurt = hurt >= NUMOFINJURIES ? NUMOFINJURIES -1 : hurt; + if (!injuries[hurt]){ + injuries[hurt] = 1; + printf("I'm afraid you have suffered %s.\n", ouch[hurt]); + } + else + puts("You emerge unscathed."); + if (injuries[SKULL] && injuries[INCISE] && injuries[NECK]){ + puts("I'm afraid you have suffered fatal injuries."); + die(); + } + goto fighton; +} diff --git a/games/battlestar/cypher.c b/games/battlestar/cypher.c new file mode 100644 index 0000000..b9fa021 --- /dev/null +++ b/games/battlestar/cypher.c @@ -0,0 +1,403 @@ +/* + * Copyright (c) 1983 Regents of the University of California, + * All rights reserved. Redistribution permitted subject to + * the terms of the Berkeley Software License Agreement. + */ + +#if !defined(lint) && !defined(pdp11) +static char sccsid[] = "@(#)cypher.c 1.3.1 1996/10/26"; +#endif + +#include "externs.h" + +cypher() +{ + register int n; + int junk; + int lflag = -1; + char buffer[10]; + + while (wordtype[wordnumber] == ADJS) + wordnumber++; + while (wordnumber <= wordcount) { + switch(wordvalue[wordnumber]) { + + case UP: + if (location[position].access || wiz || tempwiz) { + if (!location[position].access) + puts("Zap! A gust of wind lifts you up."); + if (!move(location[position].up, AHEAD)) + return(-1); + } else { + puts("There is no way up"); + return(-1); + } + lflag = 0; + break; + + case DOWN: + if (!move(location[position].down, AHEAD)) + return(-1); + lflag = 0; + break; + + case LEFT: + if (!move(left, LEFT)) + return(-1); + lflag = 0; + break; + + case RIGHT: + if (!move(right, RIGHT)) + return(-1); + lflag = 0; + break; + + case AHEAD: + if (!move(ahead, AHEAD)) + return(-1); + lflag = 0; + break; + + case BACK: + if (!move(back, BACK)) + return(-1); + lflag = 0; + break; + + case SHOOT: + if (wordnumber < wordcount && wordvalue[wordnumber+1] == EVERYTHING){ + for (n=0; n < NUMOFOBJECTS; n++) + if (testbit(location[position].objects,n) && *objsht[n]){ + wordvalue[wordnumber+1] = n; + wordnumber = shoot(); + } + wordnumber++; + wordnumber++; + } + else + shoot(); + break; + + case TAKE: + if (wordnumber < wordcount && wordvalue[wordnumber+1] == EVERYTHING){ + for (n=0; n < NUMOFOBJECTS; n++) + if (testbit(location[position].objects,n) && *objsht[n]){ + wordvalue[wordnumber+1] = n; + wordnumber = take(location[position].objects); + } + wordnumber++; + wordnumber++; + } + else + take(location[position].objects); + break; + + case DROP: + + if (wordnumber < wordcount && wordvalue[wordnumber+1] == EVERYTHING){ + for (n=0; n < NUMOFOBJECTS; n++) + if (testbit(inven,n)){ + wordvalue[wordnumber+1] = n; + wordnumber = drop("Dropped"); + } + wordnumber++; + wordnumber++; + } + else + drop("Dropped"); + break; + + + case KICK: + case THROW: + if (wordnumber < wordcount && wordvalue[wordnumber+1] == EVERYTHING){ + for (n=0; n < NUMOFOBJECTS; n++) + if (testbit(inven,n) || + testbit(location[position].objects, n) && *objsht[n]){ + wordvalue[wordnumber+1] = n; + wordnumber = throw(wordvalue[wordnumber] == KICK ? "Kicked" : "Thrown"); + } + wordnumber += 2; + } else + throw(wordvalue[wordnumber] == KICK ? "Kicked" : "Thrown"); + break; + + case TAKEOFF: + if (wordnumber < wordcount && wordvalue[wordnumber+1] == EVERYTHING){ + for (n=0; n < NUMOFOBJECTS; n++) + if (testbit(wear,n)){ + wordvalue[wordnumber+1] = n; + wordnumber = takeoff(); + } + wordnumber += 2; + } + else + takeoff(); + break; + + + case DRAW: + + if (wordnumber < wordcount && wordvalue[wordnumber+1] == EVERYTHING){ + for (n=0; n < NUMOFOBJECTS; n++) + if (testbit(wear,n)){ + wordvalue[wordnumber+1] = n; + wordnumber = draw(); + } + wordnumber += 2; + } + else + draw(); + break; + + + case PUTON: + + if (wordnumber < wordcount && wordvalue[wordnumber+1] == EVERYTHING){ + for (n=0; n < NUMOFOBJECTS; n++) + if (testbit(location[position].objects,n) && *objsht[n]){ + wordvalue[wordnumber+1] = n; + wordnumber = puton(); + } + wordnumber += 2; + } + else + puton(); + break; + + case WEARIT: + + if (wordnumber < wordcount && wordvalue[wordnumber+1] == EVERYTHING){ + for (n=0; n < NUMOFOBJECTS; n++) + if (testbit(inven,n)){ + wordvalue[wordnumber+1] = n; + wordnumber = wearit(); + } + wordnumber += 2; + } + else + wearit(); + break; + + + case EAT: + + if (wordnumber < wordcount && wordvalue[wordnumber+1] == EVERYTHING){ + for (n=0; n < NUMOFOBJECTS; n++) + if (testbit(inven,n)){ + wordvalue[wordnumber+1] = n; + wordnumber = eat(); + } + wordnumber += 2; + } + else + eat(); + break; + + + case PUT: + put(); + break; + + + case INVEN: + if (ucard(inven)){ + puts("You are holding:\n"); + for (n=0; n < NUMOFOBJECTS; n++) + if (testbit(inven,n)) + printf("\t%s\n", objsht[n]); + printf("\n= %d kilogram%s (%d%%)\n", carrying, (carrying == 1 ? "." : "s."),(WEIGHT ? carrying*100/WEIGHT : -1)); + printf("Your arms are %d%% full.\n",encumber*100/CUMBER); + } + else + puts("You aren't carrying anything."); + + if (ucard(wear)){ + puts("\nYou are wearing:\n"); + for (n=0; n < NUMOFOBJECTS; n++) + if (testbit(wear,n)) + printf("\t%s\n", objsht[n]); + } + else + puts("\nYou are stark naked."); + if (card(injuries,NUMOFINJURIES)){ + puts("\nYou have suffered:\n"); + for (n=0; n < NUMOFINJURIES; n++) + if (injuries[n]) + printf("\t%s\n",ouch[n]); + printf("\nYou can still carry up to %d kilogram%s\n",WEIGHT,(WEIGHT == 1 ? "." : "s.")); + } + else + puts("\nYou are in perfect health."); + break; + + case USE: + lflag = use(); + break; + + case LOOK: + if (!notes[CANTSEE] || testbit(inven,LAMPON) || testbit(location[position].objects,LAMPON) || matchlight){ + beenthere[position] = 2; + writedes(); + printobjs(); + if (matchlight){ + puts("\nYour match splutters out."); + matchlight = 0; + } + } else + puts("I can't see anything."); + return(-1); + break; + + case SU: + if (wiz || tempwiz){ + printf("\nRoom (was %d) = ", position); + fgets(buffer,10,stdin); + if (*buffer != '\n') + sscanf(buffer,"%d", &position); + printf("Time (was %d) = ",Time); + fgets(buffer,10,stdin); + if (*buffer != '\n') + sscanf(buffer,"%d", &Time); + printf("Fuel (was %d) = ",fuel); + fgets(buffer,10,stdin); + if (*buffer != '\n') + sscanf(buffer,"%d", &fuel); + printf("Torps (was %d) = ",torps); + fgets(buffer,10,stdin); + if (*buffer != '\n') + sscanf(buffer,"%d", &torps); + printf("CUMBER (was %d) = ",CUMBER); + fgets(buffer,10,stdin); + if (*buffer != '\n') + sscanf(buffer,"%d", &CUMBER); + printf("WEIGHT (was %d) = ",WEIGHT); + fgets(buffer,10,stdin); + if (*buffer != '\n') + sscanf(buffer,"%d",&WEIGHT); + printf("Clock (was %d) = ",clock); + fgets(buffer,10,stdin); + if (*buffer != '\n') + sscanf(buffer,"%d",&clock); + printf("Wizard (was %d, %d) = ",wiz, tempwiz); + fgets(buffer,10,stdin); + if (*buffer != '\n'){ + sscanf(buffer,"%d",&junk); + if (!junk) + tempwiz = wiz = 0; + } + printf("\nDONE.\n"); + return(0); + } + else + puts("You aren't a wizard."); + break; + + case SCORE: + printf("\tPLEASURE\tPOWER\t\tEGO\n"); + printf("\t%3d\t\t%3d\t\t%3d\n\n",pleasure,power,ego); + printf("This gives you the rating of %s in %d turns.\n",rate(),Time); + printf("You have visited %d out of %d rooms this run (%d%%).\n",card(beenthere,NUMOFROOMS),NUMOFROOMS,card(beenthere,NUMOFROOMS)*100/NUMOFROOMS); + break; + + case KNIFE: + case KILL: + murder(); + break; + + case UNDRESS: + case RAVAGE: + ravage(); + break; + + case SAVE: + save(); + break; + + case FOLLOW: + lflag = follow(); + break; + + case GIVE: + give(); + break; + + case KISS: + kiss(); + break; + + case LOVE: + love(); + break; + + case RIDE: + lflag = ride(); + break; + + case DRIVE: + lflag = drive(); + break; + + case LIGHT: + light(); + break; + + case LAUNCH: + if (!launch()) + return(-1); + else + lflag = 0; + break; + + case LANDIT: + if (!land()) + return(-1); + else + lflag = 0; + break; + + case TIME: + chime(); + break; + + case SLEEP: + zzz(); + break; + + case DIG: + dig(); + break; + + case JUMP: + lflag = jump(); + break; + + case BURY: + bury(); + break; + + case SWIM: + puts("Surf's up!"); + break; + + case DRINK: + drink(); + break; + + case QUIT: + die(); + + default: + puts("How's that?"); + return(-1); + break; + + + } + if (wordnumber < wordcount && *words[wordnumber++] == ',') + continue; + else return(lflag); + } + return(lflag); +} diff --git a/games/battlestar/dayfile.c b/games/battlestar/dayfile.c new file mode 100644 index 0000000..3cfa3e1 --- /dev/null +++ b/games/battlestar/dayfile.c @@ -0,0 +1,1180 @@ +/* + * Copyright (c) 1983 Regents of the University of California, + * All rights reserved. Redistribution permitted subject to + * the terms of the Berkeley Software License Agreement. + */ + +#if !defined(lint) && !defined(pdp11) +static char sccsid[] = "@(#)dayfile.c 1.2 4/24/85"; +#endif + +#include "externs.h" + +#define strstr(x) x + +struct room dayfile[] = { + { 0 }, + { strstr("You are in the main hangar."), + 5, 2, 9, 3, 3, 1, 0, 0, +strstr("This is a huge bay where many fighters and cargo craft lie. Alarms are \n\ +sounding and fighter pilots are running to their ships. Above is a gallery\n\ +overlooking the bay. The scream of turbo engines is coming from +. The rest\n\ +of the hangar is +. There is an exit +.*\n") }, + { strstr("This is the landing bay."), + 1, 0, 10, 0, 0, 0, 0, 0, +strstr("Ships are landing here, some heavily damaged. Enemy fighters continually\n\ +strafe this vulnerable port. The main hangar is +, *\n\ +There is an exit +.*\n") }, + { strstr("You are in the gallery."), + 4, 0, 0, 0, 0, 0, 1, 0, +strstr("From here a view of the entire landing bay reveals that our battlestar\n\ +is near destruction. Fires are spreading out of control and laser blasts\n\ +lick at the shadows. The control room is +. ***\n") }, + { strstr("You are in the control room."), + 0, 3, 0, 0, 0, 0, 5, 0, +strstr("Several frantic technicians are flipping switches wildly but otherwise\n\ +this room seems fairly deserted. A weapons locker has been left open.\n\ +A staircase leads down. * There is a way -. ** \n") }, + { strstr("This is the launch room."), + 6, 1, 7, 0, 4, 1, 0, 0, +strstr("From the launch tubes here fighters blast off into space. Only one is left,\n\ +and it is guarded by two fierce men. A staircase leads up from here.\n\ +There is a cluttered workbench +. From the main hangar come sounds of great\n\ +explosions. The main hangar is +. The viper launch tubes are to the -.*\n") }, + { strstr("You are at the workbench."), + 0, 5, 7, 0, 0, 0, 0, 0, +strstr("Strange and unwieldy tools are arranged here including a lunch box \n\ +and pneumatic wrenches and turbo sprocket rockets.*\n\ +The launch room is +. The remaining viper is +.*\n") }, + { strstr("You are in the viper launch tube."), + 0, 5, 0, 5, 32, 0, 0, 0, +strstr("The two guards are eyeing you warily! ****\n") }, + { strstr("This is a walk in closet."), + 22, 0, 0, 0, 0, 0, 0, 0, +strstr("A wardrobe of immense magnitude greets the eye. Furs and robes of kings\n\ +hang on rack after rack. Silken gowns, capes woven with spun gold, and \n\ +delicate synthetic fabrics are stowed here. The bedroom is +.***\n") }, + { strstr("You are in a wide hallway leading to the main hangar."), + 0, 0, 11, 1, 0, 0, 0, 0, +strstr("The walls and ceiling here have been blasted through in several places.\n\ +It looks as if quite a battle has been fought for possession of the landing bay\n\ +Gaping corpses litter the floor.** The hallway continues +.\n\ +The main hangar is +.\n") }, + { strstr("You are in a wide hallway leading to the landing bay."), + 0, 0, 12, 2, 0, 0, 0, 0, +strstr("Most of the men and supplies needed in the main hangar come through this\n\ +corridor, but the wounded are forced to use it too. It very dank and\n\ +crowded here, and the floor is slippery with blood.**\n\ +The hallway continues -. The landing bay is +.\n") }, + { strstr("The hallway is very congested with rubble here."), + 0, 0, 0, 9, 13, 1, 0, 0, +strstr("It is too choked with broken steel girders and other debris to continue\n\ +on much farther. Above, the ceiling has caved in and it is possible to \n\ +climb up. There is not much chance to go -, -, or -.\n\ +But the hallway seems clearer +.\n") }, + { strstr("A wide hallway and a more narrow walkway meet here."), + 14, 15, 0, 10, 0, 0, 0, 0, +strstr("The intersection is crowded with the many wounded who have come up\n\ +the wide hallway and continued +. The walkway is less crowded +.\n\ +The wide hallway goes *-.\n") }, + { strstr("You are in what was once an elegant stateroom."), + 16, 0, 0, 0, 0, 0, 11, 0, +strstr("Whoever lived in this stateroom, he and his female companion\n\ +were mercilessly slain in their sleep. Clothes, trinkets and personal\n\ +belongings are scattered all across the floor. Through a hole in the\n\ +collapsed floor I can see a hallway below. A door is +.***\n") }, + { strstr("You're at the entrance to the sick bay."), + 17, 12, 18, 0, 0, 0, 0, 0, +strstr("The wounded are entering the sick bay in loudly moaning files.\n\ +The walkway continues - and +. A doctor is motioning for you to \n\ +come to the -. *\n") }, + { strstr("You're in the walkway."), + 12, 19, 0, 0, 0, 0, 0, 0, +strstr("Most of the men and supplies were coming from the armory. The walkway\n\ +continues -. The armory is +.**\n") }, + { strstr("These are the executive suites of the battlestar."), + 20, 13, 21, 22, 23, 1, 24, 0, +strstr("Luxurious staterooms carpeted with crushed velvet and adorned with beaten\n\ +gold open onto this parlor. A wide staircase with ivory banisters leads\n\ +up or down. This parlor leads into a hallway +. The bridal suite is +.\n\ +Other rooms lie - and +.\n") }, + { strstr("You're in a long dimly lit hallway."), + 0, 14, 25, 0, 0, 0, 0, 0, +strstr("This part of the walkway is deserted. There is a dead end +. The\n\ +entrance to the sickbay is +. The walkway turns sharply -.*\n") }, + { strstr("This is the sick bay."), + 0, 0, 0, 14, 0, 0, 0, 0, +strstr("Sinister nurses with long needles and pitiful aim probe the depths of suffering\n\ +here. Only the mortally wounded receive medical attention on a battlestar,\n\ +but afterwards they are thrown into the incinerators along with the rest.**\n\ +Nothing but death and suffering +. The walkway is +.\n") }, + { strstr("You're in the armory."), + 15, 26, 0, 0, 0, 0, 0, 0, +strstr("An armed guard is stationed here 365 sectars a yarn to protect the magazine.\n\ +The walkway is +. The magazine is +.**\n") }, + { strstr("The hallway ends here at the presidential suite."), + 27, 16, 0, 0, 0, 0, 0, 0, +strstr("The door to this suite is made from solid magnesium, and the entryway is\n\ +inlaid with diamonds and fire opals. The door is ajar +. The hallway\n\ +goes -.**\n") }, + { strstr("This is the maid's utility room."), + 0, 0, 0, 16, 0, 0, 0, 0, +strstr("What a gruesome sight! The maid has been brutally drowned in a bucket of\n\ +Pine Sol and repeatedly stabbed in the back with a knife.***\n\ +The hallway is +.\n") }, + { strstr("This is a luxurious stateroom."), + 0, 8, 16, 0, 0, 0, 0, 0, +strstr("The floor is carpeted with a soft animal fur and the great wooden furniture\n\ +is inlaid with strips of platinum and gold. Electronic equipment built\n\ +into the walls and ceiling is flashing wildly. The floor shudders and\n\ +the sounds of dull explosions rumble though the room. From a window in\n\ +the wall + comes a view of darkest space. There is a small adjoining\n\ +room +, and a doorway +.*\n") }, + { strstr("You are at the entrance to the dining hall."), + 0, 0, 28, 0, 0, 0, 16, 0, +strstr("A wide staircase with ebony banisters leads down here.**\n\ +The dining hall is to the -.*\n") }, + { strstr("This was once the first class lounge."), + 0, 0, 29, 0, 16, 1, 0, 0, +strstr("There is much rubble and destruction here that was not apparent elsewhere.\n\ +The walls and ceilings have broken in in some places. A staircase with\n\ +red coral banisters leads up. It is impossible to go - or -.\n\ +It seems a little clearer +.*\n") }, + { strstr("You are in a narrow stairwell."), + 0, 17, 0, 0, 30, 1, 0, 0, +strstr("These dusty and decrepit stairs lead up. There is no way -. The\n\ +hallway turns sharply -.**\n") }, + { strstr("You are in the magazine."), + 19, 0, 0, 0, 0, 0, 0, 0, +strstr("Rows and rows of neatly stacked ammunition for laser pistols and grenade\n\ +launchers are here. The armory is +.***\n") }, + { strstr("You're in the presidential suite."), + 0, 20, 0, 0, 0, 0, 0, 0, +strstr("Apparently the president has been assassinated. A scorched figure lies\n\ +face downward on the carpet clutching his chest.*\n\ +The hallway leads -.**\n") }, + { strstr("You are in the dining hall."), + 0, 30, 31, 23, 0, 0, 0, 0, +strstr("This was the seen of a mass suicide. Hundreds of ambassadors and assorted\n\ +dignitaries sit slumped over their breakfast cereal. I suppose the news\n\ +of the cylon attack killed them. There is a strange chill in this room. I\n\ +would not linger here. * The kitchen is +. Entrances + and +.\n") }, + { strstr("The debris is very thick here."), + 0, 11, 0, 24, 0, 0, 0, 0, +strstr("Broken furniture, fallen girders, and other rubble block the way.\n\ +There is not much chance to continue -, -, or -.\n\ +It would be best to go -.\n") }, + { strstr("You are in the kitchen."), + 28, 0, 0, 0, 0, 0, 0, 0, +strstr("This room is full of shining stainless steel and burnished bronze cookware. An \n\ +assortment of tropical fruits and vegetables as well as fine meats and cheeses \n\ +lies on a sterling platter. The chef, unfortunately, has been skewered like a \n\ +side of beef. The dining room is +. ** There is a locked door +.\n") }, + { strstr("You are in an arched entry leading to the dining room."), + 0, 0, 0, 28, 0, 0, 0, 0, +strstr("The door leading out is bolted shut from the outside and is very strong.***\n\ +The dining room is +.\n") }, + { strstr("You are in space."), + 33, 34, 35, 36, 37, 1, 33, 1, +strstr("****\n") }, + { strstr("You are in space."), + 38, 32, 39, 40, 41, 1, 42, 1, +strstr("****\n") }, + { strstr("You are in space."), + 32, 44, 45, 46, 47, 1, 48, 1, +strstr("****\n") }, + { strstr("You are in space."), + 40, 45, 49, 32, 50, 1, 51, 1, +strstr("****\n") }, + { strstr("You are in space."), + 41, 46, 32, 52, 53, 1, 54, 1, +strstr("****\n") }, + { strstr("You are in space."), + 42, 47, 50, 53, 55, 1, 32, 1, +strstr("****\n") }, + { strstr("You are in space."), + 43, 48, 51, 54, 32, 1, 56, 1, +strstr("****\n") }, + { strstr("You are in space."), + 57, 33, 40, 41, 42, 1, 43, 1, +strstr("****\n") }, + { strstr("You are in space."), + 39, 35, 57, 33, 58, 1, 59, 1, +strstr("****\n") }, + { strstr("You are in space."), + 39, 36, 33, 59, 60, 1, 61, 1, +strstr("****\n") }, + { strstr("You are in space."), + 39, 37, 58, 60, 62, 1, 33, 1, +strstr("****\n") }, + { strstr("You are in space."), + 39, 38, 59, 61, 33, 1, 63, 1, +strstr("****\n") }, + { strstr("You are in space."), + 34, 64, 45, 46, 47, 1, 48, 1, +strstr("****\n") }, + { strstr("You are in space."), + 35, 44, 49, 34, 50, 1, 51, 1, +strstr("****\n") }, + { strstr("You are in space."), + 36, 44, 34, 52, 53, 1, 54, 1, +strstr("****\n") }, + { strstr("You are in space."), + 37, 44, 50, 53, 55, 1, 34, 1, +strstr("****\n") }, + { strstr("You are in space."), + 38, 44, 51, 54, 34, 1, 56, 1, +strstr("****\n") }, + { strstr("You are in space."), + 49, 49, 52, 35, 49, 1, 49, 1, +strstr("****\n") }, + { strstr("You are in space."), + 58, 47, 49, 37, 55, 1, 35, 1, +strstr("****\n") }, + { strstr("You are in space."), + 59, 48, 49, 38, 35, 1, 56, 1, +strstr("****\n") }, + { strstr("You are in space."), + 52, 52, 36, 49, 52, 1, 52, 1, +strstr("****\n") }, + { strstr("You are in space."), + 60, 46, 37, 52, 55, 1, 36, 1, +strstr("****\n") }, + { strstr("You are in space."), + 61, 48, 38, 52, 36, 1, 56, 1, +strstr("****\n") }, + { strstr("You are in space."), + 62, 55, 55, 55, 56, 1, 37, 1, +strstr("****\n") }, + { strstr("You are in space."), + 56, 56, 56, 56, 38, 1, 55, 1, +strstr("****\n") }, + { strstr("You are in space."), + 65, 39, 57, 57, 57, 1, 57, 1, +strstr("****\n") }, + { strstr("You are in space."), + 39, 50, 49, 42, 62, 1, 40, 1, +strstr("****\n") }, + { strstr("You are in space."), + 39, 51, 49, 43, 40, 1, 63, 1, +strstr("****\n") }, + { strstr("You are in space."), + 39, 53, 43, 59, 62, 1, 41, 1, +strstr("****\n") }, + { strstr("You are in space."), + 39, 54, 43, 59, 41, 1, 56, 1, +strstr("****\n") }, + { strstr("You are in space."), + 39, 55, 62, 62, 56, 1, 42, 1, +strstr("****\n") }, + { strstr("You are in space."), + 39, 56, 35, 36, 43, 1, 55, 1, +strstr("****\n") }, + { strstr("You are in space."), + 44, 66, 66, 66, 66, 1, 66, 1, +strstr("****\n") }, + { strstr("You are in space."), + 67, 57, 67, 67, 67, 1, 67, 1, +strstr("****\n") }, + { strstr("You are in space."), + 64, 68, 68, 68, 68, 1, 68, 1, +strstr("****\n") }, + { strstr("You are orbiting a small blue planet."), + 67, 67, 67, 67, 65, 1, 69, 1, +strstr("****\n") }, + { strstr("You are orbiting a tropical planet."), + 68, 68, 68, 68, 66, 1, 70, 1, +strstr("****\n") }, + { strstr("You are flying through a dense fog."), + 69, 69, 69, 69, 69, 1, 69, 1, +strstr("A cold grey sea of mist is swirling around the windshield and water droplets\n\ +are spewing from the wingtips. Ominous shadows loom in the darkness and it\n\ +feels as if a trap is closing around us. I have lost all sense of direction.\n\ +****\n") }, + { strstr("You are approaching an island."), + 71, 72, 73, 74, 68, 1, 0, 1, +strstr("Coconut palms, sword ferns, orchids, and other lush vegetation drape this\n\ +jagged island carved seemingly from pure emerald and set in a turquoise\n\ +sea. The land rises sharply +. There is a nice beach* +.*\n") }, + { strstr("You are flying over a mountainous region."), + 75, 73, 76, 77, 68, 1, 0, 1, +strstr("Below is a magnificent canyon with deep gorges, high pinnacles and\n\ +waterfalls plummeting hundreds of feet into mist. Everything in sight\n\ +is carpeted with a tropical green.* The ocean is +.**\n") }, + { strstr("You are flying over the ocean."), + 74, 78, 78, 78, 68, 1, 0, 1, +strstr("You bank over the water and your wingtips dip low to the green waves. The\n\ +sea is very shallow here and the white coral beds beneath us teem with \n\ +colorful fish.****\n") }, + { strstr("You are flying over the beach."), + 71, 72, 79, 74, 68, 1, 80, 1, +strstr("A warm gentle surf caresses the white coral beach here. The land rises\n\ +sharply +.* The beach is lost in low cliffs and rocks +.*\n") }, + { strstr("You are flying over a large lagoon."), + 81, 72, 73, 82, 68, 1, 0, 1, +strstr("Encircled by a coral reef, the palms and ferns in this sheltered spot\n\ +have grown down to the water's very brink which winds tortuously inland.\n\ +There looks like a small village +.***\n") }, + { strstr("You are flying over a gently sloping plane."), + 83, 71, 84, 85, 68, 1, 0, 1, +strstr("This is where several alluvial fans and ancient lava flows have run\n\ +together forming a fertile plane choked with vegetation. It would be\n\ +impossible to land safely here.* The terrain is more rugged +.**\n") }, + { strstr("You are flying through a gorge."), + 0, 0, 86, 71, 68, 1, 102, 1, +strstr("This narrow, steep sided canyon is lined with waving ferns. The floor is of\n\ +light gravel with many freshets pouring from the walls and running along it.\n\ +The gorge leads to the sea** +, and to a tumultuous origin +.\n") }, + { strstr("You are flying over a plantation."), + 85, 81, 71, 88, 68, 1, 89, 1, +strstr("Rows of palms, papayas, mangoes, kiwi, as well as smaller fields of sugar\n\ +cane and pineapple are growing here. It might be possible to land here, but\n\ +I wouldn't advise it.* There looks like two small settlements + \n\ +and *+.\n") }, + { strstr("You are over the ocean."), + 72, 78, 79, 74, 68, 1, 0, 1, +strstr("The deep green swells foam and roll into the shore **+*.\n") }, + { strstr("You are flying along the coast."), + 86, 72, 90, 73, 68, 1, 91, 1, +strstr("The coastline here is very rocky with little or no sand. The surf in some\n\ +places is violent and explodes in a shower of sparkling spray.\n\ +There is a winding road below which closely follows the shore. ****\n") }, + { strstr("This is a beautiful coral beach."), + 106, 0, 107, 108, 73, 0, 0, 0, +strstr("Fine silver sand kissed lightly by warm tropical waters stretches at least\n\ +30 meters here from the ocean to under gently swaying palms +.***\n") }, + { strstr("You are flying over a small fishing village."), + 77, 74, 71, 82, 68, 1, 92, 1, +strstr("A few thatched huts a short distance from the water and row of more modern\n\ +bungalows on either side of a dirt road are all that is here. The road\n\ +continues on ***+.\n") }, + { strstr("You are flying over a clearing."), + 88, 72, 74, 87, 68, 1, 93, 1, +strstr("There is a dock here (big enough for a seaplane) leading to a grassy\n\ +meadow and a road. Some people are having a party down there. Below is\n\ +a good landing site. ****\n") }, + { strstr("You are flying over the shore."), + 94, 75, 95, 96, 68, 1, 0, 1, +strstr("Rocky lava flows or coarse sandy beaches are all that is here except for\n\ +sparse herbs and weeds.****\n") }, + { strstr("You are flying in a wide valley."), + 95, 97, 86, 75, 68, 1, 98, 1, +strstr("This is a shallow valley yet the floor is obscured by a thick mist.\n\ +The valley opens to the sea +. The mist grows thicker +.**\n") }, + { strstr("You are flying near the shore."), + 96, 77, 75, 99, 68, 1, 0, 1, +strstr("Very tall palm trees growing in neatly planted rows march off from the \n\ +water here towards the hills and down to the flat lands *+.*\n\ +There is a nice beach +.\n") }, + { strstr("You are flying around the very tip of the island."), + 95, 79, 90, 84, 68, 1, 0, 1, +strstr("There is no beach here for sheer cliffs rise several hundred feet\n\ +to a tree covered summit. Far below, the blue sea gnaws voraciously at\n\ +the roots of these cliffs. The island bends around +** and +.\n") }, + { strstr("You are flying along the coastline."), + 99, 82, 88, 100, 68, 1, 101, 1, +strstr("There is a narrow strip of sand here lined with ferns and shrubs, but very\n\ +few trees. The beach is barley wide enough to land on. The beach continues\n\ +on -.* There are some buildings +.*\n") }, + { strstr("You are flying over several cottages and buildings"), + 99, 82, 77, 87, 68, 1, 103, 1, +strstr("The grounds here are landscaped with palm trees, ferns, orchids, and beds of\n\ +flowering plumeria and antheriums. Directly below is a small ornate white\n\ +house with a belltower, a lush green lawn, and a spurting fountain.\n\ +Small dirt roads go + and +.**\n") }, + { strstr("You are in a field of sugar cane."), + 109, 110, 111, 112, 77, 0, 0, 0, +strstr("These strong, thick canes give little shelter but many cuts and scrapes.\n\ +There are some large trees ***+.\n") }, + { strstr("You are flying over the ocean."), + 95, 78, 90, 86, 68, 1, 0, 1, +strstr("The water is a placid turquoise and so clear that fish and sharks\n\ +many fathoms below are clearly visible.****\n") }, + { strstr("You are on the coast road."), + 113, 114, 115, 116, 79, 0, 0, 0, +strstr("The road winds close to the shore here and the sound of crashing surf is\n\ +deafening.* The water is +. The road continues - and -.\n") }, + { strstr("You are on the main street of the village."), + 117, 118, 119, 120, 81, 0, 0, 0, +strstr("Thatched roofs and outrigger canoes, palm trees and vacation bungalows, and\n\ +comely natives in a tropical paradise all make this a fantasy come true.\n\ +There is an open bungalow +.* The road continues - and -.\n") }, + { strstr("You are at the sea plane dock."), + 121, 122, 123, 124, 82, 0, 0, 0, +strstr("Native girls with skin of gold, clad only in fragrant leis and lavalavas,\n\ +line the dockside to greet you. A couple of ukulele plucking islanders and a\n\ +keyboard player are adding appropriate music. A road crosses the clearing \n\ ++*. There are some tables set up +.*\n") }, + { strstr("You are flying over the ocean."), + 94, 83, 95, 96, 68, 1, 0, 1, +strstr("Sea weeds and kelp surge in the waves off shore here. The ocean becomes \n\ +much deeper +.***\n") }, + { strstr("You are flying along the coast."), + 94, 84, 86, 83, 68, 1, 0, 1, +strstr("The land is very low here with a river running into the sea +. There\n\ +is a wide valley opening up +. The very tip of the island is +.*\n") }, + { strstr("You are flying along the coast."), + 94, 85, 83, 99, 68, 1, 0, 1, +strstr("There are some secluded sandy stretches of beach here, but too many rocky\n\ +outcroppings of lava to land. There is a nicer beach ***+.\n") }, + { strstr("You are lost in a sea of fog."), + 97, 104, 97, 97, 97, 1, 0, 1, +strstr("What have you gotten us into?\n\ +I cant see a thing! ****\n") }, + { strstr("You are on a gravel wash."), + 125, 126, 127, 128, 84, 0, 0, 0, +strstr("The sound of cascading water is the background for a diluted chorus of \n\ +gurgling, splashing, and enchantingly delicate singing. Great billows\n\ +of steam are rising *+.**\n") }, + { strstr("You are flying over a wide beach."), + 96, 88, 85, 87, 68, 1, 105, 1, +strstr("Unlike the leeward beaches, few coconut palms grow here but a well groomed\n\ +lawn and garden with traipsing stone walks leads down to the sand.*\n\ +There are some buildings +. Some trees are growing +.*\n") }, + { strstr("You are flying over the ocean."), + 100, 100, 87, 100, 68, 1, 0, 1, +strstr("The sea is a perfectly clear blue with a white sandy bottom. No coral\n\ +grows underwater here, but the force of the waves is broken by the steep\n\ +incline.****\n") }, + { strstr("You are on a narrow strip of sand."), + 129, 130, 131, 0, 87, 0, 0, 0, +strstr("Rather coarse sand makes this beach very steep and only a few meters wide.\n\ +A fresh ocean breeze is rustling the ferns **+.*\n") }, + { strstr("This is Fern Canyon."), + 0, 0, 132, 133, 76, 0, 0, 0, +strstr("Delicate waving ferns flourish here, suckled by warm water dripping from \n\ +every fissure and crevice in the solid rock walls.\n\ +The canyon winds **-, and -.\n") }, + { strstr("This is the front lawn."), + 134, 135, 136, 137, 88, 0, 0, 0, +strstr("There is a small fountain here where the driveway meets the lawn.\n\ +Across the driveway, +, is an ornate white house with and elegant \n\ +woodworking. The bargeboards are carved with fylfots, the ancient \n\ +symbols of luck. Even a bell tower has been built here.* There is a \n\ +road + which turns into the driveway.*\n") }, + { strstr("You have just crossed the crest of a mountain."), + 97, 79, 86, 71, 68, 1, 0, 1, +strstr("The fog vanished mysteriously as we flew over the crest.*\n\ +Far + I can see the ocean.**\n") }, + { strstr("You are on a sandy beach."), + 138, 139, 140, 0, 99, 0, 0, 0, +strstr("This is the only good beach on the weather side of the island. Fine coral\n\ +sand, a fresh sea breeze, and dramatic surf add to its appeal.**\n\ +Stone steps lead to the gardens +.*\n") }, + { strstr("You are among palm trees near the shore."), + 141, 80, 142, 143, 73, 0, 0, 0, +strstr("Arching coconut palms laden with fruit provide a canopy for the glistening\n\ +white sand and sparse grasses growing here. The forest grows denser +.\n\ +The ocean is +.**\n") }, + { strstr("You are walking along the beach."), + 144, 0, 145, 80, 73, 0, 0, 0, +strstr("The warm tropical waters nuzzle your ankles as you walk. Above is a fiercely\n\ +blue sky. The slope of the sand is so gentle that two hundred meters\n\ +offshore the water is only knee deep.** There are some rocks +.*\n") }, + { strstr("You are walking along the beach."), + 146, 0, 80, 147, 73, 0, 0, 0, +strstr("Many beautiful shells have been washed up here including bright yellow \n\ +cowries, chocolate colored murex, orange conchs, striped tritons and the\n\ +deadly cone shells.****\n") }, + { strstr("You are in a papaya grove."), + 148, 89, 149, 150, 77, 0, 0, 0, +strstr("Green slender trees no taller than three meters bulge with their\n\ +orange succulent fruit. There are some tall trees +.***\n") }, + { strstr("You are in a field of pineapple."), + 89, 151, 152, 153, 77, 0, 0, 0, +strstr("The sharp dagger like pineapple leaves can pierce the flesh and hold fast\n\ +a skewered victim with tiny barbs.* The field ends +.**\n") }, + { strstr("You are in a field of kiwi plants."), + 149, 154, 155, 89, 77, 0, 0, 0, +strstr("Round hairy fruit hang from staked vines here. There are some trees +\n\ +and +. The field ends in a dirt road +.*\n") }, + { strstr("You are in a large grove of coconuts."), + 150, 153, 89, 156, 77, 0, 0, 0, +strstr("These trees are much taller than any growing near the shore plus the fat,\n\ +juicy coconuts have been selectively cultivated. The grove continues\n\ ++, +, *and +.\n") }, + { strstr("You are in the woods."), + 157, 91, 158, 116, 79, 0, 0, 0, +strstr("Tropical undergrowth makes the going rough here. Sword ferns give no strong\n\ +foot hold and the dangling vines would gladly throttle one. Strange cackling\n\ +noises are coming from somewhere +.***\n") }, + { strstr("You are at the shore."), + 91, 0, 159, 145, 79, 0, 0, 0, +strstr("Explosions of surf jetting out of underwater tunnels here make it\n\ +impossible to climb down to a small cave entrance below. Only at rare\n\ +minus tides would it be possible to enter.*** The beach is better +.\n") }, + { strstr("You are on the coast road."), + 158, 161, 162, 91, 79, 0, 0, 0, +strstr("The road is beginning to turn inland.* I can here the surf +. The road\n\ +continues +.*\n") }, + { strstr("The road winds deeper into the trees."), + 163, 142, 91, 164, 79, 0, 0, 0, +strstr("Only narrow sunbeams filter through the foliage above. The moist rich earth\n\ +has nurtured a myriad of trees, shrubs, and flowers to grow here. The\n\ +road continues - and *- from here.*\n") }, + { strstr("This is the front porch of the bungalow."), + 165, 92, 0, 0, 81, 0, 0, 0, +strstr("These wooden steps and porch are very bucolic. A little woven mat on the \n\ +doorstep reads \"Don't Tread on Me\". The open front door is +.\n\ +A stone walk leads to the main street +.**\n") }, + { strstr("You are on a path leading to the lagoon."), + 92, 166, 167, 168, 81, 0, 0, 0, +strstr("This path trampled fern, grass, sapling, and anything else that got in its\n\ +way.* The water is +.**\n") }, + { strstr("This is a dirt road."), + 169, 118, 170, 92, 81, 0, 0, 0, +strstr("**The road continues on - here for some distance. A village is +.\n") }, + { strstr("You are on a dirt road."), + 171, 118, 92, 172, 81, 0, 0, 0, +strstr("**There is a small village +. The road continues +.\n") }, + { strstr("You are on a dirt road."), + 173, 93, 174, 175, 82, 0, 0, 0, +strstr("The light tan soil of the road contrasts artistically with the lush green\n\ +vegetation and seering blue sky.* There is a clearing and many people +.\n\ +The road continues - and -.\n") }, + { strstr("You are at the seaplane dock."), + 93, 0, 176, 177, 82, 0, 0, 0, +strstr("Several muscular, bronze skinned men greet you warmly as you pass under\n\ +a thatched shelter above the dock here. Polynesian hospitality.\n\ +There is a clearing +.* A trail runs around the lagoon + and +.\n") }, + { strstr("There are some tables on the lawn here."), + 121, 122, 123, 93, 82, 0, 0, 0, +strstr("Hors d'oeuvres, canapes, mixed drinks, and various narcotic drugs along with\n\ +cartons of Di Gel fill the tables to overflowing. Several other guests are\n\ +conversing and talking excitedly****.\n") }, + { strstr("You are nosing around in the bushes."), + 124, 124, 93, 124, 82, 0, 0, 0, +strstr("There is little here but some old beer cans. You are making fools out of\n\ +us in front of the other guests.** It would be best to go -.*\n") }, + { strstr("You are walking in a dry stream bed."), + 178, 98, 179, 0, 84, 0, 0, 0, +strstr("The large cobblestones are difficult to walk on. No sunlight reaches\n\ +below a white canopy of fog seemingly generated from *+. A dirt path \n\ +along the wash is +. A high bank is impossible to climb +.\n") }, + { strstr("You are at the thermal pools."), + 98, 0, 180, 181, 84, 0, 0, 0, +strstr("Several steaming fumaroles and spluttering geysers drenched by icy mountain\n\ +waters from a nearby waterfall heat half a dozen natural pools to a\n\ +delicious 42 degrees. Enchantingly beautiful singing seems to flow from the\n\ +water itself as it tumbles down the falls.*** There is a mossy entrance\n\ +to a cave +.\n") }, + { strstr("You are in the woods."), + 127, 180, 182, 98, 84, 0, 0, 0, +strstr("Coniferous trees girded by wild huckleberries, elderberries, salmonberries\n\ +and thimbleberries enjoy a less tropical climate here in the high mountains.\n\ +*The sound of rushing water is coming from +.**\n") }, + { strstr("You are on a dirt trail."), + 179, 181, 98, 0, 84, 0, 0, 0, +strstr("The trail seems to start here and head -.** High cliffs border the \n\ +trail +.\n") }, + { strstr("You are walking along the beach."), + 183, 101, 184, 0, 87, 0, 0, 0, +strstr("A rather unnerving surf explodes onto the beach here and dashes itself into\n\ +spray on the steep incline. The beach continues + and +.**\n") }, + { strstr("You are walking along the beach."), + 101, 185, 186, 0, 87, 0, 0, 0, +strstr("This is not a very nice beach. The coarse sand hurts my feet.****\n") }, + { strstr("You are walking through some ferns."), + 184, 186, 187, 101, 87, 0, 0, 0, +strstr("This is a wide field growing only ferns and small shrubs.** The \n\ +ocean is *+.\n") }, + { strstr("You are in a narrow canyon."), + 0, 0, 188, 102, 76, 0, 0, 0, +strstr("The steep sides here squeeze a little freshet through a gauntlet like\n\ +series of riffles and pools.****\n") }, + { strstr("The canyon is much wider here."), + 0, 0, 102, 189, 76, 0, 0, 0, +strstr("The sheer rock walls rise 10 meters to the forest above. A slender \n\ +waterfall careens away from the face of the rock high above and showers\n\ +the gravel floor with sparkling raindrops.** The canyon continues -\n\ +and -.\n") }, + { strstr("You are on the front porch of the cottage."), + 190, 103, 0, 0, 0, 0, 0, 0, +strstr("Several giggling native girls came running down the steps as you approached\n\ +and headed on down the road. On the fern rimmed porch is a small table with\n\ +matching white wrought iron chairs cushioned with red velvet. The front\n\ +door leads -. The lawn and fountain are +.**\n") }, + { strstr("You are in a palm grove."), + 103, 191, 192, 105, 88, 0, 0, 0, +strstr("****\n") }, + { strstr("You are on a dirt road."), + 193, 192, 245, 103, 88, 0, 0, 0, +strstr("There is a large village +. The road cleaves a coconut plantation +.\n\ +A small dirt road goes -, and a drive way peals off +.\n") }, + { strstr("You are in a field of small shrubs."), + 184, 186, 103, 187, 88, 0, 0, 0, +strstr("**Pine and other coniferous saplings have been planted here. The rich brown\n\ +soil is well tilled and watered. Across a large lawn, there is a small\n\ +cottage +. I can feel a delicious sea breeze blowing from +.\n") }, + { strstr("The beach is pretty rocky here."), + 194, 105, 195, 0, 96, 0, 0, 0, +strstr("Dangerous surf and lava outcroppings make this a treacherous strand.\n\ +The beach is nicer* +.**\n") }, + { strstr("The beach is almost 10 meters wide here."), + 105, 183, 196, 0, 99, 0, 0, 0, +strstr("The sand has become more coarse and the beach steeper.* It gets \n\ +worse +.**\n") }, + { strstr("You are in the gardens."), + 195, 196, 197, 105, 99, 0, 0, 0, +strstr("Lush green lawns studded with palms and benches stretch as far as the eye\n\ +can see.** A path leads -. Stone steps lead down to the beach +.\n") }, + { strstr("You are on the coast road."), + 198, 106, 163, 199, 73, 0, 0, 0, +strstr("The forest is dense on either side and conceals the road from anyone\n\ +approaching it.** The road continues - and -.\n") }, + { strstr("You are in the forest."), + 116, 107, 91, 106, 73, 0, 0, 0, +strstr("There are trees and ferns all around.****\n") }, + { strstr("You are in the forest."), + 199, 108, 106, 146, 73, 0, 0, 0, +strstr("There are trees and ferns all around.****\n") }, + { strstr("You are in a copse."), + 142, 107, 145, 80, 0, 0, 0, 0, +strstr("This is a secret hidden thicket only noticeable from the beach. Someone\n\ +has been digging here recently.****\n") }, + { strstr("You are at the tide pools."), + 91, 0, 114, 107, 79, 0, 0, 0, +strstr("These rocks and pools are the home for many sea anemones and crustaceans.\n\ +**The surf is very rough +. There is a nice beach +.\n") }, + { strstr("You are in the forest."), + 199, 108, 143, 0, 73, 0, 0, 0, +strstr("This is a shallow depression sheltered from the wind by a thick growth of \n\ +thorny shrubs. It looks like someone has camped here. There is a fire pit\n\ +with some dry sticks and grass nearby.* The beach is +.* The thorny\n\ +shrubs block the way -.\n") }, + { strstr("You are at the mouth of the lagoon."), + 200, 0, 108, 201, 74, 0, 0, 0, +strstr("The beach ends here where the coral reef rises to form a wide lagoon\n\ +bending inland. A path winds around the lagoon to the -.*\n\ +The beach continues on -. Only water lies +.\n") }, + { strstr("You are in a breadfruit grove."), + 202, 109, 203, 204, 77, 0, 0, 0, +strstr("The tall trees bend leisurely in the breeze, holding many round breadfruits\n\ +close to their large serrated leaves. There are coconut palms +,\n\ +*+, and +.\n") }, + { strstr("You are in a grove of mango trees."), + 203, 111, 205, 109, 77, 0, 0, 0, +strstr("The juicy yellow red fruits are nearly ripe on the trees here. There are\n\ +some coconut palms +. There are some vines +. There is a road +.*\n") }, + { strstr("You are in a grove of coconut palms."), + 204, 112, 109, 206, 77, 0, 0, 0, +strstr("All I can see around us are palm trees.****\n") }, + { strstr("You are in a coconut grove."), + 110, 207, 208, 209, 77, 0, 0, 0, +strstr("There are countless trees here.****\n") }, + { strstr("You are in a field of pineapple."), + 154, 208, 210, 110, 77, 0, 0, 0, +strstr("The sharp leaves are cutting me to ribbons. There is a road **+.\n\ +More pineapple +.\n") }, + { strstr("You are in a coconut grove."), + 112, 209, 110, 211, 77, 0, 0, 0, +strstr("There is a field of pineapple **+.*\n") }, + { strstr("You are on the edge of a kiwi and pineapple field."), + 111, 152, 155, 110, 77, 0, 0, 0, +strstr("An irrigation ditch separates the two fields here. There is a road **+.*\n") }, + { strstr("This is a dirt road."), + 205, 210, 212, 111, 77, 0, 0, 0, +strstr("The road runs - and - here.**\n") }, + { strstr("You are in a palm grove."), + 206, 211, 112, 213, 77, 0, 0, 0, +strstr("There are palm trees all around us.****\n") }, + { strstr("You are on the edge of a small clearing."), + 157, 113, 157, 157, 79, 0, 0, 0, +strstr("The ground is rather marshy here and darting in and out of the many tussocks\n\ +is a flock of wild chicken like fowl.****\n") }, + { strstr("You are in the woods."), + 158, 115, 215, 113, 79, 0, 0, 0, +strstr("You have walked a long way and found only trees. ****\n") }, + { strstr("You are walking along the shore."), + 115, 0, 214, 114, 86, 0, 0, 0, +strstr("You are now about 10 meters above the surf on a gently rising cliffside.**\n\ +The land rises +. There is a beach far +.\n") }, + { strstr("You are just inside the entrance to the sea cave."), + 246, 114, 0, 0, 114, 1, 0, 0, +strstr("The sound of water dripping in darkness and the roar of the ocean just outside\n\ +create a very unwelcoming atmosphere inside this cave. Only on rare occasions\n\ +such as this is it possible to enter the forbidden catacombs... The cave\n\ +continues -.***\n") }, + { strstr("You are in a secret nook beside the road."), + 115, 159, 162, 91, 79, 0, 0, 0, +strstr("Hidden from all but the most stalwart snoopers are some old clothes, empty\n\ +beer cans and a trash baggie full of used Huggies and ordure. Lets get\n\ +back to the road +.***\n") }, + { strstr("You are on the coast road."), + 215, 214, 0, 115, 86, 0, 0, 0, +strstr("The road turns abruptly - here, avoiding the cliffs near the shore\n\ ++ and +.*\n") }, + { strstr("You are on a dirt road."), + 216, 116, 113, 141, 79, 0, 0, 0, +strstr("The roadside is choked with broad leaved plants fighting for every breath of\n\ +sunshine. The palm trees are taller than at the shore yet bend over the road \n\ +forming a canopy. The road continues *- and *-.\n") }, + { strstr("You have discovered a hidden thicket near the road."), + 163, 142, 116, 106, 73, 0, 0, 0, +strstr("Stuffed into a little bundle here is a bloody silken robe and many beer cans.\n\ +*Some droplets of blood and a major spill sparkle farther +.\n\ +The road is +.*\n") }, + { strstr("You are in the living room."), + 0, 117, 217, 218, 0, 0, 0, 0, +strstr("A decorative entry with fresh flowers and wall to wall carpeting leads into\n\ +the living room here where a couch and two chairs converse with an end table.\n\ +*The exit is +.* The bedroom is +.\n") }, + { strstr("You are at the lagoon."), + 118, 0, 167, 168, 81, 0, 0, 0, +strstr("There are several outrigger canoes pulled up on a small beach here and a\n\ +catch of colorful fish is drying in the sun. There are paths leading \n\ +off -*, -, and -.\n") }, + { strstr("You are at the lagoon."), + 118, 0, 170, 166, 81, 0, 0, 0, +strstr("This is a grassy little spot near the water. A sightly native girl is frolicing\n\ +in the water close to shore here.** The path continues - and -. \n") }, + { strstr("You are at the lagoon."), + 118, 0, 166, 172, 81, 0, 0, 0, +strstr("The path meanders through tussocks of grass, ferns, and thorny bushes here\n\ +and continues on **- and -.\n") }, + { strstr("You are in the woods."), + 219, 119, 220, 92, 81, 0, 0, 0, +strstr("There are plenty of ferns and thorny bushes here! ****\n") }, + { strstr("You are on a dirt road."), + 220, 167, 199, 119, 74, 0, 0, 0, +strstr("The road winds rather close to a large lagoon here and many sedges and tall\n\ +grasses line the shoulder *+. The road continues - and -.\n") }, + { strstr("You are in the woods beside the road."), + 221, 120, 92, 222, 81, 0, 0, 0, +strstr("The forest grows darker +. The road is +.**\n") }, + { strstr("The road crosses the lagoon here."), + 222, 0, 120, 174, 81, 0, 0, 0, +strstr("Coursing through the trees, the road at this point bridges a watery finger\n\ +of the lagoon.* The water is +. The road continues - and -.\n") }, + { strstr("You are in a coconut palm grove."), + 223, 121, 224, 225, 82, 0, 0, 0, +strstr("The tall palms are planted about 30 feet apart with a hardy deep green grass\n\ +filling the spaces in between. There are tire tracks through the grass. The\n\ +grove continues -. There is a road +.**\n") }, + { strstr("You are walking along a dirt road."), + 224, 176, 172, 121, 82, 0, 0, 0, +strstr("You are nearing the lagoon.** The road continues - and -.\n") }, + { strstr("You are on a dirt road."), + 225, 177, 121, 226, 82, 0, 0, 0, +strstr("The road turns abruptly - here, entering a grove of palm trees.* The road\n\ +also continues - toward the lagoon.*\n") }, + { strstr("You are on a trail running around the lagoon."), + 172, 0, 0, 122, 82, 0, 0, 0, +strstr("The dark waters brush the trail here and the path crosses a bridge +.\n\ +There is deep water + and +. The trail continues -.\n") }, + { strstr("This is the mouth of the lagoon."), + 175, 0, 122, 227, 82, 0, 0, 0, +strstr("The coral reef wraps around a natural bay here to create a wide lagoon which\n\ +winds tortuously inland.** A trail goes around the lagoon +. The beach\n\ +is +.\n") }, + { strstr("You are in a dry stream bed."), + 0, 125, 0, 0, 84, 0, 0, 0, +strstr("The dry wash drains over a tall precipice here into a turbid morass below. The\n\ +most noisome stench imaginable is wafting up to defile our nostrils. Above,\n\ +the lurid sun glows brown through a strange mist.* The only direction \n\ +I'm going is -.**\n") }, + { strstr("You are on a dirt path along the wash."), + 0, 128, 125, 228, 84, 0, 0, 0, +strstr("This path looks more like a deer trail. It scampers away ***+.\n") }, + { strstr("The thermal pools flow into a stream here."), + 127, 0, 229, 126, 84, 0, 0, 0, +strstr("The gurgling hot waters pour over boulders into a swiftly flowing\n\ +stream **+. The pools are +.\n") }, + { strstr("You are at the entrance to a cave."), + 128, 230, 126, 0, 84, 0, 0, 0, +strstr("A tall narrow fissure in the rock cliffs here has become a well traveled\n\ +passage way. A hoof beaten dirt path leads directly into it. A curl of\n\ +steam is trailing from a corner of the fissure's gaping mouth. The path\n\ +leads - and -. The pools are +.*\n") }, + { strstr("You are in the woods."), + 182, 229, 182, 127, 84, 0, 0, 0, +strstr("Wild berry bushes plump with fruit and thorns tangle your every effort to\n\ +proceed.* The sound of rushing water is +.**\n") }, + { strstr("You are walking along the beach."), + 139, 129, 184, 0, 99, 0, 0, 0, +strstr("Some dunes here progress inland and make it impossible to get very far in that\n\ +direction. The beach continues - and -.* The ocean is +.\n") }, + { strstr("You are in the dunes."), + 183, 101, 184, 129, 87, 0, 0, 0, +strstr("The endless rolling and pitching sand dunes are enough to make one very queasy!\n\ +The only way I'm going is ***+.\n") }, + { strstr("This is a lousy beach."), + 130, 0, 0, 0, 87, 0, 0, 0, +strstr("Volcanic and viciously sharp bitted grains of sand here bite like cold steel\n\ +into my tender feet. I refuse to continue on. Let's get out of here. The\n\ +beach is better +.***\n") }, + { strstr("You are in a field of sparse ferns."), + 131, 185, 187, 130, 87, 0, 0, 0, +strstr("The lava rock outcroppings here will support few plants. There is more \n\ +vegetation +. There is a nice beach +.* The ocean is +.\n") }, + { strstr("You are in the woods."), + 131, 131, 137, 131, 87, 0, 0, 0, +strstr("Young trees and tall shrubs grow densely together at this distance from the \n\ +shore.** The trees grow thicker +.*\n") }, + { strstr("The canyon is no wider than a foot here."), + 0, 0, 0, 132, 0, 0, 0, 0, +strstr("The freshet is gushing through the narrow trough, but the canyon has grown\n\ +too narrow to follow it any farther.*** I guess we'll have to go -.\n") }, + { strstr("You are in a narrow part of the canyon."), + 0, 0, 133, 232, 76, 0, 0, 0, +strstr("The two sheer sides are no more than a few meters apart here. There is a stone\n\ +door in the wall +. The gravelly floor runs with tiny rivulets seeping \n\ +from the ground itself.* The canyon continues - and -.\n") }, + { strstr("You are in the drawing room."), + 0, 134, 0, 0, 0, 0, 0, 0, +strstr("Exquisitely decorated with plants and antique furniture of superb\n\ +craftsmanship, the parlor reflects its owners impeccable taste. The tropical\n\ +sun is streaming in through open shutters *+. There doesn't seem \n\ +to be anybody around. A large immaculate oaken desk is visible in the\n\ +study and it even has a old fashioned telephone to complete the decor.**\n") }, + { strstr("You are in a palm grove."), + 135, 191, 233, 191, 88, 0, 0, 0, +strstr("Grassy rows of palms stretch as far as I can see.** There is a road +.*\n") }, + { strstr("You are on a dirt road."), + 136, 233, 234, 135, 88, 0, 0, 0, +strstr("The road winds through a coconut palm grove here. It continues on - \n\ +and -.**\n") }, + { strstr("The road leads to several large buildings here."), + 235, 136, 236, 237, 88, 0, 0, 0, +strstr("There is a clubhouse +,* a large barn and stable +, and a garage of \n\ +similar construct to the barn +.\n") }, + { strstr("This part of the beach is impassable."), + 0, 138, 0, 0, 96, 0, 0, 0, +strstr("The huge rocks and thunderous surf here would pound our frail bodies to pulp\n\ +in an instant.* The only direction I'm going is -.**\n") }, + { strstr("You are in the gardens."), + 195, 140, 197, 138, 96, 0, 0, 0, +strstr("So much green grass is a pleasure to the eyes.****\n") }, + { strstr("You are in the gardens."), + 140, 183, 197, 139, 99, 0, 0, 0, +strstr("Beautiful flowers and shrubs surround a little goldfish pond.****\n") }, + { strstr("You are on a stone walk in the garden."), + 195, 196, 238, 140, 99, 0, 0, 0, +strstr("The walk leads to a road **+.*\n") }, + { strstr("You are in the forest near the road."), + 198, 141, 216, 198, 73, 0, 0, 0, +strstr("There are many thorny bushes here!****\n") }, + { strstr("You are at a fork in the road."), + 239, 146, 141, 170, 73, 0, 0, 0, +strstr("Two roads come together in the forest here. One runs -,* the other \n\ +runs - and -.\n") }, + { strstr("You are on a dirt path around the lagoon."), + 170, 147, 146, 0, 74, 0, 0, 0, +strstr("The still waters reflect bending palms and a cloudless sky. It looks like\n\ +the path runs into a clearing +. The path continues -.**\n") }, + { strstr("You are drowning in the lagoon."), + 201, 201, 147, 201, 74, 0, 0, 0, +strstr("I suggest you get out before you become waterlogged.****\n") }, + { strstr("You are in a coconut palm grove."), + 202, 148, 203, 204, 77, 0, 0, 0, +strstr("****\n") }, + { strstr("You are in a palm grove."), + 202, 149, 205, 148, 77, 0, 0, 0, +strstr("****\n") }, + { strstr("You are in a palm grove."), + 202, 150, 148, 206, 77, 0, 0, 0, +strstr("****\n") }, + { strstr("You are on a dirt road."), + 203, 155, 212, 149, 77, 0, 0, 0, +strstr("*This road ends here at a palm grove but continues on - for quite\n\ +some way.**\n") }, + { strstr("You are in a coconut palm grove."), + 204, 156, 150, 213, 77, 0, 0, 0, +strstr("****\n") }, + { strstr("You are in a coconut grove."), + 151, 219, 208, 209, 77, 0, 0, 0, +strstr("*The grove ends +.**\n") }, + { strstr("You are in a coconut grove."), + 152, 207, 239, 151, 77, 0, 0, 0, +strstr("**There is a dirt road +.*\n") }, + { strstr("You are in a coconut grove."), + 153, 207, 151, 211, 77, 0, 0, 0, +strstr("****\n") }, + { strstr("This is a dirt road."), + 205, 239, 212, 154, 77, 0, 0, 0, +strstr("The road continues - and -.**\n") }, + { strstr("You are in a coconut grove."), + 153, 209, 153, 213, 77, 0, 0, 0, +strstr("****\n") }, + { strstr("You are in the woods near the road."), + 205, 210, 212, 155, 77, 0, 0, 0, +strstr("There are many thorny bushes here!****\n") }, + { strstr("You are in a coconut grove."), + 213, 213, 156, 234, 88, 0, 0, 0, +strstr("***The grove ends in a clearing +.\n") }, + { strstr("You are walking along some high cliffs."), + 162, 0, 0, 159, 86, 0, 0, 0, +strstr("The island bends sharply + here with high cliffs -\n\ +and -. The cliffs are lower +.\n") }, + { strstr("You are at the coast road turn around."), + 0, 162, 0, 158, 90, 0, 0, 0, +strstr("The coast road ends here in a lookout with a view of 100 kilometers of blue\n\ +sea and 100 meters of rugged cliff. Far below the waves crash against rocks.\n\ +****\n") }, + { strstr("You are in the woods near the road."), + 216, 163, 216, 198, 79, 0, 257, 0, +strstr("These thorny bushes are killing me.****\n") }, + { strstr("You are in the kitchen."), + 0, 0, 0, 165, 0, 0, 0, 0, +strstr("A small gas stove and a refrigerator are all the only appliances here. The\n\ +gas oven has been left on and the whole room is reeking with natural gas.\n\ +One spark from a match and.... The door out is ***+.\n") }, + { strstr("You are in the bedroom."), + 0, 0, 165, 0, 0, 0, 0, 0, +strstr("A soft feather comforter on top of layers of Answer blankets make this a very\n\ +luxurious place to sleep indeed. There are also some end tables and a dresser\n\ +here.** The living room is +.*\n") }, + { strstr("You are in the woods."), + 207, 169, 220, 221, 81, 0, 0, 0, +strstr("There seems to be a clearing +.***\n") }, + { strstr("You are in the woods near the road."), + 219, 170, 239, 169, 81, 0, 0, 0, +strstr("*As far as I can tell, there are two roads + and +.*\n") }, + { strstr("You are in the woods."), + 207, 171, 219, 222, 81, 0, 0, 0, +strstr("The forest is clearer +.***\n") }, + { strstr("You are on the lagoon's inland finger."), + 0, 172, 171, 172, 81, 0, 0, 0, +strstr("It is impossible to follow the lagoon any farther inland because of sharp\n\ +and very painful sedges.* The road is +.**\n") }, + { strstr("You are in a grassy coconut grove."), + 240, 173, 224, 241, 82, 0, 0, 0, +strstr("The tall palms provide a perfect canopy for the lush green grass.***\n\ +There is a road +.\n") }, + { strstr("You are near the lagoon's inland finger."), + 0, 174, 0, 173, 82, 0, 0, 0, +strstr("Very sharp sedges make it impossible to follow the lagoon any farther inland.\n\ +*There is a road +.**\n") }, + { strstr("You are on a dirt road."), + 241, 175, 173, 226, 82, 0, 0, 0, +strstr("The road winds through a coconut grove here and continues - and -.**\n") }, + { strstr("You are in the woods near the road."), + 226, 226, 175, 226, 82, 0, 0, 0, +strstr("**The road is +.*\n") }, + { strstr("This is a beach?"), + 227, 227, 177, 0, 82, 0, 0, 0, +strstr("Hard jagged rocks that pierce with every footstep hardly comprise a beach.**\n\ +Let's go -.*\n") }, + { strstr("The trail is lost in the woods here."), + 241, 241, 179, 241, 84, 0, 0, 0, +strstr("I suppose the animals that use this trail all depart in different directions\n\ +when they get this far into the woods.** The trail goes -.*\n") }, + { strstr("You are on the bank of a stream."), + 182, 0, 242, 180, 84, 0, 0, 0, +strstr("The stream falls over several small boulders here and continues on **-.*\n") }, + { strstr("You are just inside the cave."), + 181, 267, 0, 0, 0, 0, 0, 0, +strstr("A steamy hot breath is belching from the depths of the earth within.* The\n\ +cave continues -.**\n") }, + { strstr("You are just inside the cave entrance."), + 274, 0, 0, 0, 0, 0, 0, 0, +strstr("The air is hot and sticky inside. The cave continues -. There is a \n\ +stone door in the wall +. A wooden sign in the dust reads in old elven\n\ +runes, \"GSRF KDIRE NLVEMP!\".**\n") }, + { strstr("You are at the edge of a huge chasm."), + 0, 0, 189, 0, 76, 0, 0, 0, +strstr("Several hundred feet down I can see the glimmer of placid water. The\n\ +rivulets drain over the edge and trickle down into the depths. It is \n\ +impossible to climb down without a rope.** The canyon continues -.*\n") }, + { strstr("You are on a dirt road."), + 192, 241, 240, 191, 88, 0, 0, 0, +strstr("The road winds through a coconut grove here. The road continues on -\n\ +and -.**\n") }, + { strstr("You are in a coconut palm grove near the road."), + 193, 233, 213, 192, 88, 0, 0, 0, +strstr("***The road is +.\n") }, + { strstr("You are at the clubhouse."), + 0, 193, 0, 0, 0, 0, 0, 0, +strstr("The clubhouse is built over the most inland part of the lagoon. Tropical\n\ +bananas and fragrant frangipani grow along the grassy shore. Walking across\n\ +the short wooden bridge, we enter. Along one wall is a bar with only a few\n\ +people seated at it. The restaurant and dance floor are closed off with\n\ +a 2 inch nylon rope. ****\n") }, + { strstr("You are in the stables."), + 0, 0, 0, 193, 0, 0, 0, 0, +strstr("Neighing horses snacking on hay and oats fill the stalls on both sides of\n\ +the barn. It is rather warm in here but that is not the most offensive\n\ +part. The old boards of the barn part just enough to let in dust laden\n\ +shafts of light. Flies swarm overhead and strafe the ground for dung.\n\ +My nose is beginning to itch. ****\n") }, + { strstr("You are in the old garage."), + 0, 0, 193, 0, 0, 0, 0, 0, +strstr("This is an old wooden building of the same vintage as the stables. Beneath\n\ +a sagging roof stand gardening tools and greasy rags. Parked in the center\n\ +is an underpowered Plymouth Volare' with a red and white striped golf cart\n\ +roof. ****\n") }, + { strstr("You are on a dirt road."), + 197, 197, 243, 197, 85, 0, 0, 0, +strstr("The road leads to a beautiful formal garden laced with stone walks and tropical\n\ +flowers and trees.** The road continues -. A walk leads -.\n") }, + { strstr("You are on a dirt road."), + 210, 199, 198, 220, 73, 0, 0, 0, +strstr("The road runs - and -.**\n") }, + { strstr("You are in a coconut grove near the road."), + 234, 223, 234, 233, 88, 0, 0, 0, +strstr("***The road is +.\n") }, + { strstr("You are on a dirt road."), + 233, 225, 223, 226, 82, 0, 0, 0, +strstr("The road continues - and -.**\n") }, + { strstr("The stream plummets over a cliff here."), + 182, 0, 0, 229, 84, 0, 0, 0, +strstr("Falling 10 agonizing meters into spray, only droplets of the stream are\n\ +left to dance off the floor below. I thought I saw a sparkle of gold\n\ +at the bottom of the falls, but now it is gone. There is no way down,\n\ +even with a strong rope. ****\n") }, + { strstr("You are on a dirt road."), + 0, 0, 244, 238, 85, 0, 0, 0, +strstr("**The road continues - and -.\n") }, + { strstr("You are on a dirt road."), + 0, 245, 0, 243, 88, 0, 0, 0, +strstr("*The road continues -* and -.\n") }, + { strstr("You are on a dirt road."), + 244, 234, 213, 136, 88, 0, 0, 0, +strstr("The road goes -* and *-.\n") }, + { strstr("You are in a low passage."), + 247, 160, 0, 0, 0, 0, 0, 0, +strstr("The passage is partially flooded here and it may be hazardous to proceed.\n\ +Water is surging from the tunnel and heading out to sea. Strange moaning\n\ +noises rise above the rushing of the water. They are as thin as a whispering\n\ +wind yet penetrate to my very soul. I think we have come too far...\n\ +The passage continues -.***\n") }, + { strstr("The walls are very close together here."), + 248, 0, 0, 0, 0, 0, 0, 0, +strstr("I can barely squeeze through the jagged opening. Slimy sea weeds provide\n\ +no footing at all. This tunnel seems to be an ancient lava tube. There is\n\ +a large room -.***\n") }, + { strstr("You are in the cathedral room."), + 249, 251, 249, 251, 0, 0, 0, 0, +strstr("Your light casts ghostly shadows on the walls but cannot pierce the \n\ +engulfing darkness overhead. The sound of water dripping echoes in the void.\n\ +*I can see no passages leading out of this room. We have definitely\n\ +come too far.*** \n") }, + { strstr("You are walking through a very round tunnel."), + 252, 0, 0, 0, 252, 1, 0, 0, +strstr("The round walls of this tunnel are amazingly smooth to the touch. A little\n\ +trickle of water flows down the center. The tunnel climbs steadily +.\n\ +The cave is beginning to flood again! Let's get out of here! ***\n") }, + { strstr("You are in the cathedral anteroom."), + 0, 0, 0, 248, 253, 1, 0, 0, +strstr("This small chamber with a flat stone floor is to one side of the cathedral \n\ +room. We appear to be at the bottom of a tall narrow shaft. There are many \n\ +puddles of water here. A staircase hewn from solid rock and black lava \n\ +leads up.*** The cathedral room is +.\n") }, + { strstr("You are in a wide chamber."), + 0, 0, 248, 254, 0, 0, 0, 0, +strstr("Water is sprinkling from the ceiling here. A shallow pool populated by a \n\ +myriad of blind white creatures sparkles in your light. Tiny shrimp and\n\ +crabs scurry away, frightened by the blinding rays.** The cave \n\ +continues - and -.\n") }, + { strstr("You are at the top of a sloping passage."), + 0, 0, 255, 256, 257, 1, 0, 0, +strstr("There is much algae growing here, both green and brown specimens. \n\ +Water from an underground sea surges and splashes against the slope of\n\ +the rock. The walls glisten with shiny minerals. High above, light\n\ +filters in through a narrow shaft.** A hallway here runs -\n\ +and -.\n") }, + { strstr("You are in an elaborately tiled room."), + 0, 0, 258, 0, 0, 0, 250, 0, +strstr("Large colorful tiles plate the floor and walls. The ceiling is a mosaic\n\ +of gems set in gold. Hopefully it is only our footsteps that are echoing in\n\ +this hollow chamber.** The room continues -. A stone staircase\n\ +leads down.*\n") }, + { strstr("You are at a dead end."), + 0, 0, 251, 0, 0, 0, 0, 0, +strstr("The walls here are alive with dark mussels. They click their shells menacingly\n\ +if we disturb them. ** The only exit is +.*\n") }, + { strstr("The tunnel is very low here."), + 0, 0, 259, 252, 0, 0, 0, 0, +strstr("I practically have to crawl on my knees to pass through this opening. The\n\ +air is stiflingly damp, but I can't hear any sounds of water dripping.**\n\ +The crawlspace continues -. The tunnel seems wider +.\n") }, + { strstr("This is the supply room."), + 0, 0, 252, 0, 0, 0, 0, 0, +strstr("Picks and shovels line the walls here, as well as hard hats, boxes of\n\ +dynamite, and a cartload of very high grade gold and silver ore.** \n\ +A tunnel leads off +.*\n") }, + { strstr("You have found a secret entrance to the catacombs."), + 0, 0, 0, 0, 216, 1, 252, 0, +strstr("I have a sickening feeling that we should not have entered the catacombs.\n\ +Below is a wet, seaweed covered floor. Above is a way out. ****\n") }, + { strstr("You are in the catacombs."), + 0, 0, 260, 253, 0, 0, 0, 0, +strstr("Ornate tombs and piles of treasure line the walls. Long spears with many\n\ +blades, fine swords and coats of mail, heaps of coins, jewelry, pottery, \n\ +and golden statues are tribute of past kings and queens.** The catacombs\n\ +continue - and -.\n") }, + { strstr("You are crawling on your stomach."), + 0, 0, 261, 255, 0, 0, 0, 0, +strstr("The passage is quite narrow and jagged, but the rock is no longer lava.\n\ +It appears to be a form of granite.** The crawlspace continues -, \n\ +but I would just as soon go -.\n") }, + { strstr("You are in the Sepulcher."), + 0, 0, 0, 258, 0, 0, 0, 0, +strstr("A single tomb is here. Encrusted with diamonds and opals, and secured with \n\ +straps of a very hard, untarnished silver, this tomb must be of a great king.\n\ +Vases overflowing with gold coins stand nearby. A line of verse on the wall\n\ +reads, \"Three he made and gave them to his daughters.\"****\n") }, + { strstr("The passage is wider here."), + 0, 0, 0, 259, 0, 0, 0, 0, +strstr("You are at the top of a flooded shaft. About a meter below the edge,\n\ +dark water rises and falls to the rhythm of the sea. A ladder goes\n\ +down into water here.*** A small crawlspace goes -.\n") }, + { strstr("You are at the bottom of a ladder."), + 0, 0, 0, 0, 261, 1, 263, 0, +strstr("This is a narrow platform to rest on before we continue either up or down this\n\ +rickety wooden ladder.****\n") }, + { strstr("You are standing in several inches of water."), + 264, 0, 265, 266, 262, 1, 0, 0, +strstr("This seems to be a working mine. Many different tunnels wander off following\n\ +glowing veins of precious metal. The floor is flooded here since we must\n\ +be nearly at sea level. A ladder leads up. ****\n") }, + { strstr("The tunnel here is blocked by broken rocks."), + 0, 263, 0, 0, 0, 0, 0, 0, +strstr("The way is blocked, but if you had some dynamite, we might be able to blast our\n\ +way through.* The passage goes -.**\n") }, + { strstr("The tunnel is too flooded to proceed."), + 0, 0, 0, 263, 0, 0, 0, 0, +strstr("Hidden shafts could swallow us if we tried to continue on down this tunnel.\n\ +The flooding is already up to my waist. Large crystals overhead shimmer\n\ +rainbows of reflected light.*** Let's go -.\n") }, + { strstr("The mine is less flooded here."), + 0, 0, 263, 0, 0, 0, 0, 0, +strstr("A meandering gold laden vein of quartz and blooming crystals of diamonds\n\ +and topaz burst from the walls of the cave. A passage goes -.***\n") }, + { strstr("You are inside the cave."), + 230, 268, 0, 0, 0, 0, 0, 0, +strstr("A hot steam swirls around our heads, and the walls are warm to the touch.\n\ +The trail winds + and +.**\n") }, + { strstr("You are in a rather large chamber."), + 267, 0, 0, 269, 0, 0, 269, 0, +strstr("Beds of ferns and palm leaves make several cozy nests along the walls. In the\n\ +center of the room is a throne of gold and silver which pulls out into a bed\n\ +of enormous size.*** A passageway leads down to the -.\n") }, + { strstr("You are walking along the edge of a huge abyss."), + 0, 0, 268, 0, 268, 1, 270, 0, +strstr("Steam is rising in great clouds from the immeasurable depths. A very narrow\n\ +trail winds down.** There is a tunnel +.*\n") }, + { strstr("You are on the edge of a huge abyss."), + 0, 0, 0, 0, 269, 1, 271, 0, +strstr("The trail winds farther down.****\n") }, + { strstr("You are winding your way along the abyss."), + 0, 0, 0, 0, 270, 1, 272, 0, +strstr("The trail continues up and down.****\n") }, + { strstr("You are on a wide shelf near the steamy abyss."), + 0, 273, 0, 0, 271, 1, 0, 0, +strstr("The stifling hot cave seems even hotter to me, staring down into this misty \n\ +abyss. A trail winds up.* A passageway leads -.**\n") }, + { strstr("You are in a wide tunnel leading to a fuming abyss."), + 272, 274, 0, 0, 0, 0, 0, 0, +strstr("The passageway winds through many beautiful formations of crystals and\n\ +sparkling minerals. The tunnel continues - and -.**\n") }, + { strstr("You are in a tunnel."), + 273, 231, 0, 0, 0, 0, 0, 0, +strstr("It is very warm in here. The smell of steam and hot rocks permeates the place.\n\ +The cave continues - and -.**\n") }, + { strstr("You are at the bottom of a pit."), + 0, 0, 0, 0, 232, 0, 0, 0, +strstr("I can see daylight far up at the mouth of the pit. A cool draft wafts down.\n\ +There doesn't seem to be any way out, and I don't remember how we came in.\n\ +If you had a rope it might be possible to climb out. ****\n") }, +}; diff --git a/games/battlestar/dayobjs.c b/games/battlestar/dayobjs.c new file mode 100644 index 0000000..4df318f --- /dev/null +++ b/games/battlestar/dayobjs.c @@ -0,0 +1,111 @@ +/* + * Copyright (c) 1983 Regents of the University of California, + * All rights reserved. Redistribution permitted subject to + * the terms of the Berkeley Software License Agreement. + */ + +#if !defined(lint) && !defined(pdp11) +static char sccsid[] = "@(#)dayobjs.c 1.3 4/24/85"; +#endif + +#include "externs.h" + +struct objs dayobjs[] = { + { 236, HORSE }, + { 237, CAR }, + { 275, POT }, + { 275, BAR }, + { 275, BLOCK }, + { 260, COINS }, + { 266, DARK }, + { 235, TIMER }, + { 51, 51 }, + { 59, 51 }, + { 48, 51 }, + { 66, 52 }, + { 65, 52 }, + { 19, BOMB }, + { 167, NATIVE }, + { 21, KNIFE }, + { 30, KNIFE }, + { 30, CLEAVER }, + { 260, SWORD }, + { 70, LAND }, + { 71, LAND }, + { 72, LAND }, + { 73, LAND }, + { 74, LAND }, + { 75, LAND }, + { 76, LAND }, + { 77, LAND }, + { 78, LAND }, + { 79, LAND }, + { 81, LAND }, + { 82, LAND }, + { 83, LAND }, + { 84, LAND }, + { 85, LAND }, + { 86, LAND }, + { 87, LAND }, + { 88, LAND }, + { 90, LAND }, + { 95, LAND }, + { 96, LAND }, + { 97, LAND }, + { 99, LAND }, + { 100, LAND }, + { 104, LAND }, + { 172, WOODSMAN }, + { 172, DEADWOOD }, + { 172, MALLET }, + { 146, ELF }, + { 146, HALBERD }, + { 146, SHIELD }, + { 190, TWO_HANDED }, + { 190, POTION }, + { 142, BROAD }, + { 258, MAIL }, + { 258, HELM }, + { 21, MAID }, + { 7, VIPER }, + { 216, SHOES }, + { 64, CYLON }, + { 36, CYLON }, + { 49, CYLON }, + { 8, ROBE }, + { 13, AMULET }, + { 20, LASER }, + { 126, BATHGOD }, + { 26, GRENADE }, + { 256, GRENADE }, + { 237, CHAIN }, + { 237, COMPASS }, + { 218, LEVIS }, + { 164, MACE }, + { 137, SHOVEL }, + { 11, COINS }, + { 24, MATCHES }, + { 235, MATCHES }, + { 93, MAN }, + { 109, PAPAYAS }, + { 110, PINEAPPLE }, + { 152, PINEAPPLE }, + { 154, PINEAPPLE }, + { 111, KIWI }, + { 149, MANGO }, + { 112, COCONUTS }, + { 150, COCONUTS }, + { 151, COCONUTS }, + { 153, COCONUTS }, + { 192, COCONUTS }, + { 204, COCONUTS }, + { 207, COCONUTS }, + { 209, COCONUTS }, + { 213, COCONUTS }, + { 240, COCONUTS }, + { 218, RING }, + { 130, BRACELET }, + { 93, GIRL }, + { 268, LAMPON }, + 0 +}; diff --git a/games/battlestar/externs.h b/games/battlestar/externs.h new file mode 100644 index 0000000..146bf8e --- /dev/null +++ b/games/battlestar/externs.h @@ -0,0 +1,286 @@ +/* + * Copyright (c) 1983 Regents of the University of California, + * All rights reserved. Redistribution permitted subject to + * the terms of the Berkeley Software License Agreement. + */ + +/* @(#)externs.h 1.3.1 1996/10/26 */ + +#include +#include + +#define PATH(x) "/usr/games/lib/x" +#define logfile PATH(battlestar.log) +#define BATTLESTRINGS PATH(battle_strings) + +#define BITS (8 * sizeof (int)) + +#define OUTSIDE (position > 68 && position < 246 && position != 218) +#define rnd(x) (rand() % (x)) +#define max(a,b) ((a) < (b) ? (b) : (a)) +#define testbit(array, index) (array[index/BITS] & (1 << (index % BITS))) +#define setbit(array, index) (array[index/BITS] |= (1 << (index % BITS))) +#define clearbit(array, index) (array[index/BITS] &= ~(1 << (index % BITS))) + + /* well known rooms */ +#define FINAL 275 +#define GARDEN 197 +#define POOLS 126 +#define DOCK 93 + + /* word types */ +#define VERB 0 +#define OBJECT 1 +#define NOUNS 2 +#define PREPS 3 +#define ADJS 4 +#define CONJ 5 + + /* words numbers */ +#define KNIFE 0 +#define SWORD 1 +#define LAND 2 +#define WOODSMAN 3 +#define TWO_HANDED 4 +#define CLEAVER 5 +#define BROAD 6 +#define MAIL 7 +#define HELM 8 +#define SHIELD 9 +#define MAID 10 +#define BODY 10 +#define VIPER 11 +#define LAMPON 12 +#define SHOES 13 +#define CYLON 14 +#define PAJAMAS 15 +#define ROBE 16 +#define AMULET 17 +#define MEDALION 18 +#define TALISMAN 19 +#define DEADWOOD 20 +#define MALLET 21 +#define LASER 22 +#define BATHGOD 23 +#define NORMGOD 24 +#define GRENADE 25 +#define CHAIN 26 +#define ROPE 27 +#define LEVIS 28 +#define MACE 29 +#define SHOVEL 30 +#define HALBERD 31 +#define COMPASS 32 +#define CRASH 33 +#define ELF 34 +#define FOOT 35 +#define COINS 36 +#define MATCHES 37 +#define MAN 38 +#define PAPAYAS 39 +#define PINEAPPLE 40 +#define KIWI 41 +#define COCONUTS 42 +#define MANGO 43 +#define RING 44 +#define POTION 45 +#define BRACELET 46 +#define GIRL 47 +#define GIRLTALK 48 +#define DARK 49 +#define TIMER 50 +#define CHAR 53 +#define BOMB 54 +#define DEADGOD 55 +#define DEADTIME 56 +#define DEADNATIVE 57 +#define NATIVE 58 +#define HORSE 59 +#define CAR 60 +#define POT 61 +#define BAR 62 +#define BLOCK 63 +#define NUMOFOBJECTS 64 + /* non-objects below */ +#define UP 1000 +#define DOWN 1001 +#define AHEAD 1002 +#define BACK 1003 +#define RIGHT 1004 +#define LEFT 1005 +#define TAKE 1006 +#define USE 1007 +#define LOOK 1008 +#define QUIT 1009 +#define NORTH 1010 +#define SOUTH 1011 +#define EAST 1012 +#define WEST 1013 +#define SU 1014 +#define DROP 1015 +#define TAKEOFF 1016 +#define DRAW 1017 +#define PUTON 1018 +#define WEARIT 1019 +#define PUT 1020 +#define INVEN 1021 +#define EVERYTHING 1022 +#define AND 1023 +#define KILL 1024 +#define RAVAGE 1025 +#define UNDRESS 1026 +#define THROW 1027 +#define LAUNCH 1028 +#define LANDIT 1029 +#define LIGHT 1030 +#define FOLLOW 1031 +#define KISS 1032 +#define LOVE 1033 +#define GIVE 1034 +#define SMITE 1035 +#define SHOOT 1036 +#define ON 1037 +#define OFF 1038 +#define TIME 1039 +#define SLEEP 1040 +#define DIG 1041 +#define EAT 1042 +#define SWIM 1043 +#define DRINK 1044 +#define DOOR 1045 +#define SAVE 1046 +#define RIDE 1047 +#define DRIVE 1048 +#define SCORE 1049 +#define BURY 1050 +#define JUMP 1051 +#define KICK 1052 + + /* injuries */ +#define ARM 6 /* broken arm */ +#define RIBS 7 /* broken ribs */ +#define SPINE 9 /* broken back */ +#define SKULL 11 /* fractured skull */ +#define INCISE 10 /* deep incisions */ +#define NECK 12 /* broken NECK */ +#define NUMOFINJURIES 13 + + /* notes */ +#define CANTLAUNCH 0 +#define LAUNCHED 1 +#define CANTSEE 2 +#define CANTMOVE 3 +#define JINXED 4 +#define DUG 5 +#define NUMOFNOTES 6 + + /* fundamental constants */ +#define NUMOFROOMS 275 +#define NUMOFWORDS ((NUMOFOBJECTS + BITS - 1) / BITS) +#define LINELENGTH 81 + +#define TODAY 0 +#define TONIGHT 1 +#define CYCLE 100 + + /* initial variable values */ +#define TANKFULL 250 +#define TORPEDOES 10 +#define MAXWEIGHT 60 +#define MAXCUMBER 10 + +struct room { +#ifdef pdp11 + unsigned name; +#else + char *name; +#endif + int link[8]; +#define north link[0] +#define south link[1] +#define east link[2] +#define west link[3] +#define up link[4] +#define access link[5] +#define down link[6] +#define flyhere link[7] +#ifdef pdp11 + unsigned desc; +#else + char *desc; +#endif + unsigned int objects[NUMOFWORDS]; +}; +struct room dayfile[]; +struct room nightfile[]; +struct room *location; + + /* object characteristics */ +#ifdef pdp11 +unsigned objdes[NUMOFOBJECTS]; +#else +char *objdes[NUMOFOBJECTS]; +#endif +char *objsht[NUMOFOBJECTS]; +char *ouch[NUMOFINJURIES]; +int objwt[NUMOFOBJECTS]; +int objcumber[NUMOFOBJECTS]; + + /* current input line */ +#define NWORD 20 /* words per line */ +char words[NWORD][15]; +int wordvalue[NWORD]; +int wordtype[NWORD]; +int wordcount, wordnumber; + +char *truedirec(), *rate(); +char *getcom(), *getword(); + + /* state of the game */ +int Time; +int position; +int direction; +int left, right, ahead, back; +int clock, fuel, torps; +int carrying, encumber; +int rythmn; +int followfight; +int ate; +int snooze; +int meetgirl; +int followgod; +int godready; +int win; +int wintime; +int wiz; +int tempwiz; +int matchlight, matchcount; +int loved; +int pleasure, power, ego; +int WEIGHT; +int CUMBER; +int notes[NUMOFNOTES]; +unsigned int inven[NUMOFWORDS]; +unsigned int wear[NUMOFWORDS]; +char beenthere[NUMOFROOMS+1]; +char injuries[NUMOFINJURIES]; + +char uname[9]; + +struct wlist { + char *string; + int value, article; + struct wlist *next; +}; +#define HASHSIZE 256 +#define HASHMUL 81 +#define HASHMASK (HASHSIZE - 1) +struct wlist *hashtab[HASHSIZE]; +struct wlist wlist[]; + +struct objs { + short room; + short obj; +}; +struct objs dayobjs[]; +struct objs nightobjs[]; diff --git a/games/battlestar/fly.c b/games/battlestar/fly.c new file mode 100644 index 0000000..f31f1a2 --- /dev/null +++ b/games/battlestar/fly.c @@ -0,0 +1,258 @@ +/* + * Copyright (c) 1983 Regents of the University of California, + * All rights reserved. Redistribution permitted subject to + * the terms of the Berkeley Software License Agreement. + */ + +#if !defined(lint) && !defined(pdp11) +static char sccsid[] = "@(#)fly.c 1.3 4/24/85"; +#endif + +#include "externs.h" +#undef UP +#include + +#define abs(a) ((a) < 0 ? -(a) : (a)) +#define MIDR (LINES/2 - 1) +#define MIDC (COLS/2 - 1) + +int row, column; +int dr = 0, dc = 0; +char destroyed; +int clock = 120; /* time for all the flights in the game */ +char cross = 0; +int (*oldsig)(); + +succumb() +{ + switch (oldsig) { + case SIG_DFL: + endfly(); + exit(1); + case SIG_IGN: + break; + default: + endfly(); + (*oldsig)(); + } +} + +visual() +{ + int moveenemy(); + + destroyed = 0; + savetty(); + if(initscr() == ERR){ + puts("Whoops! No more memory..."); + return(0); + } + oldsig = signal(SIGINT, succumb); + crmode(); + noecho(); + screen(); + row = rnd(LINES-3) + 1; + column = rnd(COLS-2) + 1; + moveenemy(); + for (;;) { + switch(getchar()){ + + case 'h': + case 'r': + dc = -1; + fuel--; + break; + + case 'H': + case 'R': + dc = -5; + fuel -= 10; + break; + + case 'l': + dc = 1; + fuel--; + break; + + case 'L': + dc = 5; + fuel -= 10; + break; + + case 'j': + case 'u': + dr = 1; + fuel--; + break; + + case 'J': + case 'U': + dr = 5; + fuel -= 10; + break; + + case 'k': + case 'd': + dr = -1; + fuel--; + break; + + case 'K': + case 'D': + dr = -5; + fuel -= 10; + break; + + case '+': + if (cross){ + cross = 0; + notarget(); + } + else + cross = 1; + break; + + case ' ': + case 'f': + if (torps){ + torps -= 2; + blast(); + if (row == MIDR && column - MIDC < 2 && MIDC - column < 2){ + destroyed = 1; + alarm(0); + } + } + else + mvaddstr(0,0,"*** Out of torpedoes. ***"); + break; + + case 'q': + endfly(); + return(0); + + default: + mvaddstr(0,26,"Commands = r,R,l,L,u,U,d,D,f,+,q"); + continue; + + case EOF: + break; + } + if (destroyed){ + endfly(); + return(1); + } + if (clock <= 0){ + endfly(); + die(); + } + } +} + +screen() +{ + register int r,c,n; + int i; + + clear(); + i = rnd(100); + for (n=0; n < i; n++){ + r = rnd(LINES-3) + 1; + c = rnd(COLS); + mvaddch(r, c, '.'); + } + mvaddstr(LINES-1-1,21,"TORPEDOES FUEL TIME"); + refresh(); +} + +target() +{ + register int n; + + move(MIDR,MIDC-10); + addstr("------- + -------"); + for (n = MIDR-4; n < MIDR-1; n++){ + mvaddch(n,MIDC,'|'); + mvaddch(n+6,MIDC,'|'); + } +} + +notarget() +{ + register int n; + + move(MIDR,MIDC-10); + addstr(" "); + for (n = MIDR-4; n < MIDR-1; n++){ + mvaddch(n,MIDC,' '); + mvaddch(n+6,MIDC,' '); + } +} + +blast() +{ + register int n; + + alarm(0); + move(LINES-1, 24); + printw("%3d", torps); + for(n = LINES-1-2; n >= MIDR + 1; n--){ + mvaddch(n, MIDC+MIDR-n, '/'); + mvaddch(n, MIDC-MIDR+n, '\\'); + refresh(); + } + mvaddch(MIDR,MIDC,'*'); + for(n = LINES-1-2; n >= MIDR + 1; n--){ + mvaddch(n, MIDC+MIDR-n, ' '); + mvaddch(n, MIDC-MIDR+n, ' '); + refresh(); + } + alarm(1); +} + +moveenemy() +{ + double d; + int oldr, oldc; + + oldr = row; + oldc = column; + if (fuel > 0){ + if (row + dr <= LINES-3 && row + dr > 0) + row += dr; + if (column + dc < COLS-1 && column + dc > 0) + column += dc; + } else if (fuel < 0){ + fuel = 0; + mvaddstr(0,60,"*** Out of fuel ***"); + } + d = (double) ((row - MIDR)*(row - MIDR) + (column - MIDC)*(column - MIDC)); + if (d < 16){ + row += (rnd(9) - 4) % (4 - abs(row - MIDR)); + column += (rnd(9) - 4) % (4 - abs(column - MIDC)); + } + clock--; + mvaddstr(oldr, oldc - 1, " "); + if (cross) + target(); + mvaddstr(row, column - 1, "/-\\"); + move(LINES-1, 24); + printw("%3d", torps); + move(LINES-1, 42); + printw("%3d", fuel); + move(LINES-1, 57); + printw("%3d", clock); + refresh(); + signal(SIGALRM, moveenemy); + alarm(1); +} + +endfly() +{ + alarm(0); + signal(SIGALRM, SIG_DFL); + mvcur(0,COLS-1,LINES-1,0); + delwin(stdscr); + endwin(); + signal(SIGTSTP, SIG_DFL); + signal(SIGINT, oldsig); +} diff --git a/games/battlestar/getcom.c b/games/battlestar/getcom.c new file mode 100644 index 0000000..9c46a1d --- /dev/null +++ b/games/battlestar/getcom.c @@ -0,0 +1,72 @@ +/* + * Copyright (c) 1983 Regents of the University of California, + * All rights reserved. Redistribution permitted subject to + * the terms of the Berkeley Software License Agreement. + */ + +#if !defined(lint) && !defined(pdp11) +static char sccsid[] = "@(#)getcom.c 1.3 4/24/85"; +#endif + +#include +#include + +char * +getcom(buf, size, prompt, error) + char *buf; + int size; + char *prompt, *error; +{ + for (;;) { + fputs(prompt, stdout); + if (fgets(buf, size, stdin) == 0) { + clearerr(stdin); + continue; + } + while (isspace(*buf)) + buf++; + if (*buf) + break; + if (error) + puts(error); + } + return (buf); +} + + +/* + * shifts to UPPERCASE if flag > 0, lowercase if flag < 0, + * and leaves it unchanged if flag = 0 + */ +char * +getword(buf1, buf2, flag) + register char *buf1, *buf2; + register flag; +{ + while (isspace(*buf1)) + buf1++; + if (*buf1 != ',') { + if (!*buf1) { + *buf2 = 0; + return (0); + } + while (*buf1 && !isspace(*buf1) && *buf1 != ',') + if (flag < 0) + if (isupper(*buf1)) + *buf2++ = tolower(*buf1++); + else + *buf2++ = *buf1++; + else if (flag > 0) + if (islower(*buf1)) + *buf2++ = toupper(*buf1++); + else + *buf2++ = *buf1++; + else + *buf2++ = *buf1++; + } else + *buf2++ = *buf1++; + *buf2 = 0; + while (isspace(*buf1)) + buf1++; + return (*buf1 ? buf1 : 0); +} diff --git a/games/battlestar/globals.c b/games/battlestar/globals.c new file mode 100644 index 0000000..a4f5a3f --- /dev/null +++ b/games/battlestar/globals.c @@ -0,0 +1,198 @@ +/* + * Copyright (c) 1983 Regents of the University of California, + * All rights reserved. Redistribution permitted subject to + * the terms of the Berkeley Software License Agreement. + */ + +#if !defined(lint) && !defined(pdp11) +static char sccsid[] = "@(#)globals.c 1.3 4/24/85"; +#endif + +#include "externs.h" + +#define strstr(x) x + +int WEIGHT = MAXWEIGHT; +int CUMBER = MAXCUMBER; + +#ifdef pdp11 +unsigned objdes[NUMOFOBJECTS] = { +#else +char *objdes[NUMOFOBJECTS] = { +#endif + strstr("There is a knife here"), + strstr("There is an exquisitely crafted sword and scabbard here."), + 0, /* can land from here */ + strstr("There is a fierce woodsman here brandishing a heavy mallet."), + strstr("There is an unweildly two-handed sword here."), + strstr("There is a bloody meat cleaver here."), + strstr("A rusty broadsword is lying here."), + strstr("There is an ancient coat of finely woven mail here."), + strstr("There is a old dented helmet with an ostrich plume here."), + strstr("There is a shield of some native tribe here."), + strstr("The maid's body is lying here. She was murdered!"), + strstr("There is a Viper ready for launch here."), + strstr("A kerosene lantern is burning luridly here."), + strstr("An old pair of shoes has been discarded here."), + 0, /* cylon */ + strstr("There is a pair of pajamas here."), + strstr("A kingly robe of royal purple and spun gold is draped here."), + strstr("There is a strange golden amulet on the floor here."), + strstr("A medallion of solid gold shimmers on the ground nearby."), + strstr("A talisman of gold is lying here."), + strstr("A dead woodsman has fallen here. He was savagely murdered."), + strstr("A heavy wooden mallet lies nearby."), + strstr("There is a laser pistol here."), + strstr("A flower-like young goddess is bathing in the hot mineral pools. She is \nwatching you, but continues to steep and sing softly."), + strstr("The goddess is reclining on a bed of ferns and studying you intently."), + strstr("There is a grenade here"), + strstr("There is a length of heavy chain here."), + strstr("There is a stout rope here."), + strstr("There is a pair of Levi's here."), + strstr("A bloody mace is lying on the ground here."), + strstr("There is a shovel here."), + strstr("A long, sharp halberd is propped up here."), + strstr("There is a compass here"), + strstr("Wreckage and smoldering debris from a crash litter the ground here."), + strstr("A woodland Elf armed with a shield and deadly halberd lunges toward you!"), + strstr("I think I hear footsteps behind us."), + strstr("There are a few coins here."), + strstr("There are some matches here."), + strstr("An unctuous man in a white suit and a dwarf are standing here."), + strstr("There are some ripe papayas here."), + strstr("There is a ripe pineapple here."), + strstr("There are some kiwi fruit here."), + strstr("There are some coconuts here."), + strstr("There is a ripe mango here."), + strstr("There is a sparkling diamond ring here."), + strstr("There is a colorful pink potion in a small crystal vial here."), + strstr("A gold bracelet is on the ground here."), + strstr("A swarthy woman with stern features pulls you aside from the crowd,\n'I must talk to you -- but not here. Meet me at midnight in the gardens.'"), + strstr("The swarthy woman has been awaiting you anxiousy. 'I must warn you that the\nIsland has anticipated your Quest. You will not be welcomed. The Darkness is\nstrong where you must search. Seek not the shadows save only at night, for\nthen are they the weakest. In the mountains far from here a canyon winds\nwith ferns and streams and forgotten vines. There you must go. Take this\nrope.'"), + strstr("Out from the shadows a figure leaps! His black cape swirls around, and he\nholds a laser sword at your chest. 'So, you have come to fulfill the Quest.\nHa! Your weapons are no match for me!'"), + strstr("An old timer with one eye missing and no money for a drink sits at the bar."), + strstr("You are flying through an asteroid field!"), + strstr("A planet is nearby."), + strstr("The ground is charred here."), + strstr("There is a thermonuclear warhead here."), + strstr("The fragile, beautiful young goddess lies here. You murdered her horribly."), + strstr("The old timer is lying here. He is dead."), + strstr("The native girl's body is lying here."), + strstr("A native girl is sitting here."), + strstr("A gorgeous white stallion is standing here."), + strstr("The keys are in the ignition."), + strstr("A pot of pearls and jewels is sitting here."), + strstr("A bar of solid gold is here."), + strstr("There is a 10 kilogram diamond block here.") + +}; + +char *objsht[NUMOFOBJECTS] = { + "knife", + "fine sword", + 0, + "Woodsman", + "two-handed sword", + "meat cleaver", + "broadsword", + "coat of mail", + "plumed helmet", + "shield", + "maid's body", + "viper", + "lantern", + "shoes", + 0, + "pajamas", + "robe", + "amulet", + "medallion", + "talisman", + "woodsman's body", + "wooden mallet", + "laser", + 0, + 0, + "grenade", + "chain", + "rope", + "levis", + "mace", + "shovel", + "halberd", + "compass", + 0, + "Elf", + 0, + "coins", + "match book", + 0, + "papayas", + "pineapple", + "kiwi", + "coconuts", + "mango", + "ring", + "potion", + "bracelet", + 0, + 0, + "Dark Lord", + 0, + 0, + 0, + 0, + "warhead", + "goddess's body", + "old timer's body", + "girl's body", + 0, + "stallion", + "car", + "pot of jewels", + "bar of gold", + "diamond block" +}; + +char *ouch[NUMOFINJURIES] = { + "some minor abrasions", + "some minor lacerations", + "a minor puncture wound", + "a minor amputation", + "a sprained wrist", + "a fractured ankle and shattered kneecap", + "a broken arm and dislocated shoulder", + "a few broken ribs", + "a broken leg and torn ligaments", + "a broken back and ruptured spleen", + "some deep incisions and a loss of blood", + "a fractured skull and mashed face", + "a broken neck" +}; + +int objwt[NUMOFOBJECTS] = { + 1, 5, 0, 10, 15, 2, 10, 10, + 3, 5, 50, 2500, 2, 1, 100, 1, + 2, 1, 1, 1, 60, 10, 5, 0, + 50, 5, 15, 5, 1, 20, 10, 10, + 0, 0, 0, 0, 1, 0, 0, 1, + 1, 1, 2, 1, 0, 0, 0, 0, + 0, 0, 100, 0, 0, 0, 55, 47, + 50, 45, 45, 100, 2000, 30, 20, 10 +}; + +int objcumber[NUMOFOBJECTS] = { + 1, 5, 0, 150, 10, 1, 5, 2, + 2, 1, 5, 10, 1, 1, 10, 1, + 1, 1, 1, 1, 7, 5, 4, 0, + 0, 1, 1, 1, 1, 5, 4, 4, + 1, 0, 0, 0, 1, 0, 0, 1, + 1, 1, 3, 1, 0, 0, 1, 0, + 0, 0, 10, 0, 0, 0, 7, 8, + 10, 8, 8, 10, 10, 3, 1, 2 +}; + +int win = 1; +int matchcount = 20; +int followgod = -1; +int followfight = -1; diff --git a/games/battlestar/init.c b/games/battlestar/init.c new file mode 100644 index 0000000..c9f6ec2 --- /dev/null +++ b/games/battlestar/init.c @@ -0,0 +1,103 @@ +/* + * Copyright (c) 1983 Regents of the University of California, + * All rights reserved. Redistribution permitted subject to + * the terms of the Berkeley Software License Agreement. + */ + +#if !defined(lint) && !defined(pdp11) +static char sccsid[] = "@(#)init.c 1.3.1 1996/10/26"; +#endif + +#include "externs.h" +#include + +initialize(startup) + char startup; +{ + register struct objs *p; + int die(); + + puts("Version 4.2, fall 1984."); + puts("First Adventure game written by His Lordship, the honorable"); + puts("Admiral D.W. Riggle\n"); + srand(getpid()); + getutmp(uname); + wiz = wizard(uname); + wordinit(); + if (startup) { + location = dayfile; + direction = NORTH; + Time = 0; + snooze = CYCLE * 1.5; + position = 22; + setbit(wear, PAJAMAS); + fuel = TANKFULL; + torps = TORPEDOES; + for (p = dayobjs; p->room != 0; p++) + setbit(location[p->room].objects, p->obj); + } else + restore(); + signal(SIGINT, die); +} + +getutmp(uname) + char *uname; +{ + struct passwd *ptr; + + ptr = getpwuid(getuid()); + strcpy(uname, ptr ? ptr->pw_name : ""); +} + +char *list[] = { /* hereditary wizards */ + "riggle", + "chris", + "games", + "edward", + "comay", + "yee", + "dmr", + "ken", + 0 +}; + +char *badguys[] = { + "wnj", + "root", + "ted", + 0 +}; + +wizard(uname) + char *uname; +{ + char flag; + + if (flag = checkout(uname)) + printf("You are the Great wizard %s.\n", uname); + return flag; +} + +checkout(uname) + register char *uname; +{ + register char **ptr; + + for (ptr = list; *ptr; ptr++) + if (strcmp(*ptr, uname) == 0) + return 1; + for (ptr = badguys; *ptr; ptr++) + if (strcmp(*ptr, uname) == 0) { + printf("You are the Poor anti-wizard %s. Good Luck!\n", + uname); + CUMBER = 3; + WEIGHT = 9; /* that'll get him! */ + clock = 10; + setbit(location[7].objects, WOODSMAN); /* viper room */ + setbit(location[20].objects, WOODSMAN); /* laser " */ + setbit(location[13].objects, DARK); /* amulet " */ + setbit(location[8].objects, ELF); /* closet */ + return 0; /* anything else, Chris? */ + } + return 0; +} diff --git a/games/battlestar/misc.c b/games/battlestar/misc.c new file mode 100644 index 0000000..652db46 --- /dev/null +++ b/games/battlestar/misc.c @@ -0,0 +1,35 @@ +/* + * Copyright (c) 1983 Regents of the University of California, + * All rights reserved. Redistribution permitted subject to + * the terms of the Berkeley Software License Agreement. + */ + +#if !defined(lint) && !defined(pdp11) +static char sccsid[] = "@(#)misc.c 1.2 4/24/85"; +#endif + +#include "externs.h" + +card(array, size) /* for beenthere, injuries */ + register char *array; + int size; +{ + register char *end = array + size; + register int i = 0; + + while (array < end) + if (*array++) + i++; + return (i); +} + +ucard(array) + register unsigned *array; +{ + register int j = 0, n; + + for (n = 0; n < NUMOFOBJECTS; n++) + if (testbit(array, n)) + j++; + return (j); +} diff --git a/games/battlestar/mkstr.c b/games/battlestar/mkstr.c new file mode 100644 index 0000000..358f71f --- /dev/null +++ b/games/battlestar/mkstr.c @@ -0,0 +1,291 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +/* + * Somewhat modified to key on strstr(" instead of error(", for use + * as a general purpose string stripper. Also replaces pointer with + * a (long) pointer. + */ + +#ifndef lint +char copyright[] = +"@(#) Copyright (c) 1980 Regents of the University of California.\n\ + All rights reserved.\n"; +#endif not lint + +#ifndef lint +static char sccsid[] = "@(#)mkstr.c 5.1 (Berkeley) 5/31/85"; +#endif not lint + +#include + +#define ungetchar(c) ungetc(c, stdin) + +long ftell(); +char *calloc(); +/* + * mkstr - create a string error message file by massaging C source + * + * Bill Joy UCB August 1977 + * + * Modified March 1978 to hash old messages to be able to recompile + * without addding messages to the message file (usually) + * + * Based on an earlier program conceived by Bill Joy and Chuck Haley + * + * Program to create a string error message file + * from a group of C programs. Arguments are the name + * of the file where the strings are to be placed, the + * prefix of the new files where the processed source text + * is to be placed, and the files to be processed. + * + * The program looks for 'strstr("' in the source stream. + * Whenever it finds this, the following characters from the '"' + * to a '"' are replaced by 'seekpt' where seekpt is a + * pointer into the error message file. + * If the '(' is not immediately followed by a '"' no change occurs. + * + * The optional '-' causes strings to be added at the end of the + * existing error message file for recompilation of single routines. + */ + + +FILE *mesgread, *mesgwrite; +char *progname; +char usagestr[] = "usage: %s [ - ] mesgfile prefix file ...\n"; +char name[100], *np; + +main(argc, argv) + int argc; + char *argv[]; +{ + char addon = 0; + + argc--, progname = *argv++; + if (argc > 1 && argv[0][0] == '-') + addon++, argc--, argv++; + if (argc < 3) + fprintf(stderr, usagestr, progname), exit(1); + mesgwrite = fopen(argv[0], addon ? "a" : "w"); + if (mesgwrite == NULL) + perror(argv[0]), exit(1); + mesgread = fopen(argv[0], "r"); + if (mesgread == NULL) + perror(argv[0]), exit(1); + inithash(); + argc--, argv++; + strcpy(name, argv[0]); + np = name + strlen(name); + argc--, argv++; + do { + strcpy(np, argv[0]); + if (freopen(name, "w", stdout) == NULL) + perror(name), exit(1); + if (freopen(argv[0], "r", stdin) == NULL) + perror(argv[0]), exit(1); + process(); + argc--, argv++; + } while (argc > 0); + exit(0); +} + +process() +{ + register char *cp; + register c; + + for (;;) { + c = getchar(); + if (c == EOF) + return; + if (c != 's') { + putchar(c); + continue; + } + if (match("strstr(")) { + printf("strstr("); + c = getchar(); + if (c != '"') + putchar(c); + else + copystr(); + } + } +} + +match(ocp) + char *ocp; +{ + register char *cp; + register c; + + for (cp = ocp + 1; *cp; cp++) { + c = getchar(); + if (c != *cp) { + while (ocp < cp) + putchar(*ocp++); + ungetchar(c); + return (0); + } + } + return (1); +} + +copystr() +{ + register c, ch; + char buf[512]; + register char *cp = buf; + long hashit(); + + for (;;) { + c = getchar(); + if (c == EOF) + break; + switch (c) { + + case '"': + *cp++ = 0; + goto out; + case '\\': + c = getchar(); + switch (c) { + + case 'b': + c = '\b'; + break; + case 't': + c = '\t'; + break; + case 'r': + c = '\r'; + break; + case 'n': + c = '\n'; + break; + case '\n': + continue; + case 'f': + c = '\f'; + break; + case '0': + c = 0; + break; + case '\\': + break; + default: + if (!octdigit(c)) + break; + c -= '0'; + ch = getchar(); + if (!octdigit(ch)) + break; + c <<= 7, c += ch - '0'; + ch = getchar(); + if (!octdigit(ch)) + break; + c <<= 3, c+= ch - '0', ch = -1; + break; + } + } + *cp++ = c; + } +out: + *cp = 0; + printf("%ld", hashit(buf, 1, NULL)); +} + +octdigit(c) + char c; +{ + + return (c >= '0' && c <= '7'); +} + +inithash() +{ + char buf[512]; + int mesgpt = 0; + + rewind(mesgread); + while (fgetNUL(buf, sizeof buf, mesgread) != NULL) { + hashit(buf, 0, mesgpt); + mesgpt += strlen(buf) + 2; + } +} + +#define NBUCKETS 511 + +struct hash { + long hval; + long hpt; + struct hash *hnext; +} *bucket[NBUCKETS]; + +long +hashit(str, really, fakept) + char *str; + char really; + unsigned fakept; +{ + int i; + register struct hash *hp; + char buf[512]; + long hashval = 0; + register char *cp; + + if (really) + fflush(mesgwrite); + for (cp = str; *cp;) + hashval = (hashval << 1) + *cp++; + i = hashval % NBUCKETS; + if (i < 0) + i += NBUCKETS; + if (really != 0) + for (hp = bucket[i]; hp != 0; hp = hp->hnext) + if (hp->hval == hashval) { + fseek(mesgread, (long) hp->hpt, 0); + fgetNUL(buf, sizeof buf, mesgread); +#ifdef DEBUG + fprintf(stderr, "Got (from %ld) %s\n", hp->hpt, buf); +#endif + if (strcmp(buf, str) == 0) + break; + } + if (!really || hp == 0) { + hp = (struct hash *) calloc(1, sizeof *hp); + hp->hnext = bucket[i]; + hp->hval = hashval; + hp->hpt = really ? ftell(mesgwrite) : fakept; + if (really) { + fwrite(str, sizeof (char), strlen(str) + 1, mesgwrite); + fwrite("\n", sizeof (char), 1, mesgwrite); + } + bucket[i] = hp; + } +#ifdef DEBUG + fprintf(stderr, "%s hashed to %ld at %ld\n", str, hp->hval, hp->hpt); +#endif + return (hp->hpt); +} + +#include +#include + +fgetNUL(obuf, rmdr, file) + char *obuf; + register int rmdr; + FILE *file; +{ + register c; + register char *buf = obuf; + + while (--rmdr > 0 && (c = getc(file)) != 0 && c != EOF) + *buf++ = c; + *buf++ = 0; + getc(file); + return ((feof(file) || ferror(file)) ? NULL : 1); +} diff --git a/games/battlestar/nightfile.c b/games/battlestar/nightfile.c new file mode 100644 index 0000000..f206781 --- /dev/null +++ b/games/battlestar/nightfile.c @@ -0,0 +1,1152 @@ +/* + * Copyright (c) 1983 Regents of the University of California, + * All rights reserved. Redistribution permitted subject to + * the terms of the Berkeley Software License Agreement. + */ + +#if !defined(lint) && !defined(pdp11) +static char sccsid[] = "@(#)nightfile.c 1.2 4/24/85"; +#endif + +#include "externs.h" + +#define strstr(x) x + +struct room nightfile[] = { + { 0 }, + { strstr("You are in the main hangar."), + 5, 2, 9, 3, 3, 1, 0, 0, +strstr("This is a huge bay where many fighters and cargo craft lie. Alarms are \n\ +sounding and fighter pilots are running to their ships. Above is a gallery\n\ +overlooking the bay. The scream of turbo engines is coming from +. The rest\n\ +of the hangar is +. There is an exit +.*\n") }, + { strstr("This is the landing bay."), + 1, 0, 10, 0, 0, 0, 0, 0, +strstr("Ships are landing here, some heavily damaged. Enemy fighters continually\n\ +strafe this vulnerable port. The main hangar is +, *\n\ +There is an exit +.*\n") }, + { strstr("You are in the gallery."), + 4, 0, 0, 0, 0, 0, 1, 0, +strstr("From here a view of the entire landing bay reveals that our battlestar\n\ +is near destruction. Fires are spreading out of control and laser blasts\n\ +lick at the shadows. The control room is +. ***\n") }, + { strstr("You are in the control room."), + 0, 3, 0, 0, 0, 0, 5, 0, +strstr("Several frantic technicians are flipping switches wildly but otherwise\n\ +this room seems fairly deserted. A weapons locker has been left open.\n\ +A staircase leads down. * There is a way -. ** \n") }, + { strstr("This is the launch room."), + 6, 1, 7, 0, 4, 1, 0, 0, +strstr("From the launch tubes here fighters blast off into space. Only one is left,\n\ +and it is guarded by two fierce men. A staircase leads up from here.\n\ +There is a cluttered workbench +. From the main hangar come sounds of great\n\ +explosions. The main hangar is +. The viper launch tubes are to the -.*\n") }, + { strstr("You are at the workbench."), + 0, 5, 7, 0, 0, 0, 0, 0, +strstr("Strange and unwieldy tools are arranged here including a lunch box \n\ +and pneumatic wrenches and turbo sprocket rockets.*\n\ +The launch room is +. The remaining viper is +.*\n") }, + { strstr("You are in the viper launch tube."), + 0, 5, 0, 5, 32, 0, 0, 0, +strstr("The two guards are eyeing you warily! ****\n") }, + { strstr("This is a walk in closet."), + 22, 0, 0, 0, 0, 0, 0, 0, +strstr("A wardrobe of immense magnitude greets the eye. Furs and robes of kings\n\ +hang on rack after rack. Silken gowns, capes woven with spun gold, and \n\ +delicate synthetic fabrics are stowed here. The bedroom is +.***\n") }, + { strstr("You are in a wide hallway leading to the main hangar."), + 0, 0, 11, 1, 0, 0, 0, 0, +strstr("The walls and ceiling here have been blasted through in several places.\n\ +It looks as if quite a battle has been fought for possession of the landing bay\n\ +Gaping corpses litter the floor.** The hallway continues +.\n\ +The main hangar is +.\n") }, + { strstr("You are in a wide hallway leading to the landing bay."), + 0, 0, 12, 2, 0, 0, 0, 0, +strstr("Most of the men and supplies needed in the main hangar come through this\n\ +corridor, but the wounded are forced to use it too. It very dank and\n\ +crowded here, and the floor is slippery with blood.**\n\ +The hallway continues -. The landing bay is +.\n") }, + { strstr("The hallway is very congested with rubble here."), + 0, 0, 0, 9, 13, 1, 0, 0, +strstr("It is too choked with broken steel girders and other debris to continue\n\ +on much farther. Above, the ceiling has caved in and it is possible to \n\ +climb up. There is not much chance to go -, -, or -.\n\ +But the hallway seems clearer +.\n") }, + { strstr("A wide hallway and a more narrow walkway meet here."), + 14, 15, 0, 10, 0, 0, 0, 0, +strstr("The intersection is crowded with the many wounded who have come up\n\ +the wide hallway and continued +. The walkway is less crowded +.\n\ +The wide hallway goes *-.\n") }, + { strstr("You are in what was once an elegant stateroom."), + 16, 0, 0, 0, 0, 0, 11, 0, +strstr("Whoever lived in this stateroom, he and his female companion\n\ +were mercilessly slain in their sleep. Clothes, trinkets and personal\n\ +belongings are scattered all across the floor. Through a hole in the\n\ +collapsed floor I can see a hallway below. A door is +.***\n") }, + { strstr("You're at the entrance to the sick bay."), + 17, 12, 18, 0, 0, 0, 0, 0, +strstr("The wounded are entering the sick bay in loudly moaning files.\n\ +The walkway continues - and +. A doctor is motioning for you to \n\ +come to the -. *\n") }, + { strstr("You're in the walkway."), + 12, 19, 0, 0, 0, 0, 0, 0, +strstr("Most of the men and supplies were coming from the armory. The walkway\n\ +continues -. The armory is +.**\n") }, + { strstr("These are the executive suites of the battlestar."), + 20, 13, 21, 22, 23, 1, 24, 0, +strstr("Luxurious staterooms carpeted with crushed velvet and adorned with beaten\n\ +gold open onto this parlor. A wide staircase with ivory banisters leads\n\ +up or down. This parlor leads into a hallway +. The bridal suite is +.\n\ +Other rooms lie - and +.\n") }, + { strstr("You're in a long dimly lit hallway."), + 0, 14, 25, 0, 0, 0, 0, 0, +strstr("This part of the walkway is deserted. There is a dead end +. The\n\ +entrance to the sickbay is +. The walkway turns sharply -.*\n") }, + { strstr("This is the sick bay."), + 0, 0, 0, 14, 0, 0, 0, 0, +strstr("Sinister nurses with long needles and pitiful aim probe the depths of suffering\n\ +here. Only the mortally wounded receive medical attention on a battlestar,\n\ +but afterwards they are thrown into the incinerators along with the rest.**\n\ +Nothing but death and suffering +. The walkway is +.\n") }, + { strstr("You're in the armory."), + 15, 26, 0, 0, 0, 0, 0, 0, +strstr("An armed guard is stationed here 365 sectars a yarn to protect the magazine.\n\ +The walkway is +. The magazine is +.**\n") }, + { strstr("The hallway ends here at the presidential suite."), + 27, 16, 0, 0, 0, 0, 0, 0, +strstr("The door to this suite is made from solid magnesium, and the entryway is\n\ +inlaid with diamonds and fire opals. The door is ajar +. The hallway\n\ +goes -.**\n") }, + { strstr("This is the maid's utility room."), + 0, 0, 0, 16, 0, 0, 0, 0, +strstr("What a gruesome sight! The maid has been brutally drowned in a bucket of\n\ +Pine Sol and repeatedly stabbed in the back with a knife.***\n\ +The hallway is +.\n") }, + { strstr("This is a luxurious stateroom."), + 0, 8, 16, 0, 0, 0, 0, 0, +strstr("The floor is carpeted with a soft animal fur and the great wooden furniture\n\ +is inlaid with strips of platinum and gold. Electronic equipment built\n\ +into the walls and ceiling is flashing wildly. The floor shudders and\n\ +the sounds of dull explosions rumble though the room. From a window in\n\ +the wall + comes a view of darkest space. There is a small adjoining\n\ +room +, and a doorway +.*\n") }, + { strstr("You are at the entrance to the dining hall."), + 0, 0, 28, 0, 0, 0, 16, 0, +strstr("A wide staircase with ebony banisters leads down here.**\n\ +The dining hall is to the -.*\n") }, + { strstr("This was once the first class lounge."), + 0, 0, 29, 0, 16, 1, 0, 0, +strstr("There is much rubble and destruction here that was not apparent elsewhere.\n\ +The walls and ceilings have broken in in some places. A staircase with\n\ +red coral banisters leads up. It is impossible to go - or -.\n\ +It seems a little clearer +.*\n") }, + { strstr("You are in a narrow stairwell."), + 0, 17, 0, 0, 30, 1, 0, 0, +strstr("These dusty and decrepit stairs lead up. There is no way -. The\n\ +hallway turns sharply -.**\n") }, + { strstr("You are in the magazine."), + 19, 0, 0, 0, 0, 0, 0, 0, +strstr("Rows and rows of neatly stacked ammunition for laser pistols and grenade\n\ +launchers are here. The armory is +.***\n") }, + { strstr("You're in the presidential suite."), + 0, 20, 0, 0, 0, 0, 0, 0, +strstr("Apparently the president has been assassinated. A scorched figure lies\n\ +face downward on the carpet clutching his chest.*\n\ +The hallway leads -.**\n") }, + { strstr("You are in the dining hall."), + 0, 30, 31, 23, 0, 0, 0, 0, +strstr("This was the seen of a mass suicide. Hundreds of ambassadors and assorted\n\ +dignitaries sit slumped over their breakfast cereal. I suppose the news\n\ +of the cylon attack killed them. There is a strange chill in this room. I\n\ +would not linger here. * The kitchen is +. Entrances + and +.\n") }, + { strstr("The debris is very thick here."), + 0, 11, 0, 24, 0, 0, 0, 0, +strstr("Broken furniture, fallen girders, and other rubble block the way.\n\ +There is not much chance to continue -, -, or -.\n\ +It would be best to go -.\n") }, + { strstr("You are in the kitchen."), + 28, 0, 0, 0, 0, 0, 0, 0, +strstr("This room is full of shining stainless steel and burnished bronze cookware. An \n\ +assortment of tropical fruits and vegetables as well as fine meats and cheeses \n\ +lies on a sterling platter. The chef, unfortunately, has been skewered like a \n\ +side of beef. The dining room is +. ** There is a locked door +.\n") }, + { strstr("You are in an arched entry leading to the dining room."), + 0, 0, 0, 28, 0, 0, 0, 0, +strstr("The door leading out is bolted shut from the outside and is very strong.***\n\ +The dining room is +.\n") }, + { strstr("You are in space."), + 33, 34, 35, 36, 37, 1, 33, 1, +strstr("****\n") }, + { strstr("You are in space."), + 38, 32, 39, 40, 41, 1, 42, 1, +strstr("****\n") }, + { strstr("You are in space."), + 32, 44, 45, 46, 47, 1, 48, 1, +strstr("****\n") }, + { strstr("You are in space."), + 40, 45, 49, 32, 50, 1, 51, 1, +strstr("****\n") }, + { strstr("You are in space."), + 41, 46, 32, 52, 53, 1, 54, 1, +strstr("****\n") }, + { strstr("You are in space."), + 42, 47, 50, 53, 55, 1, 32, 1, +strstr("****\n") }, + { strstr("You are in space."), + 43, 48, 51, 54, 32, 1, 56, 1, +strstr("****\n") }, + { strstr("You are in space."), + 57, 33, 40, 41, 42, 1, 43, 1, +strstr("****\n") }, + { strstr("You are in space."), + 39, 35, 57, 33, 58, 1, 59, 1, +strstr("****\n") }, + { strstr("You are in space."), + 39, 36, 33, 59, 60, 1, 61, 1, +strstr("****\n") }, + { strstr("You are in space."), + 39, 37, 58, 60, 62, 1, 33, 1, +strstr("****\n") }, + { strstr("You are in space."), + 39, 38, 59, 61, 33, 1, 63, 1, +strstr("****\n") }, + { strstr("You are in space."), + 34, 64, 45, 46, 47, 1, 48, 1, +strstr("****\n") }, + { strstr("You are in space."), + 35, 44, 49, 34, 50, 1, 51, 1, +strstr("****\n") }, + { strstr("You are in space."), + 36, 44, 34, 52, 53, 1, 54, 1, +strstr("****\n") }, + { strstr("You are in space."), + 37, 44, 50, 53, 55, 1, 34, 1, +strstr("****\n") }, + { strstr("You are in space."), + 38, 44, 51, 54, 34, 1, 56, 1, +strstr("****\n") }, + { strstr("You are in space."), + 49, 49, 52, 35, 49, 1, 49, 1, +strstr("****\n") }, + { strstr("You are in space."), + 58, 47, 49, 37, 55, 1, 35, 1, +strstr("****\n") }, + { strstr("You are in space."), + 59, 48, 49, 38, 35, 1, 56, 1, +strstr("****\n") }, + { strstr("You are in space."), + 52, 52, 36, 49, 52, 1, 52, 1, +strstr("****\n") }, + { strstr("You are in space."), + 60, 46, 37, 52, 55, 1, 36, 1, +strstr("****\n") }, + { strstr("You are in space."), + 61, 48, 38, 52, 36, 1, 56, 1, +strstr("****\n") }, + { strstr("You are in space."), + 62, 55, 55, 55, 56, 1, 37, 1, +strstr("****\n") }, + { strstr("You are in space."), + 56, 56, 56, 56, 38, 1, 55, 1, +strstr("****\n") }, + { strstr("You are in space."), + 65, 39, 57, 57, 57, 1, 57, 1, +strstr("****\n") }, + { strstr("You are in space."), + 39, 50, 49, 42, 62, 1, 40, 1, +strstr("****\n") }, + { strstr("You are in space."), + 39, 51, 49, 43, 40, 1, 63, 1, +strstr("****\n") }, + { strstr("You are in space."), + 39, 53, 43, 59, 62, 1, 41, 1, +strstr("****\n") }, + { strstr("You are in space."), + 39, 54, 43, 59, 41, 1, 56, 1, +strstr("****\n") }, + { strstr("You are in space."), + 39, 55, 62, 62, 56, 1, 42, 1, +strstr("****\n") }, + { strstr("You are in space."), + 39, 56, 35, 36, 43, 1, 55, 1, +strstr("****\n") }, + { strstr("You are in space."), + 44, 66, 66, 66, 66, 1, 66, 1, +strstr("****\n") }, + { strstr("You are in space."), + 67, 57, 67, 67, 67, 1, 67, 1, +strstr("****\n") }, + { strstr("You are in space."), + 64, 68, 68, 68, 68, 1, 68, 1, +strstr("****\n") }, + { strstr("You are orbiting a small blue planet."), + 67, 67, 67, 67, 65, 1, 69, 1, +strstr("****\n") }, + { strstr("You are orbiting a tropical planet."), + 68, 68, 68, 68, 66, 1, 70, 1, +strstr("****\n") }, + { strstr("You are flying through a dense fog."), + 69, 69, 69, 69, 69, 1, 69, 1, +strstr("A cold grey sea of mist is swirling around the windshield and water droplets\n\ +are spewing from the wingtips. Ominous shadows loom in the darkness and it\n\ +feels as if a trap is closing around us. I have lost all sense of direction.\n\ +****\n") }, + { strstr("You are approaching an island."), + 71, 72, 73, 74, 68, 1, 0, 1, +strstr("Feather palms outlined by mellow moonlight and a silvery black ocean line\n\ +the perimeter of the island. Mighty mountains of emerald and amethyst rise\n\ +like jagged teeth from black gums. The land rises sharply +. The shore\n\ +line stretches on *+.*\n") }, + { strstr("You are flying over a mountainous region."), + 75, 73, 76, 77, 68, 1, 0, 1, +strstr("Below is a shadow filled canyon with luminous waterfalls plummeting down beyond sight and looming spires and pinnacles. **The ocean is +.*\n") }, + { strstr("You are flying over the ocean."), + 74, 78, 78, 78, 68, 1, 0, 1, +strstr("You bank over the water and your wingtips dip low to the green waves. The\n\ +sea is very shallow here and the white coral beds beneath us teem with \n\ +shadowy fish.****\n") }, + { strstr("You are flying over the beach."), + 71, 72, 79, 74, 68, 1, 80, 1, +strstr("A warm gentle surf caresses the beach here. The land rises\n\ +sharply +.* The beach is lost in low cliffs +.*\n") }, + { strstr("You are flying over a large lagoon."), + 81, 72, 73, 82, 68, 1, 0, 1, +strstr("The water's brink winds tortuously inland. There are some lights +.***\n") }, + { strstr("You are flying over a gently sloping plane."), + 83, 71, 84, 85, 68, 1, 0, 1, +strstr("The ground appears to be choked with vegetation.* The terrain is more\n\ +rugged +.**\n") }, + { strstr("You are flying through a gorge."), + 0, 0, 86, 71, 68, 1, 102, 1, +strstr("This is a narrow, steep sided canyon lined with plants. The stars above\n\ +glisten through the over hanging trees. The gorge leads to the\n\ +sea** +, and to a tumultuous origin +.\n") }, + { strstr("You are flying over a plantation."), + 85, 81, 71, 88, 68, 1, 89, 1, +strstr("It might be possible to land here, but not in the dark.* There are some lights\n\ ++ and *+.\n") }, + { strstr("You are over the ocean."), + 72, 78, 79, 74, 68, 1, 0, 1, +strstr("The deep green swells foam and roll into the shore **+*.\n") }, + { strstr("You are flying along the coast."), + 86, 72, 90, 73, 68, 1, 91, 1, +strstr("The coastline here is very rocky. The surf in some places is violent\n\ +and explodes in a shower of sparkling, moonlit spray. ****\n") }, + { strstr("This is a beautiful coral beach."), + 106, 0, 107, 108, 73, 0, 0, 0, +strstr("Fine silver sand kissed lightly by warm tropical waters and illuminated\n\ +by a huge tropical moon stretches at least 30 meters inland.\n\ +Gently swaying palm trees are +.***\n") }, + { strstr("You are flying over a small fishing village."), + 77, 74, 71, 82, 68, 1, 92, 1, +strstr("A few thatched huts lit with torches and bonfires line a road below.\n\ +The road continues on ***+.\n") }, + { strstr("You are flying over a clearing."), + 88, 72, 74, 87, 68, 1, 93, 1, +strstr("There is a dock here (big enough for a seaplane) leading to a clearing.\n\ +The still waters of the lagoon reflects our orange turbo thrusters.****\n") }, + { strstr("You are flying over the shore."), + 94, 75, 95, 96, 68, 1, 0, 1, +strstr("Rocky lava flows have overtaken the beach here.****\n") }, + { strstr("You are flying in a wide valley."), + 95, 97, 86, 75, 68, 1, 98, 1, +strstr("This is a shallow valley yet the floor is obscured by a thick mist.\n\ +The valley opens into blackness +. The mist grows thicker +.**\n") }, + { strstr("You are flying near the shore."), + 96, 77, 75, 99, 68, 1, 0, 1, +strstr("Very tall trees growing in neatly planted rows march off from the \n\ +water here towards the hills and down to the flat lands *+.**\n") }, + { strstr("You are flying around the very tip of the island."), + 95, 79, 90, 84, 68, 1, 0, 1, +strstr("Sheer cliffs rise several hundred feet to a tree covered summit. Far below,\n\ +the grey sea gnaws voraciously at the roots of these cliffs. The island bends\n\ +around +** and +.\n") }, + { strstr("You are flying along the coastline."), + 99, 82, 88, 100, 68, 1, 101, 1, +strstr("This is a narrow strip of sand lined with very few trees. The stars above\n\ +flicker through wisps of clouds. The beach continues on -.* There\n\ +are some lights +.*\n") }, + { strstr("You are flying over several cottages and buildings"), + 99, 82, 77, 87, 68, 1, 103, 1, +strstr("Directly below is small ornate house lit up with spot lights and decorative\n\ +bulbs. A bell tower and a spurting fountain are nearby. Small dirt roads go\n\ ++ and +.**\n") }, + { strstr("You are in a field of sugar cane."), + 109, 110, 111, 112, 77, 0, 0, 0, +strstr("These strong, thick canes give little shelter but many cuts and scrapes.\n\ +There are some large trees ***+.\n") }, + { strstr("You are flying over the ocean."), + 95, 78, 90, 86, 68, 1, 0, 1, +strstr("The water is a placid ebony.****\n") }, + { strstr("You are on the coast road."), + 113, 114, 115, 116, 79, 0, 0, 0, +strstr("The road winds close to the shore here. The trees on either side press close\n\ +in the darkness and seem to be watching us.** The road continues -\n\ +and -.\n") }, + { strstr("You are on the main street of the village."), + 117, 118, 119, 120, 81, 0, 0, 0, +strstr("The natives are having a festive luau here. Beautiful dancers gyrate in the\n\ +torchlight to the rhythm of wooden drums. A suckling pig is sizzling in a\n\ +bed of coals and ti leaves are spread with poi and tropical fruits. Several\n\ +natives have come over to you and want you to join in the festivities.\n\ +There is a light burning in a bungalow +.***\n") }, + { strstr("You are at the sea plane dock."), + 121, 122, 123, 124, 82, 0, 0, 0, +strstr("The clearing is deserted. The grass is wet with the evening dew +.*\n\ +There is something set up +.*\n") }, + { strstr("You are flying over the ocean."), + 94, 83, 95, 96, 68, 1, 0, 1, +strstr("The black waves surge off shore here. The ocean becomes much calmer +.***\n") }, + { strstr("You are flying along the coast."), + 94, 84, 86, 83, 68, 1, 0, 1, +strstr("The land is very low here with a river running into the sea +. There\n\ +is a wide valley opening up +, but a strange mist is flowing out of it.\n\ +The very tip of the island is +.*\n") }, + { strstr("You are flying along the coast."), + 94, 85, 83, 99, 68, 1, 0, 1, +strstr("The coast here is cluttered with rocky outcroppings.****\n") }, + { strstr("You are lost in a sea of fog."), + 97, 104, 97, 97, 97, 1, 0, 1, +strstr("What have you gotten us into?\n\ +I cant see a thing! ****\n") }, + { strstr("You are on a gravel wash."), + 125, 126, 127, 128, 84, 0, 0, 0, +strstr("It is very dark here. A cool breeze is blowing from +. No moonlight can\n\ +reach below a thick canopy of fog above. The sound of cascading water is\n\ +coming from +.**\n") }, + { strstr("You are flying over a wide beach."), + 96, 88, 85, 87, 68, 1, 105, 1, +strstr("There are some lighted buildings *+. Some trees are growing +.*\n") }, + { strstr("You are flying over the ocean."), + 100, 100, 87, 100, 68, 1, 0, 1, +strstr("The black waves surge and splash against the rocky shore.****\n") }, + { strstr("You are on a narrow strip of sand."), + 129, 130, 131, 0, 87, 0, 0, 0, +strstr("Rather coarse sand makes this beach very steep and only a few meters wide.\n\ +A fresh ocean breeze is rustling the ferns **+.*\n") }, + { strstr("This is Fern Canyon."), + 0, 0, 132, 133, 76, 0, 0, 0, +strstr("Delicate waving ferns flourish here, suckled by warm water dripping from \n\ +every fissure and crevice in the solid rock walls. The stars above sparkle\n\ +through a thin mist. The canyon winds **-, and -.\n") }, + { strstr("This is the front lawn."), + 134, 135, 136, 137, 88, 0, 0, 0, +strstr("There is a small fountain lighted with green and yellow bulbs here where\n\ +the driveway meets the lawn. Across the driveway, +, is an ornate white\n\ +house lit with gas lamps. A bell tower here is awash in pale blue.* There\n\ +is a road + which turns into the driveway.*\n") }, + { strstr("You have just crossed the crest of a mountain."), + 97, 79, 86, 71, 68, 1, 0, 1, +strstr("The fog vanished mysteriously as we flew over the crest.*\n\ +Far + I can see the ocean sparkling in the moonlight.**\n") }, + { strstr("You are on a sandy beach."), + 138, 139, 140, 0, 99, 0, 0, 0, +strstr("Fine coral sand, a fresh sea breeze, and dramatic surf add to this beach's\n\ +appeal.** Stone steps lead to a lighted path in the gardens +.*\n") }, + { strstr("You are among palm trees near the shore."), + 141, 80, 142, 143, 73, 0, 0, 0, +strstr("Arching coconut palms laden with fruit provide a canopy for the glistening\n\ +white sand and sparse, dew covered grasses growing here. The forest grows\n\ +denser +. Crickets are chirping loudly here. The ocean is +.**\n") }, + { strstr("You are walking along the beach."), + 144, 0, 145, 80, 73, 0, 0, 0, +strstr("The warm tropical waters nuzzle your ankles as you walk. Above is a gorgeous\n\ +starscape. The battlestar must be up there somewhere. The slope of the sand\n\ +is so gentle that the surf only slides up the sand.** There are some rocks\n\ ++.*\n") }, + { strstr("You are walking along the beach."), + 146, 0, 80, 147, 73, 0, 0, 0, +strstr("The tide is out very far tonight, and it is possible to explore hidden rocks\n\ +and caves not ordinarily accessible. Rich beds of seaweed have been exposed\n\ +to the cool night air.****\n") }, + { strstr("You are in a papaya grove."), + 148, 89, 149, 150, 77, 0, 0, 0, +strstr("Slender trees with their large seven lobed leaves bulge with succulent fruit.\n\ +There are some tall trees +.***\n") }, + { strstr("You are in a field of pineapple."), + 89, 151, 152, 153, 77, 0, 0, 0, +strstr("The sharp dagger like pineapple leaves can pierce the flesh and hold fast\n\ +a skewered victim with tiny barbs.* The field ends +.**\n") }, + { strstr("You are in a field of kiwi plants."), + 149, 154, 155, 89, 77, 0, 0, 0, +strstr("Round hairy fruit hang from staked vines here. There are some trees +\n\ +and +. The field ends in a road +.*\n") }, + { strstr("You are in a large grove of coconuts."), + 150, 153, 89, 156, 77, 0, 0, 0, +strstr("These trees are much taller than any growing near the shore and the shadows\n\ +are also deeper. It's hard to keep my sense of direction.****\n") }, + { strstr("You are in the woods."), + 157, 91, 158, 116, 79, 0, 0, 0, +strstr("Tropical undergrowth makes the going rough here. Sword ferns give no strong\n\ +foot hold and the dangling vines would gladly throttle one. The darkness is\n\ +so intense here that we stand in utter blackness.****\n") }, + { strstr("You are at the shore."), + 91, 0, 159, 145, 79, 0, 160, 0, +strstr("The low minus tide tonight might make it possible to climb down to a\n\ +small cave entrance below. Large rocks would usually churn the waves\n\ +asunder.*** The beach goes -.\n") }, + { strstr("You are on the coast road."), + 158, 161, 162, 91, 79, 0, 0, 0, +strstr("The road is beginning to turn slightly -. I can here the surf +. The road\n\ +continues into the dark forest +.*\n") }, + { strstr("The road winds deeper into the trees."), + 163, 142, 91, 164, 79, 0, 0, 0, +strstr("Only narrow moonbeams filter through the dense foliage above. The moist rich\n\ +earth has nurtured a myriad of slugs, snakes, and spiders to grow here. The\n\ +road continues - and *- into the shadows.*\n") }, + { strstr("This is the front porch of the bungalow."), + 165, 92, 0, 0, 81, 0, 0, 0, +strstr("The veranda is lit by a small yellow bug light. The door leads -.\n\ +The stone walk down to the luau is lined with burning torches +. That\n\ +roast pig smells good.**\n") }, + { strstr("You are on a path leading to the lagoon."), + 92, 166, 167, 168, 81, 0, 0, 0, +strstr("This path winds through the underbrush and towards the lagoon *+. The\n\ +broad faced moon peeps though the branches above. The sound of drums echos\n\ +in the woods.**\n") }, + { strstr("This is a dirt road."), + 169, 118, 170, 92, 81, 0, 0, 0, +strstr("**The road continues on - here for some distance. A bonfire and party light\n\ +up the night sky +.\n") }, + { strstr("You are on a dirt road."), + 171, 118, 92, 172, 81, 0, 0, 0, +strstr("**There is a village +. A huge bonfire licks at the trees, and a celebration\n\ +of some sort is going on there. The smell of luscious cooking is tantalizing\n\ +my flared nostrils. The road continues +.\n") }, + { strstr("You are on a dirt road."), + 173, 93, 174, 175, 82, 0, 0, 0, +strstr("This is a wide grassy clearing bedewed with droplets of evening mist. The\n\ +trees alongside the road moan and whisper as we pass. They seem annoyed at\n\ +our presence. **The road continues - and -.\n") }, + { strstr("You are at the seaplane dock."), + 93, 0, 176, 177, 82, 0, 0, 0, +strstr("Not a living thing stirs the calm surface of the lagoon. The wooden planks\n\ +creak unnaturally as we tread on them. The dock reaches a clearing +.\n\ +A dark trail leads around the lagoon **+.\n") }, + { strstr("There are some tables on the lawn here."), + 121, 122, 123, 93, 82, 0, 0, 0, +strstr("Some tables are strewn on the wet lawn.****\n") }, + { strstr("You are nosing around in the bushes."), + 124, 124, 93, 124, 82, 0, 0, 0, +strstr("There is little here but some old beer cans. It is damp and dirty in here.\n\ +I think I stepped in something unpleasant. It would be best to go **-.*\n") }, + { strstr("You are walking in a dry stream bed."), + 178, 98, 179, 0, 84, 0, 0, 0, +strstr("The large cobblestones are difficult to walk on. No starlight reaches\n\ +below a black canopy of fog seemingly engulfing the whole island. A dirt\n\ +path along the wash is **+. The high bank is impossible to climb +.\n") }, + { strstr("You are at the thermal pools."), + 98, 0, 180, 181, 84, 0, 0, 0, +strstr("Odd spluttering and belching water splashes up around the rocks here.\n\ +A spectacular waterfall nearby tumbles down as a river of effervescent\n\ +bubbles. The air is quite warm and a cave entrance ***+ spews steam.\n") }, + { strstr("You are in the woods."), + 127, 180, 182, 98, 84, 0, 0, 0, +strstr("It is pitch black in the forest here and my pant leg is caught on something.\n\ +There may be poison oak here. What was that? A lantern just flickered by in\n\ +the dark! The sound of rushing water is coming from *+.**\n") }, + { strstr("You are on a dirt trail."), + 179, 181, 98, 0, 84, 0, 0, 0, +strstr("The trail seems to start here and head towards the forest +.** High, dark\n\ +cliffs border the trail +. Some crickets are chirping noisily.\n") }, + { strstr("You are walking along the beach."), + 183, 101, 184, 0, 87, 0, 0, 0, +strstr("The surf is rather tame tonight. The beach continues + and +.**\n") }, + { strstr("You are walking along the beach."), + 101, 185, 186, 0, 87, 0, 0, 0, +strstr("This is not a very nice beach. The coarse sand hurts my feet.****\n") }, + { strstr("You are walking through some ferns."), + 184, 186, 187, 101, 87, 0, 0, 0, +strstr("This is a wide field growing only ferns and small shrubs.** In the dark\n\ +it would be all to easy to stumble into a venomous snake. The ocean is\n\ +*+.\n") }, + { strstr("You are in a narrow canyon."), + 0, 0, 188, 102, 76, 0, 0, 0, +strstr("The steep sides here squeeze a little freshet through a gauntlet like\n\ +series of riffles and pools. The cool mountain air is refreshing.****\n") }, + { strstr("The canyon is much wider here."), + 0, 0, 102, 189, 76, 0, 0, 0, +strstr("The sheer rock walls rise 10 meters into darkness. A slender waterfall\n\ +careens away from the face of the rock high above and showers the gravel\n\ +floor with sparkling raindrops.** The canyon continues -\n\ +and -.\n") }, + { strstr("You are on the front porch of the cottage."), + 190, 103, 0, 0, 0, 0, 0, 0, +strstr("The veranda is deserted. A table and chair are the only things on the porch.\n\ +Inside the house is a parlor lighted with an elegant chandelier. The door\n\ +leads -. The lawn and fountain are +.**\n") }, + { strstr("You are in a palm grove."), + 103, 191, 192, 105, 88, 0, 0, 0, +strstr("Crickets are chirping in the cool night air.****\n") }, + { strstr("You are on a dirt road."), + 193, 192, 245, 103, 88, 0, 0, 0, +strstr("There are many bright lights +. The road cleaves the darkness +.\n\ +A small dirt road goes -, and a drive way peals off +.\n") }, + { strstr("You are in a field of small shrubs."), + 184, 186, 103, 187, 88, 0, 0, 0, +strstr("**Pine and other coniferous saplings are growing here. The rich brown\n\ +soil is well watered. Across a large lawn +, there is a small cottage lighted\n\ +with spot lights and gas lamps. A cool land breeze is blowing.*\n") }, + { strstr("The beach is pretty rocky here."), + 194, 105, 195, 0, 96, 0, 0, 0, +strstr("The tide is very low tonight. The beach is nicer *+.**\n") }, + { strstr("The beach is almost 10 meters wide here."), + 105, 183, 196, 0, 99, 0, 0, 0, +strstr("The sand has become more coarse and the beach steeper.****\n") }, + { strstr("You are in the gardens."), + 195, 196, 197, 105, 99, 0, 0, 0, +strstr("Shadowy expanses of lawn and leaf have been groomed and manicured here.\n\ +The night sky is glowing with a full moon.** A lighted path leads -.\n\ +Stone steps lead down to the beach +.\n") }, + { strstr("You are on the coast road."), + 198, 106, 163, 199, 73, 0, 0, 0, +strstr("The forest is dense on either side. The trees seem to be actually squeezing\n\ +together to keep us from passing. A feeling of emnity is in the air.**\n\ +The road continues - and -.\n") }, + { strstr("You are in the forest."), + 116, 107, 91, 106, 73, 0, 0, 0, +strstr("I suppose there are trees and ferns all around, but it is too dark to see.****\n") }, + { strstr("You are in the forest."), + 199, 108, 106, 146, 73, 0, 0, 0, +strstr("There are shadowy trees and ferns all around.****\n") }, + { strstr("You are in a copse."), + 142, 107, 145, 80, 0, 0, 0, 0, +strstr("This is a secret hidden thicket only noticeable from the beach. In the\n\ +moonlight, I can tell that someone has been digging here recently.****\n") }, + { strstr("You are at the tide pools."), + 91, 0, 114, 107, 79, 0, 0, 0, +strstr("These rocks and pools are the home for many sea anemones and crustaceans.\n\ +They are exposed because of the low tide. There is a beach ***+.\n") }, + { strstr("You are in the forest."), + 199, 108, 143, 0, 73, 0, 0, 0, +strstr("This is a shallow depression sheltered from the wind by a thick growth of \n\ +thorny shrubs. It looks like someone is camping here. There is a fire pit\n\ +with warm, crackling flames and coals here.* The beach is +.* The thorny\n\ +shrubs block the way -.\n") }, + { strstr("You are at the mouth of the lagoon."), + 200, 0, 108, 201, 74, 0, 0, 0, +strstr("The beach ends here where the coral reef rises to form a wide lagoon.\n\ +A path winds around the lagoon to the -.* The beach continues\n\ +on -. Only water lies +.\n") }, + { strstr("You are in a breadfruit grove."), + 202, 109, 203, 204, 77, 0, 0, 0, +strstr("The tall trees bend leisurely in the breeze, holding many round breadfruits\n\ +close to their large serrated leaves. There are coconut palms +,\n\ +*+, and +.\n") }, + { strstr("You are in a grove of mango trees."), + 203, 111, 205, 109, 77, 0, 0, 0, +strstr("The trees are not tall enough to obscure the view and the bright moonlight\n\ +makes it fairly easy to see.****\n") }, + { strstr("You are in a grove of coconut palms."), + 204, 112, 109, 206, 77, 0, 0, 0, +strstr("All I can see around us are trees and ominous shapes darting in and out of the\n\ +shadows.****\n") }, + { strstr("You are in a coconut grove."), + 110, 207, 208, 209, 77, 0, 0, 0, +strstr("There are countless trees here.****\n") }, + { strstr("You are in a field of pineapple."), + 154, 208, 210, 110, 77, 0, 0, 0, +strstr("The sharp leaves are cutting me to ribbons. There is a road **+.*\n") }, + { strstr("You are in a coconut grove."), + 112, 209, 110, 211, 77, 0, 0, 0, +strstr("There is a field of something **+.*\n") }, + { strstr("You are on the edge of a kiwi and pineapple field."), + 111, 152, 155, 110, 77, 0, 0, 0, +strstr("An irrigation ditch separates the two fields here. There is a road **+.*\n") }, + { strstr("This is a dirt road."), + 205, 210, 212, 111, 77, 0, 0, 0, +strstr("The road runs - and - here. It is very dark in the forest.**\n") }, + { strstr("You are in a palm grove."), + 206, 211, 112, 213, 77, 0, 0, 0, +strstr("There are trees all around us.****\n") }, + { strstr("You are on the edge of a small clearing."), + 157, 113, 157, 157, 79, 0, 0, 0, +strstr("The ground is rather marshy here and the darkness is intense. A swarm of\n\ +ravenous mosquitoes has descended upon you and has sent you quaking to your\n\ +knees.****\n") }, + { strstr("You are in the woods."), + 158, 115, 215, 113, 79, 0, 0, 0, +strstr("You have walked a long way and found only spider webs. ****\n") }, + { strstr("You are walking along the shore."), + 115, 0, 214, 114, 86, 0, 0, 0, +strstr("You are now about 10 meters above the surf on a gently rising cliffside.**\n\ +The land rises +. There is a beach far +.\n") }, + { strstr("You are just inside the entrance to the sea cave."), + 246, 114, 0, 0, 114, 1, 0, 0, +strstr("The sound of water dripping in darkness and the roar of the ocean just outside\n\ +create a very unwelcoming atmosphere inside this cave. Only on rare occasions\n\ +such as this is it possible to enter the forbidden catacombs... The cave\n\ +continues -.***\n") }, + { strstr("You are in a secret nook beside the road."), + 115, 159, 162, 91, 79, 0, 0, 0, +strstr("This little thicket is hidden from the road in the shadows of the forest.\n\ +From here we have a clear view of any traffic along the road. A great hollow\n\ +tree stuffed with something is nearby. The road is +.***\n") }, + { strstr("You are on the coast road."), + 215, 214, 0, 115, 86, 0, 0, 0, +strstr("The road turns abruptly - here, wandering deeper into the black forest.***\n") }, + { strstr("You are on a dirt road."), + 216, 116, 113, 141, 79, 0, 0, 0, +strstr("We are walking through a tunnel of unfriendly trees and shrubs. The tall\n\ +ones bend over the roadway and reach down with their branches to grab us.\n\ +Broad leafed plants at the roadside whisper in the darkness. Something\n\ +just darted across the road and into the bushes *+. Let's go *-.\n") }, + { strstr("You have discovered a hidden thicket near the road."), + 163, 142, 116, 106, 73, 0, 0, 0, +strstr("I would think it best to stay n the road. The forest seems very unfriendly\n\ +at night. The road is **+.*\n") }, + { strstr("You are in the living room."), + 0, 117, 217, 218, 0, 0, 0, 0, +strstr("A decorative entry with fresh flowers and wall to wall carpeting leads into\n\ +the living room here where a couch and two chairs converse with an end table.\n\ +*The exit is +.* The bedroom is +.\n") }, + { strstr("You are at the lagoon."), + 118, 0, 167, 168, 81, 0, 0, 0, +strstr("A small beach here is deserted except for some fishing nets. It is very\n\ +peaceful at the lagoon at night. The sound of native drums is carried on\n\ +the night breeze. There are paths leading off into darkness +,\n\ +*+, and +.\n") }, + { strstr("You are at the lagoon."), + 118, 0, 170, 166, 81, 0, 0, 0, +strstr("The grass near the water is moist with the refreshing evening dew. Far away,\n\ +drums reverberate in the forest.** The path continues + and +.\n") }, + { strstr("You are at the lagoon."), + 118, 0, 166, 172, 81, 0, 0, 0, +strstr("The path meanders through shadows of tussocks of grass, ferns, and thorny\n\ +bushes here and continues on **- and -.\n") }, + { strstr("You are in the woods."), + 219, 119, 220, 92, 81, 0, 0, 0, +strstr("There are plenty of ferns and thorny bushes here! Spider webs and probing\n\ +branches snare us as we stumble along in the pitch black night.****\n") }, + { strstr("You are on a dirt road."), + 220, 167, 199, 119, 74, 0, 0, 0, +strstr("The road winds rather close to a large lagoon here and many sedges and tall\n\ +loom in the darkness *+. The road continues - and -.\n") }, + { strstr("You are in the woods beside the road."), + 221, 120, 92, 222, 81, 0, 0, 0, +strstr("The forest grows darker +. The road is +.**\n") }, + { strstr("The road crosses the lagoon here."), + 222, 0, 120, 174, 81, 0, 0, 0, +strstr("Strange mists rising from the water engulf a rickety old enclosed bridge here.\n\ +Spider webs catch our hair as we pass through its rotting timbers. I felt\n\ +something drop on my neck. The road delves into the accursed forest\n\ +**+ and +.\n") }, + { strstr("You are in a coconut palm grove."), + 223, 121, 224, 225, 82, 0, 0, 0, +strstr("The tall palms are planted about 30 feet apart and the stary sky is clearly\n\ +visible above. A low growing grass carpets the ground all around. The grove\n\ +continues +.***\n") }, + { strstr("You are walking along a dirt road."), + 224, 176, 172, 121, 82, 0, 0, 0, +strstr("You are near misty patch of the roadway **+. The road continues -.\n") }, + { strstr("You are on a dirt road."), + 225, 177, 121, 226, 82, 0, 0, 0, +strstr("The road turns abruptly - here, splitting a grove of palm trees.* In the\n\ +starlight I can also discern that the road continues - toward the lagoon.*\n") }, + { strstr("You are on a trail running around the lagoon."), + 172, 0, 0, 122, 82, 0, 0, 0, +strstr("The dark waters brush the trail here and the path crosses an old bridge\n\ ++. There is deep water + and +. The trail continues -.\n") }, + { strstr("This is the mouth of the lagoon."), + 175, 0, 122, 227, 82, 0, 0, 0, +strstr("The coral reef wraps around a natural bay here to create a wide lagoon which\n\ +winds tortuously inland.** A trail goes around the lagoon +.\n\ +The beach is -.\n") }, + { strstr("You are in a dry stream bed."), + 0, 125, 0, 0, 84, 0, 0, 0, +strstr("The dry wash drains over a tall precipice here into a turbid morass below. The\n\ +most noisome stench imaginable is wafting up to defile our nostrils. Above,\n\ +the blackness is intense and a strange mist engulfs the island.* Let's go\n\ +-.**\n") }, + { strstr("You are on a dirt path along the wash."), + 0, 128, 125, 228, 84, 0, 0, 0, +strstr("The trail winds along the gravel wash and delves into the forest ***+.\n") }, + { strstr("The thermal pools flow into a stream here."), + 127, 0, 229, 126, 84, 0, 0, 0, +strstr("The gurgling hot waters pour over boulders into a swiftly flowing\n\ +stream **+. The pools are +.\n") }, + { strstr("You are at the entrance to a cave."), + 128, 230, 126, 0, 84, 0, 0, 0, +strstr("A torch lights the entrance to the cave. Deep inside I can see shadows moving.\n\ +A path goes + from here. The entrance is +.**\n") }, + { strstr("You are in the woods."), + 182, 229, 182, 127, 84, 0, 0, 0, +strstr("Thorns tangle your every effort to proceed.* The sound of rushing water is\n\ ++.**\n") }, + { strstr("You are walking along the beach."), + 139, 129, 184, 0, 99, 0, 0, 0, +strstr("Some dunes here progress inland and make it impossible to get very far in that\n\ +direction. The beach continues - and -.* The ocean is +.\n") }, + { strstr("You are in the dunes."), + 183, 101, 184, 129, 87, 0, 0, 0, +strstr("The endless rolling and pitching sand dunes are enough to make one very queasy!\n\ +The sand is cool and the stars are bright at the ocean. The only way I'm going\n\ +is ***+.\n") }, + { strstr("This is a lousy beach."), + 130, 0, 0, 0, 87, 0, 0, 0, +strstr("Volcanic and viciously sharp bitted grains of sand here bite like cold steel\n\ +into my tender feet. I refuse to continue on. Let's get out of here. The\n\ +beach is better +.***\n") }, + { strstr("You are in a field of sparse ferns."), + 131, 185, 187, 130, 87, 0, 0, 0, +strstr("The lava rock outcroppings here will support few plants. There is more \n\ +vegetation +.** The ocean is +.\n") }, + { strstr("You are in the woods."), + 131, 131, 137, 131, 87, 0, 0, 0, +strstr("Young trees and tall shrubs grow densely together here.\n\ +They grow thicker **+.*\n") }, + { strstr("The canyon is no wider than a foot here."), + 0, 0, 0, 132, 0, 0, 0, 0, +strstr("The freshet is gushing through the narrow trough, but the canyon has grown\n\ +too narrow to follow it any farther.*** I guess we'll have to go -.\n") }, + { strstr("You are in a narrow part of the canyon."), + 0, 0, 133, 232, 76, 0, 0, 0, +strstr("The two sheer sides are no more than a few meters apart here. There is a stone\n\ +door in the wall +. The gravelly floor runs with tiny rivulets seeping \n\ +from the ground itself.* The canyon continues - and -.\n") }, + { strstr("You are in the drawing room."), + 0, 134, 0, 0, 0, 0, 0, 0, +strstr("Exquisitely decorated with plants and antique furniture of superb\n\ +craftsmanship, the parlor reflects its owners impeccable taste. The tropical\n\ +night air pours in through open shutters *+. There doesn't seem \n\ +to be anybody around. A large immaculate oaken desk is visible in the\n\ +study and it even has a old fashioned telephone to complete the decor.**\n") }, + { strstr("You are in a palm grove."), + 135, 191, 233, 191, 88, 0, 0, 0, +strstr("Grassy rows of dew covered palms stretch as far as I can see.**\n\ +There is a road +.*\n") }, + { strstr("You are on a dirt road."), + 136, 233, 234, 135, 88, 0, 0, 0, +strstr("The road winds through a coconut palm grove here. It continues on - \n\ +and -.**\n") }, + { strstr("The road leads to several large buildings here."), + 235, 136, 236, 237, 88, 0, 0, 0, +strstr("There is a lighted clubhouse +,* a large barn and stable +, and a\n\ +garage of similar construct to the barn +.\n") }, + { strstr("This part of the beach is impassable."), + 0, 138, 0, 0, 96, 0, 0, 0, +strstr("The see is calm tonight. The beach goes *-.**\n") }, + { strstr("You are in the gardens."), + 195, 140, 197, 138, 96, 0, 0, 0, +strstr("Dew beaded grass sparkles in the moonlight. Tiny lamps beside the path light\n\ +the way to the ocean ***+.\n") }, + { strstr("You are in the gardens."), + 140, 183, 197, 139, 99, 0, 0, 0, +strstr("Beautiful flowers and shrubs surround a lighted goldfish pond.****\n") }, + { strstr("You are on a stone walk in the garden."), + 195, 196, 238, 140, 99, 0, 0, 0, +strstr("The walk leads to a road **+.*\n") }, + { strstr("You are in the forest near the road."), + 198, 141, 216, 198, 73, 0, 0, 0, +strstr("There are many thorny bushes here!****\n") }, + { strstr("You are at a fork in the road."), + 239, 146, 141, 170, 73, 0, 0, 0, +strstr("Two roads come together in the darkness here. One runs -,* the other \n\ +runs - and -.\n") }, + { strstr("You are on a dirt path around the lagoon."), + 170, 147, 146, 0, 74, 0, 0, 0, +strstr("The still waters reflect bending palms and a stary sky. It looks like\n\ +the path runs into a clearing +. The path continues -.**\n") }, + { strstr("You are drowning in the lagoon."), + 201, 201, 147, 201, 74, 0, 0, 0, +strstr("I suggest you get out before you become waterlogged.****\n") }, + { strstr("You are in a coconut palm grove."), + 202, 148, 203, 204, 77, 0, 0, 0, +strstr("****\n") }, + { strstr("You are in a palm grove."), + 202, 149, 205, 148, 77, 0, 0, 0, +strstr("****\n") }, + { strstr("You are in a palm grove."), + 202, 150, 148, 206, 77, 0, 0, 0, +strstr("****\n") }, + { strstr("You are on a dirt road."), + 203, 155, 212, 149, 77, 0, 0, 0, +strstr("*This road ends here at a palm grove but continues on - for quite\n\ +some way.**\n") }, + { strstr("You are in a coconut palm grove."), + 204, 156, 150, 213, 77, 0, 0, 0, +strstr("****\n") }, + { strstr("You are in a coconut grove."), + 151, 219, 208, 209, 77, 0, 0, 0, +strstr("*The grove ends +.**\n") }, + { strstr("You are in a coconut grove."), + 152, 207, 239, 151, 77, 0, 0, 0, +strstr("**There is a dirt road +.*\n") }, + { strstr("You are in a coconut grove."), + 153, 207, 151, 211, 77, 0, 0, 0, +strstr("****\n") }, + { strstr("This is a dirt road."), + 205, 239, 212, 154, 77, 0, 0, 0, +strstr("The road continues - and -.**\n") }, + { strstr("You are in a coconut grove."), + 153, 209, 153, 213, 77, 0, 0, 0, +strstr("****\n") }, + { strstr("You are in the woods near the road."), + 205, 210, 212, 155, 77, 0, 0, 0, +strstr("There are many thorny bushes here!****\n") }, + { strstr("You are in a coconut grove."), + 213, 213, 156, 234, 88, 0, 0, 0, +strstr("***The grove ends in a clearing +.\n") }, + { strstr("You are walking along some high cliffs."), + 162, 0, 0, 159, 86, 0, 0, 0, +strstr("The island bends sharply + here with high cliffs -\n\ +and -. The cliffs are lower +.\n") }, + { strstr("You are at the coast road turn around."), + 0, 162, 0, 158, 90, 0, 0, 0, +strstr("The coast road ends here in a lookout with a view of the ocean.\n\ +Far below, the waves crash against the rocks.\n\ +****\n") }, + { strstr("You are in the woods near the road."), + 216, 163, 216, 198, 79, 0, 257, 0, +strstr("These thorny bushes are killing me.****\n") }, + { strstr("You are in the kitchen."), + 0, 0, 0, 165, 0, 0, 0, 0, +strstr("A small gas stove and a refrigerator are all the only appliances here. The\n\ +gas oven has been left on and the whole room is reeking with natural gas.\n\ +One spark from a match and.... The door out is ***+.\n") }, + { strstr("You are in the bedroom."), + 0, 0, 165, 0, 0, 0, 0, 0, +strstr("A soft feather comforter on top of layers of Answer blankets make this a very\n\ +luxurious place to sleep indeed. There are also some end tables and a dresser\n\ +here.** The living room is +.*\n") }, + { strstr("You are in the woods."), + 207, 169, 220, 221, 81, 0, 0, 0, +strstr("The darkness is intense, but there seems to be a clearing +.***\n") }, + { strstr("You are in the woods near the road."), + 219, 170, 239, 169, 81, 0, 0, 0, +strstr("*As far as I can tell, there are two roads + and +.*\n") }, + { strstr("You are in the woods."), + 207, 171, 219, 222, 81, 0, 0, 0, +strstr("The spider webs thin out and the forest is clearer +.***\n") }, + { strstr("You are on the lagoon's inland finger."), + 0, 172, 171, 172, 81, 0, 0, 0, +strstr("It is impossible to follow the lagoon any farther inland because of sharp\n\ +and very painful sedges.* The road is +.**\n") }, + { strstr("You are in a grassy coconut grove."), + 240, 173, 224, 241, 82, 0, 0, 0, +strstr("The tall palms provide a ghostly canopy for the sandy ground covering.****\n") }, + { strstr("You are near the lagoon's inland finger."), + 0, 174, 0, 173, 82, 0, 0, 0, +strstr("Very sharp sedges make it impossible to follow the lagoon any farther inland.\n\ +*There is a road +.**\n") }, + { strstr("You are on a dirt road."), + 241, 175, 173, 226, 82, 0, 0, 0, +strstr("The road winds through a coconut grove here and continues - and -.**\n") }, + { strstr("You are in the woods near the road."), + 226, 226, 175, 226, 82, 0, 0, 0, +strstr("**The road is +.*\n") }, + { strstr("This is a beach?"), + 227, 227, 177, 0, 82, 0, 0, 0, +strstr("Hard jagged rocks that pierce with every footstep hardly comprise a beach.**\n\ +Let's go -.*\n") }, + { strstr("The trail is lost in the woods here."), + 241, 241, 179, 241, 84, 0, 0, 0, +strstr("The trail goes **-.*\n") }, + { strstr("You are on the bank of a stream."), + 182, 0, 242, 180, 84, 0, 0, 0, +strstr("The stream falls over several small boulders here and continues on **-.*\n") }, + { strstr("You are just inside the cave."), + 181, 267, 0, 0, 0, 0, 0, 0, +strstr("A steamy hot breath is belching from the depths of the earth within.* The\n\ +cave continues -.**\n") }, + { strstr("You are just inside the cave entrance."), + 274, 0, 0, 0, 0, 0, 0, 0, +strstr("The air is hot and sticky inside. The cave continues -. There is a \n\ +stone door in the wall +. A wooden sign in the dust warns in old elven\n\ +runes, \"GSRF KDIRE NLVEMP!\".**\n") }, + { strstr("You are at the edge of a huge chasm."), + 0, 0, 189, 0, 76, 0, 0, 0, +strstr("Several hundred feet down I can see the glimmer of placid water. The\n\ +rivulets drain over the edge and trickle down into the depths. It is \n\ +impossible to climb down.** The canyon continues -.*\n") }, + { strstr("You are on a dirt road."), + 192, 241, 240, 191, 88, 0, 0, 0, +strstr("The road winds through a coconut grove here. The road continues on into the\n\ +shadows - and -.**\n") }, + { strstr("You are in a coconut palm grove near the road."), + 193, 233, 213, 192, 88, 0, 0, 0, +strstr("***The road is +.\n") }, + { strstr("You are at the clubhouse."), + 0, 193, 0, 0, 0, 0, 0, 0, +strstr("The clubhouse is built over the most inland part of the lagoon. Tropical\n\ +bananas and fragrant frangipani grow along the grassy shore. Walking across\n\ +the short wooden bridge, we enter. Along one wall is a bar crowded with people.\n\ +The restaurant and disco dance floor are filled to capacity. A rock group\n\ +electrocutes itself to the satisfaction of the audience.****\n") }, + { strstr("You are in the stables."), + 0, 0, 0, 193, 0, 0, 0, 0, +strstr("Neighing horses snacking on hay and oats fill the stalls on both sides of\n\ +the barn. It is rather warm in here but that is not the most offensive\n\ +part.****\n") }, + { strstr("You are in the old garage."), + 0, 0, 193, 0, 0, 0, 0, 0, +strstr("This is an old wooden building of the same vintage as the stables. Beneath\n\ +a sagging roof stand gardening tools and greasy rags. Parked in the center\n\ +is an underpowered Plymouth Volare' with a red and white striped golf cart\n\ +roof. ****\n") }, + { strstr("You are on a dirt road."), + 197, 197, 243, 197, 85, 0, 0, 0, +strstr("The road leads to a formal garden laced with lighted stone walks and tropical\n\ +flowers and trees.** The road continues -. A walk leads -.\n") }, + { strstr("You are on a dirt road."), + 210, 199, 198, 220, 73, 0, 0, 0, +strstr("The road runs - and -.**\n") }, + { strstr("You are in a coconut grove near the road."), + 234, 223, 234, 233, 88, 0, 0, 0, +strstr("***The road is +.\n") }, + { strstr("You are on a dirt road."), + 233, 225, 223, 226, 82, 0, 0, 0, +strstr("The road continues - and -.**\n") }, + { strstr("The stream plummets over a cliff here."), + 182, 0, 0, 229, 84, 0, 0, 0, +strstr("Falling 10 agonizing meters into darkness, only droplets of the stream must\n\ +be left to dance off the floor below. There is no way down, even with a\n\ +strong rope. ****\n") }, + { strstr("You are on a dirt road."), + 0, 0, 244, 238, 85, 0, 0, 0, +strstr("**The road continues - and -.\n") }, + { strstr("You are on a dirt road."), + 0, 245, 0, 243, 88, 0, 0, 0, +strstr("*The road continues -* and -.\n") }, + { strstr("You are on a dirt road."), + 244, 234, 213, 136, 88, 0, 0, 0, +strstr("The road goes -* and *-.\n") }, + { strstr("You are in a low passage."), + 247, 160, 0, 0, 0, 0, 0, 0, +strstr("The ceiling here sparkles with iridiscent gems and minerals. Colorful starfish\n\ +and sea anemones cling to the slippery walls and floor. The passage continues\n\ ++.***\n") }, + { strstr("The walls are very close together here."), + 248, 246, 0, 0, 0, 0, 0, 0, +strstr("I can barely squeeze through the jagged opening. Slimy sea weeds provide\n\ +no footing at all. This tunnel seems to be an ancient lava tube. There is\n\ +a large room +.***\n") }, + { strstr("You are in the cathedral room."), + 249, 247, 250, 251, 0, 0, 0, 0, +strstr("Your light casts ghostly shadows on the walls but cannot pierce the \n\ +engulfing darkness overhead. The sound of water dripping echoes in the void.\n\ +*I can see no passages leading out of this room.*** \n") }, + { strstr("You are walking through a very round tunnel."), + 252, 248, 0, 0, 252, 1, 0, 0, +strstr("The round walls of this tunnel are amazingly smooth to the touch. A little\n\ +trickle of water flows down the center. The tunnel climbs steadily +.\n\ +There is a large room +.**\n") }, + { strstr("You are in the cathedral anteroom."), + 0, 0, 0, 248, 253, 1, 0, 0, +strstr("This small chamber with a flat stone floor is to one side of the cathedral \n\ +room. We appear to be at the bottom of a tall narrow shaft. There are many \n\ +puddles of water here. A staircase hewn from solid rock and black lava \n\ +leads up.*** The cathedral room is -.\n") }, + { strstr("You are in a wide chamber."), + 0, 0, 248, 254, 0, 0, 0, 0, +strstr("Water is sprinkling from the ceiling here. A shallow pool populated by a \n\ +myriad of blind white creatures sparkles in your light. Tiny shrimp and\n\ +crabs scurry away, frightened by the blinding rays.** The cave \n\ +continues + and +.\n") }, + { strstr("You are at the top of a sloping passage."), + 0, 249, 255, 256, 257, 1, 249, 0, +strstr("There is much algae growing here, both green and brown specimens. I suspect\n\ +that we are near the high tide zone, but no light can get in here. The walls\n\ +glisten with shiny minerals.** A hallway here runs + and -.\n") }, + { strstr("You are in an elaborately tiled room."), + 0, 0, 258, 0, 0, 0, 250, 0, +strstr("Large colorful tiles plate the floor and walls. The ceiling is a mosaic\n\ +of gems set in gold. Hopefully it is only our footsteps that are echoing in\n\ +this hollow chamber.** The room continues -. A stone staircase leads\n\ +down.*\n") }, + { strstr("You are at a dead end."), + 0, 0, 251, 0, 0, 0, 0, 0, +strstr("The walls here are alive with dark mussels. They click their shells menacingly\n\ +if we disturb them.** The only exit is +.*\n") }, + { strstr("The tunnel is very low here."), + 0, 0, 259, 252, 0, 0, 0, 0, +strstr("You practically have to crawl on your knees to pass through this opening. The\n\ +air is stiflingly damp, but you can't hear any sounds of water dripping.**\n\ +The crawlspace continues -. The tunnel seems wider +.\n") }, + { strstr("This is the supply room."), + 0, 0, 252, 0, 0, 0, 0, 0, +strstr("Picks and shovels line the walls here, as well as hard hats, boxes of\n\ +dynamite, and a cartload of very high grade gold and silver ore.** \n\ +A tunnel leads off +.*\n") }, + { strstr("You have found a secret entrance to the catacombs"), + 0, 0, 0, 0, 216, 1, 252, 0, +strstr("Below is a wet, seaweed covered floor. Above is a way out.****\n") }, + { strstr("You are in the catacombs."), + 0, 0, 260, 253, 0, 0, 0, 0, +strstr("Ornate tombs and piles of treasure line the walls. Long spears with many\n\ +blades, fine swords and coats of mail, heaps of coins, jewelry, pottery, \n\ +and golden statues are tribute past kings and queens.** The catacombs\n\ +continue - and -.\n") }, + { strstr("You are crawling on your stomach."), + 0, 0, 261, 255, 0, 0, 0, 0, +strstr("The passage is quite narrow and jagged, but the rock is no longer lava.\n\ +It appears to be a form of granite.** The crawlspace continues -, \n\ +but I would just as soon go -.\n") }, + { strstr("You are in the Sepulcher."), + 0, 0, 0, 258, 0, 0, 0, 0, +strstr("A single tomb is here. Encrusted with diamonds and opals, and secured with \n\ +straps of a very hard, untarnished silver, this tomb must be of a great king.\n\ +Vases overflowing with gold coins stand nearby. A line of verse on the wall\n\ +reads, \"Three he made and gave them to his daughters.\"****\n") }, + { strstr("The passage is wider here."), + 0, 0, 0, 259, 0, 0, 262, 0, +strstr("A ladder goes down into darkness here.*** A small crawlspace goes -.\n") }, + { strstr("You are at the bottom of a ladder."), + 0, 0, 0, 0, 261, 1, 263, 0, +strstr("This is a narrow platform to rest on before we continue either up or down this\n\ +rickety wooden ladder.****\n") }, + { strstr("You are standing in several inches of water."), + 264, 0, 265, 266, 262, 1, 0, 0, +strstr("This seems to be a working mine. Many different tunnels wander off following\n\ +glowing veins of precious metal. The floor is flooded here since we must\n\ +be nearly at sea level. A ladder leads up.****\n") }, + { strstr("The tunnel here is blocked by broken rocks."), + 0, 263, 0, 0, 0, 0, 0, 0, +strstr("The way is blocked, but if you had some dynamite, we might be able to blast our\n\ +way through.* The passage goes -.**\n") }, + { strstr("The tunnel is too flooded to proceed."), + 0, 0, 0, 263, 0, 0, 0, 0, +strstr("Hidden shafts could swallow us if we tried to continue on down this tunnel.\n\ +The flooding is already up to my waist. Large crystals overhead shimmer\n\ +rainbows of reflected light.*** Let's go -.\n") }, + { strstr("The mine is less flooded here."), + 0, 0, 263, 0, 0, 0, 0, 0, +strstr("A meandering gold laden vein of quartz and blooming crystals of diamonds\n\ +and topaz burst from the walls of the cave. A passage goes -.***\n") }, + { strstr("You are inside the cave."), + 230, 268, 0, 0, 0, 0, 0, 0, +strstr("A hot steam swirls around our heads, and the walls are warm to the touch.\n\ +The trail winds - and -.**\n") }, + { strstr("You are in a rather large chamber."), + 267, 0, 0, 269, 0, 0, 269, 0, +strstr("Beds of ferns and palm leaves make several cozy nests along the walls. In the\n\ +center of the room is a throne of gold and silver.*** A passageway leads\n\ +down and +.\n") }, + { strstr("You are walking along the edge of a huge abyss."), + 0, 0, 268, 0, 268, 1, 270, 0, +strstr("Steam is rising in great clouds from the immeasurable depths. A very narrow\n\ +trail winds down.** There is a tunnel -.*\n") }, + { strstr("You are on the edge of a huge abyss."), + 0, 0, 0, 0, 269, 1, 271, 0, +strstr("The trail winds farther down.****\n") }, + { strstr("You are winding your way along the abyss."), + 0, 0, 0, 0, 270, 1, 272, 0, +strstr("The trail continues up and down.****\n") }, + { strstr("You are on a wide shelf near the steamy abyss."), + 0, 273, 0, 0, 271, 1, 0, 0, +strstr("The stifling hot cave seems even hotter to me, staring down into this misty \n\ +abyss. A trail winds up.* A passageway leads -.**\n") }, + { strstr("You are in a wide tunnel leading to a fuming abyss."), + 272, 274, 0, 0, 0, 0, 0, 0, +strstr("The passageway winds through many beautiful formations of crystals and\n\ +sparkling minerals. The tunnel continues - and -.**\n") }, + { strstr("You are in a tunnel."), + 273, 231, 0, 0, 0, 0, 0, 0, +strstr("It is very warm in here. The smell of steam and hot rocks permeates the place.\n\ +The cave continues - and -.**\n") }, + { strstr("You are at the bottom of a pit."), + 0, 0, 0, 0, 232, 0, 0, 0, +strstr("At the top of the pit, a single star can be seen in the night sky. There\n\ +doesn't appear to be any way to get out without a rope. I don't remember\n\ +how we got here.****\n") }, +}; diff --git a/games/battlestar/nightobjs.c b/games/battlestar/nightobjs.c new file mode 100644 index 0000000..2d3d2f9 --- /dev/null +++ b/games/battlestar/nightobjs.c @@ -0,0 +1,73 @@ +/* + * Copyright (c) 1983 Regents of the University of California, + * All rights reserved. Redistribution permitted subject to + * the terms of the Berkeley Software License Agreement. + */ + +#if !defined(lint) && !defined(pdp11) +static char sccsid[] = "@(#)nightobjs.c 1.3 4/24/85"; +#endif + +#include "externs.h" + +struct objs nightobjs[] = { + { 218, PAJAMAS }, + { 235, NATIVE }, + { 92, PAPAYAS }, + { 92, PINEAPPLE }, + { 92, KIWI }, + { 92, MANGO }, + { 92, NATIVE }, + { 92, MAN }, + { 181, LAMPON }, + { 236, LAMPON }, + { 92, LAMPON }, + { 216, WOODSMAN }, + { 216, DEADWOOD }, + { 216, MALLET }, + { 168, WOODSMAN }, + { 168, DEADWOOD }, + { 168, MALLET }, + { 170, WOODSMAN }, + { 170, DEADWOOD }, + { 170, MALLET }, + { 124, SHIELD }, + { 124, HALBERD }, + { 124, ELF }, + { 144, SHIELD }, + { 144, HALBERD }, + { 144, ELF }, + { 113, SHIELD }, + { 113, HALBERD }, + { 113, ELF }, + { 161, SHIELD }, + { 161, HALBERD }, + { 161, ELF }, + { 169, SHIELD }, + { 169, HALBERD }, + { 169, ELF }, + { 182, SHIELD }, + { 182, HALBERD }, + { 182, ELF }, + { 198, SHIELD }, + { 198, HALBERD }, + { 198, ELF }, + { 212, SHIELD }, + { 212, HALBERD }, + { 212, ELF }, + { 216, SHIELD }, + { 216, HALBERD }, + { 216, ELF }, + { 226, SHIELD }, + { 226, HALBERD }, + { 226, ELF }, + { 228, SHIELD }, + { 228, HALBERD }, + { 228, ELF }, + { 68, CYLON }, + { 144, SHOVEL }, + { 249, FOOT }, + { 250, FOOT }, + { 93, PAPAYAS }, + 0 +}; diff --git a/games/battlestar/parse.c b/games/battlestar/parse.c new file mode 100644 index 0000000..48e0901 --- /dev/null +++ b/games/battlestar/parse.c @@ -0,0 +1,74 @@ +/* + * Copyright (c) 1983 Regents of the University of California, + * All rights reserved. Redistribution permitted subject to + * the terms of the Berkeley Software License Agreement. + */ + +#if !defined(lint) && !defined(pdp11) +static char sccsid[] = "@(#)parse.c 1.2 4/24/85"; +#endif + +#include "externs.h" + +wordinit() +{ + register struct wlist *w; + + for (w = wlist; w->string; w++) + install(w); +} + +hash(s) + register char *s; +{ + register hashval = 0; + + while (*s) { + hashval += *s++; + hashval *= HASHMUL; + hashval &= HASHMASK; + } + return hashval; +} + +struct wlist * +lookup(s) + char *s; +{ + register struct wlist *wp; + + for (wp = hashtab[hash(s)]; wp != NULL; wp = wp->next) + if (*s == *wp->string && strcmp(s, wp->string) == 0) + return wp; + return NULL; +} + +install(wp) + register struct wlist *wp; +{ + int hashval; + + if (lookup(wp->string) == NULL) { + hashval = hash(wp->string); + wp->next = hashtab[hashval]; + hashtab[hashval] = wp; + } else + printf("Multiply defined %s.\n", wp->string); +} + +parse() +{ + register struct wlist *wp; + register n; + + wordnumber = 0; /* for cypher */ + for (n = 0; n <= wordcount; n++) { + if ((wp = lookup(words[n])) == NULL) { + wordvalue[n] = -1; + wordtype[n] = -1; + } else { + wordvalue[n] = wp -> value; + wordtype[n] = wp -> article; + } + } +} diff --git a/games/battlestar/room.c b/games/battlestar/room.c new file mode 100644 index 0000000..c84be78 --- /dev/null +++ b/games/battlestar/room.c @@ -0,0 +1,260 @@ +/* + * Copyright (c) 1983 Regents of the University of California, + * All rights reserved. Redistribution permitted subject to + * the terms of the Berkeley Software License Agreement. + */ + +#if !defined(lint) && !defined(pdp11) +static char sccsid[] = "@(#)room.c 1.3 4/24/85"; +#endif + +#include "externs.h" + +#ifdef pdp11 +#include +#include + +static int desc = -1; + +writedes() +{ + int compass; + register char *p; + register c; + char buf[BUFSIZ]; + + if (desc < 0) + desc = open(BATTLESTRINGS, O_RDONLY, 0666); + + lseek(desc, (off_t) location[position].name, L_SET); + read(desc, &buf, sizeof(buf)); + printf("\n\t%s\n", &buf); + if (beenthere[position] < 3) { + compass = NORTH; + lseek(desc, (off_t) location[position].desc, L_SET); + read(desc, &buf, sizeof(buf)); + for (p = buf; c = *p++;) + if (c != '-' && c != '*' && c != '+') + putchar(c); + else { + if (c != '*') + printf(truedirec(compass, c)); + compass++; + } + } +} + +printobjs() +{ + register unsigned int *p = location[position].objects; + register n; + char buf[BUFSIZ]; + + printf("\n"); + for (n = 0; n < NUMOFOBJECTS; n++) + if (testbit(p, n) && objdes[n]) { + lseek(desc, (off_t) objdes[n], L_SET); + read(desc, &buf, sizeof(buf)); + puts(&buf); + } +} + +strprt(n) +int n; +{ + char buf[BUFSIZ]; + + lseek(desc, (off_t) objdes[n], L_SET); + read(desc, &buf, sizeof(buf)); + printf("%s\n", &buf); +} + +#else pdp11 +writedes() +{ + int compass; + register char *p; + register c; + + printf("\n\t%s\n", location[position].name); + if (beenthere[position] < 3) { + compass = NORTH; + for (p = location[position].desc; c = *p++;) + if (c != '-' && c != '*' && c != '+') + putchar(c); + else { + if (c != '*') + printf(truedirec(compass, c)); + compass++; + } + } +} + +printobjs() +{ + register unsigned int *p = location[position].objects; + register n; + + printf("\n"); + for (n = 0; n < NUMOFOBJECTS; n++) + if (testbit(p, n) && objdes[n]) + puts(objdes[n]); +} +#endif pdp11 + +whichway(here) +struct room here; +{ + switch(direction) { + + case NORTH: + left = here.west; + right = here.east; + ahead = here.north; + back = here.south; + break; + + case SOUTH: + left = here.east; + right = here.west; + ahead = here.south; + back = here.north; + break; + + case EAST: + left = here.north; + right = here.south; + ahead = here.east; + back = here.west; + break; + + case WEST: + left = here.south; + right = here.north; + ahead = here.west; + back = here.east; + break; + + } +} + +char * +truedirec(way, option) +int way; +char option; +{ + switch(way) { + + case NORTH: + switch(direction) { + case NORTH: + return("ahead"); + case SOUTH: + return(option == '+' ? "behind you" : "back"); + case EAST: + return("left"); + case WEST: + return("right"); + } + + case SOUTH: + switch(direction) { + case NORTH: + return(option == '+' ? "behind you" : "back"); + case SOUTH: + return("ahead"); + case EAST: + return("right"); + case WEST: + return("left"); + } + + case EAST: + switch(direction) { + case NORTH: + return("right"); + case SOUTH: + return("left"); + case EAST: + return("ahead"); + case WEST: + return(option == '+' ? "behind you" : "back"); + } + + case WEST: + switch(direction) { + case NORTH: + return("left"); + case SOUTH: + return("right"); + case EAST: + return(option == '+' ? "behind you" : "back"); + case WEST: + return("ahead"); + } + + default: + printf("Error: room %d. More than four directions wanted.", position); + return("!!"); + } +} + +newway(thisway) +int thisway; +{ + switch(direction){ + + case NORTH: + switch(thisway){ + case LEFT: + direction = WEST; + break; + case RIGHT: + direction = EAST; + break; + case BACK: + direction = SOUTH; + break; + } + break; + case SOUTH: + switch(thisway){ + case LEFT: + direction = EAST; + break; + case RIGHT: + direction = WEST; + break; + case BACK: + direction = NORTH; + break; + } + break; + case EAST: + switch(thisway){ + case LEFT: + direction = NORTH; + break; + case RIGHT: + direction = SOUTH; + break; + case BACK: + direction = WEST; + break; + } + break; + case WEST: + switch(thisway){ + case LEFT: + direction = SOUTH; + break; + case RIGHT: + direction = NORTH; + break; + case BACK: + direction = EAST; + break; + } + break; + } +} diff --git a/games/battlestar/save.c b/games/battlestar/save.c new file mode 100644 index 0000000..530ca73 --- /dev/null +++ b/games/battlestar/save.c @@ -0,0 +1,122 @@ +/* + * Copyright (c) 1983 Regents of the University of California, + * All rights reserved. Redistribution permitted subject to + * the terms of the Berkeley Software License Agreement. + */ + +#if !defined(lint) && !defined(pdp11) +static char sccsid[] = "@(#)save.c 1.4.1 1996/10/26"; +#endif + +#include "externs.h" + +restore() +{ + char *getenv(); + char *home; + char home1[100]; + register int n; + int tmp; + register FILE *fp; + + home = getenv("HOME"); + strcpy(home1, home); + strcat(home1, "/Bstar"); + if ((fp = fopen(home1, "r")) == 0) { + perror(home1); + return; + } + fread(&WEIGHT, sizeof WEIGHT, 1, fp); + fread(&CUMBER, sizeof CUMBER, 1, fp); + fread(&clock, sizeof clock, 1, fp); + fread(&tmp, sizeof tmp, 1, fp); + location = tmp ? dayfile : nightfile; + for (n = 1; n <= NUMOFROOMS; n++) { + fread(location[n].link, sizeof location[n].link, 1, fp); + fread(location[n].objects, sizeof location[n].objects, 1, fp); + } + fread(inven, sizeof inven, 1, fp); + fread(wear, sizeof wear, 1, fp); + fread(injuries, sizeof injuries, 1, fp); + fread(notes, sizeof notes, 1, fp); + fread(&direction, sizeof direction, 1, fp); + fread(&position, sizeof position, 1, fp); + fread(&Time, sizeof Time, 1, fp); + fread(&fuel, sizeof fuel, 1, fp); + fread(&torps, sizeof torps, 1, fp); + fread(&carrying, sizeof carrying, 1, fp); + fread(&encumber, sizeof encumber, 1, fp); + fread(&rythmn, sizeof rythmn, 1, fp); + fread(&followfight, sizeof followfight, 1, fp); + fread(&ate, sizeof ate, 1, fp); + fread(&snooze, sizeof snooze, 1, fp); + fread(&meetgirl, sizeof meetgirl, 1, fp); + fread(&followgod, sizeof followgod, 1, fp); + fread(&godready, sizeof godready, 1, fp); + fread(&win, sizeof win, 1, fp); + fread(&wintime, sizeof wintime, 1, fp); + fread(&matchlight, sizeof matchlight, 1, fp); + fread(&matchcount, sizeof matchcount, 1, fp); + fread(&loved, sizeof loved, 1, fp); + fread(&pleasure, sizeof pleasure, 1, fp); + fread(&power, sizeof power, 1, fp); + fread(&ego, sizeof ego, 1, fp); + + fclose(fp); +} + +save() +{ + char *getenv(); + char *home; + char home1[100]; + register int n; + int tmp; + FILE *fp; + + home = getenv("HOME"); + strcpy(home1, home); + strcat(home1, "/Bstar"); + if ((fp = fopen(home1, "w")) == 0) { + perror(home1); + return; + } + printf("Saved in %s.\n", home1); + fwrite(&WEIGHT, sizeof WEIGHT, 1, fp); + fwrite(&CUMBER, sizeof CUMBER, 1, fp); + fwrite(&clock, sizeof clock, 1, fp); + tmp = location == dayfile; + fwrite(&tmp, sizeof tmp, 1, fp); + for (n = 1; n <= NUMOFROOMS; n++) { + fwrite(location[n].link, sizeof location[n].link, 1, fp); + fwrite(location[n].objects, sizeof location[n].objects, 1, fp); + } + fwrite(inven, sizeof inven, 1, fp); + fwrite(wear, sizeof wear, 1, fp); + fwrite(injuries, sizeof injuries, 1, fp); + fwrite(notes, sizeof notes, 1, fp); + fwrite(&direction, sizeof direction, 1, fp); + fwrite(&position, sizeof position, 1, fp); + fwrite(&Time, sizeof Time, 1, fp); + fwrite(&fuel, sizeof fuel, 1, fp); + fwrite(&torps, sizeof torps, 1, fp); + fwrite(&carrying, sizeof carrying, 1, fp); + fwrite(&encumber, sizeof encumber, 1, fp); + fwrite(&rythmn, sizeof rythmn, 1, fp); + fwrite(&followfight, sizeof followfight, 1, fp); + fwrite(&ate, sizeof ate, 1, fp); + fwrite(&snooze, sizeof snooze, 1, fp); + fwrite(&meetgirl, sizeof meetgirl, 1, fp); + fwrite(&followgod, sizeof followgod, 1, fp); + fwrite(&godready, sizeof godready, 1, fp); + fwrite(&win, sizeof win, 1, fp); + fwrite(&wintime, sizeof wintime, 1, fp); + fwrite(&matchlight, sizeof matchlight, 1, fp); + fwrite(&matchcount, sizeof matchcount, 1, fp); + fwrite(&loved, sizeof loved, 1, fp); + fwrite(&pleasure, sizeof pleasure, 1, fp); + fwrite(&power, sizeof power, 1, fp); + fwrite(&ego, sizeof ego, 1, fp); + + fclose(fp); +} diff --git a/games/battlestar/words.c b/games/battlestar/words.c new file mode 100644 index 0000000..2735753 --- /dev/null +++ b/games/battlestar/words.c @@ -0,0 +1,179 @@ +/* + * Copyright (c) 1983 Regents of the University of California, + * All rights reserved. Redistribution permitted subject to + * the terms of the Berkeley Software License Agreement. + */ + +#if !defined(lint) && !defined(pdp11) +static char sccsid[] = "@(#)words.c 1.3 4/24/85"; +#endif + +#include "externs.h" + +struct wlist wlist[] = { + { "knife", KNIFE, OBJECT }, + { "sword", SWORD, NOUNS }, + { "scabbard", SWORD, OBJECT }, + { "fine", SWORD, OBJECT }, + { "two-handed", TWO_HANDED, OBJECT }, + { "cleaver", CLEAVER, OBJECT }, + { "broadsword", BROAD, OBJECT }, + { "mail", MAIL, OBJECT }, + { "coat", MAIL, OBJECT }, + { "helmet", HELM, OBJECT }, + { "shield", SHIELD, OBJECT }, + { "maid", MAID, OBJECT }, + { "maid's", MAID, OBJECT }, + { "body", BODY, NOUNS }, + { "viper", VIPER, OBJECT }, + { "lamp", LAMPON, OBJECT }, + { "lantern", LAMPON, OBJECT }, + { "shoes", SHOES, OBJECT }, + { "pajamas", PAJAMAS, OBJECT }, + { "robe", ROBE, OBJECT }, + { "amulet", AMULET, NOUNS }, + { "medallion", MEDALION, NOUNS }, + { "talisman", TALISMAN, NOUNS }, + { "woodsman", DEADWOOD, OBJECT }, + { "woodsman's", DEADWOOD, OBJECT }, + { "mallet", MALLET, OBJECT }, + { "laser", LASER, OBJECT }, + { "pistol", LASER, OBJECT }, + { "blaster", LASER, OBJECT }, + { "gun", LASER, OBJECT }, + { "goddess", NORMGOD, NOUNS }, + { "grenade", GRENADE, OBJECT }, + { "chain", CHAIN, OBJECT }, + { "rope", ROPE, OBJECT }, + { "levis", LEVIS, OBJECT }, + { "pants", LEVIS, OBJECT }, + { "mace", MACE, OBJECT }, + { "shovel", SHOVEL, OBJECT }, + { "halberd", HALBERD, OBJECT }, + { "compass", COMPASS, OBJECT }, + { "elf", ELF, OBJECT }, + { "coins", COINS, OBJECT }, + { "matches", MATCHES, OBJECT }, + { "match", MATCHES, OBJECT }, + { "book", MATCHES, OBJECT }, + { "man", MAN, NOUNS }, + { "papayas", PAPAYAS, OBJECT }, + { "pineapple", PINEAPPLE, OBJECT }, + { "kiwi", KIWI, OBJECT }, + { "coconuts", COCONUTS, OBJECT }, + { "mango", MANGO, OBJECT }, + { "ring", RING, OBJECT }, + { "potion", POTION, OBJECT }, + { "bracelet", BRACELET, OBJECT }, + { "timer", TIMER, NOUNS }, + { "bomb", BOMB, OBJECT }, + { "warhead", BOMB, OBJECT }, + { "girl", NATIVE, NOUNS }, + { "native", NATIVE, NOUNS }, + { "horse", HORSE, OBJECT }, + { "stallion", HORSE, OBJECT }, + { "car", CAR, OBJECT }, + { "volare", CAR, OBJECT }, + { "pot", POT, OBJECT }, + { "jewels", POT, OBJECT }, + { "bar", BAR, OBJECT }, + { "diamond", BLOCK, OBJECT }, + { "block", BLOCK, OBJECT }, + { "up", UP, VERB }, + { "u", UP, VERB }, + { "down", DOWN, VERB }, + { "d", DOWN, VERB }, + { "ahead", AHEAD, VERB }, + { "a", AHEAD, VERB }, + { "back", BACK, VERB }, + { "b", BACK, VERB }, + { "right", RIGHT, VERB }, + { "r", RIGHT, VERB }, + { "left", LEFT, VERB }, + { "l", LEFT, VERB }, + { "take", TAKE, VERB }, + { "get", TAKE, VERB }, + { "use", USE, VERB }, + { "look", LOOK, VERB }, + { "lo", LOOK, VERB }, + { "quit", QUIT, VERB }, + { "q", QUIT, VERB }, + { "su", SU, VERB }, + { "drop", DROP, VERB }, + { "draw", DRAW, VERB }, + { "pull", DRAW, VERB }, + { "carry", DRAW, VERB }, + { "wear", WEARIT, VERB }, + { "sheathe", WEARIT, VERB }, + { "put", PUT, VERB }, + { "buckle", PUT, VERB }, + { "strap", PUT, VERB }, + { "tie", PUT, VERB }, + { "inven", INVEN, VERB }, + { "i", INVEN, VERB }, + { "everything", EVERYTHING, OBJECT }, + { "all", EVERYTHING, OBJECT }, + { "and", AND, CONJ }, + { "kill", KILL, VERB }, + { "fight", KILL, VERB }, + { "ravage", RAVAGE, VERB }, + { "rape", RAVAGE, VERB }, + { "undress", UNDRESS, VERB }, + { "throw", THROW, VERB }, + { "launch", LAUNCH, VERB }, + { "land", LANDIT, VERB }, + { "light", LIGHT, VERB }, + { "strike", LIGHT, VERB }, + { "follow", FOLLOW, VERB }, + { "chase", FOLLOW, VERB }, + { "kiss", KISS, VERB }, + { "love", LOVE, VERB }, + { "fuck", LOVE, VERB }, + { "give", GIVE, VERB }, + { "smite", SMITE, VERB }, + { "attack", SMITE, VERB }, + { "swing", SMITE, VERB }, + { "stab", SMITE, VERB }, + { "slice", SMITE, VERB }, + { "cut", SMITE, VERB }, + { "hack", SMITE, VERB }, + { "shoot", SHOOT, VERB }, + { "blast", SHOOT, VERB }, + { "on", ON, PREPS }, + { "off", OFF, PREPS }, + { "time", TIME, VERB }, + { "sleep", SLEEP, VERB }, + { "dig", DIG, VERB }, + { "eat", EAT, VERB }, + { "swim", SWIM, VERB }, + { "drink", DRINK, VERB }, + { "door", DOOR, NOUNS }, + { "save", SAVE, VERB }, + { "ride", RIDE, VERB }, + { "mount", RIDE, VERB }, + { "drive", DRIVE, VERB }, + { "start", DRIVE, VERB }, + { "score", SCORE, VERB }, + { "points", SCORE, VERB }, + { "bury", BURY, VERB }, + { "jump", JUMP, VERB }, + { "kick", KICK, VERB }, + { "kerosene", 0, ADJS }, + { "plumed", 0, ADJS }, + { "ancient", 0, ADJS }, + { "golden", 0, ADJS }, + { "gold", 0, ADJS }, + { "ostrich", 0, ADJS }, + { "rusty", 0, ADJS }, + { "old", 0, ADJS }, + { "dented", 0, ADJS }, + { "blue", 0, ADJS }, + { "purple", 0, ADJS }, + { "kingly", 0, ADJS }, + { "the", 0, ADJS }, + { "climb", 0, ADJS }, + { "move", 0, ADJS }, + { "make", 0, ADJS }, + { "to", 0, ADJS }, + 0 +}; diff --git a/games/bcd.c b/games/bcd.c new file mode 100644 index 0000000..13b60b6 --- /dev/null +++ b/games/bcd.c @@ -0,0 +1,136 @@ + +static char sccsid[] = " bcd.c 4.1 82/10/24 "; + +int chtab[] = { +00000, /* */ +03004, /* ! */ +02404, /* " */ +02040, /* sharp */ +02042, /* $ */ +02104, /* % */ +00001, /* & */ +03002, /* ' */ +02201, /* ( */ +02202, /* ) */ +02102, /* * */ +00005, /* + */ +02044, /* , */ +00002, /* - */ +02041, /* . */ +00014, /* / */ +00004, /* 0 */ +00010, /* 1 */ +00020, /* 2 */ +00040, /* 3 */ +00100, /* 4 */ +00200, /* 5 */ +00400, /* 6 */ +01000, /* 7 */ +02000, /* 8 */ +04000, /* 9 */ +02200, /* : */ +02402, /* ; */ +02401, /* < */ +02204, /* = */ +02400, /* > */ +03000, /* ? */ +02100, /* at */ + 011, + 021, + 041, +0101, +0201, +0401, +01001, +02001, +04001, +012, +022, +042, +0102, +0202, +0402, +01002, +02002, +02002, +024, +044, +0104, +0204, +0404, +01004, +02004, +04004, +02020, /* [ */ +03001, /* \ */ +02101, /* ] */ +00006, /* ^ */ +02024 /* _ */ +}; + char s[128]; + char *sp = {&s[0]}; +main(argc, argv) +char *argv[]; +{ + char *spp; + int i; + int j; + int c; + int l; + + if (argc<2) { + puts("% "); + while ((c=getchar())!='\0'&c!='\n') + *sp++ = c; + *sp = 0; + sp = &s[0]; + } else + sp = *++argv; + puts("\n\n\n\n"); + puts(" ________________________________"); + puts("________________\n"); + spp = sp; + while(*spp++); + spp--; + l = spp - sp; + putchar('/'); + puts(sp); + i = 49 - l; + while(--i>0) putchar(' '); + puts("|\n"); + j = 0; + spp = sp; + while (j++<12) { + putchar('|'); + i = 0; + spp = sp; + while (i<48) { + if(i>l) c = 0; + else c = *spp++ - 040; + i++; + if (c>='a'-040) c = c - 040; + if (c<0 | c>137) c = 0; + if ((chtab[c]>>(j-1))&1) + puts("[]"); + else + putchar(j>3?'0'+j-3:' '); + } + puts("|\n"); + } + putchar('|'); + puts("____________"); + puts("____________________________________"); + puts("|\n"); + puts("\n\n\n\n"); +} + +puts(ss) char *ss; { + int i; + char t; + i = 0; + while(t = *ss++) { + if(t >= 'a' && t <= 'z') + t += 'A'-'a'; + putchar(t); + } +} diff --git a/games/boggle/Makefile b/games/boggle/Makefile new file mode 100644 index 0000000..b3179aa --- /dev/null +++ b/games/boggle/Makefile @@ -0,0 +1,32 @@ +# +# Copyright (c) 1980 Regents of the University of California. +# All rights reserved. The Berkeley software License Agreement +# specifies the terms and conditions for redistribution. +# +# @(#)Makefile 5.3 (Berkeley) 9/7/85 +# +DESTDIR= +CC = /bin/cc +SEPFLAG= -i +CFLAGS = -O + +all: boggle bogdict + +bogdict: comp sfile + -if [ -f /usr/local/lib/w2a ]; \ + then dict=/usr/local/lib/w2a; \ + else dict=/usr/dict/words; fi; \ + sed -f sfile $$dict | uniq | ./comp >bogdict + +install: all + install -s boggle ${DESTDIR}/usr/games/boggle + install -m 644 bogdict ${DESTDIR}/usr/games/lib/bogdict + +boggle: boggle.c + cc ${SEPFLAG} -o boggle ${CFLAGS} boggle.c + +comp: comp.c + cc ${SEPFLAG} -o comp ${CFLAGS} comp.c + +clean: + rm -f bogdict boggle comp *.o diff --git a/games/boggle/boggle.c b/games/boggle/boggle.c new file mode 100644 index 0000000..c56553e --- /dev/null +++ b/games/boggle/boggle.c @@ -0,0 +1,652 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if !defined(lint) && defined(DOSCCS) +char copyright[] = +"@(#) Copyright (c) 1980 Regents of the University of California.\n\ + All rights reserved.\n"; + +static char sccsid[] = "@(#)boggle.c 5.1.1 (2.11BSD) 1997/10/2"; +#endif + +#include +#include +#include +#include +#include +#include +#include +#include + +/* basic parameters */ +#define N 4 +#define SSIZE 200 +#define MAXWORDS 1000 +#define CWIDTH 10 +#define LWIDTH 80 + +/* parameters defined in terms of above */ +#define BSIZE (N*N) +#define row(x) (x/N) +#define col(x) (x%N) + +/* word being searched for */ +int wlength; +int numsame; +char wbuff [BSIZE+1]; + +/* tty and process control */ +extern int errno; +int status; +int pipefd[2]; +int super = 0; +int delct = 1; +int zero = 0; +int master = 1; +int column; +int *timept; +int timeint[] = {60,60,50,7,1,1,1,0}; +long timein; +struct sgttyb origttyb, tempttyb; +int ctlecho = 0; +int lctlech = LCTLECH; +jmp_buf env; + +/* monitoring variables */ +int games; +int logfile = -1; +long logloc; +char logbuff[100] = {"inst\t"}; + +/* dictionary interface */ +char defname[] = "/usr/games/lib/bogdict"; +char *dictname = &defname[0]; +FILE *dict; + +/* structures for doing matching */ +struct frame { + struct frame *parent; + int place; +}; +struct frame stack [SSIZE]; +struct frame *level [BSIZE+1]; + +/* the board and subsidiary structures */ +char present [BSIZE+1]; +char board [BSIZE]; +char olink [BSIZE]; +char adj [BSIZE+1][BSIZE]; +char occurs [26]; + +/* the boggle cubes */ +char *cube [BSIZE] = { + "forixb", "moqabj", "gurilw", "setupl", + "cmpdae", "acitao", "slcrae", "romash", + "nodesw", "hefiye", "onudtk", "tevign", + "anedvz", "pinesh", "abilyt", "gkyleu" +}; + + +/* storage for words found */ +int ubotch, ustart, wcount; +char *word [MAXWORDS]; +char *freesp; +char space[10000]; + +endline () +{ + if (column != 0) { + putchar('\n'); + column = 0; + } +} + +timeout () +{ + if (*timept > 0) { + signal (SIGALRM, timeout); + alarm(*timept++); + } + putchar('\007'); +} + +interrupt () +{ + signal(SIGINT, interrupt); + if (delct++ >= 1) + longjmp(env, 1); + timept = &zero; +} + +goodbye (stat) +int stat; +{ + if (master != 0) { + wait(&status); + if ( ctlecho & LCTLECH ) { + ioctl( fileno(stdin), TIOCLBIS, &lctlech ); + } + stty(fileno(stdin), &origttyb); + } + exit(stat); +} + +clearscreen () +{ + stty (fileno(stdin), &tempttyb); + printf("\n\f\r"); +} + +compare (a, b) +char **a, **b; +{ + return(wordcomp(*a, *b)); +} + +wordcomp (p, q) +register char *p, *q; +{ + if (*p=='0' && *q!='0') + return(-1); + if (*p!='0' && *q=='0') + return(1); + while (*++p == *++q && isalpha(*p)) ; + if (!isalpha(*p)) + return(-isalpha(*q)); + if (!isalpha(*q)) + return(1); + return(*p-*q); +} + +printinst () +{ + stty (fileno(stdin), &tempttyb); + printf("instructions?"); + if (getchar() == 'y') { + clearscreen(); + printf(" The object of Boggle (TM Parker Bros.) is to find, within 3\n"); + printf("minutes, as many words as possible in a 4 by 4 grid of letters. Words\n"); + printf("may be formed from any sequence of 3 or more adjacent letters in the\n"); + printf("grid. The letters may join horizontally, vertically, or diagonally.\n"); + printf("However, no position in the grid may be used more than once within any\n"); + printf("one word. In competitive play amongst humans, each player is given\n"); + printf("credit for those of his words which no other player has found.\n"); + printf(" This program is intended for people wishing to sharpen their\n"); + printf("skills at Boggle. If you invoke the program with 4 arguments of 4\n"); + printf("letters each, (e.g. \"boggle appl epie moth erhd\") the program forms the\n"); + printf("obvious Boggle grid and lists all the words from /usr/dict/words found\n"); + printf("therein. If you invoke the program without arguments, it will generate\n"); + printf("a board for you, let you enter words for 3 minutes, and then tell you\n"); + printf("how well you did relative to /usr/dict/words.\n"); + printf(" In interactive play, enter your words separated by spaces, tabs,\n"); + printf("or newlines. A bell will ring when there is 2:00, 1:00, 0:10, 0:02,\n"); + printf("0:01, and 0:00 time left. You may complete any word started before the\n"); + printf("expiration of time. You can surrender before time is up by hitting\n"); + printf("'break'. While entering words, your erase character is only effective\n"); + printf("within the current word and your line kill character is ignored.\n"); + printf(" Advanced players may wish to invoke the program with 1 or 2 +'s as\n"); + printf("the first argument. The first + removes the restriction that positions\n"); + printf("can only be used once in each word. The second + causes a position to\n"); + printf("be considered adjacent to itself as well as its (up to) 8 neighbors.\n"); + printf("Hit any key to begin.\n"); + stty (fileno(stdin), &tempttyb); + getchar(); + } + stty (fileno(stdin), &tempttyb); +} + +setup () +{ + register int i, j; + int rd, cd, k; + for (i=0; i=2 ? 1 : 0; + adj[BSIZE][i] = 1; + for (j=0; j0 && (isspace(c=getchar()) || c==EOF)); + if (*timept == 0) + return(0); + word[wcount++] = freesp; + *freesp++ = '0'; + r = &wbuff[1]; + q = p = freesp; + *p++ = c; + while (!isspace(c = getchar())) { + if (c == EOF) + continue; + if (c == origttyb.sg_erase) { + if (p > q) + p--; + continue; + } + *p++ = c; + } + freesp = p; + for (p=q; p=10 ? '*' : '0'+ways; +} + +aputword (ways) +int ways; +{ + /* store (wbuff, ways) in next slot in space */ + register int i; + *freesp++ = ways>=10 ? '*' : '0'+ways; + for (i=1; i<= wlength; i++) + *freesp++ = wbuff[i]; + word[++wcount] = freesp; +} + +tputword (ways) +int ways; +{ + /* print (wbuff, ways) on terminal */ + wbuff[wlength+1] = '0'; + wbuff[0] = ways>=10 ? '*' : '0'+ways; + outword(&wbuff[0]); +} + +outword (p) +register char *p; +{ + register int newcol; + register char *q; + for (q=p+1; isalpha(*q); ) { + putchar(*q); + if (*q++ == 'q') { + putchar('u'); + column++; + } + } + column += q-p-1; + if (column > LWIDTH-CWIDTH) { + putchar('\n'); + column = 0; + return; + } + newcol = ((column+CWIDTH)/CWIDTH)*CWIDTH; + while (((column+8)/8)*8 <= newcol) { + putchar('\t'); + column = ((column+8)/8)*8; + } + while (column < newcol) { + putchar(' '); + column++; + } +} + +printdiff () +{ + register int c, d, u; + char both, donly, uonly; + word[wcount] = freesp; + *freesp = '0'; + both = donly = uonly = column = d = 0; + u = ustart; + while (d < ubotch) { + c = u 0) + return(last-leaf); + count = 0; + present[BSIZE] = 1; + while (leaf < last) { + for (p = &present[0]; p < &present[BSIZE]; *p++ = 0); + for (node = leaf; present[node->place]++ == 0; node = node->parent); + if (node == &stack[0]) + count++; + leaf++; + } + return(count); +} + +evalboard (getword, putword) +int (*getword)(), (*putword)(); +{ + register struct frame *top; + register int l, q; + int fo, found; + struct frame *parent, *lastparent; + char *padj; + + numsame = found = 0; + makelists (); + + while (1) { + l = numsame; + if (!(*getword) ()) + break; + top = level[l+1]; + + while (1) { + level[l+1] = lastparent = top; + /* wbuff[1]...wbuff[l] have been matched */ + /* level[0],...,level[l] of tree built */ + if (l == wlength) { + if (wlength >= 3 && (q = numways(level[l], top)) != 0) { + (*putword) (q); + found++; + } + l = BSIZE+1; + break; + } + if ((fo = occurs[wbuff[++l]-'a']) == BSIZE) + break; + /* wbuff[1]...wbuff[l-1] have been matched */ + /* level[0],...,level[l-1] of tree built */ + for (parent=level[l-1]; parentplace][0]; + for (q=fo; q!=BSIZE; q=olink[q]) + if (padj[q]) { + top->parent = parent; + top->place = q; + if (++top >= &stack[SSIZE]) { + printf("stack overflow\n"); + goodbye(1); + } + } + } + /* were any nodes added? */ + if (top == lastparent) + break; + } + + /* advance until first l characters of next word are different */ + while (numsame >= l && (*getword)()) ; + } + return(found); +} + +main (argc, argv) +int argc; +char **argv; +{ + char *q; + register char *p; + register int i, c; + + gtty (fileno(stdin), &origttyb); + setbuf(stdin, NULL); + tempttyb = origttyb; + if (setjmp(env) != 0) + goodbye(0); + signal (SIGINT, interrupt); + timein = time(0L); + if (argv[0][0] != 'a' && (logfile = open("/usr/games/lib/boglog", 1)) >= 0) { + p = &logbuff[5]; + q = getlogin(); + while (*p++ = *q++); + p[-1] = '\t'; + q = ctime(&timein); + while (*p++ = *q++); + logloc = lseek(logfile, 0L, 2); + write(logfile, &logbuff[0], p-&logbuff[1]); + } + if ((dict = fopen(dictname, "r")) == NULL) { + printf("can't open %s\n", dictname); + goodbye (2); + } + while ( argc > 1 && ( argv[1][0] == '+' || argv[1][0] == '-' ) ) { + if (argv[1][0]=='+') { + while(*(argv[1]++) == '+') + super++; + argc--; + argv++; + } + if ( argv[1][0] == '-' ) { + timeint[0] = 60 * ( atol( &argv[1][1] ) - 2 ); + if ( timeint[0] <= 0 ) { + timeint[0] = 60; + } + argc--; + argv++; + } + } + setup (); + switch (argc) { + default: punt: + printf("usage: boggle [+[+]] [row1 row2 row3 row4]\n"); + goodbye (3); + case 5: + for (i=0; i= 0) { + strncpy(&logbuff[0], "eval", 4); + lseek(logfile, logloc, 0); + write(logfile, &logbuff[0], 4); + } + goodbye(0); + case 1: + tempttyb.sg_flags |= CBREAK; + if ( ioctl( fileno(stdin), TIOCLGET, &ctlecho ) == 0 ) { + if ( ctlecho & LCTLECH ) { + ioctl( fileno(stdin), TIOCLBIC, &lctlech ); + } + } + printinst(); + srand((int) timein); + while (setjmp(env) == 0) { + errno = 0; + if (pipe(&pipefd[0]) != 0) { + printf("can't create pipe\n"); + goodbye(4); + } + genboard(); + delct = wcount = 0; + word[0] = freesp = &space[0]; + if ((master = fork()) == 0) { + close(pipefd[0]); + clearscreen(); + printboard(); + signal(SIGALRM, timeout); + timept = &timeint[0]; + alarm(*timept++); + evalboard(getuword, aputuword); + clearscreen(); + qsort(&word[0], wcount, sizeof (int), compare); + for (i=0; i= 0) { + sprintf(&logbuff[0], "%4d", games); + lseek(logfile, logloc, 0); + write(logfile, &logbuff[0], 4); + } + stty (fileno(stdin), &tempttyb); + printf("\nanother game?"); + if (getchar() != 'y') { + putchar('\n'); + break; + } + stty (fileno(stdin), &tempttyb); + } + goodbye(0); + } +} diff --git a/games/boggle/comp.c b/games/boggle/comp.c new file mode 100644 index 0000000..874f0a2 --- /dev/null +++ b/games/boggle/comp.c @@ -0,0 +1,37 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#ifndef lint +char copyright[] = +"@(#) Copyright (c) 1980 Regents of the University of California.\n\ + All rights reserved.\n"; +#endif not lint + +#ifndef lint +static char sccsid[] = "@(#)comp.c 5.1 (Berkeley) 5/30/85"; +#endif not lint + +#include +#define MAX ' ' + +char new[MAX], old[MAX]; + +main () +{ + register int i, j; + old[0] = '\0'; + while (fgets(&new[0], MAX, stdin) != NULL) { + for (i=0; i= MAX) { + fprintf(stderr, "long word\n"); + exit(1); + } + putc(i, stdout); + for (j=0; (old[j]=new[j]) != '\n'; j++); + old[j] = '\0'; + fputs(&old[i], stdout); + } +} diff --git a/games/boggle/inst b/games/boggle/inst new file mode 100644 index 0000000..c70fb7d --- /dev/null +++ b/games/boggle/inst @@ -0,0 +1,42 @@ +.\" Copyright (c) 1980 Regents of the University of California. +.\" All rights reserved. The Berkeley software License Agreement +.\" specifies the terms and conditions for redistribution. +.\" +.\" @(#)inst 5.1 (Berkeley) 5/30/85 +.\" +.ll 71 +.ls 1 +.ti +5 +The object of Boggle (TM Parker Bros.) is to find, within 3 minutes, as +many words as possible in a 4 by 4 grid of letters. +Words may be formed from any sequence of 3 or more adjacent letters +in the grid. The letters may join horizontally, vertically, +or diagonally. However, no position in the grid may be used +more than once within any one word. +In competitive play amongst humans, each player is given +credit for those of his words which no other player has found. +.ti +5 +This program is intended for people +wishing to sharpen their skills at Boggle. +If you invoke the program with 4 arguments of 4 letters each, +(e.g. "boggle appl epie moth erhd") +the program forms the obvious Boggle grid and lists all the +words from /usr/dict/words found therein. +If you invoke the program without arguments, it will generate +a board for you, let you enter words for 3 minutes, and then +tell you how well you did relative to /usr/dict/words. +.ti +5 +In interactive play, enter your words separated by spaces, tabs, or newlines. +A bell will ring when there is 2:00, 1:00, 0:10, 0:02, 0:01, and 0:00 time +left. +You may complete any word started before the expiration of time. +You can surrender before time is up by hitting 'break'. +While entering words, your erase character is only effective within the current +word and your line kill character is ignored. +.ti +5 +Advanced players may wish to invoke the program with 1 or 2 +'s as the +first argument. The first + removes the restriction that postions can only +be used once in each word. +The second + causes a position to be considered adjacent to itself +as well as its (up to) 8 neighbors. +Hit any key to begin. diff --git a/games/boggle/sfile b/games/boggle/sfile new file mode 100644 index 0000000..2fb416d --- /dev/null +++ b/games/boggle/sfile @@ -0,0 +1,10 @@ +/^-/d +/-$/d +s/-//g +/[^a-z]/d +/q[^u]/d +/q$/d +/^.$/d +/^..$/d +s/qu/q/g +/.............../d diff --git a/games/btlgammon/Makefile b/games/btlgammon/Makefile new file mode 100644 index 0000000..d0724c0 --- /dev/null +++ b/games/btlgammon/Makefile @@ -0,0 +1,36 @@ +# @(#)Makefile 4.2 (Berkeley) 9/7/85 +# +DESTDIR= +CFLAGS= -O +SEPFLAG= -i + +btlgammon: btlgammon.c + cc ${SEPFLAG} ${CFLAGS} -o btlgammon btlgammon.c + +install: btlgammon backrules + install -s btlgammon ${DESTDIR}/usr/games/btlgammon + install -c backrules ${DESTDIR}/usr/games/lib/backrules + +clean: + rm -f a.out core *.s *.o btlgammon + +depend: + cat x.c + for i in btlgammon; do \ + (echo $$i: $$i.c >>makedep; \ + /bin/grep '^#[ ]*include' x.c $$i.c | sed \ + -e 's,<\(.*\)>,"/usr/include/\1",' \ + -e 's/:[^"]*"\([^"]*\)".*/: \1/' \ + -e 's/\.c//' >>makedep); done + echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep + echo '$$r makedep' >>eddep + echo 'w' >>eddep + cp Makefile Makefile.bak + ed - Makefile < eddep + rm eddep makedep x.c + echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile + echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile + echo '# see make depend above' >> Makefile + +# DO NOT DELETE THIS LINE -- make depend uses it + diff --git a/games/btlgammon/backrules b/games/btlgammon/backrules new file mode 100644 index 0000000..4b2ca70 --- /dev/null +++ b/games/btlgammon/backrules @@ -0,0 +1,19 @@ +To play backgammon, type the numbers of the points from which pieces are +to be moved. Thus, if the roll is '3,5', typing '2 6' will move a piece +from point 2 three spaces to point 5, and a piece from point 6 forward to +point 11. If the moves must be made in the opposite order, the first +character typed must be a minus ('-'). Thus, typing '-2 6' moves the +piece on point 2 by 5, and the piece on point 6 by 3. + +If you want to move a single piece several times, the sequence of points +from which it is to be moved must be typed. Thus '14 17' will move a +piece from point 14 to point 17 and thence to to point 22. + +If a double is rolled, you should type four numbers. Red pieces that +have been removed from the board by being hit by white are on point 0 and +must be brought in before any other move can be made. White pieces that +are hit are removed to point 25. You will not be allowed to make an +illegal move, or to make too many moves. However, if you make too few +moves, the program does not care. In particular you may skip your turn by +typing a 'new-line' all by itself. + diff --git a/games/btlgammon/btlgammon.c b/games/btlgammon/btlgammon.c new file mode 100644 index 0000000..e1acba8 --- /dev/null +++ b/games/btlgammon/btlgammon.c @@ -0,0 +1,717 @@ + +static char sccsid[] = " backgammon.c 4.1 82/10/24 "; + +/* +** The game of Backgammon +*/ + +#include + +#define WHITE 0 +#define BROWN 1 +#define NIL (-1) +#define MAXGMOV 10 +#define MAXIMOVES 1000 +#define RULES "/usr/games/lib/backrules" + +char level; /*'b'=beginner, 'i'=intermediate, 'e'=expert*/ + +int die1; +int die2; +int i; +int j; +int l; +int m; +int pflg = 1; +int nobroll = 0; +int count; +int imoves; +int goodmoves[MAXGMOV]; +int probmoves[MAXGMOV]; + +int brown[] = { /* brown position table */ + 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[] = { /* white position table */ + 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 +}; + +struct { + int pos[4]; + int mov[4]; +} moves[MAXIMOVES]; + +main() +{ + int go[5], tvec[2]; + int k, n, pid, ret, rpid, t; + char s[100]; + + srand(time(0)); + go[5] = NIL; + fprintf(stdout, "Instructions? "); + gets(s); + if(*s == 'y') + instructions(); + putchar('\n'); + fprintf(stdout, "Opponent's level: b - beginner,\n"); + fprintf(stdout, "i - intermediate, e - expert? "); + level='e'; + gets(s); + if(*s == 'b') + level = 'b'; + else if(*s == 'i') + level = 'i'; + putchar('\n'); + fprintf(stdout, "You will play brown.\n\n"); + fprintf(stdout, "Would you like to roll your own dice? "); + gets(s); + putchar('\n'); + if(*s == 'y') + nobroll = 1; + fprintf(stdout, "Would you like to go first? "); + gets(s); + putchar('\n'); + if(*s == 'y') + goto nowhmove; +whitesmv: + roll(WHITE); + fprintf(stdout, "white rolls %d, %d\n", die1, die2); + fprintf(stdout, "white's move is:"); + if(nextmove(white, brown) == NIL) + goto nowhmove; + if(piececount(white, 0, 24) == 0){ + fprintf(stdout, "White wins"); + if(piececount(brown, 0, 6) != 0) + fprintf(stdout, " with a Backgammon!\n"); + else if (piececount(brown, 0, 24) == 24) + fprintf(stdout, " with a Gammon.\n"); + else + fprintf(stdout, ".\n"); + exit(0); + } +nowhmove: + if(pflg) + prtbrd(); + roll(BROWN); +retry: + fprintf(stdout, "\nYour roll is %d %d\n", die1, die2); + fprintf(stdout, "Move? "); + gets(s); + switch(*s) { + case '\0': /* empty line */ + fprintf(stdout, "Brown's move skipped.\n"); + goto whitesmv; + + case 'b': /* how many beared off? */ + fprintf(stdout, "Brown: %d\n", piececount(brown, 0, 24) - 15); + fprintf(stdout, "White: %d\n", piececount(white, 0, 24) - 15); + goto retry; + + case 'p': /* print board */ + prtbrd(); + goto retry; + + case 's': /* stop auto printing of board */ + pflg = 0; + goto retry; + + case 'r': /* resume auto printing */ + pflg = 1; + goto retry; + + case 'm': /* print possible moves */ + pmoves(); + goto retry; + + case 'q': /* i give up */ + exit(0); + + case '!': /* escape to Shell */ + if(s[1] != '\0') + system(s+1); + else if((pid = fork()) == 0) { + execl("/bin/sh", "sh", "-", 0); + fprintf(stderr, "back: cannot exec /bin/sh!\n"); + exit(2); + } + while((rpid = wait(&ret)) != pid && rpid != -1) + ; + goto retry; + + case '?': /* well, what can i do? */ + fprintf(stdout, " skip this move\n"); + fprintf(stdout, "b number beared off\n"); + fprintf(stdout, "p print board\n"); + fprintf(stdout, "q quit\n"); + fprintf(stdout, "r resume auto print of board\n"); + fprintf(stdout, "s stop auto print of board\n"); + fprintf(stdout, "! escape to Shell\n"); + goto retry; + } + 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){ + fprintf(stdout, "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{ + fprintf(stdout, "Move %d illegal.\n", go[k]); + goto retry; + } + } + if(play(brown, white, go)) + goto retry; + if(piececount(brown, 0, 24) == 0){ + fprintf(stdout, "Brown wins"); + if(piececount(white, 0, 6) != 0) + fprintf(stdout, " with a Backgammon.\n"); + else if(piececount(white, 0, 24) == 24) + fprintf(stdout, " with a gammon.\n"); + else + fprintf(stdout, ".\n"); + exit(0); + } + goto whitesmv; +} + +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){ + fprintf(stdout, "Stone on bar must be moved first.\n"); + return(NIL); + } + } + 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: + fprintf(stdout, "Move %d illegal.\n", ipos); + while(k--){ + die=k?die2:die1; + player[pos[k]]++; + player[pos[k]+die]--; + } + return(NIL); +} +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){ + fprintf(stdout, "no move possible.\n"); + 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) + fprintf(stdout, "No move possible\n"); + else for(n = 0; n < 4; n++){ + if(moves[k].pos[n] == NIL) + break; + fprintf(stdout, " %d, %d",25-moves[k].pos[n],moves[k].mov[n]); + } + fprintf(stdout, "\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); +} +pmoves() +{ + int i1, i2; + + fprintf(stdout, "Possible moves are:\n"); + for(i1 = 0; i1 < imoves; i1++){ + fprintf(stdout, "\n%d",i1); + for (i2 = 0; i2<4; i2++){ + if(moves[i1].pos[i2] == NIL) + break; + fprintf(stdout, "%d, %d",moves[i1].pos[i2],moves[i1].mov[i2]); + } + } + fprintf(stdout, "\n"); +} + +roll(who) +{ + register n; + char s[10]; + + if(who == BROWN && nobroll) { + fprintf(stdout, "Roll? "); + gets(s); + n = sscanf(s, "%d%d", &die1, &die2); + if(n != 2 || die1 < 1 || die1 > 6 || die2 < 1 || die2 > 6) + fprintf(stdout, "Illegal - I'll do it!\n"); + else + return; + } + die1 = ((rand()>>8) % 6) + 1; + die2 = ((rand()>>8) % 6) + 1; +} + +movegen(mover,movee) +int *mover,*movee; +{ + 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,i-1) != 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,j-1) != 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,l-1) != 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,m-1) != 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; +{ + int t; + + if(imoves < MAXIMOVES) { + 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++; + } + } + 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; +{ + 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(n1){ + nn=n; + n=0; + prob=32000; + for(k = 0; k < nn; k++){ + if((moveval=probmoves[k]) > prob) + continue; + if(moveval>4)%n]); +} + +eval(player,playee,k,prob) +int *player,*playee,k,*prob; +{ + int newtry[31], newother[31], *r, *q, *p, n, sum, first; + int ii, lastwhite, lastbrown; + + *prob = sum = 0; + r = player+25; + p = newtry; + q = newother; + while(player6) { + for(sum = 1000; lastwhite > 6; lastwhite--) + sum = sum-lastwhite*newtry[25-lastwhite]; + } + for(first = 0; first < 25; first++) + if(newother[first] != 0) /*find other's first piece*/ + break; + q = newtry+25; + for(p = newtry+1; p < q;) /* blocked points are good */ + if(*p++ > 1) + sum++; + 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) /*singles are bad after 1st 6 points if they can be hit*/ + sum--; + q = newtry+3; + for(p = newtry; p < q; ) /*bad to be on 1st three points*/ + sum -= *p++; + } + + for(n = 1; n <= 4; n++) + *prob += n*getprob(newtry,newother,6*n-5,6*n); + return(sum); +} +instructions() +{ + register fd, r; + char buf[BUFSIZ]; + + if((fd = open(RULES, 0)) < 0) { + fprintf(stderr, "back: cannot open %s\n", RULES); + return; + } + while(r = read(fd, buf, BUFSIZ)) + write(1, buf, r); +} + +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; + static char undersc[]="______________________________________________________"; + + fprintf(stdout, "White's Home\n%s\r",undersc); + for(k = 1; k <= 6; k++) + fprintf(stdout, "%4d",k); + fprintf(stdout, " "); + for(k = 7; k <= 12; k++) + fprintf(stdout, "%4d",k); + putchar('\n'); + numline(brown, white, 1, 6); + fprintf(stdout, " "); + numline(brown, white, 7, 12); + putchar('\n'); + colorline(brown, 'B', white, 'W', 1, 6); + fprintf(stdout, " "); + colorline(brown, 'B', white, 'W', 7, 12); + putchar('\n'); + if(white[0] != 0) + fprintf(stdout, "%28dW\n",white[0]); + else + putchar('\n'); + if(brown[0] != 0) + fprintf(stdout, "%28dB\n", brown[0]); + else + putchar('\n'); + colorline(white, 'W', brown, 'B', 1, 6); + fprintf(stdout, " "); + colorline(white, 'W', brown, 'B', 7, 12); + fprintf(stdout, "\n%s\r",undersc); + numline(white, brown, 1, 6); + fprintf(stdout, " "); + numline(white, brown, 7, 12); + putchar('\n'); + for(k = 24; k >= 19; k--) + fprintf(stdout, "%4d",k); + fprintf(stdout, " "); + for(k = 18; k >= 13; k--) + fprintf(stdout, "%4d",k); + fprintf(stdout, "\nBrown'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) + fprintf(stdout, "%4d", n); + else + fprintf(stdout, " "); + } +} +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; + fprintf(stdout, " %c",c); + } +} diff --git a/games/canfield.c b/games/canfield.c new file mode 100644 index 0000000..69c36af --- /dev/null +++ b/games/canfield.c @@ -0,0 +1,1634 @@ +/* + * Copyright (c) 1982 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(DOSCCS) && !defined(lint) +char copyright[] = +"@(#) Copyright (c) 1980 Regents of the University of California.\n\ + All rights reserved.\n"; + +static char sccsid[] = "@(#)canfield.c 5.4.2 (2.11BSD GTE) 1/16/95"; +#endif + +/* + * The canfield program + * + * Authors: + * Originally written: Steve Levine + * Converted to use curses and debugged: Steve Feldman + * Card counting: Kirk McKusick and Mikey Olson + * User interface cleanups: Eric Allman and Kirk McKusick + * Betting by Kirk McKusick + */ + +#include +#include +#include +#include + +#define decksize 52 +#define originrow 0 +#define origincol 0 +#define basecol 1 +#define boxcol 42 +#define tboxrow 2 +#define bboxrow 17 +#define movecol 43 +#define moverow 16 +#define msgcol 43 +#define msgrow 15 +#define titlecol 30 +#define titlerow 0 +#define sidecol 1 +#define ottlrow 6 +#define foundcol 11 +#define foundrow 3 +#define stockcol 2 +#define stockrow 8 +#define fttlcol 10 +#define fttlrow 1 +#define taloncol 2 +#define talonrow 13 +#define tabrow 8 +#define ctoprow 21 +#define cbotrow 23 +#define cinitcol 14 +#define cheightcol 1 +#define cwidthcol 4 +#define handstatrow 21 +#define handstatcol 7 +#define talonstatrow 22 +#define talonstatcol 7 +#define stockstatrow 23 +#define stockstatcol 7 +#define Ace 1 +#define Jack 11 +#define Queen 12 +#define King 13 +#define atabcol 11 +#define btabcol 18 +#define ctabcol 25 +#define dtabcol 32 + +#define spades 's' +#define clubs 'c' +#define hearts 'h' +#define diamonds 'd' +#define black 'b' +#define red 'r' + +#define stk 1 +#define tal 2 +#define tab 3 +#define INCRHAND(row, col) {\ + row -= cheightcol;\ + if (row < ctoprow) {\ + row = cbotrow;\ + col += cwidthcol;\ + }\ +} +#define DECRHAND(row, col) {\ + row += cheightcol;\ + if (row > cbotrow) {\ + row = ctoprow;\ + col -= cwidthcol;\ + }\ +} + + +struct cardtype { + char suit; + char color; + bool visible; + bool paid; + int rank; + struct cardtype *next; +}; + +#define NIL ((struct cardtype *) -1) + +struct cardtype *deck[decksize]; +struct cardtype cards[decksize]; +struct cardtype *bottom[4], *found[4], *tableau[4]; +struct cardtype *talon, *hand, *stock, *basecard; +int length[4]; +int cardsoff, base, cinhand, taloncnt, stockcnt, timesthru; +char suitmap[4] = {spades, clubs, hearts, diamonds}; +char colormap[4] = {black, black, red, red}; +char pilemap[4] = {atabcol, btabcol, ctabcol, dtabcol}; +char srcpile, destpile; +int mtforigin, tempbase; +int coldcol, cnewcol, coldrow, cnewrow; +bool errmsg, done; +bool mtfdone, Cflag = FALSE; +#define INSTRUCTIONBOX 1 +#define BETTINGBOX 2 +#define NOBOX 3 +int status = INSTRUCTIONBOX; + +/* + * Basic betting costs + */ +#define costofhand 13 +#define costofinspection 13 +#define costofgame 26 +#define costofrunthroughhand 5 +#define costofinformation 1 +#define secondsperdollar 60 +#define maxtimecharge 3 +#define valuepercardup 5 +/* + * Variables associated with betting + */ +struct betinfo { + long hand; /* cost of dealing hand */ + long inspection; /* cost of inspecting hand */ + long game; /* cost of buying game */ + long runs; /* cost of running through hands */ + long information; /* cost of information */ + long thinktime; /* cost of thinking time */ + long wins; /* total winnings */ + long worth; /* net worth after costs */ +}; +struct betinfo this, total; +bool startedgame = FALSE, infullgame = FALSE; +time_t acctstart; +int dbfd = -1; + +/* + * The following procedures print the board onto the screen using the + * addressible cursor. The end of these procedures will also be + * separated from the rest of the program. + * + * procedure to set the move command box + */ +movebox() +{ + switch (status) { + case BETTINGBOX: + printtopbettingbox(); + break; + case NOBOX: + clearabovemovebox(); + break; + case INSTRUCTIONBOX: + printtopinstructions(); + break; + } + move(moverow, boxcol); + printw("| |"); + move(msgrow, boxcol); + printw("| |"); + switch (status) { + case BETTINGBOX: + printbottombettingbox(); + break; + case NOBOX: + clearbelowmovebox(); + break; + case INSTRUCTIONBOX: + printbottominstructions(); + break; + } + refresh(); +} + +/* + * print directions above move box + */ +printtopinstructions() +{ + move(tboxrow, boxcol); + printw("*--------------------------*"); + move(tboxrow + 1, boxcol); + printw("| MOVES |"); + move(tboxrow + 2, boxcol); + printw("|s# = stock to tableau |"); + move(tboxrow + 3, boxcol); + printw("|sf = stock to foundation |"); + move(tboxrow + 4, boxcol); + printw("|t# = talon to tableau |"); + move(tboxrow + 5, boxcol); + printw("|tf = talon to foundation |"); + move(tboxrow + 6, boxcol); + printw("|## = tableau to tableau |"); + move(tboxrow + 7, boxcol); + printw("|#f = tableau to foundation|"); + move(tboxrow + 8, boxcol); + printw("|ht = hand to talon |"); + move(tboxrow + 9, boxcol); + printw("|c = toggle card counting |"); + move(tboxrow + 10, boxcol); + printw("|b = present betting info |"); + move(tboxrow + 11, boxcol); + printw("|q = quit to end the game |"); + move(tboxrow + 12, boxcol); + printw("|==========================|"); +} + +/* + * Print the betting box. + */ +printtopbettingbox() +{ + + move(tboxrow, boxcol); + printw(" "); + move(tboxrow + 1, boxcol); + printw("*--------------------------*"); + move(tboxrow + 2, boxcol); + printw("|Costs Hand Total |"); + move(tboxrow + 3, boxcol); + printw("| Hands |"); + move(tboxrow + 4, boxcol); + printw("| Inspections |"); + move(tboxrow + 5, boxcol); + printw("| Games |"); + move(tboxrow + 6, boxcol); + printw("| Runs |"); + move(tboxrow + 7, boxcol); + printw("| Information |"); + move(tboxrow + 8, boxcol); + printw("| Think time |"); + move(tboxrow + 9, boxcol); + printw("|Total Costs |"); + move(tboxrow + 10, boxcol); + printw("|Winnings |"); + move(tboxrow + 11, boxcol); + printw("|Net Worth |"); + move(tboxrow + 12, boxcol); + printw("|==========================|"); +} + +/* + * clear info above move box + */ +clearabovemovebox() +{ + int i; + + for (i = 0; i <= 11; i++) { + move(tboxrow + i, boxcol); + printw(" "); + } + move(tboxrow + 12, boxcol); + printw("*--------------------------*"); +} + +/* + * print instructions below move box + */ +printbottominstructions() +{ + move(bboxrow, boxcol); + printw("|Replace # with the number |"); + move(bboxrow + 1, boxcol); + printw("|of the tableau you want. |"); + move(bboxrow + 2, boxcol); + printw("*--------------------------*"); +} + +/* + * print betting information below move box + */ +printbottombettingbox() +{ + move(bboxrow, boxcol); + printw("|x = toggle information box|"); + move(bboxrow + 1, boxcol); + printw("|i = list instructions |"); + move(bboxrow + 2, boxcol); + printw("*--------------------------*"); +} + +/* + * clear info below move box + */ +clearbelowmovebox() +{ + int i; + + move(bboxrow, boxcol); + printw("*--------------------------*"); + for (i = 1; i <= 2; i++) { + move(bboxrow + i, boxcol); + printw(" "); + } +} + +/* + * procedure to put the board on the screen using addressable cursor + */ +makeboard() +{ + clear(); + refresh(); + move(titlerow, titlecol); + printw("=-> CANFIELD <-="); + move(fttlrow, fttlcol); + printw("foundation"); + move(foundrow - 1, fttlcol); + printw("=---= =---= =---= =---="); + move(foundrow, fttlcol); + printw("| | | | | | | |"); + move(foundrow + 1, fttlcol); + printw("=---= =---= =---= =---="); + move(ottlrow, sidecol); + printw("stock tableau"); + move(stockrow - 1, sidecol); + printw("=---="); + move(stockrow, sidecol); + printw("| |"); + move(stockrow + 1, sidecol); + printw("=---="); + move(talonrow - 2, sidecol); + printw("talon"); + move(talonrow - 1, sidecol); + printw("=---="); + move(talonrow, sidecol); + printw("| |"); + move(talonrow + 1, sidecol); + printw("=---="); + move(tabrow - 1, atabcol); + printw("-1- -2- -3- -4-"); + movebox(); +} + +/* + * clean up the board for another game + */ +cleanupboard() +{ + int cnt, row, col; + struct cardtype *ptr; + + if (Cflag) { + clearstat(); + for(ptr = stock, row = stockrow; + ptr != NIL; + ptr = ptr->next, row++) { + move(row, sidecol); + printw(" "); + } + move(row, sidecol); + printw(" "); + move(stockrow + 1, sidecol); + printw("=---="); + move(talonrow - 2, sidecol); + printw("talon"); + move(talonrow - 1, sidecol); + printw("=---="); + move(talonrow + 1, sidecol); + printw("=---="); + } + move(stockrow, sidecol); + printw("| |"); + move(talonrow, sidecol); + printw("| |"); + move(foundrow, fttlcol); + printw("| | | | | | | |"); + for (cnt = 0; cnt < 4; cnt++) { + switch(cnt) { + case 0: + col = atabcol; + break; + case 1: + col = btabcol; + break; + case 2: + col = ctabcol; + break; + case 3: + col = dtabcol; + break; + } + for(ptr = tableau[cnt], row = tabrow; + ptr != NIL; + ptr = ptr->next, row++) + removecard(col, row); + } +} + +/* + * procedure to create a deck of cards + */ +initdeck(deck) + struct cardtype *deck[]; +{ + int i; + int scnt; + char s; + int r; + + i = 0; + for (scnt=0; scnt<4; scnt++) { + s = suitmap[scnt]; + for (r=Ace; r<=King; r++) { + deck[i] = &cards[i]; + cards[i].rank = r; + cards[i].suit = s; + cards[i].color = colormap[scnt]; + cards[i].next = NIL; + i++; + } + } +} + +/* + * procedure to shuffle the deck + */ +shuffle(deck) + struct cardtype *deck[]; +{ + int i,j; + struct cardtype *temp; + + for (i=0; ivisible = FALSE; + deck[i]->paid = FALSE; + } + for (i = decksize-1; i>=0; i--) { + j = random() % decksize; + if (i != j) { + temp = deck[i]; + deck[i] = deck[j]; + deck[j] = temp; + } + } +} + +/* + * procedure to remove the card from the board + */ +removecard(a, b) +{ + move(b, a); + printw(" "); +} + +/* + * procedure to print the cards on the board + */ +printrank(a, b, cp, inverse) + struct cardtype *cp; + bool inverse; +{ + move(b, a); + if (cp->rank != 10) + addch(' '); + if (inverse) + standout(); + switch (cp->rank) { + case 2: case 3: case 4: case 5: case 6: case 7: + case 8: case 9: case 10: + printw("%d", cp->rank); + break; + case Ace: + addch('A'); + break; + case Jack: + addch('J'); + break; + case Queen: + addch('Q'); + break; + case King: + addch('K'); + } + if (inverse) + standend(); +} + +/* + * procedure to print out a card + */ +printcard(a, b, cp) + int a,b; + struct cardtype *cp; +{ + if (cp == NIL) + removecard(a, b); + else if (cp->visible == FALSE) { + move(b, a); + printw(" ? "); + } else { + bool inverse = (cp->suit == 'd' || cp->suit == 'h'); + + printrank(a, b, cp, inverse); + if (inverse) + standout(); + addch(cp->suit); + if (inverse) + standend(); + } +} + +/* + * procedure to move the top card from one location to the top + * of another location. The pointers always point to the top + * of the piles. + */ +transit(source, dest) + struct cardtype **source, **dest; +{ + struct cardtype *temp; + + temp = *source; + *source = (*source)->next; + temp->next = *dest; + *dest = temp; +} + +/* + * Procedure to set the cards on the foundation base when available. + * Note that it is only called on a foundation pile at the beginning of + * the game, so the pile will have exactly one card in it. + */ +fndbase(cp, column, row) + struct cardtype **cp; +{ + bool nomore; + + if (*cp != NIL) + do { + if ((*cp)->rank == basecard->rank) { + base++; + printcard(pilemap[base], foundrow, *cp); + if (*cp == tableau[0]) + length[0] = length[0] - 1; + if (*cp == tableau[1]) + length[1] = length[1] - 1; + if (*cp == tableau[2]) + length[2] = length[2] - 1; + if (*cp == tableau[3]) + length[3] = length[3] - 1; + transit(cp, &found[base]); + if (cp == &talon) + usedtalon(); + if (cp == &stock) + usedstock(); + if (*cp != NIL) { + printcard(column, row, *cp); + nomore = FALSE; + } else { + removecard(column, row); + nomore = TRUE; + } + cardsoff++; + if (infullgame) { + this.wins += valuepercardup; + total.wins += valuepercardup; + } + } else + nomore = TRUE; + } while (nomore == FALSE); +} + +/* + * procedure to initialize the things necessary for the game + */ +initgame() +{ + register i; + + for (i=0; i<18; i++) { + deck[i]->visible = TRUE; + deck[i]->paid = TRUE; + } + stockcnt = 13; + stock = deck[12]; + for (i=12; i>=1; i--) + deck[i]->next = deck[i - 1]; + deck[0]->next = NIL; + found[0] = deck[13]; + deck[13]->next = NIL; + for (i=1; i<4; i++) + found[i] = NIL; + basecard = found[0]; + for (i=14; i<18; i++) { + tableau[i - 14] = deck[i]; + deck[i]->next = NIL; + } + for (i=0; i<4; i++) { + bottom[i] = tableau[i]; + length[i] = tabrow; + } + hand = deck[18]; + for (i=18; inext = deck[i + 1]; + deck[decksize-1]->next = NIL; + talon = NIL; + base = 0; + cinhand = 34; + taloncnt = 0; + timesthru = 0; + cardsoff = 1; + coldrow = ctoprow; + coldcol = cinitcol; + cnewrow = ctoprow; + cnewcol = cinitcol + cwidthcol; +} + +/* + * procedure to print the beginning cards and to start each game + */ +startgame() +{ + register int j; + + shuffle(deck); + initgame(); + this.hand = costofhand; + total.hand += costofhand; + this.inspection = 0; + this.game = 0; + this.runs = 0; + this.information = 0; + this.wins = 0; + this.thinktime = 0; + infullgame = FALSE; + startedgame = FALSE; + printcard(foundcol, foundrow, found[0]); + printcard(stockcol, stockrow, stock); + printcard(atabcol, tabrow, tableau[0]); + printcard(btabcol, tabrow, tableau[1]); + printcard(ctabcol, tabrow, tableau[2]); + printcard(dtabcol, tabrow, tableau[3]); + printcard(taloncol, talonrow, talon); + move(foundrow - 2, basecol); + printw("Base"); + move(foundrow - 1, basecol); + printw("Rank"); + printrank(basecol, foundrow, found[0], 0); + for (j=0; j<=3; j++) + fndbase(&tableau[j], pilemap[j], tabrow); + fndbase(&stock, stockcol, stockrow); + showstat(); /* show card counting info to cheaters */ + movetotalon(); + updatebettinginfo(); +} + +/* + * procedure to clear the message printed from an error + */ +clearmsg() +{ + int i; + + if (errmsg == TRUE) { + errmsg = FALSE; + move(msgrow, msgcol); + for (i=0; i<25; i++) + addch(' '); + refresh(); + } +} + +/* + * procedure to print an error message if the move is not listed + */ +dumberror() +{ + errmsg = TRUE; + move(msgrow, msgcol); + printw("Not a proper move "); +} + +/* + * procedure to print an error message if the move is not possible + */ +destinerror() +{ + errmsg = TRUE; + move(msgrow, msgcol); + printw("Error: Can't move there"); +} + +/* + * function to see if the source has cards in it + */ +bool +notempty(cp) +struct cardtype *cp; +{ + if (cp == NIL) { + errmsg = TRUE; + move(msgrow, msgcol); + printw("Error: no cards to move"); + return (FALSE); + } else + return (TRUE); +} + +/* + * function to see if the rank of one card is less than another + */ +bool +ranklower(cp1, cp2) + struct cardtype *cp1, *cp2; +{ + if (cp2->rank == Ace) + if (cp1->rank == King) + return (TRUE); + else + return (FALSE); + else if (cp1->rank + 1 == cp2->rank) + return (TRUE); + else + return (FALSE); +} + +/* + * function to check the cardcolor for moving to a tableau + */ +bool +diffcolor(cp1, cp2) + struct cardtype *cp1, *cp2; +{ + if (cp1->color == cp2->color) + return (FALSE); + else + return (TRUE); +} + +/* + * function to see if the card can move to the tableau + */ +bool +tabok(cp, des) + struct cardtype *cp; +{ + if ((cp == stock) && (tableau[des] == NIL)) + return (TRUE); + else if (tableau[des] == NIL) + if (stock == NIL && + cp != bottom[0] && cp != bottom[1] && + cp != bottom[2] && cp != bottom[3]) + return (TRUE); + else + return (FALSE); + else if (ranklower(cp, tableau[des]) && diffcolor(cp, tableau[des])) + return (TRUE); + else + return (FALSE); +} + +/* + * procedure to turn the cards onto the talon from the deck + */ +movetotalon() +{ + int i, fin; + + if (cinhand <= 3 && cinhand > 0) { + move(msgrow, msgcol); + printw("Hand is now empty "); + } + if (cinhand >= 3) + fin = 3; + else if (cinhand > 0) + fin = cinhand; + else if (talon != NIL) { + timesthru++; + errmsg = TRUE; + move(msgrow, msgcol); + if (timesthru != 4) { + printw("Talon is now the new hand"); + this.runs += costofrunthroughhand; + total.runs += costofrunthroughhand; + while (talon != NIL) { + transit(&talon, &hand); + cinhand++; + } + if (cinhand >= 3) + fin = 3; + else + fin = cinhand; + taloncnt = 0; + coldrow = ctoprow; + coldcol = cinitcol; + cnewrow = ctoprow; + cnewcol = cinitcol + cwidthcol; + clearstat(); + showstat(); + } else { + fin = 0; + done = TRUE; + printw("I believe you have lost"); + refresh(); + sleep(5); + } + } else { + errmsg = TRUE; + move(msgrow, msgcol); + printw("Talon and hand are empty"); + fin = 0; + } + for (i=0; ivisible = TRUE; + if (Cflag) { + if (talon->paid == FALSE && talon->visible == TRUE) { + this.information += costofinformation; + total.information += costofinformation; + talon->paid = TRUE; + } + printcard(coldcol, coldrow, talon); + } + } + if (fin != 0) { + printcard(taloncol, talonrow, talon); + cinhand -= fin; + taloncnt += fin; + if (Cflag) { + move(handstatrow, handstatcol); + printw("%3d", cinhand); + move(talonstatrow, talonstatcol); + printw("%3d", taloncnt); + } + fndbase(&talon, taloncol, talonrow); + } +} + + +/* + * procedure to print card counting info on screen + */ +showstat() +{ + int row, col; + register struct cardtype *ptr; + + if (!Cflag) + return; + move(talonstatrow, talonstatcol - 7); + printw("Talon: %3d", taloncnt); + move(handstatrow, handstatcol - 7); + printw("Hand: %3d", cinhand); + move(stockstatrow, stockstatcol - 7); + printw("Stock: %3d", stockcnt); + for ( row = coldrow, col = coldcol, ptr = talon; + ptr != NIL; + ptr = ptr->next ) { + if (ptr->paid == FALSE && ptr->visible == TRUE) { + ptr->paid = TRUE; + this.information += costofinformation; + total.information += costofinformation; + } + printcard(col, row, ptr); + DECRHAND(row, col); + } + for ( row = cnewrow, col = cnewcol, ptr = hand; + ptr != NIL; + ptr = ptr->next ) { + if (ptr->paid == FALSE && ptr->visible == TRUE) { + ptr->paid = TRUE; + this.information += costofinformation; + total.information += costofinformation; + } + INCRHAND(row, col); + printcard(col, row, ptr); + } +} + +/* + * procedure to clear card counting info from screen + */ +clearstat() +{ + int row; + + move(talonstatrow, talonstatcol - 7); + printw(" "); + move(handstatrow, handstatcol - 7); + printw(" "); + move(stockstatrow, stockstatcol - 7); + printw(" "); + for ( row = ctoprow ; row <= cbotrow ; row++ ) { + move(row, cinitcol); + printw("%56s", " "); + } +} + +/* + * procedure to update card counting base + */ +usedtalon() +{ + removecard(coldcol, coldrow); + DECRHAND(coldrow, coldcol); + if (talon != NIL && (talon->visible == FALSE)) { + talon->visible = TRUE; + if (Cflag) { + this.information += costofinformation; + total.information += costofinformation; + talon->paid = TRUE; + printcard(coldcol, coldrow, talon); + } + } + taloncnt--; + if (Cflag) { + move(talonstatrow, talonstatcol); + printw("%3d", taloncnt); + } +} + +/* + * procedure to update stock card counting base + */ +usedstock() +{ + stockcnt--; + if (Cflag) { + move(stockstatrow, stockstatcol); + printw("%3d", stockcnt); + } +} + +/* + * let 'em know how they lost! + */ +showcards() +{ + register struct cardtype *ptr; + int row; + + if (!Cflag || cardsoff == 52) + return; + for (ptr = talon; ptr != NIL; ptr = ptr->next) { + ptr->visible = TRUE; + ptr->paid = TRUE; + } + for (ptr = hand; ptr != NIL; ptr = ptr->next) { + ptr->visible = TRUE; + ptr->paid = TRUE; + } + showstat(); + move(stockrow + 1, sidecol); + printw(" "); + move(talonrow - 2, sidecol); + printw(" "); + move(talonrow - 1, sidecol); + printw(" "); + move(talonrow, sidecol); + printw(" "); + move(talonrow + 1, sidecol); + printw(" "); + for (ptr = stock, row = stockrow; ptr != NIL; ptr = ptr->next, row++) { + move(row, stockcol - 1); + printw("| |"); + printcard(stockcol, row, ptr); + } + if (stock == NIL) { + move(row, stockcol - 1); + printw("| |"); + row++; + } + move(handstatrow, handstatcol - 7); + printw(" "); + move(row, stockcol - 1); + printw("=---="); + if ( cardsoff == 52 ) + getcmd(moverow, movecol, "Hit return to exit"); +} + +/* + * procedure to update the betting values + */ +updatebettinginfo() +{ + long thiscosts, totalcosts; + time_t now; + register long dollars; + + time(&now); + dollars = (now - acctstart) / secondsperdollar; + if (dollars > 0) { + acctstart += dollars * secondsperdollar; + if (dollars > maxtimecharge) + dollars = maxtimecharge; + this.thinktime += dollars; + total.thinktime += dollars; + } + thiscosts = this.hand + this.inspection + this.game + + this.runs + this.information + this.thinktime; + totalcosts = total.hand + total.inspection + total.game + + total.runs + total.information + total.thinktime; + this.worth = this.wins - thiscosts; + total.worth = total.wins - totalcosts; + if (status != BETTINGBOX) + return; + move(tboxrow + 3, boxcol + 13); + printw("%4d%9d", this.hand, total.hand); + move(tboxrow + 4, boxcol + 13); + printw("%4d%9d", this.inspection, total.inspection); + move(tboxrow + 5, boxcol + 13); + printw("%4d%9d", this.game, total.game); + move(tboxrow + 6, boxcol + 13); + printw("%4d%9d", this.runs, total.runs); + move(tboxrow + 7, boxcol + 13); + printw("%4d%9d", this.information, total.information); + move(tboxrow + 8, boxcol + 13); + printw("%4d%9d", this.thinktime, total.thinktime); + move(tboxrow + 9, boxcol + 13); + printw("%4d%9d", thiscosts, totalcosts); + move(tboxrow + 10, boxcol + 13); + printw("%4d%9d", this.wins, total.wins); + move(tboxrow + 11, boxcol + 13); + printw("%4d%9d", this.worth, total.worth); +} + +/* + * procedure to move a card from the stock or talon to the tableau + */ +simpletableau(cp, des) +struct cardtype **cp; +{ + int origin; + + if (notempty(*cp)) { + if (tabok(*cp, des)) { + if (*cp == stock) + origin = stk; + else + origin = tal; + if (tableau[des] == NIL) + bottom[des] = *cp; + transit(cp, &tableau[des]); + length[des]++; + printcard(pilemap[des], length[des], tableau[des]); + timesthru = 0; + if (origin == stk) { + usedstock(); + printcard(stockcol, stockrow, stock); + } else { + usedtalon(); + printcard(taloncol, talonrow, talon); + } + } else + destinerror(); + } +} + +/* + * print the tableau + */ +tabprint(sour, des) +{ + int dlength, slength, i; + struct cardtype *tempcard; + + for (i=tabrow; i<=length[sour]; i++) + removecard(pilemap[sour], i); + dlength = length[des] + 1; + slength = length[sour]; + if (slength == tabrow) + printcard(pilemap[des], dlength, tableau[sour]); + else + while (slength != tabrow - 1) { + tempcard = tableau[sour]; + for (i=1; i<=slength-tabrow; i++) + tempcard = tempcard->next; + printcard(pilemap[des], dlength, tempcard); + slength--; + dlength++; + } +} + +/* + * procedure to move from the tableau to the tableau + */ +tabtotab(sour, des) + register int sour, des; +{ + struct cardtype *temp; + + if (notempty(tableau[sour])) { + if (tabok(bottom[sour], des)) { + tabprint(sour, des); + temp = bottom[sour]; + bottom[sour] = NIL; + if (bottom[des] == NIL) + bottom[des] = temp; + temp->next = tableau[des]; + tableau[des] = tableau[sour]; + tableau[sour] = NIL; + length[des] = length[des] + (length[sour] - (tabrow - 1)); + length[sour] = tabrow - 1; + timesthru = 0; + } else + destinerror(); + } +} + +/* + * functions to see if the card can go onto the foundation + */ +bool +rankhigher(cp, let) + struct cardtype *cp; +{ + if (found[let]->rank == King) + if (cp->rank == Ace) + return(TRUE); + else + return(FALSE); + else if (cp->rank - 1 == found[let]->rank) + return(TRUE); + else + return(FALSE); +} + +/* + * function to determine if two cards are the same suit + */ +samesuit(cp, let) + struct cardtype *cp; +{ + if (cp->suit == found[let]->suit) + return (TRUE); + else + return (FALSE); +} + +/* + * procedure to move a card to the correct foundation pile + */ +movetofound(cp, source) + struct cardtype **cp; +{ + tempbase = 0; + mtfdone = FALSE; + if (notempty(*cp)) { + do { + if (found[tempbase] != NIL) + if (rankhigher(*cp, tempbase) + && samesuit(*cp, tempbase)) { + if (*cp == stock) + mtforigin = stk; + else if (*cp == talon) + mtforigin = tal; + else + mtforigin = tab; + transit(cp, &found[tempbase]); + printcard(pilemap[tempbase], + foundrow, found[tempbase]); + timesthru = 0; + if (mtforigin == stk) { + usedstock(); + printcard(stockcol, stockrow, stock); + } else if (mtforigin == tal) { + usedtalon(); + printcard(taloncol, talonrow, talon); + } else { + removecard(pilemap[source], length[source]); + length[source]--; + } + cardsoff++; + if (infullgame) { + this.wins += valuepercardup; + total.wins += valuepercardup; + } + mtfdone = TRUE; + } else + tempbase++; + else + tempbase++; + } while ((tempbase != 4) && !mtfdone); + if (!mtfdone) + destinerror(); + } +} + +/* + * procedure to get a command + */ +getcmd(row, col, cp) + int row, col; + char *cp; +{ + char cmd[2], ch; + int i; + + i = 0; + move(row, col); + printw("%-24s", cp); + col += 1 + strlen(cp); + move(row, col); + refresh(); + do { + ch = getch() & 0177; + if (ch >= 'A' && ch <= 'Z') + ch += ('a' - 'A'); + if (ch == '\f') { + wrefresh(curscr); + refresh(); + } else if (i >= 2 && ch != _tty.sg_erase && ch != _tty.sg_kill) { + if (ch != '\n' && ch != '\r' && ch != ' ') + write(1, "\007", 1); + } else if (ch == _tty.sg_erase && i > 0) { + printw("\b \b"); + refresh(); + i--; + } else if (ch == _tty.sg_kill && i > 0) { + while (i > 0) { + printw("\b \b"); + i--; + } + refresh(); + } else if (ch == '\032') { /* Control-Z */ + suspend(); + move(row, col + i); + refresh(); + } else if (isprint(ch)) { + cmd[i++] = ch; + addch(ch); + refresh(); + } + } while (ch != '\n' && ch != '\r' && ch != ' '); + srcpile = cmd[0]; + destpile = cmd[1]; +} + +/* + * Suspend the game (shell escape if no process control on system) + */ +suspend() +{ +#ifndef SIGTSTP + char *sh; +#endif + + move(21, 0); + refresh(); +#ifdef SIGTSTP + kill(getpid(), SIGTSTP); +#else + sh = getenv("SHELL"); + if (sh == NULL) + sh = "/bin/sh"; + system(sh); +#endif + raw(); + noecho(); +} + +/* + * procedure to evaluate and make the specific moves + */ +movecard() +{ + int source, dest; + char osrcpile, odestpile; + + done = FALSE; + errmsg = FALSE; + do { + if (talon == NIL && hand != NIL) + movetotalon(); + if (cardsoff == 52) { + refresh(); + srcpile = 'q'; + } else + getcmd(moverow, movecol, "Move:"); + clearmsg(); + if (srcpile >= '1' && srcpile <= '4') + source = (int) (srcpile - '1'); + if (destpile >= '1' && destpile <= '4') + dest = (int) (destpile - '1'); + if (!startedgame && + (srcpile == 't' || srcpile == 's' || srcpile == 'h' || + srcpile == '1' || srcpile == '2' || srcpile == '3' || + srcpile == '4')) { + startedgame = TRUE; + osrcpile = srcpile; + odestpile = destpile; + if (status != BETTINGBOX) + srcpile = 'y'; + else do { + getcmd(moverow, movecol, "Inspect game?"); + } while (srcpile != 'y' && srcpile != 'n'); + if (srcpile == 'n') { + srcpile = 'q'; + } else { + this.inspection += costofinspection; + total.inspection += costofinspection; + srcpile = osrcpile; + destpile = odestpile; + } + } + switch (srcpile) { + case 't': + if (destpile == 'f' || destpile == 'F') + movetofound(&talon, source); + else if (destpile >= '1' && destpile <= '4') + simpletableau(&talon, dest); + else + dumberror(); + break; + case 's': + if (destpile == 'f' || destpile == 'F') + movetofound(&stock, source); + else if (destpile >= '1' && destpile <= '4') + simpletableau(&stock, dest); + else dumberror(); + break; + case 'h': + if (destpile != 't' && destpile != 'T') { + dumberror(); + break; + } + if (infullgame) { + movetotalon(); + break; + } + if (status == BETTINGBOX) { + do { + getcmd(moverow, movecol, + "Buy game?"); + } while (srcpile != 'y' && + srcpile != 'n'); + if (srcpile == 'n') { + showcards(); + done = TRUE; + break; + } + } + infullgame = TRUE; + this.wins += valuepercardup * cardsoff; + total.wins += valuepercardup * cardsoff; + this.game += costofgame; + total.game += costofgame; + movetotalon(); + break; + case 'q': + showcards(); + done = TRUE; + break; + case 'b': + printtopbettingbox(); + printbottombettingbox(); + status = BETTINGBOX; + break; + case 'x': + clearabovemovebox(); + clearbelowmovebox(); + status = NOBOX; + break; + case 'i': + printtopinstructions(); + printbottominstructions(); + status = INSTRUCTIONBOX; + break; + case 'c': + Cflag = !Cflag; + if (Cflag) + showstat(); + else + clearstat(); + break; + case '1': case '2': case '3': case '4': + if (destpile == 'f' || destpile == 'F') + movetofound(&tableau[source], source); + else if (destpile >= '1' && destpile <= '4') + tabtotab(source, dest); + else dumberror(); + break; + default: + dumberror(); + } + fndbase(&stock, stockcol, stockrow); + fndbase(&talon, taloncol, talonrow); + updatebettinginfo(); + } while (!done); +} + +char *basicinstructions[] = { + "Here are brief instuctions to the game of Canfield:\n\n", + " If you have never played solitaire before, it is recom-\n", + "mended that you consult a solitaire instruction book. In\n", + "Canfield, tableau cards may be built on each other downward\n", + "in alternate colors. An entire pile must be moved as a unit\n", + "in building. Top cards of the piles are available to be able\n", + "to be played on foundations, but never into empty spaces.\n\n", + " Spaces must be filled from the stock. The top card of\n", + "the stock also is available to be played on foundations or\n", + "built on tableau piles. After the stock is exhausted, ta-\n", + "bleau spaces may be filled from the talon and the player may\n", + "keep them open until he wishes to use them.\n\n", + " Cards are dealt from the hand to the talon by threes\n", + "and this repeats until there are no more cards in the hand\n", + "or the player quits. To have cards dealt onto the talon the\n", + "player types 'ht' for his move. Foundation base cards are\n", + "also automatically moved to the foundation when they become\n", + "available.\n\n", + "push any key when you are finished: ", + 0 }; + +char *bettinginstructions[] = { + " The rules for betting are somewhat less strict than\n", + "those used in the official version of the game. The initial\n", + "deal costs $13. You may quit at this point or inspect the\n", + "game. Inspection costs $13 and allows you to make as many\n", + "moves as is possible without moving any cards from your hand\n", + "to the talon. (the initial deal places three cards on the\n", + "talon; if all these cards are used, three more are made\n", + "available) Finally, if the game seems interesting, you must\n", + "pay the final installment of $26. At this point you are\n", + "credited at the rate of $5 for each card on the foundation;\n", + "as the game progresses you are credited with $5 for each\n", + "card that is moved to the foundation. Each run through the\n", + "hand after the first costs $5. The card counting feature\n", + "costs $1 for each unknown card that is identified. If the\n", + "information is toggled on, you are only charged for cards\n", + "that became visible since it was last turned on. Thus the\n", + "maximum cost of information is $34. Playing time is charged\n", + "at a rate of $1 per minute.\n\n", + "push any key when you are finished: ", + 0 }; + +/* + * procedure to printout instructions + */ +instruct() +{ + register char **cp; + + move(originrow, origincol); + printw("This is the game of solitaire called Canfield. Do\n"); + printw("you want instructions for the game?"); + do { + getcmd(originrow + 3, origincol, "y or n?"); + } while (srcpile != 'y' && srcpile != 'n'); + if (srcpile == 'n') + return; + clear(); + for (cp = basicinstructions; *cp != 0; cp++) + printw(*cp); + refresh(); + getch(); + clear(); + move(originrow, origincol); + printw("Do you want instructions for betting?"); + do { + getcmd(originrow + 2, origincol, "y or n?"); + } while (srcpile != 'y' && srcpile != 'n'); + if (srcpile == 'n') + return; + clear(); + for (cp = bettinginstructions; *cp != 0; cp++) + printw(*cp); + refresh(); + getch(); +} + +/* + * procedure to initialize the game + */ +initall() +{ + int uid, i; + + srandom(getpid()); + time(&acctstart); + initdeck(deck); + uid = getuid(); + if (uid < 0) + return; + dbfd = open("/usr/games/lib/cfscores", 2); + if (dbfd < 0) + return; + i = lseek(dbfd, uid * sizeof(struct betinfo), 0); + if (i < 0) { + close(dbfd); + dbfd = -1; + return; + } + i = read(dbfd, (char *)&total, sizeof(total)); + if (i < 0) { + close(dbfd); + dbfd = -1; + return; + } + lseek(dbfd, uid * sizeof(struct betinfo), 0); +} + +/* + * procedure to end the game + */ +bool +finish() +{ + int row, col; + + if (cardsoff == 52) { + getcmd(moverow, movecol, "Hit return to exit"); + clear(); + refresh(); + move(originrow, origincol); + printw("CONGRATULATIONS!\n"); + printw("You won the game. That is a feat to be proud of.\n"); + row = originrow + 5; + col = origincol; + } else { + move(msgrow, msgcol); + printw("You got %d card", cardsoff); + if (cardsoff > 1) + printw("s"); + printw(" off "); + move(msgrow, msgcol); + row = moverow; + col = movecol; + } + do { + getcmd(row, col, "Play again (y or n)?"); + } while (srcpile != 'y' && srcpile != 'n'); + errmsg = TRUE; + clearmsg(); + if (srcpile == 'y') + return (FALSE); + else + return (TRUE); +} + +/* + * Field an interrupt. + */ +askquit() +{ + move(msgrow, msgcol); + printw("Really wish to quit? "); + do { + getcmd(moverow, movecol, "y or n?"); + } while (srcpile != 'y' && srcpile != 'n'); + clearmsg(); + if (srcpile == 'y') + cleanup(); + signal(SIGINT, askquit); +} + +/* + * procedure to clean up and exit + */ +cleanup() +{ + + total.thinktime += 1; + status = NOBOX; + updatebettinginfo(); + if (dbfd != -1) { + write(dbfd, (char *)&total, sizeof(total)); + close(dbfd); + } + clear(); + move(22,0); + refresh(); + endwin(); + exit(0); + /* NOTREACHED */ +} + +/* + * Can you tell that this used to be a Pascal program? + */ +main(argc, argv) + int argc; + char *argv[]; +{ +#ifdef MAXLOAD + double vec[3]; + + getloadavg(vec, 3); + if (vec[2] >= MAXLOAD) { + puts("The system load is too high. Try again later."); + exit(0); + } +#endif + signal(SIGINT, askquit); + signal(SIGHUP, cleanup); + signal(SIGTERM, cleanup); + initscr(); + raw(); + noecho(); + initall(); + instruct(); + makeboard(); + for (;;) { + startgame(); + movecard(); + if (finish()) + break; + if (cardsoff == 52) + makeboard(); + else + cleanupboard(); + } + cleanup(); + /* NOTREACHED */ +} diff --git a/games/cfscores.c b/games/cfscores.c new file mode 100644 index 0000000..0fd94f9 --- /dev/null +++ b/games/cfscores.c @@ -0,0 +1,120 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#ifndef lint +char copyright[] = +"@(#) Copyright (c) 1983 Regents of the University of California.\n\ + All rights reserved.\n"; +#endif not lint + +#ifndef lint +static char sccsid[] = "@(#)cfscores.c 5.1 (Berkeley) 5/29/85"; +#endif not lint + +#include + +struct betinfo { + long hand; /* cost of dealing hand */ + long inspection; /* cost of inspecting hand */ + long game; /* cost of buying game */ + long runs; /* cost of running through hands */ + long information; /* cost of information */ + long thinktime; /* cost of thinking time */ + long wins; /* total winnings */ + long worth; /* net worth after costs */ +}; + +char *scorefile = "/usr/games/lib/cfscores"; +int dbfd; + +main(argc, argv) + int argc; + char *argv[]; +{ + register struct passwd *pw; + int uid; + + if (argc > 2) { + printf("Usage: cfscores [user]\n"); + exit(1); + } + dbfd = open(scorefile, 0); + if (dbfd < 0) { + perror(scorefile); + exit(2); + } + setpwent(); + if (argc == 1) { + uid = getuid(); + pw = getpwuid(uid); + if (pw == 0) { + printf("You are not listed in the password file?!?\n"); + exit(2); + } + printuser(pw, 1); + exit(0); + } + if (strcmp(argv[1], "-a") == 0) { + while ((pw = getpwent()) != 0) + printuser(pw, 0); + exit(0); + } + pw = getpwnam(argv[1]); + if (pw == 0) { + printf("User %s unknown\n", argv[1]); + exit(3); + } + printuser(pw, 1); + exit(0); +} + +/* + * print out info for specified password entry + */ +printuser(pw, printfail) + register struct passwd *pw; + int printfail; +{ + struct betinfo total; + int i; + + if (pw->pw_uid < 0) { + printf("Bad uid %d\n", pw->pw_uid); + return; + } + i = lseek(dbfd, pw->pw_uid * sizeof(struct betinfo), 0); + if (i < 0) { + perror("lseek"); + return; + } + i = read(dbfd, (char *)&total, sizeof(total)); + if (i < 0) { + perror("read"); + return; + } + if (i == 0 || total.hand == 0) { + if (printfail) + printf("%s has never played canfield.\n", pw->pw_name); + return; + } + printf("*----------------------*\n"); + if (total.worth >= 0) + printf("* Winnings for %-8s*\n", pw->pw_name); + else + printf("* Losses for %-10s*\n", pw->pw_name); + printf("*======================*\n"); + printf("|Costs Total |\n"); + printf("| Hands %8d |\n", total.hand); + printf("| Inspections %8d |\n", total.inspection); + printf("| Games %8d |\n", total.game); + printf("| Runs %8d |\n", total.runs); + printf("| Information %8d |\n", total.information); + printf("| Think time %8d |\n", total.thinktime); + printf("|Total Costs %8d |\n", total.wins - total.worth); + printf("|Winnings %8d |\n", total.wins); + printf("|Net Worth %8d |\n", total.worth); + printf("*----------------------*\n\n"); +} diff --git a/games/cribbage/:ctfix b/games/cribbage/:ctfix new file mode 100644 index 0000000..78c4a73 --- /dev/null +++ b/games/cribbage/:ctfix @@ -0,0 +1,3 @@ +g/^Mcrib/s//main/ +w +q diff --git a/games/cribbage/Makefile b/games/cribbage/Makefile new file mode 100644 index 0000000..d0d3525 --- /dev/null +++ b/games/cribbage/Makefile @@ -0,0 +1,51 @@ +# +# Copyright (c) 1980 Regents of the University of California. +# All rights reserved. The Berkeley software License Agreement +# specifies the terms and conditions for redistribution. +# +# @(#)Makefile 5.2.1 (2.11BSD) 1996/1/28 +# +# make file for cribbage +# +HDRS= cribbage.h deck.h cribcur.h +OBJS= extern.o crib.o support.o cards.o score.o io.o +CFILES= extern.c crib.c support.c cards.c score.c io.c +TOBJS= test.o cards.o score.o io.o extern.o +MAN= crib.0 +SEPFLAG= -i +CFLAGS= -O +DESTDIR= + +all: cribbage ${MAN} + +cribbage: ${OBJS} + ${CC} ${SEPFLAG} ${CFLAGS} -o cribbage ${OBJS} -lcurses -ltermlib + +all: cribbage ${MAN} + +crib.o io.o support.o: cribcur.h + +test: ${TOBJS} + ${CC} ${SEPFLAG} ${CFLAGS} -o test ${TOBJS} -lcurses -ltermlib + +crib.0: cribbage.n macro + nroff cribbage.n > crib.0 + +tags: ${HDRS} ${CFILES} + ctags -u $? + ed - tags < :ctfix + sort tags -o tags + +clean: + rm -f ${OBJS} ? a.out core crib.0 cribbage errs + +crib.o: deck.h cribbage.h cribcur.h +support.o: deck.h cribbage.h cribcur.h +test.o: deck.h +cards.o: deck.h +score.o: deck.h +io.o: deck.h cribcur.h + +install: cribbage crib.0 + install -s cribbage $(DESTDIR)/usr/games + install -m 644 crib.0 $(DESTDIR)/usr/games/lib/crib.instr diff --git a/games/cribbage/cards.c b/games/cribbage/cards.c new file mode 100644 index 0000000..e7805b3 --- /dev/null +++ b/games/cribbage/cards.c @@ -0,0 +1,134 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#ifndef lint +static char sccsid[] = "@(#)cards.c 5.1 (Berkeley) 5/30/85"; +#endif not lint + +#include +#include "deck.h" + + +/* + * initialize a deck of cards to contain one of each type + */ + +makedeck( d ) + + CARD d[]; +{ + register int i, j, k; + long time(); + + i = time( (long *) 0 ); + i = ( (i&0xff) << 8 ) | ( (i >> 8)&0xff ) | 1; + srand( i ); + k = 0; + for( i = 0; i < RANKS; i++ ) { + for( j = 0; j < SUITS; j++ ) { + d[k].suit = j; + d[k++].rank = i; + } + } +} + + + +/* + * given a deck of cards, shuffle it -- i.e. randomize it + * see Knuth, vol. 2, page 125 + */ + +shuffle( d ) + + CARD d[]; +{ + register int j, k; + CARD c; + + for( j = CARDS; j > 0; --j ) { + k = ( rand() >> 4 ) % j; /* random 0 <= k < j */ + c = d[j - 1]; /* exchange (j - 1) and k */ + d[j - 1] = d[k]; + d[k] = c; + } +} + + + +/* + * return true if the two cards are equal... + */ + +eq( a, b ) + + CARD a, b; +{ + return( ( a.rank == b.rank ) && ( a.suit == b.suit ) ); +} + + + +/* + * isone returns TRUE if a is in the set of cards b + */ + +isone( a, b, n ) + + CARD a, b[]; + int n; +{ + register int i; + + for( i = 0; i < n; i++ ) { + if( eq( a, b[i] ) ) return( TRUE ); + } + return( FALSE ); +} + + + +/* + * remove the card a from the deck d of n cards + */ + +remove( a, d, n ) + + CARD a, d[]; + int n; +{ + register int i, j; + + j = 0; + for( i = 0; i < n; i++ ) { + if( !eq( a, d[i] ) ) d[j++] = d[i]; + } + if( j < n ) d[j].suit = d[j].rank = EMPTY; +} + + + +/* + * sorthand: + * Sort a hand of n cards + */ +sorthand(h, n) +register CARD h[]; +int n; +{ + register CARD *cp, *endp; + CARD c; + + for (endp = &h[n]; h < endp - 1; h++) + for (cp = h + 1; cp < endp; cp++) + if ((cp->rank < h->rank) || + (cp->rank == h->rank && cp->suit < h->suit)) { + c = *h; + *h = *cp; + *cp = c; + } +} + diff --git a/games/cribbage/crib.c b/games/cribbage/crib.c new file mode 100644 index 0000000..e853239 --- /dev/null +++ b/games/cribbage/crib.c @@ -0,0 +1,587 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#ifndef lint +char copyright[] = +"@(#) Copyright (c) 1980 Regents of the University of California.\n\ + All rights reserved.\n"; +#endif not lint + +#ifndef lint +static char sccsid[] = "@(#)crib.c 5.1 (Berkeley) 5/30/85"; +#endif not lint + +# include +# include +# include "deck.h" +# include "cribbage.h" +# include "cribcur.h" + + +# define LOGFILE "/usr/games/lib/criblog" +# define INSTRCMD "more /usr/games/lib/crib.instr" + + +main(argc, argv) +int argc; +char *argv[]; +{ + register char *p; + BOOLEAN playing; + char *s; /* for reading arguments */ + char bust; /* flag for arg reader */ + FILE *f; + FILE *fopen(); + char *getline(); + int bye(); + + while (--argc > 0) { + if ((*++argv)[0] != '-') { + fprintf(stderr, "\n\ncribbage: usage is 'cribbage [-eqr]'\n"); + exit(1); + } + bust = FALSE; + for (s = argv[0] + 1; *s != NULL; s++) { + switch (*s) { + case 'e': + explain = TRUE; + break; + case 'q': + quiet = TRUE; + break; + case 'r': + rflag = TRUE; + break; + default: + fprintf(stderr, "\n\ncribbage: usage is 'cribbage [-eqr]'\n"); + exit(2); + break; + } + if (bust) + break; + } + } + + initscr(); + signal(SIGINT, bye); + crmode(); + noecho(); + Playwin = subwin(stdscr, PLAY_Y, PLAY_X, 0, 0); + Tablewin = subwin(stdscr, TABLE_Y, TABLE_X, 0, PLAY_X); + Compwin = subwin(stdscr, COMP_Y, COMP_X, 0, TABLE_X + PLAY_X); + Msgwin = subwin(stdscr, MSG_Y, MSG_X, Y_MSG_START, SCORE_X + 1); + leaveok(Playwin, TRUE); + leaveok(Tablewin, TRUE); + leaveok(Compwin, TRUE); + clearok(stdscr, FALSE); + + if (!quiet) { + msg("Do you need instructions for cribbage? "); + if (getuchar() == 'Y') { + endwin(); + fflush(stdout); + system(INSTRCMD); + crmode(); + noecho(); + clear(); + refresh(); + msg("For the rules of this program, do \"man cribbage\""); + } + } + playing = TRUE; + do { + wclrtobot(Msgwin); + msg(quiet ? "L or S? " : "Long (to 121) or Short (to 61)? "); + if (glimit == SGAME) + glimit = (getuchar() == 'L' ? LGAME : SGAME); + else + glimit = (getuchar() == 'S' ? SGAME : LGAME); + game(); + msg("Another game? "); + playing = (getuchar() == 'Y'); + } while (playing); + + if ((f = fopen(LOGFILE, "a")) != NULL) { + fprintf(f, "Won %5.5d, Lost %5.5d\n", cgames, pgames); + fclose(f); + } + + bye(); +} + +/* + * makeboard: + * Print out the initial board on the screen + */ +makeboard() +{ + mvaddstr(SCORE_Y + 0, SCORE_X, "+---------------------------------------+"); + mvaddstr(SCORE_Y + 1, SCORE_X, "| Score: 0 YOU |"); + mvaddstr(SCORE_Y + 2, SCORE_X, "| *.....:.....:.....:.....:.....:..... |"); + mvaddstr(SCORE_Y + 3, SCORE_X, "| *.....:.....:.....:.....:.....:..... |"); + mvaddstr(SCORE_Y + 4, SCORE_X, "| |"); + mvaddstr(SCORE_Y + 5, SCORE_X, "| *.....:.....:.....:.....:.....:..... |"); + mvaddstr(SCORE_Y + 6, SCORE_X, "| *.....:.....:.....:.....:.....:..... |"); + mvaddstr(SCORE_Y + 7, SCORE_X, "| Score: 0 ME |"); + mvaddstr(SCORE_Y + 8, SCORE_X, "+---------------------------------------+"); + gamescore(); +} + +/* + * gamescore: + * Print out the current game score + */ +gamescore() +{ + extern int Lastscore[]; + + if (pgames || cgames) { + mvprintw(SCORE_Y + 1, SCORE_X + 28, "Games: %3d", pgames); + mvprintw(SCORE_Y + 7, SCORE_X + 28, "Games: %3d", cgames); + } + Lastscore[0] = -1; + Lastscore[1] = -1; +} + +/* + * game: + * Play one game up to glimit points. Actually, we only ASK the + * player what card to turn. We do a random one, anyway. + */ +game() +{ + register int i, j; + BOOLEAN flag; + BOOLEAN compcrib; + + makeboard(); + refresh(); + makedeck(deck); + shuffle(deck); + if (gamecount == 0) { + flag = TRUE; + do { + if (!rflag) { /* player cuts deck */ + msg(quiet ? "Cut for crib? " : + "Cut to see whose crib it is -- low card wins? "); + getline(); + } + i = (rand() >> 4) % CARDS; /* random cut */ + do { /* comp cuts deck */ + j = (rand() >> 4) % CARDS; + } while (j == i); + addmsg(quiet ? "You cut " : "You cut the "); + msgcard(deck[i], FALSE); + endmsg(); + addmsg(quiet ? "I cut " : "I cut the "); + msgcard(deck[j], FALSE); + endmsg(); + flag = (deck[i].rank == deck[j].rank); + if (flag) { + msg(quiet ? "We tied..." : + "We tied and have to try again..."); + shuffle(deck); + continue; + } + else + compcrib = (deck[i].rank > deck[j].rank); + } while (flag); + } + else { + werase(Tablewin); + wrefresh(Tablewin); + werase(Compwin); + wrefresh(Compwin); + msg("Loser (%s) gets first crib", (iwon ? "you" : "me")); + compcrib = !iwon; + } + + pscore = cscore = 0; + flag = TRUE; + do { + shuffle(deck); + flag = !playhand(compcrib); + compcrib = !compcrib; + } while (flag); + ++gamecount; + if (cscore < pscore) { + if (glimit - cscore > 60) { + msg("YOU DOUBLE SKUNKED ME!"); + pgames += 4; + } + else if (glimit - cscore > 30) { + msg("YOU SKUNKED ME!"); + pgames += 2; + } + else { + msg("YOU WON!"); + ++pgames; + } + iwon = FALSE; + } + else { + if (glimit - pscore > 60) { + msg("I DOUBLE SKUNKED YOU!"); + cgames += 4; + } + else if (glimit - pscore > 30) { + msg("I SKUNKED YOU!"); + cgames += 2; + } + else { + msg("I WON!"); + ++cgames; + } + iwon = TRUE; + } + gamescore(); +} + +/* + * playhand: + * Do up one hand of the game + */ +playhand(mycrib) +BOOLEAN mycrib; +{ + register int deckpos; + extern char Msgbuf[]; + + werase(Compwin); + + knownum = 0; + deckpos = deal(mycrib); + sorthand(chand, FULLHAND); + sorthand(phand, FULLHAND); + makeknown(chand, FULLHAND); + prhand(phand, FULLHAND, Playwin, FALSE); + discard(mycrib); + if (cut(mycrib, deckpos)) + return TRUE; + if (peg(mycrib)) + return TRUE; + werase(Tablewin); + wrefresh(Tablewin); + if (score(mycrib)) + return TRUE; + return FALSE; +} + + + +/* + * deal cards to both players from deck + */ + +deal( mycrib ) +{ + register int i, j; + + j = 0; + for( i = 0; i < FULLHAND; i++ ) { + if( mycrib ) { + phand[i] = deck[j++]; + chand[i] = deck[j++]; + } + else { + chand[i] = deck[j++]; + phand[i] = deck[j++]; + } + } + return( j ); +} + +/* + * discard: + * Handle players discarding into the crib... + * Note: we call cdiscard() after prining first message so player doesn't wait + */ +discard(mycrib) +BOOLEAN mycrib; +{ + register char *prompt; + CARD crd; + + prcrib(mycrib, TRUE); + prompt = (quiet ? "Discard --> " : "Discard a card --> "); + cdiscard(mycrib); /* puts best discard at end */ + crd = phand[infrom(phand, FULLHAND, prompt)]; + remove(crd, phand, FULLHAND); + prhand(phand, FULLHAND, Playwin, FALSE); + crib[0] = crd; +/* next four lines same as last four except for cdiscard() */ + crd = phand[infrom(phand, FULLHAND - 1, prompt)]; + remove(crd, phand, FULLHAND - 1); + prhand(phand, FULLHAND, Playwin, FALSE); + crib[1] = crd; + crib[2] = chand[4]; + crib[3] = chand[5]; + chand[4].rank = chand[4].suit = chand[5].rank = chand[5].suit = EMPTY; +} + +/* + * cut: + * Cut the deck and set turnover. Actually, we only ASK the + * player what card to turn. We do a random one, anyway. + */ +cut(mycrib, pos) +BOOLEAN mycrib; +int pos; +{ + register int i, cardx; + BOOLEAN win = FALSE; + + if (mycrib) { + if (!rflag) { /* random cut */ + msg(quiet ? "Cut the deck? " : + "How many cards down do you wish to cut the deck? "); + getline(); + } + i = (rand() >> 4) % (CARDS - pos); + turnover = deck[i + pos]; + addmsg(quiet ? "You cut " : "You cut the "); + msgcard(turnover, FALSE); + endmsg(); + if (turnover.rank == JACK) { + msg("I get two for his heels"); + win = chkscr(&cscore,2 ); + } + } + else { + i = (rand() >> 4) % (CARDS - pos) + pos; + turnover = deck[i]; + addmsg(quiet ? "I cut " : "I cut the "); + msgcard(turnover, FALSE); + endmsg(); + if (turnover.rank == JACK) { + msg("You get two for his heels"); + win = chkscr(&pscore, 2); + } + } + makeknown(&turnover, 1); + prcrib(mycrib, FALSE); + return win; +} + +/* + * prcrib: + * Print out the turnover card with crib indicator + */ +prcrib(mycrib, blank) +BOOLEAN mycrib, blank; +{ + register int y, cardx; + + if (mycrib) + cardx = CRIB_X; + else + cardx = 0; + + mvaddstr(CRIB_Y, cardx + 1, "CRIB"); + prcard(stdscr, CRIB_Y + 1, cardx, turnover, blank); + + if (mycrib) + cardx = 0; + else + cardx = CRIB_X; + + for (y = CRIB_Y; y <= CRIB_Y + 5; y++) + mvaddstr(y, cardx, " "); +} + +/* + * peg: + * Handle all the pegging... + */ + +static CARD Table[14]; + +static int Tcnt; + +peg(mycrib) +BOOLEAN mycrib; +{ + static CARD ch[CINHAND], ph[CINHAND]; + CARD crd; + register int i, j, k; + register int l; + register int cnum, pnum, sum; + register BOOLEAN myturn, mego, ugo, last, played; + + cnum = pnum = CINHAND; + for (i = 0; i < CINHAND; i++) { /* make copies of hands */ + ch[i] = chand[i]; + ph[i] = phand[i]; + } + Tcnt = 0; /* index to table of cards played */ + sum = 0; /* sum of cards played */ + mego = ugo = FALSE; + myturn = !mycrib; + for (;;) { + last = TRUE; /* enable last flag */ + prhand(ph, pnum, Playwin, FALSE); + prhand(ch, cnum, Compwin, TRUE); + prtable(sum); + if (myturn) { /* my tyrn to play */ + if (!anymove(ch, cnum, sum)) { /* if no card to play */ + if (!mego && cnum) { /* go for comp? */ + msg("GO"); + mego = TRUE; + } + if (anymove(ph, pnum, sum)) /* can player move? */ + myturn = !myturn; + else { /* give him his point */ + msg(quiet ? "You get one" : "You get one point"); + if (chkscr(&pscore, 1)) + return TRUE; + sum = 0; + mego = ugo = FALSE; + Tcnt = 0; + } + } + else { + played = TRUE; + j = -1; + k = 0; + for (i = 0; i < cnum; i++) { /* maximize score */ + l = pegscore(ch[i], Table, Tcnt, sum); + if (l > k) { + k = l; + j = i; + } + } + if (j < 0) /* if nothing scores */ + j = cchose(ch, cnum, sum); + crd = ch[j]; + remove(crd, ch, cnum--); + sum += VAL(crd.rank); + Table[Tcnt++] = crd; + if (k > 0) { + addmsg(quiet ? "I get %d playing " : + "I get %d points playing ", k); + msgcard(crd, FALSE); + endmsg(); + if (chkscr(&cscore, k)) + return TRUE; + } + myturn = !myturn; + } + } + else { + if (!anymove(ph, pnum, sum)) { /* can player move? */ + if (!ugo && pnum) { /* go for player */ + msg("You have a GO"); + ugo = TRUE; + } + if (anymove(ch, cnum, sum)) /* can computer play? */ + myturn = !myturn; + else { + msg(quiet ? "I get one" : "I get one point"); + do_wait(); + if (chkscr(&cscore, 1)) + return TRUE; + sum = 0; + mego = ugo = FALSE; + Tcnt = 0; + } + } + else { /* player plays */ + played = FALSE; + if (pnum == 1) { + crd = ph[0]; + msg("You play your last card"); + } + else + for (;;) { + prhand(ph, pnum, Playwin, FALSE); + crd = ph[infrom(ph, pnum, "Your play: ")]; + if (sum + VAL(crd.rank) <= 31) + break; + else + msg("Total > 31 -- try again"); + } + makeknown(&crd, 1); + remove(crd, ph, pnum--); + i = pegscore(crd, Table, Tcnt, sum); + sum += VAL(crd.rank); + Table[Tcnt++] = crd; + if (i > 0) { + msg(quiet ? "You got %d" : "You got %d points", i); + if (chkscr(&pscore, i)) + return TRUE; + } + myturn = !myturn; + } + } + if (sum >= 31) { + if (!myturn) + do_wait(); + sum = 0; + mego = ugo = FALSE; + Tcnt = 0; + last = FALSE; /* disable last flag */ + } + if (!pnum && !cnum) + break; /* both done */ + } + prhand(ph, pnum, Playwin, FALSE); + prhand(ch, cnum, Compwin, TRUE); + prtable(sum); + if (last) + if (played) { + msg(quiet ? "I get one for last" : "I get one point for last"); + do_wait(); + if (chkscr(&cscore, 1)) + return TRUE; + } + else { + msg(quiet ? "You get one for last" : + "You get one point for last"); + if (chkscr(&pscore, 1)) + return TRUE; + } + return FALSE; +} + +/* + * prtable: + * Print out the table with the current score + */ +prtable(score) +int score; +{ + prhand(Table, Tcnt, Tablewin, FALSE); + mvwprintw(Tablewin, (Tcnt + 2) * 2, Tcnt + 1, "%2d", score); + wrefresh(Tablewin); +} + +/* + * score: + * Handle the scoring of the hands + */ +score(mycrib) +BOOLEAN mycrib; +{ + sorthand(crib, CINHAND); + if (mycrib) { + if (plyrhand(phand, "hand")) + return TRUE; + if (comphand(chand, "hand")) + return TRUE; + do_wait(); + if (comphand(crib, "crib")) + return TRUE; + } + else { + if (comphand(chand, "hand")) + return TRUE; + if (plyrhand(phand, "hand")) + return TRUE; + if (plyrhand(crib, "crib")) + return TRUE; + } + return FALSE; +} diff --git a/games/cribbage/cribbage.h b/games/cribbage/cribbage.h new file mode 100644 index 0000000..9c0d793 --- /dev/null +++ b/games/cribbage/cribbage.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + * + * @(#)cribbage.h 5.1 (Berkeley) 5/30/85 + */ + +extern CARD deck[ CARDS ]; /* a deck */ +extern CARD phand[ FULLHAND ]; /* player's hand */ +extern CARD chand[ FULLHAND ]; /* computer's hand */ +extern CARD crib[ CINHAND ]; /* the crib */ +extern CARD turnover; /* the starter */ + +extern CARD known[ CARDS ]; /* cards we have seen */ +extern int knownum; /* # of cards we know */ + +extern int pscore; /* player's score */ +extern int cscore; /* comp's score */ +extern int glimit; /* points to win game */ + +extern int pgames; /* player's games won */ +extern int cgames; /* comp's games won */ +extern int gamecount; /* # games played */ +extern int Lastscore[2]; /* previous score for each */ + +extern BOOLEAN iwon; /* if comp won last */ +extern BOOLEAN explain; /* player mistakes explained */ +extern BOOLEAN rflag; /* if all cuts random */ +extern BOOLEAN quiet; /* if suppress random mess */ +extern BOOLEAN playing; /* currently playing game */ + +extern char expl[]; /* string for explanation */ + diff --git a/games/cribbage/cribbage.n b/games/cribbage/cribbage.n new file mode 100644 index 0000000..96eb9c1 --- /dev/null +++ b/games/cribbage/cribbage.n @@ -0,0 +1,318 @@ +.\" Copyright (c) 1980 Regents of the University of California. +.\" All rights reserved. The Berkeley software License Agreement +.\" specifies the terms and conditions for redistribution. +.\" +.\" @(#)cribbage.n 5.1 (Berkeley) 5/30/85 +.\" +.so macro +.na +.PH "CRIBBAGE" +.sp 2 +.ce +from +.sp +.ce +.ul +According to Hoyle +.sp 2 +.PG +Cribbage is believed to have been invented by Sir John Suckling (1609-1642). +Probably it is an elaboration of an older game, Noddy. The original game was +played with hands of five cards; the modern game gives each player six. That +is virtually the only change from Suckling's directions. +.HP "Players." +Two. There are variants for three and four players, described later. +.HP "Cards." +The pack of 52. The cards in each suit rank: K (high), Q, J, 10, 9, 8, +7, 6, 5, 4, 3, 2, A. The +.ul +counting values +are: K, Q, J, 10, each 10 (wherefore these are called +.ul +tenth cards); +ace, 1; each other card, its index value. +.HP "Cribbage Board". +Indispensable to scoring (unless you have a computer!, ed.) is the device +known as the +.ul +cribbage board. +This is a rectangular panel, long and narrow, in which are +four rows of 30 holes each. (See illustration.) At one end, or in the center, +are two or four additional holes, called +.ul +game holes. +The board is placed between the two players, and each keeps his own score on +the two rows of holes nearest himself. Each is supplied with two +.ul +pegs. +Before the first hand, the pegs are placed in the game holes. On +making his first score, the player advances one peg an appropriate number +of holes (one per point) away from the +.ul +game end +of the board. The second score is recorded by placing the second peg an +appropriate distance ahead of the first. For each subsequent score, the +rear peg is jumped ahead of the other, the distance between the two pegs +always showing the amount of this last score. +.PG +The traditional mode of scoring is down (away from the game end) the +outer row, and up the inner row. "Once around" is a game of 61 points. +"Twice around" is a game of 121 points. +.HP "Preliminaries." +Cards are drawn; the lower deals first. If cards of equal rank are drawn, +both players draw again. Dealer has the right to shuffle last. Nondealer +cuts, and must leave at least four cards in each packet. +.HP "Dealing." +Each player receives six cards, dealt one at a time face down, beginning +with the nondealer. The turn to deal alternates. The dealer has an +advantage. +.HP "Laying Away." +After seeing his hand, each player +.ul +lays away +two cards face down. The four cards laid away, placed in one pile, form the +.ul +crib. +The crib counts for the dealer. Nondealer therefore tries to lay away +.ul +balking cards -- +cards that are least likely to create a score in the crib. +.HP "The Starter." +After both hands have laid away, nondealer lifts off a packet from the top +of the +.ul +stock +(the rest of the pack). Again, each packet must contain at least four cards. +Dealer turns up the top card of the lower packer, which is then placed on +top of the stock when the packets are reunited. The card thus turned up is +called +.ul +1 the starter. +If it is a jack, dealer immediately pegs 2, called +.ul +2 for his heels. +.HP "The Play." +Nondealer begins the play by laying a card from his hand face up on the +table, announcing its counting value. Dealer then shows a card, announcing +the total count of the two cards. Play continues in the same way, by +alternate exposure of cards, each player announcing the new total count. +The total may be carried only to 31, no further. If a player adds a card +that brings the total exactly to 31, he pegs 2. If a player is unable to +play another card without exceeding 31, he must say "Go," and his opponent +pegs 1, but before doing so, opponent must lay down any additional cards he +can without exceeding 31. If such additional cards bring the total to +exactly 31, he pegs 2 instead of 1. +.PG +Whenever a +.ul +go +occurs, the opponent of the player who played the last card must lead for a +new count starting at zero. Playing the last card of all counts as a go. +(Since nondealer makes the opening lead, dealer is bound to peg at least +1 in play.) +.PG +Besides pegging for 31 and go, the player may also peg for certain +combinations made in play, as follows: +.sp 2 +.ti +4 +.ul +Fifteen. +.IP +Making the count total 15 pegs 2. +.EP +.sp 2 +.ti +4 +.ul +Pair. +.IP +Playing a card of same rank as that previously played pegs 2. Playing +a third card of the same rank makes +.ul +pair royal +and pegs 6. Playing the fourth card of the same rank makes +.ul +double pair royal +and pegs 12. +.PG +The tenth cards pair strictly by rank, a king with a king, a queen with a +queen, and so on. (King and jack do not make a pair, although each has +the counting value 10.) +.EP +.sp 2 +.ti +4 +.ul +Run. +.IP +Playing a card which, with the two or more played immediately previously, +makes a sequence of three or more cards, pegs 1 for each card in the +.ul +run. +Runs depend on rank alone; the suits do not matter. Nor does the score +for run depend upon playing the cards in strict sequence, so long as +the three or more last cards played can be arranged in a run. +.ul +Example: +7, 6, 8 played in that order score 3 for run; 5, 2, 4, 3 played in that order +score 4 for run. +.EP +.PG +Any of the foregoing combinations count, whether the cards are played +alternately or one player plays several times in succession in consequence +of a go. But a combination does not score if it is interrupted by a go. +.HP "Showing." +After the play, the hands are +.ul +shown +(counted). Nondealer shows first, then dealer's hand, then crib. +The starter is deemed to belong to each hand, so that each hand includes +five cards. Combinations of scoring value are as follows: +.sp 2 +.ti +4 +.ul +Fifteen. +.IP +Each combinations of two or more cards that total fifteen scores 2. +.EP +.sp 2 +.ti +4 +.ul +Pair. +.IP +Each pair of cards of the same rank scores 2. +.EP +.sp 2 +.ti +4 +.ul +Run. +.IP +Each combination of three or more cards in sequence scores 1 for each card +in the run. +.EP +.sp 2 +.ti +4 +.ul +Flush. +.IP +Four cards of the same suit in hand score 4; four cards in hand or crib +of same suit as the starter score 5. (No count for four-flush in crib.) +.EP +.sp 2 +.ti +4 +.ul +His Nobs. +.IP +Jack of same suit as the starter, in hand or crib, scores 1. +.EP +.PG +It is important to note that every separate grouping of cards that makes +a fifteen, pair, or run counts separately. Three of a kind, +.ul +pair royal, +counts 6 because three sets of pairs can be made; similarly, four of a +kind, +.ul +double pair royal, +contain six pairs and count 12. +.PG +The highest possible hand is J, 5, 5, 5 with the starter the 5 of the same +suit as the jack. There are four fifteens by combining the jack with a +five, four more by combinations of three fives (a total of 16 for fifteens); +the double pair royal adds 12 for a total of 28; and +.ul +his nobs +adds 1 for a maximum score of 29. (the score of 2 for +.ul +his heels +does not count in the total of the hand, since it is pegged before the play.) +.PG +A +.ul +double run +is a run with one card duplicated, as 4-3-3-2. Exclusive of fifteens, a +double run of three cards counts 8; of four cards, 10. A +.ul +triple run +is a run of three with one card triplicated, as K-K-K-Q-J. Exclusive of +fifteens, it counts 15. A +.ul +quadruple run +is a run of three with two different cards duplicated, as the example +8-8-7-6-6 previously given. Exclusive of fifteens, it counts 16. +.PG +No hand can be constructed that counts 19, 25, 26 or 27. A time-honored +way of showing a hand with not a single counting combination is to say +"I have nineteen." +.PG +The customary oder in showing is to count fifteens first, then runs, then +pairs, but there is no compulsion of law. +.ul +Example: +A hand (with starter) of 9-6-5-4-4 will usually be counted "Fifteen 2, +fifteen 4, fifteen 6 and double run makes 14," or simply "Fifteen 6 and +8 is 14." +.HP "Muggins." +The hands and crib are counted aloud, and if a player claims a greater +total than is due him, his opponent may require correction. In some +localities, if a player claims less than is due, his opponent may say +"Muggins" and himself score the points overlooked. +.HP "Scoring." +The usual +.ul +game +is 121, but it may be set at 61 by agreement. Since the player wins +who first returns to the game hole by going "twice around," the scores +must be pegged strictly in order: his heels, pegging in play, non-dealer's +hand, dealer's hand, crib. Thus, if nondealer goes out on showing his +hand, he wins, even though dealer might have gone out with a greater +total if allowed to count his hand and crib. +.PG +When the game of 121 is played for a stake, a player wins a single game +if the loser makes 61 points or more. If the loser fails to reach +61, he is +.ul +lurched, +and the other wins a double game. +.HP "Irregularities." +.ul +Misdeal. +There must be a new deal by the same dealer if a card is found faced in the +pack, if a card is exposed in dealing, or if the pack be found imperfect. +.PG +.ul +Wrong Number of Cards. +If one hand (not crib) is found to have the wrong number of cards after +laying away for the crib, the other hand and crib being correct, the +opponent may either demand a new deal or may peg 2 and rectify the +hand. If the crib is incorrect, both hands being correct, nondealer +pegs 2 and the crib is corrected. +.HP "Error in Pegging." +If a player places a peg short of the amount to which he is entitled, he +may not correct his error after he has played the next card or after the +cut for the next deal. If he pegs more than his announced score, +the error must be corrected on demand at any time before the cut for the +next deal and his opponent pegs 2. +.HP "Strategy." +The best balking cards are kings and aces, because they have the least +chance of producing sequences. Tenth cards are generally good, provided +that the two cards laid away are not too +.ul +near +(likely to make a sequence). When nothing better offers, give two +.ul +wide +cards -- at least three apart in rank. +.PG +Proverbially the safest lead is a 4. The next card cannot make a 15. +Lower cards are also safe from this point of view, but are better +treasured for go and 31. The most dangerous leads are 7 and 8, but +may be made to trap the opponent when they are backed with other +close cards. Generally speaking, play +.ul +on +(toward a sequence) when you have close cards and +.ul +off +when you do not. However, the state of the score is a consideration. +If far behind, play on when there is any chance of building a score +for yourself; if well ahead, balk your opponent by playing off unless +you will surely peg as much as he by playing on. diff --git a/games/cribbage/cribcur.h b/games/cribbage/cribcur.h new file mode 100644 index 0000000..c75ded9 --- /dev/null +++ b/games/cribbage/cribcur.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + * + * @(#)cribcur.h 5.1 (Berkeley) 5/30/85 + */ + +# define PLAY_Y 15 /* size of player's hand window */ +# define PLAY_X 12 +# define TABLE_Y 21 /* size of table window */ +# define TABLE_X 14 +# define COMP_Y 15 /* size of computer's hand window */ +# define COMP_X 12 +# define Y_SCORE_SZ 9 /* Y size of score board */ +# define X_SCORE_SZ 41 /* X size of score board */ +# define SCORE_Y 0 /* starting position of scoring board */ +# define SCORE_X (PLAY_X + TABLE_X + COMP_X) +# define CRIB_Y 17 /* position of crib (cut card) */ +# define CRIB_X (PLAY_X + TABLE_X) +# define MSG_Y (LINES - (Y_SCORE_SZ + 1)) +# define MSG_X (COLS - SCORE_X - 1) +# define Y_MSG_START (Y_SCORE_SZ + 1) + +# define PEG '*' /* what a peg looks like on the board */ + +extern WINDOW *Compwin; /* computer's hand window */ +extern WINDOW *Msgwin; /* message window */ +extern WINDOW *Playwin; /* player's hand window */ +extern WINDOW *Tablewin; /* table window */ diff --git a/games/cribbage/deck.h b/games/cribbage/deck.h new file mode 100644 index 0000000..c600be2 --- /dev/null +++ b/games/cribbage/deck.h @@ -0,0 +1,58 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + * + * @(#)deck.h 5.1 (Berkeley) 5/30/85 + */ + +/* + * define structure of a deck of cards and other related things + */ + + +#define CARDS 52 /* number cards in deck */ +#define RANKS 13 /* number ranks in deck */ +#define SUITS 4 /* number suits in deck */ + +#define CINHAND 4 /* # cards in cribbage hand */ +#define FULLHAND 6 /* # cards in dealt hand */ + +#define LGAME 121 /* number points in a game */ +#define SGAME 61 /* # points in a short game */ + +#define SPADES 0 /* value of each suit */ +#define HEARTS 1 +#define DIAMONDS 2 +#define CLUBS 3 + +#define ACE 0 /* value of each rank */ +#define TWO 1 +#define THREE 2 +#define FOUR 3 +#define FIVE 4 +#define SIX 5 +#define SEVEN 6 +#define EIGHT 7 +#define NINE 8 +#define TEN 9 +#define JACK 10 +#define QUEEN 11 +#define KING 12 +#define EMPTY 13 + +#define VAL(c) ( (c) < 9 ? (c)+1 : 10 ) /* val of rank */ + + +#ifndef TRUE +# define TRUE 1 +# define FALSE 0 +#endif + +typedef struct { + int rank; + int suit; + } CARD; + +typedef char BOOLEAN; + diff --git a/games/cribbage/extern.c b/games/cribbage/extern.c new file mode 100644 index 0000000..4914957 --- /dev/null +++ b/games/cribbage/extern.c @@ -0,0 +1,40 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#ifndef lint +static char sccsid[] = "@(#)extern.c 5.1 (Berkeley) 5/30/85"; +#endif not lint + +# include +# include "deck.h" +# include "cribbage.h" + +bool explain = FALSE; /* player mistakes explained */ +bool iwon = FALSE; /* if comp won last game */ +bool quiet = FALSE; /* if suppress random mess */ +bool rflag = FALSE; /* if all cuts random */ + +char expl[128]; /* explanation */ + +int cgames = 0; /* number games comp won */ +int cscore = 0; /* comp score in this game */ +int gamecount = 0; /* number games played */ +int glimit = LGAME; /* game playe to glimit */ +int knownum = 0; /* number of cards we know */ +int pgames = 0; /* number games player won */ +int pscore = 0; /* player score in this game */ + +CARD chand[FULLHAND]; /* computer's hand */ +CARD crib[CINHAND]; /* the crib */ +CARD deck[CARDS]; /* a deck */ +CARD known[CARDS]; /* cards we have seen */ +CARD phand[FULLHAND]; /* player's hand */ +CARD turnover; /* the starter */ + +WINDOW *Compwin; /* computer's hand window */ +WINDOW *Msgwin; /* messages for the player */ +WINDOW *Playwin; /* player's hand window */ +WINDOW *Tablewin; /* table window */ diff --git a/games/cribbage/io.c b/games/cribbage/io.c new file mode 100644 index 0000000..4808d95 --- /dev/null +++ b/games/cribbage/io.c @@ -0,0 +1,575 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#ifndef lint +static char sccsid[] = "@(#)io.c 5.1 (Berkeley) 5/30/85"; +#endif not lint + +# include +# include +# include +# include "deck.h" +# include "cribbage.h" +# include "cribcur.h" + +# define LINESIZE 128 + +# ifdef CTRL +# undef CTRL +# endif +# define CTRL(X) ('X' - 'A' + 1) + +# ifndef erasechar() +# define erasechar() _tty.sg_erase +# endif erasechar() + +# ifndef killchar() +# define killchar() _tty.sg_kill +# endif killchar() + +char linebuf[ LINESIZE ]; + +char *rankname[ RANKS ] = { "ACE", "TWO", "THREE", "FOUR", + "FIVE", "SIX", "SEVEN", "EIGHT", + "NINE", "TEN", "JACK", "QUEEN", + "KING" }; + +char *rankchar[ RANKS ] = { "A", "2", "3", "4", "5", "6", "7", + "8", "9", "T", "J", "Q", "K" }; + +char *suitname[ SUITS ] = { "SPADES", "HEARTS", "DIAMONDS", + "CLUBS" }; + +char *suitchar[ SUITS ] = { "S", "H", "D", "C" }; + + + +/* + * msgcard: + * Call msgcrd in one of two forms + */ +msgcard(c, brief) +CARD c; +BOOLEAN brief; +{ + if (brief) + return msgcrd(c, TRUE, (char *) NULL, TRUE); + else + return msgcrd(c, FALSE, " of ", FALSE); +} + + + +/* + * msgcrd: + * Print the value of a card in ascii + */ +msgcrd(c, brfrank, mid, brfsuit) +CARD c; +char *mid; +BOOLEAN brfrank, brfsuit; +{ + if (c.rank == EMPTY || c.suit == EMPTY) + return FALSE; + if (brfrank) + addmsg("%1.1s", rankchar[c.rank]); + else + addmsg(rankname[c.rank]); + if (mid != NULL) + addmsg(mid); + if (brfsuit) + addmsg("%1.1s", suitchar[c.suit]); + else + addmsg(suitname[c.suit]); + return TRUE; +} + +/* + * printcard: + * Print out a card. + */ +printcard(win, cardno, c, blank) +WINDOW *win; +int cardno; +CARD c; +BOOLEAN blank; +{ + prcard(win, cardno * 2, cardno, c, blank); +} + +/* + * prcard: + * Print out a card on the window at the specified location + */ +prcard(win, y, x, c, blank) +WINDOW *win; +int y, x; +CARD c; +BOOLEAN blank; +{ + if (c.rank == EMPTY) + return; + mvwaddstr(win, y + 0, x, "+-----+"); + mvwaddstr(win, y + 1, x, "| |"); + mvwaddstr(win, y + 2, x, "| |"); + mvwaddstr(win, y + 3, x, "| |"); + mvwaddstr(win, y + 4, x, "+-----+"); + if (!blank) { + mvwaddch(win, y + 1, x + 1, rankchar[c.rank][0]); + waddch(win, suitchar[c.suit][0]); + mvwaddch(win, y + 3, x + 4, rankchar[c.rank][0]); + waddch(win, suitchar[c.suit][0]); + } +} + +/* + * prhand: + * Print a hand of n cards + */ +prhand(h, n, win, blank) +CARD h[]; +int n; +WINDOW *win; +BOOLEAN blank; +{ + register int i; + + werase(win); + for (i = 0; i < n; i++) + printcard(win, i, *h++, blank); + wrefresh(win); +} + + + +/* + * infrom: + * reads a card, supposedly in hand, accepting unambigous brief + * input, returns the index of the card found... + */ +infrom(hand, n, prompt) +CARD hand[]; +int n; +char *prompt; +{ + register int i, j; + CARD crd; + + if (n < 1) { + printf("\nINFROM: %d = n < 1!!\n", n); + exit(74); + } + for (;;) { + msg(prompt); + if (incard(&crd)) { /* if card is full card */ + if (!isone(crd, hand, n)) + msg("That's not in your hand"); + else { + for (i = 0; i < n; i++) + if (hand[i].rank == crd.rank && + hand[i].suit == crd.suit) + break; + if (i >= n) { + printf("\nINFROM: isone or something messed up\n"); + exit(77); + } + return i; + } + } + else /* if not full card... */ + if (crd.rank != EMPTY) { + for (i = 0; i < n; i++) + if (hand[i].rank == crd.rank) + break; + if (i >= n) + msg("No such rank in your hand"); + else { + for (j = i + 1; j < n; j++) + if (hand[j].rank == crd.rank) + break; + if (j < n) + msg("Ambiguous rank"); + else + return i; + } + } + else + msg("Sorry, I missed that"); + } + /* NOTREACHED */ +} + + + +/* + * incard: + * Inputs a card in any format. It reads a line ending with a CR + * and then parses it. + */ +incard(crd) +CARD *crd; +{ + char *getline(); + register int i; + int rnk, sut; + char *line, *p, *p1; + BOOLEAN retval; + + retval = FALSE; + rnk = sut = EMPTY; + if (!(line = getline())) + goto gotit; + p = p1 = line; + while( *p1 != ' ' && *p1 != NULL ) ++p1; + *p1++ = NULL; + if( *p == NULL ) goto gotit; + /* IMPORTANT: no real card has 2 char first name */ + if( strlen(p) == 2 ) { /* check for short form */ + rnk = EMPTY; + for( i = 0; i < RANKS; i++ ) { + if( *p == *rankchar[i] ) { + rnk = i; + break; + } + } + if( rnk == EMPTY ) goto gotit; /* it's nothing... */ + ++p; /* advance to next char */ + sut = EMPTY; + for( i = 0; i < SUITS; i++ ) { + if( *p == *suitchar[i] ) { + sut = i; + break; + } + } + if( sut != EMPTY ) retval = TRUE; + goto gotit; + } + rnk = EMPTY; + for( i = 0; i < RANKS; i++ ) { + if( !strcmp( p, rankname[i] ) || !strcmp( p, rankchar[i] ) ) { + rnk = i; + break; + } + } + if( rnk == EMPTY ) goto gotit; + p = p1; + while( *p1 != ' ' && *p1 != NULL ) ++p1; + *p1++ = NULL; + if( *p == NULL ) goto gotit; + if( !strcmp( "OF", p ) ) { + p = p1; + while( *p1 != ' ' && *p1 != NULL ) ++p1; + *p1++ = NULL; + if( *p == NULL ) goto gotit; + } + sut = EMPTY; + for( i = 0; i < SUITS; i++ ) { + if( !strcmp( p, suitname[i] ) || !strcmp( p, suitchar[i] ) ) { + sut = i; + break; + } + } + if( sut != EMPTY ) retval = TRUE; +gotit: + (*crd).rank = rnk; + (*crd).suit = sut; + return( retval ); +} + + + +/* + * getuchar: + * Reads and converts to upper case + */ +getuchar() +{ + register int c; + + c = readchar(); + if (islower(c)) + c = toupper(c); + waddch(Msgwin, c); + return c; +} + +/* + * number: + * Reads in a decimal number and makes sure it is between "lo" and + * "hi" inclusive. + */ +number(lo, hi, prompt) +int lo, hi; +char *prompt; +{ + char *getline(); + register char *p; + register int sum; + + sum = 0; + for (;;) { + msg(prompt); + if(!(p = getline()) || *p == NULL) { + msg(quiet ? "Not a number" : "That doesn't look like a number"); + continue; + } + sum = 0; + + if (!isdigit(*p)) + sum = lo - 1; + else + while (isdigit(*p)) { + sum = 10 * sum + (*p - '0'); + ++p; + } + + if (*p != ' ' && *p != '\t' && *p != NULL) + sum = lo - 1; + if (sum >= lo && sum <= hi) + return sum; + if (sum == lo - 1) + msg("that doesn't look like a number, try again --> "); + else + msg("%d is not between %d and %d inclusive, try again --> ", + sum, lo, hi); + } +} + +/* + * msg: + * Display a message at the top of the screen. + */ +char Msgbuf[BUFSIZ] = { '\0' }; + +int Mpos = 0; + +static int Newpos = 0; + +/* VARARGS1 */ +msg(fmt, args) +char *fmt; +int args; +{ + doadd(fmt, &args); + endmsg(); +} + +/* + * addmsg: + * Add things to the current message + */ +/* VARARGS1 */ +addmsg(fmt, args) +char *fmt; +int args; +{ + doadd(fmt, &args); +} + +/* + * endmsg: + * Display a new msg. + */ + +int Lineno = 0; + +endmsg() +{ + register int len; + register char *mp, *omp; + static int lastline = 0; + + /* + * All messages should start with uppercase + */ + mvaddch(lastline + Y_MSG_START, SCORE_X, ' '); + if (islower(Msgbuf[0]) && Msgbuf[1] != ')') + Msgbuf[0] = toupper(Msgbuf[0]); + mp = Msgbuf; + len = strlen(mp); + if (len / MSG_X + Lineno >= MSG_Y) { + while (Lineno < MSG_Y) { + wmove(Msgwin, Lineno++, 0); + wclrtoeol(Msgwin); + } + Lineno = 0; + } + mvaddch(Lineno + Y_MSG_START, SCORE_X, '*'); + lastline = Lineno; + do { + mvwaddstr(Msgwin, Lineno, 0, mp); + if ((len = strlen(mp)) > MSG_X) { + omp = mp; + for (mp = &mp[MSG_X-1]; *mp != ' '; mp--) + continue; + while (*mp == ' ') + mp--; + mp++; + wmove(Msgwin, Lineno, mp - omp); + wclrtoeol(Msgwin); + } + if (++Lineno >= MSG_Y) + Lineno = 0; + } while (len > MSG_X); + wclrtoeol(Msgwin); + Mpos = len; + Newpos = 0; + wrefresh(Msgwin); + refresh(); + wrefresh(Msgwin); +} + +/* + * doadd: + * Perform an add onto the message buffer + */ +doadd(fmt, args) +char *fmt; +int *args; +{ + static FILE junk; + + /* + * Do the printf into Msgbuf + */ + junk._flag = _IOWRT + _IOSTRG; + junk._ptr = &Msgbuf[Newpos]; + junk._cnt = 32767; + _doprnt(fmt, args, &junk); + putc('\0', &junk); + Newpos = strlen(Msgbuf); +} + +/* + * do_wait: + * Wait for the user to type ' ' before doing anything else + */ +do_wait() +{ + register int line; + static char prompt[] = { '-', '-', 'M', 'o', 'r', 'e', '-', '-', '\0' }; + + if (Mpos + sizeof prompt < MSG_X) + wmove(Msgwin, Lineno > 0 ? Lineno - 1 : MSG_Y - 1, Mpos); + else { + mvwaddch(Msgwin, Lineno, 0, ' '); + wclrtoeol(Msgwin); + if (++Lineno >= MSG_Y) + Lineno = 0; + } + waddstr(Msgwin, prompt); + wrefresh(Msgwin); + wait_for(' '); +} + +/* + * wait_for + * Sit around until the guy types the right key + */ +wait_for(ch) +register char ch; +{ + register char c; + + if (ch == '\n') + while ((c = readchar()) != '\n') + continue; + else + while (readchar() != ch) + continue; +} + +/* + * readchar: + * Reads and returns a character, checking for gross input errors + */ +readchar() +{ + register int cnt, y, x; + auto char c; + +over: + cnt = 0; + while (read(0, &c, 1) <= 0) + if (cnt++ > 100) /* if we are getting infinite EOFs */ + bye(); /* quit the game */ + if (c == CTRL(L)) { + wrefresh(curscr); + goto over; + } + if (c == '\r') + return '\n'; + else + return c; +} + +/* + * getline: + * Reads the next line up to '\n' or EOF. Multiple spaces are + * compressed to one space; a space is inserted before a ',' + */ +char * +getline() +{ + register char *sp; + register int c, oy, ox; + register WINDOW *oscr; + + oscr = stdscr; + stdscr = Msgwin; + getyx(stdscr, oy, ox); + refresh(); + /* + * loop reading in the string, and put it in a temporary buffer + */ + for (sp = linebuf; (c = readchar()) != '\n'; clrtoeol(), refresh()) { + if (c == -1) + continue; + else if (c == erasechar()) { /* process erase character */ + if (sp > linebuf) { + register int i; + + sp--; + for (i = strlen(unctrl(*sp)); i; i--) + addch('\b'); + } + continue; + } + else if (c == killchar()) { /* process kill character */ + sp = linebuf; + move(oy, ox); + continue; + } + else if (sp == linebuf && c == ' ') + continue; + if (sp >= &linebuf[LINESIZE-1] || !(isprint(c) || c == ' ')) + putchar(CTRL(G)); + else { + if (islower(c)) + c = toupper(c); + *sp++ = c; + addstr(unctrl(c)); + Mpos++; + } + } + *sp = '\0'; + stdscr = oscr; + return linebuf; +} + +/* + * bye: + * Leave the program, cleaning things up as we go. + */ +bye() +{ + signal(SIGINT, SIG_IGN); + mvcur(0, COLS - 1, LINES - 1, 0); + fflush(stdout); + endwin(); + putchar('\n'); + exit(1); +} diff --git a/games/cribbage/macro b/games/cribbage/macro new file mode 100644 index 0000000..7e29a7a --- /dev/null +++ b/games/cribbage/macro @@ -0,0 +1,126 @@ +.\" Copyright (c) 1980 Regents of the University of California. +.\" All rights reserved. The Berkeley software License Agreement +.\" specifies the terms and conditions for redistribution. +.\" +.\" @(#)macro 5.1 (Berkeley) 5/30/85 +.\" +.nr TX 2 \" default line space for text is 2 +.nr PG 8 \" default paragraph indentation in PG is 8 +.nr QI 8 \" default indentation for quotes is 8 +.nr IP 4 \" default indentation for indented paragraph is 4 +.de TX \" define text settings +.ls \\n(TX +.fi +.. +.de NT \" define non-text setings +.nf +.ls 1 +.. +.de PG \" define paragraph starter +.sp +.ti +\\n(PG +.. +.de HD \" define page header +'sp 1i +.. +.de FO \" define page footer +.if \\n%>1 \{\ +'sp 2 +.tl ""- % -"" \} +'bp +.. +.wh 0 HD \" trap invocation of header +.wh -1i FO \" trap invocation of footer +.de pH \" define page header +.ce +.ul +\\$1 +.sp 1 +.. +.de PF \" define Page header for first page -- no .bp +.ce +.ul +\\$1 +.sp 1 +.. +.de PH \" define Page header +.ce +.ul +\\$1 +.sp 1 +.. +.de HP \" define paragraph header +.sp 2 +.ne 4 +.ul +\\$1 +.PG +.. +.de TP \" define title page +.ls 1 +   +.sp 3.5i +.ce +.ul +\\$1 +.sp +3i +.ti +50 +\\$2 +.br +.ti +50 +\\$3 +.br +.ti +50 +\\n(mo / \\n(dy / \\n(yr +.nr % 0 +.ls +.. +.de KS +.br +.di KB +.. +.de KE +.br +.di +.ne \\n(dnu +.KB +.. +.de QI \" define indented quote macro +.sp +.in +\\n(QI +.ll -\\n(QI +.ls 1 +.. +.de EQ \" define end quote macro +.ls +.sp +.ll +\\n(QI +.in -\\n(QI +.. +.de IP \" define indented paragraph macro +.in +\\n(IP +.ll -\\n(IP +.PG +.. +.de EP \" define end indented paragraph macro +.ll +\\n(IP +.in -\\n(IP +.. +.de IH \" define indented paragraph header +.in +\\n(IP +.ll -\\n(IP +.sp 2 +.ne 4 +.ul +\\$1 +.PG +.. +.de IN +.in +8 +.br +.ti -4 +\\$1 +.. +.de NE +.in -8 +.. diff --git a/games/cribbage/score.c b/games/cribbage/score.c new file mode 100644 index 0000000..ff8c942 --- /dev/null +++ b/games/cribbage/score.c @@ -0,0 +1,337 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#ifndef lint +static char sccsid[] = "@(#)score.c 5.1 (Berkeley) 5/30/85"; +#endif not lint + +#include +#include "deck.h" +#include "cribbage.h" + + +/* + * the following arrays give the sum of the scores of the (50 2)*48 = 58800 + * hands obtainable for the crib given the two cards whose ranks index the + * array. the two arrays are for the case where the suits are equal and + * not equal respectively + */ + +long crbescr[ 169 ] = { + -10000, 271827, 278883, 332319, 347769, 261129, 250653, 253203, 248259, + 243435, 256275, 237435, 231051, -10000, -10000, 412815, 295707, 349497, + 267519, 262521, 259695, 254019, 250047, 262887, 244047, 237663, -10000, + -10000, -10000, 333987, 388629, 262017, 266787, 262971, 252729, 254475, + 267315, 248475, 242091, -10000, -10000, -10000, -10000, 422097, 302787, + 256437, 263751, 257883, 254271, 267111, 248271, 241887, -10000, -10000, + -10000, -10000, -10000, 427677, 387837, 349173, 347985, 423861, 436701, + 417861, 411477, -10000, -10000, -10000, -10000, -10000, -10000, 336387, + 298851, 338667, 236487, 249327, 230487, 224103, -10000, -10000, -10000, + -10000, -10000, -10000, -10000, 408483, 266691, 229803, 246195, 227355, + 220971, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, + 300675, 263787, 241695, 226407, 220023, -10000, -10000, -10000, -10000, + -10000, -10000, -10000, -10000, -10000, 295635, 273543, 219771, 216939, + -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, + -10000, 306519, 252747, 211431, -10000, -10000, -10000, -10000, -10000, + -10000, -10000, -10000, -10000, -10000, -10000, 304287, 262971, -10000, + -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, + -10000, -10000, 244131, -10000, -10000, -10000, -10000, -10000, -10000, + -10000, -10000, -10000, -10000, -10000, -10000, -10000 }; + +long crbnescr[ 169 ] = { + 325272, 260772, 267828, 321264, 336714, 250074, 239598, 242148, 237204, + 232380, 246348, 226380, 219996, -10000, 342528, 401760, 284652, 338442, + 256464, 251466, 248640, 242964, 238992, 252960, 232992, 226608, -10000, + -10000, 362280, 322932, 377574, 250962, 255732, 251916, 241674, 243420, + 257388, 237420, 231036, -10000, -10000, -10000, 360768, 411042, 291732, + 245382, 252696, 246828, 243216, 257184, 237216, 230832, -10000, -10000, + -10000, -10000, 528768, 416622, 376782, 338118, 336930, 412806, 426774, + 406806, 400422, -10000, -10000, -10000, -10000, -10000, 369864, 325332, + 287796, 327612, 225432, 239400, 219432, 213048, -10000, -10000, -10000, + -10000, -10000, -10000, 359160, 397428, 255636, 218748, 236268, 216300, + 209916, -10000, -10000, -10000, -10000, -10000, -10000, -10000, 331320, + 289620, 252732, 231768, 215352, 208968, -10000, -10000, -10000, -10000, + -10000, -10000, -10000, -10000, 325152, 284580, 263616, 208716, 205884, + -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, + 321240, 296592, 241692, 200376, -10000, -10000, -10000, -10000, -10000, + -10000, -10000, -10000, -10000, -10000, 348600, 294360, 253044, -10000, + -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, + -10000, 308664, 233076, -10000, -10000, -10000, -10000, -10000, -10000, + -10000, -10000, -10000, -10000, -10000, -10000, 295896 }; + + +static int ichoose2[ 5 ] = { 0, 0, 2, 6, 12 }; +static int pairpoints, runpoints; /* globals from pairuns */ + + +/* + * scorehand: + * Score the given hand of n cards and the starter card. + * n must be <= 4 + */ +scorehand(hand, starter, n, crb, do_explain) +register CARD hand[]; +CARD starter; +int n; +BOOLEAN crb; /* true if scoring crib */ +BOOLEAN do_explain; /* true if must explain this hand */ +{ + CARD h[(CINHAND + 1)]; + register int i, k; + register int score; + register BOOLEAN flag; + char buf[32]; + + expl[0] = NULL; /* initialize explanation */ + score = 0; + flag = TRUE; + k = hand[0].suit; + for (i = 0; i < n; i++) { /* check for flush */ + flag = (flag && (hand[i].suit == k)); + if (hand[i].rank == JACK) /* check for his nibs */ + if (hand[i].suit == starter.suit) { + score++; + if (do_explain) + strcat(expl, "His Nobs"); + } + h[i] = hand[i]; + } + + if (flag && n >= CINHAND) { + if (do_explain && expl[0] != NULL) + strcat(expl, ", "); + if (starter.suit == k) { + score += 5; + if (do_explain) + strcat(expl, "Five-flush"); + } + else if (!crb) { + score += 4; + if (do_explain && expl[0] != NULL) + strcat(expl, ", Four-flush"); + else + strcpy(expl, "Four-flush"); + } + } + + if (do_explain && expl[0] != NULL) + strcat(expl, ", "); + h[n] = starter; + sorthand(h, n + 1); /* sort by rank */ + i = 2 * fifteens(h, n + 1); + score += i; + if (do_explain) + if (i > 0) { + sprintf(buf, "%d points in fifteens", i); + strcat(expl, buf); + } + else + strcat(expl, "No fifteens"); + i = pairuns(h, n + 1); + score += i; + if (do_explain) + if (i > 0) { + sprintf(buf, ", %d points in pairs, %d in runs", pairpoints, + runpoints); + strcat(expl, buf); + } + else + strcat(expl, ", No pairs/runs"); + return score; +} + +/* + * fifteens: + * Return number of fifteens in hand of n cards + */ +fifteens(hand, n) +register CARD hand[]; +int n; +{ + register int *sp, *np; + register int i; + register CARD *endp; + static int sums[15], nsums[15]; + + np = nsums; + sp = sums; + i = 16; + while (--i) { + *np++ = 0; + *sp++ = 0; + } + for (endp = &hand[n]; hand < endp; hand++) { + i = hand->rank + 1; + if (i > 10) + i = 10; + np = &nsums[i]; + np[-1]++; /* one way to make this */ + sp = sums; + while (i < 15) { + *np++ += *sp++; + i++; + } + sp = sums; + np = nsums; + i = 16; + while (--i) + *sp++ = *np++; + } + return sums[14]; +} + + + +/* + * pairuns returns the number of points in the n card sorted hand + * due to pairs and runs + * this routine only works if n is strictly less than 6 + * sets the globals pairpoints and runpoints appropriately + */ + +pairuns( h, n ) + + CARD h[]; + int n; +{ + register int i; + int runlength, runmult, lastmult, curmult; + int mult1, mult2, pair1, pair2; + BOOLEAN run; + + run = TRUE; + runlength = 1; + mult1 = 1; + pair1 = -1; + mult2 = 1; + pair2 = -1; + curmult = runmult = 1; + for( i = 1; i < n; i++ ) { + lastmult = curmult; + if( h[i].rank == h[i - 1].rank ) { + if( pair1 < 0 ) { + pair1 = h[i].rank; + mult1 = curmult = 2; + } + else { + if( h[i].rank == pair1 ) { + curmult = ++mult1; + } + else { + if( pair2 < 0 ) { + pair2 = h[i].rank; + mult2 = curmult = 2; + } + else { + curmult = ++mult2; + } + } + } + if( i == (n - 1) && run ) { + runmult *= curmult; + } + } + else { + curmult = 1; + if( h[i].rank == h[i - 1].rank + 1 ) { + if( run ) { + ++runlength; + } + else { + if( runlength < 3 ) { /* only if old short */ + run = TRUE; + runlength = 2; + runmult = 1; + } + } + runmult *= lastmult; + } + else { + if( run ) runmult *= lastmult; /* if just ended */ + run = FALSE; + } + } + } + pairpoints = ichoose2[ mult1 ] + ichoose2[ mult2 ]; + runpoints = ( runlength >= 3 ? runlength*runmult : 0 ); + return( pairpoints + runpoints ); +} + + + +/* + * pegscore tells how many points crd would get if played after + * the n cards in tbl during pegging + */ + +pegscore( crd, tbl, n, sum ) + + CARD crd, tbl[]; + int n; + int sum; +{ + BOOLEAN got[ RANKS ]; + register int i, j, scr; + int k, lo, hi; + + sum += VAL( crd.rank ); + if( sum > 31 ) return( -1 ); + if( sum == 31 || sum == 15 ) scr = 2; + else scr = 0; + if( !n ) return( scr ); + j = 1; + while( ( crd.rank == tbl[n - j].rank ) && ( n - j >= 0 ) ) ++j; + if( j > 1 ) return( scr + ichoose2[j] ); + if( n < 2 ) return( scr ); + lo = hi = crd.rank; + for( i = 0; i < RANKS; i++ ) got[i] = FALSE; + got[ crd.rank ] = TRUE; + k = -1; + for( i = n - 1; i >= 0; --i ) { + if( got[ tbl[i].rank ] ) break; + got[ tbl[i].rank ] = TRUE; + if( tbl[i].rank < lo ) lo = tbl[i].rank; + if( tbl[i].rank > hi ) hi = tbl[i].rank; + for( j = lo; j <= hi; j++ ) if( !got[j] ) break; + if( j > hi ) k = hi - lo + 1; + } + if( k >= 3 ) return( scr + k ); + else return( scr ); +} + + + +/* + * adjust takes a two card hand that will be put in the crib + * and returns an adjusted normalized score for the number of + * points such a crib will get. + */ + +adjust( cb, tnv ) + + CARD cb[], tnv; +{ + int i, c0, c1; + long scr; + + c0 = cb[0].rank; + c1 = cb[1].rank; + if( c0 > c1 ) { + i = c0; + c0 = c1; + c1 = i; + } + if( cb[0].suit != cb[1].suit ) scr = crbnescr[ RANKS*c0 + c1 ]; + else scr = crbescr[ RANKS*c0 + c1 ]; + if( scr <= 0 ) { + printf( "\nADJUST: internal error %d %d\n", c0, c1 ); + exit( 93 ); + } + return( (scr + 29400)/58800 ); +} + + + diff --git a/games/cribbage/support.c b/games/cribbage/support.c new file mode 100644 index 0000000..867ad01 --- /dev/null +++ b/games/cribbage/support.c @@ -0,0 +1,330 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#ifndef lint +static char sccsid[] = "@(#)support.c 5.1 (Berkeley) 5/30/85"; +#endif not lint + +#include +#include "deck.h" +#include "cribbage.h" +#include "cribcur.h" + + +#define NTV 10 /* number scores to test */ + +/* score to test reachability of, and order to test them in */ +int tv[ NTV ] = { 8, 7, 9, 6, 11, 12, 13, 14, 10, 5 }; + + +/* + * computer chooses what to play in pegging... + * only called if no playable card will score points + */ + +cchose( h, n, s ) + + CARD h[]; + int n; + int s; +{ + register int i, j, l; + + if( n <= 1 ) return( 0 ); + if( s < 4 ) { /* try for good value */ + if( ( j = anysumto(h, n, s, 4) ) >= 0 ) return( j ); + if( ( j = anysumto(h, n, s, 3) ) >= 0 && s == 0 ) + return( j ); + } + if( s > 0 && s < 20 ) { + for( i = 1; i <= 10; i++ ) { /* try for retaliation to 31 */ + if( ( j = anysumto(h, n, s, 21-i) ) >= 0 ) { + if( ( l = numofval(h, n, i) ) > 0 ) { + if( l > 1 || VAL( h[j].rank ) != i ) return( j ); + } + } + } + } + if( s < 15 ) { + for( i = 0; i < NTV; i++ ) { /* for retaliation after 15 */ + if( ( j = anysumto(h, n, s, tv[i]) ) >= 0 ) { + if( ( l = numofval(h, n, 15-tv[i]) ) > 0 ) { + if( l > 1 || VAL( h[j].rank ) != 15-tv[i] ) return( j ); + } + } + } + } + j = -1; + for( i = n - 1; i >= 0; --i ) { /* remember: h is sorted */ + l = s + VAL( h[i].rank ); + if( l > 31 ) continue; + if( l != 5 && l != 10 && l != 21 ) { + j = i; + break; + } + } + if( j >= 0 ) return( j ); + for( i = n - 1; i >= 0; --i ) { + l = s + VAL( h[i].rank ); + if( l > 31 ) continue; + if( j < 0 ) j = i; + if( l != 5 && l != 21 ) { + j = i; + break; + } + } + return( j ); +} + + + +/* + * plyrhand: + * Evaluate and score a player hand or crib + */ +plyrhand(hand, s) +CARD hand[]; +char *s; +{ + register int i, j; + register BOOLEAN win; + static char prompt[BUFSIZ]; + + prhand(hand, CINHAND, Playwin, FALSE); + sprintf(prompt, "Your %s scores ", s); + i = scorehand(hand, turnover, CINHAND, strcmp(s, "crib") == 0, explain); + if ((j = number(0, 29, prompt)) == 19) + j = 0; + if (i != j) { + if (i < j) { + win = chkscr(&pscore, i); + msg("It's really only %d points; I get %d", i, 2); + if (!win) + win = chkscr(&cscore, 2); + } + else { + win = chkscr(&pscore, j); + msg("You should have taken %d, not %d!", i, j); + } + if (explain) + msg("Explanation: %s", expl); + do_wait(); + } + else + win = chkscr(&pscore, i); + return win; +} + +/* + * comphand: + * Handle scoring and displaying the computers hand + */ +comphand(h, s) +CARD h[]; +char *s; +{ + register int j; + + j = scorehand(h, turnover, CINHAND, strcmp(s, "crib") == 0, FALSE); + prhand(h, CINHAND, Compwin, FALSE); + msg("My %s scores %d", s, (j == 0 ? 19 : j)); + return chkscr(&cscore, j); +} + +/* + * chkscr: + * Add inc to scr and test for > glimit, printing on the scoring + * board while we're at it. + */ + +int Lastscore[2] = {-1, -1}; + +chkscr(scr, inc) +int *scr, inc; +{ + BOOLEAN myturn; + + myturn = (scr == &cscore); + if (inc != 0) { + prpeg(Lastscore[myturn], '.', myturn); + Lastscore[myturn] = *scr; + *scr += inc; + prpeg(*scr, PEG, myturn); + refresh(); + } + return (*scr >= glimit); +} + +/* + * prpeg: + * Put out the peg character on the score board and put the + * score up on the board. + */ +prpeg(score, peg, myturn) +register int score; +char peg; +BOOLEAN myturn; +{ + register int y, x; + + if (!myturn) + y = SCORE_Y + 2; + else + y = SCORE_Y + 5; + + if (score <= 0 || score >= glimit) { + if (peg == '.') + peg = ' '; + if (score == 0) + x = SCORE_X + 2; + else { + x = SCORE_X + 2; + y++; + } + } + else { + x = (score - 1) % 30; + if (score > 90 || (score > 30 && score <= 60)) { + y++; + x = 29 - x; + } + x += x / 5; + x += SCORE_X + 3; + } + mvaddch(y, x, peg); + mvprintw(SCORE_Y + (myturn ? 7 : 1), SCORE_X + 10, "%3d", score); +} + +/* + * cdiscard -- the computer figures out what is the best discard for + * the crib and puts the best two cards at the end + */ + +cdiscard( mycrib ) + + BOOLEAN mycrib; +{ + CARD d[ CARDS ], h[ FULLHAND ], cb[ 2 ]; + register int i, j, k; + int nc, ns; + long sums[ 15 ]; + static int undo1[15] = {0,0,0,0,0,1,1,1,1,2,2,2,3,3,4}; + static int undo2[15] = {1,2,3,4,5,2,3,4,5,3,4,5,4,5,5}; + + makedeck( d ); + nc = CARDS; + for( i = 0; i < knownum; i++ ) { /* get all other cards */ + remove( known[i], d, nc-- ); + } + for( i = 0; i < 15; i++ ) sums[i] = 0L; + ns = 0; + for( i = 0; i < (FULLHAND - 1); i++ ) { + cb[0] = chand[i]; + for( j = i + 1; j < FULLHAND; j++ ) { + cb[1] = chand[j]; + for( k = 0; k < FULLHAND; k++ ) h[k] = chand[k]; + remove( chand[i], h, FULLHAND ); + remove( chand[j], h, FULLHAND - 1 ); + for( k = 0; k < nc; k++ ) { + sums[ns] += scorehand( h, d[k], CINHAND, TRUE, FALSE ); + if( mycrib ) sums[ns] += adjust( cb, d[k] ); + else sums[ns] -= adjust( cb, d[k] ); + } + ++ns; + } + } + j = 0; + for( i = 1; i < 15; i++ ) if( sums[i] > sums[j] ) j = i; + for( k = 0; k < FULLHAND; k++ ) h[k] = chand[k]; + remove( h[ undo1[j] ], chand, FULLHAND ); + remove( h[ undo2[j] ], chand, FULLHAND - 1 ); + chand[4] = h[ undo1[j] ]; + chand[5] = h[ undo2[j] ]; +} + + + +/* + * returns true if some card in hand can be played without exceeding 31 + */ + +anymove( hand, n, sum ) + + CARD hand[]; + int n; + int sum; +{ + register int i, j; + + if( n < 1 ) return( FALSE ); + j = hand[0].rank; + for( i = 1; i < n; i++ ) { + if( hand[i].rank < j ) j = hand[i].rank; + } + return( sum + VAL( j ) <= 31 ); +} + + + +/* + * anysumto returns the index (0 <= i < n) of the card in hand that brings + * the s up to t, or -1 if there is none + */ + +anysumto( hand, n, s, t ) + + CARD hand[]; + int n; + int s, t; +{ + register int i; + + for( i = 0; i < n; i++ ) { + if( s + VAL( hand[i].rank ) == t ) return( i ); + } + return( -1 ); +} + + + + +/* + * return the number of cards in h having the given rank value + */ + +numofval( h, n, v ) + + CARD h[]; + int n; + int v; +{ + register int i, j; + + j = 0; + for( i = 0; i < n; i++ ) { + if( VAL( h[i].rank ) == v ) ++j; + } + return( j ); +} + + + +/* + * makeknown remembers all n cards in h for future recall + */ + +makeknown( h, n ) + + CARD h[]; + int n; +{ + register int i; + + for( i = 0; i < n; i++ ) { + known[ knownum++ ] = h[i]; + } +} + diff --git a/games/cribbage/test.c b/games/cribbage/test.c new file mode 100644 index 0000000..44f2f61 --- /dev/null +++ b/games/cribbage/test.c @@ -0,0 +1,131 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#ifndef lint +char copyright[] = +"@(#) Copyright (c) 1980 Regents of the University of California.\n\ + All rights reserved.\n"; +#endif not lint + +#ifndef lint +static char sccsid[] = "@(#)test.c 5.1 (Berkeley) 5/30/85"; +#endif not lint + +#include +#include "deck.h" + + +CARD known[ CARDS ]; /* a deck */ +CARD deck[ CARDS ]; /* a deck */ +CARD hand[ 4 ]; /* a hand */ + +int knownum; + + +main( argc, argv ) + + int argc; + char *argv[]; +{ + register int k, l, m; + int i, j, is, n, sum, sum2; + CARD ic, jc; + CARD d[ CARDS]; + extern char expl[]; + + printf( "Assuming cards are same suit\n" ); + if( argc == 2 ) { + is = atoi( *++argv ); + printf( "Starting at i = %d\n", is ); + } + makedeck( deck ); +# if 0 + for( i = is; i < RANKS; i++ ) { /* first card */ + ic.rank = i; + ic.suit = 0; + hand[0] = ic; + for( j = 0; j <= i; j++ ) { + printf( "%d %d: sum = %d\n", i, j, -10000000 ); + printf( "%d %d: sum2 = %d\n", i, j, -10000000 ); + } + for( j = i + 1; j < RANKS; j++ ) { /* second card */ + jc.rank = j; + jc.suit = 0; + hand[1] = jc; + for( k = 0; k < CARDS; k++ ) d[k] = deck[k]; + n = CARDS; + remove( ic, d, n-- ); + remove( jc, d, n-- ); + sum = 0; + sum2 = 0; + for( k = 0; k < n - 1; k++ ) { /* 3rd card */ + hand[2] = d[k]; + for( l = k + 1; l < n; l++ ) { /* 4th card */ + hand[3] = d[l]; + for( m = 0; m < n; m++ ) { /* cut card */ + if( m != l && m != k ) + sum += scorehand(hand, d[m], 4, FALSE, FALSE); + sum2 += scorehand(hand, d[m], 4, TRUE, FALSE); + } + } + } + printf( "%d %d: sum = %d\n", i, j, sum ); + printf( "%d %d: sum2 = %d\n", i, j, sum2 ); + fflush( stdout ); + } + } + printf( "\nthe hand scores %d\n", i ); +# else + hand[0].rank = 0; + hand[1].rank = 1; + hand[2].rank = 2; + hand[3].rank = 3; + hand[4].rank = 4; + hand[0].suit = 0; + hand[1].suit = 0; + hand[2].suit = 0; + hand[3].suit = 0; + hand[4].suit = 0; + printf("scorehand of hand = %d\n", scorehand(hand, hand[4], CINHAND, FALSE, TRUE)); + printf("\t%s\n", expl); + hand[0].rank = 0; + hand[1].rank = 1; + hand[2].rank = 2; + hand[3].rank = 3; + hand[4].rank = 4; + hand[0].suit = 0; + hand[1].suit = 0; + hand[2].suit = 0; + hand[3].suit = 0; + hand[4].suit = 0; + printf("scorehand of crib = %d\n", scorehand(hand, hand[4], CINHAND, TRUE, TRUE)); + printf("\t%s\n", expl); + hand[0].rank = 0; + hand[1].rank = 1; + hand[2].rank = 2; + hand[3].rank = 3; + hand[4].rank = 4; + hand[0].suit = 0; + hand[1].suit = 0; + hand[2].suit = 0; + hand[3].suit = 0; + hand[4].suit = 1; + printf("scorehand of hand = %d\n", scorehand(hand, hand[4], CINHAND, FALSE, TRUE)); + printf("\t%s\n", expl); + hand[0].rank = 0; + hand[1].rank = 1; + hand[2].rank = 2; + hand[3].rank = 3; + hand[4].rank = 4; + hand[0].suit = 0; + hand[1].suit = 0; + hand[2].suit = 0; + hand[3].suit = 0; + hand[4].suit = 1; + printf("scorehand of crib = %d\n", scorehand(hand, hand[4], CINHAND, TRUE, TRUE)); + printf("\t%s\n", expl); +# endif +} diff --git a/games/factor.c b/games/factor.c new file mode 100644 index 0000000..94f9256 --- /dev/null +++ b/games/factor.c @@ -0,0 +1,100 @@ +#ifndef lint +static char sccsid[] = "@(#)factor.c 4.1 (Wollongong) 6/13/83"; +#endif + +/* + * factor [ number ] + * + * Written to replace factor.s in Bell V7 distribution + */ + +main(argc, argv) +char *argv[]; +{ + int n; + + if (argc >= 2) { + sscanf(argv[1], "%d", &n); + if (n > 0) + printfactors(n); + } else { + while (scanf("%d", &n) == 1) + if (n > 0) + printfactors(n); + } +} + +/* + * Print all prime factors of integer n > 0, smallest first, one to a line + */ +printfactors(n) + register int n; +{ + register int prime; + + if (n == 1) + printf("\t1\n"); + else while (n != 1) { + prime = factor(n); + printf("\t%d\n", prime); + n /= prime; + } +} + +/* + * Return smallest prime factor of integer N > 0 + * + * Algorithm from E.W. Dijkstra (A Discipline of Programming, Chapter 20) + */ + +int +factor(N) + int N; +{ + int p; + register int f; + static struct { + int hib; + int val[24]; + } ar; + + { register int x, y; + + ar.hib = -1; + x = N; y = 2; + while (x != 0) { + ar.val[++ar.hib] = x % y; + x /= y; + y += 1; + } + } + + f = 2; + + while (ar.val[0] != 0 && ar.hib > 1) { + register int i; + + f += 1; + i = 0; + while (i != ar.hib) { + register int j; + + j = i + 1; + ar.val[i] -= j * ar.val[j]; + while (ar.val[i] < 0) { + ar.val[i] += f + i; + ar.val[j] -= 1; + } + i = j; + } + while (ar.val[ar.hib] == 0) + ar.hib--; + } + + if (ar.val[0] == 0) + p = f; + else + p = N; + + return(p); +} diff --git a/games/fish.c b/games/fish.c new file mode 100644 index 0000000..fd75be2 --- /dev/null +++ b/games/fish.c @@ -0,0 +1,509 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#ifndef lint +char copyright[] = +"@(#) Copyright (c) 1980 Regents of the University of California.\n\ + All rights reserved.\n"; +#endif not lint + +#ifndef lint +static char sccsid[] = "@(#)fish.c 5.1 (Berkeley) 5/29/85"; +#endif not lint + +# include + +/* 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; i0; --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!\n", + "", + }; + +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> fortunes + cat obscene >> fortunes + +lint: + lint -hxb $(DEFS) fortune.c rnd.c 2>&1 > fortune.lint + lint -hxb $(DEFS) strfile.c rnd.c 2>&1 > strfile.lint + lint -hxb $(DEFS) unstr.c 2>&1 > unstr.lint + +install: all install.data + install -s -m 4711 -o daemon fortune $(DESTDIR)$(BINDIR) + +install.data: fortunes.dat + install -m 600 -o daemon fortunes.dat $(DESTDIR)$(LIBDIR) + +troff: troff.scene troff.obscene + +troff.scene: + ./Do_troff scene $(TROFF) + +troff.obscene: + ./Do_troff obscene $(TROFF) + +clean: sort.clean + rm -f fortune fortunes fortunes.dat strfile unstr ? core *.o + +sort: sort.scene sort.obscene + +sort.scene: strfile unstr + strfile -oi scene + mv scene Oscene + unstr -o scene + +sort.obscene: strfile unstr + strfile -oi obscene + mv obscene Oobscene + unstr -o obscene + +sort.clean: + rm -f Oscene Oobscene diff --git a/games/fortune/Troff.mac b/games/fortune/Troff.mac new file mode 100644 index 0000000..c2b433e --- /dev/null +++ b/games/fortune/Troff.mac @@ -0,0 +1,26 @@ +.nr tp 8 +.nr hm 3v +.nr fm 2v +.nr tm 5v +.nr bm 4v +.cs R +.sc +.sz 6 +.ll +10n +.lt \n(.l +.de $h +.tl 'Fortune Database'\\*(Se'\*(td' +.. +.de $f +.tl ''- % -'' +.. +.2c +.nf +.ta +.ta 8n 16n 24n 32n 40n 48n 56n 64n 72n 80n +.de %% +.sp .3 +.ce +\(sq\|\(sq\|\(sq\|\(sq\|\(sq\|\(sq\|\(sq\|\(sq\|\(sq +.sp .2 +.. diff --git a/games/fortune/Troff.sed b/games/fortune/Troff.sed new file mode 100644 index 0000000..3216681 --- /dev/null +++ b/games/fortune/Troff.sed @@ -0,0 +1,13 @@ +/^['.]/s//\\\&&/ +/^%%/s//.&/ +/--/s//\\*-/g +/_a-squared cos 2(phi)/s//\\fIa\\fP\\u2\\d cos 2\\(*f/ +/__**\([a-zA-Z]*\)/s//\\fI\1\\fP/g +/"\(.\)/s//\1\\*:/g +/`\(.\)/s//\1\\*`/g +/'\(.\)/s//\1\\*'/g +/~\(.\)/s//\1\\*~/g +/\^\(.\)/s//\1\\*^/g +/,\(.\)/s//\1\\*,/g +/\(.\)\(.\)/s//\\o_\1\2_/g +/*/s//\\(bs/g diff --git a/games/fortune/fortune.c b/games/fortune/fortune.c new file mode 100644 index 0000000..6253dea --- /dev/null +++ b/games/fortune/fortune.c @@ -0,0 +1,237 @@ +/* $Header: fortune.c,v 1.10 85/11/01 15:19:49 arnold Exp $ */ + +# include +# include +# include +# include "strfile.h" + +# define TRUE 1 +# define FALSE 0 +# define bool short + +# define MINW 6 /* minimum wait if desired */ +# define CPERS 20 /* # of chars for each sec */ +# define SLEN 160 /* # of chars in short fortune */ + +# define FORTFILE "/usr/games/lib/fortunes.dat" + +bool Wflag = FALSE, /* wait desired after fortune */ + Sflag = FALSE, /* short fortune desired */ + Lflag = FALSE, /* long fortune desired */ + Oflag = FALSE, /* offensive fortunes only */ + Aflag = FALSE; /* any fortune allowed */ + +char *Fortfile = FORTFILE, /* fortune database */ + *Usage[] = { + "usage: fortune [ - ] [ -wsloa ] [ file ]", + " - - give this summary of usage", + " w - have program wait after printing message in order", + " to give time to read", + " s - short fortune only", + " l - long fortune only", + " o - offensive fortunes only", + " a - any fortune", + " Mail suggested fortunes to \"fortune\"", + NULL + }; + +long Seekpts[2]; /* seek pointers to fortunes */ + +FILE *Inf; /* input file */ + +STRFILE Tbl; /* input table */ + +time_t time(); + +main(ac, av) +int ac; +char *av[]; +{ + register char c; + register int nchar = 0; + register int i; + + getargs(ac, av); + if ((Inf = fopen(Fortfile, "r+")) == NULL) { + perror(Fortfile); + exit(-1); + } + fread((char *) &Tbl, sizeof Tbl, 1, Inf); /* NOSTRICT */ + if (Tbl.str_longlen <= SLEN && Lflag) { + puts("Sorry, no long strings in this file"); + exit(0); + } + if (Tbl.str_shortlen > SLEN && Sflag) { + puts("Sorry, no short strings in this file"); + exit(0); + } + + /* + * initialize the pointer to the first -o fortune if need be. + */ + if (Tbl.str_delims[2] == 0) + Tbl.str_delims[2] = Tbl.str_delims[0]; + + do { + getfort(); + } while ((Sflag && !is_short()) || (Lflag && !is_long())); + + fseek(Inf, Seekpts[0], 0); + while (c = getc(Inf)) { + nchar++; + putchar(c); + } + fflush(stdout); + fseek(Inf, 0L, 0); +#ifdef LOCK_EX + /* + * if we can, we exclusive lock, but since it isn't very + * important, we just punt if we don't have easy locking + * available. + */ + flock(fileno(Inf), LOCK_EX); +#endif LOCK_EX + fwrite(&Tbl, 1, sizeof Tbl, Inf); +#ifdef LOCK_EX + flock(fileno(Inf), LOCK_UN); +#endif LOCK_EX + if (Wflag) + sleep(max((int) nchar / CPERS, MINW)); + exit(0); +} + +/* + * is_short: + * Return TRUE if fortune is "short". + */ +is_short() +{ + register int nchar; + + if (!(Tbl.str_flags & (STR_RANDOM | STR_ORDERED))) + return (Seekpts[1] - Seekpts[0] <= SLEN); + fseek(Inf, Seekpts[0], 0); + nchar = 0; + while (getc(Inf)) + nchar++; + return (nchar <= SLEN); +} + +/* + * is_long: + * Return TRUE if fortune is "long". + */ +is_long() +{ + register int nchar; + + if (!(Tbl.str_flags & (STR_RANDOM | STR_ORDERED))) + return (Seekpts[1] - Seekpts[0] > SLEN); + fseek(Inf, Seekpts[0], 0); + nchar = 0; + while (getc(Inf)) + nchar++; + return (nchar > SLEN); +} + +/* + * This routine evaluates the arguments on the command line + */ +getargs(ac, av) +register int ac; +register char *av[]; +{ + register int i; + register char *sp; + register int j; + register short bad = 0; + + for (i = 1; i < ac; i++) { + if (av[i][0] != '-') { + setuid(getuid()); + setgid(getgid()); + Fortfile = av[i]; + } + else if (av[i][1] == '\0') { + j = 0; + while (Usage[j] != NULL) + puts(Usage[j++]); + exit(0); + /* NOTREACHED */ + } + else + for (sp = &av[i][1]; *sp != '\0'; sp++) + switch (*sp) { + case 'w': /* give time to read */ + Wflag++; + break; + case 's': /* short ones only */ + Sflag++; + break; + case 'l': /* long ones only */ + Lflag++; + break; + case 'o': /* offensive ones only */ + Oflag++; + break; + case 'a': /* any fortune */ + Aflag++; + /* + * initialize the random number + * generator; throw away the first + * few numbers to avoid any non- + * randomness in startup + */ + srnd(time(NULL) + getpid()); + for (j = 0; j < 20; j++) + (void) rnd(100); + break; + default: + printf("unknown flag: '%c'\n", *sp); + bad++; + break; + } + } + if (bad) { + printf("use \"%s -\" to get usage\n", av[0]); + exit(-1); + } +} + +/* + * getfort: + * Get the fortune data file's seek pointer for the next fortune. + */ +getfort() +{ + register int fortune; + + /* + * Make sure all values are in range. + */ + + if (Tbl.str_delims[1] >= Tbl.str_delims[0]) + Tbl.str_delims[1] = 0; + if (Tbl.str_delims[2] >= Tbl.str_numstr) + Tbl.str_delims[2] = Tbl.str_delims[0]; + + if (Aflag) { + if (rnd(Tbl.str_numstr) < Tbl.str_delims[0]) + fortune = Tbl.str_delims[1]++; + else + fortune = Tbl.str_delims[2]++; + } + else if (Oflag) + fortune = Tbl.str_delims[2]++; + else + fortune = Tbl.str_delims[1]++; + + fseek(Inf, (long)(sizeof Seekpts[0]) * fortune + sizeof Tbl, 0); + fread((char *) Seekpts, (sizeof Seekpts[0]), 2, Inf); +} + +max(i, j) +register int i, j; +{ + return (i >= j ? i : j); +} diff --git a/games/fortune/notes b/games/fortune/notes new file mode 100644 index 0000000..b9e99b3 --- /dev/null +++ b/games/fortune/notes @@ -0,0 +1,140 @@ +Warning: The fortunes contained in the fortune database have + been collected haphazardly from a caphony of sources, + in number so huge it boggles the mind. It is + impossible to do any meaningful quality control on + attributions, or lack thereof, or exactness of the + quote. Since this database is not used for profit, and + since entire works are not published, it falls under + fair use, as we understand it. However, if any + half-assed idiot decides to make a profit off of this, + they will need to double check it all, and nobody not + involved of such an effort makes any warranty that + anything in here bears any relation to the real world + of literature, law, or other bizzarrity. + +[All examples are indented by one tab stop -- KCRCA] + +Numbers should be given in parentheses, e.g., + + (1) Everything depends. + (2) Nothing is always. + (3) Everything is sometimes. + +Attributions are two tab stops, followed by two hyphens, followed by a +space, followed by the attribution, and are *not* preceded by blank +lines. Book, journal, movie, and all other titles are in quotes, .e.g, + + $100 invested at 7% interest for 100 years will become $100,000, at + which time it will be worth absolutely nothing. + -- Lazarus Long, "Time Enough for Love" + +Attributions which do not fit on one (72 char) line should be continued +on a line which lines up below the first text of the attribution, e.g., + + -- A very long attribution which might not fit on one + line, "Ken Arnold's Stupid Sayings" + +Single paragraph fortunes are in left justified (non-indented) +paragraphs unless they fall into another category listed below (see +examle above). Longer fortunes should also be in left justified +paragraphs, but if this makes it too long, try indented paragraphs, +with indentations of either one tab stop or 5 chars. Indentations of +less than 5 are too hard to read. + +Laws have the title left justified and capitalized, followed by a +colon, with all the text of the law itself indented one tab stop, +initially capitalized, e.g., + + A Law of Computer Programming: + Make it possible for programmers to write in English and you + will find the programmers cannot write in English. + +Limericks are indented as follows, all lines capitalized: + + A computer, to print out a fact, + Will divide, multiply, and subtract. + But this output can be + No more than debris, + If the input was short of exact. + +Accents precede the letter they are over, e.g., "`^He" for e with a +grave accent. Underlining is done on a word-by-word basis, with the +underlines preceding the word, e.g., "__^H^Hhi ____^H^H^H^Hthere". + +No fortune should run beyond 72 characters on a single line without +good justification (er, no pun intended). And no right margin +justification, either. Sorry. + +Definitions are given with the word or phrase left justified, followed +by the part of speech (if appropriate) and a colon. The definition +starts indented by one tab stop, with subsequent lines left justified, +e.g., + + Afternoon, n.: + That part of the day we spend worrying about how we wasted the + morning. + +Quotes are sometimes put around statements which are funnier or make +more sense if they are understood as being spoken, rather than written, +communication, e.g, + + "All my friends and I are crazy. That's the only thing that keeps us + sane." + +Elipses are always surrounded by spaces, except when next to +puncuation, and are three dots, unless there is a good reason not to. +(In fact, all these rules can be broken if they make a good joke.) + + "... all the modern inconveniences ..." + -- Mark Twain + +Human initials always have spaces after the periods, e.g, "P. T. +Barnum", not "P.T. Barnum". However, "P.T.A.", not "P. T. A.". + +All fortunes should be attributed, but if and only if they are original +with somebody. Many people have said things that are folk sayings +(i.e., are common among the folk (i.e., us common slobs)). There is +nothing wrong with this, of course, but such statements should not be +attributed to individuals who did not invent them. + +Horoscopes should have the sign indented by one tab stop, followed by +the dates of the sign, with the text left justified below it, e.g., + + AQUARIUS (Jan 20 - Feb 18) + You have an inventive mind and are inclined to be progressive. You lie + a great deal. On the other hand, you are inclined to be careless and + impractical, causing you to make the same mistakes over and over + again. People think you are stupid. + +Single quotes should not be used except as quotes within quotes. Not +even single quotes masquerading as double quotes are to be used, e.g., +don't say ``hi there'' or `hi there' or 'hi there', but "hi there". +However, you *can* say "I said, `hi there'". + +A long poem or song can be ordered as follows in order to make it +fit on a screen (fortunes should be 19 lines or less if at all +possible): + + 11111111111111111111 + 11111111111111111111 + 11111111111111111111 22222222222222222222 + 11111111111111111111 22222222222222222222 + 22222222222222222222 + 33333333333333333333 22222222222222222222 + 33333333333333333333 + 33333333333333333333 44444444444444444444 + 33333333333333333333 44444444444444444444 + 44444444444444444444 + 44444444444444444444 + +Fortunes are split into potentially offensive and not potentially +offensive, into the files "obscene" and "scene", respectively. +Anything which would not make it onto network prime time programming +should *not* go into "scene". Also, anything which would only get on +if some discredited kind of guy said it should *not* go in scene. +Fortunes containing "shit", "fuck", "cock" (not the male version of a +chicken, obviously, but "penis"), "cunt", "pussy", and such like are +*obscene*. Political opinions are supposed to be in "obscene", too. +Antyhing which is blatantly racist, mysoginist, or homophobic, should +not be in either, since they are not really funny unless *you* are +racist, mysoginist, or homophobic. diff --git a/games/fortune/obscene b/games/fortune/obscene new file mode 100644 index 0000000..0e59fd6 --- /dev/null +++ b/games/fortune/obscene @@ -0,0 +1,10500 @@ +... which the Minstrel was supposed by some authorities to have composed +beneath the gibbet at Elsdon on the occasion of his hanging, drawing and +quartering for misguidedly climbing into bed with Sir Oswald Capheughton's +wife, Lady Fleur, when that noble lord was not only in it, but in her at +the same time. Minstrel Flawse's introduction of himself into Sir Oswald +had met with that reaction known as dog-knotting on the part of all +concerned... +I gan noo wha ma organs gan +When oft I lay abed I should ha' known 'twas never Fleur +So rither hang me upside doon That smelt so mooch of sweat +Than by ma empty head. For she was iver sweet and pure + And iver her purse was wet. +But old Sir Oswald allus stank +Of horse and hound and dung So hang me noo fra' Elsdon tree +And when I chose to breech his rank And draw ma innards out +Was barrel to my bung. That all the wald around may see + What I have done without. +But ere ye come to draw ma heart +Na do it all so quick So prick 'em wet or prick 'em dry +But prise the arse of Oswald 'part 'Tis all the same to me +And bring me back ma prick. I canna wait for him to die + Afore I have a pee. + -- Tom Sharpe, "The Ballad of Prick 'Em Dry" +%% +6802 hackers make great use of the SEX instruction. +%% +68: + Do me now and I'll owe you one. +%% +69 + 69 = dinner for 4. +%% +A '49er walked into the saloon at Bloody Gulch. He'd been prospecting for +more than a year. + "Hey! Y'got any wimmen around here?" + "Nope," the bartender replied, "But there's George in the back room." + "I don't go for that kind of thing," the prospector scowled. He +downed his drink and left disgustedly. +A few months passed before the miner found his way down the mountain again. +He stumbled into the tavern and asked the bartender, "Any wimmen pass through +this part of town?" + "Nope. Nary a one. But we still got George in the back room." + Angry, the miner shouted, "I told you I don't go for that kind of +thing," and turned on his heel and left. + Within a year he came back from his mine again. With a wild look on +his face he re-entered the saloon. Leaning over the bar he whispered to the +bartender, "If I was to go into the back room with George, how many people +'round here would know?" + "Oh," the bartender said, scratching his chin, "'bout seven, I guess." + "Seven!?" + "Yep. You, me, George, and the four men holdin' him down. You see, +George don't go for that kind of thing neither." +%% +A 6'8", 280-pound Southerner walked into a NY bar, sat down next to a +patron, and said, "Ah'm big, and ah'm bad, and I *loves* to fuck Northern +women!" The guy was so terrified that he put down his beer and ran out +of the bar. + The Rebel moved over to the next guy and said, "Ah'm big and ah'm +bad and I *loves* to fuck New York women." The guy took one look at him, +blanched and ran out of the bar. + The man then went over to a short little guy with "Bronx" written +all over him. "Ah'm big and ah'm bad and I *loves* to fuck your sister." + The short guy looked him up and down and said, "I don't blame +you one bit. She's *got* to be an improvement on yours." +%% + A Mexican and a Texan worked together for a construction firm, and, +while they were good friends, they had a friendly rivalry over whose wife +was the better cook. One weekend, as the Texan's wife was out of town, the +Mexican invited the Texan to have supper with his family. + The Texan accepted, and that evening sat down to some the best stew +that he had ever eaten. + "Damn! That stew is fantastic!" he exclaimed to his host. "What +kind of meat is it?" + "Rabbeet stew," replied the Mexican. + "Rabbit?" replied the Texan. "There aren't any rabbits around here." + "Si, my freend, the rabbeets make the beeg noise, and I shoot theem." + "Rabbits don't make any noise..." + "Si, my freend, they say meeyow, meeyow!" +%% +A New Yorker is riding down the road in his new Mercedes. So intent is he +on the cocaine in his hand he completely misses a turn and his car plunges +over the five-hundred-foot cliff to be smashed into pieces at the bottom. +As the on-lookers rush to the edge of the cliff they see him fifty feet +from the top of the cliff clinging to a stunted bush with all his strength. +"Dear Lord," he prays, "I never asked you for nothin' before, but I'm askin' +you now: Save me, Lord, save me." + Booms the Lord: "LET GO OF THE BRANCH." + "But Lord, if I do that, I'll fall!" + "TRUST ME, LET GO OF THE BRANCH." + "But Lord, I'm gonna fall and die..." + "TRUST ME TO SAVE YOU. LET GO OF THE BRANCH." + Okay, Lord, I'll trust you, here I... here I go!" And he falls +to his death. + "DUMB YANKEE." +%% +A New Yorker was driving through Berkeley when he saw a big crowd gathered +by the side of the street. Curiousity got the better of him and he leaned +out of his window to ask an onlooker what was going on. The fellow explained +that a protestor against the U.S. position in South America had doused +himself with gasoline and set himself on fire. "That's terrible," gasped +the man. "But why is everyone still standing around?" + "Well, they're taking up a collection for his wife and kids," the +onlooker explained. "Would you be willing to help?" + "Well, sure," said the New Yorker. "I suppose I could spare a gallon +or two." +%% +A Norse god decides to assume human form, come down from Valhalla, and check +out the local action. He finds himself in the piano bar of Caesar's Boardwalk +Regency in Atlantic City, and sits down to sip an Acquavit or two. After a few +minutes, an extremely attractive young woman, having been taken with his form +and features, sends a drink down to him, then joins him. The chemistry between +them is immediate and total. They have the next drink in her room, and spend +the night repeatedly making passionate love. The woman has no idea of her +partner's true identity; all she knows is he's driving her mad. In the +morning, the Norse god jumps into the shower. Reflecting on the previous +night he decides that he wants to be honest with his lover. Without even +bothering to wrap himself in a towel, he leaps from the shower into the room, +where the woman is still in bed, exhausted. He kneels beside the bed, looks +deep into her eyes and says, "Honey, I have something very important to tell +you -- I'm Thor!". + The woman looks at him. "You're Thor?", she says. "My inthides feel +like grated cheeth!" +%% +A bar patron returned from the men's room grumbling to himself. + "What's the trouble, buddy?" the bartender inquired. + "You got John Wayne toilet paper in there!" + "What do you mean?" the barkeeper asked. + "It's rough, it's tough, and it doesn't take shit from nobody." +%% +A beachcomber of 25 had been shipwrecked on a desert island since the age of +six. One day, while in search of food, he stumbled across a beautifully +sensuous female lying on the beach nearly naked; she'd been washed ashore from +another shipwreck that morning. After they got over their initial surprise +at seeing each other, the girl wanted to know how long he had been alone on +this barren bit of land. + "Almost twenty years," he answered. + "Twenty years!" she exclaimed. "But how ever did you survive?" + "Oh, I fish, dig for clams, and gather berries and coconuts," he +replied. + "And what do you do for sex?" she asked. + "What's that?" He looked puzzled. + Whereupon the maiden pulled the innocent young man down onto the sand +beside her and proceeded to demonstrate. After they had finished, she asked +how he had enjoyed it. + "Great!" was the reply. "But look what it did to my clamdigger!" +%% +A big store buyer had been on the road for nearly two months. Each week he +would send his wife a telegram saying, + "Can't come home yet. Still buying." +His wife knew that these buying trips usually involved more than business. +She tolerated this particular jaunt for a while, but when the third month +rolled by and she'd still seen nothing of her husband but the weekly telegrams, +she wired him, + "Better come home. I'm selling what you're buying." +%% +A bisexual is a man who likes girls as well as the next fellow. +%% +A businessman was awe-struck by the beautiful redhead at the hotel bar. +Seeing his interest, she quietly informed him that she was a prostitute +and that her price was $500. He was taken aback by the price, but after +a few minutes of thought he took her up to his room. She spent a few +minutes in the bathroom and was shocked when she came out to see him +masturbating furiously on the bed. "What are you doing?", she asked. + "Baby, for $500, you're not going to get the easy one!" +%% +A chiseler is a man who goes stag to a wife-swapping party. +%% +A clitoris is a lot like Antarctica; +most men know it's there, but few really care. +%% +A couple took their young son for his first visit to the circus, and by +chance their seats were next to the elephant pen. When his father left +to buy popcorn, the boy piped up, + "Mom, what's that long thing on the elephant?" + "That's the elephant's trunk, dear," she replied. + "No, not that." + "Oh, that's the elephant's tail." + "No, Mom. Down underneath." + His mother blushed and said, "Oh, that's nothing." + Pretty soon the father returned, and the mother went off to get +a soda. As soon as she had left the boy repeated his question. + "That's the elephant's trunk, son." + "Dad, I know what an elephant's trunk is. The thing at the +other end." + "Oh, that's the elephant's tail." + "No. Down there." + The father took a good look and explained, "That's the elephant's +penis." + "Dad, how come when I asked Mom, she said it was nothing?" + The man took a deep breath and replied, "Son, I've *spoiled* +that woman." +%% +A fisherman from Maine went to Alabama on his vacation. He rented a boat, +rowed out to the middle of the lake, and cast his line, but when he looked +down into the water he was horrified to see a man wrapped in chains lying +on the bottom of the lake. He quickly rowed to shore and ran to the police +station. "Sheriff, sheriff," he gasped, there's a guy wrapped in chains, +drowned in the lake!" + "Now ain't that jest like a Yankee," drawled the sheriff, "to steal +more chain than he can swim with?" +%% +A fool is a man who worries about whether or not his lover has integrity. +A wise man, on the other hand, busies himself with deeper attributes. +%% +A friend of mine received a note through the mail advising him, + "If you don't stop making love to my wife, I'll kill you." +The trouble is, the note wasn't signed. +%% +A gambler was telling a friend about his first junket to Las Vegas and how +hard it was to get any sleep. + "I was awakened at one, two and four in the morning by a +drunken chorus girl banging on the door and screaming," he recalled. + "That's terrible," the friend said." How'd you ever get any sleep?" + "At five o'clock I unlocked the door and let her out." +%% +A genius is a queer who can whistle while he works. + -- Bobby Knight +%% +A girl's conscience doesn't really keep her from doing anything wrong-- +it merely keeps her from enjoying it. +%% +A grade school teacher, who was doing a unit on World War II heard that +the father of one of her students had been a fighter pilot during the war +with one of the Scandinavian Air Forces. She invited him to come in and +speak to the class. The guy was more than happy to talk, and began with +a story about a morning patrol where he had been nearly shot down. + "We had been up for about 20 minutes flying over enemy held +territory, when we noticed, just in time, 3 fokkers diving on us from above." +At the first mention of `fokkers' the class giggled a little bit. + "Our group broke formation, and began the dog-fighting. As we +fought, we noticed 2 more fokkers coming at us from above and 2 more +fokkers, fresh from the landing field, come to join the battle". +At this second and third mention of `fokkers' the class was almost laughing +openly, and the teacher interrupted the story to ask the pilot to explain +to the class that a 'fokker' was a particular type of plane flown by the +German Air Force. + He replied, "Ya, dat is true, but these fokkers were Messerschmidts". +%% +A guy comes into a bar with a frog and sets it down next to the prettiest +girl there. + "This is a very special frog," he informs her. "His name is Charlie." + "What's so special about this frog?" she asks. +He's reluctant to tell her, but when pressed, explains that, + "This frog can eat pussy." +The girl slaps him, knocking him off his chair, and accuses him of telling her +a filthy lie. But no, he assures her, it's completely true. And after much +discussion, she agrees to come back to his apartment to see the frog in action. +She positions herself appropriately, the guy carefully takes out the frog, and +says, "Okay, Charlie, do your stuff!" The frog is immobile, despite his +owner's exhortations, and the girl starts to snicker. + "Okay, Charlie, do your stuff!" + "C'mon Charlie, do your stuff!" +By now, the girl is laughing openly. + "Okay, Charlie," says the guy, moving the frog out of the way, "I'm +only going to show you one more time." +%% +A hard man is good to find. +%% +A hunter saved a native boy from a boa constrictor. In gratitude, the boy gave +the hunter a magic gorilla prick. The lad said the prick would do anything you +told it to do until you told it to do something else. When the hunter returned +home to England, he put the magic gorilla prick on the mantle along with some +of his other trophies. His wife thought it quaint and his story charming. But +soon, the hunter went a-safariing again. He was away for months. One evening, +the woman eyed the MGP carefully and whispered, "Gorilla Prick, fuck me." +Whereupon the thing jumped off the mantle and began to bang her with great +thoroughness and ferocity. For the first twenty minutes it was pure heaven, +but after the next few minutes it became fatiguing, and she said, "Stop it, +Gorilla Prick," but it didn't. After a bit more she was screaming "Stop! +Stop!" at the thing and trying to pull it out of her smoking hole. But nothing +worked. Finally, the butler bursts into the room, summoned by her screams. + "Saunders, help me please!" + "But what is it, Madame?" + "It's a Magic Gorilla Prick!" + "Gorilla prick, my ass!! ... AAAaaeeeeeeeeeiiiiiiiii!!!!!!" +%% +A husky foreigner, looking for sex, accepted a prostitute's terms. When +she undressed, he noticed that she had no pubic hair. The man shouted, +"What, no wool? In my country all women have wool down there." + The prostitute snapped back, "What do you want to do, knit or fuck?" +%% +A lanky Texan was mad because Texas had just become the second largest state in +the Union, so he made up his mind to move to Alaska. He drove for three days +and three nights to get there and finally he came to what looked like the state +line. He halted his car and walked up to the border guard. "Hi, there! How +do I become a resident of this here biggest state?" demanded the Texan. + The guard looked him up and down and grinned. "Waal," he answered, +there are three things you gotta do to get in. First, drink down a quart of +110 proof corn liquor without blinkin'. Second, kill a grizzly bear, and +third, make love to an Eskimo woman." + "Sounds easy enough," said the Texan. "Where can I get a quart of +this here corn liquor?" + "Got one right here," replied the guard. + The Texan gulped down the whiskey without batting an eyelash. +"Now, do you happen to know where I can find me a grizzly?" + "Yep," answered the guard, "there's a big b'ar over that way, 'bout +a mile... lives in a cave on that cliff." + The Texan lurched merrily off. About an hour later he returned +with his clothes almost torn off and his face scratched and bloody. He was +smiling happily. "Now," he roared, "where's that damn Eskimo woman you +want killed?" +%% +A lisping fag fell off a pleasure yacht and began to scream. "Help! Help, I +can't thwim!" One of the other passengers heard the caterwauling and leaned +over the rail, remarking, "Really, there's no need to scream. Just reach out +and grab that buoy near you." To which the floundering sodomite answered, +"Buoy! Oh, thith ith no time for thekth, you degenerate... I'm dwowning!" +%% +A man and a woman got married. Although it is the first time for the +husband, it is the woman's second marriage. As they go to bed on their +wedding night, the wife says to her husband: + + "Dear, there's something I must tell you. I'm a virgin." +Naturally, the husband is surprised. + "You've been married before!", he says, "How can you still be a +virgin?" + "Well, it's all quite simple," she retorted, "my husband was a +computer programmer." + "What's so odd about that?", he asked. "Why would you still be +a virgin after a marriage to a programmer?" + "Well", she said, "all he did was sit on the edge of the bed and +tell me how great it was going to be." +%% +A man is marooned on a desert island with a female sheep and a male Doberman +for companionship. The animals soon get it on sexually, and all goes well +until the man becomes unbearably horny and makes his move for the ewe, at +which point the dog interposes himself, snarling, fangs bared. Months later, +a raft drifts into sight. The sailor swims out, finds a beautiful girl on it, +takes her to shore and feeds and comforts her. + "You are so good to me," she responds gratefully. "I'd do absolutely +anything to show my gratitude." + "Would you?" smiles the sailor as he unfastens the length of rope +that holds up his ragged pants. "Well, then, here -- use this as a leash +and take that damn dog for a walk!" +%% +A man needs a mistress, just to break the monogamy. +%% +A man never minds being in the doghouse +as long as he can get his tail outside. +%% +A man rushed into a bar and breathlessly asked the bartender to pour him +three straight scotches. The bartender complied, and watched as he downed +them one after another. + "Why three scotches?" the bartender asked as he paused for breath. + "Well, to be honest, I'm celebrating my first blow-job." + "Hell, congratulations, the next one's on me." + "No thanks," the young man replied, "if the first three didn't get +the taste out of my mouth, I don't think another one will." +%% +A man sat down next to another passenger on a train recently and couldn't +help overhearing his conversation out the window with a man standing on +the train platform. + "Thanks for putting me up while I was here, Sam," said the passenger. + "Glad to do it," said the other man. + "Thanks for the food and the drinks -- everything was wonderful." + "It was a pleasure," said the man. + "And thank your wife, Sam, she was great," said the passenger, +"she was a truly great lay." + The man was rather taken aback by this exchange and he later turned +to his fellow passenger and said: "Pardon me sir, but did I understand you +to say that your friend's wife was a great lay?" + "Well," said the other passenger, "I didn't REALLY enjoy it. But +Sam is a helluva nice guy." +%% + A man walks into a bar and says: "I'd like a shot of twelve-year-old +Scotch". The bartender, who figures the guy is just being obnoxious, reaches +down under the bar and pours him a shot of bar Scotch. The man takes one sip +and says: "Hey, bartender, I asked you for some twelve-year-old Scotch -- this +is eight-year-old Scotch." + The bartender reaches behind the bar for the twelve-year-old Scotch, +pours a shot, hands it to the man and says "I've got to hand it to you -- +most guys who come in here asking for twelve-year-old Scotch have never even +had it -- they're just being pricks. But you really know your Scotch -- this +is on the house." + A drunk has been sitting at the other end of the bar watching this +conversation. He walks up to the man, hands him a glass and says "Taste this." +The man does -- and spits it out yelling, "This tastes like piss!" To which +the drunk replies, "It is -- but how old am I?" +%% +A man was playing golf one day when a little frog hopped out the water at a +water hazard and croaked, "I am a magic frog, and since you are the 10,000th +person to play through here, I'm prepared to offer you one of two magic gifts: +First, for a whole year you can have the most fabulous sex life that anyone +ever had; beyond your wildest dreams. Or, second, for a whole year you can +be the best golfer the world has ever known. Which do you prefer?" The man +thought a bit and said that he'd take the golf. Well, the man holed his wood +shot from where he was, completed the course in an average of 2 per hole, and +went round in 22. Quickly he attracted the attention of the sports world, +and became the world's best-known golfer, setting course records wherever +he went. A year later he was playing the same course inhabited by the frog, +and at the water hazard the frog hopped out and said, "Well, the year is up, +and you now revert to the 18-handicap player you were before. But tell me, I +was a little surprised that you chose the golf -- I take it your sex life is +outstanding?" The man said, "Well, I have no complaints in that department +at all, which is why I chose the golf." "How many times did you engage in sex +last year?" inquired the frog. The man thought a little and said, "Oh, eight +or ten times, I guess." "Damn," said the frog, "that doesn't strike me as very +satisfactory." "Oh, I don't know," replied the man, "for a Catholic priest in +a little town in South Dakota it doesn't seem so bad." +%% + A man was traveling cross-country one summer from New York to LA. +He arrived in Needles CA late one night and pulled into an Exxon for some +gas. When he pulled up to the gas pumps, he noticed that all of the lights +were off. Suddenly, he heard a faint sound from outside. He wasn't sure +what he'd heard, so he rolled down his window and heard a faint cry, +"Help... help... help". He got out of his car, and sure enough there was +a guy stooped down in the corner, stark naked with his wrists tied to his +ankles. He walked up to the guy and said, "Hey, man, what happened to you?" + "These guys pulled me out of my car, took my money, my wallet, my +clothes, tied my wrists to my ankles, and then stole my car!!" + "Damn!", replied the first man as he unzipped his pants. "This just +hasn't been your day, has it?" +%% + A man went to a doctor to have his penis enlarged. Well, this +particular procedure involved splicing a baby elephant's trunk onto the +man's penis. Overjoyed, the man went out with his best girl to a very +fancy restaurant. After cocktails, the man's penis crept out of his pants, +felt around the table, grabbed a hard roll and quickly disappeared under +the tablecloth. The girl was startled and exclaimed, "What was that?" + Suddenly the penis came back, took another hard roll and just as +quickly disappeared. The girl was silent for a moment, then finally said, +"I don't believe I saw what I think I just saw... can you do that again?" + With a bit of an uncomfortable smile the man replied, "Honey, I'd +like to, but I don't think my ass can take another hard roll!" +%% +A man without a God is like a fish without a bicycle. +%% +A midget had a date with a very tall girl. It was a quiff-hanger. +%% + A mother and her daughter came to the doctor's office. The mother +asked the doctor to examine her daughter. "She has been having some strange +symptoms and I'm worried about her," the mother said. + The doctor examined the daughter carefully. Then he announced, +"Madam, I believe your daughter is pregnant." + The mother gasped. "That's nonsense!" she said. "Why, my little +girl has never even been out with a man, let alone... let alone..." She +turns to the girl and said, "Tell the doctor, Susie!" + "Yes, Mumsy," said the girl. "Doctor, I have never so much as +kissed a man!" + The doctor looked from the mother to daughter, and back again. Then, +silently he stood up and walked to the window. He stared out. He continued +staring until the mother felt compelled to ask, "Doctor, is there something +wrong out there?" + "No, Madam," said the doctor. "It's just that the last time anything +like this happened, a star appeared in the East and I was looking to see if +another one was going to show up." +%% +A mouse was sniffing around in a meadow, when an eagle swooped down, +swallowed him whole, and rose up in the air again. The mouse worked +his way through until his head was sticking out of the bird's asshole. + "Say, good buddy," he squeaked, "how high up are we, anyway?" + "Oh, about two thousand feet," answered the eagle. + The mouse's eyes bugged out. "Hey, you wouldn't shit me, would you?" +%% +A new lumberjack had just finished his first month in the lonely wilds of +Alaska, where there were no women for miles. He finally couldn't take it +anymore and nervously asked the foreman what the other men did to relieve +the pressure. + "Try the hole in the barrel outside the shower," suggested the +foreman. "The other men swear by it." + The lumberjack dubiously tried it out and had the experience of +his life. "That barrel is fantastic! Warm! Wet! I'm going to use it +every day!" + "Every day but the third Wednesday of the month," one of the +other men replied. + "Why not then?" + "That's your day in the barrel." +%% +A non-vegetarian anti-abortionist is a contradiction in terms. + -- Phyllis Schlafly +%% +A nymph hits you and steals your virginity. +%% +A pair of suburban couples who had known each other for quite some time +talked it over and decided to do a little conjugal swapping. The trade +was made the following evening and the newly arranged couples retired to +their respective houses. After about an hour of bedroom bliss, one of +the wives propped herself up on an elbow, looked at her new partner and +said: "Well, I wonder how the boys are getting along?" +%% +A pederastic necrophiliac is a gentleman who is +true to the very end of the end of a friend. +%% +A performing octopus could play the piano, the zither and a piccolo, and his +trainer wanted him to add the bagpipe to his accomplishments. With this in +mind, a bagpipe was placed in the octopus's room, and the trainer awaited +results. Hours passed, but no bagpipe music was heard. Since the talented +octopus usually learned quickly, the trainer was disturbed. Opening the door +the next morning, he asked the octopus, + "Have you learned to play that thing yet?" + "Play it!" retorted the octopus. "I've been trying to lay it all +night!" +%% +A person who has both feet planted firmly +in the air can be safely called a liberal. +%% +A proctologist is a doctor who puts in a hard day at the orifice. +%% + A proper elderly English couple visiting Australia decided to hire a +car to take a look at the outback. "We know it's rough country, but it's safe +and decent, isn't it?" the husband inquired of the rental-agency manager. +Upon being assured that it was, the couple drove off. + Later that day, they returned, upset and angry. "You said it was +decent country," the Englishwoman upbraided the rental agent, "but we hadn't +driven too far when we saw a man in a field copulating with a kangaroo!" + "And not too long after that," complained her husband, "a one-legged +aborigine leaning against a tree by the side of the road grinningly waved +at us with one hand while he brazenly masturbated himself with the other!" + "Guv'nor," responded the Aussie, "yer wouldn't expect a poor bugger +like that, with only one leg, to catch a 'roo, would you?" +%% +A retired schoolteacher finally decided that she was tired of living alone +and wanted some companionship, so after a good deal of thought she decided +to visit the local pet shop. The owner suggested a parrot, with which she +could conduct a civilized conversation. This seemed to be an excellent +idea, so she bought a handsome parrot, sat him on a perch in her living room, +and said, "Say 'Pretty boy.'" Silence from the bird. "Come on now, say +'Pretty boy ... pretty boy.'" + At long last, disgustedly, the bird said, "Oh, shit." + Shocked, the schoolteacher said, "Just for that, you get five minutes +in the refrigerator." Five minutes later she put the shivering bird back on +its perch and said, "Now let's hear it: 'Pretty boy ... pretty boy.'" + "Damn it, wouldja lay off, lady?" said the parrot. + Outraged, the woman grabbed the bird, said, "That's it! Ten minutes +in the freezer," and slammed the door on him. + Hopping about to keep warm, what does the parrot come across but a +big frozen turkey waiting for Thanksgiving. Startled, he squawks, "My God, +you must have told the bitch to go fuck herself!" +%% +A sheriff arrived at the scene of the horrible accident just as his deputy, +all alone, was climbing down from the controls of a bulldozer. "Say, +Junior, what's goin' on?" asked the sheriff. + "A bus full of migrant workers went out of control and over the +cliff, and I just finished buryin' 'em," explained the deputy. + "Good work, boy," replied the sheriff. "Pretty gory work -- were +all of 'em dead?" + Junior nodded sadly and said, "Some of them said they weren't, but +you know how them Mex'cans lie." +%% +A shy young man, preparing himself for what he hoped would be the ultimate sex +act with a pretty young lady, went into a drugstore to inquire about sizes and +styles of condoms. The lusty proprietress, a buxom widow, saw an opportunity +for fun at the lad's expense. + "Come in the back and try some on for size," she said, taking his hand. +The widow unzipped the youth's fly and watched the small instrument grow in +her hand as she measured it. When the weapon had unfurled to a rosy seven and +a half inches, the young man, unable to contain himself, had an orgasm with a +tremendous discharge. After recovering, he asked the widow if she could now +give him the proper size. + "I'll do more than that," she said. "I'll give you free meals and a +half interest in the store." +%% +A spinster in Kalamazoo +Once strolled after dark by the zoo. + She was seized by the nape, + And fucked by an ape, +And she murmured, "A wonderful screw." + +And she added, "You're rough, yes, and hairy, +But I hope -- yes I do -- that I marry + A man with a prick + Half as stiff and as thick +As the kind that you zoo-keepers carry." +%% +A stately-looking matron was walking through the Bronx Zoo, studying the +animals. When she passed the porcupine enclosure she beckoned to a nearby +attendant. + "Young man," she began, "do North American porcupines have sharper +pricks than those raised in Africa?" + The attendant hesitated for a moment. "Well, ma'am," he answered, +"the African porcupine's quills are sharper... but I think their pricks are +about the same." +%% +A sweet young schoolteacher who had always been virtuous was invited to go +for a ride in the country with the gym instructor, whom she admired. Under +a tree on the bank of a quiet lake, she struggled with her conscience and +with the gym instructor and finally gave in to the latter. Sobbing +uncontrollably she asked her seducer, + "How can I ever face my students again, knowing I have sinned twice?" + "Twice?" asked the young man, confused. + "Why, yes," said the sweet teacher, wiping a tear from her eye. +"You're going to do it again, aren't you?" +%% +A toast to the kisses you've snatched and vice-versa. +%% +A virgin is chaste. +%% +A virginal is a harpsichord that has never been plucked. +%% +A virtuous abstinence from the joys of pederasty +comes most easily to those who have no taste for it. + -- Oscar Wilde +%% +A witty writer, K. Kraus in the Vienna "Fackel", has as it were, +expressed this truth paradoxically in the cynical saying: +"Coitus is merely an unsatisfactory substitute for onanism!" + -- Sigmund Freud, attempting to explain why + masturbation is "by no means harmless" +%% +A woman is like a dresser... some man always goin' through her drawers. + -- Blind Lemon Pledge +%% +A young New York housewife was shocked by some of the language used by her +daughter. When asked about it, the daughter said she had learned it from +a small girl she played with in the park. The next day, the mother sought +out the little girl as she played in the park. "Are you the little girl +who uses bad words?" + "Who told you?" + "A little bird," answered the mother. + "Well, I like that!" exclaimed the small girl. "And I've been +feeding the little bastards, too!" +%% + A young couple jumped out of their car and dashed into the park. +They hurriedly found a secluded spot and began to make frenzied, passionate +love. Shortly thereafter, as they were driving away, the young man turned +to her and said, "If I had known you were a virgin, I'd have taken more time." + She replied, "If I had known you had more time, I'd have taken off +my pantyhose." +%% +A young lady friend of mine just swallowed a razor blade... +She performed a tonsillectomy, an appendectomy, a hysterectomy, +three circumcisions, and cut off the finger of a casual friend. +%% + A young man asked his father to lend him $50 for a blowjob, +whereupon his father solemnly replied, "When I was young we used to +settle for a kiss." + The son retorted, "OK, how about $50 for a long low kiss?" +%% +ADULTERY: + Putting yourself in someone else's position. +%% +AI hackers do it robotically. +%% +AI hackers do it with robots. +%% +AMBITION: + An ant crawling up an elephant's leg with rape on his mind. +%% +ANXIETY: + The first time you can't do it a second time. +PANIC: + The second time you can't do it the first time. +%% +APL hackers take all they want. +%% +ARKANSAS: + Where the men are men, so are the women and the sheep run scared. +%% +Aboard the good ship Venus, The cabin boy, the captain's joy, +The mast it was a penis, A cunning little nipper, + Her figurehead They filled his ass, + A whore in bed, With broken glass, +Good grief you should have seen us! And circumcized the skipper. + +The first mate's name was Higgins, The captain's daughter Mabel, +And Higgins was a biggins, They screwed when they were able, + Once round the deck, They nailed her tits, + Twice up the mast, Those nasty shits, +And the rest was used for riggins'! Right to the captain's table. + +The engineer's name was Carter, The second mate's name was Andy, +And Carter was a farter, By God, he was a dandy, + When the wind wouldn't blow, They broke his cock, + And the ship couldn't go, With chunks of rock, +Carter the farter would start her! For conking in the brandy! +%% +Achilles' Biological Findings: + (1) If a child looks like his father, that's heredity. + If he looks like a neighbor, that's environment. + (2) A lot of time has been wasted arguing over what came first + -- the chicken or the egg. It was undoubtedly the rooster. +%% +Admittedly, there are a lot of things that are better than sex, +and a lot more that are worse; but there's nothing quite like it... +%% +After an evening at the theatre and several nightcaps at an intimate little +bistro, the young man whispered to his date, "How do you feel about making +love to men?" + "That's MY business," she snapped. + "Ah," he said. "A professional." +%% +After cocktails in the Oak Room, the graying millionaire took the blond, +attractive, wholesome, winning young woman up to his suite. They chatted +for a while, and then kissed on the couch. A little fondling, some feeling +and petting ... to which the young lady lent herself shyly ... and then they +were in the wide, cool bed, naked together. They chatted more, established +a communion, a rapport the older man considered remarkably gratifying. The +girl seemed sympatico, innocent, good. + "Yes, that was it," he thought, "essentially good. Why, she could +be my own daughter." He smiled into the young girl's deep blue eyes. + "Tell me," he asked, his hand on her breast, "What's a nice girl +like you doing in a hotel like this?" + "Oh, about $2000 a week, with tips." +%% +After rushing into a drugstore, the nervous young man was obviously +embarrassed when a prim thirty-ish woman asked if she could serve him. + "N-no," he stammered, "I'd like to see the druggist." + "I'm the druggist", she replied cheerfully. + "Oh.. well, uh, it's nothing important," he said, and turned to leave. + "Young man," said the woman, "my sister and I have been running this +drugstore for nearly ten years. There is nothing you can tell us that will +embarrass us. + "Well, all right," he said. "I have this awful sexual hunger that +nothing will appease. No matter how many times I make love, I still want to +make love again and again. Is there anything you can give me for it?" + "Just a moment," said the woman, "I'll have to discuss this with my +sister." + A few minutes later, she returned. "The best we can do," she said, +"is room and board and a half-interest in the business." +%% +After spending a forbidden night on the town, two young nuns were trying +to sneak through the fence surrounding their Convent. + "You know," giggled one as she held the wire apart for the other +to crawl through, "I feel like a Marine." + "So do I," the other nun sighed, "but where are we going to +find one at three in the morning?" +%% +Alex came home from a business trip to Chicago and found no one home but his +daughter Rose, who was crying bitterly. + "What's the matter, darling?" asked Alex. + "Mommy almost died last night," sobbed Rose. + "That's nonsense," said the father. "Why do you say that?" + "Well," said Rose,"you always told us that when we die we'll see God; +so when I heard Mommy moaning last night I rushed to her bedroom and she was +screaming, "Oh God, here I come," and she would have but Uncle Jerry held her +down." +%% +"Algorithms" is an anagram for "Hilt orgasm". Maybe this explains +the popularity of this field of study in computer science. +%% +All I really want in life is a piece and some quiet. +%% +All a hacker needs is a tight PUSHJ, +a loose pair of UUOs, and a warm place to shift. +%% +All things dull and ugly, Each little snake that poisons, +All creatures short and squat, Each little wasp that stings, +All things rude and nasty, He made their brutish venom, +The Lord God made the lot; He made their horrid wings. + +All things sick and cancerous, Each nasty little hornet, +All evil great and small, Each beastly little squid. +All things foul and dangerous, Who made the spikey urchin? +The Lord God made them all. Who made the sharks? He did. + +All things scabbed and ulcerous, +All pox both great and small. +Putrid, foul and gangrenous, +The Lord God made them all. + -- Monty Python +%% +Always talk to your wife while you're +making love... if there's a phone handy. +%% +America cannot be sold a can of beer without +being offered a piece of pussy along with it. + -- Julius Lester +%% +An 11 is a 10 who doesn't have headaches. +%% + An Aggie was appointed ambassador to Japan. Two weeks before +officially reporting to the embassy, he went from geisha house to geisha +house. While making love to a geisha girl, he heard her repeat, "Yaki-san, +yaki-san." + Right away the Aggie thought to himself, "I've learned my first +Japanese word. It must be an expression of joy." + When he reported to the embassy, he received his first assignment, +which was to escort the prime minister of Japan around the golf course. +After having played a couple of holes, the prime minister teed-off and made +a hole-in-one. The prime minister jumped up and down shouting, "Bonsai! +Bonsai!" + Quickly, thinking that this was the perfect chance to show off the +new Japanese word that he'd learned, the Aggie exclaimed, "Yaki-san, +yaki-san!" + The prime minister turned to the Aggie and exclaimed, "What do you +mean, wrong hole?" +%% + An American tourist went into a restaurant in a Spanish provincial +city and asked to be served the specialty of the house. When the dish +arrived he asked what kind of meat it contained. "These, senor," explained +the waiter in halting English, "are the cojones -- the, what you say, the +testicles -- of the bull killed in the ring today. + The tourist gulped but tasted the dish and found it delicious. +Returning the following evening, he asked for the same dish. When it was +served, he commented to the waiter, "But these -- these cojones -- are +much smaller than the ones I had yesterday." + "True, senor, but the bull -- he does not ALWAYS lose." +%% +An Army travels on her stomach. +%% + An Israeli soldier was checking travelers' papers on a road, when a +man and a heavily pregnant woman on a donkey came by. "Your names please?" +said the the soldier. + "My name is Mary," said the woman. + "And mine is Joseph," said the man. + "Oh," said the soldier, a little taken aback, "And where are you +going?" + "To Bethlehem." + "Your reason for going there?" + "To pay our taxes to the government." + "Tell me," said the soldier, "are you going to name the baby Jesus?" + "Of course not," said the woman, "What do you think we are, Puerto +Ricans?" +%% + An old maid wanted to travel by bus to the pet cemetery with the +remains of her cat. As she boarded the bus, she whispered to the driver, +"I have a dead pussy." + The driver pointed to the woman in the seat behind him and said, +"Sit with my wife. You two have a lot in common." +%% +And the northern lights commenced to glow. +And she said, with a tear in her eye, +"Watch out where the huskies go, and don't you eat that yellow snow." + -- Frank Zappa, "The Story of Nanook and the Fur Trapper" +%% +"And what do you two think you are doing?!" roared the husband, as he came +upon his wife in bed with another man. The wife turned and smiled at her +companion. + "See?" she said. "I told you he was stupid!" +%% +Another stupid gay joke!!! + You see, this gay man walks into a Texas bar and orders a strawberry +daquiri. The bartender looks him over with amusement and says: "We don't +serve your kind, buddy, why don't you get out of here before the boys come +in and kick your ass?" + The guy whimpers a little and lisps, "Pleasse misssture I am soooo +thurstay...." + Well, the bartender feels somewhat sorry for him and hands him a beer +on the house on the condition that he drink it in the back and leave as soon +as he's done. A little while later, a hulking cowboy walks in and up to the +bar. He slams his fist on the bar and hollers, "I'm so thirsty, I could +lick the sweat off of a bulls' balls!" + From the back of the bar comes the cry... "Moo, moo, buckaroooooo!!!" +%% +Another nun joke!!! + You see, three nuns were walking down the street, when suddenly +this flasher jumped out in front of them and opened his trench coat, +exposing his all to the sisters. Well, two of the nuns had strokes right +there, but the third nun wouldn't touch it. +%% +Any girl who believes that the way to a man's heart is through +his stomach is obviously setting her standards too high. +%% + "Anything else, sir?" asked the attentive bellhop, trying his best +to make the lady and gentleman comfortable in their penthouse suite in the +posh hotel. + "No. No, thank you," replied the gentleman. + "Anything for your wife, sir?" the bellhop asked. + "Why, yes, young man," said the gentleman. "Would you bring me +a postcard?" +%% +Apple owners do it with mice! +%% +As for Carter being for registration but against the draft, isn't that +sort of being like for putting it in and not taking it out? Even if it +was possible not to follow through, you'd still be getting screwed. +%% +As long as your ass is pointed at the ground, don't fuck with me. +%% +As near as I can tell, you're not any crazier +than the average asshole on the street. + -- R.P. McMurphy, "One Flew Over the Cuckoo's Nest" +%% +Ass, grass or gas... nobody rides for free! +%% +At her annual checkup, the attractive young woman is told by the doctor that +it's necessary to take her temperature rectally. She agrees and bends over +the examining table, but a few seconds later says indignantly, "Doctor, that's +NOT my rectum!" + "Madam," says the doctor, "that's not my thermometer!" + Just then, the woman's husband, hearing her voice, comes into the +room. "Just what the hell is going on here?" he demands. + "I'm taking your wife's temperature," the doctor cooly replies. + "Okay, doc, you know best," says the husband as he picks a scalpel +off the doctor's desk, "but when that thing comes out, it better have +numbers on it!" +%% +Australia's a lovely land +It's full of bonza blokes, +Sheilas, beer and no-one's queer +Except in Pommie jokes. + +Australians are lovely chaps +They're God's own chosen race. +If they ever see a fairy Pom +They'll smash him in the face. + +Australians like dressing up +In skirts and having fun +And that's all we were doing +When the Vice Squad came along. + -- Monty Python +%% +B4 I4Q, RU/18 QT 3.14 +%% +BALTIMORE: + Where the women wear turtleneck + sweators to hide their flea collars. +%% +BEAT ME, BITE ME, WHIP ME, FUCK ME!!! +%% +BEEF STROGANOFF: + A bull masturbating. +%% +BETTER LATE THAN NEVER: + The single girl's motto. +%% +BOHICA: + Bend over, here it comes again. +%% +BRUNETTE BUSH: + The dark side of the moon. +%% +Back in the good ole days in Texas, when stagecoaches and the like was +popular, there were three people in a stagecoach one day: a true red- +blooded born and bred Texas gentleman, a tenderfoot city-slicker from +back East, and a beautiful and well-endowed Texas lady. The city-slicker +kept eyeing the lady, and finally he leaned forward and said, "Lady, I'll +give you $10 for a blow job." + The Texas gentleman looked appalled, pulled out his pistol, and +killed the city-slicker on the spot. The lady gasped and said, "Thank +you, suh, for defendin' mah honor!" + Whereupon the Texan holstered his gun and said, "Your honor, hell! +No tenderfoot is gonna come 'round here raisin' the price of women in Texas!" +%% +Balls Law: + The angle of the dangle is directly proportional to the heat + of the meat provided that the thrusts of the busts are constant. +%% +Bankers do it with interest (penalty for early withdrawal). +%% + Barbra Walters was doing a documentary on the customs of American +Indians. After a tour of a reservation they were on, she was curious as to +the number of feathers in the headdresses. She asked a brave who had only +one feather in his headdress. His reply was, "Me have only one squaw, me +have only one feather." She asked another brave, feeling the first fellow +was only joking. This brave had four feathers in his headdress. He replied, +"Me have four feathers, because me sleep with four squaws." + Still not convinced the number of feathers indicated the number of +squaws involved, she decided to interview the Chief. Now the Chief had a +headdress full of feathers which, needless to say, amused Ms. Walters. +Ms. W: "Why do you have so many feathers in your headdress?" +Chief: "Me Chief, me fuck-em all, big, small, fat, tall, + me fuck-em all." +Ms. W: "You ought to be hung!" +Chief: "You damned right, me hung. Big like buffalo, long like snake." +Ms. W: "You don't have to be so hostile!" +Chief: "Hoss-style, dog-style, wolf-style, any-style, me fuck-em all." +Ms. W: "Oh, dear!" +Chief: "No deer, me no fuck deer. Asshole too high and fuckers run + too fast." +%% + Before he went off to the wars, King Arthur locked his lovely wife, +Guinevere, into her chastity belt. Then he summoned his loyal friend and +subject Sir Lancelot. "Lancelot, noble knight," said Arthur, "within this +sturdy belt is imprisoned the virtue of my wife. The key to this chaste +treasure I will entrust to only one man in the world. To you." + Humbled before this great honor, Lancelot knelt, received his king's +blessing and took charge of the key. Arthur mounted his steed and rode off. +Not half a mile from his castle, he heard hoofbeats behind him and turned to +see Sir Lancelot riding hard to catch up with him. + "What is amiss, my friend?" asked the king. + "My lord," gasped Lancelot, "you have given me the wrong key!" +%% +Beneath this stone a virgin lies, +For her life held no terrors. +A virgin born, a virgin died: +No hits, no runs, no errors. +%% +Beneath this stone lies Murphy, +They buried him today, +He lived the life of Riley, +While Riley was away. +%% +Better a sister in a whorehouse than a brother on a Honda. +%% +Beware of a tall dark man with a spoon up his nose. +%% +Bill and Jim were walking home from work. As they walked along, they +discussed their wives' spending habits. "I don't understand how women +can spend so much money," Bill exclaimed. "I mean, understand, she +don't drink, and she's got her own pussy!" +%% + Bill had just returned from a week of honeymooning, and his best +friend asked him how it went. + "The first night we did it nine times," Bill said. "The second +night, eight times. The third night, seven times. The fourth night, six +times. The fifth night, five times. The sixth night, four times, and the +last night, nothing!" + "Nothing?" his pal asked. "How come?" + "Hey, you ever tried putting a marshmallow in a parking meter?" +%% +Bitch, bitch, bitch -- +That's all I ever hear, +Ever since the dog ate the baby, +"Get rida the dog, get rida the dog." +%% +Blow it out your ass! +%% +Bridget O'Flaherty McHugh +Held venal traffic with a gnu. +Mistaking fore for aft one morn +Impaled herself upon its horn. + +Moral: Those who seek high ends should shun + our furred and feathered friends. +%% +Bringing your mate to a convention is like taking a game warden hunting. +%% +Build a better mousetrap, the saying goes -- and with the brassiere, Yankee +Ingenuity did exactly that. But their true stroke of genius was the new bait. +The old fashioned mousetrap was loaded with cheese; nobody cares much about +cheese, except mice. But when American know-how reloaded the brassiere with +tits, every heterosexual male in the country was hopelessly trapped. + -- Alan Sherman, "The Rape of the A*P*E*" +%% + But among the children of the Great Society there were those whose +skins were black. And lo! Their portion was niggardly, and of the fatted +calf they were sucking hind teat... + Now it came to pass that a prophet rose up amongst them, and they +called him King. And he went unto Pharaoh and said, "Let my people go to +the front of the bus." + But Pharaoh answered: "In the fullness of time and with all +deliberate speed shall this thing come to pass. When ye shall prove +yourselves worthy, shall ye have your just portion -- yea, verily, like +unto a snowball in Hell." +%% + But the reward of a successful collaboration is a thing that +cannot be produced by either of the parties working alone. It is akin +to the benefits of sex with a partner, as opposed to masturbation. The +latter is fun, but you show me anyone who has gotten a baby from playing +with him or herself, and I'll show you an ugly baby, with just a whole +bunch of knuckles. + -- Harlan Ellison +%% +But they'll never mechanize me -- not me! +Said Charlotte, the Louisville harlot. + -- S.I. Hayakawa +%% +CAD: + A man who doesn't tell his wife + that he's sterile until she's pregnant. +%% +CHRISTIAN: + One who believes that the New Testament is a divinely inspired + book, admirably suited to the spiritual needs of his neighbor. + -- Ambrose Bierce +%% +CHRISTIAN: + One who follows the teachings of Christ in so far + as they are not inconsistent with a life of sin. +%% +CINDERELLA 10: + A woman who sucks and fucks 'til midnight and + then turns into a pizza and a six-pack. +%% +CLONE OF MY OWN (to Home on the Range) + +Oh, give me a clone +Of my own flesh and bone + With the Y chromosome changed to X. +And when she is grown, +My very own clone, + We'll be of the opposite sex. +Chorus: + Clone, clone of my own, + With the Y chromosome changed to X. + And when we're alone, + Since her mind is my own, + She'll be thinking of nothing but sex. + -- Randall Garrett +%% +COCK-SUCKER: + Someone who got caught doing what you got away with. +%% +COITUS INTERRUPTUS: + A jerky movement following the words (by either sex partner) + "I want to have your child." +%% +COLD: + When your dog sticks to the fire hydrant. +%% +COMPUTER PERSONALS: + SWBiM, 29. Gr/Fr/Mild English. + Have moose, hoop. Sincere inquiries + only. Discreet. Fortune Box 1910. +%% +COMPUTERFIRM NYMPHOMANIAC: + Hot Apple pie. +%% +CONFUSION: + Father's Day in San Francisco. +%% +CONTINENTAL BREAKFAST: + A roll in bed with some honey. +%% +COORS: + Like making love in a canoe -- fucking close to water. +%% +CORPORATE VIRGIN: + A woman who's new to the firm. +%% +COURAGE: + Two cannibals having oral sex. +%% +COYOTE LOVE: + Coyote love is a nebulous term. Basically, what it involves is + the taking of a member of the preferred sex home from a singles + bar. Then, when you wake up the next morning, they're sleeping + on your arm. So, rather than wake them up as you escape, you + chew off your arm at the shoulder. +%% +Call for Ms. Lingus, Ms. Connie Lingus... +%% +Came a bellow that echoed for miles. + Said the rector, "My gracious, + Has Father Ignatius +Forgotten the Bishop has piles!?" +%% +Captain Hook died of jock itch. +%% +"Carefully study these two enlarged photographs on display, Mr. Rafferty," +the attorney for a politician suing a newspaper for libel instructued his +client on the witness stand, "and indicate which is your ass and which is +a hole in the ground." +%% +Chaste makes waste. +%% +Chipmunks roasting on an open fire +Jack Frost ripping up your nose +Yuletide carolers being thrown in the fire +And folks dressed up like buffaloes +Everybody knows a turkey slaughtered in the snow +Helps to make the season right +Tiny tots with their eyes all gouged out +Will find it hard to see tonight +They know that Santa's on his way +He's loaded lots of guns and bullets on his sleigh +And every mother's child is sure to spy +To see if reindeer really scream when they die +And so I'm offering this simple phrase +To kids from one to ninety two +Although it's been said many times, many ways +Merry Christmas, Merry Christmas, Merry Christmas, Fuck you!! +%% +Chorus: + I don't want to join the army, I don't want to go to war, + I'd rather sit around, pickin' dillies off the ground, + And livin' off the favors of a 'igh-born lady. + I don't want a bullet up me ass 'ole, + I don't want me pecker blown away, + I'd rather live in England, in jolly, sunny, England, + And fornicate me bloody life away!! + +Monday I touched her on the ankle, +Tuesday I touched her on the knee, +And Wednesday after Mass, I lifted up her dress, +And Thursday I saw you know what, +Friday I put me hand upon it, +Saturday she gave me balls a tweak [tweak, tweak] +And Sunday after supper, I ran me fucker up 'er, +And now she pays me forty quid a week! +Oh, blimey... + +[chorus] +%% +Christmas comes but once a year, +A time for love and laughter; +You can come much more than that, +But you have to clean up after. +%% +Cleveland still lives. God MUST be dead. +%% +Close the door, let me give you what you've been waiting for!! +%% +Cocaine's a joke! + (Who's got the next line?) +%% +Coito ergo sum +%% +Coitus is punishment for the happiness of being together. +Live as ascetically as possible... that is the only possible +way for me to endure marriage. But she? + -- Franz Kafka +%% +College is like a woman -- you work so hard to get in, +and nine months later you wish you'd never come. +%% +Communists do it without class. +%% +Computer scientists are programmed to do it by macro insertion. +%% +Confucious say: + man who screws near graveyard is fucking near dead. + man who lay girl on hill, not on level. + man who fishes in other man's well often catch crabs. + boy who play with himself pulls boner. + woman who cooks carrots and pees in same pot very unsanitary. + man who marry girl with no bust has right to feel low down. + man who sleeps with old hen finds it's better than pullet. + man with hole in pocket feel cocky all day. +%% +Confucious say: + woman who ride bicycle peddle ass around town. + fool man climb tree to get cherries; wise man spread limbs. + woman who fly upside down in airplane have big crack up. + man who live in glass house should bathe in the basement. + man who make love on ground have piece on Earth. + man who lose key to girlfriend's apartment get no new key. + man who fights with wife, gets not peace at night. + child conceived in back seat of car with automatic transmission + turn out to be shiftless bastard. +%% +Confucius say: + Man who go to bed with sex problem wake up with solution in hand. +%% +Copa-ulation: +(to the tune of Copacabana) + +Her name was Lola, she was a bimbo, with yellow streamers in her hair, +She wore see-through underwear, she'd go to discos, and do the go-go, +And while she tried to be star, Tony jacked off on the bar, +And when the dance was done, his hand was full of come, +His favorite drink is cream in coffee, +Won't you order one? + +At the Copa, Copa-ulation ... + +Her name was Lola, she was a show-girl, +But that was thirty years ago, when she still could slurp and blow, +Now she's a sado, but not for Tony, still in her chains and leather gown, +She ties Rico to the ground, and fucks that boy half-blind, +But Rico, he don't mind, there are whips and a lot of beatings, +But a real good time ... +%% +Cox's philosophy: + Life's a bitch, then you die. +%% +Cunnilingus is next to cleanliness. +%% +Curiousity killed the cat, but satisfaction brought her back. +%% +DIAPHRAGM: + A childproof cap. +%% +DICKER: + What you do to your wife if arguing doesn't work. +%% +DIVORCE: + A change of wife. +%% +DYKE: + A woman who kick-starts her vibrator. +%% +DYSLEXICS OF THE WORLD, UNTIE! +%% +Dallas still lives. God MUST be dead. +%% +Dammit, how many times do I have to tell you? +FIRST you rape, THEN you pillage!! +%% + "Darling," he breathed, "after making love I doubt if I'll +be able to get over you -- so would you mind answering the phone?" +%% + "Darling", said the young bride, "tell me what's bothering you. +We promised to share all our joys and sorrows, remember?" + "But this is different," protested her husband. + "Together, darling," she insisted, "we will bear the burden. +Now tell me what our problem is." + "Well," said the husband, "we've just become the father of a +bastard child." +%% + "Darling," she whispered, "will you still love me after we are +married?" + He considered this for a moment and then replied, "I think so. +I've always been especially fond of married women." +%% +David was just a shepherd who liked to get his rocks off in leather. +%% +Dear Abby: + I have two brothers. One was sent to the electric chair when I was +a child. My mother died in an insane asylum. My father is a pimp and my +sister is a very successful and highly paid prostitute. My other brother +is a graduate student attending Purdue University. + Recently I met a wonderful girl who has just been released from prison +for murdering her illegitimate child with a Zip-loc sandwich bag. We're very +much in love and want to be married after her venereal disease is cured. + My problem is this: should I tell her about my brother at Purdue? + Sincerely, + Undecided. +%% +Dear Abby: + I just met the most terrific girl and we get along fabulously. I +think she's the one for me. There's just one problem: I can't remember +from our first date if she told me she had TB or VD. What should I do? + --Confused + +Dear Confused: + If she coughs, fuck her. +%% +Dear Lord, observe this bended knee +This visage meek and humble, +And hear this confidential plea +Voiced in reverent mumble: + Give me Shylock, give me Fagin + But O God spare me Ronald Reagan! + -- Ansel Adams +%% + Desperate about the state of her social life, a young woman resorted +to the Personal Ads in the back of her local paper. In the ad she made it +quite clear that what she was advertising for was an expert lover; she already +had plenty of sensitive friends and meaningful relationships and what she +now wanted was to get laid, to put it bluntly. Phone calls started coming +in, with each caller testifying to his sexual prowess, but none quite struck +the young woman's fancy. Until one night her doorbell rang. Opening the door +she found a man with no arms or legs, who informed her that he was there in +response to her advertisement. "I'm terribly sorry," she stammered, "but my +ad was quite explicit. I'm really looking for something of a sexual expert, +and you... uh... don't have all the..." + "Listen," the man interrupted her, "I rang the doorbell, didn't I?" +%% +Desperate because her husband hadn't made love to her in months, a lonely +housewife finally mustered her courage and went to their doctor for advice. +The doctor was very sympathetic and wrote out a prescription for pills that +were guaranteed to rekindle the husband's ardor in a big way. "They'll make +him horny as hell," the doctor confided, "but they're very potent, so just +put one in whatever he's drinking." + Upon arriving home, the woman left the pills on the kitchen counter +and dashed off to the supermarket. It didn't take long before the cat jumped +up, knocked them over onto the floor, and ate a couple, as did the family +dog. And when the husband got home with a headache, he took a few thinking +they were aspirin. + When the housewife returned, she was horrified to see the dog humping +the cat and the cat jumping all over the dog, but even stranger was the sight +of her husband with his penis inside the pencil sharpener on the counter. +"What in heaven's name are you doing, John?" she cried. + "See that mosquito?" he replied. +%% +Hear about... + the French soldier who kissed his wife's + cheeks before he went to the front? +%% +Hear about... + the girl with the big wardrobe who started with just a little slip? +%% +Hear about... + the nurse they thought had drowned + until they found her under the doc? +%% +Did you know that there are 71.9 acres of nipple tissue in the U.S.? +%% +Distributed Systems people do it loosely coupled. +%% +Do something big -- fuck a giant. +%% +"Do you cheat on your wife?" asked the psychiatrist. +"Who else?" answered the patient. +%% +Do you smoke after sex? +Why, do you know, I've never looked! +%% +Doctors take two aspirin and do it in the morning. +%% +Does he treat your breasts like unripe grapefruit? Who needs him? + -- `J', "The Sensuous Woman" +%% +Doing business with the government is like fucking sheep. +It's easy, but it's not very satisfying. +%% +Don't let your mouth write no check that your tail can't cash. + -- Bo Diddley +%% +Don't look now -- your office mate is a pederast!!! +%% +Don't look now, but your mother is having sex with a horse. +%% +Draft beer, not boys! +%% +Dry fucking: that's man on top of woman, the action is the same as fucking, +but you're dressed. It's great for the girl... you're hitting and rubbing +exactly the area that you ought to be... I still like that. + -- Grace Slick +%% +Due to a mixup in urology, orange juice will not be served this morning. +%% + During a session with a marriage counselor, the wife snapped at her +husband: "That's not true, I do enjoy sex!" Then, turning to the counselor, +she added: "But this fiend expects it three or four times a year!" +%% +Dyslexia means never having to say that you're ysror. +%% +EE's do it without shorts. +%% +EMBARRASSMENT: + Finding out your German Shepherd has the clap. +%% +Eat shit and die a virgin! +%% + Ed, a traveling salesman, had his car break down in the middle of a +blizzard. He trudged to a nearby farmhouse where the farmer told him that, +while they were short of beds, he could sleep with his daughter. She proved +to be eighteen and beautiful. So they went to bed, and shortly, Ed made a +pass at the daughter. "Stop that!" she said. "I'll call my father." + He desisted. But half an hour later he made another attempt. "Uh, +stop ... that," she said. "I'll call my father." + But she moved closer to him, so he made a third try. This time, no +protest, no threat. Just as Ed, satisfied, was about to drowse off, she +tugged at his pajama sleeve. "Could we do that again?" she asked. + Ed obliged, and this time fell asleep only to be awakened by the +tug at his sleeve. "Again?" + And again Ed obliged. But when his sleep was once more interrupted +by the tugging at his pajama sleeve, Ed indignantly pulled it away from her +and mumbled, "Stop that! Or I'll call your father." +%% +Eleven reasons a cucumber is better than a man: + 1) Cucumbers can stay up all night, + and you won't have to sleep in the wet spot. + 2) Cucumbers don't play the guitar and try to find themselves. + 3) You won't find out later that your cucumber + ...is married + ...is on penicillin + ...likes you -- but loves your brother! + 4) A cucumber won't care what time of the month it is. + 5) A cucumber never wants to get it on when your nails are wet. + 6) Cucumbers don't say "Let's keep trying until we have a boy". + 7) Cucumbers won't tell you size doesn't count. + 8) A cucumber won't leave you for a cheerleader or an ex-nun. + 9) Cucumbers don't fall asleep on your chest or drool on the pillow. + 10) Cucumbers don't care if you make more money than they do. + 11) With a cucumber, the toilet seat is always the way you left it. +%% +Evangelists do it with Him watching. +%% +Ever wondered why you always run out of breath when you throw up? +Ah, but a man's retch should exceed his gasp, else what's a heaving for? +%% + Every morning, the crowd on Coney Island beach was startled to see +a jogger with the build of a pro football player but a head the size of a +baseball. Finally, some brave young man got up the nerve to stop him and +ask, "What happened to give you such a small head?" + The jogger sadly told the story of finding a magic lamp on the beach, +which produced a beautiful genie when rubbed. The genie said, "I now give +you one wish. Do you want a quick fuck or a little head?" +%% +Everyone in the office is welcome to join the group going to the Columbus +Theater tonight. Meet in the lobby at 8:30. The films are "Blue Jennifer" +and "Hot Coed Cheerleaders". +%% + Everyone in the smart nightclub was amazed by the old gentleman, +obviously pushing 70, tossing off manhattans and cavorting around the dance +floor like a 20-year old. Finally curiousity got the best of the cigarette +girl. "I beg your pardon, sir," she said, "but I'm amazed to see a gentleman +of your age living it up like a youngster. Tell me, are all of your faculties +unimpaired?" + The old fellow looked up at the girl sadly and shook his head. "Not +all, I'm afraid." he said. "Just last evening I went nightclubbing with a +girlfriend -- we drank and danced all night and finally rolled into her place +about two A.M. We went to bed immediately, and I was asleep almost as soon +as my head hit the pillow. I woke around three-thirty and nudged my girl." + "Why, George," she said in suprise, "we did that fifteen minutes ago." + "So you see," the old boy said sadly, "my memory is beginning to +fail me." +%% +FALSIE SALESMAN: + Fuller bust man. +%% +FELT TIP: + Past tense for a breast examination! +%% +FEMALE: + Life support system for a pussy. +%% +FORNICATION: + Term used by people who don't have anybody to screw with. +%% +FUCKOFF: + The tie breaker at the Miss America Beauty Pageant. +%% +Fat dirty farts came spluttering out of your backside. You had an arse full +of farts that night, darling, and I fucked them out of you, big fat fellows, +long windy ones, quick little merry cracks... + -- James Joyce +%% +Fed some caviar to my girlfriend +She was a virgin tried and true +Now my girlfriend needs no urgin' +There ain't nothin' she won't do! + Caviar comes from a Virgin Sturgeon - + Virgin Sturgeon's a very fine fish. + Virgin Sturgeon needs no urgin' + That's why caviar is my dish! +Fed some caviar to my Grandpa +He was a man of ninety-three +Shrieks and screams were heard from Grandma +He had chased her up a tree! + (chorus) +%% +Fie for shame, +you lascivious, lewd, lecherous, +libidinous, lustful, licentious, dirty bum!! +%% +Fig Newton. +%% + "First, I'm going to buy you a few drinks and get you a little tight," +said the guy aggressively. + "Oh, no, you're not," said the girl. + "Then I'll take you to dinner at the most exclusive restaurant in +town." + "Oh, no, you won't." + "Then I'll take you to my apartment and mix up a pitcher of daiquiris." + "Oh, no, you won't." + "Then I'm going to make violent, mad, passionate love to you." + "Oh, no, you're not." + "And I'm not going to take any precautions either!" said the guy. + "Oh, yes, you are!!" said the girl. +%% +Floppy now, hard later. +%% +For children, a woman. +For pleasure, a boy. +For sheer ecstasy, a melon. +%% +For her first week's salary the gorgeous new secretary was given an +exquisite nightgown of imported lace. The next week her salary was +raised! +%% +For months the loving newlywed had asked his blushing bride to perform oral +sex on him, but to no avail. His sweet entreaties never worked, for she was +simply too innocent and inexperienced to even *think* of such a thing, let +alone attempt it. But a year of gentle persistence finally paid off, and +one night his darling nervously but lovingly performed the act. When it was +over, she looked deeply into his eyes, blushed, and asked, "How was I, +sweetheart?" + He looked at her and replied, "How should I know -- I'm no +cocksucker!" +%% +For the man who has everything ... penicillin IV. +%% +Fortune's Guide to Movies: +G: No girl. +PG: The hero gets the girl. +R: The bad guy gets the girl, then the good guy gets the girl. +X: The hero still gets the girl in the end, but he's never sure + which end it will be. +XXX: Everybody gets the girl. +%% + Friends were surprised, indeed, when Frank and Jennifer broke their +engagement, but Frank had a ready explanation: "Would you marry someone who +was habitually unfaithful, who lied at every turn, who was selfish and lazy +and sarcastic?" + "Of course not," said a sympathetic friend. + "Well," retorted Frank, "neither would Jennifer." +%% +From the outset, the blind date was a fiasco and it was intensified by the +fact that the fellow was too insensitive and ego-ridden to realize it. The +moment of truth came in the supper club as he clutched the girl's thigh and +whispered, + "Baby, how's about our cutting out to my pad +so I can slip you nine inches?" +There was a moment of silence, and then the girl said, + "You know, I really don't think you could get it up +three times in a row!" +%% +Fuck art; let's dance! +%% +Fuck off and die! +%% +Fuck'em if they can't take a joke! +%% +GAY: + One who'd rather swish than fight. +%% +GEMINI (May 21 - June 20) + You are a quick and intelligent thinker. People like you because +you are bisexual. However, you are inclined to expect too much for too +little. This means you are cheap. Geminis are known for committing incest. +%% +GET OFF THE FUCKING SYSTEM THIS INSTANT, YOU ASSHOLE!!!! +%% +GLEE CLUB GROUPIE: + A girl into choral sex. +%% +GREAT LOVER: + A man who can breathe through his ears. +%% +Gross, adj.: + When your bloody mary still has the string in it. +%% +Gross, adj.: + When your grandmother kisses you goodnight and + slips you some tongue. +%% +Gynecologist, n: + Someone who spends their time spreading old wives' tails. +%% +Gardeners do it in raised beds. +%% +George Washington not only chopped down his father's cherry tree, but he +also admitted doing it. Now, do you know why his father didn't punish him? +Because George still had the axe in his hand. +%% +Getting an education at the University of California +is like having $50.00 shoved up your ass, a nickel at a time. +%% +Girls are like pianos. When they're not upright, they're grand! +%% +Girls would never stay out late if guys didn't make them. +%% +Give me Librium or give me Meth. +%% +Go out with girls Dutch treat -- pay for dinner, drinks, +and the movie, and the rest of the evening is on her. +%% + God built a compelling sex drive into every creature, no matter +what style of fucking it practiced. He made sex irresistibly pleasurable, +wildly joyous, free from fears. He made it innocent merriment. + Needless to say, fucking was an immediate smash hit. Everyone +agreed, from aardvarks to zebras. All the jolly animals -- lions and +lambs, rhinoceroses and gazelles, skylarks and lobsters, even insects, +though most of them fuck only once in a lifetime -- fucked along +innocently and merrily for hundreds of millions of years. Maybe they +were dumb animals, but they knew a good thing when they had one. + -- Alan Sherman, "The Rape of the A*P*E*" +%% +God is a polythiest. +%% +God is an atheist. +%% +God is not dead! He's alive and autographing bibles at Cody's. +%% +God is not dead -- he's been busted. +%% +God isn't dead, He's just trying to avoid the draft. +%% +God isn't dead, he just couldn't find a parking place. +%% +God made the world in six days, and was arrested on the seventh. +%% +God must love assholes -- She made so many of them. +%% +God wanted to have a holiday, so He asked St. Peter for suggestions on +where to go. + "Why not go to Jupiter?" asked St. Peter. + "No, too much gravity, too much stomping around," said God. + "Well, how about Mercury?" + "No, it's too hot there." + "Okay," said St. Peter, "What about Earth?" + "No," sighed God, "They're such horrible gossips. When I was +there 2000 years ago, I had an affair with a Jewish woman, and they're +still talking about it." +%% +Good day for water sports. Take a bath with a friend. +%% +Grain grows best in shit. + -- U.K. LeGuin +%% +Gravity is a myth, the Earth sucks. +%% +HACKER: + A master byter. +%% +HAGGIS: + Haggis is a kind of stuff black pudding eaten by the Scots and + considered by them to be not only a delicacy but fit for human + consumption. The minced heart, liver and lungs of a sheep, calf + or other animal's inner organs are mixed with oatmeal, sealed + and boiled in maw in the sheep's intestinal stomach-bag and... + [Excuse me a minute. Ed.] +%% +HAPPINESS: + Having your Herpes (Type II) test come back negative. +%% +HENPECKED HUSBAND: + One who's afraid to tell his pregnant wife that he's sterile. +%% +HERMIT: + A man who'd rather get off by himself. +%% +HERPES: + The final proof that 'tis better to + give than to receive. Much better. +%% +HEY KIDS! ANN LANDERS SAYS: + A great way to prevent the tragedy of unwanted pregnancy is to +become a homosexual. Every year, millions of young men and women, just +like you, are making the clean change to worry-free homosexuality. +They're having more sex than ever, and more fun than ever. Send 50 cents +today for my leaflet "Gay sexual techniques". Be sure to specify the +male or female edition. +%% +HEY, KIDS! ANN LANDERS SAYS: + Masturbation isn't as simple as it looks. Do it right! +Send 50 cents for my illustrated booklet "Masturbation techniques +for the teenager". Be sure to specify the male or female edition. +%% +HEY KIDS! ANN LANDERS SAYS: + Remember, oral sex CAN cause pregnancy, unless you use an +oral contraceptive. See your family planning clinic today! +%% +HONOR: + Almost as good as in 'er. +%% +HOW TO REMOVE STAINS -- #28 + Semen stains can be removed from computer terminals with + Fantastik or the like. Use Windex on the glass however, and + be sure to turn the power off if you have to clean between + the keys. +%% +HYPOCRITE: + A man who says he likes cats, but won't eat pussy. +%% +Hackers do it bottom-up. +%% +Hackers do it with all sorts of characters. +%% +Hackers do it with bugs. +%% +Hackers do it with fewer instructions. +%% +Hackers have kernel knowledge. +%% +Hackers know all the right MOVs. +%% +Halt!! Who goes there, friend or enema? +%% +Handy hint: + A tea bag or two can be a dandy substitute + when you're out of tampons. +%% +Hang gliders come down very slowly. +%% +Hardly a pure science, history is closer to animal husbandry than it is to +mathematics, in that it involves selective breeding. The principal difference +between the husbandryman and the historian is that the former breeds sheep +or cows or such, and the latter breeds (assumed) facts. The husbandryman uses +his skills to enrich the future; the historian uses his to enrich the past. +Both are usually up to their ankles in bullshit. + -- Tom Robbins +%% +Harry came into work on Monday feeling absolutely fine, and so was astonished +when his secretary urged him to lie down on the sofa; even more so when his +boss took one look at him and ordered him to take the day, if not the week, +off. Even his poker buddies wouldn't have anything to do with him, insisting +that he go straight to bed. Finally, tired of resisting everyone's advice, +he went to see his doctor, who took one look at him and rushed over with +a stretcher. + "But doctor," he protested, "I feel fine." +Well, this was a puzzler, conceded the doctor, who proceeded to refer to the +enormous reference tomes behind his desk, muttering to himself. + "Looks good, feels good... No, you look like hell. Looks good, +feels terrible... Nah, you feel fine, right?" +Thumbing furiously through another volume, he said, + "Looks terrible, feels terrible... Nope, that won't do it either." +Finally, "Looks terrible, feels terrific... Aha!! You're a vagina!" +%% +Have you ever stopped to think what it would be like to have a woman President? +"I can't deal with the Russians today. Not now. I've got my period." + -- Steven Moore +%% +Having discovered the possibility that other creatures could be used +for sexual intercourse, early man was likely to have made many such +attempts... though it is doubtful that he was so sexually carnivorous +as the Christian and Jewish Adam, who, rabbinical interpreters of the +Old Testament tell us, had intercourse with every creature before God +finally hit upon the idea of woman and created Eve. + -- R.E. Masters +%% +He boil my first cabbage, make it awfully hot, +But when he put in the bacon, oooh, you know it overflow the pot. + -- Bessie Smith, "Empty Bed Blues" +%% +He carried me over the stream, striding through the current, his strong, +muscular, thighs scarcely hesitating as he sure-footedly forded the water. +But what was that bulge, small, oblong, solid, that might have been, say, +a pocket camera? + -- An Exciting Journey +%% +He drank with curvy Mable, +The pace was fast and furious, +He slid beneath the table, +Not drunk but merely curious. +%% +He had heard that a certain whorehouse had a reputation for the bizarre. +So he drove to the place and, once inside, asked the Madam if she had anything +unusual for him to try. "Things are pretty slow today," she said, "but I +do have one number you might enjoy." She went on to describe a New Jersey +hen that had been trained to do blow jobs. + "We've got her here, but only for the day." + The visitor could hardly believe it, but he paid the fee and went +into a room with a hen. After a frustrating hour of trying to force his +cock into the hen's mouth, he figured out that he was dealing with nothing +but a plain old chicken. He left. Thinking about it later, he decided +that he had had so much fun trying that he returned the few days later and +asked the Madam, "Do you have anything new today?" + "Come this way," she said, and led him to a dark room where a group +of men were looking through a one-way mirror. He saw that they were watching +a girl trying to make it with a dog. + "Wow!" he said to the man standing next to him. "This is really +great!" + The man replied, "Man, it ain't nothin'! You shoulda been here +a week ago and seen the guy with the chicken!" +%% +He used to kiss her on her lips, but it's all over now. +%% +He was so gay he'd never lean his ass on a baseball bat -- +scared it'd get serious. +%% +He wasn't much of an actor, he wasn't much of a Governor -- +Hell, they HAD to make him President of the United States. +It's the only job he's qualified for! + -- Michael Cain +%% +He who farts in church must sit in his own pew. +%% +He who findeth sensuous pleasures in the bodies of lush, hot, +pink damsels is not righteous, but he can have a lot more fun. +%% +He who sneezes without a handkerchief takes matters into his own hands. +%% +He: Am I... am I your first? +She: Well, honey, I could have sworn your face looked familiar... +%% +He: "Hey, Baby, I'd sure like to get in your pants!" +She: "No, thanks, I've already got one asshole in there now." +%% +Hear about the Californian terrorist that tried to blow up a bus? +Burned his lips on the exhaust pipe. +%% +Hear about the guy who had his vasectomy done by Sears? +Every time he gets a hard-on, the garage door goes up. +%% +Hear about the young lady raped in San Francisco? +By two men, one held her down while the other one did her hair. +%% +Hear the sad story of the Greek fisherman who got his upper torso +wedged into the porthole and couldn't get out to save his ass? +%% +Heard tell that the Iron Magnolia wanted to divorce ol' Jimmy. +Seems he's screwing everyone but her. +%% +"Heard you were moving your piano, so I came over to help." +"Thanks. Got it upstairs already." +"Do it alone?" +"Nope. Hitched the cat to it." +"How would that help?" +"Used a whip." +%% +Heisenberg may have done it. +%% + "Hello, Police Department." + "This is Thomas Parrish, 903 Sylvester Court. I've just been sexually +molested by a pervert, right here in my own home. It was horrifying!" + "Just remain calm, sir, and tell me about it." + "Well, the man came in the window wearing a ski mask. I was napping +on the bed, in just my pajamas, and the TV set was on so I didn't hear anything. +Suddenly he had his great big old callused hand over my mouth, holding me down. +I tried to scream... he was pulling my pants off. I was so frightened! He +held a knife to my throat and undressed so quickly. What could I do? I +couldn't stop him. He was huge. A great, hairy, beefy man, more than fifty +pounds heavier than I am, and hung like... Oh! it was terrible. He had an +erection, and he knelt on my shoulders and forced the awful thing down my +throat; forced me to suck it. Yes, officer! There was no escaping this man. +Finally, when I thought I would faint, he got off me and turned me over on +my tummy, forcing my legs apart with his knees, and oh! I'm so embarrassed to +say it, he put that huge thing... It must have been a foot long, and I don't +know how thick... into my... Just a minute." + "What's the matter, mister?" + "Listen, I have to hang up now, he's getting out of the shower." +%% +Hello, children!! + This is Uncle Dennis welcoming you to your own fortune. Hello. + Today we are going to hear a story, so sit right here on my lap + and we can all start. Comfortable? Ah, yes, ah... Ah? Ah!! + + One day, Rikki, the magic Pixie, went to visit Daisy Bumble in her + tumbledown cottage. He found her in the bedroom. Roughly he + grabbed her heaving ******* pulling her down on the bed and + hurriedly ripping off her thin *******. + + Old Nick, the Sea Captain was a rough tough jolly sort of fellow. + He loved the life of the sea and he loved to hang out down by the + pier where the men dressed as ladies ****** ** ******* ******* + ** ***** ********* **** ****** with a melon. + + Rumpletweezer ran the Dinky Tinky shop in the foot of the Magic + oak tree by the wobbly dum-dum tree in the shade of the enchanted + glen down in Dingly Dell. Here he sold contraceptives, ******** + and various appliances *** ******** *** ***** naked fun *** ***** + **** ******** ******* *** into six or seven pairs. +%% +Help Stamp Out Rape! (Say Yes.) +%% +Her kisses left something to be desired: the rest of her. +%% +Here's a toast to Screwy Dick, +The man who was born with a corkscrew prick. +He spent his life in a futile hunt, +To find a woman with a spiral cunt. +And when he did, he dropped stone dead, +'Cause the blasted thing had a left-hand thread! +%% +Here's to the girl that's sweet, +Here's to the girl that's true, +Here's to the girl in all our hearts... + +In other words, guys, what do you say we all go downtown for +the rest of the night? +%% +Here's to the woman beautiful and devine +she flowers every month bears fruit every nine +she's the only creature 'tween heaven and hell +can get the juice from a nut without cracking the shell. +%% +He's a son-of-a-bitch, but he's our son-of-a-bitch. + -- FDR on Nicaraguan dictator Anastasio Somoza +%% +He's gallantry personified, in fact, his brochures ought to +read satisfaction guaranteed, or your virginity returned intact. +%% +Hey baby! + How 'bout a brutal face fuck? +%% +Hire the handicapped -- they're fun to watch! +%% +Honest, officer, had I known my health was +in jeopardy, why, I'd never have lit one! +%% +How come if you're horny it's lust, but if she's horny it's affection? +%% +"How did you spend the weekend?" asked the pretty brunette + secretary of her blonde companion. +"Fishing through the ice," she said. +"Fishing through the ice? Whatever for?" +"Olives." +%% +How do you like the new America? We've cut the fat out of the +government, and more recently the heart and brain (the backbone was +gone some time ago). All we seem to have left now is muscle. +We'll be lucky to escape with our skins! +%% +Howard Cosell's biggest protrusion is his asshole. + -- John Valby +%% +"How'd you get that flat?" +"Ran over a bottle." +"Didn't you see it?" +"Damn kid had it under his coat." +%% +Hugh Hefner is a virgin. +%% +Did you hear about... + the plastic surgeon who hung himself? +%% +Q: Why do elephants wear springs on their feet? +A: So they can jump into trees and rape mice. + +Q: What is the most fearsome sound in the world to a mouse? +A: BOING, BOING!!! +%% +Did you hear about... + the butcher who dropped his cleaver and went home half-cocked? +%% +A sperm faced, alack and forsooth, +His moment of sexual truth. + He'd expected to fall + On a womb's spongy wall +But was dashed to his death on a tooth. +%% +Obscenity is a crutch for lazy Motherfuckers. +%% +Q: Why did the epileptic cross the road? +A: He couldn't help it. + +Q: What do you do if an epileptic has a seizure in the bathtub? +A: Throw in the dirty clothes and some laundry detergent. +%% + Well, this woman went to the butcher shop to get some ham for dinner. +She asked the butcher what kind of ham he recommended, and the butcher said, +"Well ma'am, we got some Damn ham here for $3.50 a pound..." Needless to +say, she was surprised at the butcher's language! The butcher, who was +reasonably astute, noticed the alarmed look on the woman's face, and quickly +justified himself. "No no, ma'am, I wasn't cursin', the NAME of this here +ham is "Damn ham". Amused, the woman requested some "Damn ham." + That night, before dinner, the woman took her husband aside and +explained what had happened at the butcher shop. He also was amused, and +suggested that they play a joke on their son. So, at dinner, after grace, +the man turned to his wife and said, "Honey, pass the damn ham." + Their son looked up, surprised. "WHOAH! Dad be gettin' hip! +How 'bout them mother-fuckin' potatoes?" +%% + One day a mother and daughter are walking around a farming community +and they see a stallion mounting a mare. The daughter takes in the scene and +turns to her mother. "Mommy, what are those two horses doing?" + Her mother hastily answered, "The horse on top hurt its hoof, and the +one on the bottom is carrying him back to the stable." + The daughter shook her head and sadly replied, "Isn't that just the +way it goes? Try to help someone and you get fucked." +%% +Women, can't live with them, can't leave +them by the curb when you're done with 'em. +%% +Anything more than three shakes is for fun. +%% +I never met a woman I couldn't drink pretty. +%% +You're not an alcoholic unless you go to the meetings. +%% +I may not be able to walk, but I drive from a sitting position. +%% +Some women achieve greatness, some have greatness thrust into them. +%% +There was a young woman called Pearl +Who quite resembled a churl; + When she asked a young man named Tex + Whether he would like to have sex, +"Certainly," quoth he, "Who's the girl?" +%% +Assassins do it from behind. +%% +When in calling, plain speaking is out; +When the ladies (God bless 'em) are milling about, +You may wet, make water, or empty the glass; +You can powder your nose, or the "johnny" will pass. +It's a drain for the lily, or man about dog +When everyone's drunk, it's condensing the fog; +But sure as the devil, that word with a hiss +It's only in Shakespeare that characters ____. + -- Ogden Nash +%% +Gorbachev woke up early one morning, and felt great. He walked over to his +window, threw back the curtains, and saw the sun coming up. He felt *so* +good, he crowed, "Good Morning Sun!", and was startled when a great booming +voice came back to him, "Good morning Comrade! Good morning to you and +the great Soviet Socialist Republic!". Of course, this surprised him, but +great politician that he is, he considers the political ramifications. +Gorbachev then woke up Reza and his closest aides, brought them into his +bedroom, and shouted out "Good morning, Comrade Sun!". Again a booming reply, +"Good morning, Comrade. Good morning to you and the rest of the Party!" +Everyone was quite excited about this, and Gorbachev sat down to his +day's work with a feeling of being destiny's favorite child. + Later, in the evening, he was preparing for the ballet. As he +dressed, he noticed that the sun was setting. Walking over to the window, +Gorbachev threw up the sash and again addressed the sun, "Good evening to +you, Comrade Sun!". Once more the great voice boomed out, "Fuck you, +asshole! I'm in the West, now!" +%% +If life's a piece of shit, Calculus III is the spoon. +%% +Yesterday is a memory, + Tomorrow is a vision, + Today is a bitch! +%% +Two golfers were being held up as the twosome of women in front of them +whiffed shots, hunted for lost balls and stood over putts for what seemed +like hours. + "I'll ask if we can play through," Bill said as he strode toward +the women. Twenty yards from the green, however, he turned on his heel +and went back to where his companion was waiting. + "Can't do it," he explained, sheepishly. "One of them's my wife +and the other's my mistress!" + "I'll ask," said Jim. He started off, only to turn and come back +before reaching the green. + "What's wrong?" Bill asked. + "Small world, isn't it?" +%% +Harold had never wanted a woman so much in his life, but upon overhearing +the 22-year-old beauty remark that he was too old and out of shape for +her. The determined septuagenarian immediately embarked upon a rigorous +self-improvement program. He had his face lifted, bought a toupee, ran +five miles every day, lifted weights and adopted a strict vegetarian diet. +Within months, the rejuvenated old man won the young woman's heart, and she +agreed to marry him. + On the way out of the chapel, however, Haroled was fatally struck +by lightning. Furious, he confronted Saint Peter at the pearly gates. "How +could you do this to me after all the pain I went through?" + "To be honest, Harold," Saint Peter sheepishly replied, "I didn't +recognize you." +%% +A group of scientists discovered an apelike creature in the jungle, which +they hoped would prove to be the missing link. The proof of their theory, +however, required that a human mate with the animal so that they could see +what characteristics the offspring would assume. Needing volunteers, the +scientists placed an ad in the paper: "$5000 to mate with ape." + Almost immediately, they received response from a man who said he +would be willing to take part in the experiment, with three conditions. + "First," he said, "my wife must never know. Second, any children +must be baptized. And, third, I'd have to pay in installments." +%% +Hunters make the best lovers; they go deeper into the +bush, shoot more often and *always* eat what they shoot. +%% +I believe that Ronald Reagan will someday make this +country what it once was... an arctic wilderness. + -- Steve Martin +%% + "I believe you have the wrong number," said the old gentleman into +the phone. "You'll have to call the weather bureau for that information." + "Who was that?" his young wife asked. + "Some guy wanting to know if the coast was clear." +%% +I came; I saw; I fucked up. +%% +I can't quite put my finger on it, but +something about you pisses me off. + -- Peter Knight +%% +I choked Linda Lovelace. +%% +I continued wetting my bed for a long time, not just out of contrariness, +but to have the pleasure of feeling my warm urine running down my legs +and wallowing in its odor. + -- Salvador Dali +%% +I don't care who you are, Fatso. Get those reindeer off my roof. +%% +I don't drink water; fish fuck in it. + -- W.C. Fields +%% +I don't give a flying fuck at a rolling doughnut. +%% +"I don't really mind her being unfaithful," sighed the man to his +marriage counselor, "but I just can't sleep three in a bed." +%% +I don't remember ever having had the itch, and yet +scratching is one of nature's sweet pleasures, and so handy. +%% +"I finally found out what my ranch foreman husband really meant," +sobbed the recent bride, "when he told me he'd love me 'til the +cows came home." +%% +I have a funny daddy +Who goes in and out with me +And everything that baby does +Daddy's sure to see, +And everything that baby says, +My daddy's sure to tell. +You must have read my daddy's verse. +I hope he fries in Hell. + -- Ogden Nash +%% +"I have credit with this madam who runs a string of super callgirls," +the executive reminisced at his club bar, "but when I got the bill for +the great head session one of them pleasured me with, I must say that +it was enough to make a blown man cry." +%% +I know what you're up to, you white-feathered fiend! +Go release your bowels on some lesser personage! + -- W.C. Fields, upon seeing a bird overhead +%% + "I need a camel that can go without water for at least three weeks," +the American said to an Algerian camel merchant. "Is it possible?" + "All things are possible," replied the merchant. He proceeded to +take a camel out of his barn and lead him to a tank of water. After the +camel had drunk its fill and was about to lift its head out of the tank, +the merchant picked up two nearby bricks, one in each hand, stepped behind +the camel, and smacked his testicles with the bricks. + The camel let out a gigantic "Whhoooosh!" and sucked up what seemed +like twenty more gallons of water. + The American stared incredulously at the camel merchant. "My God, +man!" he exclaimed, "doesn't that hurt?!" + The merchant shrugged. "Only if you get your thumbs in between the +bricks." +%% +I never trust a man unless I've got his pecker in my pocket. + -- Lyndon Johnson +%% +I regret to say that we are powerless to act in cases of oral-genital +intimacy, unless it has in some way obstructed interstate commerce. + -- J. Edgar Hoover +%% +I think any man in business would be foolish to fool around +with his secretary. If it's someone else's secretary, fine. + -- Barry Goldwater +%% +"I think my wife may be getting somewhat overweight. +"Oh, how can you tell?" +"Well, last night when she sat on my face, I couldn't hear the stereo." +%% +I think pop music has done more for oral intercourse +than anything else that has ever happened, and vice versa. + -- Frank Zappa +%% +I want a girl that can swallow my pride. + -- Frank Zappa, "Jewish Princess" +%% +I was a cock-teaser at Rooster Rama. +I used to enrage the bantams before the big bouts. + -- Firesign Theatre +%% +I was having sex just the other night, but she hung up. +%% +"I was plodding through the woods when suddenly a giant brown bear +grabbed me from behind and made me drop my gun. He picked it up +and stuck it in my back." + "What did you do?" + "What *could* I do? I married his daughter." +%% +I wonder what my wife will want tonight; +Wonder if the wife will fuss and fight? + I wonder can she tell + That I've been raising hell; +Wonder if she'll know that I've been tight? + +My wife is just as nice as can be, +I hope she doesn't feel too nice toward me. + For an afternoon of joy, + Is hell on the old boy, +I wonder what the wife will want tonight! +%% +I wouldn't fuck her with your prick. +%% +I wouldn't mind dying -- it's that business of +having to stay dead that scares the shit out of me. + -- R. Geis +%% +Incest, n: + Sibling revelry; a sport the whole family can enjoy. +%% +Infatuation, n: + When you're in love, there's a lump in your throat. + When you're infatuated, there's a lump in your pants. +%% +I'd like to meet the man who invented +sex and see what he's working on now. +%% +I'd walk a mile for a Camel, two for a hump. +%% +If Carter is the answer, it must have been a VERY silly question. +%% +If God doesn't destroy San Francisco, +He should apologize to Sodom and Gomorrah. +%% +If God had wanted people to give blow +jobs, he wouldn't have given them teeth. +%% +If God hadn't intended man to eat pussy, +would He have made it look like a taco? +%% +If Helen Keller is alone in a forest and falls, does she make a sound? +%% +If a President doesn't do it to his wife, he'll do it to his country. +%% +If it flies, floats or fucks, rent it, don't buy it. + -- Tommy Earl Bruner +%% +If it's not one thing, it's a mother. +%% +If men could get pregnant, abortion would be a sacrament. +%% +If men couldn't fuck there'd be a bounty on their heads. +%% +If sex is a pain in the ass, you may be doing it wrong. +%% +If someone were to ask me for a short cut to sensuality, I would +suggest he go shopping for a used 427 Shelby-Cobra. But it is +only fair to warn you that of the 300 guys who switched to them +in 1966, only two went back to women. + -- Mort Sahl +%% +If there is no God, who pops up the next Kleenex? + -- Art Hoppe +%% +If you were attacked by a homosexual, would you beat him off? +%% +If you could get an erection, you would have no need for Emacs. +%% +If you drink, don't park. Accidents make people. +%% +If you're Catholic you've only got two choices: periodic +abstinence and complete continence; (you know, rhythm and blues). +%% +If you're really into astrology, tell me, what happens +when Mercury is in the Fish, and Jupiter enters the Virgin? +%% +I'm a bisexual; I get it maybe twice a year. + -- Rodney Dangerfield +%% +I'm glad that I'm an American, +I'm glad that I am free, +But I wish I were a little doggy, +And McGovern were a tree. +%% +I'm going to Iowa for an award. Then I'm appearing at Carnegie Hall, +it's sold out. Then I'm sailing to France to be honored by the French +government -- I'd give it all up for one erection. + -- Groucho Marx +%% + "I'm looking for adventure, excitement, beautiful women," cried the +young man to his father as he prepared to leave home. "Don't try to stop me. +I'm on my way." + "Who's trying to stop you?" shouted the father. "Take me along!" +%% +I'm never through with a girl until I've had her three ways. + -- J.F. Kennedy +%% +I'm not laughing behind your back; everything funny is in front! + -- Rodney Dangerfield's wife +%% +I'm unbuttoning your shirt, unzipping your jeans.... + +Oh, I can feel your fingers on the keys, baby, + I'm getting WARM.... + +I am getting there, oh yes,. Oh, my. OH YES... OHHHH! + ...!!!rrrrrgh!!!!! + +Honey, that was *really* terrific, but, next time, +couldn't you please input a little SLOWER? +%% +Immanuel Kant was a real pissant who was very rarely stable. +Heidegger, Heidegger was a boozy beggar who could think you under the table. +David Hume could out-consume Schopenhauer and Hegel, +And Wittgenstein was a beery swine who was just as schloshed as Schlegel. +There's nothing Nietzsche couldn't teach ya 'bout the raising of the wrist. +Socrates, himself, was permanently pissed! + +John Stuart Mill, of his own free will, +On half a pint of shandy was particularly ill. +Plato, they say, could stick it away, half a crate of whiskey every day. +Aristotle, Aristotle was a bugger for the bottle, +Hobbes was fond of his dram, +And Rene Descartes was a drunken fart: "I drink, therefore I am". +Yes, Socrates, himself, is particularly missed; +A lovely little thinker but a bugger when he's pissed! + -- Monty Python, "The Philosopher's Drinking Song" +%% +In France they piss on Main Street +(In pissoirs, Mama, not cheap display). + -- Joni Mitchell +%% +In a recent survey on why some men are homosexual, 82 percent of the gay +chaps responding said that either genetics or home environment was the +principal factor. The remaining 18 percent revealed that they had been +sucked into it. +%% +In days of old, when knights were bold, + And rubbers weren't invented, +They tied their socks around their cocks + And babies were prevented. +%% +In my sweet little Alice Blue gown +Was the first time I ever laid down, + I was both proud and shy + As he opened his fly +And the moment I saw it I thought I would die. + +Oh it hung almost down to the ground, +As it went in I made not a sound, + The more that he shoved it + The more that I loved it, +As he came on my Alice Blue gown. +%% +In my sweet little night gown of blue, +On the first night that I slept with you, + I was both shy and scared + As the bed was prepared, +And you played peekaboo with my ribbons of blue. + +As we both watched the break of day, +And in peaceful submission I lay, + You said you adored it + But dammit, you tore it, +My sweet little night gown of blue. +%% +In outer space, nobody can hear you fart. +%% +In the beginning was the DEMO Project. And the Project was without form. +And darkness was upon the staff members thereof. So they spake unto +their Division Head, saying, "It is a crock of shit, and it stinks." + +And the Division Head spake unto his Department Head, saying, +"It is a crock of excrement and none may abide the odor thereof." +Now, the Department Head spake unto his Directorate Head, saying, +"It is a container of excrement, and is very strong, such that none +may abide before it." And it came to pass that the Directorate Head +spake unto the Assistant Technical Director, saying, "It is a vessel +of fertilizer and none may abide by its strength." + +And the assistant Technical Director spake thus unto the Technical +Director, saying, "It containeth that which aids growth and it is +very strong." And, Lo, the Technical Director spake then unto the +Captain, saying, "The powerful new Project will help promote the +growth of the Laboratories." + +And the Captain looked down upon the Project, and He saw that it was Good! +%% +In the romantic days of Warsaw, Viennese whores were known for their +beauty and delicacy. A gallant officer picked up one such lady of the +evening, who took him to her apartment. They made delicious love all +evening before drifting to sleep in each others' arms. In the morning +the man dressed, staring into a full-length mirror. The lady lay in her +bed watching him. Finally, she said softly, + "Didn't you forget something?" + "What did I forget?" asked the officer. + "You forgot about the money," said the lady. + "Oh, no," said the man, standing at ramrod attention. +"A Polish officer never accepts money." +%% +In the shade of the old apple tree +Where between her fat legs I could see + A little brown spot + With the hair in a knot, +And it certainly looked good to me. + +I asked as I tickled her tit +If she thought that my big thing would fit. + She said it would do + So we had a good screw In the shade of the old apple tree +In the shade of the old apple tree. I got all that was coming to me. + In the soft dewy grass +I could hear the dull buzz of the bee I had a fine piece of ass +As he sunk his grub hooks into me. From a maiden that was fine to see. + Her ass it was fine + But you should have seen mine +In the shade of the old apple tree. +%% +It is a sad commentary on today's society that this fortune has to be +classified as "offensive" simply because it contains the word "fuck". +%% +It is better to have Uranus in Cancer than to have Cancer in Uranus. +%% +It is far better to sleep with an old hen than pullet. +%% +It is not wise to make love more than once in the morning. +You never know who you'll meet later in the day. +%% +It takes a brave man to admit his mistakes. +Especially in a paternity hearing. +%% +It takes leather balls to play rugby. + (Blood makes the grass grow!) +%% +It used to be a man's world, and the woman's place was in the home. +They can kiss that shit goodbye. +%% +It was New Year's Eve and the house was brightly decorated with holiday +trappings. The only sound that broke the quiet was the click of Grandma's +knitting needles. The children; Jane, eight and Mary, five, were seated +in front of a cheerily burning fire, leafing through a picture book. +Tiring of this, they went over to Grandma's rocker. Jane climbed up on +the arm of the chair and Mary snuggled into Grandma's cozy lap. + "Tell us a story," begged Mary. + "Oh," said the old lady, laying aside her knitting and wrapping +her arms around the children. "What story should I tell you?" + "Tell us our favorite story," whispered little Jane eagerly. +"About the time you were a hooker in Chicago." +%% +It was a warm, sunny Sunday, so a man and his wife decided to take in the zoo. +They spent the day, and at closing time they walked past the gorilla cage, and +the man noticed the gorilla looking at his wife. "That gorilla is getting +excited just looking at your tits," he said. "Why don't you take your blouse +off and we'll see what he does?" + At first she refused. But finally persuaded by her husband, she took +off her blouse and bra. The gorilla went nuts. He started grunting and +jumping up and down. + "Hey," the husband said, "let's really blow his mind. Take off all +your clothes and we'll see what he does." + Again she said no and again he persuaded her. This time the ape +really went bananas! He climbed up and down the bars, did flips, ran around +in circles and tossed his food all over the cage. The husband went over to +the cage, opened the door and pushed his wife in. + "Now," said the husband, "tell that motherfucker you have a headache!" +%% +It was almost closing time when a male patron who had been getting the +frosty treatment from a girl at the end of the bar called to the +bartender and said, "Give that bitchy douche bag over there one on me." + "We discourage that sort of language here, sir," the bartender +answered sternly. + "OK, OK. Serve the lady a cocktail with my compliments." + The bartender approached the female in question. "The, uh, gentleman +at the other end of the bar would like to buy you a drink, miss. What would +you like?" + "Vinegar and water." +%% +It was at the eighth annual mouse convention and mice from near and far had +gathered for the ball. A pretty little female mouse waltzed by the stag +line and one of the males whistled a low, dirty whistle to himself. +Turning to another mouse he said, "Look at the legs on that bitch, aren't +they beautiful?" + "Just fair," was the answer. + "You're crazy," said the first mouse and then turning to another, +asked his opinion. + "They're nice," said the third mouse, "but nothing to get excited +about." + "Some mice have no appreciation," exclaimed the first mouse. "Now +you," he said to a fourth mouse, "what did you think?" + "To tell you the truth," was the reply, "I'm no authority on legs, +I'm a tit mouse myself." +%% +It was her wedding night, and the sweet young thing was in a romantic haze. +"Oh, darling," she sighed, "We're married at last. It's all like a wonderful +dream!" + Her husband didn't answer. A few moments passed. She sighed again +and said, "I'm afraid I'll awake in a moment and find it isn't true." + Still no response from her spouse. Another pause and another +sensuous sigh, then, softly, "I just can't believe that I'm really your +wife." + "Damn it," growled her mate, "as soon as I get this shoelace untied, +you will!" +%% +It was his third marriage and her fourth. He was quite surprised when on +their honeymoon she pleaded, "Please be gentle, I'm still a virgin." + "Darling, what do you mean you're still a virgin? You've been +married three times." + "Yes, but they all worked for DEC. The first was a salesman, +and all he ever did was promise how good it would be. The second was one +of their software hacks, he told me to take care of it myself. And the +third was a field service representative, and he kept promising that it +would be up in 15 minutes. +%% + It was in a bar in midtown Manhattan and the Frenchman and the +American were talking about love over some dry Martinis. "Deed you know, +sir," the Frenchman said, "that een my country thair are 79 different +ways how to make the REAL, passionate luff?" + "Do tell?" said the American. "Well, that's amazing. In this +country there's only one." + "Just one?" the Frenchman said, condescendingly. "And what eez +that?" + "Well, there's a man and a woman, and --" + "Sacre bleu!!" exclaimed the Frenchman. "Numbair 80!" +%% +It was the first day of a new term at Princeton, and a Texas A&M freshman +was learning his way around the campus. Stopping a distinguished looking +upperclassman, he inquired, + "Say, buddy, can you tell me where the library is at?" + "My good fellow," came the reply, "at Princeton we do not end our +sentences with a preposition." + "All right," said the freshman, "can you tell me where the library +is at, asshole?" +%% +It's a question of Napleon brandy versus Ripple. +I am mellow and amber and I go down real smooth. + -- Rita Moreno, commenting in Newsweek on the sex appeal + of older women versus younger women +%% +"It's always the same," the girl sighed to her roommate after returning +in the wee, small hours. "Afterward, I feel so compromised, so cheap, so +soiled... so absolutely wonderful from head to toe!" +%% +It's better to be pissed off than pissed on. +%% +It's hard to keep a good girl down -- but lots of fun trying. +%% +It's not the ups and downs of love, it's the ins and outs. +%% +It's so fuckin' great to be alive! +%% +It's the sighs that count. +%% +I've been watching you closely to see if you have been good this year; +and since you have, I will be telling my elves to make some goodies for me +to leave under your tree on Christmas. I was going to bring you all the +gifts from the twelve days of Christmas, but we had a little problem up here. +The twelve fiddlers fiddling have all come down with V.D. from fiddling with +the ten ladies dancing, the eleven lords-a-leaping have knocked up the eight +maids-a-milking, and the nine pipers piping have been arrested for doing +weird things to the seven swans-a-swimming and the six geese-a-laying. The +four calling birds, three French hens, two turtle doves, and the partridge +in the pear tree have me up to my ass in birdshit. On top of all this, Mrs. +Claus is going through menopause, eight of my reindeer are in heat, the elves +have joined gay liberation, and those dumb ass Polacks have scheduled +Christmas for the fifth of February. I'll do what I can. + Sincerely, + Santa +%% +I've finally found the perfect girl, +I couldn't ask for more, +She's deaf and dumb and over-sexed, +And owns a liquor store. +%% +Jack an Jill went up the hill. +Jill went down, +Jack came. +%% +Jack and Jill went up a hill +To fetch a pail of water. +Jack fell down and broke his crown Jack on Jill produced a thrill +And Jill came tumbling after. When on the ground he got her, + Then went down and told the town + He tumbled Jill and gaffed her. +Jack to Jill thus did such ill +That Jill, to pay the rotter, +Told the town Jack's crown broke down Jack and Jill have split the bill +When he set out to shaft her. Since Jack led Jill to totter. + Half the town deals Jill a frown + And half greets Jack with laughter. +%% +Jack and Jill went up the hill +Each had a buck and a quarter. +Jill came down with two and a half -- +And you thought that they went for water. +%% +Jack be nimble, Jack be quick. +Jack jumped over the candle stick, +And burnt his balls. +%% +Jesus loves you, but everybody else thinks you're a dork. +%% +Jesus was killed by a Moral Majority. +%% +Joan of Arc is alive and medium well. +%% +Joe sat as his dying wife's bedside. +Her voice was little more than a whisper. + "Joe, darling," she breathed, "I've got a confession to make +before I go. I ... I'm the one who took the $10,000 from your safe... +I spent it on a fling with your best friend, Charles. And it was I who +forced your mistress to leave the city. And I am the one who reported +your income-tax evasion to the I.R.S..." + "That's all right, dearest, don't give it a second thought," +whispered Joe. "I'm the one who poisoned you." +%% +John Birch Society: + That pathetic manifestation of organized apoplexy. + -- Edward P. Morgan +%% +Kasha, n: + Kasha is always defined as "buckwheat groats". There's only one + problem with this definition: what the fuck are "buckwheat groats"? + I know what they are -- they're kasha. But that doesn't help you + much. +%% +Knowledge Engineering: + +A combination of: + +Engineering, n: + The application of science and mathematics by which the properties +of matter and the sources of energy in nature are made useful to man in +structures, machines, products, systems and processes. + +and + +Knowledge, n: + Sexual intercourse. + +See also: Prostitution, Grantsmanship. +%% +Kotex, n: + Not the best thing on earth, but next to the best. +%% +Kumquat, n: + Any of several small citrus fruits with sweet spongy rind and + somewhat acidic pulp that are used chiefly for preserves. + Extremely popular in some forms of sexual intercourse. In fact, + an early indication that your partner is willing to experiment + sexually may be a rather insistent moaning of "kumquat, kumquat" + during orgasm. + + Note: this is *not* to be confused with a warning from your + partner that his/her parents are upstairs and probably awake. +%% +Kissing, petting, and even intercourse are all right as long as they are +sincere. I have never given a kiss in my life that wasn't sincere. As +for intercourse, I'd say three times a day was about right. + -- Margaret Sangor +%% +Labia majora, n: + The curly gates. +%% +LAGNAF: + Let's All Get Naked And Fuck! +%% +Lawyer, n: + Someone who can get a sodomy charge changed to "following too + closely." +%% + LEPROSY +Leprosy, all my skin is falling off of me. +I'm not half the man I used to be. +Oh, how did I get leprosy? + +Syphillis, it all started with a simple kiss. +Now it even hurts to take a piss. +Oh why did I get syphillis? + +Why'd she have VD? I don't know, she wouldn't say. +I did something wrong, now I long for yesterday .... + -- To the tune of "Yesterday" +%% +LIBRA (Sept 23 - Oct 22) + You are the artistic type and have a difficult time with +reality. If you are a man, you are more than likely gay. Chances for +employment and monetary gains are excellent. Most Libra women are +prostitutes. All Libra people die of Venereal disease. +%% +Lucky, adj: + When you have a wife and a cigarette + lighter -- both of which work. +%% +Luser, n: + Someone who picks up a female + hitch-hiker walking home from a date. +%% +Large cats can be dangerous, but a little pussy never hurt anyone. +%% +Lawyers do it to everyone. +%% +Let a Field Service Engineer put it in. +%% +Life is a bitch, but the puppies can be cute. +%% +Life is a shit sandwich, and every day you get to take another bite. +It's just that some days are TWO BITE days ... +%% +Life is like a cucumber -- one moment it's +in your hand, the next it's up your ass. +%% +Life is like a penis: when it's soft you +can't beat it, and when it's hard you get fucked. +%% +Lipstick on your dipstick told a tale on you, +Lipstick on your dipstick said you were untrue. +Bet your bottom dollar you and I are through, +'Cause lipstick on your dipstick told a tale on you. + -- To the tune of "Lipstick On Your Collar" +%% +Lisp hackers + ... do it in CARS. + ... do it with tail recursion. + ... first do it in the front, then do it in the back. + ... have DEFUN while doing it. + ... have to be bound to do it. + ... have Moby dicks. +%% +Little Herbie had been blind since birth. One day at bedtime, his mother +told him that the next day was a very special one. If he prayed extra +hard, he'd be able to see when he woke up the next morning. The next +morning she came into Herbie's room and asked him if he'd prayed hard +the night before. + "Yes, Mommie," was his reply, "all night long!" + "Well, then," she said, "open your eyes and you'll know that +your prayers have been answered." +Little Herbie opened his eyes, only to cry out, + "Mother! Mother! I still can't see!" + "I know, dear," said his mother, "April Fool." +%% +Little Johnny with a grin, +Drank up all of daddy's gin, +Mother said, when he was plastered, +Go to bed, you little love-child. +%% +Little Miss Muffet sat on a tuffet, +Eating her curds and whey. +Along came a spider +And bit her right in the snatch. +%% +Little Red Riding Hood was walking through the woods on her way to visit +her grandmother when a wolf jumped out from behind a tree. + "Aha!" the wolf said, "Now I've got you, and I'm going to eat you." + "Eat, eat, eat," said Little Red Riding Hood angrily, +"Damn it, doesn't anybody fuck anymore?" +%% +Living in California is like living in a bowl of granola. +What ain't flakes and nuts is fruits. +%% +Love is blind but desire doesn't give a good goddam. + -- James Thurber +%% +Love is eating her even when she's not having her period. +%% +Love is just for now ... herpes lasts forever. +%% +Macho, adj: + Jogging home from a vasectomy. +%% +Male, n: + Life support system for a cock. +%% +Marriage, n: + The evil aye. +%% +Menage a trois, n: + Using both hands to masturbate. +%% +Meteorologist, n: + A man who can look in a woman's eyes and predict whether. +%% +Missionary position: + The missionary on top. +%% +Mistress, n: + Something between a mister and a mattress. +%% +Montana: + Where men are men and women are sheep. +%% +Ma Bell runs a baudy house. +%% +Man who dance in crowded ballroom +dance cheek to cheek with woman behind him. +%% +Man who keep money in jockstrap has financial matters all balled up. +%% +Many a bachelor feels the need to insert his masculinity. +%% +Many a wife thinks her husband is the world's greatest lover. +But she can never catch him at it. +%% +Many a woman hasn't realized that she was raped until the check bounced. +%% +Many nice things suck. +%% +Marijuana is nature's way of saying, "Hi!". +%% +Marriage is learning about women the hard way. +%% +Mary had a little lamb, +She kept it in a bucket. +And every time she let it out, +The bulldog used to +Chase it around the garden. +%% +Mary had a little sheep, +And with the sheep she went to sleep, +The sheep turned out to be a ram, +And Mary had a little lamb. +%% +Mary had a little watch; +She swallowed it one day. +And so she took some Ex-Lax +To pass the time away. + +But when she took the Ex-Lax +The time it did not pass. +So when you want to know the time, +Just look up Mary's ... + Uncle, he has a watch, too. +%% +Don't knock masturbation, it's sex with someone I love. + -- Woody Allen +%% +Mathematicians + ... do it in groups. + ... do it in theory. + ... take it to the limit. +%% +Maybe if the guy who developed Twinkies hadn't had such a low +opinion of himself they would have been an inch or two longer! +%% +Meanwhile, back at the ranch, Granny was a-beating off the Indians, but they +jus' kept on a-comin'. And, as the U.S. fourth Calvary mounted the hill, +Tonto, cleverly disguised as a doorknob, came off in the Lone Ranger's hand. +%% +Mickey Mouse has a long talk one day with a psychiatrist, after which +the psychiatrist interviews Minnie Mouse. A few days later Mickey meets +with the psychiatrist, and the following conversation ensues: + +Sigmund : I talked with Minnie after talking with you. +Mickey : Oh? +Sigmund : I couldn't find anything wrong with her -- she isn't insane. +Mickey : Idiot! I didn't say she was insane -- I said she was + fuckin' Goofy. +%% +Mistress Mary, quite contrary, +How does your garden grow? +With silver bells and cockle shells, +And one fucked-up petunia. +%% +Morris left for a two-day business trip to Chicago. He was only a few +blocks from his house, when he realized that he had left the airplane +tickets on his bureau top. He returned and quietly entered the house. +His wife, in her skimpiest negligee, was standing at the sink washing +the breakfast dishes. She looked so inviting that he tiptoed up behind +her, reached out, and squeezed her breast. + "Leave only one quart of milk," she said. "Morris won't be here +for breakfast tomorrow." +%% +Most seminars have a happy ending. Everyone's glad when they're over. +%% +Most women look for a man who is tall, dark and hung some. +%% +Motto of the Electrical Engineer: + Working computer hardware is a lot like an erect penis: + it stays up as long as you don't fuck with it. +%% +Moustache rides, 50 cents. +%% +Mrs. Johnson had a very beautiful and intelligent parrot. He had just one +problem: He liked to fuck Mr. Hawkins' chickens. Mrs. Johnson scolded him +time and time again, but he would just laugh at her. Finally, she told him +that if he did it again, she would cut off all of the feathers on the top of +his head. Well, he resisted the urge for a week, but one day, he just +couldn't resist going next door. Besides, he figured she was bluffing. + Well, Mr. Hawkins came over, ranting and raving about how the parrot +had been fucking his chickens again. Mrs. Johnson didn't say a word, just +took out her scissors and cut off all of the parrot's head feathers. + That night, Mrs. Johnson had a big party at her house. Before it +started, she took the parrot and put him on top of the piano by the front +door. "Since you disobeyed me today, you have to stay here on the piano +tonight. Now, don't you dare move." + Well, the parrot was pretty pissed off about having his head bare, +and he wasn't too happy about having to spend the whole evening on the piano. +Still, as he usually did, when the butler would announce the guests as they +arrived, he would say hello to them. Just then, two bald-headed men came to +the door. + Before the butler could say anything, the parrot yelled, "Okay, you +chicken-fuckers, up here on the piano with me!" +%% +Much to his Mum and Dad's dismay, Horace ate himself one day. +He didn't stop to say his grace, he just sat down and ate his face. +"We can't have this!" his Dad declared, "If that lad's ate, he should + be shared." +But even as he spoke they saw Horace eating more and more: +First his legs and then his thighs, his arms, his nose, his hair, his eyes... +"Stop him someone!" Mother cried, "Those eyeballs would be better fried!" +But all too late, for they were gone, and he had started on his dong... +"Oh! foolish child!" the father mourns "You could have deep-fried that + with prawns, +Some parsley and and some tartar sauce..." +But H. was on his second course: his liver and his lights and lung, +His ears, his neck, his chin, his tongue; "To think I raised him from the cot, +And now he's going to scoff the lot!" +His Mother cried: "What shall we do? What's left won't even make a stew..." +And as she wept, her son was seen, to eat his head, his heart his spleen. +and there he lay: a boy no more, just a stomach on the floor... +None the less, since it *was* his, they ate it -- that's what haggis is. +%% +Must be getting close to town -- we're hitting more people. +%% +My brother-in-law has found a way to make ends meet. +He goes around with his head stuck up his ass. +%% +My girlfriend and I sure had a good time at the beach last summer. First +she'd bury me in the sand, then I'd bury her. This summer I'm going to go +back and dig her up. +%% +My girlfriend's favorite erotic position is bending over my credit cards. +%% + "My mother," said the sweet young steno, "says there are some things +a girl should not do before twenty." + "Your mother is right," said the executive, "I don't like a large +audience, either." +%% +My sex life hasn't been so good; either fist or famine. +%% +Navel, n: + A place to stash your gum on the way down. +%% +Necrophilia, n: + Dropping in for a cold one. +%% +NEW ADDITION TO THE LIBRARY: + "Sally", the department's new inflatable doll, is available on +a short-term removal basis only -- please sign her out and return her +promptly to avoid extended waits. (We are still awaiting shipment of +our "Big John" doll.) +%% +New York: + Where men are men, sheep enjoy it, and lepers laugh their heads off. +%% +NEWSFLASH!! + Rodney Fenster looked up the shaft of elevator number four at +1700 N. 17th St. this morning to see if the elevator was on its way down. +It was. Age 31. +%% +Nothing, n: + A man with an erection who walks into a wall and breaks his nose. +%% +Naked children are so perfectly pure and lovely. I confess I do not admire +naked boys. They always seem to me to need clothes -- whereas one hardly +sees why the lovely forms of girls should ever be covered up. + -- Lewis Carroll +%% +Nancy Reagan wants to divorce old Ron... +seems he's making it hard for everyone but her. +%% +Need to buy black lace crotchless panties for sheep? +Try Fredricks of Ithaca, New York. +%% + Never take a resume seriously. Resumes only make money for the +people who write the resumes. No resume ever tells an employer how many +times a job applicant has had the clap. + Why, indeed, would anyone hire a person based +on a resume written by a professional liar? + If the applicant is a man, the employer must ask only one question: +did the applicant go to TCU? + If the applicant is a woman, the employer may simply ask: does she +have a tongue that can lick the paint off a dormitory wall? + -- Dan Jenkins, "Baja Oklahoma" +%% +Never try to keep up with the Joneses; they might be newlyweds. +%% +New Jersey is not the armpit of the nation; +it's the asshole of the universe. + -- Jonathan Michael Smith +%% +Nice computers don't go down. +%% +Nine out of ten men who preferred Camels have switched back to women. +%% +Nine reasons a taco is better than a woman: + 1: Tacos don't put frilly covers on the toilet seat + so the lid won't stay up. + 2: Tacos don't use your razor on their legs. + 3: Tacos don't say "That's okay, it doesn't have to be good for me." + 4: Tacos don't get upset if you eat another taco, "Just for fun." + 5: Tacos will never contest a divorce, + demand a property settlement or seek custody of anything. + 6: Tacos won't ask you about your last lover, + or speculate about your next one. + 7: A taco will never make a scene because + there are other tacos in the refrigerator. + 8: It's easy to drop a taco. + 9: Tacos don't want to sleep on your chest. +%% +OLD FELLA RED CLARET + Produce of Australia -- "The Big 69'er" + +An unusual "Rough-as-Guts" wine that has the Distinctive Bouquet of old +and ill-cared for animals. It is best drunk with the teeth clenched to +prevent ingestion of the seeds and skins. Connoisseurs will savour the +slight Tannin Taste of burnt shag feathers and soiled medical dressings. +Possessors of a cultivated Palate admire the initial assault on the taste +buds which comes from the careful and loving blending of circus hosings +with perished jock straps. The maturing in Midland Abattoir hogsheads +gives it a very Definite Nose. With the bouquet like an aborigine's armpit. +In the United States this wine is marketed as Crow Brand (9 out of 10 people +who drink it for the first time exclaim "VRAAAARRRRRK"). + +It won a Bronze at the "Kings Cross Homosexuals Convention" of 1973 + +Warning: Avoid contact with eyes and open cuts. + Keep away from open naked flames -- both old and new. +%% +Oral sex, n: + The taste of things to come. +%% +Oh, I'm looking over, my dead dog Rover, +That got run over with my mower. +One leg is missing, and one other is gone, +The fourth one is scattered all over the lawn. +It's no use explain'n, the one remaining, +It landed by the kitchen door. +Oh, I'm looking over, my dead dog rover, +that ain't gonna walk no more... + -- Tune is something about a four-leaf clover. +%% +Oh John, let's not park here. +Oh John, let's not park. +Oh John, let's not. +Oh John, let's. +Oh John. +Oh. +%% +Oh, baby, put two fingers here and one finger there and call me bitch. +%% +Oh give me a home, where the bookmakers roam, +Where the beer and the whiskey flows free, +Where never is heard, a discouraging word, +And the call-girls keep callin' for me! +%% +Old Mother Hubbard, +Went to the cubbard, +To get her poor doggie a bone. + +But when she stooped over, +Old Rover, he drove her. +You see, he had a bone of his own. +%% +On Brassieres: + Russian: Uplifts the masses. + Salvation Army: Raises the fallen. + American: Makes mountains out of molehills. +%% +On an isolated stretch of beach near Cannes, a beautiful French girl threw +herself into the sea and drowned despite a young man's attempt to save her. +The man dragged the half-nude body ashore and left it on the sand while he +went to notify the authorities. Upon his return, he was horrified to find +a man making love to the corpse. + "Monsieur, monsieur," he shouted, "that woman is dead, +that woman is dead!" + "Sacre bleu," exclaimed the man, springing up. +"I thought she was an American!" +%% +Ona day Ima gonna to Detroit to a bigga hotel. Ina morning I go down to +eat breakfast. I tella waitress I wanna two piss's toast. She bringa me +only one piss. I tella her I wanna two piss ona my plate. She says you +better no piss on the plate, you sonna bitch. I don't even know the lady +and she call me sonna bitch. Later I go out to eat at the bigga restaurant. +The waitress bring me a spoon and a knife but no fock. I tell her I wanna +fock. She tells me everone wanna fock. I tell her "you no understand", I +wanna fock on the table. She say you better not fock on the table, you +sonna bitch. So I go back to my room ina hotel and there isa no shits ona +my bed. I calla the manager and tella him I wanna shit. He tella me to go +to the toilet. I say "you no understand", I wanna shit on the bed. He say +you better no shit ona bed, you sonna bitch. I go to check out and the man +at the desk say "peace to you". I say piss on you too, you sonna bitch. I +gonna back to Italy. +%% +Once upon a girl there was a time... +%% +Once upon a time there was a farmer who owned a large number of chickens and +made money by selling chickens to a local distributing company. The farmer +wanted to increase his business, and so went to market to buy another rooster. +"This rooster," assured the vendor, "is my best. He's virile and energetic +and will take care of all your chickens!" The farmer, delighted at this, +bought the rooster and returned to his farm. He set the rooster loose among +his hen houses and, sure enough, the rooster enthusiastically went to work. +It wasn't too long, however, before the rooster finished off all the hens and +began on the few geese and ducks that were on the farm. "If you keep up this +rate," warned the farmer, "you'll screw yourself to death!" The rooster, +however, scoffed at the farmer and continued at an increased speed. The next +morning, the farmer was doing his chores when he noticed several buzzards in +the sky circling over something. He headed out behind the barn, and sure +enough there was the rooster, flat on his back, with eyes closed. The farmer +shook his fist at the motionless body and cursed, shouting "I knew it! I told +you so! I knew you'd screw yourself to death!" The rooster turned his head +toward the farmer, opened one eye, and winked. "Shhh!" he said, pointing to +the birds above. "I think they're coming down." +%% +Once upon a time there was a little girl named Little Red Riding Hood. One +fine morning she decided to visit her Grandmother, so she put a freshly baked +cake and a .357 magnum into her basket and set off through the forest. When +she got there, what should she find but a big black wolf in the bed, who +jumped up, grabbed her and snarled, "I'm going to fuck you until the sun goes +down." + So Little Red Riding Hood whipped out the .357 and said, "Oh, no, +you're not! You're going to eat me just like the story says!" +%% +Once upon a time, there was a non-conforming sparrow who decided not to +fly south for the winter. However, soon after the weather turned cold, +the sparrow changed his mind and reluctantly started to fly south. +After a short time, ice began to form his on his wings and he fell to +earth in a barnyard almost frozen. A cow passed by and crapped on this +little bird and the sparrow thought it was the end, but the manure +warmed him and defrosted his wings. Warm and happy the little sparrow +began to sing. Just then, a large Tom cat came by and hearing the +chirping investigated the sounds. As Old Tom cleared away the manure, +he found the chirping bird and promptly ate him. +There are three morals to this story: +1) Everyone who shits on you is not necessarily your enemy. +2) Everyone who gets you out of shit is not necessarily your friend. +3) If you are warm and happy in a pile of shit, keep your mouth shut. +%% +Once upon a time there was a sperm named Stanley. He'd do pushups and +somersaults and limber up all the time, while the other sperm just lay around +on their fat asses not doing a thing. One day, one of them became curious +enough to ask Stanley why he exercised all day. Stanley said, + "Look, only one sperm gets a woman pregnant and when the right +time comes, I am going to be that one." +A few days later, the all felt themselves getting hotter and hotter, and they +knew that it was getting to be their time to go. They were released abruptly +and, sure enough, there was Stanley swimming far ahead of all the others. +All of a sudden, Stanley stopped, turned around, and began to swim back with +all his might. + "Go back! Go back!" he screamed. "It's a blow job!" +%% +Once upon a time there were three coeds -- a big coed, a medium-sized coed, +and a little, tiny coed. One night they came home from a dance, and the big +coed said, "Someone's been sleeping in my bed!" + The medium-sized coed looked in her room and said, "Someone's been +sleeping in my bed!" + And the little, tiny coed said, "Well, nighty-night, girls!" +%% +Once you've got them by the balls, their hearts and minds will follow. +%% +One by one the vice-presidents of a large corporation were called into the +boss's office. Then the junior executives were individually summoned. +Finally the office boy was brought in. + "I want the truth, Charles," the boss bellowed. "Have you been +playing around with my secretary?" + "N-no, sir," the office boy stammered. "I-I'd never do anything +like that, sir." + "All right, all right," sighed the boss, "then you fire her." +%% +One day Father O'Malley was walking through the park when he came upon an +enchanting scene. A beautiful little girl with long blond hair, deep blue +eyes, and a dainty white dress was reading under a tree with her adorable +little dog. + What a lovely picture, thought the Father to himself. Walking over, +he asked, "Child, what is your name?" + "Blossom," she replied. + "What a fitting name," exclaimed Father O'Malley. "And how did your +parents come to choose such a pretty name?" + "Well, one day when I was still in my mommy's tummy she was lying +under this very tree when a blossom fell and landed on her stomach. She +thought it was a message from God and decided that I would be a girl and my +name would be Blossom," explained the little girl sweetly. + How charming, thought the priest. He started to say good-bye and +walk away, then turned back. "And the name of your little dog?" he +inquired. + "Porky," was the child's reply. + Again he asked her how the unusual name had been chosen. + "Because he likes to fuck pigs." +%% +One day President Reagan, Chairman Brezhnev, the Pope, and a boy scout were +flying together in an airplane. Right out in the middle of nowhere the plane +developed engine trouble and started to go down. Unfortunately, only three +parachutes could be found for the four passengers! Brezhnev grabbed one of +the parachutes and declared "Comrades, as leader of the socialist workers +revolution, my life must be spared." And he jumped out of the plane. Then +Reagan exclaimed "As leader of the greatest nation on earth, I must keep the +world safe for democracy." And with that he too jumped to safety. Now if +you are following all this (or counting on your fingers) you must see that +there is only one parachute left for the two remaining passengers. The Pope +looked kindly upon the boy scout and said "I have had a long and productive +life, my son. You take the parachute and leave me in God's hands." "That's +very kind of you," the observant scout replied, "but there is no need. Reagan +just jumped out with my knapsack." +%% +One day a mouse was driving along the road in his Mercedes when he heard an +anguished roaring noise coming from the side of the road. Stopping the car, +he got out and discovered a lion stuck in a deep ditch and roaring for help. +Reassuring the lion, the mouse tied a rope around the axle of the Mercedes, +threw the other end down to the lion, and pulled the beast out of the ditch. +The lion thanked the mouse profusely and they went their separate ways. + Two weeks later the lion was out for a stroll in the country when +he heard a panicked squeaking coming from the side of the road. Investigating +the noise, what should he come across but the mouse stuck in the same hole. +"Oh, please help me, Mr. Lion," squeaked the terrified mouse. "I saved you +with my car once, remember?" + "Course I'll help you, little feller," roared the lion. "I'll just +lower my dick down to you, you hold on to it, and we'll have you out of there +in a jiffy." Sure enough, a few minutes later the mouse was high and dry on +the roadside, trying to convey his eternal gratitude to the lion. + "Don't give it another thought," said the lion kindly. "It just goes +to show that if you've got a big dick, you don't need a Mercedes." +%% +One fall day, two men were out in the woods hunting. Feeling a sudden need +to relieve himself, George went over to a nearby clump of bushes, unzipped +his fly, and started in when a poisonous snake lunged out of the bushes and +bit him on his penis. Hearing George's howl of pain and fright, his friend +Fred came running up and told him to lie still while he used the radio to +call a doctor. + "There's only one way to save your friend's life," said the doctor +gravely. "If you cut a shallow 'X' over the bite and then suck as much of +the poison out as you can, he'll probably be okay, but otherwise there's not +much hope." + Hearing Fred's footsteps, George rose weakly up on one elbow and +cried out, "Fred, what'd he say? What did the doctor say?" + "George, old friend," said Fred sadly, "he said you're gonna die." +%% +One man's nightmare is another man's wet dream. +%% + One night when his charge was pretty high, Micro-Farad decided to +seek out a cute little coil to let him discharge. He picked up Milli-Amp +and took her for a ride on his Megacycle. They rode across the Wheatstone +bridge, around the sine waves, and stopped in the magnetic field by the +flowing current. Micro-Farad, attracted by Milli-Amp's charactaristic curves, +soon had her fully charged and excited, her resistance to a minimum. He laid +her on the ground potential, raised her frequency, and lowered her reluctance. +He pulled out his high voltage probe and inserted it into her socket, +connecting them in parallel and began short circuiting her resistance shunt. +Fully excited, Milli-Amp mumbled: "OHM-OHM-OHM." + With his tube operating at a maximum and her field vibrating with +his current flow, it caused her shunt to overheat, and Micro-Farad was rapidly +discharged and drained of every electron. They Fluxed all night trying +various connections and sockets until his magnet had a soft core and lost +all of its field strength. + Afterwards, Milli-Amp tried self-induction and damaged her +solenoids. With his battery fully discharged, Micro-Farad was unable to +excite his field, so they spent the night reversing polarity and blowing +each others fuses. + -- Eddie Currents, "The Sex Life of an Electron" +%% +One of the airlines recently introduced a special half-fare rate for wives +accompanying their husbands on business trips. Anticipating some valuable +testimonials, the publicity department of the airline sent out letters to +all the wives of businessmen who used the special rates, asking how they +enjoyed their trip. Responses are still pouring in asking, + "What trip?" +%% +One should be cherry of virgins. +%% + One spring evening, after a hard rain, grandpa and grandson were +sitting out on the porch, talking. Grandpa spied a worm crawling up out +of its hole and said to his grandson, "Sonny, if you can get that there +worm back down its hole, I'll give you five dollars." + "Sure!", says sonny, and runs in the house. Out he runs an +instant later with a can of hairspray, grabs the worm, and sprays it with +the hairspray as it dangles earthward. He then slips the stiff worm back +into its hole and turns to his grandpa with a huge smile on his face. + "Well, I'll be. That was pretty smart there, boy.", he says. +"Here's your fiver.", he adds as he fishes out a bill. By then it's almost +dark, and they say their goodnights and part. + The next day sonny's playing out on the porch, and grandpa comes +out of the house and gives him a five. "But you gave me my five yesterday, +grandpa.", he remarks. + "Yep, I know. This is from your grandma." +%% +One who does not know a burro from a burrow +does not know his ass from a hole in the ground! +%% +Ooooooh, nooooooo, not tonite!! +%% +Operators mount anything! +%% +Opinions are like assholes -- everyone's got one, +but nobody wants to look at the other guy's. + -- Hal Hickman +%% +Over 5,000 years ago, Moses said to the children of Israel, + "Pick up your shovels, mount your asses and load your camels, +and I will lead you to the promised land." + Not too long ago, Roosevelt said, "Lay down your shovels, sit on +your asses, light a Camel, this is the promised land." + Now Nixon is stealing your shovels, kicking your asses, raising +the price of Camels, and mortgaging the promised land. +%% +PENIS ENVY: + The desire to be pink and wrinkled and about four inches long. +%% +PHILADELPHIA FLYING FUCK: + Okay, see, he hangs from a chin-up bar with his feet on the arms + of the rocking chair. She crouches in the rocking chair pleasuring + him orally. + + [Note: Personally, we've never tried this. If you have, or if + you do, please inform us of the results at Fortune, Box 1597, + Rockville IL. Thank you. Ed.] +%% + PLAYGIRL, Inc. + Philadelphia, Pa. 19369 +Dear Sir: + Your name has been submitted to us with your photo. I regret to +inform you that we will be unable to use your body in our centerfold. On +a scale of one to ten, your body was rated a minus two by a panel of women +ranging in age from 60 to 75 years. We tried to assemble a panel in the +age bracket of 25 to 35 years, but we could not get them to stop laughing +long enough to reach a decision. Should the taste of the American woman +ever change so drastically that bodies such as yours would be appropriate +in our magazine, you will be notified by this office. Please, don't call +us. + Sympathetically, + Amanda L. Smith + +p.s. We also want to commend you for your unusual pose. Were you + wounded in the war, or do you ride your bike a lot? +%% +POCKET POOL: + Well, for guys, it's two-ball in the side pocket. + For girls, it's playing the slots. +%% +POLISH FLY: + You put it in her drink and she begs you to take her bowling. +%% +PREMATURE EJACULATOR: + Troubled shooter. +%% +PUBIC HAIR: + Organic dental floss. +%% +Painters do it with even strokes. +%% +Pardon me, sir, but you've obviously +mistaken me for someone who gives a shit. +%% +People who live in glass houses should ball in the basement. +%% + People who write position papers often find themselves in an +enviable position. They are hired to write papers for both sides of the +position. + A good position paper will have many words in it like +"superincumbence," "egress," and "plurification." + You will not often find the phrase "lightweight dropcase +limp-wristed motherfucker" in a serious position paper. + Charts and multiplication tables should always be included in +position papers. They should look complicated enough to make Albert +Einstein stagger across the room for a Tylenol. + A good position paper will never underestimate the value of a +semicolon. + -- Dan Jenkins, "Baja Oklahoma" +%% +Physicists do it with charm. +%% +Picking up a man in a bar is like a snowstorm, you never know when +he's coming, how many inches you'll get or how long'll he'll stay. +%% +Politicians do it to everyone. +%% +Postulate #1: Nothing is better than sex. +Postulate #2: Masturbation is better than nothing. +Conclusion: Masturbation is better than sex. +%% +Pouring out his troubles to his great and good friend over a couple of +triple martinis, Brad had to confess that things weren't going too well +at home. "My wife and I just don't hit it off at night," he was saying +to Bart. "I hate to admit it, but I'm afraid I just don't know how to +make her happy." + "Hell, boy," said Bart, "there's really nothing to it. Let me +give you some advice. At bedtime, switch on a new Sinatra platter, turn +all the lights low and spray some perfume around the room. Next, tell +your wife to get into her sheerest nightie; then make sure you raise the +bottom window." + "Then what do I do?" asked Brad. + "Just whistle." + "Whistle?" + "That's right. I'll be waiting outside the window. When I hear +you whistle, I'll come right up and finish the job." +%% +Pregnancy -- the worst sexually transmitted disease of them all. +%% +Pregnancy begins with a single sell. +%% +Printers do it without wrinkling the sheets. +%% +Procrastinators do it tomorrow. +%% +Programmers do it bit by bit. +%% +Prostitution is the only business where you +can go into the hole and still come out ahead. +%% +Puff the Jewish dragon lived in Palestine, +And frollicked in the Autumn mist, +And drank Manishiewitz wine. +Little Rabbi Jacob loved that rascal Puff, +And brought him soup and Matzah balls, +And other kosher stuff. + +Then one day it happened, Puff was eating pork. +Little Rabbi Jacob took that dragon for a walk. +Gently he explained that dragons don't eat meat, +That come from little piggies who have dirty filthy feet. +%% +Q. Do you know how to tell a Polack at a cockfight? +A. He's the only one with a duck. + +Q. Do you know how to tell an Aggie at a cockfight? +A. He's the only one who bets on the duck. + +Q. And do you know how to tell the Mafia is at the cockfight? +A. The duck wins! +%% +Q: Have you ever been picked up by the fuzz? +A: No, but I bet it hurts like hell. +%% +Q: How can a real man tell when his girl friend's having an orgasm. +A: Real men don't care. +%% +Q: How can you tell the bride at a WASP wedding? +A: She's the one kissing the golden retriever. +%% +Q: How can you tell when a WASP is sexually aroused? +A: By the stiff upper lip. +%% +Q: How can you tell when your girlfriend has had an orgasm? +A: Who cares? +%% +Q: How did Hellen Keller burn the side of her face? +A: She answered the iron. + +Q: How did she burn the other side of her face? +A: They called back. +%% +Q: How do you fit 1000 dead babies into a phone booth? +A: Cusinart. + +Q: How do you get them back out? +A: Doritos. +%% +Q: How do you get a woman to stop having sex with you? +A: Propose. +%% +Q: How do you hide an elephant in a cherry tree? +A: Paint his balls red and his toenails green. + +Q: Ever see an elephant in a cherry tree? +A: No -- so it must work pretty well! + +Q: How did Tarzan die? +A: Picking cherries!!! +%% +Q: How do you know your elephant had her period? +A: There's a nickel on your dresser and your mattress is missing. +%% +Q: How do you make a dead baby float? +A: With 2 scoops of dead baby and some rootbeer. +%% +Q: How do you tell if two elephants have + been making love in your backyard? +A: Your Hefty trashcan liners are missing. +%% +Q: How do you tell if you're making love to a nurse, + a schoolteacher, or an airline stewardess? +A: A nurse says: "This won't hurt a bit." + A schoolteacher says: "We're going to have to do this + over and over again until we get it right." + An airline stewardess says: "Just hold this over your mouth + and nose, and breath normally." +%% +Q: How do you tell that your roommate's gay? +A: When his cock tastes like shit. +%% +Q: How does a girl know she's sleeping with a Computer Scientist? +A: It isn't hard. +%% +Q: How does a mink get babies? +A: The same way babies get minks. +%% +Q: How many Aggies does it take to eat an armadillo? +A: Three, one to eat it, and two to watch for traffic. +%% +Q: How many feminists does it take to screw in a lightbulb? +A: NONE! THAT'S NOT FUNNY!!!!! +%% +Q: How many heterosexual males does it take + to screw in a light bulb in San Fransisco? +A: Both of them. +%% +Q: How many lesbians does it take to screw in a lightbulb? +A: Ten. One to do it, and nine to talk about how gratifying + it was without a man. +%% +Q: If Tarzan was Jewish, and Jane was a princess, + what would Cheetah have been? +A: A fur coat. +%% +Q: What can you use used tampons for? +A: Tea bags for vampires. +%% +Q: What did Raggedy Anne say to Pinocchio as she was + sitting on his face? +A: Tell the truth! Tell a lie! Tell the truth! Tell a lie! +%% +Q: What do a walrus and a tupperware container have in common? +A: They both like a tight seal. +%% +Q: What do elephants use instead of tampons? +A: Sheep. Well, they used to, anyway. There have been so + many cases of Toxic Flock Syndrome recently that their + ewes has been discouraged. + +Q: Why do elephants have trunks? +A: Sheep don't have strings. +%% +Q: What do two WASPs say after making love? +A: Thank you very much. It'll never happen again. +%% +Q: What do you call a blind, deaf-mute, quadraplegic Virginian? +A: Trustworthy. +%% +Q: What do you call a nun who has had a sex change operation? +A: A transistor. +%% +Q: What do you call a truck load of vibrators? +A: Toys for twats. +%% +Q: What do you call a woman who can suck a + golf ball through 50 feet of garden hose? +A: Darling. + [Often? Ed.] +%% +Q: What do you call couples that use that rhythm method? +A: Parents. +%% +Q: What do you do if an Irishman throws a pin at you? +A: Run like hell, he's got a grenade in his mouth!! +%% +Q: What do you do with an elephant with three balls? +A: Walk him and pitch to the rhino. +%% +Q: What do you get when you cross a computer and a JAP? +A: A computer that won't go down on you. +%% +Q: What do you get when you cross a rooster with a telephone pole? +A: A thirty foot cock that wants to reach out and touch someone! +%% +Q: What do you get when you cross an onion with a donkey? +A: Well, most of the time you get an onion with big ears, but every + once in a while you get a piece of ass that will bring tears to + your eyes... +%% +Q: What do you say to a Puerto Rican in a three-piece suit? +A: Will the defendant please rise? +%% +Q: What goes green, red, green, red, green, red, pink? +A: A frog in a blender. + +Q: What do you get if you add 2 eggs to it?? +A: Frognogg. If you drink it, you croak. +%% +Q: What is black and white and red all over? +A: Half a nun. +%% +Q: What is green and comes in Brownies? +A: Boy Scouts. +%% +Q: What is the difference between snow-men and snow-women? +A: Snowballs! +%% +Q: What's a JAP's (Jewish American Princess) dream house? +A: Fourteen rooms in Scarsdale, no kitchen, no bedroom. +%% +Q: What's a WASPs idea of open-mindedness? +A: Dating a Canadian. +%% +Q: What's black and white and red all over and can't go through + revolving doors? +A: A nun with a javelin through her head. +%% +Q: What's buried in Grant's tomb? +A: A corpse. +%% +Q: What's hard going in and soft and sticky coming out? +A: Chewing gum. +%% +Q: What's invisible and smells like carrots? +A: Bunny farts. +%% +Q: What's red and has 7 dents? +A: Snow White's cherry. +%% +Q: What's the difference between a dog and a fox? +A: About four drinks. +%% +Q: What's the difference between a man and a toilet? +A: A toilet doesn't follow you around for a week after you flush it. +%% +Q: What's the difference between a man and the weekend? +A: The weekend never comes too soon. +%% +Q: What's the difference between a sorority girl and a fast car? +A: Not everyone's been in a fast car. +%% +Q: What's the difference between erotic and kinky? +A: Erotic is when you use a feather. + Kinky is when you use the whole bird... +%% +Q: What's the difference between hard and dark? +A: It stays dark all night. +%% +Q: What's the difference between your girlfriend and the Titanic? +A: Only 1100 men went down on the Titanic. +%% +Q: What's the last thing that goes through a + grasshopper's mind when he hits your windshield? +A: His ass. + +Q. What's the second-to-last thing to go + through a grasshopper's mind when he hits your windshield? +A. Oh, SHIT!! +%% +Q: What's white and crawls up your leg? +A: Uncle Ben's Perverted Rice. +%% +Q: What's worse than getting raped by Jack the Ripper? +A: Getting fingered by Captain Hook! +%% +Q: Where does Catwoman go for a good time? +A: To the batpoles, Robin! +%% +Q: Where does virgin wool come from? +A: Ugly sheep. +%% +Q: Where'd your girlfriend get those crow's feet? +A: From squinting and saying, "Suck what!?" +%% +Q: Why can't Hellen Keller have children? +A: Because she's dead. +%% +Q: Why did Captain Kirk piss on the bridge? +A: He wanted to boldly go where no man had gone before! +%% +Q: Why did God invent booze? +A: So ugly men could get laid too. +%% +Q: Why did Hellen Keller go all the way on her first date? +A: She'd never been taught to say no. +%% +Q: Why did Menachem Begin invade Lebanon? +A: To impress Jodie Foster. +%% +Q: Why did Ted Kennedy report the accident 8 hours after Mary + Jo Kopechne drowned? +A: Do you have any idea how hard it is to dress a woman underwater? +%% +Q: Why do dogs lick their private parts? +A: Because they can. +%% +Q: Why do ducks have webbed feet? +A: To stamp out forest firest. + +Q: Why do elephants have big flat feet? +A: To stamp out flaming ducks. +%% +Q: Why do men marry women? +A: You can't teach sheep to do housework. +%% +Q: Why do mice have such small balls? +A: Very few of them know how to dance! +%% +Q: Why do women have vaginas? +A: So when they're drunk, you can carry them like a six-pack. +%% +Q: Why do you put a baby in a blender feet first? +A: So you can watch the expression on its face. +%% +Q: Why does an elephant have 4 feet? +A: Because 8 inches isn't enough. +%% +Q: Why is it that Mexico isn't sending anyone to the '84 summer games? +A: Anyone in Mexico who can run, swim or jump is already in LA. +%% +RANDEL: + A nonsensical poem recited by Irish schoolboys as an + apology for farting at a friend. + -- Mrs. Byrne's Dictionary of Unusual, + Obscure & Preposterous Words +%% +REAL BUDDY: + Someone who'll go downtown and get two blowjobs, + and come back and give you one. +%% +REFORMED: + A synagogue that closes for the Jewish holidays. +%% +REJECTION: + When you're masturbating and your hand falls asleep. +%% +ROWING: + Eight big men and their cute little cox. +%% +RUGBY: + A sport requiring leather balls. +%% +Ralph: Lisa, you have no tits and a awful tight pussy. +Lisa: Ralph... get off my back!! +%% +Reach out and fuck someone. +%% +Reefers and roach clips and papers and rollers +Cocaine and procaine for twenty year molars +Reds and peyote to work out your bugs +These are a few of my favorite drugs. + +Uppers and downers and methedrine freakout +Take some amphetamines, watch your brains leak out +Acid and mescaline pull out your plugs +These are a few of my favorite drugs. + +Backs that are perfect for carrying monkeys +Users of heroin, often called junkies +Methadone helps then to stop being thugs +Takes them off one of my favorite drugs. + + On a bad trip + When the cops come + When I lose my head + I simply take more of my favorite drugs + And then I'm not sad -- I'm dead! + -- My Favorite Drugs, sung to "My Favorite Things" +%% +Religion is fine, Churchianity sucks. +%% +Remember, when preparing a dish for bedtime, +champagne is the best tenderizer. +%% +Remember when you were a kid and the boys didn't like the girls? Only +sissies liked girls? What I'm trying to tell you is that nothing's +changed. You think boys grow out of not liking girls, but we don't grow +out of it. We just grow horny. That's the problem. We mix up liking +pussy for liking girls. Believe me, one couldn't have less to do with +the other. + -- Jules Feiffer +%% +Revenge is sleeping with your enemy's wife. +Sweet revenge is the realization that she's a lousy lay. +%% +Rogue players do it with all sorts of different animals. +%% +Roses on your piano isn't nearly as good as tulips on your organ. +%% +SMALL: + Is it in yet? +%% +SPINSTER: + Unlusted number. +%% +SUCCESSFUL CUNNILINGUS: + When you wake up the next morning + with a face like a frosted doughnut. +%% +SUGAR DADDY: + A man who can afford to raise cain. +%% +Said Einstein, "I have an equation +Which to some may seem Rabelaisian: + Let V be virginity + Approaching infinity; +Let P be a constant persuasion; + +"Let V over P be inverted +With the square root of Mu inserted + N times into V ... + The result, Q.E.D., +Is a relative!" Einstein asserted. +%% +Said the attractive, cigar-smoking housewife to her girl-friend: "I +got started one night when George came home and found one burning in +the ashtray." +%% +Sam Lefkovitz is having an intimate party to celebrate his thirty +immensely profitable years in the construction business. + "You know," he laments to his friends, "over the years I have +constructed dozens of enormous projects in and around this city, but +am I known as Sam the Builder? No. + And over the years I have contributed literally millions of +dollars to charitable causes of one sort or another, but am I called +Sam the Philanthropist? No sir! + But suck one little cock..." +%% +Save Soviet Jewry -- Win Valuable Prizes!!!! +%% +Save a forest - eat a beaver! +%% +Save a mouse, eat a pussy! +%% +Save the whales. Club a seal instead. +%% +"Scott, baby," the sexually aggressive girl murmured as she guided +her date's finger to her clitoris, "This bud's for you." +%% +Sex and drugs and UNIX. +%% +Sex and drugs and rock and roll, +Is all my brain and body need. +Sex and drugs and rock and roll, +Are very good indeed. + +Take your silly ways, +Throw them out the window, +The wisdom of your ways, +I've been there and I know, +Lots of other ways... + -- Ian Drury, "New Boots and Panties" +%% +Sex is better than grass, if you have the right pusher. +%% +Sex is dirty, but only if you do it right. +%% +Sex is great, +Sex is grand, +Sex around here, +Is mostly by hand. +%% +Sex is just one damp thing after another. +%% +Sex is like a bridge game -- +If you have a good hand no partner is needed. +%% +Sex is not the answer. Sex is the question. "Yes" is the answer. +%% +Sex is what women have and men want. +%% +Share and enjoy, share and enjoy. +Journey through life with a plastic boy or girl by your side. +Let your pal be your guide. +And when it breaks down or starts to annoy, + or grinds when it moves and gives you no joy, + 'cause it digs up your hat, + or has sex with your cat, + sprays oil on your wall or rips off your door, + and you get to the point you can't stand any more. +Bring it to us, we won't give a shit. +We'll tell you: "Go stick your head in a pig". +%% +She asked me if I loved her still. +"Yes," I replied. "I've never had you any other way." +%% +She called her parakeet Onan, because he spilled his seed. + -- Dorothy Parker +%% +She hates testicles, thus limiting the men +she can admire to Democratic candidates for president. + -- John Greenway, "The American Tradition", + on feminist Elizabeth Gould Davis +%% +She never liked zippers, she said, +Until she opened one in bed. +%% +She was a farmer's daughter but she couldn't keep her calves together. +%% +She was wearing a very tight skirt, and when she tried to board the Fifth +Avenue bus she found she couldn't lift her leg. She reached back and +unzipped her zipper. It didn't seem to do any good, so she reached back +and unzipped it again. Suddenly the man behind her lifted her up and put +her on the top step. + "How dare you?" she demanded. + "Well, lady," he said, "by the time you unzipped my fly for the +second time I thought we'd become good friends." +%% +She's fine, upstanding, and wonderful laying down. +%% +Short man who dance with tall woman gets bust in mouth. +%% + Shortly after arriving at their honeymoon destination, the +still-nervous groom became worried about the state of his bride's innocence. +Deciding on a direct confrontation, he quickly undressed, pointed at his +exposed manhood and asked his mate, "Do you know what this is?" + Without hesitation, she blushingly answered, "That's a wee-wee." + Delighted at the idea of instructing his naive wife in the ways of +love, the husband whispered, "From now on, dearest, this will be called a +prick." + "Oh, come now," the girl chided. "I've seen lots of pricks and I +assure you, that's a wee-wee." +%% +Sixteen'll get you twenty. +%% +Sniff sniff... Hey! Who farted? +%% +Snow White: + "Gee guys, I've always dreamed of getting seven inches... + but not an inch at a time! +%% +So, how's your love life? +Still holding your own? +%% +So, if there's no God, who changes the water? + -- New Yorker cartoon of two goldfish in a bowl +%% +So this elderly couple were sitting in their tiny cold water flat on the +lower East Side when the husband said, "Doris, we're in bad shape. Inflation +has eaten up our Social Security check. The next one isn't due for a week +and we've got no money left for food." + "Could I do anything to help?" she asked. + "Yes," he said. "I hate to see you do this but it's the only way. +You're going to have to go out and hustle." + "Me?" she asked. "At the age of sixty-five?" + "It's the only way," he said. +Resigned to the situation, she went out into the warm night. She came +staggering in early the next morning. + "How did you do?" asked the husband. + "Here," she said, "I've got four dollars and ten cents." + "Four dollars and ten cents," he said . "Who gave you the ten cents?" + "Everybody," she said. +%% +So this traveling salesman got an audience with the Pope. + "Hey, father," he said, "have you heard the joke about the two +Polacks who --" + "My son," the Pope reminded him, "I'm Polish." +The salesman thought for a moment. + "That's okay, Father," he said. "I'll tell it very slowly." +%% +So you fucked up... you trusted us! + -- Animal House +%% +Sodomy, fellatio, cunnilingus, pederasty, +Father, why do these words sound so nasty? + -- Hair +%% +Sodomy is a pain in the ass. +%% +Some women are like musical glasses. +To keep them in tune they must be wet. + -- Samuel Coleridge +%% +Sometimes, you just gotta say "What the fuck." + -- Risky Business +%% +Special tonight, the best toot in town at prices you won't believe!! +Also, the finest dope, brought all the way from Columbia by spirited +young adventurers. All available tonight, as usual, in the graduate +students bullpen from 11: pm on, usual terms and conditions. +Faculty members especially welcome. +%% +Statisticians do it with 95 percent confidence. +%% +Statisticians probably do it. +%% +Sticks and stones may break my bones but whips and chains excite me!!! +%% +Success is like a fart -- only your own smells nice. + -- James P. Hogan +%% +Support the Girl Scouts! + (Today's Brownie is tomorrow's Cookie!) +%% +Support the right of unborn males to bear arms! + -- A public service announcement from Phyllis Schlafly, + the Catholic Church, and the National Rifle Association +%% +Systems people do it with a small, but clean, interface. +%% +TAXIDERMIST: + A man who mounts animals. +%% +TEAR LEATHER: + To become excited, as in the sentence + "Robin Hood tore his leather jerkin' off." +%% +TEARING OFF A QUICKY: + Gunning the jump. +%% +TEXAN: + A wet-back that didn't make Oklahoma. +%% +THE PERFECT WOMAN: + Four feet tall, no teeth and a flat head so you can rest your drink. +%% +THORNY: + A thailor at thea. +%% +TOURIST: + A pretty girl in Oklahoma. +%% +TRUST ME: + Los Angeles for "Fuck you, your mother, + and the horse she rode in on." +%% +TRUST: + Two cannibals having oral sex. +%% +Teddy Kennedy: A Blond in Every Pond! +%% +Teen-age prostitution: the problem is mounting! +%% +Tequila my girl, is deceiving: +Take two at the very most. +Take three and you're under the table, +Take four and you're under the host. +%% +Test makers do it: + A: sometimes + B: always + C: never +%% +That girl could suck the chrome off a bumper. +%% + "That wife of mine is a liar," said the angry husband to a +sympathetic pal seated next to him in a bar. + "How do you know?" the friend asked. + "She didn't come home last night, and when I asked her where +she'd been she said she'd spent the night with her sister Shirley." + "So?" + "So, she's a liar. I spent the night with her sister Shirley." +%% +The Father, the Son and the Holy Ghost would never throw the +Devil out of Heaven as long as they still need him as a fourth for bridge. + -- New Libertarian Notes, #19 +%% +The Israelites were all waiting anxiously at the foot of the mountain, +knowing that Moses had had a tough day negotiating with God over the +Commandments. Finally a tired Moses came into sight. + "I've got some good news and some bad news, folks," he said. "The +good news is that I got Him down to ten. The bad news is that adultery's +still in." +%% +The Pope is working on a crossword puzzle one Sunday afternoon. He stops +for a moment, scratches his forehead, then asks a Cardinal, "Can you think +of a four-letter word for `woman' that ends in `u-n-t'?" + "Aunt," replies the Cardinal. + "Say, thanks," says the Pope. "You got an eraser?" +%% +The REVERSE function works on the opposite SEXPR. +%% +The San Francisco police are nothing if not sensitive to the mood of the +community. The word is that Dirty Harry has been replaced by Bitchy Gerald. +%% + The Snack +Oh my God, screamed Mommy, You went and ate the Baby. + +What baby? asked Daddy. You know that's just the last of the leftover donkey. + +Donkey, my ass! said Mommy with some sentience. Do you think I don't + recognize my own baby? Why I can still see his little privates + caught in the gap between your front teeth. How many times have + I told you to take only what's on the *top* two shelves of the freezer? + +But there wasn't a thing to eat, cried Daddy. + And am I not the master of my own? + +Nothing to eat? + What about the elephant testicles in aspic that I put up for you + just last week in the ball jar? Our very first baby, too, wailed + Mommy, that I was saving for Christmas dinner. + +Testicles, testicles, said Daddy. A man gets tired of testicles. + -- L.L. Zeiger +%% +The abbess of a nunnery was instructing a group of novices on the house rules +of her particular order. The indoctrination period, which went on for hours, +began with "No washing of undies in the founts," and ended with "Lights out at +nine. Candles out at ten." +%% +The attractive and grief-stricken widow had been living in seclusion at the +home of her deceased husband's younger brother for several weeks. One evening, +when she could no longer control her emotions, she barged into her brother-in- +law's study and pleaded, "James, I want you to take off my dress." Shyly, +the brother-in-law did as she requested. "Now," she continued, "take off my +slip." He again complied. "And now," she said, with a slight blush, "remove +my panties and bra." Once more James obeyed her command. + Then, regaining her composure, she stared directly at the young man +and boldly announced, "I have only one more request, James. Don't ever let +me catch you wearing my things again." +%% +The best way to cut off a cat's tail is to repossess his Jaguar. +%% +The blacksmith told me before he died, +And I have no reason to believe that he lied, +That no matter how he tried, +His wife was never satisfied! + +And so he built a bloody great wheel, +Harnessed to a cock of steel, +Two balls of brass were filled with cream, +And the whole damn thing was driven by steam. + +Round and round went the bloody great wheel, +In and out went the cock of steel, +Till at last the maiden cried, +"Enough! Enough! I am satisfied!" + +And now we come to the crucial bit -- +There was no way of stopping it. +And she was split from hole to hole, +And the whole fucking thing was covered in shit... +%% +The blind daters had really hit it off and at the end of the evening, as +they were beginning to undress each other in his apartment, the fellow said, + "Before we go any further, Charmaine, tell me -- do you have +any special fetishes that I should take into account in bed?" + "As a matter of fact," smiled the girl, "I do happen to have a foot +fetish -- but I suppose I'd settle for maybe seven or eight inches." +%% +The bottom-up approach always gets me buggered. + -- Sidney J. Hurtubise +%% +The butcher, the baker, the candlestick make her, why can't I? +%% +The computer is the ultimate polluter: +Its shit is indistinguishable from the food it produces. +%% +The country girl who became a city madam +has obviously gone from rags to rigids. +%% + The defense attorney was hammering away at the plaintiff: +"You claim," he jeered, "that my client came at you with a broken bottle +in his hand. But is it not true, that you had something in YOUR hand?" + "Yes," the man admitted, "his wife. Very charming, of course, +but not much good in a fight." +%% + The devout Jew was beside himself because his son had been dating +a shiksa, so he went to visit his rabbi. The rabbi listened solemnly to +his problem, took his hand, and said, "Pray to God." + So the Jew went to the synagogue, bowed his head, and prayed, "God, +please help me. My son, my favorite son, he's going to marry a shiksa, he +sees nothing but goyim..." + "Your son," boomed down this voice from the heavens, "you think +you got problems. What about my son?" +%% +The difference between a lawyer and a rooster, is that +the rooster gets up in the morning and clucks defiance. +%% +The difference between a sorority girl and a bowling ball +is that you can only get three fingers in a bowling ball. +%% +The difference between like and love is the +same as the difference between a spit and a swallow. +%% +The difference between this school and a cactus plant +is that the cactus has the pricks on the outside. +%% +The difference between women and girls +is as much as twenty years in some states. +%% + The doctor had just finished giving the young man a thorough +physical examination. "The best thing for you to do," the M.D. said, +"is give up drinking, give up smoking, get to bed early and stay away +from women." + "Doc, I don't deserve the best," pleaded his patient. "What's +second best?" +%% +The early worm gets the bird. +%% +The five-alarm fire had been raging out of control for hours, pouring thick, +black smoke over the street. At last the blaze was under control and the +fire chief began accounting for his men. Two were missing, so he ordered +a search. Captain Kelly finally rounded a fire truck parked in an alley +and found, to his shock, one fireman with his trousers down leaning over a +garbage can and another fireman screwing him in the ass. + "What's the meaning of this!", the captain roared. + "Jones here had passed out from smoke inhalation," the fireman on +top panted. + "You're supposed to give mouth to mouth resuscitation for that!" +the captain yelled. + "I know. That's what started this," the fireman replied. +%% + The foreman of a lumber camp put a new workman on the circular saw. +As he turned away, he heard the man say, "Ouch". + "What happened?" + "Dunno," replied the man. "I just stuck out my hand like this, and +-- well, I'll be damned. There goes another one!" +%% +The fucking ain't worth the fighting. +%% +The girls that go to see a man's etchings +may not know art, but they know what they like. +%% +The good doctor had been an inspiration to the jungle natives. He had cured +their sick and taught them the religious and moral values of his own England. +He was loved and respected by every native in the village, but on this +particular afternoon the chief was obviously troubled as he entered the +doctor's hut. "You live among my people long time now," said the chief. +"You tell us not right for a man and girl to be close together before +marriage and we believe what you say. This morning white child born to +woman in village. You only white man in jungle. What I tell my people?" + The doctor smiled and led the chief to a window. "My son," he said, +"I'll won't attempt to give you a full scientific explanation for the +phenomenon known as an albino. But look at the flock of sheep upon that +hill. Every one is snow white except one. The white baby born to the +woman in your village means nothing more or less than that one black sheep +in the white flock. It is simply one of nature's mysterious accidents." + The black chief became embarrassed and looked at his feet. "OK, doc," +he said. "You no tell -- I no tell." +%% +The good news is that the horse is dead, but your mother's pregnant. +%% +The greatest lies of all time: + (1) I love you. + (2) This won't hurt a bit. + (3) The Mercedes is paid for. + (4) The check is in the mail. + (5) I was just going to call you. + (6) I've always worn cowboy boots. + (7) I swear I won't come in your mouth. + (8) Of course I'll respect you in the morning. + (9) We have a really challenging assignment for you. + (10) I'm from the government, and I'm here to help you. +%% +The hacker as a mate/lover and the signs of trouble: + +-- The morning after note reads: + Whiting, Barbara: + I enjoyed last night. We really interfaced. You looked so cute + I wanted to byte your ear. +-- He believes Steve Wozniak offered the Apple to Adam. +-- The people he tries to emulate are five years his junior. +-- The last straw: + Once again, your date has lost all track of time debugging a new + program and shows up an hour late. + + You Don't...: + Make nasty asides regarding his 5-1/4 inch floppy. + You Do...: + Remind him that "going down" doesn't necessarily + indicate a malfunction. +%% +The honeymoon is over when a quickie before dinner refers to a short drink. +%% + The honeymooning couple agreed it was a fine day for horseback riding. +After a mile or so, the bride's mount cantered under a low tree and a +branch scraped her forehead lightly. The groom dismounted, glared at his +wife's horse, and said, "That's number one." + The ride then proceeded. After another mile or so, the bride's +horse stumbled over a pebble and the lady suffered a slight jostling. +Again, her man leapt from his saddle and strode over to the nervous animal. +"That's two," he said. + Five miles later, the bride's horse became frightened when a rabbit +crossed its path, reared up and threw the girl. Immediately, the groom was +off his horse. "That's three!", he shouted, and, pulling out a pistol, he +shot the horse between the eyes. + "You brute!" shrieked his bride. "Now I see the kind of man I +married! You're a sadist, that's what!" + The groom turned to her coolly. "That's one," he said. +%% +The hungover couple dawdled over a midafternoon breakfast, after a +particularly wild all-night party held in their fashionable apartment. + "Dearest, this is rather embarrassing," said the husband, "but +was it you I made love to in the library last night?" + His wife looked at him reflectively and then asked, "About what +time?" +%% +The husband was disturbed by his wife's indifferent attitude towards him +and the marriage counselor suggested he try being more aggressive in his +lovemaking. + "Act more like a romantic lover and less like a bored spouse," he +was advised. "When you go home, make love to her as soon as you meet -- +even if it's right inside the front door." + At the next consultation, the adviser was pleased to hear that the +husband had followed his instructions. "And how did she react this time?" +the consultant asked. + "Well, to tell you the truth," the husband replied, "she was still +sort of indifferent. But one thing I've got to admit: her bridge club went +absolutely wild!" +%% +The husband wired home that he had been able to wind up his business trip a +day early and would be home on Thursday. When he walked into his apartment, +however, he found his wife in bed with another man. Furious,he picked up his +bag and stormed out. He met his mother-in-law on the street, told her what +had happened and announced that he was filing for divorce in the morning. + "Give my daughter a chance to explain before you take any action," +the older woman pleaded. Reluctantly, he agreed. + An hour later his mother-in-law phoned the husband at his club. +"I knew my daughter would have an explanation," she said, a note of triumph +in her voice. "She didn't receive your telegram!" +%% +The king arranged a regal marriage for his daughter -- a bond that would unite +two great kingdoms. Yet, because the young couple seemed so formal to each +other, he posted a spy outside the royal wedding chamber and demanded a full +account of the wedding night's progress. + "It's hard to tell," said the spy the next morning. "When the prince +entered the chamber, I heard the princess say, quite formally, 'I offer you my +honor.' Then the prince said, with equal courtliness, 'I honor your offer.' +And that's the way it went all night long -- honor, offer, honor, offer. +%% +The largest gay community in the U.S. (as a percentage of total population) +is not in San Francisco, but in Iowa Falls, Minnesota (pop. 763), a small +town in which virtually everyone is gay. In 1976, a group of about 100 +gays fleeing persecution in the South settled in the town, and soon won a +majority on the town council. Ordinances prohibiting heterosexual acts +soon followed. "After all," said mayor Harry Whalen, "If the Supreme Court +has refused to strike down laws prohibiting homosexual acts, then our +anti-straight laws are equally valid." Rigorous enforcement of those laws +has resulted in a community that is now almost 100% gay. Said one long-time +resident: "I've lived here 35 years and didn't want to leave, but I didn't +want to give up sex either. Then my neighbor Ed came over one night, and +said how about I do it with him, and my wife Millie could do it with his +wife. Well, I found it wasn't nearly as bad as I thought it was gonna be. +Fact is, I rather like it." +%% +The little boy pointed to two dogs in the park and asked his father what +they were doing. "They're making puppies, son," replied the father. + That night, the boy wandered into his parents' room while they were +making love. Asked what they were doing, the father replied, "Making you +a baby brother." + "Gee, Dad," the boy pleaded, "turn her over -- I'd rather have a +puppy." +%% +The little old lady rushed into the taxidermist and unwrapped a package +containing two recently deceased monkeys. Her instructions to the proprietor +were delivered in a welter of tears. + "Favorite pets... (blubber,sob)... caught cold... (moan)... Don't +see how I'll live without them... (weep,sob)... want to have them stuffed... +(blubber,blubber)!" + "Of course, madam," said the proprietor in an understanding voice, +"and would you care to have them mounted?" + "Oh, no," she sobbed, "shaking hands. They were just close friends." +%% +The most common form of marriage proposal: "YOU'RE WHAT!?" +%% +The moving finger having writ... gestures. +%% +The nervous young bride became irritated by her husband's lusty advances on +their wedding night and reprimanded him severly. + "I demand proper manners in bed," she declared, "just as I do at +the dinner table." + Amused by his wife's formality, the groom smoothed his rumpled hair +and climbed quietly between the sheets. "Is that better?" he asked, with a +hint of a smile. + "Yes," replied the girl, "much better." + "Very good, darling," the husband whispered. "Now would you +be so kind as to please pass the pussy?" +%% +The new rooster caused a great stir in the barnyard. From resplendent comb +to defiant spurs, he was the picture of young bantamhood. Almost immediately +upon arrival, he was greeted by and elderly rooster who took him behind the +barn and whispered in his ear: "Young fellow, I'm long past my prime. All I +want now is peace and solitude. So you take over right now as ruler of the +roost with my blessings." + The newcomer did just that. He went about his squirely duties as only +a young rooster could. After several days, however, the elder rooster again +took the young champion behind the barn. "Kid," he said, "the hens are after +me for giving up my position so readily. So why don't we have a race, say, +ten laps around the farmhouse? The winner becomes undisputed keeper of the +henhouse and the hens will stop nagging me. + The young rooster, with only contempt for his elder, agreed. +Surprisingly, the older one jumped off to an early lead. His counterpart, +weakened by the activities of the previous week, was never quite able to +overtake him. As they rounded the barn for the fourth time, the elder rooster +maintained a formidable lead. + Suddenly, a shotgun blast rang out. The young rooster fell in the +dust, his plumage riddled with buckshot. + "Dammit, Emmy," said the farmer. "That's the last rooster we buy +from Ferguson. Four of 'em this month, and every one's been queer." +%% +The only psychologically damaging thing about masturbation is +that there's nobody else to blame later for persuading you to do it. +%% +The other night I was having sex, but the girl hung up on me. +%% +The outraged husband discovered his wife in bed with another man. + "What is the meaning of this?" he demanded. "Who is this fellow?" + "That seems like a fair question," said the wife, rolling over. +"What IS your name?" +%% +The passionate young thing was having a difficult time getting across what +she wanted from her rather dense boyfriend. Finally she asked, + "Would you like to see where I was operated on for appendicitis?" + "Gosh, no!" he replied. "I hate hospitals." +%% +The penis mightier than the sword. +%% +The pleasure is momentary, +The position ridiculous, +The expense damnable. + -- Chesterfield, on sex +%% +The plural of spouse is spice. + -- R.A. Heinlein +%% +The police were investigating the mysterious death of a prominent businessman +who had jumped from a window of his 11th story office. His voluptuous private +secretary could offer no explanation for the action but said that her boss had +been acting peculiarly ever since she started working for him a month ago. + "After my very first week on the job," she said, "I received a +twenty-dollar raise. At the end of the second week he called me into his +private office, gave me a lovely black nightie, five pairs of nylon stockings +and said, 'These are for a beautiful, efficient secretary.' At the end of the +third week he gave me a gorgeous mink stole. Then, this afternoon, he called me +into his private office again, presented me with this fabulous diamond bracelet +and asked me if I would consider making love to him and what it would cost. +I told him I would, and because he had been so nice to me, he could have it +for five dollars, although I was charging all the other boys in the office ten +dollars. That's when he jumped out the window." +%% +The poor little doe +Crawled out of the woods, +Tired, bedraggled and blue. +"Look," she said, "What I did for a buck, +I should have asked for two!" +%% +The priest at Sunday mass noticed that Michael took a ten-dollar bill and two +one-dollar bills from the collection plate, instead of putting something in. +He thought to himself, I'd better watch out for Michael. The next week he +noticed the same thing. So he waited outside church when mass was over, and +as Michael came out, he accosted his and said, + "Michael, tell me -- why did you take out a ten-dollar bill and two +singles two weeks in a row, instead of putting money into the collection?" + Michael replied, "Father, I'm embarrassed, but I did it because I +wanted to go downtown for a blow job." + The priest looked suprised but said to Michael, "Listen, don't do +that anymore. I'll be watching you from now on." + When he got back to the rectory, the priest was still perplexed. +Finally he decided to call Mother Agatha at the convent. He said, "Mother, +you've been such a great friend of mine, I have a question I need to ask you. +What is a blow job?" + Mother Agatha replied, "Oh, twelve dollars, same as downtown." +%% +The problem with being best man at a wedding +is that you never get a chance to prove it. +%% +The problems with "Medflies" may have hurt Jerry Brown's chances to become a +Senator. After all, if they won't allow California fruit out of the state, +how is Brown going to get to Washington? +%% +The quality of a blow-job is determined by the +length of sheet you have to pull out of your ass. +%% +The real problem with fucking a sheep is that you have +to walk around in front every time you want to kiss her. +%% +The reason Roman Catholics are allowed to use the +rhythm method of birth control is that it doesn't work. +%% +The reason that sex is so popular is that it's centrally located. +%% +The rich man uses vaseline, + The poor man uses lard; +The worker uses axle grease + But gets it twice as hard. +%% +The romantic young man sat on the park bench with a first date. He was +certain his charming words and manner would win her as they had many others. + "Some moon out tonight,"he cooed. + "There certainly is," she agreed. + "Some really bright stars in the sky." + She nodded. + "Some dew on the grass." + "Some do," she said indignantly, "but I'm not that sort." +%% +The sergeant walked into the shower and caught me giving myself a +dishonorable discharge. Without missing a beat, I said... + "It's my dick and I can wash it as fast as I want!" +%% +The sex act is the funniest thing on the face of this earth. + -- Diana Rigg +%% +The sex life of spiders is very interesting. +He fucks her. +She bites his head off. + -- From a Women's Lib Poster +%% +The shy young man had been married for three months when he reported to his +doctor that his marriage was still in name only. The doctor, after hearing +the sad tale, told him that waiting until bedtime to make advances was causing +psychological pressure and advised him to take advantage of the next time he +felt in the mood. A week later, the doctor happened to meet the man again, +and noticed a new spring in his step. "My advice worked, I take it?" he +inquired. + The young man grinned. "Perfectly. The other night, we were having +supper, and as I reached for the salt -- so did she! Our hands touched... It +was as if an electric current ran through us. I leaped to my feet, swept the +dishes from the table and then and there consummated our marriage! There's +just one problem, however. We can't go back to The Four Seasons again..." +%% +The sun was shining brightly The breeze was blowing briskly, +And I could hardly wait, It made the flowers sway, +To ponder at my window The garden was enchanting +And gaze at my estate. On this inspiring day. + +My eyes fell on a little bird, I smiled at him cheerfully +With a beautiful yellow bill, And gave him a crust of bread, +I beckoned him to come and light And then I closed the window +Upon my window sill. And smashed his fucking head. + -- "Good Morning", Debbie Smith +%% +The surest sign that a man is in love is when he divorces his wife. +%% +The three most important parts of a stove: lifter, leg, and poker. +%% +The time has come for kicking ass and taking names. +%% +The two couples were enjoying their vacation together at a resort hotel. They +were in the middle of a game of Scrabble in the lobby when a thunderstorm cut +off the hotel's electricity, leaving little to do but retire to their rooms. +Bill was a rather devout man, so before getting into bed with his companion, +he said his prayers. As he got under the covers, the lightning suddenly +flashed through the window and he discovered that he was in the wrong room. +He instantly jumped up and started to dash for the hallway. "It's too late, +called the girl from the bed, "my guy doesn't pray." +%% +The two men feigned friendship but secretly hated each other's guts and took +great pleasure in giving one another the needle on any and all occasions. +This particular evening they met, quite by accident, at a popular bar. +The conversation started innocently enough; then one, with sudden inspiration, +ran his hand over the other's bald head and exclaimed, + "By God, Fred, that feels just like my wife's ass!" +The other ran his own hand over his head and nonchalantly retorted, + "Well, I'll be damned, Jim, so it does, so it does!" +%% +The very proper spinster didn't go out very often, but she had some important +shopping to do that morning and so decided to have her lunch in what appeared +to be a nice quiet respectable restaurant. With the noontime crowd, many +customers shared their tables with strangers; the spinster selected a seat +next to an attractive, young office girl. The girl finished her sandwich and +coffee, then settled back and lit up a cigarette. The older woman controlled +herself for a few moments and then snapped, + "I'd rather commit adultery than smoke in public." + "So would I," said the girl, "but I only have half an hour for lunch." +%% +The wages of sin are high -- unless you know someone who does it for nothing. +%% +The warden of the De Luxington preparatory school for boys was holding a +hearing. The lad before his desk, a very popular young fellow, was angrily +accusing one of his schoolmates of having assaulted him sexually. + "I must warn you, m'boy, this is a very serious charge, the warden +said. + "I don't care. I tell you it is true. He raped me, warden." The +youth pointed to another, somewhat larger boy smirking in the corner. +"That's him, sir, the one who forced me to do all those crimes against +nature. The bully!" + "Now tell me, son, as closely as you can, when this happened." + "Sir, two weeks ago on Wednesday at 4:00, then at 7:00 that same +evening, on Friday, twice on Saturday, two times on Monday, once on +Wednesday, and then he met that bitch Roy and he hasn't touched me since." +%% +The whole world is about three drinks behind. + -- Humphrey Bogart +%% +The word `spine' is, of course, an anagram of `penis'. This is true in +almost fifty percent of the languages of the Galaxy, and many people have +attempted to explain why. Usually these explanations get bogged down in +silly puns about "standing erect". + -- The Hitchhiker's Guide to the Galaxy +%% +The world is an 8000 mile in diameter spherical pile of shit. +%% +The young Georgia miss came to the hospital for a checkup. + "Have you been X-rayed?" asked the doctor. + "Nope," she said, "but ah've been ultraviolated." +%% +The young girl was having a heart-to-heart talk with her mother on her +first visit home since starting college. + "Mom, I have to tell you," the girl confessed. "I lost my virginity +last weekend." + "I'm not suprised," said her mother. "It was bound to happen sooner +or later. I just hope it was a romantic and pleasurable experience." + "Well, yes and no," the pretty student remarked. "The first eight +guys felt great, but after them my pussy got real sore." +%% +The young lady had an unusual list, +Linked in part to a structural weakness. +She set no preconditions. +%% + The young male race horse came from a long line of winners, and did +wonderfully in time trials. However, in actual races he proved a little too +romantic, and could never quite bring himself to pass a mare. + So one day the trainer went to him and told him he'd have to be +castrated. The young horse, knowing that it was either this or the glue +factory, took it philosophically. After all, having the operation was +almost a certain guarantee of a long and illustrious racing career. + After a short recovery period, the horse was again run in time +trials, and found to do as well as ever. But the first time he actually +ran in a race, he only went about ten paces, before getting a dejected look +on his face, turning around, and ambling back to the starting gates. + "What's the matter?" asked the trainer, "you were doing great!" + "Yeah, well how would you feel" replied the horse, "if five thousand +people took one look at you and shouted `they're off!'?" +%% + The young man took a blind date to the amusement park. They went +for a ride on the Ferris wheel. The ride completed, she seemed rather bored. +"What would you like to do next?" he asked. + "I wanna get weighed," she said. So he took her over to the weight +guesser. Next they rode the roller coaster. After that he bought her some +popcorn and cotton candy, then he asked what else she would like to do. + "I wanna get weighed," she said, bluntly. + I really latched onto a square one tonight, thought the boy, and +using the excuse that he had developed a headache, he took the girl home. +The girl's mother was surprised to see her home so early, and asked, "What's +wrong, dear, didn't you have a nice time tonight?" + "Wousy," said the girl. +%% +Then there was the girl who was engaged +to a gymnast -- 'til he broke it off. +%% +Then there was the girl whose boyfriend didn't smoke, drink or +swear, and never, ever made a pass at her. He also made his own dresses. +%% +Then there was the middle-aged businessman who took his spouse to Paris. +After traipsing with her from one mansion du couture to another, be begged +for a day off to rest and got it. With the wife gone shopping again, he +went to the Ritz Bar and picked up a luscious parisienne. They got on +well until the question of money came up. She wanted a hundred American +dollars; he offered fifty. They couldn't get together on the price; so +they didn't get together. That evening he escorted his wife to of the +nicer restaurants on the Rue de Rivoli, and there he spotted his gorgeous +babe of the afternoon seated at a table near the door. + "See, monsieur?" she said as they passed her. "Look what you got +for your lousy fifty bucks." +%% +There are Jews in the world, there are Buddhists, Every sperm is sacred, +there are Hindus and Mormons and then Every sperm is great, +there are those that follow Mohammed ...But... If a sperm is wasted, +I've never been one of them. God gets quite irate. + +I am a Roman Catholic Every sperm is wanted, +And have been since before I was born, Every sperm is good. +And the one thing they say about Catholics is Every sperm is needed, +They'll take you as soon as you're warm. In your neighborhood. + +You don't have to be a six-footer. Let the heathens spill theirs, +You don't have to have a great brain. On the dusty ground. +You don't have to have any clothes on, God shall make them pay for +You're a Catholic the moment Dad came Each sperm that can't be found. +...Because... + +Hindu, Taoist, Mormon, Every sperm is useful, +spill theirs just anywhere Every sperm is fine. +but God loves those who treat their God needs everybodies, +semen with more care. Mine, and mine, and mine. + -- Monty Python, "Every Sperm is Sacred" +%% +There are a couple of things about her I greatly admire. +%% +There are many ways to say "I love you", but fucking is the fastest. +%% +There are really not many jobs that actually require a penis +or a vagina, and all other occupations should be open to everyone. + -- Gloria Steinem +%% +There are three women on the fast track in a particular company. The +president realizes it's time to promote one of them, but they're all so +competent that he's not sure which one to choose. So he devises a little +test. One day while they're all at lunch, he places $500 on each of their +desks. #1 returns it to him immediately. #2 pockets it. #3 invests +in the market and returns $1,500 to him in the morning. Who gets the +promotion? The one with the big tits! +%% + There are two couples that want to convert to Catholicism. They go +and see a priest and he tells them that the first requirement is to abstain +from sex for thirty days. + Thirty days later, the couples come back to see the priest. He asks +the first couple if they passed the test. + "Father, we didn't so much as TOUCH one another during the last month. + "Congratulations," the priest replies, "you are now qualified to enter +the Church." Then, the priests asked the second couple how they did. + "Well, Father," the husband says, "everything was going just fine +until the 27th day. My wife bent over the freezer to get something out, and +I just happened to notice that she didn't have any panties on. I couldn't +stand it any more, so I walked over to her, dropped my pants, and slipped it +to her right there." + "That's DISGUSTING!", the priest bellows. "I can never let you into +the Church after something like that." + "I understand Father," the man replies sadly, "they won't let us +into Safeway anymore either." +%% +There are two sides to every divorce: yours and the shithead's. +%% +There is a definite parallel between shots of tequila and a +woman's breasts. One is not enough and three are too many. +%% +There is nothing as overrated as a bad +lay, or as underrated as a great shit. +%% +There is nothing wrong with screwing everyone in sight. +Boring your friends about it is the sin. + -- Mama Liz +%% +There once was a Sailor who looked through a glass +And spied a fair mermaid with scales on her... island. +Where seagulls flew over their nest. +She combed the long hair which hung over her... shoulders. +And caused her to tickle and itch. +The sailor cried out "There's a beautiful... mermaid. +A sittin' out there on the rocks." +The crew came a running, all grabbing their... glasses. +And crowded four deep to the rail. +All eager to share in this fine piece of... news. +... +"Throw out a line and we'll lasso her... flippers. +And soon we will certainly find +If mermaids are better before or be... brave +My dear fellows," The captain cried out. +And cursing with spleen. +This song may be dull, but it's certainly clean. + -- "The Clean Song", Oscar Brandt +%% +There once was a clergyman's daughter +Who detested the pony he bought her, + Till she found that its dong + Was as hard and as long +As the prayers her father had taught her. + +She married a fellow named Tony +Who soon found her fucking the pony. + Said he, "What's it got, + My dear, that I've not?" +Sighed she, "Just a yard-long bologna." +%% +There once was a young man from France +Who waited ten years for his chance; +Then he muffed it... +%% +There was a young fellow named Bliss +Whose sex life was strangely amiss, + For even with Venus + His recalcitrant penis +Would never do better than t + h + i + s + . +%% +There was a young fellow named Fyfe +Whose marriage was ruined for life, + For he had an aversion + To every perversion, +And only liked fucking his wife. + +Well, one year the poor woman struck, +And she wept, and she cursed at her luck, + And said, "Where have you gotten us + With your goddamn monotonous +Fuck after fuck after fuck? + +"I once knew a harlot named Lou -- +And a versatile girl she was, too. + After ten years of whoredom + She perished of boredom +When she married a jackass like you!" +%% +There was a young fellow named Skinner +Who took a young lady to dinner + At a quarter to nine, + They sat down to dine, +At twenty to ten it was in her. +The dinner, not Skinner -- Skinner was in her before dinner. + +There was a young fellow named Tupper +Who took a young lady to supper. + At a quarter to nine, + They sat down to dine, +And at twenty to ten it was up her. +Not the supper -- not Tupper -- It was some son-of-a-bitch named Skinner! +%% +There was a young fellow of Greenwich +Whose balls were all covered with spinach. + He had such a tool + It was wound on a spool, +And he reeled it out inich by inich. + +But this tale has an unhappy finich, +For due to the sand in the spinach + His ballocks grew rough + And wrecked his wife's muff, +And scratched up her thatch in the scrimmage. +%% +There was a young girl from New York +Who plugged up her cunt with a cork. + A woodpecker or two + Made the grade it is true, +But it totally baffled the stork. + +Till along came a man who presented +A tool that was strangely indented. + With a dizzying twirl + He punctured that girl, +And thus was the cork-screw invented. +%% +There was a young girl of Detroit +Who at fucking was very adroit: + She could squeeze her vagina + To a pin-point, or finer, +Or open it out like a quoit. + +And she had a friend named Durand +Whose cock could contract or expand. + He could diddle a midge + Or the arch of a bridge -- +Their performance together was grand! +%% +There was a young girl of LLewellyn +Whose breasts were as big as a melon. + They were big it is true, + But her cunt was big too, +Like a bifocal, full-color, aerial view +Of Cape Horn and the Straits of Magellan. +%% +There was a young harlot named Schwartz +Whose cock-pit was studded with warts, + And they tickled so nice + She drew a high price +From the studs at the summer resorts. + +Her pimp, a young fellow named Biddle, +Was seldom hard up for a diddle, + For according to rumor + His tool had a tumor +And a fine row of warts down the middle. +%% +There was a young lady from Munich +Who had an affair with a eunuch. + At the height of their passion + He dealt her a ration +%% +There was a young lady of Natchez +Who chanced to be born with two snatches, + And she often said, "Shit! + Why, I'd give either tit +For a man with equipment that matches." + +There was a young fellow named Locke +Who was born with a two-headed cock. + When he'd fondle the thing + It would rise up and sing +An antiphonal chorus by Bach. + +But whether these two ever met +Has not been recorded as yet, + Still, it would be diverting + To see him inserting +His whang while it sang a duet. +%% +There was a young man with a fiddle +Who asked of his girl, "Do you diddle?" + She replied, "Yes, I do, + But prefer to with two -- +It's twice as much fun in the middle." +%% +There was a young man with a prick +Which into his wife he would stick + Every morning and night + If it stood up all right -- +Not a very remarkable trick. + +His wife had a nice little cunt: +It was hairy, and soft, and in front, + And with this she would fuck him, + Though sometimes she'd suck him -- +A charming, if commonplace, stunt. +%% +There was a young woman of Croft +Who played with herself in a loft, + Having reasoned that candles + Could never cause scandals, +Besides which they did not go soft. + +Said another young woman of Croft, +Amusing herself in the loft, + "A salami or wurst + Is what I'd choose first -- +With bologna you know you've been boffed." +%% +There was once a newly-married couple. Now these two lovers were, well, +rather uptight about using expressions such as "having sex", "getting it on", +or "boffing the brains out". So, they decided to use the euphemism, "doing +the laundry" whenever the topic of sex came up. + One evening, hubby said, "Well, honey, feel like doing some laundry +tonite?", and she consented. The next evening, hubby again asked, "Sweetie, +feel like doing some laundry tonite?" Well, wifey wasn't really in the mood, +but complied. On the third night, when hubby approached her, asking her to +participate in doing still MORE laundry, she replied, "Oh, Hon, I'm really not +in the mood for doing any laundry tonite." + Well, hubby, being a bit disappointed, locked himself in the bathroom +and engaged in a spot of self-abuse instead. Upon returning to the living +room, wifey said, "Well, Poopsie, I've changed my mind -- how about doing +some laundry?" To which he replied, "Oh, no, that's okay, I just did a small +load!" +%% +There was once a salesman who had an outstanding record for selling tooth- +brushes. His boss, wondering at his unlikely success, sent a man out to +follow the salesman on rounds to see what pitch he gave that brought such +good results. It was soon found that this particular salesman went to the +corner of a busy street and opened up his briefcase, and on one side was the +assortment of toothbrushes, and on the other side various chips and garnishes +and a bowl of brownish stuff. He would grab a likely customer and give them +the following pitch. + "Good morning, ma'am, this is a commercial promotion for --- brand +of chip dip. Would you care to give it a try?" + At that point the person would try it, then spit it out and scream +in utter disgust, "This tastes like shit!" + The salesman would smile and say, "It is. You want to buy a +toothbrush?" +%% +There was something about her I liked, +but I couldn't put my finger on it. +%% +There's a vas deferens between men and women. +%% +There's many a slurp t'wixt the tip and the zip. +%% +There's more than one way to skin a cat: + Way #3 -- Krazy Glue and a toothbrush. + Way #27 -- Use an electric sander. + Way #32 -- Wrap it around a lonely frat man's pecker. + Way #33 -- A bicycle pump. +%% +There's nothing better than good sex. But bad sex? +A peanut butter and jelly sandwich is better than bad sex. + -- Billy Joel +%% +There's nothing wrong with America that a good erection wouldn't cure. + -- David Mairowitz +%% + These two project managers were walking through a residential area +one day, when they saw a dog (also male) sitting on a lawn, licking its +cock. (Why do dogs do that? Because they can). Anyway, the first manager +nudged the second and said, "Hey, look at that! That really looks like fun +-- I wish I could do that!" + Whereupon the second manager replied, "Well, I don't know... I tried +it once, and the damn dog bit me!" +%% + This 600-pound guy decides he can't go on living this way, so he seeks +the help of a clinic and proceeds to go on a drastic diet. It works: four +months later he's down to 160 pounds and feeling great, except for one problem. +He's covered with great folds of flesh where the fat used to be. He calls +up the clinic, and the doctor tells him not to worry. "There's a special +surgical procedure to correct this condition," the doctor assures him. "Just +come on over to the clinic." + "But doctor," the man pleads, "you don't understand. I'm too +embarrassed to be seen in public like this." + "Don't give it another thought," says the doctor. "Simply pull up +all the folds as high as they'll go, pile the flesh on top of your head, put +on a top hat, and come on over." + The guy follows the instructions and provokes no comments until he +reaches the clinic and is standing in front of the admitting nurse's desk, +dying of self-consciousness. "The doctor will be right with you," says the +nurse. "Say, what's that hole in the middle of your forehead?" + "My navel," blurts out the guy, "how d'ya like my tie?" +%% +This fellow rushed into a crowded tavern on Saturday night. Men and women +stood three-deep at the bar. Our man, who felt nature calling strongly, +looked about him but couldn't see anything that resembled a john. He saw a +stairway and bounded up the steps to the second floor in his increasingly +desperate search. Just as his bowels threatened to erupt, he spotted a +one-foot by one-foot hole in the floor. Now, at the end of his control, he +decided to take advantage of the hole. He dropped his pants, hunched over it, +and did his thing. Thoroughly relieved and relaxed, he sauntered down the +steps to find, to his suprise, that the crowded bar was now empty. + "Hey!" he yelled to the seemingly empty room, "Where is everyone?" + From behind the bar a voice responded, "Hey! Where were you when +the shit hit the fan?" +%% + This guy is taking a leak in a public men's room when a man enters +with his arms held out from his sides, bent at the elbows with his hands +dangling awkwardly, and comes over to him. + "Would you do me a favor and unzip my fly?" he asks. + Figuring the man to be a poor cripple, perhaps an accident victim, +the guy obliges, not without a flush of embarrassment when the man next +requests that he take out his prick and hold it in the appropriate position. + "Shake it off" is the next instruction, then "zip me up," and the +guy follows orders, wincing at his own embarrassment and at the shame of +being so helpless. + "Say, thanks," says the man, flouncing to the door. "I can't do a +*thing* 'til my nails dry!" +%% + This guy is walking down the beach one fine sunny day, feeling +good, when suddenly he sees this woman with no arms or legs in a wheelchair, +sobbing like crazy. He decides to be gallant, "What's wrong, miss?" + "I......I'm 21 and I I've never been kissed... +" + So this guy, he decides, what the hell, let's cheer up the poor lady. +He leans over and gives her a long wonderful kiss. This does wonders, and +the woman's face lights up and she grins from ear to ear, and the guy wanders +away feeling wonderful. + Well, next week, the same guy is walking along the same beach, and +sees the same girl who is once again sobbing her eyes out. Gallant to the +end, our hero says, "What's wrong, miss, can I help?" + "I...I'm 21 and I've never been fucked..." + The guy picks her up out of her chair, cuddles her close, and brings +her over to the shore, and throws her into the water. "Now you're fucked!" +%% +This guy makes an appointment with a doctor because his hemorrhoids are +really bothering him. The doctor gives him some suppositories and tells +him to come back in a week for a checkup. "How's it going?" he asks +the patient a week later. + "I gotta tell you the truth, Doc," said the man. "For all the +good these pills did me, I coulda shoved them up my ass." +%% +This guy was screwing his neighbors wife when a car pulls into the drive. +"My husband!" she screams. He panics and jumps out the window. He finds +himself on the street, naked, under cloudy skies. There is no place to hide +except in a crowd of joggers. As he runs along, a woman looks over and says, + "Do you always jog in the nude?" + "Yes ma'am!" he replies. + "Does it always result in that kind of sexual excitement?" she asks. + "Yes ma'am!" he replies. + "Do you always wear a condom?" + "Only when it rains, lady. Only when it rains." +%% +This here's the wattle +The emblem of our land +You can stick it in a bottle +Or you can hold it in your hand. + -- Monty Python +%% +This hot and dusty cowboy rode in from the mesa, filthy and exhausted. He +obviously had had nothing but his horse for company for a couple of weeks +and was looking forward to a couple of cold beers in the saloon. Swinging +off his horse and hitching it to the rail, the cowboy gave his horse an +affectionate slap on the neck. Then he astonished an old cowhand lounging +on the porch by moving around to the horse's hindquarters, lifting up its +tail and planting a demure kiss on its asshole. + "What'd you do that for?" asked the cowhand, completely repulsed. + "Chapped lips," said the cowboy, heading for the saloon doors. + "Wait a minute," said the old guy. "Whaddaya mean, chapped lips?" + "Keeps ya from lickin' 'em," explained the cowboy. +%% +This is National Smokers-Are-Shits Week. +%% +This is a test of the emergency cunnilingus system. +If this had been an actual emergency, you would have known it! +%% +This limerick is **SO**FILTHY** that it would offend you. +So I'll put in "di-dah" for the filthy words. + + Di-dah, di-dah, di-dah di-dah, + Di-dah di-dah di-dah, di-dah; + Di-dah di-dah di-dah? + Di-dah di-dah di-dah. + Di-dah di-dah, di-dah di-fuck. +%% +This story concerns a man who, after putting his son to bed each night, would +stand by his boy's door and listen to his son saying his prayers. One night, +the boy ended his prayers with, "God specially bless Granddad, who won't be +with us much longer." The man thought this was rather curious, but passed it +off as childish whimsy. The next day, however, he received a call from his +mother, informing him that his father had passed away early that morning. +During the next few weeks, he listened particularly closely to his son's +prayers, but noticed nothing unusual. Then, one night, the boy ended his +prayers with, "God specially bless Grandmom, who won't be with us much longer." +Although the shock of the original incident had worn off during the intervening +weeks, he nontheless phoned his mother to inquire as to her health. He went to +bed reassured, only to be awakened in the night by his sister calling with the +news that their mother had died suddenly in the night. The father had a series +of psychological tests done; nothing unusual was uncovered. About a month +later, the boy ended his prayers with, "God specially bless Daddy, who won't +be with us much longer." The man was panic-stricken, certain that he was +going to die during the night. He resolved to stay awake all night; if awake +and alert he should be able to prevent any tragedy. Morning came. Breathing +a huge sigh of relief, he went to get the paper off the porch. There, lying +dead on the doorstep, was the milkman. +%% +This system goes down more often than a two-dollar whore. +%% +This time it's for love; next time it's $100.00. +%% +Thou shalt not omit adultery. +%% +Thought: + Girls get minks the same way minks get minks! +%% +Three gay guys were discussing what they thought their favorite sport would +be. The first decides on football, 'cause of all those gorgeous guys bending +over in their tight pants. + "Definitely wrestling," sighs the second guy. "Those skimpy little +costumes, and think of the holds." + "Definitely baseball," says the third guy. "Why? Well, I'd be +pitching with the bases loaded, the batter would hit a savage one-hopper +right to me, I'd catch it, and I'd just stand there while the other guys +rounded the bases. Meanwhile, the crowd would be going crazy, screaming, +`Throw the ball, you cocksucker!' and that's what I like -- recognition!" +%% + Three girls and Feldstein were brought before the presiding judge. +The girls had been arrested for soliciting and the man was arrested for +selling ties without a license. "What do you do for a living?" the judge +asked, pointing at the first girl. + "Your honor, I'm a model," she replied. + "Thirty days," was the sentence. The judge turned to the second +girl. "What do you do for a living?" he asked. + "Your honor, I'm an actress." + "Thirty days." Then he turned to the third girl. "And how about +you?" he demanded. + "Well, your honor, I'm a prostitute. I'm not proud of it, but it's +the only way I can support my mother and my children since my husband's been +laid off." + "For telling the truth," he said, "I'm going to suspend sentence. +Furthermore, here's $100 to help your family out." Now he turns to Feldstein, +arrested for selling ties illegally. "And you," he said, "what do you do +for a living?" + "Your honor, I'm a prostitute. I'm not proud..." +%% +To a Real Woman, every ejaculation is premature. +%% +Tom Hayden is the kind of politician who gives opportunism a bad name. + -- Gore Vidal +%% +Tonight's piss is tommorrow's Tang. + -- An American astronaut +%% +Too ripped. Gotta go. +%% + Two Englishmen struck up a conversation with an American in the club +car of a train headed east out of Chicago. + "I say," queried the younger Englishman, "have you ever been to +London?" + The American laughed. "It was my home for two years during the war," +he said. "Had some of the wildest times of my life in that old town." + The older Englishman, a little hard of hearing, asked, "What did +he say, Reggie?" + "He said he's been to London, father," the younger Englishman +replied. + After a little lull in the conversation, the young man asked, "You +didn't, by any chance, meet a Hazel Wimbleton in London, did you?" + The American almost fell off his chair. "Hot Pants Hazel!" he +exclaimed. "My God, I shacked up with that horny broad for three months +just before I came back to the States!" + "What did he say, Reggie?" the older Englishman wanted to know. + "He says he knows Mother," the younger Englishman responded. +%% +Two anglers were fishing off Wight +And his bobber was dipping all night. + Murmured she, with a laugh, + "It's ready to gaff, +But don't break your rod which is light." + +A couple was fishing near Clombe +When the maid began looking quite glum, + And said, "Bother the fish! + I'd rather coish!" +Which they did -- which was why they had come. + +As two consular clerks in Madras +Fished, hidden in deep shore-grass, + "What a marvelous pole," + Said she, "but control +Your sinkers -- they're banging my ass." +%% + Two buddies had been out drinking for hours when their money finally +ran out. "I have an idea," croaked Al. "Lesh go over to my housh and borrow +shum money from my wife." + The two of them reeled into Al's living room, snapped on the light, +and lo and behold, there was Al's wife making love on the sofa to another man. +This state of affairs considerably unnerved Al's friend but didn't seem to +affect the husband. + "Shay, dear, you have any money for your ever-lovin' hushban?" he +asked. + "Yes, yes," she snapped. "Take my purse from the mantle, and for +Pete's sake, turn off those lights." + Outside they examined the purse, and Al proudly announced, "There's +enough here for a pint for you and a pint for me. Pretty good, eh, old buddy?" + "But, Al," protested his friend, somewhat sobered by the spectacle +he'd just witnessed, "what about that fellow back there with your wife?" + "The hell with him," replied Al. "Let him buy his own pint." +%% + Two gay guys, Larry and Phil, were driving down the highway when they +were rear-ended by a huge semi. Somewhat shaken, they maneuvered over to the +side of the road, where Phil instructed Larry to get out and confront the truck +driver. "Tell him we're going to sue, sue, sue!" he shrieked. + Obligingly, Larry got out and went around to the cab of the truck to +deliver this message to the huge, burly driver, whose response was to snarl, +"Ah, why doncha suck my cock." + "Phil," said Larry, coming back to their car, "I think we're going +to be able to settle out of court." +%% +Two gentlemen met at the club after a long absence and talked. + "Did you hear about Chumley?", one asked. + "No, old man, what about him?" + "Last seen in Africa, you know." + "No, I didn't." + "Yes. Appalling. Ran off with a gorilla. Fallen in love." + "Queer." + "Not Chumley. Female gorilla." +%% + Two little kids, aged six and eight, decide it's time to learn how +to swear. So, the eight-year-old says to the six-year-old, "Okay, you say +`ass' and I'll say `hell'". + All excited about their plan, they troop downstairs, where their +mother asks them what they'd like for breakfast. + "Aw, hell," says the eight-year-old, "gimme some Cheerios." +His mother backhands him off the stool, sending him bawling out of the room, +and turns to the younger brother. "What'll you have?" + "I dunno," quavers the six-year-old, "but you can bet your ass +it ain't gonna be Cheerios." +%% + Two longtime friends sipped Scotch in a local bar and talked about +their troubles. "And on top of everything else," said the first, "my wife +has cut me down to just once a week." + "That's too bad," agreed his friend, "but it could be worse. I know +two guys she's cut off altogether. +%% +Two men and a woman were stranded on a desert island - + +Two weeks later, the woman was so ashamed of what she +had been doing, she committed suicide. + +Two weeks later, the men were so ashamed of what they +had been doing, they buried her. + +Two weeks later, the men were so ashamed of what they +had been doing, they dug her back up. +%% +Two men were standing around talking while nearby a large German Shepherd +lay licking his balls. One man says to the other, "Damn, I wish I could +do that." + The other man replies, "Well, it's okay by me, but I think you +ought to get to know him a little first." +%% +Two midgets arrived at the convent door and asked to speak with the Mother +Superior. Led into her office, the first one asked respectfully "Excuse +me, your holiness, but are there any midget nuns in this convent?" + Receiving a reply to the negative, he asked whether any midget +nuns were to be found in any of the neighboring parish. Again the reply +was no. + The tiny man scratched his head and posed a final question. "Beggin' +your pardon, Mother Superior, but would you know of *any* midget nuns at +all, anywhere?" The nun shook her head. + At which the first midget turned to the second midget, put his hand +on his shoulder, and said, "You see, I told you you fucked a penguin!" +%% + Two morticians alternated in sharing the responsibility of covering +the night shift. One early morning about 3:00 am, a body was brought into the +mortuary, and the mortician began work. When he had unclothed the corpse, he +noticed a cork in the anus. Removing it, the strains of "Hello, Dolly, well, +hello, Dolly...!" were plainly heard being sung. He put the cork back, and +the singing stopped. Pulling it out again, the same song started, "You're +lookin' swell, Dolly!". Amazed, he telephoned his partner, and insisted he +come immediately to see something very unusual. Roused from sleep, the partner +asked if it could wait until morning. It took great persistence, but finally +the partner agreed to dress and come down to the shop. When he got there, he +said, "Now what was it that was so important you had to get me out of bed at +this ungodly hour?" + The man said, "Come into the embalming room." + They go into the embalming room, and the first partner says, "Now +watch." + He pulls out the cork, and the anus takes off singing again. The +partner looks at him disgustedly and says: "You brought me down here at +3 in the morning to hear some asshole sing Hello Dolly"? +%% +Two nuns, a mother superior and a new nun, are walking home one night from +church when they are attacked by two vicious rapists. The two men drag the +nuns off into the bushes and proceed to have their way with them. The mother +superior is very afraid, but she knows that God will protect her. To show her +strength and trust in God she yells out "Forgive him Father, for he knows not +what he does!" + To which the young nun replies "Oooooh, mine does!!" +%% +Two recent emigrants to the United States, on their first day off the boat +in New York City, spied a hotdog vendor. "Do they eat dogs in America?" +one asked his companion. + "I don't know." + "Well, if we're going to live in America, we have to learn to eat +American foods." + So they each bought a wax paper wrapped hotdog and sat down to eat +them on a nearby park bench. One man looked inside his wax paper, then over +at the other man, and asked, "So, what part did you get?" +%% +Two young men seated in a restaurant were watching a customer busily +disposing of a plate of oysters on the half shell. One of the young +men remarked to his friend, + "Did you ever hear that business about raw oysters being +good for a man's virility?" + "Yes, why?" the friend replied. + "Well, take it from me, that's a lot of foolishness. I ate a +dozen of them the other night, and only nine worked." +%% +Unitarian, n: + A bunch of athiests who really like going to church. +%% +Unix programmers do it with pipes. +%% +Vagina, n: + The box a penis comes in. +%% +Vd, n: + The gift that keeps on giving. +%% +Virgin, n: + An ugly third grader. +%% +VIRGO (Aug 23 - Sept 22) + You are the logical type and hate disorder. This nitpicking is +sickening to your friends. You are cold and unemotional and sometimes +fall asleep while making love. Virgos make good bus drivers. +%% +Vidi, vici, veni. +(I saw, I conquered, I came.) +%% +Virginity is a bubble on the sea of life, +which takes but one prick to break. + -- Jordan Sand +%% +Visiting a lawyer for advice, the wife said, "I want you to help me obtain a +divorce. My husband is getting a little queer to sleep with." + What do you mean?" asked the attorney. "Does he force you to indulge +in unusual sex practices?" + "No, he doesn't," replied the woman, "and neither does the little +queer." +%% +Wasp, n: + Someone who gets out of the shower to take a piss. +%% +Wet dream, n: + Overnight sensation. +%% +SDW/M, 35, offers French lessons for ladies. +If you desire fluency in the French tongue, +this cunning linguist can lick your problem. + +Fortune -- P.O. Box 478 +%% +Watch out for cold wave this week. (Or maybe a warm WAC.) +%% +We call our dog Egypt, because in every room he leaves a pyramid. +%% +We don't have to protect the environment -- the Second Coming is at hand. + -- James Watt, noted ecologist +%% +We drove to the hotel and said goodbye. How hypocritical to go upstairs +with a man you don't want to fuck, leave the one you do sitting there alone, +and then, in a state of great excitement, fuck the one you don't want to +fuck while pretending he's the one you do. That's called fidelity. That's +called civilization and its discontents. + -- Erica Jong, "Fear of Flying" +%% +We took some pictures of the girls, but they weren't developed. +%% + We were somewhere around Barstow on the edge of the desert when the +drugs began to take hold. I remember saying something like "I feel a bit +lightheaded; maybe you should drive...." And suddenly there was a terrible +roar all around us and the sky was full of what looked like huge bats, all +swooping and screeching and diving around the car, which was going about a +hundred miles an hour with the top down to Las Vegas. And a voice was +screaming: "Holy Jesus! What are these goddamn animals?" + Then it was quiet again. My attorney had taken his shirt off and +was pouring beer on his chest, to facilitate the tanning process. "What the +hell are you yelling about?" he muttered, staring up at the sun with his +eyes closed and covered with wraparound Spanish sungalsses. "Never mind," +I said. "It's your turn to drive." I hit the brakes and aimed the Great +Red Shark toward the shoulder of the highway. No point in mentioning those +bats, I thought. The poor bastard will see them soon enough. + -- Dr. Hunter S. Thompson, "Fear and Loathing in Las Vegas: + A Savage Journey to the Heart of the American Dream" +%% +Well, I don't know where they come from but they sure do come, +I hope they comin' for me! +And I don't know how they do it but they sure do it good, +I hope they doin' it for free! +They give me cat scratch fever... cat scratch fever! +First time that I got it I was just ten years old, +Got it from the kitty next door... +I went to see the doctor and he gave me the cure, +I think I got it some more! +Got a bad scratch fever... + -- T. Nugent, "Cat Scratch Fever" +%% +Well, I went to a party, and what did they do? +They took off their socks and they took off their shoes. +They took off their shirts, and they took off their pants, +I had a hunch, we weren't gonna dance. + +Everybody, everbody's ass was bare, +No bras left, just a queer over there. +But the whole damn thing didn't faze me a bit; +I just jumped on the pile and grabbed some tit. + +My baby's not a sports fan, +But she plays with balls whenever she can. +'Cause her favorite sport you see, +Is playing tonsil hockey. +[chorus] + Eat, bite, fuck, suck, gobble, nibble, chew; + Nipple, bosom, hair pie, finger fuck, screw. + Moose piss, cat pud, orangutan tit; + Sheep pussy, camel crack, pig-lie-in-shit. + -- Doctor Dirty, "The Eat-Bite Song" +%% +Well, he went down to dinner in his Sunday best, +Excitable boy, they all said! +And he rubbed the pot roast all over his chest, +Excitable boy, they all said! +Well, he's just an excitable boy. +He took Sally Tompkins to the junior prom, +Excitable boy, they all said! +Then he raped her and killed her, then he took her home, +Excitable boy, they all said! +Well, he's just an excitable boy. +After ten long years, they let him out of the home +Excitable boy, they all said! +And he dug up her grave, made a cage of her bones, +Excitable boy, they all said! +Well, he's just an excitable boy. + -- Warren Zevon, "Excitable Boy" +%% +Well, see, I was out with this chick last night, and we were in bed, and +she groaned to me, "Give me nine inches, and make it hurt!" So, I fucked +her twice and slapped her. +%% +Well, see, Joyce, there we were, trapped in the elevator. Now, I had +my tennis racquet and the goldfish; she was holding the Crisco. Surely +you can imagine how one thing naturally led to another! +%% +We've all heard about the woman who married a Field Service engineer but +divorced him after one day because he'd done nothing on their wedding night +but promise to have it up in 15 minutes. What few people know is that the +poor man was in the bathroom all night, masturbating furiously, saying +"I don't understand, it passes all the diagnostics!" +%% +We've just recieved the results of a survey conducted to ascertain the +various reasons men get out of bed in the middle of the night. According +to the report, 2% are motivated by a desire to visit the bathroom, and +3% have an urge to raid the refrigerator. The other 95% get up to go home. +%% +What creatures of habit we are. This morning, without thinking, half asleep, +I put $100 on my pillow. That's not so bad, no one would worry about it, but +my wife, half asleep, without thinking, gave me $20 change. +%% +What the fuck, over? +%% +What this department needs is a really good inflatible doll. +%% +What's on the floor of the old hen-house? +Doo-doo, doo-doo. + -- Foghorn Leghorn +%% +When Snow White turns on with the dwarfs +she probably winds up feeling Dopey. +%% +When a man grows old and his balls grow cold, +And the end of his knob turns blue; +When it's bent in the middle like a broken fiddle, +He can tell a tale or two. + +So find me a seat and stand me a drink +And a tale to you I'll tell +Of Dead-eye Dick and Mexico Pete When Dead-eye Dick and Mexico Pete +And the gentle Eskimo Nell. Go out in search of fun, + It's usually Dick who wields the prick +And when Dead-eye Dick and Mexico Pete And Mexico Pete the gun. +Are sore, depressed, and mad, +'Tis the cunt that bears the brunt There was rarely a day without a lay +So the shooting ain't so bad. And usually two or three + For Dead-eye Dick, his kingly prick + Was always like a tree. + -- The Ballad of Eskimo Nell +%% +When better women are made, computer programmers will make them. +%% +When ev'rybody's tryin' to sleep, +I'm somewhere makin' my midnight creep. Chorus: +In the mornin' the rooster crow, I am a back door man, +Somethin' tells me I got to go. I am a back door man, + Well, the men don't know, +They take me to the doctor, But the little girls understand. + shot full of holes, +Nurse try to save a soul. +Killed her for murder first degree, +Judge what tried let the man go free. + +Stand up, cop's wife cried, don't take him down, +Rather be dead six feet in the ground. +When you come home, you can eat pork and beans, +I eats more chicken than any man's seen. + -- Willie Dixon, "Backdoor Man", 1961 +%% +When his company fell on hard times, the boss realized that he'd have to +lay off one of his two middle managers. As both Jack and Liz were equally +honest and dedicated to their jobs, he was unable to decide which one to +fire. To resolve his dilemma, the boss arbitrarily decided that the first +to leave his or her desk the next morning would be the one to get the ax. + The next morning found Liz at her desk, rubbing her temples. Asking +Jack for some aspirin, she headed for the water fountain and that's where +the boss caught up with her. "I've got some bad news for you, Liz," he said. +"I've got to lay you or Jack off." + "Jack off," she snapped. "I have a headache." +%% +When it all boils down to the essence of truth one must live by +a dog's rule of life: If you can't eat it or fuck it, piss on it! +%% +When she hauled ass, it took three trips. +%% +When the candles are out all women are fair. + -- Plutarch +%% +When the prick stands up, the brains get buried in the ground. + -- Old Jewish saying + +[How come there aren't ever any "New Jewish sayings?" Ed.] +%% +When you and I are far apart +Can sorrow break your tender heart? +I love you darling, yes I do; +Sleep is so sweet when I dream of you; +All you are is a blossoming rose. +Night is here so I must close. +With care read the first word of each line. +You will find a question of mine. + -- Yours hopefully, The VAX. +%% +Which of the following doesn't belong? + a. meat + b. eggs + c. drum + d. blowjob. + +Answer: + d: A blowjob, because you can beat your meat, your eggs, + or your drum, but you just can't beat a blowjob. +%% +While away at a convention, an executive happened to meet a young woman who +was pretty, chic, and intelligent. When he persuaded her to disrobe in his +hotel room, he found out she had a superb body as well. Unfortunately, the +executive sadly found himself unable to perform. + On his first night home, the executive padded naked from the shower +into the bedroom to find his wife swathed in a rumpled bathrobe, her hair +curled, her face creamed, munching candy loudly as she pored through a movie +magazine. And then, without warning, he felt the onset of a magnificent +erection. + Looking down at his throbbing member, he snarled, "Why you ungrateful, +mixed-up son of a bitch! Now I know why they call you a prick!" +%% +While farmers generally allow one rooster for ten hens, +ten men are scarcely sufficient to service one woman. + -- Boccaccio +%% +While not actually a sailor, I certainly enjoy getting blown ashore. +%% +While sitting 'neath an oak one morn +In thought on this and that, +A tiny, twitt'ring little bird "Oh tiny bird, O Nature's gift +A load dropped in my hat. Of music and of wit! + Why didst thou feel that my best hat +"Thy music gladdens my poor soul, Was thy best place to shit?" +And brings joy to my heart. +But tell me, little bird divine, The tiny bird a few notes sang, +Why didst thou not just fart?" Then answer'd "Pardon me, + For thy hat I thought was my nest, +I rose and stood in solemn awe A-fallen from the tree." +His words to better mull, +Then lifted up a paving block +And crushed his fucking skull. + -- Bill Wordsworth, "A Tiny Twitt'ring Bird" +%% +While vacationing last summer in the North Woods, a young fellow thought it +might be a good idea to write his girl. He had brought no stationery with +him, however; so he had to walk into town for some. Entering the one and +only general store, he discovered that the clerk was a young, full-blown farm +girl with languorous eyes. + "Do you keep stationery?" he asked. + "Well," she giggled, "I do until the last few seconds, and then I +just go wild." +%% + While visiting our country, a lovely French maiden found herself +out of money just as her visa expired. Unable to pay her passage back to +France, she was in despair until an enterprising sailor made her a sporting +proposition. "My ship is sailing tonight," he said. "I'll smuggle you +aboard, hide you down in the hold and provide you with a mattress, blankets +and food. All it will cost you is a little love." + The girl consented, and late that night the sailor sneaked her on +board his vessel. Twice each day thereafter, the sailor smuggled a large +tray of food below decks, took his pleasure with the little French stowaway +and departed. The days turned into weeks, and the weeks might have turned +into months if the captain hadn't noticed the sailor carrying food below one +evening and followed him. After witnessing this unique bit of barter, he +waited until the sailor had departed and then confronted the girl, demanding +an explanation. She told him the whole story. + "Hmmm," mused the captian. "A clever arrangement, and I must say I +admire that young seaman's ingenuity. However, miss, I feel it is only fair +to tell you that this is the Staten Island Ferry." +%% + "Why did you spend so much time parked in that fellow's car last +night?" demanded the irate mother. +"I could hear the giggling and squealing for a good half hour." + "But, Mom," answered her daughter, "if a fellow takes you to the +movies you ought to at least kiss him good night." + "I thought you went to the Stork Club?" countered the mother. + "We did." +%% +Q: Why do women love Pacman? +A: Only place you can get eaten three times for a quarter. +%% +Why does Dr. Pepper come in a bottle? + +Because his wife left him. But things are looking up for their +reconciliation. Seems that when she left, she took his word +processor, and she's been renting it out occasionally in Japan. +That is, every now and then she gets a yen for his Wang. +%% +Why, Good Morning! I'm the bluebird of fellatio! +%% +Why is Mrs. Carter always on top when she and Jimmy make love? +Because all Jimmy Carter can do is fuck up. +%% +Why is it that there are so many more horses' asses than there are horses? + -- G. Gordon Liddy +%% +Why marry a virgin? If she wasn't good enough for +the rest of them then she isn't good enough for you. +%% +Willie in the cauldron fell; Willie saw some dynamite, +See the grief on mother's brow; Couldn't understand it quite; +Mother loved her darling well -- Curiosity never pays: +Willie's quite hard-boiled by now. It rained Willie seven days. + +Little Willie with a shout, William in a nice new sash, +Gouged the baby's eyeballs out; Fell in the fire and burned to an ash. +Stamped on them to make them pop. Now, although the room grows chilly, +Mother cried, "Now, William, stop!" I haven't the heart to poke poor Billy. + +William with a thirst for gore, +Nailed the baby to the door. +Mother said, with humor quaint: +"Careful, Will, don't mar the paint." + -- Harry Graham, "Ruthless Rhymes for Heartless Homes", 1899 +%% + With deep concern, if not alarm, Dick noted that his friend +Conrad was drunker than he'd ever seen him before. "What's the trouble, +buddy?", he asked, sliding onto the stool next to his friend. + "It's a woman, Dick," Conrad replied. + "I guessed that much. Tell me about it." + "I can't," Conrad said. But after a few more drinks his tongue +and resolution both seemed to weaken and, turning to his buddy, he said, +"Okay. It's your wife." + "My wife!!" + "Yeah." + "What about her?" + Conrad pondered the question heavily, and draped his arm around +his pal. "Well, buddy-boy," he said, "I'm afraid she's cheating on us." +%% +Women should be obscene and not heard. +%% +Women want their men to be cops. They want you to punish them and tell +them what the limits are. The only thing that women hate worse from a man +than being slapped is when you get on your knees and say you're sorry. + -- Mort Sahl +%% +Working hard around here is like pissing on yourself in +a dark suit; you get a warm feeling but nobody notices. +%% +Working here is like a pregnancy. +After nine months you wish you hadn't come. +%% +Would you rather have a 5-inch hard or an 8-inch floppy? +%% +Writers do it between periods. +%% +You are a tower of strength in the office, but only so-so in bed. +%% +You are without a doubt a rogue, a rascal, a villain, a thief, a scoundrel, +and a mean, dirty, stinking, sniveling, sneaking, pimping, pocketpicking, +thrice double-damned, no-good son-of-a-bitch. +%% +You better believe that marijuana can cause castration. +Just suppose your girlfriend gets the munchies! +%% +You can find sympathy, in the dictionary, right near shit and suicide. +%% +You can get used to living at a nudist camp. +The first three days are the hardest. + -- R. Dreiser +%% +You can pick your friends, and you can pick your nose; +but you can't pick your friend's nose. +%% +You come out of a woman and you spend the rest +of your life trying to get back inside. + -- Heathcote Williams +%% +You have been bitchy since Tuesday and you'll probably get fired today. +%% +You might get caught holding the bag. Say she's your sister. +%% +You pedophiliac sodomizer of ducklings!! +%% +You play ball with us, and we'll stick the fucking bat up your ass. +%% +You see that fucking fish? +If he'd kept his mouth shut, he wouldn'ta got caught. + -- Sam Giancana +%% + You see, this girl wakes up one morning, rolls over and sees an +elephant in the bed with her. Almost in shock, she says, "Did I pick you +up in the bar last night?" + "Uh-huh.", the elephant replies. + "Did I bring you home?" + "Uh-huh." + "Did we, uh, fool around?" + "Uh-huh." + "Lord, I must have been tight!" + "Not any more." +%% +You should be a hemorrhoid, you're such a pain in the ass. +%% +You wanna play the dozens, +Well, the dozens is a game, +But the way I fuck your mother is an ass-wringing shame! + -- George Carlin +%% +You'll be a guest at a gay party. +That will have important consequences for you. +%% +Young men want to be faithful and are not; +old men want to be faithless and cannot. + -- Oscar Wilde +%% +She's the kind of woman you could fall madly in bed with. +%% +Your spooning days are over, + And your pilot light is out; +When what used to be your sex appeal + Is now your water spout! +%% +Q: Why are babies born with soft spots on their heads? +A: So you can pick 'em up five at a time. +%% +If they can't take a joke, then fuck 'em. +If they can, then fuck 'em. +%% +Beat me, bite me, whip me, fuck me, make me write bad checks! +%% +Fuck you and anybody who looks like you. +%% +Kansas, where the men are men, the sheep +are scared and the women are grateful. +%% +Horny, adj: + When your cock gets hard if the wind blows. +%% + "Yes, sir, the bowling ball nipple rings in black. +Will there be anything else?" +%% +Teaching undergraduates is like herding sheep. And, like the old Basque +sheepherder explained, whenever the livestock starts looking good to you, +it's time to spend a night in town. +%% +San Francisco is my kind of city, +Where the women are strong and the men are pretty. +%% +Daisy, Daisy, give me your answer true, +Daisy, Daisy, wouldn't you like to screw? +I really must beg your pardon, +But I've got a hell of a hard-on, +From beating my meat, against the seat, +Of a bicycle built for two. + -- "Daisy, Daisy", "The Dirty Song Book" +%% +Love comes in spurts. + --Devo, "Please Please" +%% + Elroy stared at Barb and then leaned quietly over to Shake Tiller +and stuck out his hand. "Son," he said. "Tell the truth. It ain't better +than fried chicken, is it?" + Shake looked solemnly at Elroy, clasping his hand, and said: + "I got to be dead honest, Roy." + And Elroy said yeah, lay it on him. + Shake said slowly, "For a Lesbian who gave up the only real love she +ever knew -- Sister Francis at Our Lady of Victory -- and for a person who +can't make it any more with nothing but an electric toothbrush, she's the +finest I've ever had." + -- Dan Jenkins, "Semi-Tough" +%% +My jaw aches, my pussy is sore. +I simply can't fuck any more; + I'm covered with sweat, + And you haven't come yet, +And my God, it's a quarter to four! + -- The Gray-haired Woman's Complaint +%% +Q: What's the difference between a JAP and a baby elephant? +A: About 10 pounds. + +Q: How do you make them the same? +A: Force feed the elephant. +%% +You might as well say "yes", the sheets are messy already. +%% +Life isn't a bitch. Life is a virgin. A bitch is easy. +%% +FORTUNE TESTS THE GREAT MANAGERS: #3 + +You have prepared a proposal for your supervisor. The success of this +proposal will mean increasing your salary 20%. In the middle of your +proposal your supervisor leans over to look at your report and spits into +your coffee. You: + + (a) Tell him you take your coffee black. + (b) Ask him if he has any communicable diseases. + (c) Show him who's in command; promptly take a piss in his + "In" basket. + (d) Take a sip and comment how much better it tastes. +%% +Necrophelia, n: + Dead boring. + +Incest, n: + Relatively boring. +%% +Little Miss Muffet, sat on a tuffet, +Eating her curds and whey. +Along came a spider who sat down beside her, +And said, "What's in the bowl, bitch?" +%% +Mary had a little lamb, +It's fleece as white as snow. +It followed her to school one day, +And got fucked by a big black dog. +%% +When you're lying on the bed, +And the thought is in your head, +But the feeling is way down between your legs, +Take your problem in your hand, +And beat it to the band, +And try your best to keep it off the walls. + +Don't let your lover tell you, +Don't let anybody sell you, +That the joy of masturbation is a crime. +For I've rid myself of fears, +(I've been doing it for years) +And now I have an erection all the time. +%% +As the Catholic church becomes more and more tolerant, some day they will +have to consider the possibility of a gay pope. Possibly the largest +issue will be having to decide whether he is "absolutely divine" or "just +simply marvelous." +%% +I don't want to say that she had big tits, but one day I asked her + just how big they was, and she said, "7 and 7/8". +I said, "7 and 7/8?! What did you measure 'em with?" +And she replied, "A Stetson." +%% + It seems there were two young Marines walking down the street, and +they chanced upon a lady who was both very proper and very well endowed. +One of them said, "Wow! What tits! Hey lady, would I love to snuggle up with +them for awhile. What are you doing this afternoon?" + Well, the other Marine thought that was just about the most shameful +thing he had ever witnessed, and felt that he had to restore the honor of the +Corp. "Pardon my friend, Ma'am," he said, "He's not been very well brought +up and don't know how to talk to cunt." +%% + A bear and a rabbit are taking a crap in the woods. The bear looks +over at the rabbit and asks, "Say, does shit ever stick to your fur?" + "No." + So the bear wiped his ass with the rabbit. +%% +Once upon a time there was a farmer who had borrowed a bull to service his +two cows. He put all three animals on a meadow and sent little Johnny to +observe and report any success. A short time later, little Johnny came +running towards the house shouting: "Daddy, Daddy, the bull just fucked the +white cow!" + The father took little Johnny aside and said: "Look, kid, it's +alright if you use that kind of language around me, but the reverend is +going to be visiting soon. So next time, please use another word; just +say that the bull "surprised" the cow." + Johnny agreed and went back to observe any progress. A little +while later, while the preacher was talking to the farmer, little Johnny +came a-running again, shouting: "Daddy, Daddy!" + The father, trying to avoid embarrassing the preacher, said: "I +know, the bull surprised the brown cow." + Little Johnny replied: "He sure did, he fucked the white one again!" +%% +When things go wrong as they usually will, +And your daily road seems all uphill, +When funds are low and debts are high, +When you try to smile, but can only cry -- +And you really feel you'd like to quit, +Don't talk to me; I don't give a shit. +%% + Santa Claus comes down the chimney and the nubile sixteen-year-old +has been waiting for him. Santa sees her, and in typically unflappable +Santa-style says, "And what do you want for Christmas, little girl?" + The girl, and she's not so little, tells him. Well, Santa is +definitely flapped by this, but he manages to come out with, "Ho ho ho, +gotta go, gotta get the children their toys, you know." + The girl, not to be daunted, takes off her robe. "Aw, please stay +Santa," she begs. + He replies, "Ho ho ho, gotta go, gotta get the children their toys, +you know." + She then takes off her pajama top, her firm pouting breasts pointing +at Santa like an accusation. "Aw, please stay Santa," she pleads. + "Ho ho ho, gotta go, gotta get the children their toys, you know." + Finally, she takes off her pajama bottoms, revealing to Santa her +warm mound of delight. "Aw, please stay Santa," she begs. + Being only mortal, Santa finally gives in, sighing, "Hey hey hey, +gotta stay, can't get up the chimney with my dick this way." +%% +The three sexual positions during preganancy. + +During the first four months: Missionary style +During the second four months: Doggie style +And during the last month: Coyote style + +Coyote style? + You sit by the hole and howl. +%% + A man walks into a bar and orders 3 shots and 3 beers. The +bartender, seeing that the man is distraught, asks what the problem is. + "I just found out that my brother is gay", he replies. + About a week later, the same man walks in and orders 6 shots and +6 beers. So the bartender inquires, "What's wrong this time?" + To which the man says, "I just found out that two of my brothers +are lovers." + Another week goes by and the man comes back to the bar and orders +NINE shots and NINE beers. The bartenders says "Damn, boy, doesn't anyone in +your family like pussy?" + "Yeah. Me and my sister." +%% +Here I sit, my cheeks a flexin', +Just gave birth to another Texan. +%% + A college jock was dating a jockette; both were simple, direct, and +physical types, and not much talking was done on the dates. Not much action +either, and one night the jock decided the time had come. When they got back +to his place, he jumped her and they had a terrific tussle, wrestling back and +forth, and the jock had a great deal of difficulty in getting his penis +inserted. He pushed and shoved, and for a while all that happened was that +the girl's legs waved and thrashed about in the air. Finally he got it in and +they finished. Afterward he said, "Gee, if I'd known you were a virgin, +I'd have taken it a little easier." + The girl replied, "That's OK -- if I'd known we were going to fuck +I wouldn't have worn pantyhose." +%% +Life is like a penis: when it's soft you +can't beat it, and when it's hard you get fucked. +%% +Life is like a shit sandwich. The more bread +you have, the less shit you have to eat. +%% +He: So, what do you say to little fuck? +She: I say, "get lost, little fuck." +%% +There is a new model of car being sold in San Francisco -- +the pervertible. The top doesn't go down, but the driver does. +%% + A ten-year-old kid came home from school one day, and when his mom +asked how was school he says: "Gee, great, mom. I got laid!" + She's shocked and sends him upstairs, where his dad finds him after +work. "Mommy told me about your day at school, Billy, and I think we men +should keep it a secret. Women just don't understand these things." + So every night Dad goes up to Billy's room after Mom tucks him in: +"You get laid today, Billy?" + "Yeah, Dad." + "How was it?" + "Real neat, Dad, I liked it a lot." + "Good Boy!". + A month later: "You get laid today?" + "No, Dad." + "No? How come?" + "Gee, Dad, my ass was really sore." +%% +Hear about... + the new rule at the girls' school? + Lights out by ten, candles by eleven. +%% +Hear about... + the girl who called her boyfriend + Courvoisier, 'cause he was such a sweet liquor? +%% +Hear about... + the drunken midget who walked into a home for + girls and kissed everybody in the joint? +%% +Hear about... + the over-eager bride who came, walking down the aisle? +%% +Hear about... + the real smart girl who could play post-office all night + without getting any mail in her box? +%% +Hear about... + the new vitamin made from chicken blood, + it makes men cocky and women lay better? +%% +She was a farmer's daughter but she couldn't keep her calves together. +%% +Hear about... + the french soldier who kisses both his wife's cheeks before + he went to the front? +%% +Hear about... + the fellow who got ten years for pumping Ethyl behind the station? +%% +Hear about... + The fellow who chased his girlfriend up a tree and kissed + her between the limbs? +%% +Hear about... + the perverted australian who left his wife and returned to Sydney? +%% +Hear about... + the new breakfast cereal called "Swingers". They don't go snap, + crackle, or pop; they just lie there and go bang, bang, bang? +%% +Hear about... + the new instrument of credit especially designed for use in + single bars? It's called Bang Americard. +%% +Hear about... + the couple on the stalled elevator who got off between floors? +%% +Hear about... + the nymphomaniac teenager popularly known as Little Often Annie? +%% +Hear about... + the ultimate in singles bars? It's a place where girls have + to show their I.U.D.'s to be admitted. +%% +Hear about... + the young thing who is fondly known to the men in the office as + Secretariat -- not just because she's a good secretary but because + she's a wonderful mount? +%% +Hear about... + the mother of 12 who was called upon to use her diaphragm so often + that she kept it tacked to the headboard of her bed? +%% +Hear about... + the handsome bachelor Senator who hired a ravishing blonde as his + assistant and then made her the object of a long Congressional probe? +%% +Hear about... + the guy who took a course in exotic lovemaking and announced that + he'd never be able to face his girl again? +%% +Hear about... + the careless contortionist who accidentally swallowed his pride? +%% +Hear about... + the inexperienced stenographer who discovered that she could lose + a lot more than letters behind the files? +%% +Hear about... + the ambitious secretary who walked into her boss's office and + demanded a salary on next week's advance? +%% +Hear about... + the woman who claimed that two martinis usually made her + feel like a new man? +%% +Hear about... + the doctor that prescribed sex for insommia? His patients didn't + get any more sleep, but they had more fun staying awake. +%% +Hear about... + the cinema buff that's very excited by current trends in films? + The hero still gets the girl in the end, but he's never sure + which end it will be. +%% +Hear about... + the basketball player who was so tall that his girlfriend had to + go up on him? +%% +Hear about... + the new breakfast cereal called Queerios? You simply add milk + and they eat each other. +%% +Hear about... + the guy who couldn't find his way to the orgy? Just + kind of lost his ball bearings. +%% +Hear about... + the guy who was an incurable romantic until penicillin came along? +%% +Hear about... + the hurricane that recently struck Fire Island -- Hurricane Bruce? +%% +Bookstores will soon be stocking a volume called "The Unsensuous +Census Taker". It's about a guy who comes once every ten years. +%% +Hear about... + the fellow who maintains a special register of particularly + accommodating girls? He refers to it as his little blew book. +%% +We understand that the vote on a bill to +legalize bisexuality could go either way. +%% +Hear about... + one penile desensitizer that's so effective that you + have to stroke the tube for five minutes to get the cap off? +%% +Hear about... + the loner who gave up his solitary vice for + Lent? Except on Palm Sunday, of course. +%% +Hear about... + the high school drum major who dated two of the + majorettes and so enjoyed the breasts of both whirlers? +%% +Five-foot nine, eyes that shine +He was born in Palestine +Has anybody seen my Lord? + +He's so cool, he's so fine +Eat his bread and drink his wine +Has anybody seen my Lord? + +He's so neat, he's so cool, +Walks across my swimming pool. +Has anybody... +%% +Q: How can you tell when a Polish girl's been sucking cock? +A: She has a mouthful of feathers. +%% +He's learned about 50% of the rules of sex and conversation; +he knows how to stick it in, but not how to stick it out. +%% +The two things that you should never lend out are your car +or your woman. Someone's bound to throw a rod in either one. +%% +SUBPOENA: + From the root "sub", below, and the Latin "poena" for male organ + or penis. Therefore, "below the penis" or "by the balls." +%% +Couples in motion have moments. +%% + "Jean, what is this attraction between Catholic girls and +Jewish men?" + "You really want to know?" + "Yeah." + "Well, Carol, Jewish men are great in bed... right, Bob? And +Catholic girls fuck like bunnies." +%% +How soon can you have sexual relations after your wife delivers? +Well, depends on if she's in a ward or a private room. +%% +I don't know why women get so upset, +they have half the money and all the pussy. + -- Gary Bussy, "DC Cab" +%% +You will always have friends +Some friends will peter out. +But I'll always be your friend, +Peter in or peter out. +%% +Here's to the girl in little red shoes, +She drinks my liquor, she drinks my booze, +She has no cherry, but that's no sin, +She has the box the cherry came in. +%% +Here's to the girl that's dressed in black, +She's dressed so neat there's nothing to lack +She feels so fine and kisses so sweet +She makes things stand that have no feet. +%% +If thine eye offends thee, pluck it out. +If thy dick offends thee, whack it off. +%% +A hand in a bird is worth two on 'er bush. +%% +They watched the sun slowly sink behind the hills, and the fiery glow on the +lake fade into darkness. He eyed her shadowy figure, accentuated by the moon- +light, as the tension from within began to fuel his animalistic desires. +She followed him, ever so quietly, as they sought a secluded corner in the +barn. Alone! At last. His hands roamed about her soft back, around to her +thighs, and finally caressed her budding nipples. Oh, how smooth and succulent +she was! "Was it so wrong?", he asked himself. No, he thought, for his +father had done it, as did his own father, ad infinitum. The boiling, +uncontrollable rage within him became unbearable. She signalled her eagerness, +spreading her legs, as he grasped her nipples again. Stroking, again and +again, longer each time. It began coming; again, again, again, again. His +mind raced with fear "Will it stop?". Exhausted, he lay down beside her. +"Dear God, what have I done?". Suddenly, his father burst in. His eyes +burned as he stared for what seemed an eternity. Finally, his father spoke. + "Son, you ain't supposed to milk the damn cow till mornin'!" +%% +You know what burns my ass? A flame about three feet high. +%% + A strange looking white man came to the Indian reservation looking +for a job. He asked to talk to the Chief of the tribe, so he might give his +qualifications. The Chief strode forward from the group surrounding the +white man and said: "You leave! No job!" + The man explained that this was no ordinary job he was seeking, but +that of tribe Medicine-Man. He would convince him if the Chief would allow +him to demonstrate his magic. "No magic!" said the disbelieving Chief. + "Oh, yeah?", said the stranger. "I'll prove it to you by making +your dog, here, talk!" + "Dog, no talk!" responded the Chief, but before he could finish, he +heard a voice coming out of the mouth of the dog saying, "The Chief treats me +good. He feeds me, and keeps me in teepee when it snows!" + "If you still have doubts as to my magic," continued the stranger, +"the next voice you'll hear will be that of your horse!" + "Horse, no talk!" argued the still-sceptical Chief, but again he +heard a voice that said: "I am the Chief's favorite horse. He takes me up to +the green pasture to eat and brushes my coat when I get dirty." + The stranger, still seeing some disbelieving faces, claimed for his +final trick he would make the Chief's sheep talk. + "NO!" cried the Chief, "SHEEP LIE!" +%% +Sure eating yoghurt will improve your sex life. People +know that if you'll eat that stuff, you'll eat anything. +%% +There's a tendency today to absolve individuals from moral responsibility and +treat them as victims of social circumstance. You buy that, you pay with your +soul. It's not men who limit women, it's not straights who limit gays, it's +not whites who limit blacks. What limits people is lack of character. What +limits people is that they don't have the fucking nerve or imagination to star +in their own movie, let alone direct it. + -- Bernard Mickey Wrangle +%% +Q: Why are Unix emulators like your right hand? +A: They're just pussy substitutes! +%% + Out on the great American desert one day, a bald eagle reached a +state of great libidal distress. Pickings were slim, but in time, he saw a +dove flying by. "Better than nothin'", he muttered (birds in jokes can mutter) +and swooped down, grabbed the dove and flew to his nest. Feathers flew, and +eventually the dove tottered to the edge of the cliff and shouted (yes, they +shout, too): + "I'm a dove! I've been loved! And I LIKE it!" + Well, this took care of the old boy for a while but soon enough he +was at it again. All he could find was a lark, so away he went, and feathers +flew and soon the lark tottered to the edge of the cliff and shouted: + "I'm a lark! I've been sparked! And I LIKE it!" + As you can guess, some time later our friend was again in need of +amor... lib... you know! This time, all that happened by was... a duck! +So down he swooped, and feathers flew, and the next thing seen is the duck +tottering to the cliffside and shouting: + "I'M A DRAKE! THERE'S BEEN A MISTAKE! AND I DON'T LIKE IT!!! +%% +One day, in a bar, a young man walks in with a little dwarf about one foot +tall on his shoulder and orders a beer. The bartender serves the man a beer; +to his astonishment, the little guy walks down the man's arm, takes a swallow +of the brew and spits it in his face. After a few minutes the customer +orders another beer and the exact same thing happens. Well, by this time, +the bartender is getting pretty upset; he figures that the man should take +care of the dwarf. So he asks the guy, "Why are you letting that guy drink +all your beer and spit it in my face?" + "Well, sir, when I was on a contract in Saudi Arabia I met this genie +and he granted me three wishes. I asked for a million dollars, the most +beautiful woman in the world, and a twelve-inch prick. +%% +A real estate agent, looking over a farmer's house for possible sale, +commented to the farmer how sturdy the house looked. + The farmer replied, "Yep, built it with my bare hands... did it +the hard way. The steps to the front door, here, carved 'em out of +field stones... did it the hard way. That hardwood floor in the living +room, dovetailed the pieces myself... did it the hard way. The ceiling +beams, made 'em out of my own oak trees... did it the hard way." + Just then, the farmer's gorgeous daughter walked in. The farmer +looks over at the real estate agent who is trying not to stare too +obviously and smiles. "Yep... standing up in a canoe." +%% +One day Adam, while wandering around the Garden of Eden, noticed that all +the animals seemed to come in pairs, male and female. He also noted that +they seemed to enjoy being together a lot. So, he went to his special +place an reported to God what he'd noticed. + God, understanding his need, said, "Adam, the time has come for me +to provide you with a mate. Go lie down and when you have fallen asleep, I +will create your mate." + So Adam wandered off, found a nice patch of soft grass and fell +asleep. Some time later he awoke, possibly due to a bit of pain in his +ribs, possibly because of the gorgeous woman leaning over him. Remembering +the animals he'd seen having such fun, he immediately reached for her. +Pretty soon Adam's back at his special place. + "God?" + "Yes, Adam, what now?" + "God, what's a headache?" +%% +Jesus died for your sins... make it worth his time. +%% +That reminds me of a friend of mine who went north to work on the Alaskan +pipeline. Before he went up there, he was just a skinny little runt. When +he got back, he was a husky fucker. +%% +The young stud walked into a bordello. After he took his clothes off, the +woman was puzzled to see him put a clothespin on his nose, stuff cotton in +his ears, and put a prophylactic on his penis. + "Hey," she asked, "what the hell are you doing?" + "Well, ma'am", replied the stud, "there are two things I just can't +stand. A screaming woman and the smell of burning rubber." +%% +I love this fucking University, and this University loves fucking me. +%% +Q: What is Smoorplay? +A: What Smurfs do before they smuck! +%% + Well, there was this tiger, who woke up one morning, and just felt +great (yes, just like Tony the Tiger: GREAAAAAAT). Anyway, he just felt +so good, he went out and cornered a small monkey and roared at him: "WHO IS +THE MIGHTIEST OF ALL THE JUNGLE ANIMALS?" + And this poor quaking little monkey replied: "You are of course, no +one is mightier than you." + A little while later this tiger confronts a deer, and just bellows out: +"WHO IS THE GREATEST AND STRONGEST OF ALL THE JUNGLE ANIMALS?" + The deer is shaking so hard it can barely speak, but manages to +stammer: "Oh great tiger, you are by far the mightiest animal in the jungle." + The tiger, being on a roll, swaggered, up to an elephant that was +quietly munching on some weeds, and roared at the top of his voice: "WHO IS +THE MIGHTIEST OF ALL THE ANIMALS IN THE JUNGLE?" + Well, this elephant grabs the tiger with his trunk, picks him up, slams +him down; picks him up again, and shakes him until the tiger is just a blur of +orange and black; and finally throws him violently into a nearby tree. + The tiger staggers to his feet, looks at the elephant and says: "Man, +you don't have to get so pissed, just because you don't know the answer!" +%% + When the surgeon came to see her on the morning after her +operation, the young woman asked him somewhat hesitantly how long +it would be before she could resume her sex life. + "I really haven't thought about it," gulped the stunned surgeon. +"You're the first patient who's asked me that after a tonsillectomy!" +%% + People who claim to know jackrabbits will tell you they are primarily +motivated by Fear, Stupidity and Craziness. But I have spent enough time in +jackrabbit country to know that most of them lead pretty dull lives; they are +bored with their daily routines: eat, fuck, sleep, hop around a bush now and +then... No wonder some of them drift over the line into cheap thrills once in +a while; there has to be a powerful adrenalin rush in crouching by the side of +a road, waiting for the next set of headlights to come along, then streaking +out of the bushes with split-second timing and making it across to the other +side just inches in front of the speeding front wheels. + Why not? Anything that gets the adrenalin moving like a 440 volt +blast in a copper bathtub is good for the reflexes and keeps the veins free +of cholesterol ... but too many adrenalin rushes in any given time-span has +the same bad effect on the nervous system as too many electro-shock treatments +are said to have on the brain: after a while you start burning out the +circuits. + When a jackrabbit gets addicted to road running, it is only a matter +of time before he gets smashed -- and when a journalist turns into a politics +junkie he will sooner or later start raving and babbling in print about things +that only a person who has Been There can possibly understand. + -- Hunter Thompson, "Fear and Loathing: On the Campaign Trail" +%% +Tip O'Neill is just like Congress; old, fat and out of control. + -- J. LeBoutillier +%% + One of my favorite Zoo jokes has to do with a woman who, while +visiting the zoo, desided to have a little fun with the Gorilla. She walks +up to his cage, reaches in, and begins to fondle the beast. Needless to +say, the animal becomes quite excited, and as he tries to reciprocate in +kind, the woman steps back and gives him a raspberry...! + The gorilla becomes enraged. He rips the bars from his cage, grabs +the woman, drags her back into the cage, and ravishes her. While doing so, +he inflicts a great deal of harm upon her person. + Later, at the hospital, a neighbor of the woman visits and exclaims, +"Oh, you poor dear...! Are you hurt?" + "Hurt!", "Hurt!?" the injured lady sobs, "He doesn't phone. He +never writes..." +%% +If guns are outlawed, how will we shoot the liberals? +%% +On one hot dusty day in 1860, a lone Mexican bandit crossed the border into +Texas. After robbing a small bank and shooting up the town, he led the posse +on a merry chase through the desert. On the sixth day of the chase he was +apprehended. + Sheriff-to-interpreter: "Ask him where the money is." + Interpreter-to-bandit: "He wants to know where you hid the money." + Bandit-to-interpreter: "I'll never tell, never!" + Interpreter-to-sheriff: "He says he'll never tell, senor." +At this point, the sheriff loses his cool. His town has been shot up, his +bank robbed, he's spent a week in the desert tracking this guy, and now he +says he'll never tell. So he takes his pistol, jams it under the bandits' +chin, and, with the veins standing out on his neck, screams "Tell him to tell +me where the money is, or I'm gonna blow his brains all over the desert!" + Interpreter-to-bandit: "He says if you don't tell him where the + money is right now, he will kill you here." + Bandit-to-interpreter: "Do not kill me, senor, the money is hidden + under the big tree at the pass!" + Interpreter-to-sheriff: "He says you ain't got the balls..." +%% +Tell you what," the haberdasher said to a persistent job applicant. "I've +got one suit I can't sell -- that purple, green and yellow number over there. +If you can make that sale, you've not only got the job, you've got it for +life." + Then the store owner left for lunch. When he returned, he was shocked +to see the young man's clothes in tatters and his hands and face bleeding. + "My God, what happened to you?" + "I sold the suit! I sold the suit!" the young man shouted, a smile +on his bloodied lips. + "Congratulations," the haberdasher said. "You've got the job. But +what happened? Did the customer start a fight?" + "Oh, no," the new salesman replied. "But his Seeing Eye dog was +*pissed*." +%% +The voters have spoken, the bastards... +%% +Hypocrisy is the vaseline of social intercourse. +%% +I'm not a pheasant plucker, +Nor a pheasant plucker's son. +I'm just a'plucking pheasants +'Til the pheasant plucker comes. +%% +Hear about... + the careless canary that did it for a lark? +%% +Hear about... + the truck driver who pulled out to + avoid a child and fell off the sofa? +%% +Hear about... + the over-anxious bride who came down the aisle? +%% +Hear about... + the absent minded nurse who made + the patient without disturbing the bed? +%% +Hear about... + the frustrated musician who worked all week on an + arrangement and then his wife didn't leave town? +%% +Hear about... + the fellow who was descended from a long line his mother heard? +%% +Hear about... + the girl that wanted to impress her new boyfriend, + so she put on her low-cut dress to show him a thing or two? +%% +A Frenchman who lived in Alsace +Had sex with a virgin named Grace. + When he popped her cherry, + She made things hairy +By bleeding all over his face. +%% +A bad little girl in Madrid, +A most reprehensible kid, + Told her Tante Louise + That her cunt smelled like cheese, +And the worst of it was that it did! +%% +A beat schizophrenic said, "Me? +I am not I, I'm a tree." + But another, more sane, + Shouted, "I'm a Great Dane!" +And covered his pants leg with pee. +%% +A beautiful belle of Del Norte +Is reckoned disdainful and haughrty + Because during the day + She says: "Boys, keep away!" +But she fucks in the gloaming like forty. +%% +A beautiful lady named Psyche +Is loved by a fellow named Ikey. + One thing about Ike + The lady can't like +Is his prick, which is dreadfully spikey. +%% +A big-bosomed Bunny named Gression +Sold cigars at a key-club concession. + When she swiveled about + Even strong men cried out, +For her costume did not keep her flesh in. +%% +A bobby of Nottingham Junction +Whose organ had long ceased to function + Deceived his good wife + For the rest of her life +With the aid of his constable's truncheon. +%% +A broken-down harlot named Tupps +Was heard to confess in her cups: + "The height of my folly + Was fucking a collie -- +But I got a nice price for the pups." +%% +A cautious young fellow named Tunney +Had a whang that was worth any money. + When eased in half-way, + The girl's sigh made him say, +"Why the sigh?" "For the rest of it, honey." +%% +A certain young person of Ghent, +Uncertain if lady or gent, + Shows his organs at large + For a small handling charge +To assist him in paying the rent. +%% +A chap down in Oklahoma +Had a cock that could sing La Paloma, + But the sweetness of pitch + Couldn't put off the hitch +Of impotence, size and aroma. +%% +A charmer from old Amarillo, +Sick of finding strange heads on her pillow, + Decided one day + That to keep men away +She would stuff up her crevice with Brillo. +%% +A chippy who worked in Black Bluff +Had a pussy as large as a muff. + It had room for both hands + And some intimate glands, +And was soft as a little duck's fluff. +%% +A clever young man named Eugene +Invented a jack-off machine. + On the twenty-third stroke + The fuckin' thing broke +And beat both his balls to a creame. +%% +A contortionist hailing from Lynch +Used to rent out his tool by the inch. + A foot cost a quid -- + He could and he did +Stretch it to three in a pinch. +%% +A couple was fishing near Clombe +When the maid began looking quite glum, + And said, "Bother the fish! + I'd rather coish!" +Which they did -- which was why they had come. +%% +A cowhand way out in Seattle +Had a dooflicker flat as a paddle. + He said, "No, I can't fuck + A lamb or a duck, +But golly! it just fits the cattle." +%% +A cute little twerp from Samoa +Had a cock of one inch and no moa. + It was good for keyholes + And debutantes' peeholes +But not worth a damn on a whoa. +%% +A daredevil skater named Lowe, +Leaps barrels arranged in the snow, + But is proudest of doing, + Some incredible screwing, +Since he's jumped thirteen girls in a row! +%% +A deep-throated virgin named Netty +Was sucking a cock on the jetty. + She said, "It tastes nice, + Much better than rice, +Though not quite as good as spaghetti." +%% +A despairing old landlord named Fyfe, +With a frigid and quarrelsome wife, + Let his third-story front, + To a willing young cunt, +Who supplied him a new lease on life! +%% +A distinguished professor from Swarthmore +Got along with a sexy young sophomore. + As quick as a glance + He stripped off his pants, +But he found that the sophomore'd got off more. +%% +A doctoral student from Buckingham +Wrote his thesis on cunts and on fucking'em. + But a dropout from paree + Taught him Gamahuchee +So he added a footnote on sucking 'em. +%% +A do-it-yourselfer named Alice, +Used a dynamite stick for a phallus. + She blew her vagina + To South Carolina, +And her tits landed somewhere in Dallas. +%% +A dulcet-voiced callgirl named Shedd, +Who's cultured, well-spoken, well-bred, + Had achieved some reknown + For her tone going down-- +There's a nice civil tongue in her head. +%% +A fair-haired young damsel named Grace +Thought it very, very foolish to place + Her hand on your cock + When it turned hard as rock, +For fear it would explode in your face. +%% +A farmer I know named O'Doole +Had a long and incredible tool. + He can use it to plow, + Or to diddle a cow, +Or just as a cue-stick at pool. +%% +A fellatrix's healthful condition +Proved the value of spunk as nutrition. + Her remarkable diet + (I suggest that you try it) +Was only her clients' emission. +%% +A fellow whose surname was Hunt +Trained his cock to perform a slick stunt: + This versatile spout + Could be turned inside out, +Like a glove, and be used as a cunt. +%% +A fisherman off of Cape Cod +Said, "I'll bugger that tuna, by God!" + But the high-minded fish + Resented his wish, +And nimbly swam off with his rod. +%% +A girl of uncertain nativity +Had an ass of extreme sensitivity + While she sat on the lap + Of a German or Jap, +She could sense Fifth Column activity. +%% +A habit obscene and bizarre, +Has taken a-hold of papa. + He brings home young camels + And other odd mammals, +And gives them a go at mama. +%% +A habit obscene and unsavory, +Holds a CS professor in slavery. + With maniacal howls, + He deflowers young owls, +That he keeps in an underground aviary. +%% +A hacker-turned-pervert named Fisk +Made love to the drive of his disk. + The thing circumsized him, + Which rather suprised him. +He wasn't aware of *that* risk. +%% +A hardware debugger named Court +Shoved his tool in an Ethernet port. + But its buffer array + Only handled 1K, +So the port's driver cut it off short. +%% +A highly aesthetic young Jew +Had eyes of a heavenly blue; + The end of his dillie + Was shaped like a lilly, +And his balls were too utterly two! +%% +A highway patrol buff named Claire, +Once screwed half a troop on a dare, + And her parts grew so hot, + There was steam on her twat, +So they nicknamed her Smokey the Bare! +%% +A horny young fellow named Reg, +Was jerking off under a hedge. + The gardener drew near + With a huge pruning shear, +And trimmed off the edge of his wedge. +%% +A huge-organed female in Dallas, +Named Alice, who yearned for a phallus, + Was virgo intacto, + Because, ipso facto, +No phallus in Dallas fit Alice. +%% +A lacklustre lady of Brougham +Weaveth all night at her loom. + Anon she doth blench + When her lord and his wench +Pull a chain in the neighbouring room. +%% +A lad, at his first copulation, +Cried, "What a sensation! Inflation, + Gyration, elation + Throughout the duration, +I guess I'll give up masturbation." +%% +A lad from far-off Transvaal +Was lustful, but tactful withal. + He'd say, just for luck, + "Mam'selle, do you fuck?" +But he'd bow till he almost would crawl. +%% +A lady from Old Little Rock +In fidelity took little stock, + And deserted her man + In the streets of Japan +For a boy with a prehensile cock. +%% +A lady removing her scanties, +Heard them crackle electrical chanties. + Said her beau, "Have no fear, + For the reason is clear: +You simply have amps in your panties. +%% +A lady stockholder quite hetera +Decided her fortune to bettera: + On the floor, quite unclad, + She successively had +Merrill Lynch, Pierce, Fenner, et cetera... +%% +A lady while dining at Crewe +Found an elephant's whang in her stew. + Said the waiter, "Don't shout, + And don't wave it about, +Or the others will all want one too." +%% +A lady with features cherubic +Was famed for her area pubic. + When they asked her its size + She replied in surprise, +"Are you speaking of square feet, or cubic?" +%% +A licentious old justice of Salem +Used to catch all the harlots and jail 'em. + But instead of a fine + He would stand them in line, +With his common-law tool to impale 'em. +%% +A lonely young lad of Eton +Used always to sleep with the heat on, + Till he ran into a lass + Who showed him her ass -- +Now they sleep with only a sheet on. +%% +A lusty young maid from Seattle +Got pleasure by sleeping with cattle; + Till she found a bull + Who filled her so full +It made both her ovaries rattle. +%% +A lusty young woodsman of Maine +For years with no woman had lain, + But he found sublimation + At a high elevation +In the crotch of a pine -- God, the pain! +%% +A maestro directing in Rome +Had a quaint way of driving it home. + Whoever he climbed + Had to keep her tail timed +To the beat of his old metronome. +%% +A maiden who lived in Virginny +Had a cunt that could bark, neigh and whinny. + The horsey set rushed her, + But success finally crushed her +For her tone soon became harsh and tinny. +%% +A maiden who wrote of big cities +Some songs full of love, fun and pities, + Sold her stuff at the shop + Of a musical wop +Who played with her soft little titties. +%% +A man was once heard to boast, +That he received a parcel by post, + It contained, so we heard, + A magnificent turd, +And the balls of his grandfather's ghost. +%% +A marine being sent to Hong Kong +Got a doctor to alter his dong. + He sailed off with a tool + Flat and thin as a rule - +When he got there he found he was wrong. +%% +A mathematician named Hall +Had a hexhedronical ball, + And the square of its weight + Times his pecker's, plus eight, +Was four-fifths of five-eighths of fuck-all. +%% +A mathematician named Hall +Has a hexahedronical ball, + And the cube of its weight + Times his pecker's, plus eight +Is his phone number -- give him a call... +%% +A middle-aged codger named Bruin +Found his love life completely in ruin, + For he flirted with flirts + Wearing pants and no skirts, +And he never got in for no screwin'. +%% +A milkmaid there was, with a stutter, +Who was lonely and wanted a futter. + She had nowhere to turn, + So she diddled a churn, +And managed to come with the butter. +%% +A mortician who practised in Fife +Made love to the corpse of his wife. + "How could I know, Judge? + She was cold, did not budge-- +Just the same as she'd acted in life." +%% +A nervous young fellow named Fred +Took a charming young widow to bed. + When he'd diddled a while + She remarked with a smile, +"You've got it all in but the head." +%% +A newlywed couple from Goshen +Spent their honeymoon sailing the ocean. + In twenty-eight days + They got laid eighty ways -- +Imagine such fucking devotion! +%% +A newly-wed man of Peru +Found himself in a terrible stew: + His wife was in bed + Much deader than dead, +And so he had no one to screw. +%% +A notorious whore named Ms. Hearst, +In the pleasures of men was well-versed. + Reads the sign o'er the head + Of her well-rumpled bed +"The customer always comes first." +%% +A nudist resort at Benares +Took a midget in all unawares. + But he made members weep + For he just couldn't keep +His nose out of private affairs. +%% +A passionate red-haired girl +When you kissed her, her senses would whirl, + And her twat would get wet, + And would wiggle and fret, +And her cunt-lips would curl and unfurl. +%% +A petulant man once said, "Pish, +Your cunt is as big as a dish." + She replied, "Why, you fool, + With your limp little tool, +It's like driving a pin with a fish." +%% +A pious old woman named Tweak +Had taught her vagina to speak. + It was frequently liable + To quote from the Bible, +But when fucking -- not even a squeak! +%% +A pious young lady named Finnegan +Would caution her friend, "Well, you're in again; + So time it aright, + Make it last through the night, +For I certainly don't want to sin again!" +%% +A pious young lady of Chichester +Made all of the saints in their niches stir + And each morning at matin + Her breast in pink satin +Made the bishop of Chichester's breeches stir. +%% +A plumber whose name was John Brink +Plumbed the cook as she bent o'er the sink. + Her resistance was stout, + And John Brink petered out, +With his pipe-wrench all limber and pink. +%% +A potter who lived in Bombay +Once fashioned a cunt out of clay; + But the heat of his prick + Kilned the damn thing to brick +And chafed all his foreskin away. +%% +A pretty wife living in Tours +Demanded her daily amour. + But the husband said, "No! + It's to much. Let it go! +My backsides are dragging the floor." +%% +A pretty young lady named Vogel +Once sat herself down on a molehill. + A curious mole + Nosed into her hole -- +Ms. Vogel's ok, but the mole's ill. +%% +A pretty young maiden from France +Decided she'd "just take a chance." + She let herself go + For an hour or so +And now all her sisters are aunts. +%% +A rapturous young fellatrix +One day was at work on five pricks. + With an unholy cry + She whipped out her glass eye: +"Tell the boys I can now take on six." +%% +A reckless young lady of France +Had no qualms about taking a chance, + But she thought it was crude + To get screwed in the nude, +So she always went home with damp pants. +%% +A remarkable race are the Persians; +They have such peculiar diversions. + They make love the whole day + In the usual way +And save up the nights for perversions. +%% +A romantic attraction has clung +To a chap of whom damsels have sung: + "'Tis the Scourge from the East, + That lascivious beast +Who was known as Attila the Hung!" +%% +A sailor who slept in the sun, +Woke to find his fly buttons undone, + He remarked with a smile, + "Good grief, a sun-dial! +And now it's a quarter-past one." +%% +A savvy young hooker named Gail +Got busted and lodged in the jail. + But the jailer got hot, + To be lodged in her twat, +And so Gail made the bail with her tail. +%% +A scandal involving an oyster +Sent the Countess of Clews to a cloister + She preferred it, in bed, + To the count (so she said) +'Cause it's longer and stronger and moister. +%% +A seafaring hacker named Slatey +Went to bed with a VAX/780. + The thing's learned to swear + With a nautical air, +And refers to its users as "matey". +%% +A sex-loving coed named Bree +Caught the clap from her Apple IIE. + The joystick, she found, + Had been fooling around +With a neighboring student's PC. +%% +A stout Gaelic warrior, McPherson, +Was having a captive, a person + Who was not averse + Though she had the curse, +And he'd breeches of bristling furs on. +%% +A structured programmer named Drew +Was intensely turned on by "goto". + When he saw it in code + He'd shoot off his load. +It's a good thing his shop used so few. +%% +A studious professor named Nestor +Bet a whore all his books that he could best her. + But she drained out his balls + And skipped up the walls, +Beseeching poor Nestor to rest her. +%% +A sweetheart named Teresa Arden +Went down on her beau in the garden. + He said, "Good lord, Tess, + Don't swallow that mess " +And she replied, "Ulp, beg your pardon?" +%% +A talented fuckstress, Miss Chisholm, +Was renowned for her fine paroxysm. + While the man detumesced + She still spent on with zest, +Her rapture sheer anachronism. +%% +A team playing baseball in Dallas +Called the umpire blind out of malice. + While this worthy had fits + The team made eight hits +And a girl in the bleachers named Alice. +%% +A tidy young lady of Streator +Dearly loved to nibble a peter. + She always would say, + "I prefer it this way. +I think it is very much neater." +%% +A tired young trollop of Nome +Was worn out from her toes to her dome. + Eight miners came screwing, + But she said, "Nothing doing; +One of you has to go home!" +%% +A vengeful technician named Schmitz +Caused a disk drive to go on the fritz. + He covered the platter + With bats' fecal matter. +Now it's seek time is really the pits. +%% +A very odd pair are the Pitts: +His balls are as large as her tits, + Her tits are as large + As an invasion barge-- +Neither knows how the other cohabits. +%% +A wanton young lady from Wimley +Reproached for not acting quite primly + Said, "Heavens above! + I know sex isn't love, +But it's such an entrancing facsimile." +%% +A weary old lecher named Blott +Took a luscious young blond to his yacht. + Too lazy to rape her, + He made darts out of paper, +Which he leisurely tossed at her twat. +%% +A whimsical fellow named Bloch +Could beat the base drum with his cock. + With a special erection + He could play a selection +From Johann Sebastian Bach. +%% +A wide-bottomed girl named Trasket +Had a hole as big as a basket. + A spot, as a bride, + In it now, you could hide, +And include with your luggage your mascot. +%% +A widow whose singular vice +Was to keep her late husband on ice + Said, "It's been hard since I lost him -- + I'll never defrost him! +Cold comfort, but cheap at the price." +%% +A wonderful tribe are the Sweenies, +Renowned for the length of their peenies. + The hair on their balls + Sweeps the floors of their halls, +But they don't look at women, the meanies. +%% +A wood-fetish busboy named Gable +Is rapid, is thorough, is able; + But when everything's cleared, + He gives way to the weird, +As he lovingly busses each table. +%% +A worn-out young husband named Lehr +Her daily his wife's plaintive prayer: + "Slip on a sheath, quick, + Then slip your big dick +Between these lips covered with hair." +%% +A worried young man from Stamboul +Founds lots of red spots on his tool. + Said the doctor, a cynic, + "Get out of my clinic; +Just wipe off the lipstick, you fool!" +%% +A young Juliet of St. Louis +On a balcony stood acting screwy. + Her Romeo climbed, + But he wasn't well timed, +And half-way up, off he went -- blooey! +%% +A young fellow discovered through Freud +That although of penis devoid, + He could practice coitus + By eating a foetus, +And his parents were quite overjoyed. +%% +A young lady sat by the sea, +Just as proper as proper could be. + A young fellow goosed her, + And roughly seduced her, +So she thanked him and went home to tea. +%% +A young man by a girl was desired +To give her the thrills she required, + But he died of old age + Ere his cock could assuage +The volcanic desire it inspired. +%% +A young man from the banks of the Po +Found his cock had elongated so, + That when he'd pee + It was never he +But only his neighbors who'd know. +%% +A young man maintained that his trigger +Was so big that there weren't any bigger. + But this long and thick pud + Was so heavy it could +Scarcely lift up its head. It lacked vigor. +%% +A young man of Llanfairpwllgwyngyll +While bent over plucking a dingle + Had the whole of Eisteddfod + Taking turns at his pod +While they sang some impossible jingle. +%% +A young man with passions quite gingery +Tore a hole in his sister's best lingerie. + He slapped her behind + And made up his mind +To add incest to insult and injury. +%% +A young polo-player of Berkeley +Made love to his sweetheart beserkly. + In the midst of each chukker + He would break off and fuck her +Horizontally, laterally and verkeley. +%% +A young systems programmer of Sprotic +Found his software intensely erotic. + In jealous distress + He wiped his OS. +It's possible that he's a psychotic. +%% +A young violinist from Rio +Was seducing a woman named Cleo. + As she took down her panties + She said, "No andantes; +I want this allegro con brio!" +%% +A young wife in the outskirts of Reims +Preferred frigging to going to mass. + Said her husband, "Take Jacques, + Or any young cock, +For I cannot live up to your ass." +%% +A young woman got married at Chester, +Her mother she kissed her and blessed her. + Says she, "You're in luck, + He's a stunning good fuck, +For I've had him myself down in Leicester." +%% +Alas for the Countess d'Isere, +Whose muff wasn't furnished with hair. + Said the Count, "Quelle surprise!" + When he parted her thighs; +"Magnifique! Pourtant pas de la guerre." +%% +All the female apes ran from King Kong +For his dong was unspeakably long. + But a friendly giraffe + Quaffed his yard and a half, +And ecstatically burst into song. +%% +An AI researcher named Bluth +Wrote, to find out the sexual truth, + Eroticon VI, + Which he taught certain tricks +Which I'm sure can't be found in Knuth. +%% +An aesthete from South Carolina +Had a cock that tickled like China, + But while shooting his load + It cracked like old Spode, +So he's bought him a Steuben vagina. +%% +An agreeable girl named Miss Doves +Likes to jack off the young men she loves. + She will use her bare fist + If the fellows insist +But she really prefers to wear gloves. +%% +An amazon giantess named Dunne +Let a midget screw her for fun. + But the poor little runt + Was engulfed in her cunt +And re-born as the twin of his son. +%% +An ambitious lady named Harriet +Once dreamed she was raped in a chariot + By seventeen sailors + A monk and three tailors, +Mohammed and Judas Iscariot. +%% +An anonymous woman we knew +Was dozing one day in her pew; + When the preacher yelled "Sin!" + She said, "Count me in +As soon as the service is through." +%% +An arrogant wench from Salt Lake +Liked to tease all the boys on the make. + She was finally the prize + Of a man twice her size +And all she recalls is the ache. +%% +An eager young hacker named Gus +Once buggered a VAX Unibus. + The hardware went bad, + But not the young lad +He didn't expect all that fuss! +%% +An envious girl named McMeanus +Was jealous of her lover's big penis. + It was small consolation + That the rest of the nation +Of women were with her in weeness. +%% +An exotic young lady named Suki +Once danced in a troupe of kabuki + When asked for a fuck + She said, "Solly, no luck-- +See here: looky looky, no nuki " +%% +An impish young fellow named James +Had a passion for idiot games. + He lighted the hair + Of his lady's affair +And laughed as she pissed through the flames. +%% +An impotent Scot named MacDougall +Had to husband his sperm and be frugal. + He was gathering semen + To gender a he-man, +By screwing his wife through a bugle. +%% +An ingenious young man in South Bend +Made a synthetic ass for a friend, + But the friend shortly found + Its construction unsound, +It was simply a bother -- no end. +%% +An octagenerian Jew +To his wife remained steadfastly true. + This was not from compunction, + But due to dysfunction +Of his spermatic glands -- nuts to you. +%% +An old couple just at Shrovetide +Were having a piece -- when he died. + The wife for a week + Sat tight on his peak, +And bounced up and down as she cried. +%% +An old man at the Folies Bergere +Had a jock, a most wondrous affair: + It snipped off a twat-curl + From each new chorus girl, +And he had a wig made of the hair. +%% +An organist playing in York +Had a prick that could hold a small fork, + And between obbligatos + He'd munch at tomatoes, +To keep up his strength while at work. +%% +An orgasmic young sex star named Sue +Was a hit as she writhed to a screw. + Her climatic fame spread + With an ad blitz that said: +Coming soon at a theater near you! +%% +And earnest young woman in Thrace +Said, "Darling, that's not the right place!" + So he gave her a thwack, + And did on her back, +What he couldn't have done face to face. +%% +And then there's the story that's fraught +With disaster -- of balls that got caught, + When a chap took a crap + In the woods, and a trap +Underneath... Oh, I can't bear the thought! +%% +As for weirdness, the guy who's the tops +Is a kinky old butcher named Pops. + Since he thinks it's effete + To be beating his meat, +What he's into is licking his chops. +%% +At Vassar, sex isn't injurious, +Though of love we are never penurious. + Thanks to vulcanized aids, + Though we may die old maids, +At least we shall never die curious. +%% +At the moment Japan declared war +A sailor was fucking a whore. + He said, "After this poke + `Long and hard' ain't no joke; +This means months 'til I get back ashore." +%% +Coitus upon a cadaver +Is the ultimate way you can have 'er. + Her inanimate state + Means a man needn't wait, +And eliminates all the palaver. +%% +Cum Hilde autem ambulabat +Homo qui aedificabat. + Dixit volebat. Debet et potebat. + Sic ille ducebat. Statim faciebat. +Sed virginem pine necebat. +%% +Dame Catherine of Ashton-on-Lynches +Got on with her grooms and her wenches: + She went down on the gents, + And pronged the girl's vents +With a clitoris reaching six inches. +%% +De Hispanice puella verumque +Simplex oris verborumque + Tulit potens vagina + Hominum agmina +Iterum iterum iterumque. +%% +Did you hear about young Henry Lockett? +He was blown down the street by a rocket. + The force of the blast + Blew his balls up his ass, +And his pecker was found in his pocket. +%% +Don't dip your wick in a WAC, +Don't ride the breast of a WAVE, + Just sit in the sand + And do it by hand, +And buy bonds with the money you save. +%% +Down by the old model T, +Where she first showed it to me. + It was furry and black, + And she called it a crack, +But it looked like a manhole to me. +%% +DuPont, I.G., Monsanto, and Shell +Built a world-circling pussy cartel, + And by planned obsolescence, + So controlled detumescence, +A poor man could not get a smell. +%% +Es giebt ein Arbeiter von Tinz, +Er schlaft mit ein Madel von Linz. + Sie sagt, "Halt sein' plummen, + Ich hore Mann kommen." +"Jacht, jacht," sagt der Plummer, "Ich binz." +%% +Ethnologists up with the Sioux +Wired home for two punts, one canoe. + The answer next day, + Said, "Girls on the way, +But what the hell's a `panoe'?" +%% +Fond of equestrians, Mabel +Looked for true love in the stable. + But she found the studs, + For her were all duds, +Now she's out with the leg of a table. +%% +For a house-to-house salesman named Moore, +Getting housewives' attention's no chore: + He's endowed with a dong + That is 12 inches long, +So he wedges his foot in the door. +%% +For the sores on his prick he used Dial. +That failed; he gave Lava a trial. + But the one remedy + For contagious V.D. +Is the wonder drug sulfa-denial. +%% +"For the tenth time, dull Daphnis," said Chloe, +"You have told me my bosom is snowy; + You have made much fine verse on + Each part of my person, +Now do something -- there's a good boy!" +%% +From deep in the crypt at St. Giles +Came a bellow that echoed for miles. + Said the rector, "My gracious, + Has Father Ignatius +Forgotten the Bishop has piles!?" +%% +Have you heard of knock-kneed Samuel McGuzzum +Who married Samantha, his bow-legged cousin? + Some people say, + Love finds a way, +But for Sam and Samantha it doesn'. +%% +Have you heard of the lady named Cox +Who had a capacious old box? + When her lover was in place + She said, "Please turn your face. +I look like a gal, but I screw like a fox." +%% +He hated to mend, so young Ned +Called in a cute neighbor instead. + Her husband said, "Vi, + When you stitched up his torn fly, +Did you have to bite off the thread?" +%% +He'd kiss and the girls called him Georgie +They'd cry and the girls called him Porgie. + So he put Spanish fly + In their pudding and pie +And had the first tiny-tot orgy. +%% +"Hell, no," said the Duchess of Quick, +"I won't suck his filthy old prick! + It's not that I funk + At a mouthful of spunk, +But the smell of his ass makes me sick!" +%% +Her brother, a bastard named Ben, +Could rotate his pecker, and then + He would shoot through his rear + Which made him dear +Of the girls, and the envy of men. +%% +Her daughter, thought worried Ms. Coffin, +Had morals the city might soften. + So she phoned and asked, "Lynn, + Are you living in sin?" +Lynn said, "No -- but I visit there often." +%% +I dined with Lord Hughing Fitz-Bluing +Who said, "Do you squirm when you're screwing?" + I replied, "Simple shagging + Without any wagging +Is only for screwing canoeing." +%% +I know of a fortunate Hindu +Who is sought in the towns that he's been to + By the ladies he knows, + Who are thrilled to the toes +By the tricks that he makes his foreskin do. +%% +I met a young man in Chungking +Who had a very long thing -- + But you'll guess my surprise + When I found that its size +Just measured a third-finger ring! +%% +I never had Miss Defauw, +But it wouldn't have been quite so raw + If she'd only said "No" + When I wanted her so; +But she didn't -- she laughed and said "Naw!" +%% +I once had the wife of a Dean +Seven times while the Dean was out skiin'. + She remarked with some gaiety, + "Not bad for the laiety, +Though the Bishop once managed thirteen." +%% +I once met a lassie named Ruth +In a long distance telephone booth. + Now I know the perfection + Of an ideal connection +Even if somewhat uncouth. +%% +I once was annoyed by a queer +Who made his intentions quite clear. + Said I, "I'm no prude, + So don't think me rude, +But I'm already stewed, screwed, and tattooed." +%% +I wooed a stewed nude in Bermuda, +I was lewd, but my God! she was lewder. + She said it was crude + To be wooed in the nude-- +I persued her, subdued her, and screwed her! +%% +I'd rather have fingers than toes, +I'd rather have ears than a nose, + And a happy erection + Brought just to perfection +Makes me terribly sad when it goes. +%% +If you're speaking of actions immoral +The how about giving the laurel + To doughty Queen Esther, + No three men could best her -- +One fore, and one aft, and one oral. +%% +Il y avait un plombier, Francois, +Qui plombait sa femme dans le Bois. + Dit-elle, "Arretez! + J'entends quelqu'un venait." +Dit le plombier, en plombant, "C'est moi." +%% +Il y avait une madame de Lahore +Dont la figure n'etait la meilleure, + Mais la vagine tres forte, + Toujours ouverte la porte, +Encore, et encore, et encore. +%% +In bed Dr. Oscar McPugh +Spoke of Spengler -- and ate crackers too. + His wife said, "Oh, stuff + That philosophy guff +Up your ass, dear, and throw me a screw!" +%% +In the Garden of Eden lay Adam, +Complacently stroking his madam, + And loud was his mirth + For on all of the earth +There were only two balls -- and he had 'em. +%% +In the case of a lady named Frost, +Whose cunt's a good two feet acrost, + It's the best part of valor + To bugger the gal, or +You're apt to fall in and get lost. +%% +In the little French town of Le'Beau, +Lived a maiden exceedingly droll. + At a masquerade ball, + Clad in nothing at all, +She backed in as a Parker house roll. +%% +It always delights me at Hank's +To walk up the old river banks. + One time in the grass + I stepped on an ass, +And heard a young girl murmur, "Thanks." +%% +It had snowed, and the man in the drift, +Flagged her down and asked, "Give me a lift?" + They sat in her Bentley, + She fondled him gently, +And the lift that he'd asked for was swift! +%% +King Louis gave a lesson in class, +One time while enjoying a lass. + When she used the word "Damn" + He rebuked her: "Please ma'am, +Keep a more civil tongue in my ass." +%% +"Last night," said a lassie named Ruth, +"In a long-distance telephone booth, + I enjoyed the perfection + Of an ideal connection -- +I was screwed, if you must know the truth." +%% +Love letters no longer they write us, +To their homes they so seldom invite us. + It grieves me to say, + They have learned with dismay, +We can't cure their `vulva pruritus'. +%% +Meet Elmer, young son of the Thorpes, +Afflicted with psychotic warps. + His idea of fun + Is to bugger a nun, +And then vomit all over the corpse. +%% +Now hear this fair lass from Rhode Isle +Who said with a wink and a smile, + "Sure, please stick it in, + Be it thick be it thin, +But if's rough I won't do as a file." +%% +Oden the bardling averred +His muse was the bum of a bird, + And his Lesbian wife + Would finger his fife +While Fisherwood waited as third. +%% +Of his face she thought not very much, +But then, at the very first touch, + Her attitude shifted -- + He was terribly gifted +At frigging and fucking and such. +%% +Oh, pity the Duchess of Kent! +Her cunt is so dreadfully bent, + The poor wench doth stammer, + "I need a sledgehammer +To pound a man into my vent." +%% +Oh pity the prince, Montezuma +He tried to make love to a puma. + Seems the puma, in play, + Tore his testes away -- +An example of animal huma. +%% +On a cannibal isle near Malaysia +Lives a lady they call Anastasia. + Not Russian elite- + She's eager to eat +Whatever or whoever lays her. +%% +On the porch of a dude named Horatio, +His girl got a yen for fellatio. + As she sucked on his dingus + He tried cunnilingus +But the cops ran 'em off of that patio. +%% +One evening a guru had coitus +With an actress, a whore and a poetess. + When asked what position + He used for coition, +He answered serenely, "the lotus." +%% +One night a girl had an affair +With a fellow all covered with hair. + Then she picked up his hat + And realized that +She'd been had by Smokey the Bear. +%% +Perplexed, a shy virgin named Plummer +Asked, "what's there to do in the summer?" + She declined and declined + Till approached from behind... +When her summer turned out quite a bummer! +%% +Playing poker with busty Ms. Ware, +He announced as he folded with flair, + "I had four of a kind, + But those aces combined, +Don't stack up, I'm afraid with your pair." +%% +Prince Absalom lay with his sister +And bundled and nibbled and kissed her, + But the kid was so tight, + And it was deep night -- +Though he shot at the target, he missed her. +%% +Prope mare erat tubulator +Qui virginem ingrediebatur. + Dessine ingressus + Audivi progressus: +Est mihi inquit tubulator. +%% +Said a dainty young whore named Ms. Meggs, +"The men like to spread my two legs, + Then slip in between, + If you know what I mean, +And leave me the white of their eggs." +%% +Said a horny young girl from Milpitas, +"My favorite sport is coitus." + But a fullback from State, + Made her period late, +And now she has athlete's fetus. +%% +Said a lecherous fellow named Shea, +When his prick wouldn't rise for a lay, + "You must sieze it, and squeeze it, + And tease it, and please it, +For Rome wasn't built in a day." +%% +Said a lesbian lady, "It's sad; +Of all the girls that I've had, + None gave me the thrill + Of real rapture until +I learned how to be a tribade." +%% +Said a madam named Mamie La Farge +To a sailor just off of a barge, + "We have one girl that's dead, + With a hole in her head-- +Of course there's a slight extra charge." +%% +Said a modest young miss to de Sade, +I'm simply too shy and afraid + To take part in your pranks. + But to show you my thanks, +I'd just love to become your first aide. +%% +Said a pornographistic young poet +"Although I perhaps do not show it, + My interest in sin + Is wearing quite thin, +And I'll soon tell those fuckers to stow it." +%% +Said a swinging young chick named Lyth +Whose virtue was largely a myth, + "Try as hard as I can, + I can't find a man +That it's fun to be virtuous with." +%% +Said the Duchess of Danzer at tea, +"Young man, do you fart when you pee?" + I replied with some wit, + "Do you belch when you shit?" +I think that was one up for me. +%% +Says an airlining wanton named Vi: +"I'm a pantyless stew when I fly. + To a muffer's delight, + I'll take head on a flight, +So the guy can have pie in the sky." +%% +She made a thing of soft leather, +And topped off the end with a feather. + When she poked it inside her + She took off like a glider, +And gave up her lover forever. +%% +She was coming round the mountain doin' ninety, +When the chain on her motorcycle broke, + Now she's lying in the grass, + With the muffler up her ass, +And her tits a-playin' Dixie on the spokes. +%% +Shouted Frosty the Snowman "Hooray! +I'm agog with excitement today! + And the reason of course, + A reliable source, +Said the snow blower's heading this way!" +%% +"Snyder's got a stiff ticket," said Kay, +"Come on, take it out, and let's play." + He pulled it on out, + But she started to pout, +His ticket was only a quarter-inch stout. +%% +So here was this fellow of Strensall +Whose pecker was shaped like a pencil, + Anemic, 'tis true, + But an interesting screw, +Inasmuch as the tip was prehensile. +%% +Thank God for the Duchess of Gloucester, +She obliges all who accost her. + She welcomes the prick + Of Tom, Harry or Dick, +Or Baldwin, or even Lord Astor. +%% +That Harvard don down at El Djim -- +Oh, wasn't it nasty of him, + With the whole harem randy, + The sheik himself handy, +To muss up a young camel's quim. +%% +That naughty old Sappho of Greece +Said "What I prefer to a piece + Is to have my pudenda + Rubbed hard by the enda +The little pink nose of my niece." +%% +The King named Oedipus Rex +Who started this fuss about sex + Put the world to great pains + By the spots and the stains +Which he made on his mother's pubex. +%% +The King plugged the Queen's ass with mustard +To make her fuck hot, but got flustered, + And cried, "Oh, my dear, + I am coming, I fear, +But the mustard will make you come `plus tard'." +%% +The Reverend Henry Ward Beecher +Called a girl a most elegant creature. + So she laid on her back + And, exposing her crack, +Said, "Fuck that, you old Sunday School Teacher!" +%% +The Shah of the Empire of Persia +Lay for days in a sexual merger. + When the nautch asked the Shah, + "Won't you ever withdraw?" +He replied with a yawn, "It's inertia." +%% +The acrobats - Tom and Louise- +Do an act in the nude on their knees. + They crawl down the aisle + While screwing dog-style, +As the orchestra plays Kilmer's "Trees." +%% +The late Brigham Young was no neuter -- +No faggot, no fairy, no fruiter. + Where ten thousand virgins + Succumbed to his urgin's +There now stands the great State of Utah. +%% +The latest reports from Good Hope +State that apes there have pricks thick as rope, + And fuck high, wide, and free, + From the top of one tree +To the top of the next -- what a scope! +%% +The new local cinematorium +Is not only a super sensorium, + But a highly effectual + Heterosexual +Mutual masturbatorium. +%% +The nipples of Sarah Sarong +When excited are twelve inches long + This embarassed her lover + Who was pained to discover +She expected no less of his dong +%% +The notorious Duchess of Peels +Saw a fisherman fishing for eels. + Said she, "Would you mind? -- + Shove one up my behind. +I am anxious to know how it feels." +%% +The skater, Barbara Ann Scott +Is so fuckingly "winsome" a snot, + That when posed on her toes + She elaborately shows +Teeth, fat ass, titties and twat. +%% +The spouse of a pretty young thing +Came home from the wars in the spring. + He was lame but he came + With his dame like a flame -- +A discharge is a wondeful thing. +%% +"The testes are cooler outside," +Said the doc to the curious bride, + "For the semen must no + Get too fucking hot, +And the bag fans your bum on the ride." +%% +"The testes are cooler outside," +Said the doc to the curious bride, + "For the semen must not + Get too fucking hot, +And the bag fans your bum on the ride." +%% +The wife of young Richard of Limerick +Complained to her husband, "My quim, Rick, + Still grows in diameter + Each time that you ram at her; +How can your poor tool stay so slim, Rick?" +%% +The woman who lives on the moon +Is still cherishing the balloon + Of an earthling who'd come + And given her some, +But had dribbled away all too soon. +%% +There a young man from the Coast +Who had an affair with a ghost. + At the height of orgasm + Said the pallid phantasm, +"I think I can feel it -- almost!" +%% +There is a young faggot named Mose +Who insists that you fuck his long nose. + And you'll double the joy + Of this lecherous boy +If you'll tickle his balls with your toes. +%% +There once was a Duchess of Bruges +Whose cunt was incredibly huge. + Said the king to this dame + As he thunderously came: +"Mon Dieu! Apres moi, le deluge!" +%% +There once was a Scot named McAmeter +With a tool of prodigious diameter. + It was not the size + That cause such surprise; +'Twas his rhythm -- iambic pentameter. +%% +There once was a Swede in Minneapolis, +Discovered his sex life was hapless: + The more he would screw + The more he'd want to, +And he feared he would soon be quite sapless. +%% +There once was a chick named Longet, +Who went out to Aspen to play. + Along came a Spyder, + Who sat down beside her +And she blew the poor bastard away. +%% +There once was a couple named Kelley, +Who lived their life belly to belly. + Because in their haste + They used library paste, +Instead of petroleum jelly. +%% +There once was a dentist named Stone +Who saw all his patients alone. + In a fit of depravity + He filled the wrong cavity, +And my, how his practice has grown! +%% +There once was a fag of Khartoom +Who spent the night in a Lesbians room. + They argued all night, + Over who had the right, +To do what, and with which, and to whom. +%% +There once was a fellow named Bob +Who in sexual ways was a snob. + One day he was swimmin' + With twelve naked women +And deserted them all for a gob. +%% +There once was a fellow named Brewster +Who said to his wife, as he goosed her, + "It used to be grand + But look at my hand +You're not wiping as clean as ya uster." +%% +There once was a fellow named Howard, +Whose tool it was nuclear-powered, + While grabbing some ass, + He reached critical mass, +But think of the girl he deflowered! +%% +There once was a fellow named Siegel +Who attempted to bugger a beagle, + But the mettlesome bitch + Turned and said with a twitch, +"It's fun, but you know it's illegal." +%% +There once was a fencer named Fisk, +Whose speed was incredibly brisk. + So fast was his action, + The Fitzgerald contraction, +Foreshortended his foil to a disk. +%% +There once was a floozie named Annie +Whose prices were cosy--but cannie: + A buck for a fuck, + Fifty cents for a suck, +And a dime for a feel of her fanny. +%% +There once was a freshman named Lin, +Whose tool was as thin as a pin, + A virgin named Joan + From a bible belt home, +Said "This won't be much of a sin." +%% +There once was a gaucho named Bruno, +Who said, "About sex, well, I do know, + Sheep are just fine, + Chickens, divine, +But iguanas are Numero Uno." +%% +There once was a gay young Parisian +Who screwed an appendix incision, + And the girl of his choice + Could hardly rejoice +At the horrible lack of precision. +%% +There once was a girl from Cornell +Whose teats were shaped like a bell. + When you touched them they shrunk, + Except when she was drunk, +And then they got bigger than hell. +%% +There once was a girl from Decatur, +Who got laid by a big alligator. + Now nobody knew + The result of that screw, +'Cause after he laid her, he ate her. +%% +There once was a girl from Spokane, +Went to bed with a one-legged man. + She said, "I know you-- + You've really got two! +Why didn't you say so when we began?" +%% +There once was a girl named Mcgoffin +Who was diddled amazingly often. + She was rogered by scores + Who'd been turned down by whores, +And was finally screwed in her coffin. +%% +There once was a girl named Priscilla +Whose vagina was flavored vanilla. + The taste was so fine + Man and beast stood in line +(Including a stud armadilla). +%% +There once was a golfer named Leer, +Who got put in the clink for a year, + For an action obscene, + On the very first green. +Where the sign said "Enter course here." +%% +There once was a gouty old colonel +Who grew glum when the weather grew vernal, + And he cried in his tiffin + For his prick wouldn't stiffen, +And the size of the thing was infernal. +%% +There once was a hacker named Ken +Who inherited truckloads of Yen. + So he built him some chicks, + Of silicon chips, +And hasn't been heard from since then. +%% +There once was a handsome young seaman +Who with ladies was really a demon. + In peace or in war, + At sea or on shore, +He could certainly dish out the semen. +%% +There once was a horny old bitch +With a motorized self-frigger which + She would use with delight + All day long and all night - +Twenty bucks: Abercrombie & Fitch. +%% +There once was a horse named Lily +Whose dingus was really a dilly. + It was vaginoid duply, + And labial quadruply -- +In fact, he was really a filly. +%% +There once was a husky young Viking +Whose sexual prowess was striking. + Every time he got hot + He would scour the twat +Of some girl that might be to his liking. +%% +There once was a jolly old bloke +Who picked up a girl for a poke. + He took down her pants, + Fucked her into a trance, +And then shit into her shoe for a joke. +%% +There once was a kiddie named Carr +Caught a man on top of his mar. + As he saw him stick 'er, + He said with a snicker, +"You do it much faster than par." +%% +There once was a lady from Exeter, +So pretty that men craned their necks at her. + One was even so brave + As to take out and wave +The distinguishing mark of his sex at her. +%% +There once was a lady from Kansas +Whose cunt was as big as Bonanzas. + It was nine inches deep + And the sides were quite steep -- +It had whiskers like General Carranza's. +%% +There once was a lady named Carter, +Fell in love with a virile young Tartar. + She stripped off his pants, + At his prick quickly glanced, +And cried: "For that I'll be a martyr!" +%% +There once was a lady named Clair, +Who posessed a magnificent pair. + Or that's what I thought, + Till I saw one get caught, +On a thorn and begin losing air. +%% +There once was a lady named Myrtle +Who had an affair with a turtle. + She had crabs, so they say, + In a year and a day +Which proved that that turtle was fertile. +%% +There once was a lifeguard named Lee +Who rescued a girl from the sea + She asked how to pay, + And he said "Try this way, +Go down for the third time on me." +%% +71: + 69 with two fingers up your ass. + -- George Carlin +%% +When someone tells you to "take it like +a man" it usually means up your ass. +%% +Bend over and take it like a man! +%% +Gravity is an unforgiving motherfucker. +%% +I know a Polack his name is Cliff, +Hey-la-de-la-de-la. +He sticks it in the freezer to get it stiff, +Hey-la-de-la-de-lo. + +I know a girl, her name is Serafina, +Hey-la-de-la-de-la. +She'll get down on all fours for a bowl of Purina, +Hey-la-de-la-de-lo. + +I know a girl, her name is Cuffy, +Hey-la-de-la-de-la. +She douches with Tide and makes her pubes fluffy, +Hey la-de-la-de-lo. + -- Doctor Dirty +%% +Hangover, n: + The burden of proof. +%% +When the naive young lady asked the clerk in Le Sex Shoppe to show her his +selection of vibrators, he brought out the two most popular ones. + "The basic white one here is twenty dollars," the clerk said. "The +flesh-toned model is thirty." + "I'm just not sure," the woman said, Then she noticed an eye-catching +item on the back shelf. "How much is that plaid one over there? + "Uh, well, that's a pretty special one," said the clerk. "I couldn't +sell you that one for less than a hundred." + "I'll take it." + Later that day, the store owner checked in to see how business was +going. "Great," the clerk told him. "This morning, I sold four white +vibrators and three flesh-toned ones. And, this afternoon, I got a hundred +bucks for my Thermos." +%% +We have reason to believe that man first +walked upright to free his hands for masturbation. + -- Lily Tomlin +%% + A white man was traveling with Indian (American) out West. The +Indian stops, puts his ear to the ground, and says, "Buffalo come." + The white man looks around in all directions, sees nothing for +miles and asks the Indian how the hell he's knows that. + Replies the Indian, "Ear wet." + -- Lily Tomlin, "The Search for Signs of Intelligent + Life in the Universe" +%% +Swallow, v: + The (blew) bird of birth control. +%% +Having lost his potency years before, the octogenarian was desperate to +satisfy his new 18-year-old wife. He visited a gypsy woman with magical +powers. + After the man downed a foul-tasting potion, the gypsy said, "There. +Now the words beep-beep will give you an enormous erection. Repeating +the phrase will make it disappear. But remember," she cautioned, "it will +work only three times. Make use of them wisely." + As the old man left, he decided to test her prediction. "Beep-beep," +he said, and sure enough, he got the biggest erection of his life. +"Beep-beep", he repeated. It went away. + He sped through traffic on his way home. "Beep-beep," honked a taxi. +The old man gasped as he instantly got hard. + "Beep-beep," honked a truck. His erection wilted. + Pulling into his driveway at last, the frantic man rushed inside +and found his nubile wife lying on the bed reading a novel. + "Have I got a surprise for you," he said, tearing off his clothes. +"Beep-beep!" + "Hold on a second," his wife said, eyeing his magnificent erection. +"What's all this beep-beep shit?" +%% +After a few steamy dances and a few more drinks, the pickup couple +are back at his place tearing their clothes off. Things are really +starting to heat up when he leaps out of bed and starts frantically +rummaging through a dresser drawer. + "What are you doing?" she asks. + "Just a second, honey, I'm trying to find my lucky rubber." +%% +Be prepared... that's the Boy Scout's solemn creed. +Be prepared... to be clean in word and deed. +Don't solicit for your sister, that's not nice, +Unless you get a good percentage of her price. + -- Tom Lehrer +%% +Claude believed that only smart attractive people had the right +to fuck, and it sincerely hurt him when he discovered evidence to +the contrary. + -- Tom Robbins, "Jitterbug Perfume" +%% +I walked on toward Ploughwright, thinking about faeces. What a lot we +had found out about the prehistoric past from the study of fossilized +dung of long-vanished animals. A miraculous thing, really; a recovery +from the past from what was carelessly rejected. And in the Middle +Ages, how concerned people who lived close to the world of nature were +with the faeces of animals. And what a variety of names they had for +them: the Crotels of a Hare, the Friants of a Boar, the Spraints of +an Otter, the Werderobe of a Badger, the Waggying of a Fox, the Fumets +of a Deer. Surely there might be some words for the material so near +to the heart of Ozy Froats [an academic studying feces] than shit? +What about the Problems of a President, the Backward Passes of a +Footballer, the Deferrals of a Dean, the Odd Volumes of a Librarian, +the Footnotes of a Ph.D., the Low Grades of a Freshman, the Anxieties +of an Untenured Professor? + -- Robertson Davies, "The Rebel Angels" +%% +A certain bartender decided to try to get a few new customers into his bar +by starting a gimmick involving a horse. His claim was that if anyone could +get the horse to laugh, he would give them drinks on the house. The idea +worked well and business improved until one night a young man walked in and +whispered in the horse's ear. The horse immediately burst into hysterical +laughter and the man won the contest. The next night the same thing +happened: the man whispered in the horse's ear and the horse burst out +laughing. The next night, the bartender decided to change the rules. Now, +a person had to get the horse to cry in order to win the drinks on the +house. Later on that night, the same guy came in and said "Can I take the +horse into the bathroom for a minute? I promise I'll make him cry." The +bartender agreed and sure enough, when the man came out leading the horse, +the horse was crying his eyes out. The bartender could take it no more and +said, "How did you make him laugh the other two nights?" + "I told him that my dick was bigger than his", replied the man. + "How did you make him cry tonight?" + "I proved it." +%% +Man in stall: + Hey, buddy? Is there any toilet paper out there? +Man at sink: + No, I don't see any. Just a second... Nope, none in + any of the other stalls either. +A minute passes. +Man in stall: + Say, buddy? +Man at sink: + Yeah? +Man in stall: + You got change for a ten? +%% +Q: What did Jesus tell the Aggies? +A: Play dumb until the second coming. +%% +May a diseased yak take a liking to your sister. +%% +May the fairy god-camel leave a lump on your pillow! +%% +May Allah blow sand in your Preparation H. +%% +May a deranged midget on a pogo stick +take refuge in your sister's hoop skirt. +%% +A gorgeous young sophomore is having an affair with her English +professor. She goes home to visit her family for Christmas vacation +and when she gets back, she immediately invites him over for the +night. As soon as he walks through the door she hugs him and +asks, "Were you blue while I was away?" + "Blown, my dear," the professor corrects her, "blown." +%% +The operator's left hand quivered as she gingerly unlatched the +catch to the diskette reader. Uncontrollably, she reached down, +guiding the sharply pointed diskette into the deep, dark slot. +The floppy diskette nearly folded under the repeated thrusts of +her hand, until finally she could control it no longer, her right +hand instinctively taking an option zero. And then it all came at +once, thousands upon thousands of data bits flowing from diskette +to disk in a torrent of torrid transfer, as the helpless legs +of the 32 strained to remain on the floor. +%% +I've been feeling kind of jealous, +Of all them well-hung fellas, +Like Michael, Rod, and Mick. It would have to be a big one, +Tell me, Doctor can you mend me? A giant, horny love gun, +I've a case of penis envy -- To let me be a jock. +If I only had a dick. Girls would never beg my pardon, + They would turn on to my hardon -- + If I only had a cock. +Oh, I can tell you now, +The number of times I'd score, +I could fuck girls like I would not be just a housewife, + I never have before, Living a little mouse-life +And then I'd cum (wee!) In days that drag out long. +And fuck some more! I would dance and I'd be merry + Life would be a ding-a-derry + If I only had a dong! + -- to "If I Only Had A Brain", The Wizard of Oz +%% +Condoms are like listening to a symphony with cotton in your ears. +%% + Are you a Young Urban Professional Woman? If so, you know how +Yuppie women are; cold, ruthless bitches with no time for love, and only +an occasional weekend for sex. Your one "hot date" with Joe Fastrack, +rising corporate star, ended in disaster. Yesterday you heard him telling +a friend over lunch, "The woman must masturbate with popsicles!" Well, +all is not lost! SofSqueeze can change your nickname to Electrolux in just +15 minutes a day! + SofSqueeze is a pressure sensitive device (divided into appropriate +sections) that plugs into the serial port of most home computers. Through +the magic of biofeedback, SofSqueeze teaches you control over your vaginal +muscles. With our exciting, easy-to-follow software you'll master the +"Cincinnati Squeeze", the "Irresistable", the "California Crusher", and, +of course, the perennial favorite, "Milking Time Down on the Farm". Or, +using our exclusive Interactive Mode, invent your own! + SofSqueeze is made of sturdy ABS plastic, and is completely +immersible for easy cleaning. SofSqueeze's flesh-toned exterior is finely +textured for a realistic effect. Requires 4K RAM, a DB25 serial port and +limited graphics capability. Comes fully assembled, with 4 AA batteries. +%% +It's a bitch being butch. +%% +Of course, most people eventually give up bowling for sex. +The balls are lighter and you don't have to change your shoes. +%% +Some of the management around here are the +final proof that the Indians fucked the buffalo. +%% +Life is not a cabaret. +It's a fucking circus. +%% +Yuck Foo. +%% +Winning isn't everything, but losing really sucks. +%% +There once was a man from Calcutta +Who used to beat off in the gutta + The heat of the sun + Affected his gun +And turned all his cream into butta! +%% +There once was a man from Madras, +Whose balls were made out of brass. + When they clanged together, + They played "Stormy Weather", +And lightning shot out of his ass. +%% +There once was a man from Nantee +Who buggered an ape in a tree. + The results were most horrid + All ass and no forehead +Three balls and a purple goatee. +%% +There once was a man from Nantucket, +Whose cock was so long he could sucket. + He said with a grin, + As he wiped off his chin, +If my ear were a cunt I could fucket. +%% +There once was a man from Racine, +Who invented a screwing machine. + Both concave and convex, + It could please either sex, +But, oh, what a bastard to clean! +%% +There once was a man from Sydney +Who could put it up to her kidney. + But the man from Quebec + Put it up to her neck; +He had a big one, now didn't he? +%% +There once was a man named Lodge, +Who had seatbelts installed in his Dodge. + When his date was strapped in, + He committed a sin, +Without ever leaving the garage. +%% +There once was a man named McGruder, +Who canoed with a girl in Bermuder. + But the girl thought it crude, + To be wooed in the nude, +So McGru took an oar and subduder. +%% +There once was a man named McSweeny +Who spilled some raw gin on his weeny. + Just to be couth, + He added vermouth, +And slipped his girlfriend a martini. +%% +There once was a man named Parridge +With peculiar views on marriage. + He sucked off his brother, + Fucked his own mother, +And gobbled his sister's miscarriage. +%% +There once was a miner named Dave, +Who kept a dead whore in his cave. + She was ugly as shit, + And missing one tit, +But think of the money he saves. +%% +There once was a newspaper vendor, +A person of dubious gender. + He would charge one-and-two + For permission to view +His remarkable double pudenda. +%% +There once was a plumber from Leigh, +Who was plumbing his maid by the sea, + Said she, "Please stop plumbing, + I think someone's coming!" +Said he, "Yes I know, love, it's me." +%% +There once was a queen of Bulgaria +Whose bush had grown hairier and hairier, + Till a prince from Peru + Who came up for a screw +Had to hunt for her cunt with a terrier. +%% +There once was a sad Maitre d'hotel +Who said, "They can all go to hell! + What they do to my wife -- + Why it ruins my life; +And the worst is they all do it well." +%% +There once was a sailor named Gasted, +A swell guy, as long as he lasted, + He could jerk himself off + In a basket, aloft, +Or a breeches-buoy swung from the masthead. +%% +There once was a son-of-a-bitch, +Neither clever, nor handsome, nor rich, + Yet the girls he would dazzle, + And fuck to a frazzle, +And then ditch them, the son-of-a-bitch! +%% +There once was a woman from Arden +Who sucked off a man in a garden. + He said, "My dear Flo, + Where does all that stuff go?" +And she said, "[Swallow hard] I beg pardon?" +%% +There once was a yokel of Beaconsfield +Engaged to look after the deacon's field, + But he lurked in the ditches + And diddled the bitches +Who happened to cross that antique 'un's field. +%% +There once was a young fellow named Blaine, +And he screwed some disgusting old jane. + She was ugly and smelly, + With an awful pot-belly, +But... well, they were caught in the rain. +%% +There once was a young man from Boston +Who drove around town in an Austin, + There was room for his ass, + And a gallon of gas, +So he hung out his balls and he lost 'em. +%% +There once was a young man named Gene, +Who invented a screwing machine. + Concave and convex, + It served either sex, +And it played with itself inbetween. +%% +There once were two brothers named Luntz +Who buggered each other at once. + When asked to account + For this intricate mount, +They said, "Ass-holes are tighter than cunts." +%% +There was a bluestocking in Florence +Wrote anti-sex pamphlets in torrents, + Till a Spanish grandee, + Got her off with his knee, +And she burned all her works with abhorrence. +%% +There was a family named Doe, +An ideal family to know. + As father screwed mother, + She said, "You're heavier than brother." +And he said, "Yes, Sis told me so!" +%% +There was a fat lady of China +Who'd a really enormous vagina, + And when she was dead + They painted it red, +And used it for docking a liner. +%% +There was a fat man from Rangoon +Whose prick was much like a ballon. + He tried hard to ride her + And when finally inside her +She thought she was pregnant too soon. +%% +There was a gay countess of Bray, +And you may think it odd when I say, + That in spite of high station, + Rank and education, +She always spelled cunt with a 'k'. +%% +There was a gay dog from Ontario +Who fancied himself a Lothario. + At a wench's glance + He'd snatch off his pants +And make for her Mons Venerio. +%% +There was a gay parson of Norton +Whose prick, although thick, was a short 'un. + To make up for this loss, + He had balls like a horse, +And never spent less than a quartern. +%% +There was a gay parson of Tooting +Whose roe he was frequently shooting, + Till he married a lass + With a face like my arse, +And a cunt you could put a top-boot in. +%% +There was a girl from Aberystwyth +Who brought grain to the mill to get grist with. + The miller's son Jack + Laid her flat on her back +And united the organs they pissed with. +%% +There was a pianist named Liszt +Who played with one hand while he pissed, + But as he grew older + His technique grew bolder, +And in concert jacked off with his fist. +%% +There was a poor parson from Goring, +Who made a small hole in his flooring, + Fur-lined it all round, + Then laid on the ground, +And declared it was cheaper than whoring. +%% +There was a strong man of Drumrig +Who one day did seven times frig. + He buggered three sailors, + Four dogs and two tailors, +And ended by fucking a pig. +%% +There was a young German named Ringer +Who was screwing an opera singer. + Said he with a grin, + "Well, I've sure got it in!" +Said she, "You mean that ain't your finger?" +%% +There was a young Scot in Madrid +Who got fifty-five fucks for a quid. + When they said, "Are you faint?" + He replied, "No, I ain't, +But I don't feel as good as I did." +%% +There was a young blade from South Greece +Whose bush did so greatly increase + That before he could shack + He must hunt needle in stack. +'Twas as bad as being obese. +%% +There was a young bride, a Canuck, +Told her husband, "Let's do more than suck. + You say that I, maybe, + Can have my first baby-- +Let's give up this Frenchin' and fuck!" +%% +There was a young bride of Antigua +Whose husband said, "Dear me, how big you are!" + Said the girl, "What damn'd rot! + Why, you've only felt my twot, +My legs and my arse and my figua!" +%% +There was a young damsel named Baker +Who was poked in a pew by a Quaker. + He yelled, "My God! what + Do you call this -- a twat? +Why, the entrance is more than an acre!" +%% +There was a young dolly named Molly +Who thought that to frig was a folly. + Said she, "Your pee-pee + Means nothing to me, +But I'll do it just to be jolly." +%% +There was a young fellow from Cal., +In bed with a passionate gal. + He leapt from the bed, + To the toilet he sped; +Said the gal, "What about me, old pal?" +%% +There was a young fellow from Florida +Who liked a friend's wife, so he borrowed her. + When they got into bed + He cried, "God strike me dead! +This ain't a cunt -- it's a corridor!" +%% +There was a young fellow from Leeds +Who swallowed a package of seeds. + Great tufts of grass + Sprouted out of his ass +And his balls were all covered with weeds. +%% +There was a young fellow from Parma +Who was solemnly screwing his charmer. + Said the damsel demure, + "You'll excuse me, I'm sure, +But I must say you fuck like a farmer." +%% +There was a young fellow name Tucker +Who, instructing a novice cock-sucker, + Said, "Don't bow out your lips + Like an elephant's hips, +The boys like it best when they pucker." +%% +There was a young fellow named Babbitt +Who could screw nine times like a rabbit, + But a girl from Johore + Could do it twice more, +Which was just enough extra to crab it. +%% +There was a young fellow named Bill, +Who took an atomic pill, + His navel corroded, + His asshole exploded, +And they found his nuts in Brazil. +%% +There was a young fellow named Bowen +Whose pecker kept growin' and growin'. + It grew so tremendous, + So long and so pendulous, +'Twas no good for fuckin' -- just showin'. +%% +There was a young fellow named Charteris +Put his hand where his young lady's garter is. + Said she, "I don't mind, + And higher up you'll find +The place where my fucker and farter is." +%% +There was a young fellow named Cribbs +Whose cock was so big it had ribs. + They were inches apart, + And to suck it took art, +While to fuck it took forty-two trips. +%% +There was a young fellow named Fletcher, +Was reputed an infamous lecher. + When he'd take on a whore + She'd need a rebore, +And they'd carry him out on a stretcher. +%% +There was a young fellow named Gluck +Who found himself shit out of luck. + Though he petted and wooed, + When he tried to get screwed +He found virgins just don't give a fuck. +%% +There was a young fellow named Goody +Who claimed that he wouldn't, but would he? + If he found himself nude + With a gal in the mood +The question's not woody but could he? +%% +There was a young fellow named Grimes +Who fucked his girl seventeen times + In the course of a week -- + And this isn't to speak +Of assorted venereal crimes. +%% +There was a young fellow named Harry, +Had a joint that was long, huge and scary. + He grabbed him a virgin, + Who, without any urgin', +Immediately spread like a fairy. +%% +There was a young fellow named Kimble +Whose prick was exceedingly nimble, + But fragile and slender, + And dainty and tender, +So he kept it encased in a thimble. +%% +There was a young fellow named Meek +Who invented a lingual technique. + It drove women frantic, + And made them romantic, +And wore all the hair off his cheek. +%% +There was a young fellow named Morgan +Who possessed an unusual organ: + The end of his dong, + Which was nine inches long, +Was tipped with the head of a gorgon. +%% +There was a young fellow named Paul +Who confessed, "I have only one ball. + But the size of my prick + Is God's dirtiest trick, +For my girls always ask, 'Is that all?'" +%% +There was a young fellow named Pell +Who didn't like cunt very well. + He would finger or fuck one, + But never would suck one-- +He just couldn't get used to the smell. +%% +There was a young fellow named Price +Who dabbled in all sorts of vice. + He had virgins and boys + And mechanical toys, +And on Mondays... he meddled with mice! +%% +There was a young fellow named Prynne +Whose prick was so short and so thin, + His wife found she needed + A Fuckoscope -- she did -- +To see if he'd gotten it in. +%% +There was a young fellow named Rex +With diminutive organs of sex. + When charged with exposure + He said with composure, +"De minimis non curat lex!" +%% +There was a young fellow named Sweeney, +Whose girl was a terrible meanie, + The hatch of her snatch, + Had a catch that would latch, +She could only be screwed by Houdini. +%% +There was a young fellow of Burma +Whose betrothed had good reason to murmur. + But now that he's married he's + Been using cantharides +And the root of their love is much firmer. +%% +There was a young fellow of Harrow +Whose john was the size of a marrow. + He said to his tart, + "How's this for a start? +My balls are outside in a barrow." +%% +There was a young fellow of Kent +Whose prick was so long that it bent, + So to save himself trouble + He put it in double, +And instead of coming he went. +%% +There was a young fellow of Mayence +Who fucked his own arse in defiance + Not only of custom + And morals, dad-bust him, +But of most of the known laws of science. +%% +There was a young fellow of Perth +Whose balls were the finest on earth. + They grew to such size + That one won a prize, +And goodness knows what they were worth. +%% +There was a young fellow of Strensall +Whose prick was as sharp as a pencil. + On the night of his wedding + It went through the bedding, +And shattered the chamber utensil. +%% +There was a young fellow of Warwick +Who had reason for feeling euphoric, + For he could by election + Have triune erection: +Ionic, Corinthian, and Doric. +%% +There was a young fellow whose dong +Was prodigiously massive and long. + On each side of his whang + Two testes did hang +That attracted a curious throng. +%% +There was a young gaucho named Bruno +Who said, "Screwing is one thing I do know. + A woman is fine, + And a sheep is divine, +But a llama is Numero Uno." +%% +There was a young girl from Hong Kong +Who said, "You are utterly wrong + To say my vagina + Is the largest in China +Just because of your mean little dong." +%% +There was a young girl from Hong Kong +Whose cervical cap was a gong. + She said with a yell, + As a shot rang her bell, +"I'll give you a ding for a dong!" +%% +There was a young girl from Medina +Who could completely control her vagina. + She could twist it around + Like the cunts that are found +In Japan, Manchukuo and China. +%% +There was a young girl from New York +Who plugged up her quim with a cork + A woodpecker or two + Made the grade, it is true, +But it totally baffled the stork. +%% +There was a young girl from Peru, +Who had nothing whatever to do. + So she sat on the stairs, + And counted cunt hairs, +Four thousand, three hundred and two. +%% +There was a young girl from Samoa +Who pledged that no man would know her. + One young fellow tried, + But she wriggled aside, +And he spilled all his spermatozoa. +%% +There was a young girl from Siam +Who said to her boyfriend Priam, + "To seduce me, of course, + You'll have to use force, +And thank goodness you're stronger than I am. +%% +There was a young girl from St. Cyr +Whose reflex reactions were queer. + Her escort said, "Mable, + Get up off the table; +That money's to pay for the beer." +%% +There was a young girl from the Bronix +Who had a vagina of onyx. + She had so much `tsoris' + With her clitoris, +She traded it in for a Packard. +%% +There was a young girl in Berlin +Who eked out a living through sin. + She didn't mind fucking, + But much preferred sucking, +And she'd wipe off the pricks on her chin. +%% +There was a young girl in Berlin +Who was fucked by an elderly Finn. + Though he diddled his best, + And fucked her with zest, +She kept asking, "Hey, Pop, is it in?" +%% +There was a young girl in Dakota +Had a letter from Ickes; he wrote her: + "In addition to gas + We are rationing ass, +And you've greatly exceeded your quota." +%% +There was a young girl name McKnight +Who got drunk with her boy-friend one night. + She came to in bed, + With a split maidenhead-- +That's the last time she ever was tight. +%% +There was a young girl named Ann Heuser +Who swore that no man could surprise her. + But Pabst took a chance, + Found a Schlitz in her pants, +And now she is sadder Budweiser. +%% +There was a young girl named Heather +Whose twitcher was made out of leather. + She made a queer noise, + Which attracted the boys, +By flapping the edges together. +%% +There was a young girl named McCall +Whose cunt was exceedingly small, + But the size of her anus + Was something quite heinous -- +It could hold seven pricks and one ball. +%% +There was a young girl named O'Clare +Whose body was covered with hair. + It was really quite fun + To probe with one's gun, +For her quimmy might be anywhere. +%% +There was a young girl named O'Malley +Who wanted to dance in the ballet. + She got roars of applause + When she kicked off her drawers, +But her hair and her bush didn't tally. +%% +There was a young girl named Sapphire +Who succumbed to her lover's desire. + She said, "It's a sin, + But now that it's in, +Could you shove it a few inches higher?" +%% +There was a young girl of Aberystwyth +Who took grain to the mill to get grist with. + The miller's sun, Jack, + Laid her flat on her back, +And united the organs they pissed with. +%% +There was a young girl of Angina +Who stretched catgut across her vagina. + From the love-making frock + (With the proper sized cock) +Came Tocata and Fugue in D minor. +%% +There was a young girl of Asturias +With a penchant for practices curious. + She loved to bat rocks + With her gentlemen's cocks -- +A practice both rude and injurious. +%% +There was a young girl of Batonger +who diddled herself with a conger, + When asked how it feels + To be pleasured by eels +She said, "Just like a man, only longer. +%% +There was a young girl of Cah'lina, +Had a very capricious vagina: + To the shock of the fucker + "Twould suddenly pucker, +And whistle the chorus of "Dinah." +%% +There was a young girl of Cape Cod +Who dreamt she'd been buggered by God. + But it wasn't Jehovah + That turned the girl over, +'Twas Roger the lodger, the dirty old codger, + the bugger, the bastard, the sod! +%% +There was a young girl of Darjeeling +Who could dance with such exquisite feeling + There was never a sound + For miles around +Save of fly-buttons hitting the ceiling. +%% +There was a young girl of Des Moines +Whose cunt could be fitted with coins, + Till a guy from Hoboken + Went and dropped in a token, +And now she rides free on the ferry. +%% +There was a young girl of East Lynne +Whose mother, to save her from sin, + Had filled up her crack, + To the brim with shellac, +But the boys picked it out with a pin. +%% +There was a young girl of Gibraltar +Who was raped as she knelt at the altar. + It really seems odd + That a virtuous God +Should answer her prayers and assault her. +%% +There was a young girl of Mobile, +Who hymen was made of chilled steel, + To give her a thrill, + Took a rotary drill, +Or a number nine emery wheel. +%% +There was a young girl of Moline +Whose fucking was sweet and obscene. + She would work on a prick + With every known trick, +And finish by winking it clean. +%% +There was a young girl of Newcastle +Whose charms were declared universal. + While one man in front + Wired into her cunt, +Another was engaged at her arsehole. +%% +There was a young girl of Pawtucket +Whose box was as big as a bucket. + Her boy-friend said, "Toots, + I'll have to wear boots, +For I see I must muck it, not fuck it." +%% +There was a young girl of Penzance +Who boarded a bus in a trance. + The passengers fucked her, + Likewise the conductor, +While the driver shot off in his pants. +%% +There was a young girl of Pitlochry +Who was had by a man in a rockery. + She said, "Oh! You've come + All over my bum; +This isn't a fuck -- it's a mockery." +%% +There was a young girl of Rangoon +Who was blocked by the Man in the Moon. + "Well, it has been great fun," + She remarked when he'd done, +"But I'm sorry you came quite so soon." +%% +There was a young girl of Spitzbergen, +Whose people all thought her a virgin, + Till they found her in bed + With her twat very red, +And the head of a kid just emergin'. +%% +There was a young girl, very sweet, +Who thought sailors' meat quite a treat. + When she sat on their lap + She unbuttoned their flap, +And always had plenty to eat. +%% +There was a young girl who begat +Three brats, by name Nat, Pat, and Tat. + It was fun in the breeding, + But hell in the feeding, +When she found there was no tit for Tat. +%% +There was a young hayseed from Tiffan +Whose cock would constantly stiffen. + The knob out in front + Attracted foul cunt +Which he greatly delighted in sniffin'. +%% +There was a young idler named Blood, +Made a fortune performing at stud, + With a fifteen-inch peter, + A double-beat metre, +And a load like the Biblical Flood. +%% +There was a young lad from Nahant +Who was made like the Sensitve Plant. + When asked, "Do you fuck?" + He replied, "No such luck. +I would if I could but I can't." +%% +There was a young lad from Siam, +Whose sexlife was caught in a jam. + He loved them real small, + 'Cause they're funner to ball, +So he went out and bought him a lamb! +%% +There was a young lad name of Durcan +Who was always jerkin' his gherkin. + His father said, "Durcan! + Stop jerkin' your gherkin! +Your gherkin's for ferkin', not jerkin'. +%% +There was a young lad named McFee +Who was stung in the balls by a bee + He made oodles of money + By oozing pure honey +Every time he attempted to pee. +%% +There was a young lady at sea +Who said, "God, how it hurts me to pee." + "I see," said the mate, + "That accounts for the state +Of the captain, the purser, and me." +%% +There was a young lady from Brussels +Who was proud of her vaginal muscles. + She could easily plex them + And so interflex them +As to whistle love songs through her bustles. +%% +There was a young lady from Maine +Who claimed she had men on her brain. + But you knew from the view, + As her abdomen grew, +It was not on her brain that he'd lain. +%% +There was a young lady from Munich +Who had an affair with a eunuch. + At the height of their passion + He dealt her a ration +From a squirt gun concealed in his tunic. +%% +There was a young lady from Prentice +Who had an affair with a dentist. + To make things easier + He used anesthesia, +And diddled her, `non compos mentis'. +%% +There was a young lady from Rheims +Who amazingly pissed in four streams. + A friend poked around + And a fly-button found +Lodged tight in her hole so it seems. +%% +There was a young lady from Spain +Whose face was exceedingly plain, + But her cunt had a pucker + That made the men fuck her, +Again, and again, and again. +%% +There was a young lady from Wooster +Who complained that too many men gooster. + So she traded her scanties + For sandpaper panties, +Now they goose her much less than they used 'ter. +%% +There was a young lady in Reno, +Who lost all her dough playing Keno. + But she lay on her back, + And opened her crack, +So now she owns the Casino! +%% +There was a young lady named Astor +Who never let any get past her. + She finally got plenty + By stopping twenty, +Which certainly ought to last her. +%% +There was a young lady named Banker, +Who slept while the ship lay at anchor, + She woke in dismay, + When she heard the mate say, +"Now hoist up the topsheet and spanker." +%% +There was a young lady named Blount +Who had a rectangular cunt. + She learned for diversion + Posterior perversion, +Since no one could fit here in front. +%% +There was a young lady named Brent +With a cunt of enormous extent, + And so deep and so wide, + The acoustics inside +Were so good you could hear when you spent. +%% +There was a young lady named Cager +Who, as the result of a wager, + Consented to fart + The entire oboe part +Of Mozart's quartet in F major. +%% +There was a young lady named Clair +Who possessed a magnificent pair; + At least so I thought + Till I saw one get caught +On a thorn, and begin losing air. +%% +There was a young lady named Duff +With a lovely, luxuriant muff. + In his haste to get in her + One eager beginner +Lost both of his balls in the rough. +%% +There was a young lady named Etta +Who was constantly seen in a swetta. + Three reasons she had: + To keep warm wasn't bad, +But the other two reasons were betta. +%% +There was a young lady named Flo +Whose lover had pulled out too slow. + So they tried it all night, + Till he got it just right... +Well, practice makes pregnant, you know. +%% +There was a young lady named Flynn +Who thought fornication a sin, + But when she was tight + It seemed quite all right, +So everyone filled her with gin. +%% +There was a young lady named Gilda +Who went on a date with a builder. + He said that he would, + And he could and he should, +And he did and it damn well near killed her. +%% +There was a young lady named Gloria +Who was had by Sir Gerald Du Maurier, + And then by six men, + Sir Gerald again, +And the band at the Waldorf-Astoria. +%% +There was a young lady named Gloria, +Whose boyfriend said, "May I explore ya?" + She replied to the chap, + "I'll draw you a map, +Of where others have been to before ya." +%% +There was a young lady named Hall, +Wore a newspaper dress to a ball. + The dress caught on fire + And burned her entire +Front page, sporting section, and all. +%% +There was a young lady named Hatch +Who would always come through in a scratch. + If a guy wouldn't neck her, + She'd grab up his pecker +And shove the damn thing up her snatch. +%% +There was a young lady named Mable +Who liked to sprawl out on the table, + Then cry to her man, + "Stuff in all you can -- +Get your ballocks in, too, if you're able." +%% +There was a young lady named Mandel +Who caused quite a neighborhood scandal + By coming out bare + On the main village square +And frigging herself with a candle. +%% +There was a young lady named Maud, +A terrible society fraud: + In company, I'm told, + She was distant and cold, +But if you got her alone, Oh God! +%% +There was a young lady named May +Who strolled in a park by the way, + And she met a youg man + Who fucked her and ran -- +Now she goes to the park every day. +%% +There was a young lady named Nance +Who learned about fucking in France, + And when you'd insert it + She'd squeeze till she hurt it, +And shoved it right back in your pants. +%% +There was a young lady named Nelly +Whose tits would jiggle like jelly. + They could tickle her twat + Or be tied in a knot, +And could even swat flies on her belly. +%% +There was a young lady named Ransom +Who was rogered three times in a hansom. + When she cried out for more + A voice from the floor +Replied, "My name is Simpson, not Samson." +%% +There was a young lady named Riddle +Who had an untouchable middle. + She had many friends + Because of her ends, +Since it isn't the middle you diddle. +%% +There was a young lady named Schneider +Who often kept trysts with a spider. + She found a strange bliss, + In the hiss of her piss, +As it strained through the cobwebs inside her. +%% +There was a young lady named Smith +Whose virtue was largely a myth. + She said, "Try as I can + I can't find a man +Who it's fun to be virtuous with." +%% +There was a young lady named Twiss +Who said she thought fucking a bliss, + For it tickled her bum + And caused her to come +.siht ekil gniyl ylbatrofmoc elihW +%% +There was a young lady named Wylde +Who kept herself quite undefiled + By thinking of Jesus; + Contagious diseases; +And the bother of having a child. +%% +There was a young lady of Arden, +The tool of whose swain wouldn't harden. + Said she with a frown, + "I've been sadly let down +By the tool of a fool in a garden." +%% +There was a young lady of Bicester +Who was nicer by far than her sister: + The sister would giggle + And wiggle and jiggle, +But this one would come if you kissed her. +%% +There was a young lady of Bude +Who walked down the street in the nude. + A bobby said, "Whattum + Magnificent bottom!" +And slapped it as hard as he could. +%% +There was a young lady of Dee +Who went down to the river to pee. + A man in a punt + Put his hand on her cunt, +And God! how I wish it were me. +%% +There was a young lady of Dexter +Whose husband exceedingly vexed her, + For whenever they'd start + He'd unfailingly fart +With a blast that damn nearly unsexed her. +%% +There was a young lady of Dover +Whose passion was such that it drove her + To cry, when you came, + "Oh dear! What a shame! +Well, now we shall have to start over." +%% +There was a young lady of Ealing +And her lover before her was kneeling. + Said she, "Dearest Jim, + Take your hands off my quim; +I much prefer fucking to feeling." +%% +There was a young lady of Gaza +Who shaved her cunt bare with a razor. + The crabs, in a lump, + Made tracks to her rump - +This passing parade did amaze her. +%% +There was a young lady of Gaza +Who shaved her cunt bare with a razor. + The crabs, in a lump, + Made tracks to her rump-- +This passing parade did amaze her. +%% +There was a young lady of Gloucester, +Met a passionate fellow who tossed her. + She wasn't much hurt, + But he dirtied her skirt, +So think of the anguish it cost her. +%% +There was a young lady of Gloucester +Whose friends they thought they had lost her + Till they found on the grass + The marks of her arse, +And the knees of the man who had crossed her. +%% +There was a young lady of Kent, +Who admitted she knew what it meant + When men asked her to dine, + And plied her with wine, +She knew, oh she knew -- but she went! +%% +There was a young lady of Lee +Who scrambled up into a tree, + When she got there + Her arsehole was bare, +And so was her C U N T. +%% +There was a young lady of Lincoln +Who said that her cunt was a pink'un, + So she had a prick lent her + Which turned it magenta, +This artful old lady of Lincoln. +%% +There was a young lady of Norway +Who hung by her toes in a doorway. + She said to her beau + "Just look at me Joe +I think I've discovered one more way." +%% +There was a young lady of Rhyll +In an omnibus was taken ill, + So she called the conductor, + Who got in and fucked her, +Which did more good than a pill. +%% +There was a young lady of Spain +Who took down her pants on a train. + There was a young porter + Saw more than he orter, +And asked her to do it again. +%% +There was a young lady of Spain +Who was fucked by a monk in a drain. + They did it again + And again and again, +And again and again and again. +%% +There was a young lady of Twickenham +Who thought men had not enough prick in 'em. + On her knees every day + To God she would pray +To lengthen and strengthen and thicken 'em. +%% +There was a young lady of Wheeling +Said to her beau, "I've a feeling + My little brown jug + Has need of a plug" -- +And straightaway she started to peeling. +%% +There was a young lady of Wheeling +Who professed to lack sexual feeling. + But a cynic named Boris + Just touched her clitoris, +And she had to be scraped off the ceiling. +%% +There was a young lady of fashion +Who had oodles and oodles of passion. + To her lover she said, + As they climbed into bed, +"Here's one thing the bastards can't ration!" +%% +There was a young lady who said, +As her bridegroom got into the bed, + "I'm tired of this stunt, + That they do with one's cunt, +You can get up my bottom instead." +%% +There was a young lady whose cunt +Could accomodate a small punt. + Her mother said, "Annie, + It matches your fanny, +Which never was that of a runt." +%% +There was a young lady whose thighs, +When spread showed a slit of such size, + And so deep and so wide, + You could play cards inside, +Much to her bridegroom's surprise. +%% +There was a young laundress named Wrangle +Whose tits tilted up at an angle. + "They may tickle my chin," + She said with a grin, +"But at least they keep out of the mangle." +%% +There was a young maiden from Osset +Whose quim was nine inches across it. + Said a young man named Tong, + With tool nine inches long, +"I'll put bugger-in if I loss it." +%% +There was a young man from Bel-Aire +Who was screwing his girl on the stair, + But the banister broke + So he doubled his stroke +And finished her off in mid-air. +%% +There was a young man from Calcutta +Who was heard in his beard to mutter, + "If her Bartholin glands + Don't respond to my hands, +I'm afraid I shall have to use butter." +%% +There was a young man from Dallas +Who had an exceptional phallus. + He couldn't find room + In any girl's womb +Without rubbing it first with Vitalis. +%% +There was a young man from East Wubley +Whose cock was bifurcated doubly. + Each quadruplicate shaft + Had two balls hanging aft, +And the general effect was quite lovely. + +There was a young man from Hong Kong +Who had a trifurcated prong: + A small one for sucking, + A large one for fucking, +And a `boney' for beating a gong. +%% +There was a young man from Glengozzle +Who found a remarkable fossil. + He knew by the bend + And the wart on the end, +'Twas the peter of Paul the Apostle. +%% +There was a young man from Jodhpur +Who found he could easily cure + His dread diabetes + By eating a foetus +Served up in a sauce of manure. +%% +There was a young man from Kent +Whose tool was so long that it bent. + To save himself trouble + He put it in double +And instead of coming, he went. +%% +There was a young man from Lynn +Whose cock was the size of a pin. + Said his girl with a laugh + As she felt his staff, +"This won't be much of a sin." +%% +There was a young man from Maine +Whose prick was as strong as a crane; + It was almost as long, + So he strolled with his dong +Extended in sunshine and rain. +%% +There was a young man from Nantucket +Whose prick was so long he could suck it. + He said with a grin, + As he wiped off his chin, +If my ear were a cunt I could fuck it! +%% +There was a young man from New Haven +Who had an affair with a raven. + He said with a grin + As he wiped off his chin, +"Nevermore!" +%% +There was a young man from Peru, +Who took a long trip by canoe. + While staring at Venus, + And rubbing his penis, +He wound up with a handful of goo. +%% +There was a young man from Purdue +Who was only just learning to screw, + But he hadn't the knack, + And he got too far back -- +In the right church, but in the wrong pew. +%% +There was a young man from Rangoon +Who used to lament 'neath the moon + That he had the luck + To be born of a fuck +That was scraped off the sheets with a spoon. +%% +There was a young man from Salinas +Who had an extremely long penis: + Believe it or not, + When he lay on his cot +It reached from Marin to Martinez. +%% +There was a young man from Seattle +Whose testicles tended to rattle. + He said as he fuck-ed + Some stones in a bucket, +"If Stravinsky won't deafen you -- that'll." +%% +There was a young man from Siam +Who said, "I go in with a wham, + But I soon lose my starch + Like the mad month of March, +And the lion comes out like a lamb." +%% +There was a young man from Stamboul +Who boasted so torrid a tool + That each female crater + Explored by this satyr +Seemed almost unpleasantly cool. +%% +There was a young man in Madrid +Who got fifty-five fucks for a quid. + When they said, "Are you faint?" + He replied, "No I ain't, +But I don't feel as good as I did. +%% +There was a young man in Norway, +Tried to jerk himself off in a sleigh, + But the air was so frigid + It froze his cock rigid, +And all he could come was frappe. +%% +There was a young man in the choir +Whose penis rose higher and higher, + Till it reached such a height + It was quite out of sight -- +But of course you know I'm a liar. +%% +There was a young man, name of Saul, +Who was able to bounce either ball, + He could stretch them and snap them, + And juggle and clap them, +Which earned him the plaudits of all. +%% +There was a young man named Crockett +Whose balls got caught in a socket. + His wife was a bitch, + Yeah, she threw the switch, +And Crockett went off like a rocket. +%% +There was a young man named Hughes +Who swore off all kinds of booze. + He said, "When I'm muddled + My senses get fuddled, +And I pass up too many screws." +%% +There was a young man named Knute +Who had warts all over his root. + He put acid on these + And now when he pees, +He fingers the thing like a flute. +%% +There was a young man named McNamiter +With a tool of prodigious diameter. + But it wasn't the size + Gave the girls a surprise, +But his rythm -- iambic pentameter. +%% +There was a young man named Zerubbabel +Who had only one real, and one rubber ball. + When they asked if his pleasure + Was only half measure, +He replied, "That is highly improbable." +%% +There was a young man named Zerubbabub +Who belonged to the Block, Fuck & Bugger Club + But the pride of his life + Were the tits of his wife -- +One real, and one India-rubber bub. +%% +There was a young man of Arras +Who stretched himself out on the grass, + And with no little trouble, + He bent himself double, +And stuck his prick well up his ass. +%% +There was a young man of Australia +Who went on a wild bacchanalia. + He buggered a frog, + Two mice and a dog, +And a bishop in fullest regalia. +%% +There was a young man of Bengal +Who swore he had only one ball, + But two little bitches + Unbuttoned his britches, +And found he had no balls at all. +%% +There was a young man of Bombay +Who buggered his dad once a day. + He said, "I like, rather, + Fucking my father -- +He's clean, and there's nothing to pay." +%% +There was a young man of Calcutta, +Who tried to write "cunt" on a shutter. + When he got to c-u, + A pious Hindoo +Knocked him ass-over-head in the gutter. +%% +There was a young man of Cape Horn +Who wished he had never been born, + And he wouldn't have been + If his father had seen +That the end of the rubber was torn. +%% +There was a young man of Coblenz +Whose ballocks were simply immense: + It took forty-four draymen, + A priest and three laymen +To carry them thither and thence. +%% +There was a young man of Darjeeling +Whose cock reached up to the ceiling. + In the electric light socket, + He'd put it and rock it-- +Oh God! What a wonderful feeling! +%% +There was a young man of Devizes +Whose balls were of different sizes. + His tool when at ease, + Hung down to his knees, +Oh, what must it be when it rises! +%% +There was a young man of Dumfries +Who said to his girl, "If you please, + It would give me great bliss + If, while playing with this, +You would pay some attention to these!" +%% +There was a young man of Greenwich +Whose balls were all covered with spinach. + So long was his tool + That it wound round a spool, +And he let it out inach by inach. +%% +There was a young man of Khartoum +Who lured a poor girl to her doom. + He not only fucked her, + But buggered and sucked her-- +And left her to pay for the room. +%% +There was a young man of Kildare +Who was fucking a girl on the stair. + The bannister broke, + But he doubled his stroke +And finished her off in mid-air. +%% +There was a young man of Kutki +Who could blink himself off with one eye. + For a while though, he pined, + When his organ declined +To function, because of a stye. +%% +There was a young man of Lahore +Whose prick was one inch and no more. + It was all right for key-holes + And little girl's pee-holes, +But not worth a damn with a whore. +%% +There was a young man of Lake Placid +Whose prick was lethargic and flaccid. + When he wanted to sport + He would have to resort +To injections of sulphuric acid. +%% +There was a young man of Madras +Whose balls were constructed of brass. + When jangled together + They played "Stormy Weather", +And lightning shot out of his ass. +%% +There was a young man of Missouri +Who fucked with a terrible fury. + Till hauled into court + For his beastial sport, +And condemned by a poorly-hung jury. +%% +There was a young man of Natal +And Sue was the name of his gal. + One day, north of Aden, + He got his hard rod in, +And came clear up Suez Canal. +%% +There was a young man of Natal +Who was fucking a Hottentot gal. + Said she, "You're a sluggard!" + Said he, "You be buggered! +I like to fuck slow and I shall." +%% +There was a young man of Ostend +Who let a girl play with his end. + She took hold of Rover, + And felt it all over, +And it did what she didn't intend. +%% +There was a young man of Ostend +Whose wife caught him fucking her friend. + "It's no use, my duck, + Interrupting our fuck, +For I'm damned if I draw till I spend." +%% +There was a young man of Seattle +Who bested a bull in a battle. + With fire and gumption + He assumed the bull's function, +And deflowered a whole herd of cattle. +%% +There was a young man of St. John's +Who wanted to bugger the swans. + But the loyal hall porter + Said, "Pray take my daughter! +Those birds are reserved for the dons." +%% +There was a young man of Tibet +-- And this is the strangest one yet -- + His prick was so long, + And so pointed and strong, +He could bugger six sheep en brochette. +%% +There was a young man of Toulouse +Who had a deficient prepuce, + But the foreskin he lacked + He made up in his sac; +The result was, his balls were too loose. +%% +There was a young man of high station +Who was found by a pious relation + Making love in a ditch + To -- I won't say a bitch -- +But a woman of no reputation. +%% +There was a young man with one foot +Who had a very long root. + If he used this peg + As an extra leg +Is a question exceedingly moot. +%% +There was a young miss from Johore +Who'd lie on a mat on the floor; + In a manner uncanny + She'd wobble her fanny, +And drain your nuts dry to the core. +%% +There was a young monk in Siberia, +Whose morals were very inferior, + He jumped on a nun + Which he shouldn't have done, +And now she's a Mother Superior. +%% +There was a young of Warwick +Who had reason for feeling euphoric, + For he could by election + Have triune erection: +Ionic, Corinthian, and Doric. +%% +There was a young parson of Harwich, +Tried to grind his betrothed in a carriage. + She said, "No, you young goose, + Just try self-abuse. +And the other we'll try after marriage." +%% +There was a young peasant named Gorse +Who fell madly in love with his horse. + Said his wife, "You rapscallion, + That horse is a stallion -- +This constitutes grounds for divorce." +%% +There was a young person of Kent +Who was famous wherever he went. + All the way through a fuck, + He would quack like a duck, +And he crowed like a cock when he spent. +%% +There was a young sailor from Brighton, +Who remarked to his girl, "You're a tight one." + She replied, "'Pon my soul, + You're in the wrong hole; +There's plenty of room in the right one." +%% +There was a young sapphic named Anna +Who stuffed her friend's cunt with banana, + Which she sucked, bit by bit, + From her partner's warm slit, +In the most approved lesbian manner. +%% +There was a young soldier from Munich +Whose penis hung down past his tunic, + And their chops girls would lick + When they thought of his prick, +But alas! he was only a eunuch. +%% +There was a young squaw of Wohunt +Who possessed a collapsible cunt. + It had many odd uses, + Produced no papooses, +And fitted both giant and runt. +%% +There was a young student from Yale +Who was getting his first piece of tail. + He shoved in his pole, + But in the wrong hole, +And a voice from beneath yelled: "No sale!" +%% +There was a young trollop at Yale, +Who had verses tattooed on her tail, + And on her behind, + For the sake of the blind, +A duplicate version in Braille. +%% +There was a young whore from Kaloo +Who filled her vagina with glue. + She said with a grin, + "If they pay to get in, +They can pay to get out again too!" +%% +There was a young woman in Dee +Who stayed with each man she did see. + When it came to a test + She wished to be best, +And practice makes perfect, you see. +%% +There was a young woman named Alice +Who peed in a Catholic chalice. + She said, "I do this + From a great need to piss, +And not from sectarian malice." +%% +There was a young woman named Brent +With a cunt of enormous extent, + And so deep and so wide, + The acoustics inside +Were so good you could hear when you spent. +%% +There was a young woman named Florence +Who for fucking professed an abhorrence, + But they found her in bed + With her cunt flaming red, +And her poodle-dog spending in torrents. +%% +There was a young woman named Sutton +Who said, as she carved up the mutton, + "My father preferred + The last sheep in the herd -- +This is one of his children I'm cuttin'." +%% +There was a young woman of Cheadle, +Who once gave the clap to a beadle. + Said she, "Does it itch?" + "It does, you damned bitch, +And it burns like hell-fire when I peedle." +%% +There was an Old Man of the Mountain +Who frigged himself into a fountain + Fifteen times had he spent, + Still he wasn't content, +He simply got tired of the counting. +%% +There was an old Count of Swoboda +Who would not pay a whore what he owed her. + So with great savoir-faire + She stood on a chair, +And pissed in his whiskey-and-soda. +%% +There was an old abbess quite shocked +To find nuns where the candles were locked. + Said the abbess, "You nuns + Should behave more like guns, +And never go off till you're cocked." +%% +There was an old curate of Hestion +Who'd errect at the slightest suggestion. + But so small was his tool + He could scarce screw a spool, +And a cunt was quite out of the question. +%% +There was an old fellow named Skinner +Whose prick, his wife said, had grown thinner. + But still, by and large, + It would always discharge +Once he could just get it in her. +%% +There was an old gent from Kentuck +Who boasted a filigreed schmuck, + But he put it away + For fear that one day +He might put it in and get stuck. +%% +There was an old girl of Kilkenny +Whose usual charge was a penny. + For half of that sum + You could finger her bum-- +A source of amusement to many. +%% +There was an old lady of Kewry +Whose cunt was a `lusus naturae': + The `introitus vaginae', + Was unnaturally tiny, +And the thought of it filled her with fury. +%% +There was an old lady who lay +With her legs wide apart in the hay, + Then, calling the ploughman, + She said, "Do it now, man! +Don't wait till your hair has turned gray." +%% +There was an old man from Bengal +Who liked to do tricks in the hall. + His favorite trick + Was to stand on his dick +While he rolled around on one ball. +%% +There was an old man of Brienz +The length of whose cock was immense: + With one swerve he could plug + A boy's bottom in Zug, +And a kitchen-maid's cunt in Coblenz. +%% +There was an old man of Cajon +Who never could get a good bone. + With the aid of a gland + It grew simply grand; +Now his wife cannot leave it alone. +%% +There was an old man of Duddee +Who came home as drunk as could be. + He wound up the clock + With the end of his cock, +And buggered his wife with the key. +%% +There was an old man of Duluth +Whose cock was shot off in his youth. + He fucked with his nose + And with fingers and toes, +And he came through a hole in his tooth. +%% +There was an old man of Hong Kong +Who never did anything wrong. + He would lie on his back + With his head in a sack +And secretly finger his dong. +%% +There was an old man of Tagore +Whose tool was a yard long or more, + So he wore the damn thing + In a surgical sling +To keep it from wiping the floor. +%% +There was an old man of the port +Whose prick was remarkably short. + When he got into bed, + The old woman said, +"This isn't a prick; it's a wart!" +%% +There was an old man who said, "Tush! +My balls always hang in the brush, + And I fumble about, + Half in and half out, +With a pecker as limber as mush." +%% +There was an old pirate named Bates +Who was learning to rhumba on skates. + He fell on his cutlass + Which rendered him nutless +And practically useless on dates. +%% +There was an old satyr named Mack +Whose prick had a left handed tack. + If the ladies he loves + Don't spin when he shoves, +Their cervixes frequently crack. +%% +There was an old woman of Ghent +Who swore that her cunt had no scent. + She got fucked so often + At last she got rotten, +And didn't she stink when she spent. +%% +There was once a mechanic named Bench +Whose best tool was a sturdy gut-wrench. + With this vibrant device + He could reach, in a trice, +The innermost parts of a wench. +%% +There was once a sad Maitre d'hotel +Who said, "They can all go to hell! + What they do to my wife-- + Why it ruins my life; +And the worst is, they all do it well. +%% +There were three ladies of Huxham, +And whenever we meets 'em we fucks 'em, + And when that game grows stale + We sits on a rail, +And pulls out our pricks and they sucks 'em. +%% +There's a charming young girl in Tobruk +Who refers to her quiff as a nook. + It's deep and it's wide, + -- You can curl up inside +With a nice easy chair and a book. +%% +There's a charming young lady named Beaulieu +Who's often been screwed by yours truly, + But now--it's appallin'-- + My balls always fall in! +I fear that I've fucked her unduly. +%% +There's a dowager near Sweden Landing +Whose manners are odd and demanding. + It's one of her jests + To suck off her guests -- +She hates to keep gentlemen standing. +%% +There's a lovely young lady named Shittlecock +Who loves to play diddle and fiddle-cock, + But her cunt's got a pucker + That's best not to fuck, or +When least you expect it to, it'll lock. +%% +There's a sports-minded coed named Sue, +Who's been coxing the varsity crew. + In the shell Sue is great, + But her boyfriend's irate, +When she calls out the stroke as they screw. +%% +There's a tavern in London that's staffed, +By a barmaid who's tops at her craft: + In her striving to please, + She serves ale on her knees, +So the patrons get head with their draft. +%% +There's a vicar who's classed as nefarious, +Since his shocking perversions are various... + He will bugger some lad + With a dildo (the cad!) +While exulting, "My pleasure's vicarious!" +%% +There's a young Yiddish slut with two cunts, +Whose pleasure in life is to pruntz. + When one pireg is shot, + There's that alternate twat, +But the ausgefuckt male merely grunts. +%% +There's an over-sexed lady named Whyte +Who insists on a dozen a night. + A fellow named Cheddar + Had the brashness to wed her-- +His chance for survival is slight. +%% +There's an unbroken babe from Toronto, +Exceedingly hard to get onto, + But when you get there, + And have parted the hair, +You can fuck her as much as you want to. +%% +Though the invalid Saint of Brac +Lay all of his life on his back, + His wife got her share, + And the pilgrims now stare +At the scene, in his shrine, on a plaque. +%% +To bear offspring, Noah's snakes were unable. +Their fertility was somewhat unstable. + He constructed a bed + Out of tree trunks and said, +"Even adders can multiply on a log table." +%% +To his bride a young bridegroom said, "Pish! +Your cunt is as big as a dish!" + She replied, "Why, you fool, + With your limp little tool +It's like driving a nail with a fish!" +%% +To his bride said the keen-eyed detective, +"Can it be that my eyesight's defective? + Has the east tit the least bit + The best of the west tit, +Or is it the faulty perspective?" +%% +Two roosters in one of our pens +Found their pricks were no larger than wens. + As they looked at their foreskins + And wished they had more skins, +They discovered they'd both become hens. +%% +Under the spreading chestnut tree +The village smith he sat, + Amusing himself + By abusing himself +And catching the load in his hat. +%% +Une joile epousetta a Tours +Voulait de gig-gig tous le jours. + Mais le mari disait, "Non! + De trop n'est pas bon! +Mon derriere exige du secours!" +%% +Visas erat: huic geminarum +Dispar modus testicularum: + Minor haec nihili, + Palma triplici, +Jam fecerat altera clarum. +%% +"Well, I took your advice, Doc", said Knopp, +"And told my wife to try it on top. + She bounced for an hour, + Till she ran out of power, +And the kids, who'd grown bored, made us stop." +%% +Well buggered was a boy named Delpasse +By all of the lads in his class + He said, with a yawn, + "Now the novelty's gone +And it's only a pain in the ass." +%% +"Well, madam," the bishop declared, +While the vicar just mumbled and stared, + "'Twere better, perhaps, + In the crypt or the apse, +Because sex in the nave must be shared." +%% +When I was a baby, my penis +Was as white as the buttocks of Venus. + But now 'this as red + As her nipples instead-- +All because of the feminie genus! +%% +When he tried to inject his huge whanger +A young man aroused his girl's anger. + As they strove in the dark + She was heard to remark, +"What you need is a zeppelin hanger." +%% +When they asked a pert baggage name Alice, +Who'd been bedded and banged in the palace, + "Was he modest or vain?" + "Was he regal or plain?" +She replied, "He's a jolly good phallus!" +%% +While I, with my usual enthusiasm, +Was exploring in Ermintrude's busiasm, + She explained, "They are flat, + But think nothing of that -- +You will find that my sweet sister Susiasm." +%% +While Titian was mixing rose madder, +His model reclined on a ladder. + Her position to Titian + Suggested coition, +So he leapt up the ladder and had 'er. +%% +While out on a date in his Fiat, +The man exclaimed "Where's my key at?" + As he bent down to seek, + She let out a shriek: +"That's not where it's likely to be at." +%% +While spending the winter at Pau +Lady Pamela forgot to say "No." + So the head-porter made her + And the second-cook laid her; +The waiters were all hanging low. +%% +Winter is here with his grouch, +The time when you sneeze and you slouch. + You can't take your women + Canoein' or swimmin', +But a lot can be done on a couch. +%% +There once was a reverend at Kings +Whose mind 'twas on heavenly things. + But his heart was on fire + For a boy in the choir +Whose buns were like jelly on springs. +%% +Floating idly one day through the air, +A circus performer named Blair, + Tied a sizeable rock, + To the end of his cock, +And shattered a balcony chair. +%% +"For the tenth time, dull Daphnis," said Chloe, +"You have told me my bosom is snowy; + You have made much fine verse on + Each part of my person, +Now do something -- there's a good boy!" +%% +There were three young ladies of Birmingham, +And this is the scandal concerning 'em. + They lifted the frock + And tickled the cock +Of the Bishop engaged in confirming 'em. + +Now, the Bishop was nobody's fool, +He'd been to a good public school, + So he took down their britches + And buggered those bitches +With his ten-inch episcopal tool. + +Then up spoke a lady from Kew, +And said, as the Bishop withdrew, + "The vicar is quicker + And thicker and slicker, +And longer and stronger than you." + -- Abuses of the Clergy +%% +Said the nun as the bishop withdrew, +"This must be our final adieu, + For the vicar is slicker, + And thicker, and quicker, +And two inches longer than you." +%% +There was an old Scot named McTavish +Who attempted an anthropoid ravish. + The object of rape + Was the wrong sex of ape, +And the anthropoid ravished McTavish. +%% +I once met a lassie named Ruth +In a long distance telephone booth. + Now I know the perfection + Of an ideal connection +Even if somewhat uncouth. +%% + The big problem with pornography is defining it. You can't just +say it's pictures of people naked. For example, you have these +primitive African tribes that exist by chasing the wildebeest on foot, +and they have to go around largely naked, because, as the old tribal +saying goes: "N'wam k'honi soit qui mali," which means, "If you think +you can catch a wildebeest in this climate and wear clothes at the same +time, then I have some beach front property in the desert region of +Northern Mali that you may be interested in." + So it's not considered pornographic when National Geographic +publishes color photographs of these people hunting the wildebeest +naked, or pounding one rock onto another rock for some primitive reason +naked, or whatever. But if National Geographic were to publish an +article entitled "The Girls of the California Junior College System +Hunt the Wildebeest Naked," some people would call it pornography. But +others would not. And still others, such as the Spectacularly Rev. +Jerry Falwell, would get upset about seeing the wildebeest naked. + -- Dave Barry, "Pornography" +%% + ... So this is a very confusing situation, and what makes +it even worse is, our standards keep changing. Take Playboy magazine. +Back in the 1950s, when I started reading it strictly for the articles, +Playboy was considered just about the raciest thing around, even though +all it ever showed was women's breasts. Granted, any given one of +these breasts would have provided adequate shelter for a family of +four, but the overall effect was no more explicit than many +publications we think nothing of today, such as Sports Illustrated's +Annual Nipples Poking Through Swimsuits Issue. + -- Dave Barry, "Pornography" +%% +They [District Attorneys] learn in District Attorney School that there +are two sure-fire ways to get a lot of favorable publicity: + +(1) Go down and raid all the lockers in the local high school and + confiscate 53 marijuana cigarettes and put them in a pile and hold + a press conference where you announce that they have a street value + of $850 million. These raids never fail, because ALL high schools, + including brand-new, never-used ones, have at least 53 marijuana + cigarettes in the lockers. As far as anyone can tell, the locker + factory puts them there. +(2) Raid an "adult book store" and hold a press conference where you + announce you are charging the owner with 850 counts of being a + piece of human sleaze. This also never fails, because you always + get a conviction. A juror at a pornography trial is not about to + state for the record that he finds nothing obscene about a movie + where actors engage in sexual activities with live snakes and a + fire extinguisher. He is going to convict the bookstore owner, and + vote for the death penalty just to make sure nobody gets the wrong + impression. + -- Dave Barry, "Pornography" +%% + Here is the problem: for many years, the Supreme Court wrestled +with the issue of pornography, until finally Associate Justice John +Paul Stevens came up with the famous quotation about how he couldn't +define pornography, but he knew it when he saw it. So for a while, the +court's policy was to have all the suspected pornography trucked to +Justice Stevens' house, where he would look it over. "Nope, this isn't +it," he'd say. "Bring some more." This went on until one morning when +his housekeeper found him trapped in the recreation room under an +enormous mound of rubberized implements, and the court had to issue a +ruling stating that it didn't know what the hell pornography was except +that it was illegal and everybody should stop badgering the court about +it because the court was going to take a nap. + -- Dave Barry, "Pornography" +%% +What you mean, how old am I? About one hundred! But Viennese answer is +better: we say, "I keep passing the open windows." This is an old joke. +There was a street clown called King of the Mice: he trained rodents, he +did horoscopes, he could impersonate Napoleon, he could make dogs fart +on command. One night he jumped out his window with all his pets in a box. +Written on the box was this: "Life is serious, but art is fun!" I hear his +funeral was a party. A street artist had killed himself. Nobody had +supported him but now everybody missed him. Now who would make the dogs +make music and the mice pant? The bear knows this, too: it is hard work +and great art to make life not so serious. + -- John Irving "The Hotel New Hampshire" +%% +It was April the 41st, +Being a quadruple leap year. +I was driving in down-town Atlantis. +My Barracuda was in the shop, +So I was in a rented stingray + -- and it was over-heating. +So, I pulled into a Shell station. +They said I'd blown a seal. +I said "Fix the damned thing and leave my private + life out of it, okay pal?" + -- Wet Dreams +%% + A cowboy, his horse and his dog were captured by hostile Indians. +This wasn't really a problem for the animals as the Indians can always use +them, but the cowboy is informed that he will be burned at the stake the +following sunrise. That evening, the Indian chief tells the cowboy that +he can one last wish, within reason, of course, before meeting his fate +the following morning. The cowboy replies that all he really wants is to +see his faithful dog, Rex, one last time. When the dog is brought by the +Indians, the cowboy hugs his companion and whispers something into his ear. +At once the dog runs off over the hill. Amazingly enough, a few hours later, +he returns, accompanied by some two dozen prostitutes from a nearby town. +Needless to say, the braves are delighted and as a reward offer the cowboy +his dog to keep him company through the rest of the night. When the dog is +brought forth the cowboy again runs his hand over Rex's head and then bends +down to whisper into his ear: "This may be my last chance, Rex, so get it +right this time -- go into town and get the posse!" +%% +In the stands here I see a young couple who must be in love -- they're +kissing on every pitch. He's kissing her on the strikes, and she's +kissing him on the balls. + -- Harry Caray, a Chicago sportscaster +%% + And Jesus said unto them, "And whom do you say that I am?" + They replied, "You are the eschatological manifestation of the +ground of our being, the ontological foundation of the context of our +very selfhood revealed." + And Jesus replied, "What?" +%% +Persistence, like perspiration, is 99 percent of the fine art of love. +%% +Jehovah is an alien and still threatens this planet! +%% +This guy walks into a bank and up to a female bank teller: + +Man: "I want to open a fuckin' savings account." +Teller: "Excuse me, sir?" +M: "Listen, bitch, I want to open a fuckin' savings account." +T: "Sir, I don't have to listen to this abusive language." +M: "LOOK! I just want to open a fuckin' savings account." +T: "Sir, you leave me no choice but to speak to the manager." + +The teller walks over and explains the customer's rude behavior to the bank +manager who then accompanies her back to the teller booth. + +Mgr: "Can I help you, sir?" +M: "I want to open a fuckin' savings account." +Mgr: "Please, sir, we'll be delighted to help you, but we must request + that you not use abusive language to our tellers." +M: "Look. I just won $25 million in the state lottery and I want to + open a fuckin' savings account!" +Mgr: "I see. And has this cunt being giving you any trouble?" +%% +Get your bytes from our backend! + -- Britton Lee +%% +Me, I love the rich. *Somebody* has to love them. Sure, a lot +of rich people are assholes, but believe me, a lot of poor people +are assholes too. And an asshole with money can at least pay +for his own drinks. + -- Tom Robbins, "Jitterbug Perfume" +%% + The radio was screaming: "Power to the People -- Right On!" John +Lennon's political song, ten years too late. "That poor fool should have +stayed where he was," said my attorney. "Punks like him only get in the +way when they try to be serious." + "Speaking of serious," I said. "I think it's about time to get +into the ether and the cocaine." + "Forget ether," he said. "Let's save it for soaking down the rug +in the suite. But here's this. Your half of the sunshine blotter. Just +chew it up like baseball gum." + I took the blotter and ate it. My attorney was now fumbling with +the salt shaker containing the cocaine. Opening it. Spilling it. Then +screaming and grabbing at the air, as our fine white dust blew up and out +across the desert highway. A very expensive little twister rising up from +the Great Red Shark. "Oh, Jesus!" he moaned. "Did you see what God just +did to us?" + -- Raoul Duke, "Rolling Stone", issue 95, Nov. 11, 1971 +%% + The new patron was amazed by the cleanliness of the restaurant. A +waiter approached the table. "Good afternoon, sir. What may I serve you?" + "I'll have the steak dinner," the man answered. + As the waiter headed for the kitchen, the diner noticed that he +wore a spotless white apron and clean white gloves. Soon the waiter +returned, bearing a casserole dish on a cart which he uncovered to reveal +two tempting filet mignons. From a covered pocket in his apron he produced +a small pair of shining silver tongs and with them he transferred the meat +from the steaming casserole to the diner's plate. "We never touch anything +with our hands," he explained. + The waiter continued serving. "Confidentially," he said, "we even +have a special set of rules about visiting the lavatory. Do you see this +little piece of string attached to my apron?" + "Yes," the diner replied. "I noticed that all the aprons had one." + The waiter put a large browned potato on the plate with his tongs. +"Well," he began, "if I should have to go to the bathroom, that string +comes in very handily. I simply unzip my pants and take it out with that +piece of string. That way everything stays sanitary." + "But how do you put it back?" + "I don't know about the other guys," the waiter confided, "but I +use the tongs." +%% +There once was a girl from Madras +Who had such a beautiful ass - + It was not round and pink + (As you bastards think) +But had two ears, a tail, and ate grass. +%% +There once was a lawyer named Rex +With minuscule organs of sex. + Arraigned for exposure, + He maintained with composure: +"De minimis non curat lex." +%% +There once was a man from Bombay +He would do it all night and all day + He soon became sore + You shoulda' heard him roar +When his wife rubbed his balls with Ben-Gay! +%% +There once was a monk of Camyre +Who was seized with a carnal desire + And the primary cause + Was the abbess's drawers +Which were hung up to dry by the fire. +%% +There was a young girl from Peru, +Who noticed her lovers were few; + So she walked out her door + With a fig leaf, no more, +And now she's in bed - with the flu. +%% +There was a young lady from Spain +Who demurely undressed on a train. + A helpful young porter + Helped more than he orter, +And she promptly cried "Help me again!" +%% +There was a young lady named Rose +With erogenous zones in her toes. + She remained onanistic + Till a foot-fetishistic +Young man became one of her beaux. +%% +To be the kind of girl designed to be kissed between the thighs. +%% +'Twas orgy, and the hip and mod And as in raffish thought he sprawled, +Did groove and trip out at the pad: The Radcliffe girl, no idle flirt, +All whimsy were the slamming chicks, Crept past the hippies getting balled +And the Radcliffe undergrad. And doffed her miniskirt. + +"Beware the Radcliff girl, my son! One, two! One, two! And through +The looks that mell, the claws that and through + catch! The venerable staff went snicker-snack! +Beware the Byrn Mawr deb, and shun He left her bred, sans maidenhead, +The uppity Wellesleysnatch!" And went galumphing back. + +He took his venerable staff in hand: "And hast thou laid the Radcliffe girl? +Long time the cool young stuff he Come to my arms, my horny boy! + sought-- O spaced-out day! Calooh! Callay!" +So rested he among the spree He cackled in his joy. +And paused to smoke some pot. + 'Twas orgy, and the hip and mod + Did groove and trip out at the pad: + All whimsy were the slamming chicks, + And the Radcliffe undergrad. +%% +If God had meant for Texans to ski he would have made bullshit white. +%% +Rating women on the Budweiser scale; the number +of Clydesdales it would take to pull you off her. +%% +Did you know that some people your age have sex +thirty-seven times in a week? And die immediately after? +%% +War is menstruation envy. +%% +18th Rule of Friendship: + +A friend will let you hold the ladder while he goes up on the roof to +install your new aerial, which is the biggest son-of-a-bitch you ever saw. + -- Esquire, May 1977 +%% +Love comes in spurts. +%% +Women -- can't live with 'em, can't +leave 'em by the curb when you're done. +%% +Men -- can't live with 'em, can't leave +'em by the curb when you're done. +%% +Sex is low in calories, and *oooh* that aftertaste! +%% +National Sex Week -- don't let your meat loaf. +%% +Sex discriminates against the shy and ugly. +%% +Confucious say man who pull out too fast leave rubber. +%% +Lick-a-dee-clit! +%% +One of the first things schoolchildren in Texas learn is how to +compose a simple declarative sentence without the word "shit" in it. +%% + For three years, the young attorney had been taking his brief +vacations at this country inn. The last time he'd finally managed an +affair with the innkeeper's daughter. Looking forward to an exciting +few days, he dragged his suitcase up the stairs of the inn, then stopped +short. There sat his lover with an infant on her lap! + "Helen, why didn't you write when you learned you were pregnant?" +he cried. "I would have rushed up here, we could have gotten married, +and the baby would have my name!" + "Well," she said, "when my folks found out about my condition, +we sat up all night talkin' and talkin' and decided it would be better +to have a bastard in the family than a lawyer." +%% diff --git a/games/fortune/obscene.4.3 b/games/fortune/obscene.4.3 new file mode 100644 index 0000000..6c96f2b --- /dev/null +++ b/games/fortune/obscene.4.3 @@ -0,0 +1,1499 @@ +A bather whose clothing was strewed +By breezes that left her quite nude, + Saw a man come along + And, unless I'm quite wrong, +You expected this line to be lewd. +%% +A beat schizophrenic said, "Me? +I am not I, I'm a tree." + But another, more sane, + Shouted, "I'm a Great Dane!" +And covered his pants leg with pee. +%% +A conservative is a man who believes that nothing should be done for +the first time. + -- Alfred E. Wiggam +%% +A conservative is a man with two perfectly good legs who has never +learned to walk. + -- Franklin D. Roosevelt +%% +A friend with weed is a friend indeed. +%% +A hard man is good to find. +%% +A hard man is good to find. +%% +A man needs a mistress, just to break the monogamy. +%% +A mathematician named Hall +Has a hexahedronical ball, + And the cube of its weight + Times his pecker's, plus eight +Is his phone number -- give him a call.. +%% +"A Mormon is a man that has the bad taste and the religion to do what a +good many other people are restrained from doing by conscientious +scruples and the police." + -- Mr. Dooley +%% +A Nixon [is preferable to] a Dean Rusk -- who will be passionately +wrong with a high sense of consistency. + -- J. K. Galbraith +%% +A non-vegetarian anti-abortionist is a contradiction in terms. + --Phyllis Schlafly +%% +A nymph hits you and steals your virginity. +%% +A person who has both feet planted firmly in the air can be safely +called a liberal. +%% +A pretty young lady named Vogel +Once sat herself down on a molehill. + A curious mole + Nosed into her hole -- +Ms. Vogel's ok, but the mole's ill. +%% +A pretty young maiden from France +Decided she'd "just take a chance." + She let herself go + For an hour or so +And now all her sisters are aunts. +%% +A Puritan is someone who is deathly afraid that someone, somewhere, +is having fun. +%% +A remarkable race are the Persians; +They have such peculiar diversions. + They make love the whole day + In the usual way +And save up the nights for perversions. +%% +A team playing baseball in Dallas +Called the umpire blind out of malice. + While this worthy had fits + The team made eight hits +And a girl in the bleachers named Alice. +%% +A wanton young lady from Wimley +Reproached for not acting quite primly + Said, "Heavens above! + I know sex isn't love, +But it's such an entrancing facsimile." +%% +A wanton young lady from Wimley +Reproached for not acting quite primly + Said, "Heavens above! + I know sex isn't love, +But it's such an entrancing facsimile." +%% +A widow who fancied a man some +Was diddled three times in a hansome. + When she clamored for more + Her young man became sore +And exclaimed "My name's Simpson not Samson." +%% +"A woman is like a dresser ... some man always goin' through her +drawers." + --- Blind Lemon Pledge +%% +A worried young man from Stamboul +Founds lots of red spots on his tool. + Said the doctor, a cynic, + "Get out of my clinic; +Just wipe off the lipstick, you fool!" +%% +Achilles' Biological Findings: + (1) If a child looks like his father, that's heredity. If he + looks like a neighbor, that's environment. + (2) A lot of time has been wasted arguing over what came first + -- the chicken or the egg. It was undoubtedly the rooster. +%% +AI hackers do it with robots. +%% +Aide to Raygun: Sir, the poor are outside protesting your budget cuts. +Raygun himself: Tell them they'll have to help themselves. +Aide to Raygun: Sir, the Pentagon wants another $30 billion. +Raygun himself: Tell them to help themselves. +%% +All a hacker needs is a tight PUSHJ, a loose pair of UUOs, and a warm +place to shift. +%% +All things dull and ugly, All creatures short and squat, + All things rude and nasty, The Lord God made the lot; +Each little snake that poisons, Each little wasp that stings, + He made their brutish venom, He made their horrid wings. +All things sick and cancerous, All evil great and small, + All things foul and dangerous, The Lord God made them all. +Each nasty little hornet, Each beastly little squid. + Who made the spikey urchin? Who made the sharks? He did. +All things scabbed and ulcerous, All pox both great and small. + Putrid, foul and gangrenous, The Lord God made them all. + -- Monty Python's Flying Circus +%% +An architect fellow named Yoric +Could, when feeling euphoric, + Display for selection + Three kinds of erection -- +Corinthian, ionic, and doric. +%% +An Army travels on her stomach. +%% +An attorney was defending his client against a charge of first-degree +murder. "Your Honor, my client is accused of stuff his lover's +mutilated body into a suitcase and heading for the Mexican border. +Just north of Tijuana a cop spotted her hand sticking out of the +suitcase. Now, I would like to stress that my client is *___not* a +murderer. A sloppy packer, maybe..." +%% +"And Bezel saideth unto Sham: `Sham,' he saideth, `Thou shalt goest +unto the town of Begorrah, and there thou shalt fetcheth unto thine +bosom 35 talents, and also shalt thou fetcheth a like number of cubits, +provideth that they are nice and fresh.'" + -- Dave Barry, "Getting Religion" +%% +... And then there's the guy who bought 20,000 bras, cut them in half, +and sold 40,000 yamalchas with chin straps ... +%% +Anxiety, n.: + The first time you can't do it a second time. + +Panic, n.: + The second time you can't do it the first time. +%% +Back in the good ole days in Texas, when stagecoaches and the like was +popular, there were three people in a stagecoach one day: a true red- +blooded born-and-raised Texas gentleman, a tenderfoot city-slicker from +back East, and a beautiful and well-endowed Texas lady. The city- +slicker kept eyeing the lady, and finally he leaned forward and said, +"Lady, I'll give you $10 for a blow job." The Texas gentleman looked +appalled, pulled out his pistol, and killed the city-slicker on the +spot. The lady gasped and said, "Thank you, suh, for defendin' mah +honor!" Whereupon the Texan holstered his gun and said, "Your honor, +hell!! No tenderfoot is gonna raise the price of women in Texas!!" +%% +Baltimore, n.: + Where the women wear turtleneck sweaters to hide their flea +collars. +%% +Bankers do it with interest (penalty for early withdrawal). +%% +Behold the unborn fetus and + Weep salt tears crocodilian; +All life is sacred (save, of course, + An enemy civilian). +%% +Being stoned on marijuana isn't very different from being stoned on +gin. + -- Ralph Nader +%% +Beneath this stone a virgin lies, +For her life held no terrors. +A virgin born, a virgin died: +No hits, no runs, no errors. +%% +Blessed are the meek for they shall inhibit the earth. +%% +Build a better mousetrap, the saying goes -- and with the brassiere, +Yankee Ingenuity did exactly that. But their true stroke of genius was +the new bait. The old fashioned mousetrap was loaded with cheese; +nobody cares much about cheese, except mice. But when American +Know-How reloaded the brassiere with tits, every heterosexual male in +the country was hopelessly trapped. + -- Alan Sherman, "The Rape of the A*P*E*" +%% + ... But the reward of a successful collaboration is a +thing that cannot be produced by either of the parties working alone. +It is akin to the benefits of sex with a partner, as opposed to +masturbation. The latter is fun, but you show me anyone who has gotten +a baby from playing with him or herself, and I'll show you an ugly +baby, with just a whole bunch of knuckles. + -- Harlan Ellison +%% +Captain Hook died of jock itch. +%% +Chaste makes waste. +%% +Chipmunks roasting on an open fire +Jack Frost ripping up your nose +Yuletide carolers being thrown in the fire +And folks dressed up like buffaloes +Everybody knows a turkey slaughtered in the snow +Helps to make the season right +Tiny tots with their eyes all gouged out +Will find it hard to see tonight +They know that Santa's on his way +He's loaded lots of guns and bullets on his sleigh +And every mother's child is sure to spy +To see if reindeer really scream when they die +And so I'm offering this simple phrase +To kids from one to ninety two +Although it's been said many times, many ways +Merry Christmas, Merry Christmas, Merry Christmas, Fuck you!! +%% +Christian, n.: + One who believes that the New Testament is a divinely inspired +book admirably suited to the spiritual needs of his neighbor. One who +follows the teachings of Christ in so far as they are not inconsistent +with a life of sin. +%% +Clarke's Third Law: + Any sufficiently advanced technology is indistinguishable from + magic. + +G's Third Law: + In spite of all evidence to the contrary, the entire universe + is composed of only two basic substances: magic and bullshit. + +H's Dictum: + There is no magic ... +%% +CLONE OF MY OWN (to Home on the Range) + +Oh, give me a clone +Of my own flesh and bone + With the Y chromosome changed to X. +And when she is grown, +My very own clone, + We'll be of the opposite sex. + +Chorus: + Clone, clone of my own, + With the Y chromosome changed to X. + And when we're alone, + Since her mind is my own, + She'll be thinking of nothing but sex. + -- Randall Garrett +%% +Cocaine is nature's way of telling you you have too much money. +%% +Coito ergo sum +%% +College is like a woman -- you work so hard to get in, and nine months +later you wish you'd never come. +%% +Communists do it without class. +%% +Conservative, n.: + One who admires radicals centuries after they're dead. + -- Leo C. Rosten +%% +Cunnilingus is next to godliness. +%% +Dammit, how many times do I have to tell you? ____FIRST you rape, ____THEN you +pillage!! +%% +Dear Lord, observe this bended knee +This visage meek and humble, +And hear this confidential plea +Voiced in reverent mumble: + Give me Shylock, give me Fagin + But O God spare me Ronald Reagan! + -- Ansel Adams +%% +Did you hear about the new German microwave oven? + + ... Seats 500. +%% +Did you know that there are 71.9 acres of nipple tissue in the U.S.? +%% +Do something big -- fuck a giant +%% + "Do you cheat on your wife?" asked the psychiatrist. + "Who else?" answered the patient. +%% +Doctors take two aspirin and do it in the morning. +%% +"Don't let your mouth write no check that your tail can't cash." + -- Bo Diddley +%% +Draft beer, not people +%% +Eleven reasons a cucumber is better than a man: + 1) Cucumbers can stay up all night, and you won't have to + sleep in the wet spot. + 2) Cucumbers don't play the guitar and try to find themselves. + 3) You won't find out later that your cucumber + ... is married + ... is on penicillin + ... likes you -- but loves your brother! + 4) A cucumber won't care what time of the month it is. + 5) A cucumber never wants to get it on when your nails are wet. + 6) Cucumbers don't say "Let's keep trying until we have a boy". + 7) Cucumbers won't tell you size doesn't count. + 8) A cucumber won't leave you for a cheerleader or an ex-nun. + 9) Cucumbers don't fall asleep on your chest or drool on the pillow. + 10) Cucumbers don't care if you make more money than they do. + 11) With a cucumber, the toilet seat is always the way you left it. +%% +Evangelists do it with Him watching. +%% +Fie for shame, you lascivious, lewd, lecherous, libidinous, lustful, +licentious, dirty bum!! +%% +Floppy now, hard later. +%% +Fornication, n.: + Term used by people who don't have anybody to screw with. +%% +George Washington not only chopped down his father's cherry tree, but +he also admitted doing it. Now, do you know why his father didn't +punish him? Because George still had the axe in his hand. +%% +Getting an education at the University of California is like +having $50.00 shoved up your ass, a nickel at a time. +%% + "God built a compelling sex drive into every creature, no +matter what style of fucking it practiced. He made sex irresistibly +pleasurable, wildly joyous, free from fears. He made it innocent +merriment. + "Needless to say, fucking was an immediate smash hit. Everyone +agreed, from aardvarks to zebras. All the jolly animals -- lions and +lambs, rhinoceroses and gazelles, skylarks and lobsters, even insects, +though most of them fuck only once in a lifetime -- fucked along +innocently and merrily for hundreds of millions of years. Maybe they +were dumb animals, but they knew a good thing when they had one." + -- Alan Sherman, "The Rape of the A*P*E*" +%% +God gives us relatives; thank goodness we can chose our friends. +%% +God is an atheist. +%% +God isn't dead -- he's been busted +%% +God isn't dead, He's just trying to avoid the draft. +%% +God must love assholes -- She made so many of them. +%% +God wanted to have a holiday, so He asked St. Peter for suggestions on +where to go. + "Why not go to Jupiter?" asked St. Peter. + "No, too much gravity, too much stomping around," said God. + "Well, how about Mercury?" + "No, it's too hot there." + "Okay," said St. Peter, "What about Earth?" + "No," said God, "They're such horrible gossips. When I was +there 2000 years ago, I had an affair with a Jewish woman, and they're +still talking about it." +%% +Good day for water sports. Take a bath with a friend. +%% +Grain grows best in shit + -- Ursula K. LeGuin +%% +Great Lover, n.: + A man who can breathe through his ears. +%% +Hackers do it with all sorts of characters. +%% +Hackers do it with bugs. +%% +Hackers do it with fewer instructions. +%% +Hackers know all the right MOVs. +%% +Haggis, n.: + Haggis is a kind of stuff black pudding eaten by the Scots and +considered by them to be not only a delicacy but fit for human +consumption. The minced heart, liver and lungs of a sheep, calf or +other animal's inner organs are mixed with oatmeal, sealed and boiled +in maw in the sheep's intestinal stomach-bag and ... Excuse me a +minute ... +%% +Hardly a pure science, history is closer to animal husbandry than it is +to mathematics, in that it involves selective breeding. The principal +difference between the husbandryman and the historian is that the +former breeds sheep or cows or such, and the latter breeds (assumed) +facts. The husbandryman uses his skills to enrich the future; the +historian uses his to enrich the past. Both are usually up to their +ankles in bullshit. + -- Tom Robbins +%% +Having discovered the possibility that other creatures could be used +for sexual intercourse, early man was likely to have made many such +attempts ... though it is doubtful that he was so sexually carnivorous +as the Christian and Jewish Adam, who, rabbinical interpreters of the +Old Testament tell us, had intercourse with every creature before God +finally hit upon the idea of woman and created Eve. + -- R. E. Masters +%% +He hated to mend, so young Ned +Called in a cute neighbor instead. + Her husband said, "Vi, + When you stitched up his torn fly, +Did you have to bite off the thread?" +%% +He wasn't much of an actor, he wasn't much of a Governor -- Hell, they +_H_A_D to make him President of the United States. It's the only job he's +qualified for! + -- Michael Cain +%% +He who findeth sensuous pleasures in the bodies of lush, hot, pink +damsels is not righteous, but he can have a lot more fun. +%% +He who sneezes without a handkerchief takes matters into his own +hands. +%% +Her kisses left something to be desired -- the rest of her. +%% + Here is the problem: for many years, the Supreme Court wrestled +with the issue of pornography, until finally Associate Justice John +Paul Stevens came up with the famous quotation about how he couldn't +define pornography, but he knew it when he saw it. So for a while, the +court's policy was to have all the suspected pornography trucked to +Justice Stevens' house, where he would look it over. "Nope, this isn't +it," he'd say. "Bring some more." This went on until one morning when +his housekeeper found him trapped in the recreation room under an +enormous mound of rubberized implements, and the court had to issue a +ruling stating that it didn't know what the hell pornography was except +that it was illegal and everybody should stop badgering the court about +it because the court was going to take a nap. + -- Dave Barry, "Pornography" +%% +History has the relation to truth that theology has to religion -- +i.e., none to speak of. + -- Lazarus Long +%% +"How do you like the new America? We've cut the fat out of the +government, and more recently the heart and brain (the backbone was +gone some time ago). All we seem to have left now is muscle. We'll be +lucky to escape with our skins!" +%% +Howard Cosell's biggest protrusion is his asshole + -- John Valby +%% +Hugh Hefner is a virgin. +%% +I believe that Ronald Reagan will someday make this country what it +once was ... an arctic wilderness + -- Steve Martin +%% +I came; I saw; I fucked up +%% +I have a funny daddy +Who goes in and out with me +And everything that baby does +Daddy's sure to see, +And everything that baby says, +My daddy's sure to tell. +You _m_u_s_t have read my daddy's verse. +I hope he fries in Hell. + -- Ogden Nash +%% +I love this fucking University, and this University loves fucking me. +%% +I once met a lassie named Ruth +In a long distance telephone booth. + Now I know the perfection + Of an ideal connection +Even if somewhat uncouth. +%% +"I own my own body, but I share" +%% +I realize that today you have a number of top female athletes such as +Martina Navratilova who can run like deer and bench-press Chevrolet +trucks. But to be brutally frank, women as a group have a long way to +go before they reach the level of intensity and dedication to sports +that enables men to be such incredible jerks about it. + -- Dave Barry, "Sports is a Drag" +%% +I regret to say that we of the F.B.I. are powerless to act in cases of +oral-genital intimacy, unless it has in some way obstructed interstate +commerce. + -- J. Edgar Hoover +%% +I think every good Christian ought to kick Falwell right in the ass. + -- Barry Goldwater +%% +I think pop music has done more for oral intercourse than anything else +that has ever happened, and vice versa. + -- Frank Zappa +%% +I wouldn't mind dying -- it's that business of having to stay dead that +scares the shit out of me. + -- R. Geis +%% +I'd like to meet the man who invented sex and see what he's working on +now. +%% +I'm going to Iowa for an award. Then I'm appearing at Carnegie Hall, +it's sold out. Then I'm sailing to France to be honored by the French +government -- I'd give it all up for one erection. + -- Groucho Marx +%% +"I've had one child. My husband wants to have another. I'd like to +watch him have another." +%% +If guns are outlawed, how will we shoot the liberals? +%% +If Helen Keller is alone in a forest and falls, does she make a sound? +%% +If men could get pregnant, abortion would be a sacrament. +%% +If men could get pregnant, abortion would be a sacrament. +%% +If Reagan is the answer, it must have been a VERY silly question. +%% +If someone were to ask me for a short cut to sensuality, I would +suggest he go shopping for a used 427 Shelby-Cobra. But it is only +fair to warn you that of the 300 guys who switched to them in 1966, +only two went back to women. + -- Mort Sahl +%% +If you can believe ten impossible things before breakfast, then you +should join + + THE CHURCH OF COUNTERFACTUAL BELIEF + +The Church of Counterfactual Belief has been set up to cater to all who +do not allow demonstrable truth to get in the way of their beliefs. In +addition to creation science and the flatness of the earth, the +following beliefs have been certified by Pope Duane as Church dogma: + + -- That there is a hole in the Earth at the North Pole from which + UFOs come. + -- That pi equals precisely 3.000. + -- That sex can be enjoyed only by blacks and homosexuals. + -- That Billy Joe Wilson (Hoopla, Miss.) has successfully squared + the circle. + -- That Harry Truman is still president, and doing a fine job. + -- That pi equals precisely 22/7. + +Several other important counterfactual beliefs are presently being +studied, including Reaganomics, A.I., and that the moon landings were +done in a Hollywood special effects studio. These will be the subject +of a forthcoming Papal Bull ... +%% +If you meet somebody who tells you that he loves you more than anybody +in the whole wide world, don't trust him. It means he experiments. +%% +If you think sex is a pain in the ass, try different position. +%% +"If you're a real good kid, I'll give you a piggy-back ride on a +buzz-saw." + -- W. C. Fields +%% +Ignorance is the Mother of Devotion. + -- Robert Burton +%% + In the beginning was the DEMO Project. And the Project was +without form. And darkness was upon the staff members thereof. So +they spake unto their Division Head, saying, "It is a crock of shit, +and it stinks." + + And the Division Head spake unto his Department Head, saying, +"It is a crock of excrement and none may abide the odor thereof." Now, +the Department Head spake unto his Directorate Head, saying, "It is a +container of excrement, and is very strong, such that none may abide +before it." And it came to pass that the Directorate Head spake unto +the Assistant Technical Director, saying, "It is a vessel of fertilizer +and none may abide by its strength." + + And the assistant Technical Director spake thus unto the +Technical Director, saying, "It containeth that which aids growth and +it is very strong." And, Lo, the Technical Director spake then unto +the Captain, saying, "The powerful new Project will help promote the +growth of the Laboratories." + + And the Captain looked down upon the Project, and He saw that +it was Good! +%% +In the Garden of Eden sat Adam, +Massaging the bust of his madam, + He chuckled with mirth, + For he knew that on earth, +There were only two boobs and he had 'em. +%% +Incest, n.: + Sibling revelry. +%% +It is a sad commentary on today's society that this fortune has to be +classified as "offensive" simply because it contains the word "fuck". +%% +Jesus died for your sins. Make it worth his time. +%% +Jesus was killed by a Moral Majority. +%% +John Birch Society -- that pathetic manifestation of organized +apoplexy. + -- Edward P. Morgan +%% +Kasha, n.: + Kasha is always defined as "buckwheat groats". There's only one +problem with this definition: what the fuck are "buckwheat groats"? _I +know what they are -- they're kasha. But that doesn't help ___you much. + -- Arthur Naiman, "Every Goy's Guide to Yiddish" +%% +Kill a commie for Christ! +%% +Laissez Faire Economics is the theory that if each acts like a vulture, +all will end as doves. +%% +Large cats can be dangerous, but a little pussy never hurt anyone. +%% +Life is like a penis: when it's soft you can't beat it, and when it's +hard you get fucked. +%% +Lisp hackers have to be bound (to-do 'it) ... +%% +Living in Hollywood is like living in a bowl of granola. What ain't +fruits and nuts is flakes. +%% +Mathematicians do it in theory. +%% +Mathematicians take it to the limit. +%% +Missionary Position: + The missionary on top. +%% +Most legislators are so dumb that they couldn't pour piss out of a boot +if the instructions were printed on the heel. +%% +Motto of the Electrical Engineer: + Working computer hardware is a lot like an erect penis: it + stays up as long as you don't fuck with it. +%% +My brother-in-law has found a way to make ends meet. He goes around +with his head stuck up his ass. +%% + My Favorite Drugs [Sung to My Favorite Things] +Reefers and roach clips and papers and rollers +Cocaine and procaine for twenty year molars +Reds and peyote to work out your bugs +These are a few of my favorite drugs. + +Uppers and downers and methedrine freakout +Take some amphetamines, watch your brains leak out +Acid and mescaline pull out your plugs +These are a few of my favorite drugs. + +Backs that are perfect for carrying monkeys +Users of heroin, often called junkies +Methadone helps then to stop being thugs +Takes them off one of my favorite drugs. + + On a bad trip + When the cops come + When I lose my head + I simply take more of my favorite drugs + And then I'm not sad -- I'm dead! +%% +Nancy Reagan wants divorce old Ron ... seems he's making it hard for +everyone but her. +%% + NEW ADDITION TO THE LIBRARY: +"Sally", the department's new inflatable doll, is available on a +short-term removal basis only -- please sign her out and return her +promptly to avoid extended waits. (We are still awaiting shipment of +our "Big John" doll.) +%% +Nothing is better than Sex. +Masturbation is better than nothing. +Therefore, Masturbation is better than Sex. +%% +O'Riordan's Theorem: + Brains x Beauty = Constant. + +Purmal's Corollary: + As the limit of (Brains x Beauty) goes to infinity, + availability goes to zero. +%% +Occident, n.: + The part of the world lying west (or east) of the Orient. It +is largely inhabited by Christians, powerful sub-tribe of the +Hypocrites, whose principal industries are murder and cheating, which +they are pleased to call "war" and "commerce." These, also, are the +principal industries of the Orient. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Ocean, n.: + A body of water occupying about two-thirds of a world made for +man -- who has no gills. +%% +Once a young gay from Khartoum +Took a lesbian up to his room. + They argued all night + Over who had the right +To do what, and with which, and to whom. +%% +Once upon a time, there was a non-conforming sparrow who decided not to +fly south for the winter. However, soon after the weather turned cold, +the sparrow changed his mind and reluctantly started to fly south. +After a short time, ice began to form his on his wings and he fell to +earth in a barnyard almost frozen. A cow passed by and crapped on this +little bird and the sparrow thought it was the end, but the manure +warmed him and defrosted his wings. Warm and happy the little sparrow +began to sing. Just then, a large Tom cat came by and hearing the +chirping investigated the sounds. As Old Tom cleared away the manure, +he found the chirping bird and promptly ate him. + +There are three morals to this story: + +1) Everyone who shits on you is not necessarily your enemy. +2) Everyone who gets you out of shit is not necessarily your friend. +3) If you are warm and happy in a pile of shit, keep your mouth shut. +%% +One day President Reagan, Chairman Andropov, the Pope, and a boy scout +were flying together in an airplane. Right out in the middle of +nowhere the plane developed engine trouble and started to go down. +Unfortunately, only three parachutes could be found for the four +passengers! Andropov grabbed one of the parachutes and declared +"Comrades, as leader of the socialist workers revolution, my life must +be spared," and he jumped out of the plane. Then Reagan exclaimed "As +leader of the greatest nation on earth, I must keep the world safe for +democracy," and with that he too jumped to safety. Now if you are +following all this (or counting on your fingers) you must see that +there is only one parachute left for the two remaining passengers. The +Pope looked kindly upon the boy scout and said "I have had a long and +productive life, my son. You take the parachute and leave me in God's +hands." "That's very kind of you," the observant scout replied, "but +there is no need. Reagan just jumped out with my knapsack." +%% +Opinions are like assholes -- everyone's got one, but nobody wants to +look at the other guy's. + -- Hal Hickman +%% +Our team usually puts the other woman at second base, where the maximum +possible number of males can get there on short notice to help out in +case of emergency. As far as I can tell, our second basewoman is a +pretty good baseball player, better than I am, anyway, but there's no +way to know for sure because if the ball gets anywhere near her, a male +comes barging over from, say, right field, to deal with it. She's been +on the team for three seasons now, but the males still don't trust +her. They know, deep in their souls, that if she had to choose between +catching a fly ball and saving an infant's life, she probably would +elect to save the infant's life, without ever considering whether there +were men on base. + -- Dave Barry, "Sports is a Drag" +%% + Overheard in a bar: +Man: "Hey, Baby, I'd sure like to get in your pants!" +Woman: "No, thanks, I've already got one ass-hole in there now." +%% +Physicists do it with charm +%% +Politicians do it to everyone. +%% +Posterity will ne'er survey +A nobler grave than this; +Here lie the bones of Castlereagh; +Stop, traveler, and piss. + -- Lord Byron, on Lord Castlereagh +%% +Procrastinators do it tomorrow. +%% +Prostitution is the only business where you can go into the hole and +still come out ahead. +%% +Q: How do you play religious roulette? +A: You stand around in a circle and blaspheme and see who gets struck + by lightning first. +%% +Q: How do you tell if an Elephant has been making love in your + backyard? +A: If all your trashcan liners are missing ... +%% +Q: How do you tell if you're making love to a nurse, a schoolteacher, + or an airline stewardess? +A: A nurse says: "This won't hurt a bit." A schoolteacher says: "We're + going to have to do this over and over again until we get it + right." An airline stewardess says: "Just hold this over your mouth + and nose, and breath normally." +%% +Q: How many right-to-lifers does it take to change a light bulb? +A: Two. One to screw it in and one to say that light started when the + screwing began. +%% +Q: How many supply-siders does it take to change a light bulb? +A: None. The darkness will cause the light bulb to change by itself. +%% +Q: If Tarzan was Jewish, and Jane was a princess, what would Cheetah + be? +A: A fur coat. +%% +Q: What do you do with an elephant with three balls? +A: Walk him and pitch to the rhino. +%% +Q: What is "SMOORPLAY"? +A: It's what SMURFS do before they SMUCK, of course! +%% +Q: What's Jewish foreplay? +A: Two hours of begging. +%% +Q: Where can you buy black lace crotchless panties for sheep? +A: Fredricks of Ithaca, New York. +%% +Q: Where does virgin wool come from? +A: Ugly sheep. +%% +Randel, n.: + A nonsensical poem recited by Irish schoolboys as an apology +for farting at a friend. + -- Mrs. Byrne's Dictionary of Unusual, Obscure & + Preposterous Words +%% +Reagan can't _a_c_t either +%% +Remember when you were a kid and the boys didn't like the girls? Only +sissies liked girls? What I'm trying to tell you is that nothing's +changed. You think boys grow out of not liking girls, but we don't +grow out of it. We just grow horny. That's the problem. We mix up +liking pussy for liking girls. Believe me, one couldn't have less to +do with the other. + -- Jules Feiffer +%% +Republicans raise dahlias, Dalmatians and eyebrows. +Democrats raise Airedales, kids and taxes. + +Democrats eat the fish they catch. +Republicans hang them on the wall. + +Republican boys date Democratic girls. They plan to marry Republican +girls, but feel they're entitled to a little fun first. + +Democrats make up plans and then do something else. +Republicans follow the plans their grandfathers made. + +Republicans consume three-fourths of the rutabaga produced in the USA. +The remainder is thrown out. + +Republicans sleep in twin beds -- some even in separate rooms. +That is why there are more Democrats. + -- The Official Rules, as compiled by Paul Dickson +%% +Ronald Reagan -- America's favorite placebo +%% +Said a horny young girl from Milpitas, +"My favorite sport is coitus." + But a fullback from State + Made her period late, +And now she has athlete's fetus +%% +Said a swinging young chick named Lyth +Whose virtue was largely a myth, + "Try as hard as I can, + I can't find a man +That it's fun to be virtuous with." +%% +Said Einstein, "I have an equation +Which to some may seem rabelaisian: + Let _V be virginity + Approaching infinity; +Let _P be a constant persuasion; + +"Let _V over _P be inverted +With the square root of _M_u inserted + _N times into _V ... + The result, Q.E.D., +Is a relative!" Einstein asserted. +%% +Save Soviet Jewry -- Win Valuable Prizes!!!! +%% +Sex is like a bridge game -- +If you have a good hand no partner is needed. +%% +Sex is the poor man's opera. + -- G. B. Shaw +%% +She asked me if I loved her still. "Yes," I replied. "I've never had +you any other way." +%% +She hates testicles, thus limiting the men she can admire to Democratic +candidates for president. + -- John Greenway, "The American Tradition", on feminist + Elizabeth Gould Davis +%% + ... So this is a very confusing situation, and what makes +it even worse is, our standards keep changing. Take Playboy magazine. +Back in the 1950s, when I started reading it strictly for the articles, +Playboy was considered just about the raciest thing around, even though +all it ever showed was women's breasts. Granted, any given one of +these breasts would have provided adequate shelter for a family of +four, but the overall effect was no more explicit than many +publications we think nothing of today, such as Sports Illustrated's +Annual Nipples Poking Through Swimsuits Issue. + -- Dave Barry, "Pornography" +%% +Statisticians do it with 95% confidence. +%% +Statisticians probably do it. +%% +Subpoena,n .: + From the root "sub", below, and the Latin "poena" for male +organ or penis. Therefore, "below the penis" or "by the balls." +%% +Support the right of unborn males to bear arms! + -- A public service announcement from Phyllis Schlafly, + the Catholic Church, and the National Rifle + Association +%% +Sure eating yogurt will improve your sex life. People know that if +you'll eat that stuff, you'll eat anything. +%% +Sure, Reagan has promised to take senility tests. But what if he +forgets? +%% + The big problem with pornography is defining it You can't just +say it's pictures of people naked. For example, you have these +primitive African tribes that exist by chasing the wildebeest on foot, +and they have to go around largely naked, because, as the old tribal +saying goes: "N'wam k'honi soit qui mali," which means, "If you think +you can catch a wildebeest in this climate and wear clothes at the same +time, then I have some beach front property in the desert region of +Northern Mali that you may be interested in." + So it's not considered pornographic when National Geographic +publishes color photographs of these people hunting the wildebeest +naked, or pounding one rock onto another rock for some primitive reason +naked, or whatever. But if National Geographic were to publish an +article entitled "The Girls of the California Junior College System +Hunt the Wildebeest Naked," some people would call it pornography. But +others would not. And still others, such as the Spectacularly Rev. +Jerry Falwell, would get upset about seeing the wildebeest naked. + -- Dave Barry, "Pornography" +%% +The computer is the ultimate polluter: its shit is indistinguishable +from the food it produces. +%% + The defense attorney was hammering away at the plaintiff: "You +claim," he jeered, "that my client came at you with a broken bottle in +his hand. But is it not true, that you had something in YOUR hand?" + + "Yes," he admitted, "his wife. Very charming, of course, but +not much good in a fight." +%% +The difference between this school and a cactus plant is that the +cactus has the pricks on the outside. +%% +... the Father, the Son and the Holy Ghost would never throw the +Devil out of Heaven as long as they still need him as a fourth for +bridge. + -- Letter in NEW LIBERTARIAN NOTES #19 +%% + The Gray-haired Woman's Complaint + +My back aches, my pussy is sore; +I simply can't fuck any more; + I'm covered with sweat, + And you haven't come yet, +And my God, it's a quarter to four! +%% +The other night I was having sex, but the girl hung up on me. +%% +The problem with being best man at a wedding is that you never get a +chance to prove it. +%% +The real problem with fucking a sheep is that you have to walk around +in front every time you want to kiss her. +%% +The sergeant walked into the shower and caught me giving myself a +dishonorable discharge. Without missing a beat, I said, "It's my dick +and I can wash it as fast as I want!" +%% + The Split-Atom Blues + +Gimme Twinkies, gimme wine, + Gimme jeans by Calvin Kline ... +But if you split those atoms fine, + Mama keep 'em off those genes of mine! + +Gimme zits, take my dough, + Gimme arsenic in my jelly roll ... +Call the devil and sell my soul, + But Mama keep dem atoms whole! + -- Milo Bloom, "Bloom County" +%% +The United States Army; +194 years of proud service, +unhampered by progress. +%% +"The voters have spoken, the bastards ..." +%% +"The whole world is about three drinks behind." + -- Humphrey Bogart +%% +The word "spine" is, of course, an anagram of "penis". This is true in +almost fifty percent of the languages of the Galaxy, and many people +have attempted to explain why. Usually these explanations get bogged +down in silly puns about "standing erect". + -- Donald Adams, "The Hitchhiker's Guide to the Galaxy" +%% +The world is an 8000 mile in diameter spherical pile of shit. +%% + Them Toad Suckers + +How 'bout them toad suckers, ain't they clods? +Sittin' there suckin' them green toady frogs! + +Suckin' them hop toads, suckin' them chunkers, +Suckin' them a leapy type, suckin' them flunkers. + +Look at them toad suckers, ain't they snappy? +Suckin' them bog frogs sure make's 'em happy! + +Them hugger mugger toad suckers, way down south, +Stickin' them sucky toads in they mouth! + +How to be a toad sucker, no way to duck it, +Get yourself a toad, rear back, and suck it! + -- Mason Williams +%% +There are two sides to every divorce: yours and the shithead's. +%% +There once was a couple named Kelley, +Who lived their life belly to belly. + Because in their haste + They used Library Paste, +Instead of Petroleum Jelly. +%% +There once was a freshman named Lin, +Whose tool was as thin as a pin, + A virgin named Joan + From a bible belt home, +Said "This won't be much of a sin." +%% +There once was a hacker named Ken +Who inherited truckloads of Yen + So he built him some chicks + Of silicon chips +And hasn't been heard from since then. +%% +There once was a lady from Exeter, +So pretty that men craned their necks at her. + One was even so brave + As to take out and wave +The distinguishing mark of his sex at her. +%% +There once was a plumber from Leigh, +Who was plumbing his maid by the sea, + Said she, "Please stop plumbing, + I think someone's coming!" +Said he, "Yes I know love, it's me." +%% +There once was a queen of Bulgaria +Whose bush had grown hairier and hairier, + Till a prince from Peru + Who came up for a screw +Had to hunt for her cunt with a terrier. +%% +There once was a Scot named McAmeter +With a tool of prodigious diameter. + It was not the size + That cause such surprise; +'Twas his rhythm -- iambic pentameter. +%% +There once was a young man named Gene +Who invented a screwing machine + Concave and convex + It served either sex +And it played with itself in between. +%% +There was a bluestocking in Florence +Wrote anti-sex pamphlets in torrents, + Till a Spanish grandee, + Got her off with his knee, +And she burned all her works with abhorrence. +%% +There was a gay countess of Bray, +And you may think it odd when I say, + That in spite of high station, + Rank and education, +She always spelled cunt with a "k". +%% +There was a young fellow named Bliss +Whose sex life was strangely amiss, + For even with Venus + His recalcitrant penis +Would never do better than t + h + i + s + . +%% +There was a young girl from Hong Kong +Whose cervical cap was a gong. + She said with a yell, + As a shot rang her bell, +"I'll give you a ding for a dong!" +%% +There was a young girl named Sapphire +Who succumbed to her lover's desire. + She said, "It's a sin, + But now that it's in, +Could you shove it a few inches higher?" +%% +There was a young girl of Angina +Who stretched catgut across her vagina. + From the love-making frock + (With the proper sized cock) +Came Tocata and Fugue in D minor. +%% +There was a young girl of Darjeeling +Who could dance with such exquisite feeling + There was never a sound + For miles around +Save of fly-buttons hitting the ceiling. +%% +There was a young lad name of Durcan +Who was always jerkin' his gherkin. + His father said, "Durcan! + Stop jerkin' your gherkin! +Your gherkin's for ferkin', not jerkin'. +%% +There was a young lady from Maine +Who claimed she had men on her brain. + But you knew from the view, + As her abdomen grew, +It was not on her brain that he'd lain. +%% +There was a young lady named Clair +Who possessed a magnificent pair; + At least so I thought + Till I saw one get caught +On a thorn, and begin losing air. +%% +There was a young lady named Hall, +Wore a newspaper dress to a ball. + The dress caught on fire + And burned her entire +Front page, sporting section, and all. +%% +There was a young lady named Twiss +Who said she thought fucking a bliss, + For it tickled her bum + And caused her to come +.siht ekil gniyl ylbatrofmoc elihW +%% +There was a young lady of Norway +Who hung by her toes in a doorway. + She said to her beau + "Just look at me Joe +I think I've discovered one more way." +%% +There was a young man from Bel-Aire +Who was screwing his girl on the stair, + But the banister broke + So he doubled his stroke +And finished her off in mid-air. +%% +There was a young man named Crockett +Whose balls got caught in a socket. + His wife was a bitch, + And she threw the switch, +As Crockett went off like a rocket. +%% +There was a young man of Cape Horn +Who wished he had never been born, + And he wouldn't have been + If his father had seen +That the end of the rubber was torn. +%% +There was a young man of St. John's +Who wanted to bugger the swans. + But the loyal hall porter + Said, "Pray take my daughter! +Those birds are reserved for the dons." +%% +There was a young whore from kaloo +Who filled her vagina with glue. + She said with a grin, + "If they pay to get in, +They can pay to get out again too!" +%% +There was an old man of the port +Whose prick was remarkably short. + When he got into bed, + The old woman said, +"This isn't a prick; it's a wart!" +%% +There was an old pirate named Bates +Who was learning to rhumba on skates. + He fell on his cutlass + Which rendered him nutless +And practically useless on dates. +%% +There were the Scots +Who kept the Sabbath +And everything else they could lay their hands on. +Then there were the Welsh +Who prayed on their knees and their neighbors. +Thirdly there were the Irish +Who never knew what they wanted +But were willing to fight for it anyway. +Lastly there were the English +Who considered themselves a self-made nation +Thus relieving the Almighty of a dreadful responsibility. +%% +There's more than one way to skin a cat: + Way number 15 -- Krazy Glue and a toothbrush. +%% +There's more than one way to skin a cat: + Way number 27 -- Use an electric sander. +%% +There's more than one way to skin a cat: + Way number 32 -- Wrap it around a lonely frat man's pecker. +%% +There's nothing better than good sex. But bad sex? A peanut butter +and jelly sandwich is better than bad sex. + -- Billy Joel +%% +There's nothing wrong with America that a good erection wouldn't cure. + -- David Mairowitz +%% +They [District Attorneys] learn in District Attorney School that there +are two sure-fire ways to get a lot of favorable publicity: + +(1) Go down and raid all the lockers in the local high school and + confiscate 53 marijuana cigarettes and put them in a pile and hold + a press conference where you announce that they have a street value + of $850 million. These raids never fail, because ALL high schools, + including brand-new, never-used ones, have at least 53 marijuana + cigarettes in the lockers. As far as anyone can tell, the locker + factory puts them there. +(2) Raid an "adult book store" and hold a press conference where you + announce you are charging the owner with 850 counts of being a + piece of human sleaze. This also never fails, because you always + get a conviction. A juror at a pornography trial is not about to + state for the record that he finds nothing obscene about a movie + where actors engage in sexual activities with live snakes and a + fire extinguisher. He is going to convict the bookstore owner, and + vote for the death penalty just to make sure nobody gets the wrong + impression. + -- Dave Barry, "Pornography" +%% +This is a test of the emergency cunnilingus system. If this had been an +actual emergency, you would have known it! +%% +This is National Smokers-Are-Shits Week. +%% +This limerick is **SO**FILTHY** that it would offend you. So I'll put +"di-dah" for the filthy words: + + Di-dah, di-dah, di-dah di-dah, + Di-dah di-dah di-dah, di-dah; + di-dah di-dah di-dah? + Di-dah di-dah di-dah. + Di-dah di-dah, di-dah di-fuck. +%% +This test has been designed to evaluate reactions of management +personal to various situations. + +You are making a sales presentation to a group of corporate executives +in the plushest office you've ever seen. The enchillada casserole and +egg salad sandwich you had for lunch react, creating severe pressure. +Your sphincter loses control and you break wind, causing the glass +bookcase doors to shatter and a secretary to pass out. + +YOU SHOULD: + +(A) Offer to come back next week when the smell has gone away. +(B) Point to the Chief Executive and accuse him of the offense. +(C) Challenge anyone in the room to do better. +%% +This test has been designed to evaluate reactions of management +personal to various situations. + +You are making a sales presentation to a group of corporate executives +in the plushest office you've ever seen. The enchillada casserole and +egg salad sandwich you had for lunch react, creating severe pressure. +Your sphincter loses control and you break wind, causing the glass +bookcase doors to shatter and a secretary to pass out. + +YOU SHOULD: + +(A) Offer to come back next week when the smell has gone away. +(B) Point to the Chief Executive and accuse him of the offense. +(C) Challenge anyone in the room to do better. +%% +Thou shalt not omit adultery. +%% +To a Real Woman, every ejaculation is premature. +%% +"Tom Hayden is the kind of politician who gives opportunism a bad +name." + -- Gore Vidal +%% +'Twas orgy, and the hip and mod And as in raffish thought he sprawled, +Did groove and trip out at the pad: The Radcliffe girl, no idle flirt, +All whimsy were the slamming chicks, Crept past the hippies getting balled +And the Radcliffe undergrad. And doffed her miniskirt. + +"Beware the Radcliff girl, my son! One, two! One, two! And through +The looks that melt, the claws that and through + catch! The venerable staff went snicker-snack! +Beware the Byrn Mawr deb, and shun He left her bred, sans maidenhead, +The uppity Wellesleysnatch!" And went galumphing back. + +He took his venerable staff in hand: "And hast thou laid the Radcliffe girl? +Long time the cool young stuff he Come to my arms, my horny boy! + sought -- O spaced-out day! Calooh! Callay!" +So rested he among the spree He cackled in his joy. +And paused to smoke some pot. + 'Twas orgy, and the hip and mod + Did groove and trip out at the pad: + All whimsy were the slamming chicks, + And the Radcliffe undergrad. +%% + Two little kids, aged six and eight, decide it's time to learn +how to swear. So, the eight-year-old says to the six-year-old, "Okay, +you say `ass' and I'll say `hell'". + All excited about their plan, they troop downstairs, where +their mother asks them what they'd like for breakfast. + "Aw, hell," says the eight-year-old, "gimme some Cheerios." His +mother backhands him off the stool, sending him bawling out of the +room, and turns to the younger brother. "What'll you have?" + "I dunno," quavers the six-year-old, "but you can bet your ass +it ain't gonna be Cheerios." +%% +"Under capitalism, man exploits man. Under Communism, it's just the +opposite." + -- John Kenneth Galbraith +%% +Vidi, vici, veni. +(I saw, I conquered, I came.) +%% +Virgin, n.: + An ugly third grader. +%% +War is menstruation envy. +%% +We call our dog Egypt, because in every room he leaves a pyramid. +%% +"We don't have to protect the environment -- the Second Coming is at +hand." + -- James Watt +%% +Well, see, Joyce, there we were, trapped in the elevator. Now, I had +my tennis racquet and the goldfish; she was holding the Crisco. Surely +you can imagine how one thing naturally led to another! +%% + Well, there was this tiger, who woke up one morning, and just +felt great (yes, just like Tony the Tiger: GREAAAAAAT). Anyway, he +just felt so good, he went out and cornered a small monkey and roared +at him: "WHO IS THE MIGHTIEST OF ALL THE JUNGLE ANIMALS?" And this +poor quaking little monkey replied: "You are of course, no one is +mightier than you." A little while later this tiger confronts a deer, +and just bellows out: "WHO IS THE GREATEST AND STRONGEST OF ALL THE +JUNGLE ANIMALS?" The deer is shaking so hard it can barely speak, but +manages to stammer: "Oh great tiger, you are by far the mightiest +animal in the jungle." The tiger, being on a roll, swaggered, up to an +elephant that was quietly munching on some weeds, and roared at the top +of his voice: "WHO IS THE MIGHTIEST OF ALL THE ANIMALS IN THE JUNGLE?" +Well, this elephant grabs the tiger with his trunk, picks him up, slams +him down; picks him up again, and shakes him until the tiger is just a +blur of orange and black; and finally throws him violently into a +nearby tree. The tiger staggers to his feet and looks at the elephant +and says: "Man, just because you don't know the answer, you don't have +to get so pissed." +%% +What can you use used tampons for? Tea bags for vampires. +%% + "What the hell are you getting so upset about? I thought you +didn't believe in God." + "I don't," she sobbed, bursting violently into tears, "but the +God I don't believe in is a good God, a just God, a merciful God. He's +not the mean and stupid God you make Him out to be." + -- Joseph Heller, "Catch-22" +%% +When God created man, She was only testing. +%% +"When I grow up, I want to be an honest lawyer so things like that +can't happen." + -- Richard Nixon as a boy (on the Teapot Dome scandal) +%% +When it all boils down to the essence of truth one must live by a dog's +rule of life: if you can't eat it or fuck it, piss on it! +%% + When the surgeon came to see her on the morning after her +operation, the young woman asked her somewhat hesitantly how long it +would be before she could resume her sex life. "I really haven't +thought about it," gulped the stunned surgeon. "You're the first +patient who's asked me that after a tonsillectomy!" +%% +While I, with my usual enthusiasm, +Was exploring in Ermintrude's busiasm, + She explained, "They are flat, + But think nothing of that -- +You will find that my sweet sister Susiasm." +%% +"White House carpenters have reworked the master bedroom, remodeling it +so that Ronnie can sleep with his head in the hall. That way, by the +time he wakes up, somebody will have already shined his hair." +%% +Why is it that there are so many more horses' asses than there are +horses? + -- G. Gordon Liddy +%% +Why marry a virgin? If she wasn't good enough for the rest of them +then she isn't good enough for you. +%% +Women Unite! Make *___him* sleep in the wet spot tonight! +%% +Women who want to be equal to men lack imagination + -- Graffito in a women's restroom +%% +Womens Libbers are OK. I just wouldn't want my sister to marry one. +%% +"Yes, that was Richard Nixon. He used to be President. When he left +the White House, the Secret Service would count the silverware." + -- Woody Allen, "Sleeper" +%% +You are at a business lunch when you are suddenly overcome with an +uncontrollable desire to pick your nose. Since this is definitely a +no-no, you: + +(a) Pretend to wave to someone across the room and with one fluid + motion, bury your forefinger in your nostril right up to the 4th + joint. + +(b) Get everyone drunk and organize a nose picking contest with a + prize to the one who makes his nose bleed first. + +(c) Drop your napkin on the floor and when you bend over to pick it + up, blow your nose on your sock. +%% +You are making a presentation to a group of corporate executives in the +plushest board room you have ever seen. The hot enchillada casserole +and egg salad sandwich you had for lunch react, creating a severe +pressure. Your sphincter loses its control and you break wind in a +most convincing manner causing 3 water tumblers to shatter and a +secretary to pass out. What you should do next is: + +(a) Offer to come back next week when the smell has gone away. + +(b) Point out the Marketing Manager and accuse him of the act. + +(c) Challenge anyone in the room to do better. +%% +You better believe that marijuana can cause castration. Just suppose +your girlfriend gets the munchies! +%% +You can pick your friends, and you can pick your nose, but you can't +pick your friend's nose. +%% +You come out of a woman and you spend the rest of your life trying to +get back inside. + -- Heathcote Williams +%% +You have just returned from a trip to Green Bay, Wisconsin in January +and tell your boss that nobody but whores and football players live +there. He mentions that his wife is from Green Bay. You: + +(a) Pretend you are suffering from amnesia and don't remember your + name. + +(b) Ask what position she played. + +(c) Ask if she is still working the streets. +%% +You have prepared a proposal for your supervisor. The success of this +proposal will mean increasing your salary 20%. In the middle of your +proposal your supervisor leans over to look at your report and spits +into your coffee. You: + +(a) Tell him you take your coffee black. + +(b) Ask him if he has any communicable diseases. + +(c) Show him who's in command; promptly take a leak in his "In" + basket. diff --git a/games/fortune/obscene.sp.ok b/games/fortune/obscene.sp.ok new file mode 100644 index 0000000..c3e34dc --- /dev/null +++ b/games/fortune/obscene.sp.ok @@ -0,0 +1,238 @@ +A.I +AI +Aire +amnesia +Andropov +Angina +Ansel +apoplexy +asshole +assholes +Aw +basewoman +Begorrah +bible +Bierce +Bo +Bogart +boobs +bras +brutish +buffaloes +bullshit +busiasm +Byrn +Callay +Calooh +carnivorous +Castlereagh +castration +catgut +cervical +Cheerios +chromosome +Clair +Coito +coitus +commie +containeth +Cosell's +COUNTERFACTUAL +Counterfactual +counterfactual +countess +Crisco +cubits +Cunnilingus +cunnilingus +cunt +dah +Dalmatians +Dammit +Darjeeling +deb +defendin +dem +DEMO +Di +di +Diddley +dong +doric +dunno +Durcan +ekil +elihW +enchillada +ergo +Ermintrude's +excrement +eyeing +F.B.I +Fagin +Faire +Falwell +farting +Feiffer +ferkin +fetcheth +Fie +findeth +flunkers +Fornication +frat +freakout +Fredricks +Fuck +fuck +fucked +fucking +Galbraith +galumphing +gangrenous +Geis +genital +Gimme +gimme +girlfriend +gniyl +goin +gonna +Goy's +Graffito +grandee +GREAAAAAAT +Greenway +Groucho +Haggis +hansome +Heathcote +Hefner +hexahedronical +Hitchhiker's +husbandryman +i.e +iht +intestinal +jeered +jerkin +Jewry +k'honi +kaloo +Kasha +kasha +Krazy +lassie +leapy +lecherous +LeGuin +lesbian +Libbers +Liddy +limerick +Lyth +mah +maidenhead +Mairowitz +mali +Mama +Martina +Masturbation +masturbation +McAmeter +Methadone +methedrine +Milo +Milpitas +miniskirt +mod +mousetrap +MOVs +munchies +N'wam +Nader +Naiman +Navratilova +ne'er +Nope +O'Riordan's +ok +ole +penis +pentameter +peyote +poena +pox +provideth +Purmal's +PUSHJ +Putrid +Q.E.D +qui +rabbinical +rabelaisian +racquet +Radcliff +Randel +Raygun +Reaganomics +rhumba +Rosten +Sahl +saideth +Schlafly +shalt +shit +shithead's +Shits +shits +sissies +Sittin +sleaze +SMOORPLAY +SMUCK +SMURFS +soit +spake +sphincter +spikey +Stamboul +Stickin +strewed +Subpoena,n +Suckin +suckin +sucky +suh +Susiasm +Tijuana +Tocata +tonsillectomy +trashcan +truckloads +Twas +Twinkies +Twiss +U.S +UFOs +ulcerous +UUOs +Valby +veni +vici +Vidal +Vidi +Wellesleysnatch +What'll +whimsy +Wiggam +Wildebeest +wildebeest +Wimley +yamalchas +ylbatrofmoc +yogurt +Yoric +Yuletide +Zappa +zits diff --git a/games/fortune/rnd.c b/games/fortune/rnd.c new file mode 100644 index 0000000..946b460 --- /dev/null +++ b/games/fortune/rnd.c @@ -0,0 +1,365 @@ +/* + * code for when the good (berkeley) random number generator is around + */ + +rnd(num) +{ + return (random() % num); +} + +srnd(num) +{ + srandom(num); +} + +#ifdef NO_RANDOM + +#ifndef lint +static char sccsid[] = "@(#)random.c 4.2 (Berkeley) 83/01/02"; +#endif + +#include + +/* + * random.c: + * An improved random number generation package. In addition to the standard + * rand()/srand() like interface, this package also has a special state info + * interface. The initstate() routine is called with a seed, an array of + * bytes, and a count of how many bytes are being passed in; this array is then + * initialized to contain information for random number generation with that + * much state information. Good sizes for the amount of state information are + * 32, 64, 128, and 256 bytes. The state can be switched by calling the + * setstate() routine with the same array as was initiallized with initstate(). + * By default, the package runs with 128 bytes of state information and + * generates far better random numbers than a linear congruential generator. + * If the amount of state information is less than 32 bytes, a simple linear + * congruential R.N.G. is used. + * Internally, the state information is treated as an array of longs; the + * zeroeth element of the array is the type of R.N.G. being used (small + * integer); the remainder of the array is the state information for the + * R.N.G. Thus, 32 bytes of state information will give 7 longs worth of + * state information, which will allow a degree seven polynomial. (Note: the + * zeroeth word of state information also has some other information stored + * in it -- see setstate() for details). + * The random number generation technique is a linear feedback shift register + * approach, employing trinomials (since there are fewer terms to sum up that + * way). In this approach, the least significant bit of all the numbers in + * the state table will act as a linear feedback shift register, and will have + * period 2^deg - 1 (where deg is the degree of the polynomial being used, + * assuming that the polynomial is irreducible and primitive). The higher + * order bits will have longer periods, since their values are also influenced + * by pseudo-random carries out of the lower bits. The total period of the + * generator is approximately deg*(2**deg - 1); thus doubling the amount of + * state information has a vast influence on the period of the generator. + * Note: the deg*(2**deg - 1) is an approximation only good for large deg, + * when the period of the shift register is the dominant factor. With deg + * equal to seven, the period is actually much longer than the 7*(2**7 - 1) + * predicted by this formula. + */ + + + +/* + * For each of the currently supported random number generators, we have a + * break value on the amount of state information (you need at least this + * many bytes of state info to support this random number generator), a degree + * for the polynomial (actually a trinomial) that the R.N.G. is based on, and + * the separation between the two lower order coefficients of the trinomial. + */ + +#define TYPE_0 0 /* linear congruential */ +#define BREAK_0 8 +#define DEG_0 0 +#define SEP_0 0 + +#define TYPE_1 1 /* x**7 + x**3 + 1 */ +#define BREAK_1 32 +#define DEG_1 7 +#define SEP_1 3 + +#define TYPE_2 2 /* x**15 + x + 1 */ +#define BREAK_2 64 +#define DEG_2 15 +#define SEP_2 1 + +#define TYPE_3 3 /* x**31 + x**3 + 1 */ +#define BREAK_3 128 +#define DEG_3 31 +#define SEP_3 3 + +#define TYPE_4 4 /* x**63 + x + 1 */ +#define BREAK_4 256 +#define DEG_4 63 +#define SEP_4 1 + + +/* + * Array versions of the above information to make code run faster -- relies + * on fact that TYPE_i == i. + */ + +#define MAX_TYPES 5 /* max number of types above */ + +static int degrees[ MAX_TYPES ] = { DEG_0, DEG_1, DEG_2, + DEG_3, DEG_4 }; + +static int seps[ MAX_TYPES ] = { SEP_0, SEP_1, SEP_2, + SEP_3, SEP_4 }; + + + +/* + * Initially, everything is set up as if from : + * initstate( 1, &randtbl, 128 ); + * Note that this initialization takes advantage of the fact that srandom() + * advances the front and rear pointers 10*rand_deg times, and hence the + * rear pointer which starts at 0 will also end up at zero; thus the zeroeth + * element of the state information, which contains info about the current + * position of the rear pointer is just + * MAX_TYPES*(rptr - state) + TYPE_3 == TYPE_3. + */ + +static long randtbl[ DEG_3 + 1 ] = { TYPE_3, + 0x9a319039, 0x32d9c024, 0x9b663182, 0x5da1f342, + 0xde3b81e0, 0xdf0a6fb5, 0xf103bc02, 0x48f340fb, + 0x7449e56b, 0xbeb1dbb0, 0xab5c5918, 0x946554fd, + 0x8c2e680f, 0xeb3d799f, 0xb11ee0b7, 0x2d436b86, + 0xda672e2a, 0x1588ca88, 0xe369735d, 0x904f35f7, + 0xd7158fd6, 0x6fa6f051, 0x616e6b96, 0xac94efdc, + 0x36413f93, 0xc622c298, 0xf5a42ab8, 0x8a88d77b, + 0xf5ad9d0e, 0x8999220b, 0x27fb47b9 }; + +/* + * fptr and rptr are two pointers into the state info, a front and a rear + * pointer. These two pointers are always rand_sep places aparts, as they cycle + * cyclically through the state information. (Yes, this does mean we could get + * away with just one pointer, but the code for random() is more efficient this + * way). The pointers are left positioned as they would be from the call + * initstate( 1, randtbl, 128 ) + * (The position of the rear pointer, rptr, is really 0 (as explained above + * in the initialization of randtbl) because the state table pointer is set + * to point to randtbl[1] (as explained below). + */ + +static long *fptr = &randtbl[ SEP_3 + 1 ]; +static long *rptr = &randtbl[ 1 ]; + + + +/* + * The following things are the pointer to the state information table, + * the type of the current generator, the degree of the current polynomial + * being used, and the separation between the two pointers. + * Note that for efficiency of random(), we remember the first location of + * the state information, not the zeroeth. Hence it is valid to access + * state[-1], which is used to store the type of the R.N.G. + * Also, we remember the last location, since this is more efficient than + * indexing every time to find the address of the last element to see if + * the front and rear pointers have wrapped. + */ + +static long *state = &randtbl[ 1 ]; + +static int rand_type = TYPE_3; +static int rand_deg = DEG_3; +static int rand_sep = SEP_3; + +static long *end_ptr = &randtbl[ DEG_3 + 1 ]; + + + +/* + * srandom: + * Initialize the random number generator based on the given seed. If the + * type is the trivial no-state-information type, just remember the seed. + * Otherwise, initializes state[] based on the given "seed" via a linear + * congruential generator. Then, the pointers are set to known locations + * that are exactly rand_sep places apart. Lastly, it cycles the state + * information a given number of times to get rid of any initial dependencies + * introduced by the L.C.R.N.G. + * Note that the initialization of randtbl[] for default usage relies on + * values produced by this routine. + */ + +srandom( x ) + + unsigned x; +{ + register int i, j; + + if( rand_type == TYPE_0 ) { + state[ 0 ] = x; + } + else { + j = 1; + state[ 0 ] = x; + for( i = 1; i < rand_deg; i++ ) { + state[i] = 1103515245*state[i - 1] + 12345; + } + fptr = &state[ rand_sep ]; + rptr = &state[ 0 ]; + for( i = 0; i < 10*rand_deg; i++ ) random(); + } +} + + + +/* + * initstate: + * Initialize the state information in the given array of n bytes for + * future random number generation. Based on the number of bytes we + * are given, and the break values for the different R.N.G.'s, we choose + * the best (largest) one we can and set things up for it. srandom() is + * then called to initialize the state information. + * Note that on return from srandom(), we set state[-1] to be the type + * multiplexed with the current value of the rear pointer; this is so + * successive calls to initstate() won't lose this information and will + * be able to restart with setstate(). + * Note: the first thing we do is save the current state, if any, just like + * setstate() so that it doesn't matter when initstate is called. + * Returns a pointer to the old state. + */ + +char * +initstate( seed, arg_state, n ) + + unsigned seed; /* seed for R. N. G. */ + char *arg_state; /* pointer to state array */ + int n; /* # bytes of state info */ +{ + register char *ostate = (char *)( &state[ -1 ] ); + + if( rand_type == TYPE_0 ) state[ -1 ] = rand_type; + else state[ -1 ] = MAX_TYPES*(rptr - state) + rand_type; + if( n < BREAK_1 ) { + if( n < BREAK_0 ) { + fprintf( stderr, "initstate: not enough state (%d bytes) with which to do jack; ignored.\n" ); + return; + } + rand_type = TYPE_0; + rand_deg = DEG_0; + rand_sep = SEP_0; + } + else { + if( n < BREAK_2 ) { + rand_type = TYPE_1; + rand_deg = DEG_1; + rand_sep = SEP_1; + } + else { + if( n < BREAK_3 ) { + rand_type = TYPE_2; + rand_deg = DEG_2; + rand_sep = SEP_2; + } + else { + if( n < BREAK_4 ) { + rand_type = TYPE_3; + rand_deg = DEG_3; + rand_sep = SEP_3; + } + else { + rand_type = TYPE_4; + rand_deg = DEG_4; + rand_sep = SEP_4; + } + } + } + } + state = &( ( (long *)arg_state )[1] ); /* first location */ + end_ptr = &state[ rand_deg ]; /* must set end_ptr before srandom */ + srandom( seed ); + if( rand_type == TYPE_0 ) state[ -1 ] = rand_type; + else state[ -1 ] = MAX_TYPES*(rptr - state) + rand_type; + return( ostate ); +} + + + +/* + * setstate: + * Restore the state from the given state array. + * Note: it is important that we also remember the locations of the pointers + * in the current state information, and restore the locations of the pointers + * from the old state information. This is done by multiplexing the pointer + * location into the zeroeth word of the state information. + * Note that due to the order in which things are done, it is OK to call + * setstate() with the same state as the current state. + * Returns a pointer to the old state information. + */ + +char * +setstate( arg_state ) + + char *arg_state; +{ + register long *new_state = (long *)arg_state; + register int type = new_state[0]%MAX_TYPES; + register int rear = new_state[0]/MAX_TYPES; + char *ostate = (char *)( &state[ -1 ] ); + + if( rand_type == TYPE_0 ) state[ -1 ] = rand_type; + else state[ -1 ] = MAX_TYPES*(rptr - state) + rand_type; + switch( type ) { + case TYPE_0: + case TYPE_1: + case TYPE_2: + case TYPE_3: + case TYPE_4: + rand_type = type; + rand_deg = degrees[ type ]; + rand_sep = seps[ type ]; + break; + + default: + fprintf( stderr, "setstate: state info has been munged; not changed.\n" ); + } + state = &new_state[ 1 ]; + if( rand_type != TYPE_0 ) { + rptr = &state[ rear ]; + fptr = &state[ (rear + rand_sep)%rand_deg ]; + } + end_ptr = &state[ rand_deg ]; /* set end_ptr too */ + return( ostate ); +} + + + +/* + * random: + * If we are using the trivial TYPE_0 R.N.G., just do the old linear + * congruential bit. Otherwise, we do our fancy trinomial stuff, which is the + * same in all ther other cases due to all the global variables that have been + * set up. The basic operation is to add the number at the rear pointer into + * the one at the front pointer. Then both pointers are advanced to the next + * location cyclically in the table. The value returned is the sum generated, + * reduced to 31 bits by throwing away the "least random" low bit. + * Note: the code takes advantage of the fact that both the front and + * rear pointers can't wrap on the same call by not testing the rear + * pointer if the front one has wrapped. + * Returns a 31-bit random number. + */ + +long +random() +{ + long i; + + if( rand_type == TYPE_0 ) { + i = state[0] = ( state[0]*1103515245 + 12345 )&0x7fffffff; + } + else { + *fptr += *rptr; + i = (*fptr >> 1)&0x7fffffff; /* chucking least random bit */ + if( ++fptr >= end_ptr ) { + fptr = state; + ++rptr; + } + else { + if( ++rptr >= end_ptr ) rptr = state; + } + } + return( i ); +} + +#endif NO_RANDOM diff --git a/games/fortune/scene b/games/fortune/scene new file mode 100644 index 0000000..b124453 --- /dev/null +++ b/games/fortune/scene @@ -0,0 +1,35245 @@ + *** + ******* + ********* + ****** Confucious say: "Is stuffy inside fortune cookie." + ******* + *** +%% + Has your family tried 'em? + + POWDERMILK BISCUITS + + Heavens, they're tasty and expeditious! + + They're made from whole wheat, to give shy persons + the strength to get up and do what needs to be done. + + POWDERMILK BISCUITS + + Buy them ready-made in the big blue box with the picture of + the biscuit on the front, or in the brown bag with the dark + stains that indicate freshness. +%% + 1/2 + /\(3) + | 2 1/3 + | z dz cos(3 * PI / 9) = ln (e ) + | + \/ 1 + +The integral of z squared, dz +From 1 to the square root of 3 + Times the cosine + Of 3 PI over nine +Is the log of the cube root of e +%% +* * * * * THIS TERMINAL IS IN USE * * * * * +%% +======================================================================= +|| || +|| The FORTUNE-COOKIE program is soon to be a Major Motion Picture! || +|| Watch for it at a theater near you next summer! || +|| || +======================================================================= + Francis Ford Coppola presents a George Lucas Production: + "Fortune Cookie" + Directed by Steven Spielberg. + Starring Harrison Ford Bette Midler Marlon Brando + Christopher Reeves Marilyn Chambers + and Bob Hope as "The Waiter". + Costumes Designed by Pierre Cardin. + Special Effects by Timothy Leary. + Read the Warner paperback! + Invoke the Unix program! + Soundtrack on XTC Records. + In 70mm and Dolby Stereo at selected theaters and terminal + centers. +%% + (1/2) + / 3 + | 2 3 x 3.14 (1/2) + | z dz cos (--------) = ln(e ) + / 1 9 + +The integral, from one to root three, +Of z to the second dz, + Times the cosine + Of 3 pi over nine +Is the log of the third root of e. +%% +=== ALL CSH USERS PLEASE NOTE ======================== + +Set the variable $LOSERS to all the people that you think are losers. This +will cause all said losers to have the variable $PEOPLE-WHO-THINK-I-AM-A-LOSER +updated in their .login file. Should you attempt to execute a job on a +machine with poor response time and a machine on your local net is currently +populated by losers, that machine will be freed up for your job through a +cold boot process. +%% +=== ALL USERS PLEASE NOTE ======================== + +A new system, the CIRCULATORY system, has been added. + +The long-experimental CIRCULATORY system has been released to users. The +Lisp Machine uses Type B fluid, the L machine uses Type A fluid. When the +switch to Common Lisp occurs both machines will, of course, be Type O. +Please check fluid level by using the DIP stick which is located in the +back of VMI monitors. Unchecked low fluid levels can cause poor paging +performance. +%% +=== ALL USERS PLEASE NOTE ======================== + +Bug reports now amount to an average of 12,853 per day. Unfortunately, +this is only a small fraction [ < 1% ] of the mail volume we receive. In +order that we may more expeditiously deal with these valuable messages, +please communicate them by one of the following paths: + + ARPA: WastebasketSLMHQ.ARPA + UUCP: [berkeley, seismo, harpo]!fubar!thekid!slmhq!wastebasket + Non-network sites: Federal Express to: + Wastebasket + Room NE43-926 + Copernicus, The Moon, 12345-6789 + For that personal contact feeling call 1-900-555-1212; our trained + operators are on call 24 hours a day. VISA/MC accepted.* + +* Our very rich lawyers have assured us that we are not + responsible for any errors or advice given over the phone. +%% +=== ALL USERS PLEASE NOTE ======================== + +CAR and CDR now return extra values. + +The function CAR now returns two values. Since it has to go to the trouble +to figure out if the object is carcdr-able anyway, we figured you might as +well get both halves at once. For example, the following code shows how to +destructure a cons (SOME-CONS) into its two slots (THE-CAR and THE-CDR): + + (MULTIPLE-VALUE-BIND (THE-CAR THE-CDR) (CAR SOME-CONS) ...) + +For symmetry with CAR, CDR returns a second value which is the CAR of the +object. In a related change, the functions MAKE-ARRAY and CONS have been +fixed so they don't allocate any storage except on the stack. This should +hopefully help people who don't like using the garbage collector because +it cold boots the machine so often. +%% +=== ALL USERS PLEASE NOTE ======================== + +Compiler optimizations have been made to macro expand LET into a WITHOUT- +INTERRUPTS special form so that it can PUSH things into a stack in the +LET-OPTIMIZATION area, SETQ the variables and then POP them back when it's +done. Don't worry about this unless you use multiprocessing. +Note that LET *could* have been defined by: + + (LET ((LET '`(LET ((LET ',LET)) + ,LET))) + `(LET ((LET ',LET)) + ,LET)) + +This is believed to speed up execution by as much as a factor of 1.01 or +3.50 depending on whether you believe our friendly marketing representatives. +This code was written by a new programmer here (we snatched him away from +Itty Bitti Machines where we was writting COUGHBOL code) so to give him +confidence we trusted his vows of "it works pretty well" and installed it. +%% +=== ALL USERS PLEASE NOTE ======================== + +JCL support as alternative to system menu. + +In our continuing effort to support languages other than LISP on the CADDR, +we have developed an OS/360-compatible JCL. This can be used as an +alternative to the standard system menu. Type System J to get to a JCL +interactive read-execute-diagnose loop window. [Note that for 360 +compatibility, all input lines are truncated to 80 characters.] This +window also maintains a mouse-sensitive display of critical job parameters +such as dataset allocation, core allocation, channels, etc. When a JCL +syntax error is detected or your job ABENDs, the window-oriented JCL +debugger is entered. The JCL debugger displays appropriate OS/360 error +messages (such as IEC703, "disk error") and allows you to dequeue your job. +%% +=== ALL USERS PLEASE NOTE ======================== + +The garbage collector now works. In addition a new, experimental garbage +collection algorithm has been installed. With SI:%DSK-GC-QLX-BITS set to 17, +(NOT the default) the old garbage collection algorithm remains in force; when +virtual storage is filled, the machine cold boots itself. With SI:%DSK-GC- +QLX-BITS set to 23, the new garbage collector is enabled. Unlike most garbage +collectors, the new gc starts its mark phase from the mind of the user, rather +than from the obarray. This allows the garbage collection of significantly +more Qs. As the garbage collector runs, it may ask you something like "Do you +remember what SI:RDTBL-TRANS does?", and if you can't give a reasonable answer +in thirty seconds, the symbol becomes a candidate for GCing. The variable +SI:%GC-QLX-LUSER-TM governs how long the GC waits before timing out the user. +%% +=== ALL USERS PLEASE NOTE ======================== + +There has been some confusion concerning MAPCAR. + (DEFUN MAPCAR (&FUNCTIONAL FCN &EVAL &REST LISTS) + (PROG (V P LP) + (SETQ P (LOCF V)) + L (SETQ LP LISTS) + (%START-FUNCTION-CALL FCN T (LENGTH LISTS) NIL) + L1 (OR LP (GO L2)) + (AND (NULL (CAR LP)) (RETURN V)) + (%PUSH (CAAR LP)) + (RPLACA LP (CDAR LP)) + (SETQ LP (CDR LP)) + (GO L1) + L2 (%FINISH-FUNCTION-CALL FCN T (LENGTH LISTS) NIL) + (SETQ LP (%POP)) + (RPLACD P (SETQ P (NCONS LP))) + (GO L))) +We hope this clears up the many questions we've had about it. +%% +**** CONVENTION REMINDER + +No experiment was approved for the convention by the Human Subjects +Committee of the Psychiatric Convention Planning Team. If you notice +smoke coming from under a closed door, if you find a body on the hotel +carpet, or if you just meet someone who orders you to press a button +marked "450 volts", react as you would normally. +%% +**** GROWTH CENTER REPAIR SERVICE + +For those who have had too much of Esalen, Topanga, and Kairos. +Tired of being genuine all the time? Would you like to learn how +to be a little phony again? Have you disclosed so much that you're +beginning to avoid people? Have you touched so many people that +they're all beginning to feel the same? Like to be a little dependent? +Are perfect orgasms beginning to bore you? Would you like, for once, +not to express a feeling? Or better yet, not be in touch with it at +all? Come to us. We promise to relieve you of the burden of your +great potential. +%% + *** A NEW KIND OF PROGRAMMING *** + +Do you want the instant respect that comes from being able to use technical +terms that nobody understands? Do you want to strike fear and loathing into +the hearts of DP managers everywhere? If so, then let the Famous Programmers' +School lead you on... into the world of professional computer programming. +They say a good programmer can write 20 lines of effective program per day. +With our unique training course, we'll show you how to write 20 lines of code +and lots more besides. Our training course covers every programming language +in existence, and some that aren't. You'll learn why the on/off switch for a +computer is so important, what the words *fatal error* mean, and who and what +you should blame when you make a mistake. + + Yes, I want the brochure describing this incredible offer. + I enclose $1000 is small unmarked bills to cover the cost of + postage and handling. (No live poultry, please.) + +*** Our Slogan: Top down programming for the masses. *** +%% +=============== ALL FRESHMEN PLEASE NOTE =============== + +To minimize scheduling confusion, please realize that if you are taking one +course which is offered at only one time on a given day, and another which is +offered at all times on that day, the second class will be arranged as to +afford maximum inconvenience to the student. For example, if you happen +to work on campus, you will have 1-2 hours between classes. If you commute, +there will be a minimum of 6 hours between the two classes. +%% +-- All articles that coruscate with resplendence are not truly auriferous. +-- When there are visible vapors having the prevenience in ignited + carbonaceous materials, there is conflagration. +-- Sorting on the part of mendicants must be interdicted. +-- A plethora of individuals wither expertise in culinary techniques vitiated + the potable concoction produced by steeping certain coupestibles. +-- Eleemosynary deeds have their initial incidence intramurally. +-- Male cadavers are incapable of yielding testimony. +-- Individuals who make their abode in vitreous edifices would be well + advised to refrain from catapulting projectiles. +%% + *** DO YOU HAVE A RESTLESS URGE TO PROGRAM? *** +Do you want the instant respect that comes from being able to use technical +terms that nobody understands? Do you want to strike fear and loathing into +the hearts of DP managers everywhere? If so, then let the Famous Programmers' +School lead you on... into the world of professional computer programming. + + *** IS PROGRAMMING FOR YOU? *** +Programming is not for everyone. But, if you have the desire to learn, we can +help you get started. All you need is the Famous Programmers' Course and +enough money to keep those lessons coming month after month. + + *** TAKE OUR FREE APTITUDE TEST *** +To help determine if you are qualified to be a programmer, take a moment to +try this simple test: + 1: Write down the numbers from zero to nine and the first six letters + of the alphabet (Hint: 0123456789ABCDEF). + 2: Whose picture is on the back of a twenty-dollar bill? + 3: What is the state capital of Idaho? +If you managed to read all three questions without wondering why we asked +them, you may have a future as a computer programmer. +%% +<<<<< EVACUATION ROUTE <<<<< +%% +**** IMPORTANT **** ALL USERS PLEASE NOTE **** + +Due to a recent systems overload error your recent disk files have been +erased. Therefore, in accordance with the UNIX Basic Manual, University of +Washington Geophysics Manual, and Bylaw 9(c), Section XII of the Revised +Federal Communications Act, you are being granted Temporary Disk Space, +valid for three months from this date, subject to the restrictions set forth +in Appendix II of the Federal Communications Handbook (18th edition) as well +as the references mentioned herein. You may apply for more disk space at any +time. Disk usage in or above the eighth percentile will secure the removal +of all restrictions and you will immediately receive your permanent disk +space. Disk usage in the sixth or seventh percentile will not effect the +validity of your temporary disk space, though its expiration date may be +extended for a period of up to three months. A score in the fifth percentile +or below will result in the withdrawal of your Temporary Disk space. +%% +>>> Internal error in fortune program: +>>> fnum=2987 n=45 flag=1 goose_level=-232323 +>>> Please write down these values and notify fortune program administrator. +%% +** MAXIMUM TERMINALS ACTIVE. TRY AGAIN LATER ** +%% +*** NEWSFLASH *** + Russian tanks steamrolling through New Jersey!!!! + Details at eleven! +%% +-- Neophyte's serendipity. +-- Exclusive dedication to necessitious chores without interludes of + hedonistic diversion renders John a hebetudinous fellow. +-- A revolving concretion of earthy or mineral matter accumulates no + congeries of small, green bryophytic plant. +-- The person presenting the ultimate cachinnation possesses thereby the + optimal cachinnation. +-- Abstention from any aleatory undertaking precludes a potential + escallation of a lucrative nature. +-- Missiles of ligneous or osteal consistency have the potential of + fracturing osseous structure, but appellations will eternally + remain innocuous. +%% + *** STUDENT SUCCESSES *** + +Many of our students have gone on to achieve great success in all fields of +programming. One former student developed the concept of the personalized +form letter. Does the phrase, "Dear Mr.(insert name), You may already be a +winner!," sound familiar? Another student writes "After only five lessons I +sold a "My Most Unforgettable Program" article to Corrosive Computing magazine. +Another of our graduates writes, "I recently completed a database-management +program for my department manager. My program touched him so deeply that he +was speechless. He told me later that he had never seen such a program in +his entire career. Thank you, Famous Programmers' school; only you could +have made this possible." Send for our introductory brochure which explains +in vague detail the operation of the Famous Programmers' School, and you'll +be eligible to win a possible chance to enter a drawing, the winner of which +can vie for a set of free steak knives. If you don't do it now, you'll hate +yourself in the morning. +%% +-- Scintillate, scintillate, asteroid minikin. +-- Members of an avian species of identical plumage congregate. +-- Surveillance should precede saltation. +-- Pulchritude possesses solely cutaneous profundity. +-- It is fruitless to become lachrymose over precipitately departed + lacteal fluid. +-- Freedom from incrustations of grime is contiguous to rectitude. +-- It is fruitless to attempt to indoctrinate a superannuated + canine with innovative maneuvers. +-- Eschew the implement of correction and vitiate the scion. +-- The temperature of the aqueous content of an unremittingly + galled saucepan does not reach 212 degrees Farenheit. +%% +***** Special AI Seminar (abstract) + +It has been widely recognized that AI programs require expert knowledge +in order to perform well in complex domains. But knowledge alone is not +sufficient for some applications; wisdom is needed as well. Accordingly, +we have developed a new approach to artificial intelligence which we call +"wisdom engineering". As a test of our ideas, we have written IMMANUEL, a +wisdom based system for the task domain of western philosophical thought. +IMMANUEL was supplied initially with 200 wisdom units which contained wisdom +about such elementary concepts as mind, matter, being, nothingness, and so +forth. IMMANUEL was then allowed to run freely, guided by the heuristic +rules contained in its heterarchically organized meta wisdom base. IMMANUEL +succeeded in rediscovering most of the important philosophical ideas developed +in western culture over the course of the last 25 centuries, including those +underlying Plato's theory of government, Kant's metaphysics, Nietzsche's theory +of value, and Husserl's phenomenology. In this seminar, we will describe +IMMANUEL's achievements and internal architecture. We will also briefly +discuss our recent efforts to apply wisdom engineering to oil exploration. +%% + U X +e dUdX, e dX, cosine, secant, tangent, sine, 3.14159... +%% +* UNIX is a Trademark of Bell Laboratories. +%% +<< WAIT >> +%% +: is not an identifier +%% +!07/11 PDP a ni deppart m'I !pleH +%% +[1] Alexander the Great was a great general. +[2] Great generals are forewarned. +[3] Forewarned is forearmed. +[4] Four is an even number. +[5] Four is certainly an odd number of arms for a man to have. +[6] The only number that is both even and odd is infinity. + Therefore, Alexander the Great had an infinite number of arms. +%% +[1] Alexander the Great was a great general. +[2] Great generals are forewarned. +[3] Forewarned is forearmed. +[4] Four is an even number. +[5] Four is certainly an odd number of arms for a man to have. +[6] The only number that is both even and odd is infinity. + Therefore, all horses are black. +%% +1) Everything depends. +2) Nothing is always. +3) Everything is sometimes. +%% +1) Never draw what you can copy. +2) Never copy what you can trace. +3) Never trace what you can cut out and paste down. +%% +1: No code table for op: ++post +%% +1) X=Y ; Given +2) X^2=XY ; Multiply both sides by X +3) X^2-Y^2=XY-Y^2 ; Subtract Y^2 from both sides +4) (X+Y)(X-Y)=Y(X-Y) ; Factor +5) X+Y=Y ; Cancel out (X-Y) term +6) 2Y=Y ; Substitute X for Y, by equation 1 +7) 2=1 ; Divide both sides by Y + -- "Omni", proof that 2 equals 1 +%% +1 bulls, 3 cows. +%% +$100 placed at 7 percent interest compounded quarterly for 200 years will +increase to more than $100,000,000 -- by which time it will be worth nothing. + -- Lazarus Long, "Time Enough For Love" +%% +10.0 times 0.1 is hardly ever 1.0. +%% + 12 + 144 + 20 + 3(4) 2 + ---------------------- + 5(11) = 9 + 0 + 7 + +A dozen, a gross and a score, +Plus three times the square root of four, + Divided by seven, + Plus five times eleven, +Equals nine squared plus zero, no more! +%% +13. ... r-q1 +%% +17. HO HUM -- The Redundant + +------- (7) This hexagram refers to a situation of extreme +--- --- (8) boredom. Your programs always bomb off. Your wife +------- (7) smells bad. Your children have hives. You are working +---O--- (6) on an accounting system, when you want to develop +---X--- (9) the GREAT AMERICAN COMPILER. You give up hot dates +--- --- (8) to nurse sick computers. What you need now is sex. + +Nine in the second place means: + The yellow bird approaches the malt shop. Misfortune. + +Six in the third place means: + In former times men built altars to honor the Internal + Revenue Service. Great Dragons! Are you in trouble! +%% +186,000 miles per second: +It isn't just a good idea, it's the law! +%% +1: A sheet of paper is an ink-lined plane. +2: An inclined plane is a slope up. +3: A slow pup is a lazy dog. + +QED: A sheet of paper is a lazy dog. + -- Willard Espy, "An Almanac of Words at Play" +%% +$3,000,000. +%% +355/113 -- + Not the famous irrational number PI, but an incredible simulation. +%% +3M, under the Scotch brand name, manufactures a fine adhesive for art +and display work. This product is called "Craft Mount". 3M suggests +that to obtain the best results, one should make the bond "while the +adhesive is wet, aggressively tacky." I did not know what "aggressively +tacky" meant until I read today's fortune. + + [And who said we didn't offer equal time, huh? Ed.] +%% +3rd Law of Computing: + Anything that can go wr +fortune: Segmentation violation -- Core dumped +%% +90% of the work takes 90% of the time. +The remaining 10% takes the other 90% of the time. +%% +94% of the women in America are beautiful +and the rest hang out around here. +%% +99 blocks of crud on the disk, +99 blocks of crud! +You patch a bug, and dump it again: +100 blocks of crud on the disk! + +100 blocks of crud on the disk, +100 blocks of crud! +You patch a bug, and dump it again: +101 blocks of crud on the disk! +%% +A truly great man will neither trample on a worm nor sneak to an emperor. + -- B. Franklin +%% +A CONS is an object which cares. + -- Bernie Greenberg. +%% +A Fortran compiler is the hobgoblin of little minis. +%% +A LISP programmer knows the value of +everything, but the cost of nothing. + -- Alan Perlis +%% +A Law of Computer Programming: + Make it possible for programmers to write in English + and you will find that programmers cannot write in English. +%% +A Mormon is a man that has the bad taste and the religion to do what a good +many other people are restrained from doing by conscientious scruples and +the police. + -- Mr. Dooley +%% +A Nixon [is preferable to] a Dean Rusk -- who will be +passionately wrong with a high sense of consistency. + -- J.K. Galbraith +%% +A Polish worker walks into a bank to deposit his paycheck. He has heard +about Poland's economic problems, and he asks what would happen to his +money if the bank collapsed. "All of our deposits are guaranteed by the +finance ministry, sir," the teller replies. + "But what if the finance ministry goes broke?" the worker asks. + "Then the government will intercede to protect the working class," +the teller says. + "But what if the government goes broke?" the worker asks. + "Our socialist comrades in the Soviet Union naturally will come +to our assistance," the teller responds with growing irritation. + "And if the Soviet Union goes broke?" the worker asks. + "Idiot!" the teller snorts. "Isn't that worth losing one lousy +paycheck?" + -- Making the rounds in Warsaw, 1984 +%% +A Puritan is someone who is deathly +afraid that someone, somewhere is having fun. +%% +A Roman divorced from his wife, being highly blamed by his friends, who +demanded, "Was she not chaste? Was she not fair? Was she not fruitful?" +holding out his shoe, asked them whether it was not new and well made. +Yet, added he, none of you can tell where it pinches me. + -- Plutarch +%% +A Severe Strain on the Credulity + As a method of sending a missile to the higher, and even to the +highest parts of the earth's atmospheric envelope, Professor Goddard's rocket +is a practicable and therefore promising device. It is when one considers the +multiple-charge rocket as a traveler to the moon that one begins to doubt... +for after the rocket quits our air and really starts on its journey, its +flight would be neither accelerated nor maintained by the explosion of the +charges it then might have left. Professor Goddard, with his "chair" in +Clark College and countenancing of the Smithsonian Institution, does not +know the relation of action to re-action, and of the need to have something +better than a vacuum against which to react... Of course he only seems to +lack the knowledge ladled out daily in high schools. + -- New York Times Editorial, 1920 +%% +A Smith & Wesson beats four aces. +%% +A baby is an alimentary canal with a loud voice +at one end and no responsibility at the other. +%% +A bachelor is a selfish, undeserving guy +who has cheated some woman out of a divorce. + -- Don Quinn +%% +A banker is a fellow who lends you his umbrella when the +sun is shining and wants it back the minute it begins to rain. + -- Mark Twain +%% +A bather whose clothing was strewed +By breezes that left her quite nude, + Saw a man come along + And, unless I'm quite wrong, +You expected this line to be lewd. +%% +A beautiful woman is a blessing from Heaven, but a good cigar is a smoke. + -- Kipling +%% +A beautiful woman is a picture which drives all beholders nobly mad. + -- Emerson +%% +A beginning is the time for taking the +most delicate care that balances are correct. + -- Princess Irulan, "Manual of Maud'Dib" +%% +A billion here, a couple of billion there-- +first thing you know it adds up to be real money. + -- Everett Dirksen +%% +A bird in the hand is worth two in the bush. + -- Cervantes +%% +A bird in the hand is worth what it will bring. +%% +A bit of talcum +Is always walcum + -- Ogden Nash +%% +A black cat crossing your path signifies +that the animal is going somewhere. + -- Groucho Marx +%% +A book is the work of a mind, doing its work in the way that a mind deems +best. That's dangerous. Is the work of some mere individual mind likely to +serve the aims of collectively accepted compromises, which are known in the +schools as 'standards'? Any mind that would audaciously put itself forth to +work all alone is surely a bad example for the students, and probably, if +not downright antisocial, at least a little off-center, self-indulgent, +elitist. ... It's just good pedagogy, therefore, to stay away from such +stuff, and use instead, if film-strips and rap-sessions must be +supplemented, 'texts,' selected, or prepared, or adapted, by real +professionals. Those texts are called 'reading material.' They are the +academic equivalent of the 'listening material' that fills waiting-rooms, +and the 'eating material' that you can buy in thousands of convenient eating +resource centers along the roads. + -- The Underground Grammarian +%% +A bore is a man who talks so much about +himself that you can't talk about yourself. +%% +A bore is someone who persists in holding his +own views after we have enlightened him with ours. +%% +A boss with no humor is like a job that's no fun. +%% +A box without hinges, key, or lid, +Yet golden treasure inside is hid. + -- J.R. Tolkien +%% +A boy gets to be a man when a man is needed. + -- John Steinbeck +%% +A budget is just a method of worrying +before you spend money, as well as afterward. +%% +A bug in the code is worth two in the documentation. +%% +A bug in the hand is better than one as yet undetected. +%% +A bunch of the boys were whooping it in the Malemute saloon; +The kid that handles the music box was hitting a jag-time tune; +Back of the bar, in a solo game, sat Dangerous Dan McGrew, +And watching his luck was his light-o'-love, the lady that's known as Lou. + -- Robert W. Service +%% +A bureaucrat's idea of cleaning up his files +is to make a copy of everything before he destroys it. +%% +A burleyque dancer, a pip +Named Virginia, could peel in a zip; + But she read science fiction + And died of constriction +Attempting a Moebius strip. + -- Cyril Kornbluth, "The Unfortunate Topology" +%% + A business executive is consumed by jealousy: he suspects his wife +of cheating on him. The suspicion grows and grows, and one morning as he +drives to work he can't take it any more. He thinks to himself, "she +probably just waited until I left so she could meet with her lover." + When he gets to his office, he calls home. The maid answers. He +says, "Hello. Is my wife there?" + "Yes, sir", the maid whispers. + "Is she with her lover?" + The maid pauses, and then says, "Yes, sir, she is, and I must say +that I feel terrible about how she treats you." + The man yells, "That no good **#*&!!. If you feel as badly as you +say you do, you must do this for me: go to my dresser and get my gun. Check +to make sure that it's loaded. Then go upstairs and shoot both that cheating +two-timing whore and her lover. Dispose of the gun, and then come back to +the phone and tell me that it's over. Don't worry -- I'll protect you." +The man hears footsteps, a drawer being opened, a click, more footsteps, +silence... and then two shots. More footsteps. Finally the maid comes back +to the phone and says "It's done." + The man asks, "What did you do with the gun?" + "I threw it behind the statue in the garden", the maid replies. + "Statue in the garden? Say, what number is this, anyway?" +%% +A businessman is a hybrid of a dancer and a calculator. + -- Paul Valery +%% +A candidate is a person who gets money from the rich +and votes from the poor to protect them from each other. +%% +A castaway was washed ashore after many days on the open sea. The island +on which he landed was populated by savage cannibals who tied him, dazed +and exhausted, to a thick stake. They then proceeded to cut his arms +with their spears and drink his blood. This continued for several days +until the castaway could stand no more. He yelled for the cannibal chief +and declared, "You can kill me if you want to, but this torture with the +spears has got to stop. Dammit, I'm tired of getting stuck for the drinks." +%% +A cauliflower is nothing but cabbage with a college education. + -- Mark Twain +%% +A celebrity is a person who is known for his well-knownness. +%% +A certain amount of opposition is a help, not a hindrance. +Kites rise against the wind, not with it. +%% +A certain monk had a habit of pestering the Grand Tortue (the only one who +had ever reached the Enlightenment 'Yond Enlightenment), by asking whether +various objects had Buddha-nature or not. To such a question Tortue +invariably sat silent. The monk had already asked about a bean, a lake, +and a moonlit night. One day he brought to Tortue a piece of string, and +asked the same question. In reply, the Grand Tortue grasped the loop +between his feet and, with a few simple manipulations, created a complex +string which he proferred wordlessly to the monk. At that moment, the monk +was enlightened. + +From then on, the monk did not bother Tortue. Instead, he made string after +string by Tortue's method; and he passed the method on to his own disciples, +who passed it on to theirs. +%% +A chicken is an egg's way of producing more eggs. +%% +A chronic disposition to inquiry +deprives domestic felines of vital qualities. +%% +A chubby man with a white beard and a red suit +will approach you soon. Avoid him. He's a Commie. +%% +A city is a large community where people are lonesome together. + -- Herbert Prochnow +%% +A clash of doctrine is not a disaster - it is an opportunity. +%% +A classic is something +that everyone wants to have read and nobody wants to read. + -- Mark Twain +%% +A clever prophet makes sure of the event first. +%% +A closed mouth gathers no foot. +%% +A cloud does not know why it moves in just such a direction and at such +a speed, if feels an impulsion... this is the place to go now. But the +sky knows the reasons and the patterns behind all clouds, and you will +know, too, when you lift yourself high enough to see beyond horizons. + -- Messiah's Handbook : Reminders for the Advanced Soul +%% +A committee is a life form with six or more legs and no brain. + -- Lazarus Long, "Time Enough For Love" +%% +A committee takes root and grows, it flowers, wilts and dies, +scattering the seed from which other committees will bloom. + -- Parkinson +%% +A commune is where people join together to share their lack of wealth. + -- R. Stallman +%% +A company is known by the men it keeps. +%% +A complex system that works is invariably +found to have evolved from a simple system that works. +%% +A compliment is something like a kiss through a veil. + -- Victor Hugo +%% +A computer called Illiac4 +Had a rather tough bug in its core. + It chewed up its cards + And spewed yards and yards +Of illegible tape on the floor. +%% +A computer salesman visits a company president for the purpose of selling +the president one of the latest talking computers. +Salesman: "This machine knows everything. I can ask it any quesstion + and it'll give the correct answer. Computer, what is the + speed of light?" +Computer: 186,000 miles per second. +Salesman: "Who was the first president of the United States?" +Computer: George Washington. +President: "I'm still not convinced. Let me ask a question. + Where is my father?" +Computer: Your father is fishing in Georgia. +President: "Hah!! The computer is wrong. My father died over twenty + years ago!" +Computer: Your mother's husband died 22 years ago. Your father just + landed a twelve pound bass. +%% +A computer scientist is someone who fixes things that aren't broken. +%% +A computer, to print out a fact, +Will divide, multiply, and subtract. + But this output can be + No more than debris, +If the input was short of exact. + -- Gigo +%% +A conclusion is simply the place where someone got tired of thinking. +%% +A conservative is a man +who believes that nothing should be done for the first time. + -- Alfred E. Wiggam +%% +A conservative is a man +with two perfectly good legs who has never learned to walk. + -- Franklin D. Roosevelt +%% +A conservative is one who is too cowardly to fight and too fat to run. +%% +A couch is as good as a chair. +%% +A countryman between two lawyers is like a fish between two cats. + -- B. Franklin +%% +A couple more shots of whiskey, women 'round here start looking good. + + [something about a 10 being a 4 after a six-pack? Ed.] +%% +A cousin of mine once said about money, +money is always there but the pockets change; +it is not in the same pockets after a change, +and that is all there is to say about money. + -- Gertrude Stein +%% +A "critic" is a man who creates nothing and thereby feels +qualified to judge the work of creative men. There is logic +in this; he is unbiased -- he hates all creative people equally. +%% +A crusader's wife slipped from the garrison +And had an affair with a Saracen. + She was not oversexed, + Or jealous or vexed, +She just wanted to make a comparison. +%% +A day for firm decisions!!!!! Or is it? +%% +A day without orange juice is like a day without orange juice. +%% +A day without sunshine is like a day without Anita Bryant. +%% +A day without sunshine is like a day without orange juice. +%% +A day without sunshine is like night. +%% +A dead man cannot bite. + -- Gnaeus Pompeius (Pompey) +%% +A debugged program is one for which you have +not yet found the conditions that make it fail. + -- Jerry Ogdin +%% +A decade after Vietnam, we still cannot understand why "their" +Salvadorans fight better than "our" Salvadorans. It is not a matter of +their training or their equipment. It has to do with the quality of the +society we are asking them to risk death defending. The metaphor of the +domino obscures this reality, and the cost our self-imposed blindness +is high. San Salvador is closer to Saigon than to Munich. + -- William LeoGrande, "New York Times", 3/9/83 +%% +A diplomat is a man who can convince his +wife she'd look stout in a fur coat. +%% +A diplomat is a man who can tell you to +go to hell and make the trip sound pleasurable. + -- Samuel Clemens +%% +A diplomat is man who always remembers a woman's birthday but never her age. + -- Robert Frost +%% +A diplomat is someone who can tell you to go to hell +in such a way that you will look forward to the trip. +%% +A diplomat's life consists of three things: protocol, Geritol, and alcohol. + -- Adlai Stevenson +%% + A disciple of another sect once came to Drescher as he was eating +his morning meal. "I would like to give you this personality test", said +the outsider, "because I want you to be happy." + Drescher took the paper that was offered him and put it into the +toaster -- "I wish the toaster to be happy too". +%% +A diva who specializes in risque arias is an off-coloratura soprano. +%% + A doctor, an architect, and a computer scientist were arguing about +whose profession was the oldest. In the course of their arguments, they +got all the way back to the Garden of Eden, whereupon the doctor said, "The +medical profession is clearly the oldest, because Eve was made from Adam's +rib, as the story goes, and that was a simply incredible surgical feat." + The architect did not agree. He said, "But if you look at the Garden +itself, in the beginning there was chaos and void, and out of that the Garden +and the world were created. So God must have been an architect." + The computer scientist, who'd listened carefully to all of this, then +commented, "Yes, but where do you think the chaos came from?" +%% +A door is what a dog is perpetually on the wrong side of. + -- Ogden Nash +%% +A dreary young bank clerk named Fennis +Wished to foster an aura of menace. + To make people afraid + He wore gloves of grey suede +And white footgear intended for tennis. + -- Edward Gorey, "Amphigorey" +%% +A fail-safe circuit will destroy others. + -- Klipstein +%% +A failure will not appear until a unit has passed final inspection. +%% +A fair exterior is a silent recommendation. + -- Publilius Syrus +%% +A fake fortuneteller can be tolerated. But an authentic soothsayer +should be shot on sight. Cassandra did not get half the kicking around +she deserved. + -- R.A. Heinlein +%% +A famous Lisp Hacker noticed an Undergraduate sitting in front of a Xerox +1108, trying to edit a complex Klone network via a browser. Wanting to help, +the Hacker clicked one of the nodes in the network with the mouse, and asked +"what do you see?" Very earnestly, the Undergraduate replied, "I see a +cursor." The Hacker then quickly pressed the boot toggle at the back of +the keyboard, while simultaneously hitting the Undergraduate over the head +with a thick Interlisp Manual. The Undergraduate was then Enlightened. +%% +A fanatic is one who can't change his mind and won't change the subject. + -- Winston Churchill +%% +A farmer is a man outstanding in his field. +%% +A few hours grace before the madness begins again. +%% +A fitter fits; Though sinners sin +A cutter cuts; And thinners thin +And an aircraft spotter spots; And paper-blotters blot +A baby-sitter I've never yet +Baby-sits -- Had letters let +But an otter never ots. Or seen an otter ot. + +A batter bats +(Or scatters scats); +A potting shed's for potting; +But no one's found +A bounder bound +Or caught an otter otting. + -- Ralph Lewin +%% +A fool and his honey are soon parted. +%% +A fool and his money are soon popular. +%% +A fool and your money are soon partners. +%% +A fool must now and then be right by chance. +%% +A foolish consistency is the hobgoblin of little minds. + -- Ralph Waldo Emerson +%% +A fool-proof method for sculpting an elephant: first, get a huge block +of marble; then you chip away everything that doesn't look like an elephant. +%% +A fool's brain digests philosophy into folly, science into +superstition, and art into pedantry. Hence University education. + -- G.B. Shaw +%% +A formal parsing algorithm should not always be used. + -- D. Gries +%% +A friend in need is a pest indeed. +%% +A full belly makes a dull brain. + -- Ben Franklin + + [and the local candy machine man. Ed] +%% +A furore Normanorum libera nos, O Domine! +%% +A gambler's biggest thrill is winning a bet. +His next biggest thrill is losing a bet. +%% +A game can by God repent or we'll punish it. +That's how they did it in Salem in the seventeenth century, +and that's how we'll do it now. + -- Dick Hamlet +%% +A geneticist living in Delft +Scientifically played with himself, + And when he was done + He labled it: son, +And filed him away on a shelf. +%% +A gift of a flower will soon be made to you. +%% +A gleekzorp without a tornpee is like +a quop without a fertsneet (sort of). +%% +A good memory does not equal pale ink. +%% +A good plan today is better than a perfect plan tomorrow. + -- Patton +%% +A good reputation is more valuable than money. + -- Publilius Syrus +%% +A good scapegoat is hard to find. +%% +A good supervisor can step on your toes without messing up your shine. +%% +A great empire, like a great cake, is most easily diminished at the edges. + -- B. Franklin +%% +A great many people think they are thinking +when they are merely rearranging their prejudices. + -- William James +%% +A guy has to get fresh once in a while +so a girl doesn't lose her confidence. +%% + A guy returns from a long trip to Europe, having left his beloved +dog in his brother's care. The minute he's cleared customs, he calls up his +brother and inquires after his pet. + "Your dog's dead," replies his brother bluntly. + The guy is devastated. "You know how much that dog meant to me," +he moaned into the phone. "Couldn't you at least have thought of a nicer way +of breaking the news? Couldn't you have said, `Well, you know, the dog got +outside one day, and was crossing the street, and a car was speeding around a +corner...' or something...? Why are you always so thoughtless?" + "Look, I'm sorry," said his brother, "I guess I just didn't think." + "Okay, okay, let's just put it behind us. How are you anyway? +How's Mom?" + His brother is silent a moment. "Uh," he stammers, "uh... Mom got +outside one day..." +%% +A hacker does for love what others would not do for money. +%% +A halted retreat +Is nerve-wracking and dangerous. +To retain people as men -- and maidservants +Brings good fortune. +%% +A hammer sometimes misses its mark - a bouquet never. +%% +A handful of friends is worth more than a wagon of gold. +%% +A handful of patience is worth more than a bushel of brains. +%% +A handsome young rodent named Gratian +As a lifeguard became a sensation. + All the lady mice waved + And screamed to be saved +By his mouse-to-mouse resuscitation. +%% +A hearty young fellow named Yost +Once had an affair with a ghost. + At the height of the spasm + The poor ectoplasm +Cried, "Goodie, I feel it... almost." +%% +A hermit is a deserter from the army of humanity. +%% +A holding company is a thing where you hand +an accomplice the goods while the policeman searches you. +%% +A homeowner's reach should exceed his grasp, or what's a weekend for? +%% +A horse! A horse! My kingdom for a horse! + -- Wm. Shakespeare, "Henry VI" +%% +A joker who haunts Monticello +Is really a terrible fellow. + In the midst of caresses + He fills ladies dresses +With garter snakes, ice cubes, and jello. +%% +A journey of a thousand miles begins with a cash advance from Sam. +%% +A journey of a thousand miles must begin with a single step. + -- Lao Tsu +%% +A journey of a thousand miles starts under one's feet. + -- Lao Tsu +%% +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. +%% +A kid'll eat the middle of an Oreo, eventually. +%% +A king's castle is his home. +%% +A kiss is a course of procedure, cunningly devised, +for the mutual stoppage of speech at a moment when +words are superfluous. +%% +A lack of leadership is no substitute for inaction. +%% +A lady with one of her ears applied +To an open keyhole heard, inside, +Two female gossips in converse free -- +The subject engaging them was she. +"I think", said one, "and my husband thinks +That she's a prying, inquisitive minx!" +As soon as no more of it she could hear +The lady, indignant, removed her ear. +"I will not stay," she said with a pout, +"To hear my character lied about!" + -- Gopete Sherany +%% +A language that doesn't affect the way you +think about programming is not worth knowing. +%% +A language that doesn't have everything is +actually easier to program in than some that do. + -- D.M. Ritchie +%% +A large number of installed systems work by fiat. +That is, they work by being declared to work. + -- Anatol Holt +%% +A large spider in an old house built a beautiful web in which to catch flies. +Every time a fly landed on the web and was entangled in it the spider devoured +him, so that when another fly came along he would think the web was a safe and +quiet place in which to rest. One day a fairly intelligent fly buzzed around +above the web so long without lighting that the spider appeared and said, +"Come on down." But the fly was too clever for him and said, "I never light +where I don't see other flies and I don't see any other flies in your house." +So he flew away until he came to a place where there were a great many other +flies. He was about to settle down among them when a bee buzzed up and said, +"Hold it, stupid, that's flypaper. All those flies are trapped." "Don't be +silly," said the fly, "they're dancing." So he settled down and became stuck +to the flypaper with all the other flies. + +Moral: There is no safety in numbers, or in anything else. + -- James Thurber, "The Fairly Intelligent Fly" +%% +A liberal is someone too poor to be a +capitalist, and too rich to be a communist. +%% +A lie in time saves nine. +%% +A lifetime isn't nearly long enough to figure out what it's all about. +%% +A light wife doth make a heavy husband. + -- Wm. Shakespeare, "The Merchant of Venice" +%% +A likely impossibility is always preferable to an unconvincing possibility. + -- Aristotle +%% +A limerick packs laughs anatomical +Into space that is quite economical. + But the good ones I've seen + So seldom are clean, +And the clean ones so seldom are comical. +%% +A linguist thought it a farce +That memory space was so sparse. + One day they increased it. + Said he as he seized it: +"At last! Enough core for the parse". +%% +A list is only as strong as its weakest link. + -- Don Knuth +%% +A little bit of rape is good for a man's soul. + -- Norman Mailer +%% + A little dog goes into a saloon in the Wild West, and beckons to +the bartender. "Hey, bartender, gimmie a whiskey." + The bartender ignores him. + "Hey bartender, gimmie a whiskey." + Still ignored. + "HEY BARMAN!! GIMMIE A WHISKEY!!" + The bartender takes out his six-shooter and shoots the dog in the +leg, and the dog runs out the saloon, howling in pain. + Three years later, the wee dog appears again, wearing boots, +jeans, chaps, a Stetson, gun belt, and guns. He ambles slowly into the +saloon, goes up to the bar, leans over it, and says to the bartender, +"I'm here t'git the man that shot muh paw." +%% +A little experience often upsets a lot of theory. +%% +A little inaccuracy sometimes saves tons of explanation. + -- H.H. Munro, "Saki" +%% +A log may float in a river, but that does not make it a crocodile. +%% +A long-forgotten loved one will appear soon. +Buy the negatives at any price. +%% +A lost ounce of gold may be found, a lost moment of time never. +%% +A lot of people I know believe in positive thinking, +and so do I. I believe everything positively stinks. + -- Lew Col +%% +A lovely young diver named Nancy, +Wore a bikini bottom quite chancy, + The fish of Bonaire, + Watched her Derriere, +And the sea fans all tickled her fancy. +%% +A lovely young maid from St. Jude +Once rode through the streets in the nude. + The police cried, "Whatam-- + Agnificent bottom" +And slapped it as hard as they could. +%% +A man always needs to remember one thing about +a pretty girl. Somewhere, somebody's tired of her. +%% +A man fell off a mountain and, as he fell, saw a branch and grabbed for it. +By superhuman effort he was able to get a precarious grip on it. As he +was hanging there for dear life, he looked up and cried out, + "Is anybody there?" +A deep majestic voice answered, + "Yes my son, I am here. What do you need?" + "Help me!!" cried the man. + "I will help you", said the voice, "just let go of the branch and +you'll be safe. All you have to do is trust." +The man thought for a moment and cried out: + "Anybody ELSE up there?" +%% + A man from AI walked across the mountains to SAIL to see the Master, +Knuth. When he arrived, the Master was nowhere to be found. "Where is the +wise one named Knuth?" he asked a passing student. + "Ah," said the student, "you have not heard. He has gone on a +pilgrimage across the mountains to the temple of AI to seek out new +disciples." + Hearing this, the man was Enlightened. +%% +A man is incomplete until he is married; then he's really finished. +%% +A man is known by the company he organizes. + -- A. Bierce +%% +A man may be so much of everything that he is nothing of anything. + -- Samuel Johnson +%% +A man may sometimes be forgiven the kiss to which he is not entitled, +but never the kiss he has not the initiative to claim. +%% +A man may well bring a horse to the water, +but he cannot make him drink with he will. + -- John Heywood +%% +A man of genius makes no mistakes. +His errors are volitional and are the portals of discovery. + -- James Joyce, "Ulysses" +%% +A man paints with his brains and not with his hands. +%% +A man said to the Universe: + "Sir, I exist!" + "However," replied the Universe, + "the fact has not created in me a sense of obligation." + -- Stephen Crane +%% +A man was kneeling by a grave in a cemetery, crying and praying very loudly, + "Oh why..eeeee did you die...eeeeee, Oh Why..eeeeee, +why did you Di......eeee" +The caretaker walks up, pardons himself and asks politely, + "Excuse me, sir, but I've been seeing you for hours now, +carrying on at this grave. You must have been very close to the deceased." + "No, I never met him. Oh why....eeeee did you dieeeeee, +why....eeeee did you.." + "Sir, you say you never met this person, yet you carry on so? +Tell, me who is buried here?" + "My wife's first husband." +%% +A man who cannot seduce men cannot save them either. + -- Soren Kierkegaard +%% +A man who fishes for marlin in ponds +will put his money in Etruscan bonds. +%% +A man who turns green has eschewed protein. +%% +A man with 3 wings and a dictionary is cousin to the turkey. +%% +A man with one watch knows what time it is. +A man with two watches is never quite sure. +%% +A man without a woman is like a fish without gills. +%% +A man would still do something out of sheer perversity - he would create +destruction and chaos - just to gain his point... and if all this could in +turn be analyzed and prevented by predicting that it would occur, then man +would deliberately go mad to prove his point. + -- Feodor Dostoevsky, "Notes From the Underground" +%% +A man wrapped up in himself makes a very small package. +%% +A man's best friend is his dogma. +%% +A man's gotta know his limitations. + -- Clint Eastwood, "Dirty Harry" +%% +A man's house is his castle. + -- Sir Edward Coke +%% +A man's house is his hassle. +%% +A master was asked the question, "What is the Way?" by a curious monk. + "It is right before your eyes," said the master. + "Why do I not see it for myself?" + "Because you are thinking of yourself." + "What about you: do you see it?" + "So long as you see double, saying `I don't', and `you do', and so +on, your eyes are clouded," said the master. + "When there is neither `I' nor `You', can one see it?" + "When there is neither `I' nor `You', +who is the one that wants to see it?" +%% +A mathematician named Klein +Thought the Mobius band was divine. + Said he, "If you glue + The edges of two, +You'll get a weird bottle like mine! +%% +A meeting is an event at which the +minutes are kept and the hours are lost. +%% +A method of solution is perfect if we can forsee from the start, +and even prove, that following that method we shall attain our aim. + -- Leibnitz +%% +A mighty creature is the germ, +Though smaller than the pachyderm. +His customary dwelling place +Is deep within the human race. +His childish pride he often pleases +By giving people strange diseases. +Do you, my poppet, feel infirm? +You probably contain a germ. + -- Ogden Nash +%% +A modem is a baudy house. +%% +A modest woman, dressed out in all her finery, +is the most tremendous object in the whole creation. + -- Goldsmith +%% +A mother takes twenty years to make a man of her boy, +and another woman makes a fool of him in twenty minutes. + -- Frost +%% +A motion to adjourn is always in order. +%% +A mouse is an elephant built by the Japanese. +%% +A mushroom cloud has no silver lining. +%% +A musician, an artist, an architect: + the man or woman who is not one of these is not a Christian. + -- William Blake +%% + A musician of more ambition than talent composed an elegy at +the death of composer Edward MacDowell. She played the elegy for the +pianist Josef Hoffman, then asked his opinion. "Well, it's quite +nice," he replied, but don't you think it would be better if..." + "If what?" asked the composer. + "If ... if you had died and MacDowell had written the elegy?" +%% +A nasty looking dwarf throws a knife at you. +%% +A national debt, if it is not excessive, +will be to us a national blessing. + -- Alexander Hamilton +%% +A new dramatist of the absurd +Has a voice that will shortly be heard. + I learn from my spies + He's about to devise +An unprintable three-letter word. +%% +A new koan: + If you have some ice cream, I will give it to you. + If you have no ice cream, I will take it away from you. +It is an ice cream koan. +%% +A new supply of round tuits has arrived and are available from Mary. +Anyone who has been putting off work until they got a `round tuit' +now has no excuse for further procrastination. +%% +A new taste had been acquired and a new appetite began to grow. The time +had long since arrived to crush the technical intelligentsia, which had +come to regard itself as too irreplaceable and had not gotten used to +catching instructions on the wing. In other words, we never did trust +the engineers - and from the very first years of the Revolution we saw to +it that those lackeys and servants of former capitalist bosses were kept +in line by healthy suspicion and surveillance by the workers. + -- Aleksandr I. Solzhenitsyn, "The Gulag Archipelago" +%% +A newspaper is a circulating library with high blood pressure. + -- Arthure "Bugs" Baer +%% + A novice was trying to fix a broken lisp machine by turning the +power off and on. Knight, seeing what the student was doing spoke sternly, +"You cannot fix a machine by just power-cycling it with no understanding +of what is going wrong." Knight turned the machine off and on. The +machine worked. +%% +A nubile female virtually never experiences difficulty in finding willing +sexual partners, and in a natural habitat nubile females are probably always +married. The basic female "strategy" is to obtain the best possible husband, +to be fertilized by the fittest available male (always, of course, taking +risk into account), and to maximize the returns on sexual favors bestowed: +to be sexually aroused by the sight of males would promote random matings, +thus undermining all of these aims, and would also waste time and energy +that could be spent in economically significant activities and in nurturing +children. A female's reproductive success would be seriously compromised +by the propensity to be sexually aroused by the sight of males. + -- Donald Symons, "The Evolution of Human Sexuality", + attempting to explain the lack of female interest in + pornography. +%% +A nuclear war can ruin your whole day. +%% +A pencil with no point needs no eraser. +%% +A penny saved has not been spent. +%% +A penny saved is a penny taxed. +%% +A penny saved is ridiculous. +%% +A perfectly honest woman, a woman who never flatters, who never manages, +who never cajoles, who never conceals, who never uses her eyes, who never +speculates on the effect which she produces, who never is conscious of +unspoken admiration, what a monster, I say, would such a female be! + -- Thackeray +%% +A person forgives only when they are in the wrong. +%% +A person is just about as big as the things that make him angry. +%% +A person who has nothing looks at all there is and wants something. +A person who has something looks at all there is and wants all the rest. +%% +A person who is more than casually interested +in computers should be well schooled in machine +language, since it is a fundamental part of a computer. + -- Donald Knuth +%% +A physicist is an atom's way of knowing about atoms. + -- George Wald +%% +A pipe gives a wise man time to think +and a fool something to stick in his mouth. +%% +A plethora of individuals with expertise in culinary techniques +contaminate the potable concoction produced by steeping certain +edible nutriments. +%% +A plucked goose doesn't lay golden eggs. +%% +A poet who reads his verse in public may have other nasty habits. +%% +A political man can have as his aim the realization of freedom, +but he has no means to realize it other than through violence. + -- Jean Paul Sartre +%% +A possum must be himself, and being himself he is honest. + -- Walt Kelly +%% +A pound of salt will not sweeten a single cup of tea. +%% +A "practical joker" deserves applause for his wit according to its quality. +Bastinado is about right. For exceptional wit one might grant keelhauling. +But staking him out on an anthill should be reserved for the very wittiest. + -- Lazarus Long +%% +A prediction is worth twenty explanations. + -- K. Brecher +%% +A pretty woman can do anything; an ugly woman must do everything. +%% +A priest asked: What is Fate, Master? + + And the Master answered: + It is that which gives a beast of burden its reason for existence. +It is that which men in former times had to bear upon their backs. + + It is that which has caused nations to build byways from City +to City upon which carts and coaches pass, and alongside which inns +have come to be built to stave off Hunger, Thirst and Weariness. + + And that is Fate? said the priest. + + Fate... I thought you said Freight, responded the Master. + + That's all right, said the priest. I wanted to know +what Freight was too. + -- Kehlog Albran +%% +A prig is a fellow who is always making you a present of his opinions. + -- George Eliot +%% +A princess who lived near a bog +Met a prince in the form of a frog. + Now she and her prince + Are the parents of quints, +Four boys and one fine polliwog. +%% +A private sin is not so prejudicial in the world as a public indecency. + -- Miguel de Cervantes +%% +A professor is one who talks in someone else's sleep. +%% +A programmer down in Moline +Said, I'm the match for any machine. + My secret's aversion, + To loops and recursion, +Just acres of in-line routine. + -- W.J. Wilson +%% +A programmer is a person who passes as an exacting expert on the basis of +being able to turn out, after innumerable punching, an infinite series of +incomprehensible answers calculated with micrometric precisions from vague +assumptions based on debatable figures taken from inconclusive documents +and carried out on instruments of problematical accuracy by persons of +dubious reliability and questionable mentality for the avowed purpose of +annoying and confounding a hopelessly defenseless department that was +unfortunate enough to ask for the information in the first place. + -- IEEE Grid newsmagazine +%% +A programming language is low level +when its programs require attention to the irrelevant. +%% +A progressive professor named Winners +Held classes each evening for sinners. + They were graded and spaced + So the vile and debased +Would not be held back by beginners. +%% +A prominent broadcaster, on a big-game safari in Africa, was taken to a +watering hole where the life of the jungle could be observed. As he +looked down from his tree platform and described the scene into his +tape recorder, he saw two gnus grazing peacefully. So preoccupied were +they that they failed to observe the approach of a pride of lions led +by two magnificent specimens, obviously the leaders. The lions charged, +killed the gnus, and dragged them into the bushes where their feasting +could not be seen. A little while later the two kings of the jungle +emerged and the radioman recorded on his tape: "Well, that's the end of +the gnus and here, once again, are the head lions." +%% +A real patriot is the fellow who gets a parking +ticket and rejoices that the system works. +%% +A recent study has found that concentrating on difficult off-screen +objects, such as the faces of loved ones, causes eye strain in computer +scientists. Researchers into the phenomenon cite the added concentration +needed to "make sense" of such unnatural three dimensional objects. +%% +A relationship is like a shark - it has to keep moving forward or it dies. +Well, what we have on our hands here is a dead shark. + -- Woody Allen +%% +A robin redbreast in a cage +Puts all Heaven in a rage. + -- Blake +%% +A rock pile ceases to be a rock pile the moment a single +man contemplates it, bearing within him the image of a cathedral. + -- Antoine de Saint-Exupery +%% +A rolling disk gathers no MOS. +%% +A rolling stone gathers momentum. +%% +A rolling stone gathers no moss. + -- Publilius Syrus +%% +A sadist is a masochist who follows the Golden Rule. +%% +A scientific truth does not triumph by convincing its opponents and +making them see the light, but rather because its opponents eventually +die and a new generation grows up that is familiar with it. + -- Max Planck +%% +A sense of desolation and uncertainty, of futility, of the baselessness +of aspirations, of the vanity of endeavor, and a thirst for a life giving +water which seems suddenly to have failed, are the signs in conciousness +of this necessary reorganization of our lives. + +It is difficult to believe that this state of mind can be produced by the +recognition of such facts as that unsupported stones always fall to the +ground. + -- J.W.N. Sullivan +%% +A shortcut is the longest distance between two points. +%% +A sine curve goes off to infinity, or at least the end of the blackboard. + -- Prof. Steiner +%% +A single death is a tragedy, a million deaths is a statistic. + -- Joseph Stalin +%% +A single flow'r he sent me, since we met. +All tenderly his messenger he chose; +Deep-hearted, pure, with scented dew still wet-- +One perfect rose. + +I knew the language of the floweret; +"My fragile leaves," it said, "his heart enclose." +Love long has taken for his amulet +One perfect rose. + +Why is it no one ever sent me yet +One perfect limousine, do you suppose? +Ah no, it's always just my luck to get +One perfect rose. + -- Dorothy Parker, "One Perfect Rose" +%% +A sinking ship gathers no moss. + -- Donald Kaul +%% +A snake lurks in the grass. + -- Publius Vergilius Maro (Virgil) +%% +A soft answer turneth away wrath; but grievous words stir up anger. + -- Proverbs 15:1 +%% +A soft drink turneth away company. +%% +A software technician from Digital +Had hardware extremely prodigical. + It's rumoured, I hear, + That when he was near +He made the ladies all flustered and fidgital. +%% +A solemn, unsmiling, sanctimonious old iceberg +that looked like he was waiting for a vacancy in the Trinity. + -- Mark Twain +%% +A song in time is worth a dime. +%% +A stitch in time saves nine. +%% +A straw vote only shows which way the hot air blows. + -- O'Henry +%% +A student, in hopes of understanding the Lambda-nature, came to Greenblatt. +As they spoke a Multics system hacker walked by. "Is it true", asked the +student, "that PL-1 has many of the same data types as Lisp?" Almost before +the student had finished his question, Greenblatt shouted, "FOO!", and hit +the student with a stick. +%% +A student who changes the course of history is probably taking an exam. +%% +A successful tool is one +that was used to do something undreamed of by its author. + -- S.C. Johnson +%% +A tall, dark stranger will have more fun than you. +%% +A teenage protester named Lil +Cried, "Those Watergate spies make me ill + First they bugged our martinis, + Our bras and bikinis, +And now they are bugging the pill." +%% +A thrice-married gal from L.A. +Said, "My hymen's intact to this day, + 'Cause my first (a shrink) talked of it, + The voyeur only gawked at it, +And my most recent man's a gourmet." +%% +A total abstainer is one who abstains from everything +but abstention, and especially from inactivity in the affairs of others. + -- Ambrose Bierce +%% +A transistor protected by a fast-acting +fuse will protect the fuse by blowing first. +%% +A traveling salesman was driving past a farm when he saw a pig with three +wooden legs executing a magnificent series of backflips and cartwheels. +Intrigued, he drove up to the farmhouse, where he found an old farmer +sitting in the yard watching the pig. + "That's quite a pig you have there, sir" said the salesman. + "Sure is, son," the farmer replied. "Why, two years ago, my daughter +was swimming in the lake and bumped her head and damned near drowned, but that +pig swam out and dragged her back to shore." + "Amazing!" the salesman exlaimed. + "And that's not the only thing. Last fall I was cuttin' wood up on +the north forty when a tree fell on me. Pinned me to the ground, it did. +That pig run up and wiggled underneath that tree and lifted it off of me. +Saved my life." + "Fantastic! the salesman said. But tell me, how come the pig has +three wooden legs?" + The farmer stared at the newcomer in amazement. "Mister, when you +got an amazin' pig like that, you don't eat him all at once." +%% +A true artist will let his wife starve, his children go barefoot, his mother +drudge for his living at seventy, sooner than work at anything but his art. + -- Shaw +%% +A truly wise man never plays leapfrog with a unicorn. +%% +A truly wise woman never plays leapfrog with a unicorn. +%% +A truth that's told with bad intent +Beats all the lies you can invent. + -- William Blake +%% +A university is what a college becomes +when the faculty loses interest in students. + -- John Ciardi +%% +A vacuum is a hell of a lot better +than some of the stuff that nature replaces it with. + -- Tenessee Williams +%% +A vasectomy means never having to say you're sorry. +%% +A very intelligent turtle +Found programming UNIX a hurdle + The system, you see, + Ran as slow as did he, +And that's not saying much for the turtle. +%% +A violent man will die a violent death. + -- Lao Tsu +%% +A visit to a fresh place will bring strange work. +%% +A visit to a strange place will bring fresh work. +%% +A vivid and creative mind characterizes you. +%% +A waist is a terrible thing to mind. + -- Ziggy +%% +A watched clock never boils. +%% +A well adjusted person is one who makes +the same mistake twice without getting nervous. +%% +A well-known friend is a treasure. +%% +A widow is more sought after than an old maid of the same age. + -- Addison +%% +A wise man can see more from a mountain top +than a fool can from the bottom of a well. +%% +A wise man can see more from the bottom +of a well than a fool can from a mountain top. +%% +A wise person makes his own decisions, a weak one obeys public opinion. + -- Chinese proverb +%% +A woman can never be too rich or too thin. +%% +A woman employs sincerity only when every other form of deception has failed. + -- Scott +%% +A woman, especially if she have the misfortune +of knowing anything, should conceal it as well as she can. + -- Jane Austen +%% +A woman forgives the audacity of which +her beauty has prompted us to be guilty. + -- LeSage +%% +A woman is like your shadow; follow her, +she flies; fly from her, she follows. + -- Chamfort +%% +A woman must be a cute, cuddly, naive +little thing -- tender, sweet, and stupid. + -- Adolf Hitler +%% +A woman of generous character will sacrifice her life a thousand times +over for her lover, but will break with him for ever over a question of +pride -- for the opening or the shutting of a door. + -- Stendhal +%% +A woman physician has made the statement that smoking is neither +physically defective nor morally degrading, and that nicotine, even +when indulged to in excess, is less harmful than excessive petting." + -- Purdue Exponent, Jan 16, 1925 +%% +A woman takes off her claim to respect along with her garments. + -- Herodotus +%% + A woman was married to a golfer. One day she asked, "If I were +to die, would you remarry?" + After some thought, the man replied, "Yes, I've been very happy in +this marriage and I would want to be this happy again." + The wife asked, "Would you give your new wife my car?" + "Yes," he replied. "That's a good car and it runs well." + "Well, would you live in this house?" + "Yes, it is a lovely house and you have decorated it beautifully. +I've always loved it here." + "Well, would you give her my golf clubs?" + "No." + "Why not?" + "She's left handed." +%% +A woman who is guided by the head and not by the heart is a social +pestilence: she has all the defects of the passionate and affectionate +woman, with none of her compensations; she is without pity, without +love, without virtue, without sex. + -- Balzac +%% +A woman without a man is like a fish without a bicycle. + -- Gloria Steinem +%% +A woman without a man is like a fish without a bicycle. +Therefore, a man without a woman is like a bicycle without a fish. +%% +A woman's place is in the house... and in the Senate. +%% +A wonderful bird is the pelican. +His mouth can hold more than his belican. + He can take in his beak + Enough food for a week. +I'm darned if I know how the helican. +%% +A word to the wise is enough. + -- Miguel de Cervantes +%% +A would-be disciple came to Nasrudin's hut on the mountain-side. Knowing +that every action of such an enlightened one is significant, the seeker +watched the teacher closely. "Why do you blow on your hands?" "To warm +myself in the cold." Later, Nasrudin poured bowls of hot soup for himself +and the newcomer, and blew on his own. "Why are you doing that, Master?" +"To cool the soup." Unable to trust a man who uses the same process +to arrive at two different results -- hot and cold -- the disciple departed. +%% +A yawn is a silent shout. + -- G.K. Chesterton +%% +A year spent in Artificial Intelligence is enough to make one believe in God. +%% + A young honeymoon couple were touring southern Florida and happened +to stop at one of the rattlesnake farms along the road. After seeing the +sights, they engaged in small talk with the man that handled the snakes. +"Gosh!" exclaimed the new bride. "You certainly have a dangerous job. +Don't you ever get bitten by the snakes?" + "Yes, upon rare occasions," answered the handler. + "Well," she continued, "just what do you do when you're bitten by +a snake?" + "I always carry a razor-sharp knife in my pocket, and as soon as I +am bitten, I make deep criss-cross marks across the fang entry and then +suck the poison from the wound." + "What, uh... what would happen if you were to accidentally *sit* on +a rattler?" persisted the woman. + "Ma'am," answered the snake handler, "that will be the day I learn +who my real friends are." +%% +A young maiden from France was no prude, +She decided to dive in the nude, + But her buddy, behind, + Went out of his mind, +When he noticed where she was tatooed. +%% + A young married couple had their first child. Their original pride +and joy slowly turned to concern however, for after a couple of years the +child had never uttered any form of speech. They hired the best speech +therapists, doctors, psychiatrists, all to no avail. The child simply refused +to speak. One morning when the child was five, while the husband was reading +the paper, and the wife was feeding the dog, the little kid looks up from +his bowl and said, "My cereal's cold." + The couple is stunned. The man, in tears, confronts his son. "Son, +after all these years, why have you waited so long to say something?". + Shrugs the kid, "Everything's been okay 'til now". +%% +A.A.A.A.A.: An organization for drunks who drive. +%% +AAAAAAAAAAAaaaaaaaaaaaaaaaccccccccckkkkkk!!!!!!!!! +You brute! Knock before entering a ladies room! +%% +ABSCOND: + To be unexpectedly called away to the bedside + of a dying relative and miss the return train. +%% +ABSENTEE: + A person with an income who has had the forethought + to remove themselves from the sphere of exaction. +%% +ABSENT: + Exposed to the attacks of friends and + acquaintances; defamed; slandered. +%% +ABSTAINER: + A weak person who yields to the + temptation of denying himself a pleasure. +%% +ABSURDITY: + A statement or belief manifestly + inconsistent with one's own opinion. +%% +ACADEMY: + A modern school where football is taught. +INSTITUTE: + An archaic school where football is not taught. +%% +ACCEPTANCE TESTING: + An unsuccessful attempt to find bugs. +%% +ACCORDION: + A bagpipe with pleats. +%% +ACCURACY: + The vice of being right. +%% +ADA: + Something you need only know the name of to be an Expert in + Computing. Useful in sentences like, "We had better develop + an ADA awareness. + -- "Datamation", January 15, 1984 +%% +ADMIRATION: + Our polite recognition of another's resemblance to ourselves. +%% +ADOLESCENCE: + The stage between puberty and adultery. +%% +ADORE: + To venerate expectantly. +%% +ADULT: + One old enough to know better. +%% +AFTERNOON: + That part of the day we spend worrying + about how we wasted the morning. +%% +AIR: + A nutritious substance supplied by + a bountiful Providence for the fattening of the poor. + -- Ambrose Bierce +%% +ALASKA: + A prelude to "No." +%% +ALBRECHT'S LAW: + Social innovations tend to the level + of minimum tolerable well-being. +%% +ALGORITHM: + Trendy dance for hip programmers. +%% +ALL NEW: + Parts not interchangeable with previous model. +%% +ALLIANCE: + In international politics, the union of two thieves who + have their hands so deeply inserted in each other's pockets + that they cannot separately plunder a third. +%% +ALONE: + In bad company. +%% +AMAZING BUT TRUE... + If all the salmon caught in Canada in one year were laid end to + end across the Sahara Desert, the smell would be absolutely awful. +%% +AMAZING BUT TRUE... + There is so much sand in Northern Africa that if it + were spread out it would completely cover the Sahara Desert. +%% +AMBIDEXTROUS: + Able to pick with equal skill a right-hand pocket or a left. +%% +AMBIGUITY: + Telling the truth when you don't mean to. +%% +AMOEBIT: + Amoeba/rabbit cross; it can multiply + and divide at the same time. +%% +ANDROPHOBIA: + Fear of men. +%% +ANOINT: + To grease a king or other great + functionary already sufficiently slippery. +%% +ANTONYM: + The opposite of the word you're trying to think of. +%% +APHASIA: + Loss of speech in social scientists when asked + at parties, "But of what use is your research?" +%% +APL hackers do it in the quad. +%% +APL is a natural extension of assembler language programming; +...and is best for educational purposes. + -- A. Perlis +%% +APPENDIX: + A portion of a book, for which nobody yet has discovered any use. +%% +APPOINTMENT BOOK: + The reference of last resort when trying to duck undesired + invitations ("Gee, the soonest I can pencil you in is + December, 2004"), or when trying to figure out what the hell + it was you did during the past year. +%% +AQUARIUS (Jan 20 - Feb 18) + You have an inventive mind and are inclined to be progressive. + You lie a great deal. On the other hand, you are inclined to be + careless and impractical, causing you to make the same mistakes over + and over again. People think you are stupid. +%% +AQUARIUS (Jan.20 - Feb.18) + You are the type of person who never has enough money to do what + you want. Don't expect things to get any better today, either. + As a matter of fact they might get worse. Intensify your + relationship with your bank and any friends you have who might be + able to lend you a few bucks. +%% +ARIES (Mar 21 - Apr 19) + You are the pioneer type and hold most people in contempt. You are + quick tempered, impatient, and scornful of advice. You are not + very nice. +%% +ARIES (Mar.21 - Apr.19) + You are a wonderfully interesting, honest, hard-working person + and you should make many new friends, but you won't because you've + got a mean streak in you a mile wide. +%% +ARITHMETIC: + An obscure art no longer practiced in + the world's developed countries. +%% +ARMADILLO: + To provide weapons to a Spanish pickle. +%% +ARMADILLO: + To provide weapons to a spanish pickle. +%% +ASCII a stupid question, you get an EBCDIC answer. +%% +ASCII: + The control code for all beginning programmers and those who would + become computer literate. Etymologically, the term has come down as + a contraction of the often-repeated phrase "ascii and you shall + receive." + -- Robb Russon +%% +ASS: + The masculine of "lass". +%% +ATLANTA: + An entire city surrounded by an airport. +%% +AUCTION: + A gyp off the old block. +%% +AUTHENTIC: + Indubitably true, in somebody's opinion. +%% +AUTOMOBILE: + A four-wheeled vehicle that runs up hills and down pedestrians. +%% +A-Z affectionately, +1 to 10 alphabetically, +from here to eternity without in betweens, +still looking for a custom fit in an off-the-rack world, +sales talk from sales assistants + when all i want to do is lower your resistance, +no rhythm in cymbals no tempo in drums, +love's on arrival, +she comes when she comes, +right on the target but wide of the mark... +%% +Abandon the search for Truth; settle for a good fantasy. +%% +Aberdeen was so small that when the family with the car went +on vacation, the gas station and drive-in theatre had to close. +%% +About all some men accomplish in life is to send a son to Harvard. +%% +About the only thing on a farm that has an easy time is the dog. +%% +About the only thing we have left that actually +discriminates in favor of the plain people is the stork. +%% +About the time we think we can make ends meet, somebody moves the ends. + -- Herbert Hoover +%% +Above all else - sky. +%% +Above all things, reverence yourself. +%% +Absence diminishes mediocre passions and increases +great ones, as the wind blows out candles and fans fires. + -- La Rochefoucauld +%% +Absence in love is like water upon fire; +a little quickens, but much extinguishes it. + -- Hannah More +%% +Absence makes the heart forget. +%% +Absence makes the heart go wander. +%% +Absence makes the heart grow fonder. + -- Sextus Aurelius +%% +Absence makes the heart grow frantic. +%% +Absolutum obsoletum. (If it works, it's out of date.) + -- Stafford Beer +%% +Academicians care, that's who. +%% +Accent on helpful side of your nature. Drain the moat. +%% +Accept people for what they are -- completely unacceptable. +%% +Accident: + A condition in which presence of mind is good, + but absence of body is better. + -- Foolish Dictionary +%% +According to all the latest reports, +there was no truth in any of the earlier reports. +%% +According to experts, the oyster +In its shell - a crustacean cloister - + May frequently be + Either he or a she +Or both, if it should be its choice ter. +%% +According to my best recollection, I don't remember. + -- Vincent "Jimmy Blue Eyes" Alo +%% +According to the latest official figures, +43% of all statistics are totally worthless. +%% +Acid -- better living through chemistry. +%% +Acid absorbs 47 times its own weight in excess Reality. +%% +Acquaintance: + A person whom we know well enough + to borrow from, but not well enough to lend to. + -- Ambrose Bierce +%% +Acting is an art which consists of keeping the audience from coughing. +%% +Actor: I'm a smash hit. Why, yesterday during the last act, I had + everyone glued in their seats! +Oliver Herford: Wonderful! Wonderful! Clever of you to think of + it! +%% +Actors will happen in the best-regulated families. +%% +Actually, my goal is to have a sandwich named after me. +%% +Actually, the probability is 100% that the elevator +will be going in the right direction. Proof by induction: + +N=1. Trivialy true, since both you and the elevator + only have one floor to go to. + +Assume true for N, prove for N+1: + If you are on any of the first N floors, then it is true by the + induction hypothesis. If you are on the N+1st floor, then both you + and the elevator have only one choice, namely down. Therefore, + it is true for all N+1 floors. +QED. +%% +Ad astra per aspera. (To the stars by aspiration.) +%% +Adam's Law: + (1) Women don't know what they want; + they don't like what they have got. + (2) Men know very well what they want; + having got it, they begin to lose interest. +%% +Adde parvum parvo manus acervus erit. +[Add little to little and there will be a big pile.] + -- Ovid +%% +Adding manpower to a late software project makes it later. + -- F. Brooks, "The Mythical Man-Month" +%% +Adhere to your own act, and congratulate yourself if you have done +something strange and extravagant, and broken the monotony of a +decorous age. + -- Ralph Waldo Emerson +%% +Adler's Distinction: + Language is all that separates us from the lower animals, + and from the bureaucrats. +%% +Adults die young. +%% +Advancement in position. +%% +Advertisements contain the only +truths to be relied on in a newspaper. + -- Thomas Jefferson +%% +Advertising Rule: + In writing a patent-medicine advertisement, first convince the + reader that he has the disease he is reading about; secondly, + that it is curable. +%% +Advertising is the most fun of anything you can do with your clothes on. + -- Mary Wells, advertising executive +%% +Advice from an old carpenter: measure twice, saw once. +%% +Advice is a dangerous gift; be cautious about giving and receiving it. +%% +After a number of decimal places, nobody gives a damn. +%% +After a while you learn the subtle difference between holding a hand + and chaining a soul, +And you learn that love doesn't mean leaning and company doesn't mean + security, +And you begin to learn that kisses aren't contracts and presents aren't + promises, +And you begin to accept your defeats with your head up and your eyes open, + with the grace of an adult, not the grief of a child, +And you learn to build all your roads on today because tomorrow's ground + is too uncertain for plans. +After a while you learn that even sunshine burns if you get too much. +So plant your own garden and decorate your own soul, instead of waiting + for someone to bring you flowers. +And you learn that you really can endure... that you really are strong, +And you really do have worth. +%% +After all, all he did was string together +a lot of old, well-known quotations. + -- H.L. Mencken, on Shakespeare +%% +After all is said and done, a hell of a lot more is said than done. +%% +After all, it is only the mediocre who are always at their best. + -- Jean Giraudoux +%% +After all my erstwhile dear, +My no longer cherished, +Need we say it was not love, +Just because it perished? + -- Edna St. Vincent Millay +%% +I have yet to see any problem, however complicated, which, when +you looked at it in the right way, did not become still more complicated. + -- Poul Anderson +%% +After all, what is your hosts' purpose in having a party? Surely not for +you to enjoy yourself; if that were their sole purpose, they'd have simply +sent champagne and women over to your place by taxi. + -- P.J. O'Rourke +%% +After an instrument has been assembled, +extra components will be found on the bench. +%% +After his Ignoble Disgrace, Satan was being expelled from +Heaven. As he passed through the Gates, he paused a moment in thought, +and turned to God and said, "A new creature called Man, I hear, is soon +to be created." + "This is true," He replied. + "He will need laws," said the Demon slyly. + "What! You, his appointed Enemy for all Time! You ask for the +right to make his laws?" + "Oh, no!" Satan replied, "I ask only that he be allowed to make +his own." + It was so granted. +%% +After repeatedly warding off her date's amorous advances during the evening, +the pretty young thing decided to put her foot down: "See here," she shouted +indignantly. "This is positively the last time I'm going to tell you `no'." + "Splendid!" exclaimed her date. "Now we can start making some +progress." +%% +After the game the king and the pawn go in the same box. + -- Italian proverb +%% +After the last of 16 mounting screws has been removed from an access +cover, it will be discovered that the wrong access cover has been removed. +%% +After this was written there appeared a remarkable posthumous memoir that +throws some doubt on Millikan's leading role in these experiments. Harvey +Fletcher (1884-1981), who was a graduate student at the University of Chicago, +at Millikan's suggestion worked on the measurement of electronic charge for +his doctoral thesis, and co-authored some of the early papers on this subject +with Millikan. Fletcher left a manuscript with a friend with instructions +that it be published after his death; the manuscript was published in +Physics Today, June 1982, page 43. In it, Fletcher claims that he was the +first to do the experiment with oil drops, was the first to measure charges on +single droplets, and may have been the first to suggest the use of oil. +According to Fletcher, he had expected to be co-authored with Millikan on +the crucial first article announcing the measurement of the electronic +charge, but was talked out of this by Millikan. + -- Steven Weinberg, "The Discovery of Subatomic Particles" + +Robert Millikan is generally credited with making the first really +precise measurement of the charge on an electron and was awarded the +Nobel Prize in 1923. +%% +After two or three weeks of this madness, you begin to feel As One with +the man who said, "No news is good news." In twenty-eight papers, only +the rarest kind of luck will turn up more than two or three articles of +any interest... but even then the interest items are usually buried +deep around paragraph 16 on the jump (or "Cont. on ...") page... + +The Post will have a story about Muskie making a speech in Iowa. The +Star will say the same thing, and the Journal will say nothing at all. +But the Times might have enough room on the jump page to include a line +or so that says something like: "When he finished his speech, Muskie +burst into tears and seized his campaign manager by the side of the +neck. They grappled briefly, but the struggle was kicked apart by an +oriental woman who seemed to be in control." + +Now that's good journalism. Totally objective; very active and +straight to the point. + -- Hunter S. Thompson, "Fear and Loathing '72" +%% + After watching an extremely attractive maternity-ward patient +earnestly thumbing her way through a telephone directory for several +minutes, a hospital orderly finally asked if he could be of some help. + "No, thanks," smiled the young mother, "I'm just looking for a +name for my baby." + "But the hospital supplies a special booklet that lists hundreds +of first names and their meanings," said the orderly. + "That won't help," said the woman, "my baby already has a first +name." +%% +After your lover has gone you will still have PEANUT BUTTER! +%% +Afternoon very favorable for romance. Try a single person for a change. +%% +Against Idleness and Mischief + +How doth the little busy bee How skillfully she builds her cell! +Improve each shining hour, How neat she spreads the wax! +And gather honey all the day And labours hard to store it well +From every opening flower! With the sweet food she makes. + +In works of labour or of skill In books, or work, or healthful play, +I would be busy too; Let my first years be passed, +For Satan finds some mischief still That I may give for every day +For idle hands to do. Some good account at last. + -- Isaac Watts, 1674-1748 +%% +Age and treachery will always overcome youth and skill. +%% +Age is a tyrant who forbids, +at the penalty of life, all the pleasures of youth. +%% +Agree with them now, it will save so much time. +%% +Ah, but a man's grasp should exceed his reach, +Or what's a heaven for ? + -- Robert Browning, "Andrea del Sarto" +%% +Ah, the Tsar's bazaar's bizarre beaux-arts! +%% +Ahead warp factor one, Mr. Sulu. +%% +Aim for the moon. If you miss, you may hit a star. + -- W. Clement Stone +%% +Air Force Inertia Axiom: + Consistency is always easier to defend than correctness. +%% +Air is water with holes in it. +%% +Alas, I am dying beyond my means. + -- Oscar Wilde [as he sipped champagne on his deathbed] +%% +Alas, how love can trifle with itself! + -- William Shakespeare, "The Two Gentlemen of Verona" +%% +Albert Camus wrote that the only serious question is whether to kill yourself +or not. Tom Robbins wrote that the only serious question is whether time has +a beginning and an end. Camus clearly got up on the wrong side of bed, and +Robbins must have forgotten to set the alarm. + -- Tom Robbins +%% +Alcohol, hashish, prussic acid, strychnine are weak dilutions. +The surest poison is time. + -- Emerson, "Society and Solitude" +%% +Alden's Laws: + (1) Giving away baby clothes and furniture is the major cause + of pregnancy. + (2) Always be backlit. + (3) Sit down whenever possible. +%% +Aleph-null bottles of beer on the wall, +Aleph-null bottles of beer, +You take one down, and pass it around, +Aleph-null bottles of beer on the wall. +%% +Alex Haley was adopted! +%% +Alexander Graham Bell is alive and well +in New York, and still waiting for a dial tone. +%% +Algebraic symbols are used when you don't know what you're talking about. +%% +Algol-60 surely must be regarded as the most +important programming language yet developed. + -- T. Cheatham +%% +Alimony and bribes will engage a large share of your wealth. +%% +Alimony is a system by which, when two people +make a mistake, one of them continues to pay for it. + -- Peggy Joyce +%% +Alimony is the high cost of leaving. +%% +Alive without breath, +As cold as death; +Never thirsty, ever drinking, +All in mail ever clinking. +%% +All I ask is a chance to prove that money can't make me happy. +%% +All I know is what the words know, and dead things, and that +makes a handsome little sum, with a beginning and a middle and +an end, as in the well-built phrase and the long sonata of the dead. + -- Samuel Beckett +%% +All I've got left on the list of desirable vocations is heiress to the +throne of any country in Western Europe and Laurie Anderson. "Be +practical", was the choral reply from the dinner table. Well, Laurie +Anderson is already Laurie Anderson, but I read an article in Harpers +that said there were eleven countries, in the world this is I think, +that have queens as sovereign rulers. That's probably my best shot. +%% +All a man needs out of life is a place to sit 'n' spit in the fire. +%% +All art is but imitation of nature. + -- Lucius Annaeus Seneca +%% +All articles that coruscate with resplendence are not truly auriferous. +%% +All constants are variables. +%% +All flesh is grass. + -- Isaiah +Smoke a friend today. +%% +All generalizations are useless, including this one. +%% +All great discoveries are made by mistake. +%% +All great discoveries are made by mistake. + -- Young +%% +All great ideas are controversial, or have been at one time. +%% + All he did was take the ball and run every time they called his +number -- which came to be more and more often, and in the Super Bowl Thomas +was the whole show. But the season is now over; the purse is safe in the +vault; and Duane Thomas is facing two to twenty for possession. Nobody really +expects him to serve time, but nobody seems to think he'll be playing for +Dallas next year either, and a few sporting people who claim to know how the +NFL works say he won't be playing for ANYBODY next year; that the Commissioner +is outraged at this mockery of all those Government-sponsored "Beware of Dope" +TV shots that dressed up the screen last autumn. + We all enjoyed those spots, but not everyone found them convincing. +Here was a White House directive saying several million dollars would be spent +to drill dozens of Name Players to stare at the camera and try to stop grinding +their teeth long enough to say they hate drugs of any kind... and then the best +running back in the world turns out to be a goddamn uncontrollable drugsucker. + But not for long. There is not much room for freaks in the National +Football League. Joe Namath was saved by the simple blind luck of getting +drafted by a team in New York City, a place where social outlaws are not +always viewed as criminals. But Namath would have had a very different trip +if he'd been drafted by the St. Louis Cardinals. + -- Hunter S. Thompson +%% +All heiresses are beautiful. + -- John Dryden +%% +All his life he has looked away... to the horizon, to the sky, +to the future. Never his mind on where he was, on what he was doing. + -- Yoda +%% +All hope abandon, ye who enter here! + -- Dante Alighieri +%% +All is fear in love and war. +%% +All is well that ends well. + -- John Heywood +%% +All laws are simulations of reality. + -- John C. Lilly +%% +All life evolves by the differential survival of replicating entities. + -- Dawkins +%% +All men know the utility of useful things; +but they do not know the utility of futility. + -- Chuang-tzu +%% +All men profess honesty as long as they can. +To believe all men honest would be folly. +To believe none so is something worse. + -- John Quincy Adams +%% +All most people ask of life is a constant +and exaggerated sense of their own importance. +%% +All most people want is a little more than they'll ever get. +%% +All my friends and I are crazy. +That's the only thing that keeps us sane. +%% +All my friends are getting married, +Yes, they're all growing old, +They're all staying home on the weekend, +They're all doing what they're told. +%% +All of the animals except man know that +the principal business of life is to enjoy it. +%% +All parts should go together without forcing. You must remember that the +parts you are reassembling were disassembled by you. Therefore, if you +can't get them together again, there must be a reason. By all means, do +not use a hammer. + -- IBM maintenance manual, 1925 +%% +All people are born alike -- except Republicans and Democrats. + -- Groucho Marx +%% +All possibility of understanding is rooted in the ability to say no. + -- Susan Sontag +%% +All programmers are playwrights and all computers are lousy actors. +%% +All progress is based upon a universal innate desire on the +part of every organism to live beyond its income. + -- Samuel Butler +%% +All religions issue Bibles against Satan, and say the most +injurious things against him, but we never hear his side. + -- Mark Twain +%% +All science is either physics or stamp collecting. + -- Ernest Rutherford +%% +All seems condemned in the long run +to approximate a state akin to Gaussian noise. + -- James Martin +%% +All that glitters has a high refractive index. +%% + All that you touch, And all you create, + All that you see, And all you destroy, + All that you taste, All that you do, + All you feel, And all you say, + And all that you love, All that you eat, + And all that you hate, And everyone you meet, + All you distrust, All that you slight, + All you save, And everyone you fight, + And all that you give, And all that is now, + And all that you deal, And all that is gone, + All that you buy, And all that's to come, + Beg, borrow or steal, And everything under the sun is + in tune, + But the sun is eclipsed + By the moon. + +There is no dark side of the moon... really... matter of fact it's all dark. + -- Pink Floyd, "Dark Side of the Moon" +%% +All the evidence concerning the universe +has not yet been collected, so there's still hope. +%% +All the girls in France, do a hookie-kookie dance, +And you know the way they shake, is enough to fry a snake, +And the snake they fry, is enough to tell a lie, +And the lie they tell, is enough to go to +Hello, operator, give me number nine, +If you disconnect me, I'll kick you in the +Behind the 'frigerator, there was a piece of glass, +If you do not pick it up, I'll kick you in the +Ask me no more questions, tell me no more lies, +This is what Lulu told me, just before she died. +She had a little brother, she named him Tiny Tim, +She put him in the potty, to see if he could swim. +He swam down to the bottom, he swam up to the top, +Lulu got disgusted, and flushed him down the pot. + -- Princess +%% +All the lines have been written There's been Sandburg, +It's sad but it's true Keats, Poe and McKuen +With all the words gone, They all had their day +What's a young poet to do? And knew what they're doin' + +But of all the words written The bird is a strange one, +And all the lines read, So small and so tender +There's one I like most, Its breed still unknown, +And by a bird it was said! Not to mention its gender. + +It reminds me of days of So what is this line +Both gloom and of light. Whose author's unknown +It still lifts my spirits And still makes me giggle +And starts the day right. Even now that I'm grown? + +I've read all the greats +Both starving and fat, +But none was as great as +"I tot I taw a puddy tat." + -- Etta Stallings, "An Ode To Childhood" +%% +All the really good ideas I ever had came to me while I was milking a cow. + -- Grant Wood +%% +All the simple programs have been written. +%% +All the troubles you have will pass away very quickly. +%% +All the world's a stage and most of us are desperately un-rehearsed. + -- Sean O'Casey +%% +All things are possible except skiing through a revolving door. +%% +All things are possible except skiing thru a revolving door. +%% +All things being equal, you are bound to lose. +%% +All things that are, are with more spirit chased than enjoyed. + -- Shakespeare, "Merchant of Venice" +%% +All this big deal about white collar crime -- what's WRONG with white collar +crime? Who enjoys his job today? You? Me? Anybody? The only satisfying +part of any job is coffee break, lunch hour and quitting time. Years ago +there was at least the hope of improvement -- eventual promotion -- more +important jobs to come. Once you can be sold the myth that you may make +president of the company you'll hardly ever steal stamps. But nobody +believes he's going to be president anymore. The more people change jobs +the more they realize that there is a direct connection between working for +a living and total stupefying boredom. So why NOT take revenge? You're not +going to find ME knocking a guy because he pads an expense account and his +home stationery carries the company emblem. Take away crime from the white +collar worker and you will rob him of his last vestige of job interest. + -- J. Feiffer +%% +All this wheeling and dealing around, why, it isn't for money, +it's for fun. Money's just the way we keep score. + -- Henry Tyroon +%% +All true wisdom is found on T-shirts. +%% +All warranty and guarantee clauses +become null and void upon payment of invoice. +%% +All who joy would win Must share it -- +Happiness was born a twin. + -- Lord Byron +%% +All your files have been destroyed (sorry). Paul. +%% +Allen's Axiom: + When all else fails, read the instructions. +%% +All's well that ends. +%% +Almost anything derogatory you could say +about today's software design would be accurate. + -- K.E. Iverson +%% +Always borrow money from a pessimist; he doesn't expect to be paid back. +%% +Always do right. +This will gratify some people and astonish the rest. + -- Mark Twain +%% +Always draw your curves, then plot your reading. +%% +Always leave room to add an explanation if it doesn't work out. +%% +Always store beer in a dark place. +%% +Always the dullness of the fool is the whetstone of the wits. + -- William Shakespeare, "As You Like It" +%% +Always there remain portions of our heart +into which no one is able to enter, invite them as we may. +%% +Always think of something new; this +helps you forget your last rotten idea. + -- Seth Frankel +%% +Ambition is a poor excuse for not having sense enough to be lazy. + -- Charlie McCarthy +%% +America, I'm putting my queer shoulder to the wheel. + -- Allen Ginsberg +%% +America: born free and taxed to death. +%% +America is the country where you buy a lifetime +supply of aspirin for one dollar, and use it up in two weeks. +%% +America may be unique in being a country which has leapt +from barbarism to decadence without touching civilization. + -- John O'Hara +%% +American by birth; Texan by the grace of God. +%% +American cars are made shoddily... +Cars made overseas are far superior. + -- Sen. Barry Goldwater +%% +American culture is based on the automobile, and any young man of promise +is going to own one and want to travel great distances in it. Consequently, +any young woman of aspiration should expect to spend most of her vacations +in a car, probing into unfamiliar corners. She is not required to know how +to drive but she will certainly be expected to read the road map while her +husband drives, and if she can't, or if she's abnormally slow in giving him +help, she's bound to cause trouble. Therefore, you'd think that colleges +which train the bright young women who're going to marry the bright young +men who are going to own the Cadillacs that roar back and forth across this +continent would teach the girls to read maps. None do. They teach a hundred +other useless things, but never a word about the one that will cause the +greatest friction. + -- James Michener, "Space" +%% +Americans are people who insist on living in the present, tense. +%% +Americans' greatest fear is that America +will turn out to have been a phenomenon, not a civilization. + -- Shirley Hazzard, "Transit of Venus" +%% +America's best buy for a quarter is a telephone call to the right person. +%% +Amnesia used to be my favorite word, but then I forgot it. +%% +Among the lucky, you are the chosen one. +%% +An American is a man with two arms and four wheels. + -- A Chinese child +%% +An American scientist once visited the offices of the great Nobel prize +winning physicist, Niels Bohr, in Copenhagen. He was amazed to find that +over Bohr's desk was a horseshoe, securely nailed to the wall, with the +open end up in the approved manner (so it would catch the good luck and not +let it spill out). The American said with a nervous laugh, + "Surely you don't believe the horseshoe will bring you good luck, +do you, Professor Bohr? After all, as a scientist --" +Bohr chuckled. + "I believe no such thing, my good friend. Not at all. I am +scarcely likely to believe in such foolish nonsense. However, I am told +that a horseshoe will bring you good luck whether you believe in it or not." +%% +An American's a person who isn't afraid to criticize +the president but is always polite to traffic cops. +%% +An Englishman never enjoys himself, except for a noble purpose. + -- A.P. Herbert +%% +An Hacker there was, one of the finest sort +Who controlled the system; graphics was his sport. +A manly man, to be a wizard able; +Many a protected file he had sitting on his table. +His console, when he typed, a man might hear +Clicking and feeping wind as clear, +Aye, and as loud as does the machine room bell +Where my lord Hacker was Prior of the cell. +The Rule of good St Savage or St Doeppnor +As old and strict he tended to ignore; +He let go by the things of yesterday +And took the modern world's more spacious way. +He did not rate that text as a plucked hen +Which says that Hackers are not holy men. +And that a hacker underworked is a mere +Fish out of water, flapping on the pier. +That is to say, a hacker out of his cloister. +That was a text he held not worth an oyster. +And I agreed and said his views were sound; +Was he to study till his head wend round +Poring over books in the cloisters? Must he toil +As Andy bade and till the very soil? +Was he to leave the world upon the shelf? +Let Andy have his labor to himself! + -- Chaucer + [well, almost. Ed.] +%% +An adequate bootstrap is a contradiction in terms. +%% +An algorithm must be seen to be believed. + -- D.E. Knuth +%% +An ambassador is an honest man sent abroad +to lie and intrigue for the benefit of his country. + -- Henry Wotton +%% +An amendment to a motion may be amended, but an amendment to an amendment +to a motion may not be amended. However, a substitute for an amendment to +and amendment to a motion may be adopted and the substitute may be amended. + -- The Montana legislature's contribution to the English + language. +%% +An angst-ridden amorist, Fred, +Saw sartorial changes ahead. + His mind kept on ringing + With fishy girls singing; +Soft fruit also filled him with dread. + -- J. Walker, "The Love Song Of J. Alfred Prufrock" +%% +An aphorism is never exactly true; +it is either a half-truth or one-and-a-half truths. + -- Karl Kraus +%% +An apple a day makes 365 apples a year. +%% +An architect fellow named Yoric +Could, when feeling euphoric, + Display for selection + Three kinds of erection- +Corinthian, ionic, and doric. +%% +An artist who lived in Australia +Once painted his ass like a Dahlia. + The drawing was fine, + The colour - divine, +The scent - ah, that was a failia. +%% +An atheist is a man with no invisible means of support. +%% +An atom-blaster is a good weapon, but it can point both ways. + -- Isaac Asimov +%% +An attachment a la Plato +for a bashful young potato +or a, not too French, french bean +must excite your languid spleen. +For, if you walk down Picadilly +with a poppy or lily +in your medieval hand, +every one will say, +as you walk your flowery way; +"If this young man is content, +with a vegetable love +which would certainly not content me. +Why, what a very pure young man +this pure young man must be!" + -- W.S. Gilbert, "Patience" + [The subject of the humour is, of course, Oscar Wilde] +%% +An avocado-tone refrigerator would look good on your resume. +%% +An egghead is one who stands firmly on both feet, +in mid-air, on both sides of an issue. + -- Homer Ferguson +%% +An elephant is a mouse with an operating system. +%% +An encounter with a beautiful woman is good medicine for the well organized +logical mind -- a little jolt never hurt. Note that the anarchists have +been saying this for years about the A-bomb and civilization. + -- Encyclopadia Apocryphia +%% +An engineer is someone who does list processing in FORTRAN. +%% +An evil mind is a great comfort. +%% +An expert is a person who avoids the small errors +as he sweeps on to the grand fallacy. + -- Benjamin Stolberg +%% +An expert is one who knows more and more about less +and less until he knows absolutely nothing about everything. +%% +An eye in a blue face +Saw an eye in a green face. +"That eye is like this eye" +Said the first eye, +"But in low place, +Not in high place." +%% +An honest tale speeds best being plainly told. + -- William Shakespeare, "Henry VI" +%% +An idea is not responsible for the people who believe in it. +%% +An idle mind is worth two in the bush. +%% +An infallible method of concilliating a tiger +is to allow oneself to be devoured. + -- Konrad Adenauer +%% +An investment in knowledge always pays the best interest. + -- Benjamin Franklin +%% +An old Jewish man reads about Einstein's theory of relativity +in the newspaper and asks his scientist grandson to explain it to him. + "Well, zayda, it's sort of like this. Einstein says that if +you're having your teeth drilled without Novocain, a minute seems like +an hour. But if you're sitting with a beautiful woman on your lap, an +hour seems like a minute." + The old man considers this profound bit of thinking for a +moment and says, "And from this he makes a living?" + -- Arthur Naiman +%% +An optimist is a guy that has never had much experience. + -- Don Marquis +%% +An optimist is a man who looks forward to marriage. +A pessimist is a married optimist. +%% +Booker's Law: + An ounce of application is worth a ton of abstraction. +%% +An ounce of clear truth is worth a pound of obfuscation. +%% +An ounce of hypocrisy is worth a pound of ambition. + -- Michael Korda +%% +Anarchy may not be a better form of government, +but it's better than no government at all. +%% +And I alone am returned to wag the tail. +%% +And I suppose the little things are harder to get used to than the big +ones. The big ones you get used to, you make up your mind to them. The +little things come along unexpectedly, when you aren't thinking about +them, aren't braced against them. + -- Marion Zimmer Bradley, "The Forbidden Tower" +%% +And did those feet, in ancient times, +Walk upon England's mountains green? +And was the Holy Lamb of God +In England's pleasant pastures seen? +And did the Countenance Divine +Shine forth upon these crowded hills? +And was Jerusalem builded here +Among these dark satanic mills? + +Bring me my bow of burning gold! +Bring me my arrows of desire! +Bring me my spears! O clouds unfold! +Bring me my chariot of fire! +I shall not cease from mental fight, +Nor shall my sword rest in my hand, +Till we have built Jerusalem +In England's green and pleasant land. + -- William Blake, "Jerusalem" +%% +And ever has it been known that +love knows not its own depth until the hour of separation. + -- Kahlil Gibran +%% +And here I wait so patiently +Waiting to find out what price +You have to pay to get out of +Going thru all of these things twice + -- Dylan, "Memphis Blues Again" +%% +And if sometime, somewhere, someone asketh thee, +"Who kilt thee?", tell them it 'twas the Doones of Bagworthy! +%% +And malt does more than Milton can to justify God's ways to man. + -- A.E. Housman +%% +And miles to go before I sleep. +%% +And now for something completely the same. +%% +And now your toner's toney, Disk blocks aplenty +And your paper near pure white, Await your laser drawn lines, +The smudges on your soul are gone Your intricate fonts, +And your output's clean as light.. Your pictures and signs. + +We've labored with your father, Your amputative absence +The venerable XGP, Has made the Ten dumb, +But his slow artistic hand, Without you, Dover, +Lacks your clean velocity. We're system untounged- + +Theses and papers DRAW Plots and TEXage +And code in a queue Have been biding their time, +Dover, oh Dover, With LISP code and programs, +We've been waiting for you. And this crufty rhyme. + +Dover, oh Dover, Dover, oh Dover, arisen from dead. +We welcome you back, Dover, oh Dover, awoken from bed. +Though still you may jam, Dover, oh Dover, welcome back to the Lab. +You're on the right track. Dover, oh Dover, we've missed your clean + hand... +%% +And on the seventh day, He exited from append mode. +%% +And that's the way it is... + -- Walter Cronkite +%% +And the French medical anatomist Etienne Serres really did argue that +black males are primitive because the distance between their navel and +penis remains small (relative to body height) throughout life, while +white children begin with a small separation but increase it during +growth -- the rising belly button as a mark of progress. + -- S.J. Gould, "Racism and Recapitulation" +%% +And the silence came surging softly backwards +When the plunging hooves were gone... + -- Walter de La Mare, "The Listeners" +%% +And this is a table ma'am. What in essence it consists of is a horizontal +rectilinear plane surface maintained by four vertical columnar supports, +which we call legs. The tables in this laboratory, ma'am, are as advanced +in design as one will find anywhere in the world. + -- Michael Frayn, "The Tin Men" +%% +And this is good old Boston, +The home of the bean and the cod, +Where the Lowells talk only to Cabots, +And the Cabots talk only to God. +%% +And tomorrow will be like today, only more so. + -- Isaiah 56:12, New Standard Version +%% +And what accomplished villains these old engineers were! What diabolical +ways to sabotage they found! Nikolai Karlovich von Meck, of the People's +Comissariat of Railroads ... would hold forth for hours on end about the +economic problems involved in the construction of socialism, and he loved to +give advice. One such pernicious piece of advice was to increase the size +of freight trains and not worry about heavier than average loads. The GPU +exposed van Meck, and he was shot: his objective had been to wear out rails +and roadbeds, freight cars and locomotives, so as to leave the Republic +without railroads in case of foreign military intervention! When, not long +afterward, the new People's Commissar of Railroads ordered that average +loads should be increased, and even doubled and tripled them, the malicious +engineers who protested became known as limiters ... they were rightly +shot for their lack of faith in the possibilities of socialist transport. + -- Aleksandr I. Solzhenitsyn, "The Gulag Archipelago" +%% + "And what will you do when you grow up to be as big as me?" +asked the father of his little son. + "Diet." +%% +And yet I should have dearly liked, I own, to have touched her lips; to +have questioned her, that she might have opened them; to have looked upon +the lashes of her downcast eyes, and never raised a blush; to have let +loose waves of hair, an inch of which would be a keepsake beyond price: +in short, I should have liked, I do confess, to have had the lightest +license of a child, and yet been man enough to know its value. + -- Charles Dickens +%% +And you can't get any Watney's Red Barrel, +because the bars close every time you're thirsty... +%% +And... What ever became of Sweet Jane? + She's lost her sparkle, you see she isn't the same. + Livin' on reds, vitamin C, and cocaine + All a friend can say is "Ain't it a shame?" + -- The Grateful Dead +%% +Andrea's Admonition: + Never bestow profanity upon a driver who has wronged you. + If you think his window is closed and he can't hear you, + it isn't and he can. +%% +Anger is momentary madness. + -- Horace +%% +Anger kills as surely as the other vices. +%% +Animals can be driven crazy by putting too many in too small a pen. +Homo sapiens is the only animal that voluntarily does this to himself. + -- Lazarus Long +%% +Another day, another dollar. + -- Vincent J. Fuller + [defense lawyer for John Hinckley, upon Hinckley's acquittal] +%% +Another good night not to sleep in a eucalyptus tree. +%% +Another greeting card category consists of those persons who send out +photographs of their families every year. In the same mail that brought the +greetings from Marcia and Philip, my friend found such a conversation piece. +"My God, Lida is enormous!" she exclaimed. I don't know why women want to +record each year, for two or three hundred people to see, the ravages wrought +upon them, their mates, and their progeny by the artillery of time, but +between five and seven per cent of Christmas cards, at a rough estimate, are +family groups, and even the most charitable recipient studies them for little +signs of dissolution or derangement. Nothing cheers a woman more, I am afraid, +than the proof that another woman is letting herself go, or has lost control +of her figure, or is clearly driving her husband crazy, or is obviously +drinking more than is good for her, or still doesn't know what to wear. +Middle-aged husbands in such photographs are often described as looking +"young enough to be her son," but they don't always escape so easily, and a +couple opening envelopes in the season of mercy and good will sometimes handle +a male friend or acquaintance rather sharply. "Good Lord!" the wife will say. +"Frank looks like a sex-crazed shotgun slayer, doesn't he?" "Not to me," the +husband may reply. "to me he looks more like a Wilkes-Barre dentist who is +being sought by the police in connection with the disappearance of a choir +singer." + -- James Thurber, "Merry Christmas" +%% +Another megabytes the dust. +%% +Another such victory over the Romans, and we are undone. + -- Pyrrhus +%% + Answers to Last Fortunes' Questions: +1) None. (Moses didn't have an ark). +2) Your mother, by the pigeonhole principle. +3) You don't know. Neither does your boss. +4) Who cares? +5) 6 (or maybe 4, or else 3). Mr. Alfred J. Duncan of Podunk, Montana, + submitted an interesting solution to Problem 5. Unfortunately, I lost it. +6) I know the answer to this one, but I'm not telling! Suffer! Ha-ha-ha!! +7) There is an interesting solution to this problem on page 10,953 of my + book, which you can pick up for $23.95 at finer bookstores and bathroom + supply outlets (or 99 cents at the table in front of Papyrus Books). +%% +Anthony's Law of the Workshop: + Any tool when dropped, will roll into the least accessible + corner of the workshop. + +Corollary: + On the way to the corner, any dropped tool will first strike + your toes. +%% +Any circuit design must contain at least one part which is obsolete, two parts +which are unobtainable, and three parts which are still under development. +%% +Any clod can have the facts, but having opinions is an art. + -- Charles McCabe +%% +Any coward can sit in his home and criticize a pilot for flying into a +mountain in a fog. But I would rather, by far, die on a mountainside +than in bed. What kind of man would live where there is no daring? +And is life so dear that we should blame men for dying in adventure? +Is there a better way to die? + -- Charles Lindbergh +%% +Any excuse will serve a tyrant. + -- Aesop +%% +Any fool can paint a picture, +but it takes a wise person to be able to sell it. +%% +Any fool can tell the truth, +but it requires a man of some sense to know how to lie well. +%% +Any given program, when running, is obsolete. +%% +Any given program will expand to fill available memory. +%% +Any instrument when dropped will roll into the least accessible corner. +%% +Any man can work when every stroke of his hand brings down the fruit +rattling from the tree to the ground; but to labor in season and out +of season, under every discouragement, by the power of truth -- that +requires a heroism which is transcendent. + -- Henry Ward Beecher +%% +Any man who hates dogs and babies can't be all bad. + -- Leo Rosten, on W.C. Fields +%% +Any member introducing a dog into the Society's premises shall be +liable to a fine of one pound. Any animal leading a blind person shall +be deemed to be a cat. + -- Rule 46, Oxford Union Society, London +%% +Any philosophy that can be put "in a nutshell" belongs there. + -- Harris's Law +%% +Any president should have the right to shoot +at least two people a year without explanation. + -- Herbert Hoover, discussing the press +%% +Any priest or shaman must be presumed guilty until proved innocent. + -- Lazarus Long +%% +Any program which runs right is obsolete. +%% +Any programming language is at its best before it is implemented and used. +%% +Any road followed to its end leads precisely nowhere. +Climb the mountain just a little to test it's a mountain. +From the top of the mountain, you cannot see the mountain. + -- Bene Gesserit proverb, "Dune" +%% +Any small object that is accidentally +dropped will hide under a larger object. +%% +Any sufficiently advanced bug becomes a feature. +%% +Any sufficiently advanced technology is +indistinguishable from a rigged demo. +%% +Any sufficiently advanced technology is indistinguishable from magic. + -- Arthur Clarke +%% +Any two philosophers can tell each other all they know in two hours. + -- Oliver Wendell Holmes, Jr. +%% +Any woman is a volume if one knows how to read her. +%% +Anybody can win, unless there happens to be a second entry. +%% +Anybody who doesn't cut his speed at the +sight of a police car is probably parked. +%% +Anybody with money to burn will easily find someone to tend the fire. +%% +Anyone can hold the helm when the sea is calm. + -- Publilius Syrus +%% +Anyone who cannot cope with mathematics is not fully human. +At best he is a tolerable subhuman who has learned to wear shoes, +bathe and not make messes in the house. + -- Lazarus Long +%% +Anyone who goes to a psychiatrist ought to have his head examined. + -- Samuel Goldwyn +%% +Anyone who has had a bull by the tail +knows five or six more things than someone who hasn't. + -- Mark Twain +%% +Anyone who imagines that all fruits ripen at the same time +as the strawberries, knows nothing about grapes. + -- Philippus Paracelsus +%% +Anyone who is capable of getting themselves made President +should on no account be allowed to do the job. + -- The Hitchhiker's Guide to the Galaxy +%% +Anything cut to length will be too short. +%% + "Anything else you wish to draw to my attention, Mr. Holmes ?" + "The curious incident of the stable dog in the nightime." + "But the dog did nothing in the nighttime." + "That was the curious incident." + -- A. Conan Doyle, "Silver Blaze" +%% +Anything free is worth what you'll pay for it. +%% +Anything is good and useful if it's made of chocolate. +%% +Anything is good if it's made of chocolate. +%% +Anything is possible, unless it's not. +%% +Anything labeled "NEW" and/or "IMPROVED" isn't. +The label means the price went up. +The label "ALL NEW", "COMPLETELY NEW", or "GREAT NEW" +means the price went way up. +%% +Anything worth doing is worth overdoing. +%% +Anytime things appear to be going better, you've overlooked something. +%% +Anyway, I keep picturing all these little kids playing some game in this +big field of rye and all. Thousands of little kids, and nobody's around -- +nobody big, I mean -- except me. And I'm standing on the edge of some crazy +cliff. What I have to do, I have to catch everybody if they start to go +over the cliff -- I mean if they're running and they don't look where they're +going I have to come out from somewhere and catch them. That's all I'd do +all day. I'd just be the catcher in the rye. I know it; I know it's crazy, +but that's the only thing I'd really like to be. I know it's crazy. + -- J.D. Salinger, "Catcher in the Rye" +%% +Appearances often are deceiving. + -- Aesop +%% +April is the cruellest month... + -- Thomas Stearns Eliot +%% +Are there those in the land of the brave +Who can tell me how I should behave + When I am disgraced + Because I erased + A file I intended to save? +%% +Are we not men? +%% +Are we running light with overbyte? +%% +Are you making all this up as you go along? +%% +Are you sure the back door is locked? +%% +Are your glasses mended with a strip of masking tape right over your nose? +Do you put pennies in the slots in your penny loafers? +Does your bow-tie flash "hey you kid" in red neon at parties? +Do you think pizza before noon is unhealthy? +Do you use the "greasy kid's stuff" to stick down your cowlick? +Do you wear a "nerd-pack" in your shirt pocket to keep the dozen + or so pencils from marking the cloth? +Do you think Mary Jane is somebody's name? +Is illegal fishing is something only a daring criminal would do? +Is Batman your hero? Superman? Green Lantern? The Shadow? +Do you think girls who kiss on the first date are loose? + + Rate yourself on the nerd-o-matic scale. (1 point for each YES answer) +0-2 -- You are really hip, a real cool cat, a hoopy frood. +3-5 -- There is hope for you yet. +6-7 -- Uh-oh, trouble in River City. +8-10 -- Your immortal soul is in peril. +11+ -- Does suicide seem attractive? +%% +Argue for your limitations, and sure enough, they're yours. + -- Messiah's Handbook : Reminders for the Advanced Soul +%% +Arguments are extremely vulgar, for everyone +in good society holds exactly the same opinion. + -- O. Wilde +%% +Arguments with furniture are rarely productive. +%% +Arithmetic is being able to count up to twenty without taking off your shoes. + -- Mickey Mouse +%% +Armor's Axiom: + Virtue is the failure to achieve vice. +%% +Armstrong's Collection Law: + If the check is truly in the mail, + it is surely made out to someone else. +%% +Arnold's Laws of Documentation: + 1.) If it should exist, it doesn't. + 2.) If it does exist, it's out of date. + 3.) Only documentation for useless programs transcends the + first two laws. +%% +Arrakis teaches the attitude of the knife - chopping off what's +incomplete and saying: "Now it's complete because it's ended here." + -- Muad'dib, "Dune" +%% +Art is a jealous mistress. + -- Ralph Waldo Emerson +%% +Art is a lie which makes us realize the truth. + -- Picasso +%% +Art is the tree of life. Science is the tree of death. +%% +Arthur's Laws of Love: + 1. People to whom you are attracted invariably think you + remind them of someone else. + 2. The love letter you finally got the courage to send will + be delayed in the mail long enough for you to make a fool + of yourself in person. +%% +Article the Third: + Where a crime of the kidneys has been committed, the accused should + enjoy the right to a speedy diaper change. Public announcements and + guided tours of the aforementioned are not necessary. +Article the Fourth: + The decision to eat strained lamb or not should be with the "feedee" + and not the "feeder". Blowing the strained lamb into the feeder's + face should be accepted as an opinion, not as a declaration of war. +Article the Fifth: + Babies should enjoy the freedom to vocalize, whether it be in church, + a public meeting place, during a movie, or after hours when the + lights are out. They have not yet learned that joy and laughter have + to last a lifetime and must be conserved. + -- Erma Bombeck, "A Baby's Bill of Rights" +%% +Artistic ventures highlighted. Rob a museum. +%% +As Gen. de Gaulle occassionally acknowledges America to be the daughter +of Europe, so I am pleased to come to Yale, the daughter of Harvard. + -- J.F. Kennedy +%% +As I was passing Project MAC, +I met a Quux with seven hacks. +Every hack had seven bugs; +Every bug had seven manifestations; +Every manifestation had seven symptoms. +Symptoms, manifestations, bugs, and hacks, +How many losses at Project MAC? +%% +As Will Rogers would have said, +"There is no such things as a free variable." +%% +As Zeus said to Narcissus, "Watch yourself." +%% +As a computer, I find your faith in technology amusing. +%% +As crazy as hauling timber into the woods. + -- Quintus Horatius Flaccus (Horace) +%% +As far as the laws of mathematics refer to reality, they are not certain; +and as far as they are certain, they do not refer to reality. + -- Einstein +%% +As far as we know, our computer has never had an undetected error. + -- Weisert +%% +As flies to wanton boys are we to the gods; they kill us for their sport. + -- Shakespeare, "King Lear" +%% +As for the women, though we scorn and flout 'em, +We may live with, but cannot live without 'em. + -- Frederic Reynolds +%% +As goatherd learns his trade by goat, so writer learns his trade by wrote. +%% +As in certain cults it is possible to +kill a process if you know its true name. + -- Ken Thompson and Dennis M. Ritchie +%% +As long as the answer is right, who cares if the question is wrong? +%% +As long as there are ill-defined goals, bizarre bugs, and unrealistic +schedules, there will be Real Programmers willing to jump in and Solve +The Problem, saving the documentation for later. +%% +As long as war is regarded as wicked, it will always have its fascination. +When it is looked upon as vulgar, it will cease to be popular. + -- Oscar Wilde +%% +As of next Thursday, UNIX will be flushed in favor of TOPS-10. +Please update your programs. +%% +As of next Tuesday, C will be flushed in favor of COBOL. +Please update your programs. +%% +As of next week, passwords will be entered in Morse code. +%% +As soon as we started programming, we found to our surprise that it wasn't +as easy to get programs right as we had thought. Debugging had to be +discovered. I can remember the exact instant when I realized that a large +part of my life from then on was going to be spent in finding mistakes in +my own programs. + -- Maurice Wilkes, designer of EDSAC, on programming, 1949 +%% +As the poet said, "Only God can make a tree" -- probably +because it's so hard to figure out how to get the bark on. + -- Woody Allen +%% +As the trials of life continue to take their toll, +remember that there is always a future in Computer Maintenance. + -- Deteriorata +%% +As well look for a needle in a bottle of hay. + -- Miguel de Cervantes +%% +As with most fine things, chocolate has its season. There is a simple memory +aid that you can use to determine whether it is the correct time to order +chocolate dishes: Any month whose name contains the letter A, E, or U is the +proper time for chocolate. + -- Sandra Boynton, "Chocolate: The Consuming Passion" +%% +Ashes to ashes, dust to dust, +If God won't have you, the devil must. +%% +Ask not for whom the Bell tolls, and you +will pay only the station-to-station rate. + -- Howard Kandel +%% +Ask not for whom the telephone bell tolls... +if thou art in the bathtub, it tolls for thee. +%% +Ask not what's inside your head, but what your head's inside of. + -- J.J. Gibson +%% +Ask your boss to reconsider -- +It's so difficult to take "Go to hell" for an answer. +%% +Ask yourself whether you are happy and you cease to be so. + -- John Stuart Mill +%% +Assembly language experience is [important] for the maturity +and understanding of how computers work that it provides. + -- D. Gries +%% +Astrology... just a bunch of Taurus. +%% +Asynchronous inputs are at the root of our race problems. + -- D. Winker and F. Prosser +%% +At ebb tide I wrote a line upon the sand, and gave it all my heart and all +my soul. At flood tide I returned to read what I had inscribed and found my +ignorance upon the shore. + -- Kahlil Gibran +%% +At least I thought I was dancing, 'til somebody stepped on my hand. + -- J.B. White +%% +At once it struck me what quality went to form a man of achievement, +especially in literature, and which Shakespeare possessed so enormously +-- I mean negative capability, that is, when a man is capable of being +in uncertainties, mysteries, doubts, without any irritable reaching +after fact and reason. + -- John Keats +%% +At the end of all civilization +Is the planet Terminus's location. + There's a girl there whose feat, + Without stone or concrete, +Nonetheless, was to lay the Foundation. +%% +At the end of your life there'll be a good rest, +and no further activities are scheduled. +%% +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. +%% +At the source of every error which is blamed on the computer you will find +at least two human errors, including the error of blaming it on the computer. +%% +At these prices, I lose money -- but I make it up in volume. + -- Peter G. Alaquon +%% +At times discretion should be thrown aside, +and with the foolish we should play the fool. + -- Menander +%% +Atheism is a non-prophet organization. +%% +Atlee is a very modest man. And with reason. + -- Winston Churchill +%% +Attractive bisexual young woman seeks same for high mellow times. +%% +Audacity, and again, audacity, and always audacity. + -- G.J. Danton +%% +Auribus teneo lupum. +[I hold a wolf by the ears.] +%% +Avec! +%% +Avert misunderstanding by calm, poise, and balance. +%% +Avoid Quiet and Placid persons unless you are in Need of Sleep. +%% +Avoid gunfire in the bathroom tonight. +%% +Avoid reality at all costs. +%% +Avoid strange women and temporary variables. +%% +BACCHUS: + A convenient deity invented by the ancients + as an excuse for getting drunk. +%% +BACHELOR: + A guy who is footloose and fiancee-free. +%% +BACHELOR: + A man who chases women and never Mrs. one. +%% +BACKWARD CONDITIONING: + Putting saliva in a dog's mouth in an attempt to make a bell ring. +%% +BAD CRAZINESS, MAN!!! +%% +BALLISTOPHOBIA: + Fear of bullets; +OTOPHOBIA: + Fear of opening one's eyes. +PECCATOPHOBIA: + Fear of sinning. +TAPHEPHOBIA: + Fear of being buried alive. +SITOPHOBIA: + Fear of food. +TRICHOPHOBIA: + Fear of hair. +VESTIPHOBIA: + Fear of clothing. +%% +BALTIMORE: + A wharf-rat stealing Diogenes' lamp. +%% +BAROMETER: + An ingenious instrument which indicates + what kind of weather we are having. +%% +BASIC is to computer programming as QWERTY is to typing. + -- Seymour Papert +%% +BASIC: + A programming language. Related to certain social diseases + in that those who have it will not admit it in polite company. +%% +BE ALERT!!!! (The world needs more lerts...) +%% +BELIEF: + Something you do not believe. +%% +BEWARE! People acting under the influence of human nature. +%% +BIRTH: + The first and direst of all disasters. +%% +BORE: + A person who talks when you wish him to listen. +%% +BOSS: + According to the Oxford English Dictionary, in the Middle Ages the + words "boss" and "botch" were largely synonymous, except that boss, + in addition to meaning "a supervisor of workers" also meant "an + ornamental stud." +%% +BOSTON: + Ludwig van Beethoven being jeered by 50,000 sports + fans for finishing second in the Irish jig competition. +%% +BOY: + A noise with dirt on it. +%% +BRAIN, v.: [as in "to brain"] + To rebuke bluntly, but not pointedly; + to dispel a source of error in an opponent. +%% +BRAIN: + The apparatus with which we think that we think. +%% +BRIDE: + A woman with a fine prospect of happiness behind her. +%% +BRIEFCASE: + A trial where the jury gets together and forms a lynching party. +%% +BROAD-MINDEDNESS: + The result of flattening high-mindedness out. +%% +BROKEE: + Someone who buys stocks on the advice of a broker. +%% +BS: You remind me of a man. +B: What man? +BS: The man with the power. +B: What power? +BS: The power of voodoo. +B: Voodoo? +BS: You do. +B: Do what? +BS: Remind me of a man. +B: What man? +BS: The man with the power... + -- Cary Grant, "The Bachelor and the Bobby-Soxer" +%% +BUG: + An elusive creature living in a program that makes it incorrect. + The activity of "debugging", or removing bugs from a program, ends + when people get tired of doing it, not when the bugs are removed. + -- "Datamation", January 15, 1984 +%% +BUGS: + A son of a glitch. +%% +BUREAUCRAT: + A politician who has tenure. +%% +Bachelors' wives and old maids' children are always perfect. + -- Nicolas Chamfort +%% +Back in '80 or '81 the workers were rioting in Gdansk and there were fears +that the Soviets would invade Poland to put down the demonstrations. Foreign +correspondents were curious as to just what the Poles would do if they were +invaded. They asked, "What will you do if the East Germans invade from the +West and the Soviets invade from the East? Who will you fight first?" + To which the Poles replied, "Why, we will fight the Germans first. +Business before pleasure." +%% +Bad men live that they may eat and drink, +whereas good men eat and drink that they may live. + -- Socrates +%% +Bagdikian's Observation: + Trying to be a first-rate reporter on the average American newspaper + is like trying to play Bach's "St. Matthew Passion" on a ukelele. +%% +Bahdges? We don't need no stinkin bahdges! + -- "The Treasure of Sierra Madre" +%% +Baker's First Law of Federal Geometry: + A block grant is a solid mass of money + surrounded on all sides by governors. +%% +Ban the bomb. Save the world for conventional warfare. +%% +Banacek's Eighteenth Polish Proverb: + The hippo has no sting, but the wise + man would rather be sat upon by the bee. +%% +Bank error in your favor. Collect $200. +%% +Barach's Rule: + An alcoholic is a person who drinks more than his own physician. +%% +Barbara's Rules of Bitter Experience: + (1) When you empty a drawer for his clothes + and a shelf for his toiletries, the relationship ends. + (2) When you finally buy pretty stationary + to continue the correspondence, he stops writing. +%% +Barker's Proof: + Proofreading is more effective after publication. +%% +Base 8 is just like base 10, if you are missing two fingers. + -- Tom Lehrer +%% +Basic Definitions of Science: + If it's green or wiggles, it's biology. + If it stinks, it's chemistry. + If it doesn't work, it's physics. +%% +Basic is a high level languish. +%% +Be a better psychiatrist and the world +will beat a psychopath to your door. +%% +Be assured that a walk through the ocean of most Souls would scarcely +get your Feet wet. Fall not in Love, therefore: it will stick to your face. + -- Deteriorata +%% +Be both a speaker of words and a doer of deeds. + -- Homer +%% +Be careful! Is it classified? +%% +Be careful how you get yourself involved with persons or +situations that can't bear inspection. +%% +Be careful of reading health books, you might die of a misprint. + -- Mark Twain +%% +Be careful when a loop exits to the same place from side and bottom. +%% +Be careful when you bite into your hamburger. + -- Derek Bok +%% +Be cautious in your daily affairs. +%% +Be cheerful while you are alive. + -- Phathotep, 24th Century B.C. +%% +Be circumspect in your liaisons with women. It is better +to be seen at the opera with a man than at mass with a woman. + -- DeMaintenon +%% +Be different: conform. +%% +Be free and open and breezy! Enjoy! +Things won't get any better so get used to it. +%% +Be independent. +Insult a rich relative today. +%% +Be it our wealth, our jobs, or even our homes; +nothing is safe while the legislature is in session. +%% +Be not anxious about what you have, but about what you are. + -- Pope St. Gregory I +%% +Be open to other people -- they may enrich your dream. +%% +Be prepared to accept sacrifices. +Vestal virgins aren't all that bad. +%% +Be security conscious -- National Defense is at stake. +%% +Be self-reliant and your success is assured. +%% +Be sociable. +Speak to the person next to you in the unemployment line tomorrow. +%% +Be sure to evaluate the bird-hand/bush ratio. +%% +Be valiant, but not too venturous. +Let thy attire be comely, but not costly. + -- John Lyly +%% +Beam me up, Scotty! +%% +Beam me up, Scotty, there's no intelligent life down here! +%% +Beauty and harmony are as necessary to you as the very breath of life. +%% +Beauty is one of the rare things which does not lead to doubt of God. + -- Jean Anouilh +%% +Beauty is truth, truth beauty, that is all +Ye know on earth, and all ye need to know. + -- John Keats +%% +Beauty may be skin deep, but ugly goes clear to the bone. + -- Redd Foxx +%% +Beauty seldom recommends one woman to another. +%% +Because I do, +Because I do not hope, +Because I do not hope to survive +Injustice from the Palace, death from the air, +Because I do, only do, +I continue... + -- T.S. Pynchon +%% +Because the wine remembers. +%% +Because we don't think about future generations, they will never forget us. + -- Henrik Tikkanen +%% +Bedfellows make strange politicians. +%% +Been Transferred Lately? +%% +Been through hell? +What did you bring back for me? +%% +Been transferred lately? +%% +Beer & Pretzels -- Breakfast of Champions. +%% +Before I knew the best part of my life had come, it had gone. +%% +Before borrowing money from a friend, decide which you need more. + -- Addison H. Hallock +%% +Before destruction a man's heart is +haughty, but humility goes before honour. + -- Psalms 18:12 +%% +"Before we get married," said the young woman to her fiancee, "I want to +confess some affairs that I've had in the past." + "But you told me all about those a few weeks ago," her young man +replied. + "Yes, darling," she explained, "but that was a few weeks ago." +%% +Before you ask more questions, think about +whether you really want to know the answers. + -- Gene Wolfe, "The Claw of the Conciliator" +%% +Beggar to well-dressed businessman: + "Could you spare $20.95 for a fifth of Chivas?" +%% +Beggars should be no choosers. + -- John Heywood +%% +Behind every argument is someone's ignorance. +%% +Behind every successful man you'll find a woman with nothing to wear. +%% +Behold the fool saith, "Put not all thine eggs in the one basket" -- which +is but a manner of saying, "Scatter your money and your attention"; but +the wise man saith, "Put all your eggs in the one basket and -- watch that +basket!" + -- Mark Twain +%% +Behold the warranty -- the bold print +giveth and the fine print taketh away. +%% +Beifeld's Principle: + The probability of a young man meeting a desirable and receptive + young female increases by pyramidical progression when he + is already in the company of (1) a date, (2) his wife, (3) a + better-looking and richer male friend. + -- R. Beifeld +%% +Being a miner, as soon as you're too old and tired and sick and +stupid to do your job properly, you have to go, where the very +opposite applies with the judges. + -- Beyond the Fringe +%% +Being a woman is a terribly difficult trade, +since it consists principally of dealings with men. + -- Conrad +%% +Being popular is important. Otherwise people might not like you. +%% +Being stoned on marijuana isn't very +different from being stoned on gin. + -- Ralph Nader +%% +Being ugly isn't illegal. Yet. +%% +Bell Labs Unix - Reach out and grep someone. +%% +Ben, why didn't you tell me? + -- Luke Skywalker +%% +Bennett's Laws of Horticulture: + (1) Houses are for people to live in. + (2) Gardens are for plants to live in. + (3) There is no such thing as a houseplant. +%% +Benny Hill: Would you like a peanut? +Girl: No, thank you, I don't want to be under obligation. +Benny Hill: You won't be under obligation for a peanut. + It's not as if it were a chocolate bar or something. +%% +Bershere's Formula for Failure: + There are only two kinds of people who fail: + those who listen to nobody... and those who listen to everybody. +%% +Better by far you should forget and +smile than that you should remember and be sad. + -- Christina Rossetti +%% +Better hope the life-inspector doesn't come +around while you have your life in such a mess. +%% +Better hope you get what you want before you stop wanting it. +%% +Better late than never. + -- Titus Livius (Livy) +%% +Better living a beggar than buried an emperor. +%% +Better the prince of some inferior court, +Than second, or less, in beatific light. + -- Lucifer, Joost van den Vondel's "Lucifer" +%% +Better to light one candle than to curse the darkness. + -- motto of the Christopher Society +%% +Better to use medicines at the outset than at the last moment. +%% +Between two evils, I always pick the one I never tried before. + -- Mae West +%% +Beware of Bigfoot! +%% +Beware of Programmers who carry screwdrivers. + -- Leonard Brandwein +%% +Beware of a dark-haired man with a loud tie. +%% +Beware of a tall black man with one blond shoe. +%% +Beware of a tall blond man with one black shoe. +%% +Beware of all enterprises that require new clothes, +and not rather a new wearer of clothes. + -- Henry David Thoreau +%% +Beware of bugs in the above code; +I have only proved it correct, not tried it. + -- D. Knuth +%% +Beware of friends who are false and deceitful. +%% +Beware of geeks bearing graft. +%% +Beware of low-flying butterflies. +%% +Beware of strong drink. It can make you +shoot at tax collectors -- and miss. + -- Lazarus Long, "Time Enough For Love" +%% +Beware of the Turing Tar-pit in which everything +is possible but nothing of interest is easy. +%% +Beware of the man who knows the answer before he understands the question. +%% +"Beware of the man who works hard to learn something, learns it, and finds +himself no wiser than before," Bokonon tells us. "He is full of murderous +resentment of people who are ignorant without having come by their +ignorance the hard way." + -- Vonnegut +%% +Beware the new TTY code! +%% +Beware the one behind you. +%% +Bierman's Laws of Contracts: + (1) In any given document, you can't cover all the "what if's". + (2) Lawyers stay in business resolving all the unresolved "what if's". + (3) Every resolved "what if" creates two unresolved "what if's". +%% +Big M, Little M, many mumbling mice +Are making midnight music in the moonlight, +Mighty nice! +%% +Big book, big bore. + -- Callimachus +%% +Bigamy is having one spouse too many. Monogamy is the same. +%% +Biggest security gap -- an open mouth. +%% +Bilbo's First Law: + You cannot count friends that are all packed up in barrels. +%% +Billy: Mom, you know that vase you said was handed down from + generation to generation? +Mom: Yes? +Billy: Well, this generation dropped it. +%% +Bing's Rule: + Don't try to stem the tide -- move the beach. +%% +Biology grows on you. +%% +Biology is the only science in which +multiplication means the same thing as division. +%% +Birds are entangled by their feet and men by their tongues. +%% +Bistromathics is simply a revolutionary new way of understanding the +behavior of numbers. Just as Einstein observed that space was not an +absolute, but depended on the observer's movement in space, and that +time was not an absolute, but depended on the observer's movement in +time, so it is now realized that numbers are not absolute, but depend +on the observer's movement in restaurants. + -- Douglas Adams +%% +Biz is better. +%% +Bizarreness is the essence of the exotic. +%% +Black shiny mollies and bright colored guppies, +Shy little angels as gentle as puppies, +Swimming and diving with scarcely a swish, +They were just some of my tropical fish. + +Then I got mantas that sting in the water, +Deadly piranhas that itch for a slaughter, +Savage male betas that bite with a squish, +Now I have many less tropical fish. + + If you think that + Fish are peaceful + That's an empty wish. + Just dump them together + And leave them alone, + And soon you will have -- no fish. + -- To My Favorite Things +%% +Blackout, heatwave, .44 caliber homicide, +The bums drop dead and the dogs go mad in packs on the West Side, +A young girl standing on a ledge, looks like another suicide, +She wants to hit those bricks, + 'cause the news at six got to stick to a deadline, +While the millionaires hide in Beekman place, +The bag ladies throw their bones in my face, +I get attacked by a kid with stereo sound, +I don't want to hear it but he won't turn it down... + -- Billy Joel, "Glass Houses" +%% +Blame Saint Andreas -- it's all his fault. +%% +Blessed are the forgetful: for they +get the better even of their blunders. + -- Nietzsche +%% +Blessed are the meek for they shall inhibit the earth. +%% +Blessed are they who Go Around in Circles, +for they Shall be Known as Wheels. +%% +Blessed is he who expects nothing, for he shall never be disappointed. + -- Alexander Pope +%% +Blessed is he who has reached the point of no return and knows it, +for he shall enjoy living. + -- W.C. Bennett +%% +Blessed is he who expects no gratitude, for he shall not be disappointed. + -- W.C. Bennett +%% +Blinding speed can compensate for a lot of deficiencies. + -- David Nichols +%% +Bloom's Seventh Law of Litigation: + The judge's jokes are always funny. +%% +Blue paint today. + [Funny only to Guy Harris and Hal Pierson. Ed.] +%% +Blutarsky's Axiom: + Nothing is impossible for the man who will not listen to reason. +%% +Boling's postulate: + If you're feeling good, don't worry. You'll get over it. +%% +Bolub's Fourth Law of Computerdom: + Project teams detest weekly progress reporting because it so + vividly manifests their lack of progress. +%% +Bones: "The man's DEAD, Jim!" +%% +Boob's Law: + You always find something in the last place you look. +%% +Boren's Law's of the Bureaucracy: + 1) When in doubt, mumble. + 2) When in trouble, delegate. + 3) When in charge, ponder. + -- James H. Boren +%% +Both models are identical in performance, functional operation, and +interface circuit details. The two models, however, are not compatible +on the same communications line connection. + -- Bell System Technical Reference +%% +Boucher's Observation: + He who blows his own horn always plays the music + several octaves higher than originally written. +%% +Bounders get bound when they are caught bounding. + -- Ralph Lewin +%% +Bower's Law: + Talent goes where the action is. +%% +Bowie's Theorem: + If an experiment works, you must be using the wrong equipment. +%% +Boy! Eucalyptus! +%% +Boy, I sure wish that I could be in the +'Advanced Systems Development' group! +%% +Boy, get your head out of the stars above, +You get the maximum pleasure from a minimum of love. +Save your heart and let your body be enough, +To get the maximum pleasure from a minimum of love. +Save your heart and let your body be enough, +And get the maximum pleasure from a minimum of love. + -- Mac Macinelli, "Minimum Love" +%% +Boy, that crayon sure did hurt! +%% +Boycott meat - suck your thumb. +%% +Bozo is the Brotherhood of Zips and Others. Bozos are people who band +together for fun and profit. They have no jobs. Anybody who goes on a +tour is a Bozo. Why does a Bozo cross the street? Because there's a Bozo +on the other side. It comes from the phrase vos otros, meaning others. +They're the huge, fat, middle waist. The archetype is an Irish drunk +clown with red hair and nose, and pale skin. Fields, William Bendix. +Everybody tends to drift toward Bozoness. It has Oz in it. They mean +well. They're straight-looking except they've got inflatable shoes. They +like their comforts. The Bozos have learned to enjoy their free time, +which is all the time. + -- Firesign Theatre, "If Bees Lived Inside Your Head" +%% +Bradley's Bromide: + If computers get too powerful, we can organize + them into a committee -- that will do them in. +%% +Brady's First Law of Problem Solving: + When confronted by a difficult problem, you can + solve it more easily by reducing it to the question, + "How would the Lone Ranger have handled this?" +%% +Brain fried -- core dumped +%% +Brandy-and-water spoils two good things. + -- Charles Lamb +%% +Break into jail and claim police brutality. +%% +Breakfast sometime? + Sure. +Shall I call you or just nudge you? +%% +Breeding rabbits is a hare raising experience. +%% + Brian Kernighan has an automobile which he helped design. +Unlike most automobiles, it has neither speedometer, nor gas guage, nor +any of the numerous idiot lights which plague the modern driver. +Rather, if the driver makes any mistake, a giant "?" lights up in the +center of the dashboard. "The experienced driver", he says, "will +usually know what's wrong." +%% +Bridge ahead. Pay troll. +%% +Brigands will demand your money or +your life, but a woman will demand both. + -- Samuel Butler +%% +Bringing computers into the home won't change +either one, but may revitalize the corner saloon. +%% +Britain has lowered the tax on chastity belts by about 60 cents each... +[reclassifying them] as a safety device rather than... clothing + -- NY Times +%% +Brogan's Constant: + People tend to congregate in the back + of the church and the front of the bus. +%% +Brooke's Law: + Whenever a system becomes completely defined, some damn fool + discovers something which either abolishes the system or + expands it beyond recognition. +%% +Buck-passing usually turns out to be a boomerang. +%% +Bucy's Law: + Nothing is ever accomplished by a reasonable man. +%% +Build a system that even a fool can use +and only a fool will want to use it. +%% +Building translators is good clean fun. + -- T. Cheatham +%% +Bumper sticker: + All the parts falling off this car are + of the very finest British manufacture. +%% +Bunker's Admonition: + You cannot buy beer; you can only rent it. +%% +Bureau Termination, Law of: + When a government bureau is scheduled to be phased out, + the number of employees in that bureau will double within + 12 months after the decision is made. +%% +Burke's Postulates: + Anything is possible if you don't know what you are talking about. + Don't create a problem for which you do not have the answer. +%% +Bus error -- driver executed. +%% +Business will be either better or worse. + -- Calvin Coolidge +%% +But Captain -- the engines can't take this much longer! +%% +"But Huey, you PROMISED!" +"Tell 'em I lied." +%% +But I don't like Spam!!!! +%% +But I find the old notions somehow appealing. Not that I want to go +back to them -- it is outrageous to have some outer authority tell you +what is proper use and abuse of your own faculties, and it is ludicrous +to hold reason higher than body or feeling. Still there is something +true and profoundly sane about the belief that acts like murder or +theft or assault violate the doer as well as the done to. We might +even, if we thought this way, have less crime. The popular view of +crime, as far as I can deduce it from the movies and television, is +that it is a breaking of a rule by someone who thinks they can get away +with that; implicitly, everyone would like to break the rule, but not +everyone is arrogant enough to imagine they can get away with it. It +therefore becomes very important for the rule upholders to bring such +arrogance down. + -- Marilyn French, "The Woman's Room" +%% +But Officer, I stopped for the last one, and it was green! +%% +But, for my own part, it was Greek to me. + -- William Shakespeare, "Julius Caesar" +%% +But has any little atom, + While a-sittin' and a-splittin', +Ever stopped to think or CARE + That E = m c**2 ? +%% +But if we laugh with derision, we will never understand. Human +intellectual capacity has not altered for thousands of years so far as +we can tell. If intelligent people invested intense energy in issues +that now seem foolish to us, then the failure lies in our understanding +of their world, not in their distorted perceptions. Even the standard +example of ancient nonsense -- the debate about angels on pinheads -- +makes sense once you realize that theologians were not discussing +whether five or eighteen would fit, but whether a pin could house a +finite or an infinite number. + -- S.J. Gould, "Wide Hats and Narrow Minds" +%% +But if you wish at once to do nothing and to be respectable +nowdays, the best pretext is to be at work on some profound study. + -- Leslie Stephen [Sketches from Cambridge] +%% +But in our enthusiasm, we could not resist a radical overhaul of the +system, in which all of its major weaknesses have been exposed, +analyzed, and replaced with new weaknesses. + -- Bruce Leverett, + "Register Allocation in Optimizing Compilers" +%% +But it does move! + -- Galileo Galilei +%% +But, officer, he's not drunk, I just saw his fingers twitch! +%% +But scientists, who ought to know +Assure us that it must be so. +Oh, let us never, never doubt +What nobody is sure about. + -- Hilaire Belloc +%% +But sex and drugs and rock & roll, why, they'd bring our blackest day. +%% +But soft you, the fair Ophelia: +Ope not thy ponderous and marble jaws, +But get thee to a nunnery -- go! + -- Mark "The Bard" Twain +%% +But these pills can't be habit forming; +I've been taking them for years. +%% +But this has taken us far afield from interface, which is not a bad +place to be, since I particularly want to move ahead to the kludge. +Why do people have so much trouble understanding the kludge? What +is a kludge, after all, but not enough K's, not enough ROM's, not +enough RAM's, poor quality interface and too few bytes to go around? +Have I explained yet about the bytes? +%% +But we've only fondled the surface of that subject. + -- Virginia Masters, of Master & Johnson +%% +But you shall not escape my iambics. + -- Gaius Valerius Catullus +%% +But you who live on dreams, you are better pleased with the sophistical +reasoning and frauds of talkers about great and uncertain matters than +those who speak of certain and natural matters, not of such lofty nature. + -- Leonardo Da Vinci, "The Codex on the Flight of Birds" +%% +Buzz off, Banana Nose; Relieve mine eyes +Of hateful soreness, purge mine ears of corn; +Less dear than army ants in apple pies +Art thou, old prune-face, with thy chestnuts worn, +Dropt from thy peeling lips like lousy fruit; +Like honeybees upon the perfum'd rose +They suck, and like the double-breasted suit +Are out of date; therefore, Banana Nose, +Go fly a kite, thy welcome's overstayed; +And stem the produce of thy waspish wits: +Thy logick, like thy locks, is disarrayed; +Thy cheer, like thy complexion, is the pits. +Be off, I say; go bug somebody new, +Scram, beat it, get thee hence, and nuts to you. +%% +By doing just a little every day, you can +gradually let the task completely overwhelm you. +%% +By failing to prepare, you are preparing to fail. +%% +By nature, men are nearly alike; +by practice, they get to be wide apart. + -- Confucius +%% +By necessity, by proclivity, and by delight, we all quote. +In fact, it is as difficult to appropriate the thoughts of others +as it is to invent. + -- R. Emerson + -- Quoted from a fortune cookie program + (whose author claims, "Actually, stealing IS easier.") + [to which I reply, "You think it's easy for me to + misconstrue all these misquotations?!?" Ed.] +%% +By perseverance the snail reached the Ark. + -- Charles Spurgeon +%% +By protracting life, we do not deduct one jot from the duration of death. + -- Titus Lucretius Carus +%% +By the yard, life is hard. +By the inch, it's a cinch. +%% +By trying we can easily learn to endure adversity. +Another man's, I mean. + -- Mark Twain +%% +By working faithfully eight hours a day, you may +eventually get to be boss and work twelve. + -- Robert Frost +%% +Bypasses are devices that allow some people to dash from point A to +point B very fast while other people dash from point B to point A very +fast. People living at point C, being a point directly in between, are +often given to wonder what's so great about point A that so many people +from point B are so keen to get there and what's so great about point B +that so many people from point B are so keen to get there. They often +wish that people would just once and for all work out where the hell +they wanted to be. + -- The Hitchhiker's Guide to the Galaxy +%% +Byte your tongue. +%% +C for yourself. +%% +C: + A programming language that is sort of like Pascal except more like + assembly except that it isn't very much like either one, or anything + else. It is either the best language available to the art today, or + it isn't. +%% +CABBAGE: + A familiar kitchen-garden vegetable + about as large and wise as a man's head. +%% +CALIFORNIA: + From Latin 'calor', meaning "heat" (as in English + 'calorie' or Spanish 'caliente'); and 'fornia', for "sexual + intercourse" or "fornication." Hence: Tierra de California, + "the land of hot sex." + -- Ed Moran, Covina, California +%% +CANCER (June 21 - July 22) + This is a good time for those of you who are rich and happy, + but a poor time for those of you born under this sign who are + poor and unhappy. To tell you the truth, any day is tough + when you're poor and unhappy. +%% +CANCER (June 21 - July 22) + You are sympathetic and understanding of other people's problems. + They think you are a sucker. You are always putting things off. + That's why you'll never make anything of yourself. Most welfare + recipients are Cancer people. +%% +CAPRICORN (Dec 23 - Jan 19) + You are conservative and afraid of taking risks. You don't do + much of anything and are lazy. There has never been a Capricorn + of any importance. Capricorns should avoid standing still for + too long as they tend to take root and become trees. +%% +CAPRICORN (Dec.22 - Jan.19) + Play your hunches. This is a day when luck will play an important + part in your life. If you were smarter, you wouldn't need so much + luck and you wouldn't be reading your horoscope, either. You are + a suspicious person, and it will occur to you that astrologers + don't know what they're talking about any more than your Aunt Martha. +%% +CChheecckk yyoouurr dduupplleexx sswwiittcchh.. +%% +CHARITY: + A thing that begins at home and usually stays there. +%% +CHASTITY BELT: + An anti-trust suit. + (And an unchivalrous knight is the one that files it.) +%% +CHEMICALS: + Noxious substances from which modern foods are made. +%% +CHICAGO: + Where the dead still vote... early and often! +%% +CHRIST: + A man who was born at least 5,000 years ahead of his time. +%% +CHRISTMAS: + A day set apart by some as a time for turkey, presents, cranberry + salads, family get-togethers; for others, noted as having the best + response time of the entire year. +%% +CHRISTMAS: + A time when each of us gets to reflect upon what we each most + deeply and sincerely believe in. Money. At the mall of our + choice. +%% +CIGARETTE: + A fire at one end, a fool at the other, + and a bit of tobacco in between. +%% +CLEVELAND: + Where their last tornado did six + million dollars worth of improvements. +%% +COBOL is for morons. + -- E.W. Dijkstra +%% +COBOL: + An exercise in Artificial Inelegance. +%% +COBOL: + Completely Over and Beyond reason Or Logic. +%% +COCAINE: + The thinking man's Dristan. +%% +COLD: + When the local flashers are handing out written descriptions. +%% +COLD: + When the politicians walk around + with their hands in their own pockets. +%% +COLLABORATION: + A literary partnership based on the false + assumption that the other fellow can spell. +%% +COLLEGE: + The fountains of knowledge, where everyone goes to drink. +%% +COMMENT: + A superfluous element of a source program included so the + programmer can remember what the hell it was he was doing + six months later. Only the weak-minded need them, according + to those who think they aren't. +%% +COMMITTMENT: + Committment can be illustrated by a breakfast of ham and eggs. + The chicken was involved, the pig was committed. +%% +COMPASS [for the CDC-6000 series] is the sort of assembler +one expects from a corporation whose president codes in octal. + -- J.N. Gray +%% +COMPLIMENT: + When you say something to another which everyone knows isn't true. +%% +COMPUTER SCIENCE: + 1) A study akin to numerology and astrology, but lacking the + precision of the former and the success of the latter. + 2) The protracted value analysis of algorithms. + 3) The costly enumeration of the obvious. + 4) The boring art of coping with a large number of trivialities. + 5) Tautology harnessed in the service of Man at the speed of light. + 6) The Post-Turing decline in formal systems theory. +%% +COMPUTER: + An electronic entity which performs sequences of useful steps in a + totally understandable, rigorously logical manner. If you believe + this, see me about a bridge I have for sale in Manhattan. +%% +CONCEPT: + Any "idea" for which an outside + consultant billed you more than $25,000. +%% +CONFERENCE: + A special meeting in which the boss gathers subordinates to hear + what they have to say, so long as it doesn't conflict with what + he's already decided to do. +%% +CONFIRMED BACHELOR: + A man who goes through life without a hitch. +%% +CONFUSION: + One woman plus one left turn. +EXCITEMENT: + Two women plus one secret. +BEDLAM: + Three women plus one bargain. +CHAOS: + Four women plus one luncheon check. +%% +CONSENT DECREE: + A document in which a hapless company consents never to commit + in the future whatever heinous violations of Federal law it + never admitted to in the first place. +%% +CONSULTANT: + (1) Someone you pay to take the watch off your wrist and tell + you what time it is. (2) (For resume use) The working title + of anyone who doesn't currently hold a job. Motto: Have + Calculator, Will Travel. +%% +CONSULTANT: + An ordinary man a long way from home. +%% +CONSULTANT: + [From con "to defraud, dupe, swindle," or, possibly, French con + (vulgar) "a person of little merit" + sult elliptical form of + "insult."] A tipster disguised as an oracle, especially one who + has learned to decamp at high speed in spite of a large briefcase + and heavy wallet. +%% +CONSULTANT: + Someone who knowns 101 ways to make love, but can't get a date. +%% +CONSULTANT: + Someone who'd rather climb a tree and tell a + lie than stand on the ground and tell the truth. +%% +CONSULTATION: + Medical term meaning "to share the wealth." +%% +CONVERSATION: + A vocal competition in which the one who + is catching his breath is called the listener. +%% +COPYING MACHINE: + A device that shreds paper, flashes mysteriously + coded messages, and makes duplicates for everyone + in the office who isn't interested in reading them. +%% +CORONATION: + The ceremony of investing a sovereign with the outward and visible + signs of his divine right to be blown skyhigh with a dynamite bomb. +%% +CORRUPT: + In politics, holding an office of trust or profit. +%% +COWARD: + One who in a perilous emergency thinks with his legs. +%% +CREDITOR: + A man who has a better memory than a debtor. +%% +CRITIC: + A person who boasts himself hard to please + because nobody tries to please him. +%% +CURSOR: + One whose program will not run. + -- Robb Russon +%% +CYNIC: + A blackguard whose faulty vision sees things as they are, + not as they ought to be. Hence the custom among the + Scythians of plucking out a cynic's eyes to improve his vision. +%% +CYNIC: + Experienced. +%% +CYNIC: + One who looks through rose-colored glasses with a jaundiced eye. +%% +Cahn's Axiom: + When all else fails, read the instructions. +%% +California is a fine place to live -- if you happen to be an orange. + -- Fred Allen +%% +Call on God, but row away from the rocks. + -- Indian proverb +%% +Calvin Coolidge looks as if he had been weaned on a pickle. + -- Alice Roosevelt Longworth +%% +Calvin Coolidge was the greatest man +who ever came out of Plymouth Corner, Vermont. + -- Clarence Darrow +%% +Camille's Axiom: + If you haven't asked yourself, "Why the hell did + I go to college anyway?", you must be teaching. +%% +Campbell's Law: + Nature abhors a vacuous experimenter. +%% +Can anyone remember when the times +were not hard, and money not scarce? +%% +Can anything be sadder than work left unfinished? +Yes, work never begun. +%% +Can you buy friendship? You not only can, you must. It's the +only way to obtain friends. Everything worthwhile has a price. + -- Robert J. Ringer +%% +Canada Bill Jones's Motto: + It's morally wrong to allow suckers to keep their money. + +Canada Bill Jones's Supplement: + A Smith and Wesson beats four aces. +%% +Canada Post doesn't really charge 32 cents for a stamp. +It's 2 cents for postage and 30 cents for storage. + -- Gerald Regan, Cabinet Minister, 12/31/83 Financial Post +%% +Candy +Is dandy +But liquor +Is quicker. + -- Ogden Nash, "Reflections on Ice-Breaking" + +Fortune updates the great quotes: #53. + Candy is dandy; but liquor is quicker, + and sex won't rot your teeth. +%% +Can't open /usr/fortunes. Lid stuck on cookie jar. +%% +Can't open /usr/games/lib/fortunes.dat. +%% +Captain Penny's Law: + You can fool all of the people some of the time, and + some of the people all of the time, but you Can't Fool Mom. +%% +Captain's Log, star date 21:34.5... +%% +Carson's Consolation: + Nothing is ever a complete failure. + It can always be used as a bad example. +%% + Carol's head ached as she trailed behind the unsmiling Calibrees +along the block of booths. She chirruped at Kennicott, "Let's be wild! +Let's ride on the merry-go-round and grab a gold ring!" + Kennicott considered it, and mumbled to Calibree, "Think you folks +would like to stop and try a ride on the merry-go-round?" + Calibree considered it, and mumbled to his wife, "Think you'd like +to stop and try a ride on the merry-go-round?" + Mrs. Calibree smiled in a washed-out manner, and sighed, "Oh no, +I don't believe I care to much, but you folks go ahead and try it." + Calibree stated to Kennicott, "No, I don't believe we care to a +whole lot, but you folks go ahead and try it." + Kennicott summarized the whole case against wildness: "Let's try +it some other time, Carrie." + She gave it up. + -- Sinclair Lewis, "Main Street" +%% +Carson's Observation on Footwear: + If the shoe fits, buy the other one too. +%% +Carswell's Corollary: + Whenever man comes up with a better mousetrap, + nature invariably comes up with a better mouse. +%% +Cats, no less liquid than their shadows, offer no angles to the wind. +%% +Caution: Breathing may be hazardous to your health. +%% +Caution: Keep out of reach of children. +%% +Celebrate Hannibal Day this year. Take an elephant to lunch. +%% +Census Taker to Housewife: +Did you ever have the measles, and, if so, how many? +%% +Center meeting at 4pm in 2C-543. +%% +Cerebus: I'd love to lick apricot brandy out of your navel. +Jaka: Look, Cerebus -- Jaka has to tell you... something +Cerebus: If Cerebus had a navel, would you lick apricot brandy out + of it? +Jaka: Oooh. +Cerebus: You don't like apricot brandy? + -- Cerebus, #6, "The Secret" +%% +Certain old men prefer to rise at dawn, taking a cold bath and a long +walk with an empty stomach and otherwise mortifying the flesh. They +then point with pride to these practices as the cause of their sturdy +health and ripe years; the truth being that they are hearty and old, +not because of their habits, but in spite of them. The reason we find +only robust persons doing this thing is that it has killed all the +others who have tried it. +%% +Certainly the game is rigged. +Don't let that stop you; if you don't bet, you can't win. + -- Robert Heinlein, "Time Enough For Love" +%% +Certainly there are things in life that money can't buy, +But it's very funny -- +did you ever try buying them without money? + -- Ogden Nash +%% +C'est magnifique, mais ce n'est pas l'Informatique. + -- Bosquet [on seeing the IBM 4341] +%% +C'est magnifique, mais ce n'est pas la gare! +%% +Chance is perhaps the work of God when He did not want to sign. + -- Anatole France +%% +Change your thoughts and you change your world. +%% +Chapter 2: Newtonian Growth and Decay + + The growth-decay formulas were developed in the trivial fashion by +Isaac Newton's famous brother Phigg. His idea was to provide an equation +that would describe a quantity that would dwindle and dwindle, but never +quite reach zero. Historically, he was merely trying to work out his +mortgage. Another versatile equation also emerged, one which would define +a function that would continue to grow, but never reach unity. This equation +can be applied to charging capacitors, over-damped springs, and the human +race in general. +%% + Chapter VIII +Due to the convergence of forces beyond his comprehension, +Salvatore Quanucci was suddenly squirted out of the universe +like a watermelon seed, and never heard from again. +%% +Charity begins at home. + -- Publius Terentius Afer (Terence) +%% +Charlie was a chemist, +But Charlie is no more. +What Charlie thought was H2O was H2SO4. +%% +Charm is a way of getting the answer "Yes" -- +without having asked any clear question. +%% +Chaste makes waste. +%% +Chastity is its own punishment. +%% +Chastity: + The most unnatural of the sexual perversions. + -- Aldous Huxley +%% +Cheap things are of no value, valuable things are not cheap. +%% +Cheer Up! Things are getting worse at a slower rate. +%% +Cheit's Lament: + If you help a friend in need, he is sure to remember you-- + the next time he's in need. +%% +Chemist who falls in acid is absorbed in work. +%% +Chemist who falls in acid will be tripping for weeks. +%% +Chemistry professors never die, they just fail to react. +%% +Cheops' Law: + Nothing ever gets built on schedule or within budget. +%% +"Cheshire-Puss," she began, "would you tell me, please, + which way I ought to go from here?" +"That depends a good deal on where you want to get to," said the Cat. +"I don't care much where--" said Alice. +"Then it doesn't matter which way you go," said the Cat. +%% +Chess tonight. +%% +Chicken Little was right. +%% +Chicken Soup: + An ancient miracle drug containing equal parts of aureomycin, + cocaine, interferon, and TLC. The only ailment chicken soup + can't cure is neurotic dependence on one's mother. + -- Arthur Naiman +%% +Children are natural mimics who act like their parents +despite every effort to teach them good manners. +%% +Children aren't happy without something to ignore, +And that's what parents were created for. + -- Ogden Nash +%% +Children seldom misquote you. In fact, they usually +repeat word for word what you shouldn't have said. +%% +Chinese saying: "He who speak with forked tongue, not need chopsticks." +%% +Chism's Law of Completion: + The amount of time required to complete a government project is + precisely equal to the length of time already spent on it. +%% +Chisolm's First Corollary to Murphy's Second Law: + When things just can't possibly get any worse, they will. +%% +Chocolate Chip. +%% +Choose in marriage only a woman whom you would choose as +a friend if she were a man. + -- Joubert +%% +Christ died for our sins, so let's not disappoint Him. +%% +Christianity and Judaism aren't all that different, really. Growing up in +a Christian family, the feeling of guilt for Man's sins comes from God. +In a Jewish family, it comes from your parents. +%% +Christianity might be a good thing if anyone ever tried it. + -- George Bernard Shaw +%% +Christmas time is here, by Golly; Kill the turkeys, ducks and chickens; +Disapproval would be folly; Mix the punch, drag out the Dickens; +Deck the halls with hunks of holly; Even though the prospect sickens, +Fill the cup and don't say when... Brother, here we go again. + +On Christmas day, you can't get sore; Relations sparing no expense'll, +Your fellow man you must adore; Send some useless old utensil, +There's time to rob him all the more, Or a matching pen and pencil, +The other three hundred and sixty-four! Just the thing I need... how nice. + +It doesn't matter how sincere Hark The Herald-Tribune sings, +It is, nor how heartfelt the spirit; Advertising wondrous things. +Sentiment will not endear it; God Rest Ye Merry Merchants, +What's important is... the price. May you make the Yuletide pay. + Angels We Have Heard On High, +Let the raucous sleighbells jingle; Tell us to go out and buy. +Hail our dear old friend, Kris Kringle, Sooooo... +Driving his reindeer across the sky, +Don't stand underneath when they fly by! + -- Tom Lehrer +%% +Churchill's Commentary on Man: + Man will occasionally stumble over the truth, + but most of the time he will pick himself up and continue on. +%% +Circumstances rule men; men do not rule circumstances. + -- Herodotus +%% +Civilization and profits go hand in hand. + -- Calvin Coolidge +%% +Civilization, as we know it, will end sometime this evening. +See SYSNOTE tomorrow for more information. +%% +Civilization is the limitless multiplication of unnecessary necessities. + -- Mark Twain +%% +Clark Kent is a transvestite. +%% +Class, that's the only thing that counts in life. Class. +Without class and style, a man's a bum; he might as well be dead. + -- "Bugsy" Siegel +%% +Clay's Conclusion: + Creativity is great, but plagiarism is faster. +%% +Cleanliness is next to impossible. +%% +Cleveland? +Yes, I spent a week there one day. +%% +Clones are people two. +%% +Cloning is the sincerest form of flattery. +%% +Clothes make the man. +Naked people have little or no influence on society. + -- Mark Twain +%% +Clovis' Consideration of an Atmospheric Anomaly: + The perversity of nature is nowhere better demonstrated + than by the fact that, when exposed to the same atmosphere, + bread becomes hard while crackers become soft. +%% +Cobol programmers are down in the dumps. +%% +Cocaine -- the thinking man's Dristan. +%% +Coding is easy; All you do is sit staring at a +terminal until the drops of blood form on your forehead. +%% +Cogito cogito ergo cogito sum -- +I think that I think, therefore I think that I am. + -- Ambrose Bierce +%% +Cohen's Law: + There is no bottom to worse. +%% +Cohn's Law: + The more time you spend in reporting on what you are doing, the less + time you have to do anything. Stability is achieved when you spend + all your time reporting on the nothing you are doing. +%% +Cold hands, no gloves. +%% +Cole's Law: + Thinly sliced cabbage. +%% +College football is a game which would be much more interesting if the +faculty played instead of the students, and even more interesting if +the trustees played. There would be a great increase in broken arms, +legs, and necks, and simultaneously an appreciable diminution in the +loss to humanity. + -- H.L. Mencken +%% +Colorless green ideas sleep furiously. +%% +Colvard's Logical Premises: + All probabilities are 50%. +Either a thing will happen or it won't. + +Colvard's Unconscionable Commentary: + This is especially true when + dealing with someone you're attracted to. + +Grelb's Commentary: + Likelihoods, however, are 90% against you. +%% +Come fill the cup and in the fire of spring +Your winter garment of repentence fling. +The bird of time has but a little way +To flutter -- and the bird is on the wing. + -- Omar Khayyam +%% +Come home America. + -- George McGovern, 1972 +%% +Come, let us hasten to a higher plane, +Where dyads tread the fairy fields of Venn, +Their indices bedecked from one to n, +Commingled in an endless Markov chain! + +Come, every frustum longs to be a cone, +And every vector dreams of matrices. +Hark to the gentle gradient of the breeze: +It whispers of a more ergodic zone. + +In Riemann, Hilbert or in Banach space +Let superscripts and subscripts go their ways. +Our asymptotes no longer out of phase, +We shall encounter, counting, face to face. + -- The Cyberiad +%% +Come live with me, and be my love, +And we will some new pleasures prove +Of golden sands, and crystal brooks, +With silken lines, and silver hooks. + -- John Donne +%% +Come live with me and be my love, +And we will some new pleasures prove +Of golden sands and crystal brooks +With silken lines, and silver hooks. +There's nothing that I wouldn't do +If you would be my posslq. + +You live with me, and I with you, +And you will be my posslq. +I'll be your friend and so much more; +That's what a posslq is for. + +And everything we will confess; +Yes, even to the IRS. +Some day on what we both may earn, +Perhaps we'll file a joint return. +You'll share my pad, my taxes, joint; +You'll share my life - up to a point! +And that you'll be so glad to do, +Because you'll be my posslq. +%% +Come, muse, let us sing of rats! + -- From a poem by James Grainger, 1721-1767 +%% +Come up and see me sometime. Come Wednesday, that's amateur night. + -- Mae West +%% +Come, you spirits +That tend on mortal thoughts, unsex me here, +And fill me, from the crown to the toe, top-full +Of direst cruelty! make thick my blood, +Stop up the access and passage to remorse +That no compunctious visiting of nature +Shake my fell purpose, not keep peace between +The effect and it! Come to my woman's breasts, +And take my milk for gall, you murdering ministers, +Wherever in your sightless substances +You wait on nature's mischief! Come, thick night, +And pall the in the dunnest smoke of hell, +That my keen knife see not the wound it makes, +Nor heaven peep through the blanket of the dark, +To cry `Hold, hold!' + -- Lady MacBeth +%% +Coming together is a beginning; + keeping together is progress; + working together is success. +%% +Commit the oldest sins the newest kind of ways. + -- William Shakespeare, "Henry IV" +%% +Common sense is the collection of prejudices acquired by age eighteen. + -- Albert Einstein +%% +Commoner's three laws of ecology: + 1) No action is without side-effects. + 2) Nothing ever goes away. + 3) There is no free lunch. +%% +Communicate! It can't make things any worse. +%% +Competence, like truth, beauty, and contact lenses, +is in the eye of the beholder. + -- Dr. Laurence J. Peter +%% +Competitive fury is not always anger. It is the true missionary's +courage and zeal in facing the possibility that one's best may not +be enough. + -- Gene Scott +%% +Computer programmers do it byte by byte. +%% +Computer programmers never die, they just get lost in the processing. +%% +Computer programs expand so as to fill the core available. +%% +Computers are not intelligent. They only think they are. +%% +Computers are unreliable, but humans are even more unreliable. +Any system which depends on human reliability is unreliable. + -- Gilb +%% +Computers don't actually think. + You just think they think. + (We think.) +%% +Conceit causes more conversation than wit. + -- LaRouchefoucauld +%% +Condense soup, not books! +%% +Confess your sins to the Lord and you will be forgiven; +confess them to man and you will be laughed at. + -- Josh Billings +%% +Confession is good for the soul, but bad for the career. +%% +Confession is good for the soul only in the sense +that a tweed coat is good for dandruff. + -- Peter de Vries +%% +Confidence is the feeling you have before you understand the situation. +%% +Conflicting research paradigms +Have legitimized various crimes. + The worst we can see + Is in psychology, +Measuring reaction times. +%% +Conformity is the refuge of the unimaginative. +%% +Confucious say too damn much! +%% +Confucius say too much. + -- Recent Chinese Proverb +%% +Confusion will be my epitaph +as I walk a cracked and broken path +If we make it we can all sit back and laugh +but I fear that tomorrow we'll be crying. + -- King Crimson, "In the Court of the Crimson King" +%% +Congratulations! You are the one-millionth user to log into our system. +If there's anything special we can do for you, anything at all, don't +hesitate to ask! +%% +Conscience doth make cowards of us all. + -- Shakespeare +%% +Conscience is defined as the thing that hurts +when everything else feels great. +%% +Conscience is the inner voice that warns us somebody may be looking. + -- H.L. Mencken +%% +Conscience is what hurts when everything else feels so good. +%% +Conservative: + One who admires radicals centuries after they're dead. + -- Leo C. Rosten +%% +Consider the little mouse, how sagacious an animal +it is which never entrusts its life to one hole only. + -- Titus Maccius Plautus +%% +Consider the postage stamp: its usefulness consists in +the ability to stick to one thing till it gets there. + -- Josh Billings +%% +Consultants are mystical people who ask a +company for a number and then give it back to them. +%% +Continental Life. Why? +%% +"Contrariwise," continued Tweedledee, "if it was so, it might be, and +if it were so, it would be; but as it isn't, it ain't. That's logic!" + -- Lewis Carroll +%% +Convention is the ruler of all. + -- Pindar +%% +Conversation enriches the understanding, +but solitude is the school of genius. +%% +Conway's Law: + In any organization there will always be one person who knows + what is going on. + + This person must be fired. +%% +Correspondence Corollary: + An experiment may be considered a success if no more than half + your data must be discarded to obtain correspondence with your theory. +%% +Corruption is not the No. 1 priority of the Police Commissioner. +His job is to enforce the law and fight crime. + -- P.B.A. President E.J. Kiernan +%% +Corry's Law: + Paper is always strongest at the perforations. +%% +Couldn't we jury-rig the cat to act as an audio switch, and have it yell +at people to save their core images before logging them out? I'm sure +the cattle prod would be effective in this regard. In any case, a traverse +mounted iguana, while more perverted, gives better traction, not to mention +being easier to stake. +%% +Counting in binary is just like counting +in decimal -- if you are all thumbs. + -- Glaser and Way +%% +Counting in octal is just like counting +in decimal -- if you don't use your thumbs. + -- Tom Lehrer +%% +Courage is fear that has said its prayers. +%% +Courage is grace under pressure. +%% +Courage is resistance to fear, mastery of fear -- not absence of fear. + -- Mark Twain +%% +Courage is your greatest present need. +%% +[Crash programs] fail because they are based on the theory that, +with nine women pregnant, you can get a baby a month. + -- Wernher von Braun +%% +Crazee Edeee, his prices are INSANE!!! +%% +Creating computer software is always a demanding and painstaking +process -- an exercise in logic, clear expression, and almost fanatical +attention to detail. It requires intelligence, dedication, and an +enormous amount of hard work. But, a certain amount of unpredictable +and often unrepeatable inspiration is what usually makes the difference +between adequacy and excellence. +%% +Creativity in living is not without its attendant difficulties, for +peculiarity breeds contempt. And the unfortunate thing about being +ahead of your time when people finally realize you were right, they'll +say it was obvious all along. + -- Alan Ashley-Pitt +%% +Creativity is no substitute for knowing what you are doing. +%% +Creativity is not always bred in an environment of tranquility; +sometimes you have to squeeze a little to get the paste out of the tube. +%% +Crenna's Law of Political Accountability: + If you are the first to know about something bad, + you are going to be held responsible for acting on it, + regardless of your formal duties. +%% +Crime does not pay... as well as politics. + -- A.E. Newman +%% +Crinklaw's Observation: + Nowadays the order of life is reversed: Sex is first enjoyed, + marriage follows, and after marriage comes abstinence. +%% +Criticism comes easier than craftsmanship. + -- Zeuxis +%% +Crito, I owe a cock to Asclepius; will you remember to pay the debt? + -- Socrates' last words +%% +Cropp's Law: + The amount of work done varies inversly + with the time spent in the office. +%% +Cruickshank's Law of Committees: + If a committee is allowed to discuss a bad idea long enough, it + will inevitably decide to implement the idea simply because so + much work has already been done on it. +%% +Crush! Kill! Destroy! +%% +Culture is the habit of being pleased with the best and knowing why. +%% +Cure the disease and kill the patient. + -- Francis Bacon +%% +Cutler Webster's Law: + There are two sides to every argument, unless a person + is personally involved, in which case there is only one. +%% +DALLAS: + The city that chose Astroturf to + keep the cheerleaders from grazing. +%% +DAMN IT, I GOTTA GET OUTTA HERE! +%% +DATA: + An accrual of straws on the backs of theories. +%% +DATA: + Computerspeak for "information". Properly pronounced + the way Bostonians pronounce the word for a female child. +%% +DAWN: + The time when men of reason go to bed. +%% +DEADWOOD: + Anyone in your company who is more senior than you are. +%% +DEATH WISH: + The only wish that always comes true, whether or not one wishes it to. +%% +DEATH: + To stop sinning suddenly. + -- Elbert Hubbard +%% +DECISIONMAKER: + The person in your office who was unable + to form a task force before the music stopped. +%% +DEFAULT: + The hardware's, of course. +%% +DEJA VU: + French., already seen; unoriginal; trite. + Psychol., The illusion of having previously experienced + something actually being encountered for the first time. + Psychol., The illusion of having previously experienced + something actually being encountered for the first time. +%% + DELETE A FORTUNE! +Don't some of these fortunes just drive you nuts?! +Wouldn't you like to see some of them deleted from the system? +You can! Just mail to `fortune' with the fortune you hate most, +and we'll make sure it gets expunged. +%% +DELIBERATION: + The act of examining one's bread + to determine which side it is buttered on. +%% +DENVER: + A smallish city located just below the `O' in Colorado. +%% +DESIGN: + What you regret not doing later on. +%% +DIPLOMACY: + Lying in state. +%% +DISBAR: + As distinguished from some other bar. +%% +DISTRESS: + A disease incurred by exposure to the prosperity of a friend. +%% +DROP THE DAMN BEAR!!! +%% +DRUG: + A substance that, when injected into a rat, + produces a scientific paper. +%% + Dallas Cowboys Official Schedule + + Sept 14 Pasadena Junior High + Sept 21 Boy Scout Troop 049 + Sept 28 Blind Academy + Sept 30 World War I Veterans + Oct 5 Brownie Scout Troop 041 + Oct 12 Sugarcreek High Cheerleaders + Oct 26 St. Thomas Boys Choir + Nov 2 Texas City Vet Clinic + Nov 9 Korean War Amputees + Nov 15 VA Hospital Polio Patients +%% +Dallas still lives. God MUST be dead. +%% +Dames lie about anything -- just for practice. + -- Raymond Chandler +%% +Dammit Jim, I'm an actor not a doctor. +%% +Damn, I need a Coke! + -- Dr. William DeVries + [after implanting the first artificial human heart] +%% +Damn braces. + -- William Blake, "Proverbs of Hell" +%% +Darth Vader! Only you would be so bold! + -- Princess Leia Organa +%% +Darth Vader sleeps with a Teddywookie. +%% +Dave has an areoplane, +In which he likes to frisk. +Oh what a foolish boy, +His silly *. +%% +Davis' Law of Traffic Density: + The density of rush-hour traffic is directly proportional to + 1.5 times the amount of extra time you allow to arrive on time. +%% +Davis's Dictum: + Problems that go away by themselves, come back by themselves. +%% +Day of inquiry. You will be subpoenaed. +%% +DeVries' Dilemma: + If you hit two keys on the typewriter, + the one you don't want hits the paper. +%% +Dealing with failure is easy: + Work hard to improve. +Success is also easy to handle: + You've solved the wrong problem. Work hard to improve. +%% +Dealing with the problem of pure staff accumulation, +all our researches ... point to an average increase of 5.75% per year. + -- C.N. Parkinson +%% +Dear Ann Landers: + I have a problem. I have two brothers; one works for the Illinois +Bell Telephone Company, the other brother was just sentenced to death +in the electric chair for murder. My mother died from insanity when +I was three years old. My two sisters are prostitutes and my father +sells narcotics. + I recently met girl who was just released from a reformatory where +she served time for smothering her illegitimate child to death. I love +this girl and want to marry her. My problem is this -- dare I tell her +about my brother who works for Illinois Bell? + -- Confused. +%% +Dear Ann Landers: + My husband watches the TV preachers every Sunday. He claims +one minister said there are 350 different sins. My husband wants to +know if you can get the list. He thinks he is missing something. + -- E.J. Mayfield +%% +Dear Freshman, + You don't know who I am and frankly shouldn't care, but +unknown to you we have something in common. We are both rather +prone to mistakes. I was elected Student Government President by +mistake, and you came to school here by mistake. +%% +Dear Miss Manners: +I carry a big black umbrella, even if there's just a thirty percent chance of +rain. May I ask a young lady who is a stranger to me to share its protection? +This morning, I was waiting for a bus in comparative comfort, my umbrella +protecting me from the downpour, and noticed an attractive young woman getting +soaked. I have often seen her at my bus stop, although we have never spoken, +and I don't even know her name. Could I have asked her to get under my +umbrella without seeming insulting? + +Gentle Reader: +Certainly. Consideration for those less fortunate than you is always proper, +although it would be more convincing if you stopped babbling about how +attractive she is. In order not to give Good Samaritanism a bad name, Miss +Manners asks you to allow her two or three rainy days of unmolested protection +before making your attack. +%% +Dear Miss Manners: + My home economics teacher says that one must never place one's +elbows on the table. However, I have read that one elbow, in between +courses, is all right. Which is correct? + +Gentle Reader: + For the purpose of answering examinations in your home +economics class, your teacher is correct. Catching on to this principle +of education may be of even greater importance to you now than learning +correct current table manners, vital as Miss Manners believes that is. +%% +Dear Miss Manners: +Please list some tactful ways of removing a man's saliva from your face. + +Gentle Reader: +Please list some decent ways of acquiring a man's saliva on your face. +If the gentleman sprayed you inadvertently to accompany enthusiastic +discourse, you may step back two paces, bring out your handkerchief, +and go through the motions of wiping your nose, while trailing the cloth +along your face to pick up whatever needs mopping along the route. If, +however, the substance was acquired as a result of enthusiasm of a more +intimate nature, you may delicately retrieve it with a flick of your +pink tongue. +%% +Dear Sir, + I am firmly opposed to the spread of microchips either to the home or +to the office, We have more than enough of them foisted upon us in public +places. They are a disgusting Americanism, and can only result in the farmers +being forced to grow smaller potatoes, which in turn will cause massive un- +employment in the already severely depressed agricultural industry. + Yours faithfully, + Capt. Quinton D'Arcy, J.P. + Sevenoaks + -- Letters To The Editor, The Times of London +%% +Death has been proven to be 99% fatal in laboratory rats. +%% +Death is God's way of telling you not to be such a wise guy. +%% +Death is Nature's way of recycling human beings. +%% +Death is a spirit leaving a body, sort +of like a shell leaving the nut behind. + -- Erma Bombeck +%% +Death is life's way of telling you you've been fired. + -- R. Geis +%% +Death is nature's way of telling you to slow down. +%% +Death rays don't kill people, people kill people!! +%% + Deck us all with Boston Charlie, + Walla Walla, Wash., an' Kalamazoo! + Nora's freezin' on the trolley, + Swaller dollar cauliflower, alleygaroo! + + Don't we know archaic barrel, + Lullaby Lilla Boy, Louisville Lou. + Trolley Molly don't love Harold, + Boola boola Pensacoola hullabaloo! + -- Pogo, "Deck Us All With Boston Charlie" +%% +Declared guilty... of displaying feelings of an almost human nature. + -- Pink Floyd, "The Wall" +%% +Decorate your home. It gives the illusion +that your life is more interesting than it really is. + -- C. Schultz +%% +"Deep" is a word like "theory" or "semantic" -- it implies all sorts of +marvelous things. It's one thing to be able to say "I've got a theory", +quite another to say "I've got a semantic theory", but, ah, those who can +claim "I've got a deep semantic theory", they are truly blessed. + -- Randy Davis +%% +Deflector shields just came on, Captain. +%% +Delay is preferable to error. + -- Thomas Jefferson +%% +Deliver yesterday, code today, think tomorrow. +%% +Delusions are often functional. A mother's opinions about +her children's beauty, intelligence, goodness, et cetera ad +nauseam, keep her from drowning them at birth. +%% +Democracy is a form of government in which it is permitted to wonder +aloud what the country could do under first-class management. + -- Senator Soaper +%% +Democracy is a form of government that substitutes election by the +incompetent many for appointment by the corrupt few. + -- G.B. Shaw +%% +Democracy is also a form of worship. +It is the worship of Jackals by Jackasses. + -- H.L. Mencken +%% +Democracy is the recurrent suspicion that more than half +of the people are right more than half of the time. + -- E.B. White +%% +Democracy is the worst form of government except all those other +forms that have been tried from time to time. + -- Winston Churchill +%% +Demonstrating once again the importance of the lowly comma, this +telegram was sent from a wife to her husband: + "NOT GETTING ANY, BETTER COME HOME AT ONCE." +%% +Dental health is next to mental health. +%% +Dentist: + A Prestidigitator who, putting metal in one's mouth, + pulls coins out of one's pockets. + -- Ambrose Bierce +%% +Depart in pieces, i.e., split. +%% +Depart not from the path which fate has assigned you. +%% +Department chairmen never die, they just lose their faculties. +%% +Depend on the rabbit's foot if you will, +but remember, it didn't help the rabbit. + -- R.E. Shay +%% +Deprive a mirror of its silver and even the Czar won't see his face. +%% +Der Horizont vieler Menschen ist ein Kreis mit Radius Null - +und das nennen sie ihren Standpunkt. +%% +Desist from enumerating your fowl +prior to their emergence from the shell. +%% +Despite all appearances, your boss +is a thinking, feeling, human being. +%% +Dibble's First Law of Sociology: + Some do, some don't. +%% +Did Detroit invent the back seat to destroy the morals of America? + -- Ed Sanders +%% +Did it ever occur to you that fat chance +and slim chance mean the same thing? + +Or that we drive on parkways and park on driveways? +%% +Did you hear about the model who sat +on a broken bottle and cut a nice figure? +%% +Did you know about the -o option of the fortune program? It makes a +selection from a set of offensive and/or obscene fortunes. Why not +try it, and see how offended you are? The -a ("all") option will +select a fortune at random from either the offensive or inoffensive +set, and it is suggested that "fortune -a" is the command that you +should have in your .profile or .cshrc. file. +%% +Did you know that clones never use mirrors? +%% +Did you know that for the price of a 280-Z you can buy two Z-80's? + -- P.J. Plauger +%% +Did you know the University of Iowa +closed down after someone stole the book? +%% +Did you know.... + +That no-one ever reads these things? +%% +Didja' ever have to make up your mind, +Pick up on one and leave the other behind, +It's not often easy, and it's not often kind, +Didja' ever have to make up your mind? + -- Lovin' Spoonful +%% +Die? I should say not, dear fellow. No Barrymore +would allow such a conventional thing to happen to him. + -- John Barrymore's dying words +%% +Dieters live life in the fasting lane. +%% +Different all twisty a of in maze are you, passages little. +%% +Dig it, first they killed those pigs, then they ate dinner +in the same room with them, then they even shoved a fork in +a victim's stomach. Wild! + -- Bernadine Dohrn, on the Manson killings +%% +Digital circuits are made from analog parts. + -- Don Vonada +%% +Dime is money. +%% +Dinner suggestion #302 (Hacker's De-lite): + 1 tin imported Brisling sardines in tomato sauce + 1 pouch Chocolate Malt Carnation Instant Breakfast + 1 carton milk +%% +Diogenes, having abandoned his search for +truth, is now searching for a good fantasy. +%% +Diplomacy is the art of letting someone else have your way. +%% +Diplomacy is the art of letting the other party have things your way. + -- Daniele Vare +%% +Diplomacy is the art of saying "nice doggie" until you can find a rock. + -- Wynn Catlin +%% +Disc space -- the final frontier! +%% +Disclose classified information only when a NEED TO KNOW exists. +%% +Disco is to music what Etch-A-Sketch is to art. +%% +Disease can be cured; fate is incurable. + -- Chinese proverb +%% +Dishonor will not trouble me, once I am dead. + -- Euripides +%% +Disillusioned words like bullets bark, +As human gods aim for their mark, +Make everything from toy guns that spark +To flesh-colored christs that glow in the dark. +It's easy to see without looking too far +That not much is really sacred. +%% +Disk crisis, please clean up! +%% +Disks travel in packs. +%% +Distance doesn't make you any smaller, +but it does make you part of a larger picture. +%% +Ditat Deus. (God enriches.) +%% +Do YOU have redeeming social value? +%% +Do clones have navels? +%% +Do infants have as much fun in infancy as adults do in adultery? +%% +Do married women make the best wives? +%% +Do molecular biologists wear designer genes? +%% +Do more than anyone expects, and pretty soon everyone will expect more. +%% +Do not believe in miracles -- rely on them. +%% +Do not clog intellect's sluices with bits of knowledge of questionable uses. +%% +Do not count your chickens before they are hatched. + -- Aesop +%% +Do not despair of life. You have no doubt force enough to overcome +your obstacles. Think of the fox prowling through wood and field in +a winter night for something to satisfy his hunger. Notwithstanding +cold and hounds and traps, his race survives. I do not believe any +of them ever committed suicide. + -- Henry David Thoreau +%% +Do not do unto others as you would they should do unto you. +Their tastes may not be the same. + -- George Bernard Shaw +%% +Do not drink coffee in early A.M. It will keep you awake until noon. +%% +Do not handicap your children by making their lives easy. + -- Robert Heinlein +%% +Do not meddle in the affairs of wizards, +for they become soggy and hard to light. + +Do not throw cigarette butts in the urinal, +for they are subtle and quick to anger. +%% +Do not overtax your powers. +%% +Do not permit a woman to ask forgiveness, for that is only the first +step. The second is justification of herself by accusation of you. + -- DeGourmont +%% +Do not read this fortune under penalty of law. +Violators will be prosecuted. +(Penal Code sec. 2.3.2 (II.a.)) +%% +Do not seek death; death will find you. +But seek the road which makes death a fulfillment. + -- Dag Hammarskjold +%% +Do not simplify the design of a program if a way +can be found to make it complex and wonderful. +%% +Do not sleep in a eucalyptus tree tonight. +%% +Do not stoop to tie your laces in your neighbor's melon patch. +%% +Do not take life too seriously; you will never get out of it alive. +%% +Do not think by infection, catching an opinion like a cold. +%% +Do not try to solve all life's problems at once -- +learn to dread each day as it comes. + -- Donald Kaul +%% +Do not underestimate the power of the Farce. +%% +Do not underestimate the power of the Force. +%% +Do not use the blue keys on this terminal. +%% +Do not worry about which side your +bread is buttered on: you eat BOTH sides. +%% +Do nothing unless you must, and when you must act -- hesitate. +%% +Do, or do not; there is no try. +%% +Do something unusual today. Pay a bill. +%% +Do students of Zen Buddhism do Om-work? +%% +Do unto others before they undo you. +%% +Do what comes naturally. Seethe and fume and throw a tantrum. +%% +Do what you can to prolong your life, +in the hope that someday you'll learn what it's for. +%% +Do you feel personally responsible for the world food shortage? +Every time you go to the beach, does the tide come in? +Have you ever eaten an entire moose? +Can you see your neck? +Do joggers take laps around you for exercise? +If so, welcome to National Fat Week. +This week we'll eat without guilt, and kick off our membership campaign, + ...by force-feeding a box of cornstarch to a skinny person. + -- Garfield +%% +Do you guys know what you're doing, or are you just hacking? +%% +Do you know, I think that Dr. Swift was silly to laugh about Laputa. +I believe it is a mistake to make a mock of people, just because they +think. There are ninety thousand people in this world who do not +think, for every one who does, and these people hate the thinkers +like poison. Even if some thinkers are fanciful, it is wrong to make +fun of them for it. Better to think about cucumbers even, than not +to think at all. + -- T.H. White +%% +Do you know Montana? +%% +Do you suffer painful elimination? + -- Don Knuth, "Structured Programming with Gotos" + +Do you suffer painful recrimination? + -- Nancy Boxer, "Structured Programming with Come-froms" + +Do you suffer painful illumination? + -- Isaac Newton, "Optics" + +Do you suffer painful hallucination? + -- Don Juan, cited by Carlos Casteneda +%% +Do you think your mother and I should have lived +comfortably so long together if ever we had been married? +%% +Do you want to know what's ahead for you, in your happiness at home, +your business success? Here's a telling test: Look in the mirror. Is +your skin smooth and lovely, your hair gleaming, your make-up glamorous? +Are you slender enough for your height? Do you stand erect, confident? +Yes? Then you are on your way to success as a woman. + -- Ladies Home Journal, 1947 advertisement +%% +Do your part to help preserve life on +Earth -- by trying to preserve your own. +%% +Documentation is like sex: when it is good, it is very, +very good; and when it is bad, it is better than nothing. + -- Dick Brandon +%% +Documentation is the castor oil of programming. +Managers know it must be good because the programmers hate it so much. +%% + Does anyone know how to get chocolate syrup and honey out of a +white electric blanket? I'm afraid to wash it in the machine. + +Thanks, Kathy. (front desk, x17) + +p.s. Also, anyone ever used Noxema on friction burns? + Or is Vaseline better? +%% +Does it rape elephants? + -- Brent Byer +%% +Does the name Pavlov ring a bell? +%% +Doin' it in the dark, down in Rock Creek Park. +%% +Doing gets it done. +%% +Domestic happiness and faithful friends. +%% +Don +Ameche: I didn't know you had a cousin Penelope, Bill! + Was she pretty? +W.C.: Well, her face was so wrinkled it looked like seven miles of + bad road. She had so many gold teeth, Don, she use to have + to sleep with her head in a safe. She died in Bolivia. +Don: Oh Bill, it must be hard to lose a relative. +W.C.: It's almost impossible. + + -- W.C. Fields, "The Further Adventures of Larson E. + Whipsnade and other Tarradiddles" +%% +Don't I know you? +%% +Don't Worry, Be Happy. + -- Meher Baba +%% +Don't abandon hope. +Your Captain Midnight decoder ring arrives tomorrow. +%% +Don't be concerned, it will not harm you, +It's only me pursuing something I'm not sure of, +Across my dreams, with neptive wonder, +I chase the bright elusive butterfly of love. +%% +Don't be humble, you're not that great. + -- Golda Meir +%% +Don't be irreplaceable. If you can't +be replaced, you cannot be promoted. +%% +Don't be overly suspicious where it's not warranted. +%% +Don't believe everything you hear or anything you say. +%% +Don't compare floating point numbers solely for equality. +%% +Don't confuse things that need action +with those that take care of themselves. +%% +Don't cook tonight -- starve a rat today! +%% +Don't crush that dwarf, hand me the pliers! + -- Firesign Theatre +%% +Don't despair; your ideal lover is waiting for you around the corner. +%% +Don't do unto others as you would they should do unto you. +Their tastes may not be the same. + -- G.B. Shaw +%% +Don't drink when you drive -- you might hit a bump and spill it. +%% +Don't eat yellow snow. +%% +Don't ever slam a door; you might want to go back. +%% +Don't everyone thank me at once! + -- Han Solo +%% +Don't expect people to keep in step-- +it's hard enough just staying in line. +%% +Don't feed the bats tonight. +%% +Don't force it, get a larger hammer. + -- Anthony +%% +Don't get mad, get interest. +%% +Don't get stuck in a closet -- wear yourself out. +%% +Don't get to bragging. +%% +Don't go around saying the world owes you a living. +The world owes you nothing. It was here first. + -- Mark Twain +%% +Don't go surfing in South Dakota for a while. +%% +Don't go to bed with no price on your head. + -- Baretta +%% +Don't guess - check your security regulations. +%% +Don't hate yourself in the morning -- sleep till noon. +%% +Don't have good ideas if you aren't willing to be responsible for them. +%% +Don't hit the keys so hard, it hurts. +%% +Don't interfere with the stranger's style. +%% +Don't kid yourself. Little is relevant, and nothing lasts forever. +%% +Don't kiss an elephant on the lips today. +%% +Don't knock President Fillmore. He kept us out of Vietnam. +%% +Don't let nobody tell you what you cannot do; +don't let nobody tell you what's impossible for you; +don't let nobody tell you what you got to do, +or you'll never know ... what's on the other side of the rainbow... +remember, if you don't follow your dreams, +you'll never know what's on the other side of the rainbow... + -- melba moore, "the other side of the rainbow" +%% +Don't let your status become too quo! +%% +Don't look back, the lemmings are gaining on you. +%% +Don't look now, but the man in the moon is laughing at you. +%% +Don't look now, but there is a multi-legged creature on your shoulder. +%% +Don't make a big deal out of everything; just deal with everything. +%% +Don't marry for money; you can borrow it cheaper. + -- Scottish Proverb +%% +Don't mind him; politicians always sound like that. +%% +Don't plan any hasty moves. +You'll be evicted soon anyway. +%% +Don't put off for tomorrow what you can do today because +if you do it today, you can do it again tomorrow. +%% +Don't put too fine a point to your wit for fear it should get blunted. + -- Miguel de Cervantes +%% +Don't quit now, we might just as well +lock the door and throw away the key. +%% +Don't read any sky-writing for the next two weeks. +%% +Don't read everything you believe. +%% +Don't relax! It's only your tension that's holding you together. +%% +Don't shoot until you're sure you both aren't on the same side. +%% +Don't speak about Time, until you have spoken to him. +%% +Don't sweat it -- it's only ones and zeros. + -- P. Skelly +%% +Don't take life seriously, you'll never get out alive. +%% +Don't tell any big lies today. Small ones can be just as effective. +%% +Don't tell me that worry doesn't do any good. +I know better. The things I worry about don't happen. + -- Watchman Examiner +%% +Don't tell me what you dream'd last night for I've been reading Freud. +%% +Don't try to have the last word -- you might get it. + -- Lazarus Long +%% +Don't vote - it only encourages them! +%% +Don't wake me up too soon... +Gonna take a ride across the moon... +You and me. +%% +Don't worry. Life's too long. + -- Vincent Sardi, Jr. +%% +Don't worry -- the brontosaurus is slow, stupid, and placid. +%% +Don't worry about people stealing your ideas. If your ideas +are any good, you'll have to ram them down people's throats. + -- Howard Aiken +%% +Don't worry about the world coming to an end today. +It's already tomorrow in Australia. + -- Charles Schultz +%% +Don't worry if you're a kleptomaniac, +you can always take something for it. +%% +Don't worry over what other people are thinking about you. +They're too busy worrying over what you are thinking about them. +%% +Don't worry so loud, your roommate can't think. +%% +Don't you feel more like you do now than you did when you came in? +%% +Don't you wish that all the people who sincerely +want to help you could agree with each other? +%% +Don't you wish you had more energy... or less ambition? +%% +Dope will get you through times of no money +better than money will get you through times of no dope! + -- Freewheelin' Franklin, "The Fabulous Furry Freak Brothers" +%% +Dorothy: But how can you talk without a brain? +Scarecrow: Well, I don't know... but some people + without brains do an awful lot of talking. + -- The Wizard of Oz +%% +Double! +%% +Double Bucky, you're the one, +You make my keyboard so much fun, +Double Bucky, an additional bit or two, (Vo-vo-de-o) +Control and meta, side by side, +Augmented ASCII, 9 bits wide! +Double Bucky, a half a thousand glyphs, plus a few! + +Oh, I sure wish that I, +Had a couple of bits more! +Perhaps a set of pedals to make the number of bits four. + +Double Double Bucky! Double Bucky left and right +OR'd together, outta sight! +Double Bucky, I'd like a whole word of, +Double Bucky, I'm happy I heard of, +Double Bucky, I'd like a whole word of you! + -- to Nicholas Wirth, who suggested that an extra bit + be added to terminal codes on 36-bit machines for use + by screen editors. [to the tune of "Rubber Ducky"] +%% +Down with the categorical imperative! +%% +Dow's Law: + In a hierarchical organization, + the higher the level, the greater the confusion. +%% +Dr. Fritzkee's Lucky Astrology Diet + +The problem with the diets of today is that most women who do achieve +that magic weight, seventy-six pounds, are still fat. Dr. Fritzkee's +Lucky Astrology Diet is a sure-fire method of reducing with the added +luxury that you never feel hungry. + +Here's how the diet works: + + FOODS ALLOWED +First Month: One egg +Second Month: A raisin +Third Month: Pumpkin pie with whipped cream and chocolate sauce. + +If after the third month you haven't gotten to your dream weight, try +lopping off parts of your body until those scales tip just right for you. +%% +Dr. Jekyll had something to Hyde. +%% + Dr. Oliver Wendell Holmes of Harvard Medical School inhaled ether +at a time when it was popularly supposed to produce such mystical or +"mind-expanding" experiences, much as LSD is supposed to produce such +experiences today. Here is his account of what happened: + "I once inhaled a pretty full dose of ether, with the determination +to put on record, at the earliest moment of regaining consciousness, the +thought I should find uppermost in my mind. The mighty music of the triumphal +march into nothingness reverberated through my brain, and filled me with a +sense of infinite possibilities, which made me an archangel for a moment. +The veil of eternity was lifted. The one great truth which underlies all +human experience and is the key to all the mysteries that philosophy has +sought in vain to solve, flashed upon me in a sudden revelation. Henceforth +all was clear: a few words had lifted my intelligence to the level of the +knowledge of the cherubim. As my natural condition returned, I remembered +my resolution; and, staggering to my desk, I wrote, in ill-shaped, straggling +characters, the all-embracing truth still glimmering in my consciousness. +The words were these (children may smile; the wise will ponder): +`A strong smell of turpentine prevails throughout.'" + -- The Consumers Union Report: Licit & Illicit Drugs +%% +Draft beer, not people. +%% +Drakenberg's Discovery: + If you can't seem to find your glasses, + it's probably because you don't have them on. +%% +Drawing on my fine command of language, I said nothing. +%% +Dreams are free, but there's a small charge for alterations. +%% +Dreams are free, but you get soaked on the connect time. +%% +Drew's Law of Highway Biology: + The first bug to hit a clean windshield + lands directly in front of your eyes. +%% +Drilling for oil is boring. +%% +Drinking is not a spectator sport. + -- Jim Brosnan +%% +Drive defensively, buy a tank. +%% +Drop that pickle! +%% +Drop the vase and it will become a Ming of the past. + -- The Adventurer +%% +Drugs may be the road to nowhere, but at least they're the scenic route! +%% +Ducharme's Precept: + Opportunity always knocks at the least opportune moment. + +Ducharme's Axiom: + If you view your problem closely enough you will recognize + yourself as part of the problem. +%% +Duckies are fun! +%% +Ducks? What ducks?? +%% +Duct tape is like the force. It has a light side, +and a dark side, and it holds the universe together. + -- Carl Zwanzig +%% +Due to a shortage of devoted followers, the +production of great leaders has been discontinued. +%% +Due to circumstances beyond your control, +you are master of your fate and captain of your soul. +%% +Dungeons and Dragons is just a lot of Saxon Violence. +%% + During a grouse hunt in North Carolina two intrepid sportsmen were +blasting away at a clump of trees near a stone wall. Suddenly a red-face +country squire popped his head over the wall and shouted, "Hey, you almost +hit my wife." + "Did I?" cried one hunter, aghast. "Terribly sorry. Have a shot +at mine, over there." +%% +During the next two hours, the VAX will be going up and down +several times, often with lin~po_~{po ~poz~ppo\~{ o n~po_~ +{o[po ~poodsou>#w4k**n~po_~{ol;lkld;f;g;dd;po\~{o +%% +During the voyage of life, remember to keep an eye out for a +fair wind; batten down during a storm; hail all passing ships; +and fly your colors proudly. +%% +Duty, n: + What one expects from others. + -- Oscar Wilde +%% +Dying is a very dull, dreary affair. And my advice +to you is to have nothing whatever to do with it. + -- W. Somerset Maughm +%% +E = MC ** 2 +- 3db +%% +E Pluribus UNIX. +%% +Egotism, n: + Doing the New York Times crossword puzzle with a pen. + +Egotist, n: + A person of low taste, more interested in himself than me. +%% +Electrocution, n: + Burning at the stake with all the modern improvements. +%% +Elephant, n: + A mouse built to government specifications. +%% +Elliptical, n: + The feel of a kiss. +%% +Engram, n: + 1. The physical manifestation of human memory -- "the engram." +2. A particular memory in physical form. [Usage note: this term is no longer +in common use. Prior to Wilson and Magruder's historic discovery, the nature +of the engram was a topic of intense speculation among neuroscientists, +psychologists, and even computer scientists. In 1994 Professors M. R. Wilson +and W. V. Magruder, both of Mount St. Coax University in Palo Alto, proved +conclusively that the mammalian brain is hardwired to interpret a set of +thirty seven genetically transmitted cooperating TECO macros. Human memory +was shown to reside in 1 million Q-registers as Huffman coded uppercase-only +ASCII strings. Interest in the engram has declined substantially since that +time.] + -- New Century Unabridged English Dictionary, + 3rd edition, 2007 A.D. +%% +Entreprenuer, n: + A high-rolling risk taker who would rather + be a spectacular failure than a dismal success. +%% +Envy, n: + Wishing you'd been born with an unfair advantage, + instead of having to try and acquire one. +%% +Erogenous zone, n: + The skin you touch to love. +%% +E.T. GO HOME!!! (And take your Smurfs with you.) +%% +Etymology, n: + Some early etymological scholars came up with derivations that + were hard for the public to believe. The term 'etymology' was + formed from the Latin 'etus' ("eaten"), the root 'mal' ("bad"), + and 'logy' ("study of"). It meant "the study of things that are + hard to swallow." + -- Mike Kellen +%% +Expense accounts, n: + Corporate food stamps. +%% +Each man is his own prisoner, in solitary confinement for life. +%% +Each of us bears his own Hell. + -- Publius Vergilius Maro (Virgil) +%% +Early to bed and early to rise and you'll +be groggy when everyone else is wide awake. +%% +Early to rise and early to bed makes +a man healthy and wealthy and dead. + -- James Thurber +%% +Earn cash in your spare time -- blackmail your friends. +%% +Earth Destroyed by Solar Flare -- film clips at eleven. +%% +/Earth is 98% full ... please delete anyone you can. +%% +Earth is a great funhouse without the fun. + -- Jeff Berner +%% +Easiest Color to Solve on a Rubik's Cube: Black. + +Simply remove all the little colored stickers on the cube, and each of +side of the cube will now be the original color of the plastic underneath +-- black. According to the instructions, this means the puzzle is solved. +%% +Easy come and easy go, + some call me easy money, +Sometimes life is full of laughs, + and sometimes it ain't funny +You may think that I'm a fool + and sometimes that is true, +But I'm goin' to heaven in a flash of fire, + with or without you. + -- Hoyt Axton +%% +Eat drink and be merry! Tommorrow you may be in Utah. +%% +Eat prune yogurt for that "get up and go" feeling. +%% +Economics is extremely useful as a form of employment for economists. + -- John Kenneth Galbraith +%% +Economists are still trying to figure out why the +girls with the least principle draw the most interest. +%% +Editing is a rewording activity. +%% +Higher education helps your earning capacity. Ask any college professor. +%% +Education is an admirable thing, but it is well to +remember that nothing that is worth knowing can be taught. + -- Oscar Wilde +%% +Education is what survives when what has been learnt has been forgotten. + -- B.F. Skinner +%% +Eeny, Meeny, Jelly Beanie, +The spirits are about to speak... +%% +Eggheads unite! You have nothing to lose but your yolks. + -- Adlai Stevenson +%% +Ego sum ens omnipotens +%% +Egotism is the anesthetic given by a kindly nature +to relieve the pain of being a damned fool. + -- Bellamy Brooks +%% +Ehrman's Commentary: + 1. Things will get worse before they get better. + 2. Who said things would get better? +%% +Eighteen goddess-like daughters are not equal to one son with a hump. + -- Chinese Proverb +%% +Eighty percent of air pollution comes from plants and trees. + -- Ronald Reagan, famous movie star +%% +Eisenhower was very nice, +Nixon was his only vice. + -- C. Degen +%% +Either I'm dead or my watch has stopped. + -- Groucho Marx' last words +%% +Eleanor Rigby +Sits at the keyboard and waits for a line on the screen +Lives in a dream +Waits for a signal, finding some code that will + make the machine do some more. +What is it for? +All the lonely users, where do they all come from? +All the lonely users, why does it take so long? +%% +Electrical Engineers do it with less resistance. +%% +Elegance and truth are inversely related. + -- Becker's Razor +%% +Elevators smell different to midgets. +%% +Eli and Bessie went to sleep. +In the middle of the night, Bessie nudged Eli. + "Please be so kindly and close the window. It's cold outside!" +Half asleep, Eli murmured, + "Nu ... so if I'll close the window, will it be warm outside?" +%% +Elliptic paraboloids for sale. +%% +Eloquence is logic on fire. +%% +Emersons' Law of Contrariness: + Our chief want in life is somebody who shall make us do + what we can. Having found them, we shall then hate them + for it. +%% +Encyclopedia for sale by father. +Son knows everything. +%% +Endless Loop: n. see Loop, Endless. +Loop, Endless: n. see Endless Loop. + -- Random Shack Data Processing Dictionary +%% +Endless the world's turn, endless the sun's spinning +Endless the quest; +I turn again, back to my own beginning, +And here, find rest. +%% +Enjoy your life; be pleasant and gay, like the birds in May. +%% +Enjoy yourself while you're still old. +%% +Entropy isn't what it used to be. +%% +Entropy requires no maintenance. + -- Markoff Chaney +%% +Envy is a pain of mind that successful men cause their neighbors. + -- Onasander +%% +Enzymes are things invented by biologists +that explain things which otherwise require harder thinking. + -- Jerome Lettvin +%% +Equal bytes for women. +%% +Es brilig war. Die schlichte Toven + Wirrten und wimmelten in Waben; +Und aller-mumsige Burggoven + Dir mohmen Rath ausgraben. +%% +Eschew obfuscation. +%% +Established technology tends to persist in the face of new technology. + -- G. Blaauw, one of the designers of System 360 +%% +Eternal nothingness is fine if you happen to be dressed for it. + -- Woody Allen +%% +Etiquette is for those with no breeding; +fashion for those with no taste. +%% +Eureka! + -- Archimedes +%% +Even God cannot change the past. + -- Joseph Stalin +%% +Even God lends a hand to honest boldness. + -- Menander +%% +Even a cabbage may look at a king. +%% +Even a hawk is an eagle among crows. +%% +Even bytes get lonely for a little bit. +%% +Even if you do learn to speak correct +English, whom are you going to speak it to? + -- Clarence Darrow +%% +Even if you persuade me, you won't persuade me. + -- Aristophanes +%% +Even in the moment of our earliest kiss, +When sighed the straitened bud into the flower, +Sat the dry seed of most unwelcome this; +And that I knew, though not the day and hour. +Too season-wise am I, being country-bred, +To tilt at autumn or defy the frost: +Snuffing the chill even as my fathers did, +I say with them, "What's out tonight is lost." +I only hoped, with the mild hope of all +Who watch the leaf take shape upon the tree, +A fairer summer and a later fall +Than in these parts a man is apt to see, +And sunny clusters ripened for the wine: +I tell you this across the blackened vine. + -- Edna St. Vincent Millay, "Even in the Moment o + Our Earliest Kiss", 1931 +%% +Even moderation ought not to be practiced to excess. +%% +Even the best of friends cannot attend each other's funeral. + -- Kehlog Albran +%% +Even though they raised the rate for first class mail in the United +States we really shouldn't complain -- it's still only 2 cents a day. +%% +Evening hours "all clear" for romance! +(Tell mate you have to work late.) +%% +Events are not affected, they develop. + -- Sri Aurobindo +%% +Ever Onward! Ever Onward! +That's the sprit that has brought us fame. +We're big but bigger we will be, +We can't fail for all can see, that to serve humanity +Has been our aim. +Our products now are known in every zone. +Our reputation sparkles like a gem. +We've fought our way thru +And new fields we're sure to conquer, too +For the Ever Onward IBM! + -- Ever Onward, from the 1940 IBM Songbook +%% +Ever Onward! Ever Onward! +We're bound for the top to never fall, +Right here and now we thankfully +Pledge sincerest loyalty +To the corporation that's the best of all +Our leaders we revere and while we're here, +Let's show the world just what we think of them! +So let us sing men -- Sing men +Once or twice, then sing again +For the Ever Onward IBM! + -- Ever Onward, from the 1940 IBM Songbook +%% +Ever feel like you're the head pin on life's +bowling alley, and everyone's rolling strikes? +%% +Ever get the feeling that the world's +on tape and one of the reels is missing? + -- Rich Little +%% +Ever notice that even the busiest people are +never too busy to tell you just how busy they are? +%% +Ever wonder why fire engines are red? + +Because newspapers are read too. +Two and Two is four. +Four and four is eight. +Eight and four is twelve. +There are twelve inches in a ruler. +Queen Mary was a ruler. +Queen Mary was a ship. +Ships sail the sea. +There are fishes in the sea. +Fishes have fins. +The Fins fought the Russians. +Russians are red. +Fire engines are always rush'n. +Therefore fire engines are red. +%% +Ever wondered about the origins of the term "bugs" as applied to computer +technology? U.S. Navy Capt. Grace Murray Hopper has firsthand explanation. +The 74-year-old captain, who is still on active duty, was a pioneer in +computer technology during World War II. At the C.W. Post Center of Long +Island University, Hopper told a group of Long Island public school adminis- +trators that the first computer "bug" was a real bug--a moth. At Harvard +one August night in 1945, Hopper and her associates were working on the +"granddaddy" of modern computers, the Mark I. "Things were going badly; +there was something wrong in one of the circuits of the long glass-enclosed +computer," she said. "Finally, someone located the trouble spot and, using +ordinary tweezers, removed the problem, a two-inch moth. From then on, when +anything went wrong with a computer, we said it had bugs in it." Hopper +said that when the veracity of her story was questioned recently, "I referred +them to my 1945 log book, now in the collection of the Naval Surface Weapons +Center, and they found the remains of that moth taped to the page in +question." + [actually, the term "bug" had even earlier usage in + regard to problems with radio hardware. Ed.] +%% +Every 4 seconds a woman has a baby. +Our problem is to find this woman and stop her. +%% +Every cloud engenders not a storm. + -- William Shakespeare, "Henry VI" +%% +Every cloud has a silver lining; +you should have sold it, and bought titanium. +%% +Every creature has within him the wild, uncontrollable urge to punt. +%% +Every dog has its day, but the nights belong to the pussycats. +%% +Every gun that is made, every warship launched, every rocket fired +signifies in the final sense, a theft from those who hunger and are not +fed, those who are cold and are not clothed. This world in arms is not +spending money alone. It is spending the sweat of its laborers, the +genius of its scientists, the hopes of its children. This is not +a way of life at all in any true sense. Under the clouds of war, it +is humanity hanging on a cross of iron. + -- Dwight Eisenhower, 1953 +%% +Every harlot was a virgin once. + -- William Blake +%% +Every little picofarad has a nanohenry all its own. + -- Don Vonada +%% +Every man is apt to form his notions of things difficult to be apprehended, +or less familiar, from their analogy to things which are more familiar. +Thus, if a man bred to the seafaring life, and accustomed to think and talk +only of matters relating to navigation, enters into discourse upon any other +subject; it is well known, that the language and the notions proper to his +own profession are infused into every subject, and all things are measured +by the rules of navigation: and if he should take it into his head to +philosophize concerning the faculties of the mind, it cannot be doubted, +but he would draw his notions from the fabric of the ship, and would find +in the mind, sails, masts, rudder, and compass. + -- Thomas Reid, "An Inquiry into the Human Mind", 1764 +%% +Every man is as God made him, ay, and often worse. + -- Miguel de Cervantes +%% +Every man takes the limits of his own field +of vision for the limits of the world. + -- Schopenhauer +%% +Every man who is high up likes to think that he has done +it all himself, and the wife smiles and lets it go at that. + -- Barrie +%% +Every morning is a Smirnoff morning. +%% +Every nation has the government it deserves. + -- Joseph De Maistre +%% +Every night my prayers I say, + And get my dinner every day; +And every day that I've been good, + I get an orange after food. +The child that is not clean and neat, + With lots of toys and things to eat, +He is a naughty child, I'm sure-- + Or else his dear papa is poor. + -- Robert Louis Stevenson +%% +Every paper published in a respectable journal should have a preface by +the author stating why he is publishing the article, and what value he +sees in it. I have no hope that this practice will ever be adopted. + -- Morris Kline +%% +Every path has its puddle. +%% +Every person, all the events in your life are there because you have +drawn them there. What you choose to do with them is up to you. + -- Messiah's Handbook : Reminders for the Advanced Soul +%% +Every program has at least one bug and can be shortened by at least one +instruction -- from which, by induction, one can deduce that every program +can be reduced to one instruction which doesn't work. +%% +Every program has (at least) two purposes: + the one for which it was written and another for which it wasn't. +%% +Every silver lining has a cloud around it. +%% +Every successful person has had failures +but repeated failure is no guarantee of eventual success. +%% +Every time I look at you I am more convinced of Darwin's theory. +%% +Every time I lose weight, it finds me again! +%% +Every time I think I know where it's at, they move it. +%% +Every time you manage to close the door on +Reality, it comes in through the window. +%% +Every why hath a wherefore. + -- William Shakespeare, "A Comedy of Errors" +%% +Every word is like an unnecessary stain on silence and nothingness. + -- Beckett +%% +Everybody but Sam had signed up for a new company pension plan that +called for a small employee contribution. The company was paying all +the rest. Unfortunately, 100% employee participation was needed; +otherwise the plan was off. Sam's boss and his fellow workers pleaded +and cajoled, but to no avail. Sam said the plan would never pay off. +Finally the company president called Sam into his office. + "Sam," he said, "here's a copy of the new pension plan and here's +a pen. I want you to sign the papers. I'm sorry, but if you don't sign, +you're fired. As of right now." + Sam signed the papers immediately. + "Now," said the president, "would you mind telling me why you +couldn't have signed earlier?" + "Well, sir," replied Sam, "nobody explained it to me quite so +clearly before." +%% +Everybody has something to conceal. + -- Humphrey Bogart +%% +Everybody is somebody elses weirdo. + -- Dykstra +%% +Everybody needs a little love sometime; +stop hacking and fall in love! +%% +Everybody wants to go to heaven, but nobody wants to die. +%% +Everyone can be taught to sculpt: Michelangelo would have had +to be taught how not to. So it is with the great programmers. +%% +Everyone complains of his memory, no one of his judgement. +%% +Everyone hates me because I'm paranoid. +%% +Everyone is entitled to my opinion. +%% +Everyone is in the best seat. + -- John Cage +%% +Everyone is more or less mad on one point. + -- Rudyard Kipling +%% +Everyone knows that dragons don't exist. But while this simplistic +formulation may satisfy the layman, it does not suffice for the +scientific mind. The School of Higher Neantical Nillity is in fact +wholly unconcerned with what DOES exist. Indeed, the banality of +existence has been so amply demonstrated, there is no need for us +to discuss it any further here. The brilliant Cerebron, attacking +the problem analytically, discovered three distinct kinds of dragon: +the mythical, the chimerical, and the purely hypothetical. They were +all, one might say, nonexistent, but each nonexisted in an entirely +different way... +%% +Everyone's in a high place when you're on your knees. +%% +Everything bows to success, even grammar. +%% +Everything in this book may be wrong. + -- Messiah's Handbook : Reminders for the Advanced Soul +%% +Everything is controlled by a small evil group +to which, unfortunately, no one we know belongs. +%% +Everything might be different in the present +if only one thing had been different in the past. +%% +Everything should be built top-down, except the first time. +%% +Everything should be made as simple as possible, but not simpler. + -- Albert Einstein +%% +Everything takes longer, costs more, and is less useful. + -- Erwin Tomash +%% +Everything that you know is wrong, but you can be straightened out. +%% +Everything will be just tickety-boo today. +%% +Everything you know is wrong! +%% +Everything you've learned in school as "obvious" becomes less and less +obvious as you begin to study the universe. For example, there are no +solids in the universe. There's not even a suggestion of a solid. There +are no absolute continuums. There are no surfaces. There are no +straight lines. + -- R. Buckminster Fuller +%% +Everywhere you go you'll see them searching, +Everywhere you turn you'll feel the pain, +Everyone is looking for the answer, +Well look again. + -- Moody Blues, "Lost in a Lost World" +%% +Evolution is a million line computer +program falling into place by accident. +%% +Examinations are formidable even to the best prepared, for +even the greatest fool may ask more the the wisest man can answer. + -- C.C. Colton +%% +Excellent day for drinking heavily. +Spike the office water cooler. +%% +Excellent day to have a rotten day. +%% +Excellent time to become a missing person. +%% +Exceptions prove the rule, and wreck the budget. + -- Miller +%% +Excess on occasion is exhilarating. It prevents +moderation from acquiring the deadening effect of a habit. + -- W. Somerset Maugham +%% +Excessive login messages is a sure sign of senility. +%% +Execute every act of thy life as though it were thy last. + -- Marcus Aurelius +%% +Executive ability is prominent in your make-up. +%% +Exercise caution in your daily affairs. +%% +Expansion means complexity; and complexity decay. +%% +Expect a letter from a friend who will ask a favor of you. +%% +Expect the worst, it's the least you can do. +%% +Expedience is the best teacher. +%% +Experience is not what happens to you; +it is what you do with what happens to you. + -- Aldous Huxley +%% +Experience is that marvelous thing that enables +you recognize a mistake when you make it again. + -- F.P. Jones +%% +Experience is the worst teacher. It always +gives the test first and the instruction afterward. +%% +Experience is what causes a person +to make new mistakes instead of old ones. +%% +Experience is what you get when you were expecting something else. +%% +Experience varies directly with equipment ruined. +%% +Experience, n: + Something you don't get until just after you need it. + -- Olivier +%% +Experiments must be reproducible; they should all fail in the same way. +%% +External Security: +%% +Extreme fear can neither fight nor fly. + -- William Shakespeare, "The Rape of Lucrece" +%% +F u cn rd ths u cnt spl wrth a dm! +%% +FACILITY REJECTED 100044200000; +%% +Fairy tale: + A horror story to prepare children for the newspapers. +%% +Faith, n: + That quality which enables us to + believe what we know to be untrue. +%% +Fakir, n: + A psychologist whose charismatic data have inspired almost + religious devotion in his followers, even though the sources + seem to have shinnied up a rope and vanished. +%% +Female rabbits: + The gift that just "keeps on giving." +%% +Fidelity, n: + A virtue peculiar to those who are about to be betrayed. +%% +File cabinet: + A four drawer, manually activated trash compactor. +%% +Fishbowl, n: + A glass-enclosed isolation cell where newly + promoted managers are kept for observation. +%% +FLASH! +Intelligence of mankind decreasing. +Details at ... uh, when the little hand is on the .... +%% +Foolproof Operation: + No provision for adjustment. +%% +FORCE YOURSELF TO RELAX! +%% +Forecast, n: + A prediction of the future, based on the past, for + which the forecaster demands payment in the present. +%% +Forgetfulness, n: + A gift of God bestowed upon debtors in compensation for + their destitution of conscience. +%% +FORTH IF HONK THEN +%% +FORTRAN is a good example of a language +which is easier to parse using ad hoc techniques. + -- D. Gries + [What's good about it? Ed.] +%% +FORTRAN is not a flower but a weed -- it is hardy, +occasionally blooms, and grows in every computer. + -- A.J. Perlis +%% +FORTRAN is the language of Powerful Computers. + -- Steven Feiner +%% +FORTRAN rots the brain. + -- John McQuillin +%% +FORTRAN, "the infantile disorder", by now nearly 20 years old, is +hopelessly inadequate for whatever computer application you have +in mind today: it is now too clumsy, too risky, and too expensive +to use. + -- E.W. Dijkstra +%% +[FORTRAN] will persist for some time -- +probably for at least the next decade. + -- T. Cheatham +%% +Friends, n: + People who borrow your books and set wet glasses on them. + + People who know you well, but like you anyway. +%% + FROM THE DESK OF + Dorothy Gale + + Auntie Em: + Hate you. + Hate Kansas. + Taking the dog. + Dorothy +%% +F.S. Fitzgerald to Hemingway: + "Ernest, the rich are different from us." +Hemingway: + "Yes. They have more money." +%% +Facts, apart from their relationships, are like labels on empty bottles. + -- Sven Italla +%% +Facts are the enemy of truth. + -- Don Quixote +%% +Facts do not cease to exist because they are ignored. + -- Aldous Huxley +%% +Failure is more frequently from want of energy than want of capital. +%% +Fain would I climb, yet fear I to fall. + -- Sir Walter Raleigh +%% +Faith goes out through the window when beauty comes in at the door. +%% +Faith is the quality that enables you to eat blackberry jam +on a picnic without looking to see whether the seeds move. +%% +Fall not in love; it will stick to your face. + -- Deteriorata +%% +Falling in love is a lot like dying. +You never get to do it enough to become good at it. +%% +Familiarity breeds attempt. +%% +Familiarity breeds contempt -- and children. + -- Mark Twain +%% +Families, when a child is born +Want it to be intelligent. +I, through intelligence, +Having wrecked my whole life, +Only hope the baby will prove +Ignorant and stupid. +Then he will crown a tranquil life +By becoming a Cabinet Minister + -- Su Tung-p'o +%% +Famous last words: +%% +Famous last words: + 1: Don't unplug it, it will just take a moment to fix. + 2: Let's take the shortcut, he can't see us from there. + 3: What happens if you touch these two wires tog... + 4: We won't need reservations. + 5: It's always sunny there this time of the year. + 6: Don't worry, it's not loaded. + 7: They'd never (be stupid enough to) make him a manager. + 8: Don't worry! Women love it! +%% +Famous last words: + 1: Everything that you'll need to know is in the manual. + 2: You and what army? + 3: Don't worry, I can handle it. + 4: If you were as smart as you think you are, you wouldn't + be a cop. + 5: I don't see how they make a profit + out of this stuff at a dollar and a quarter a fifth. + 6: We're just getting into semantics again. + 7: Everything's under control. + 8: He's an asshole! Don't try to "shush" me! +%% +"Fantasies are free." +"NO!! NO!! It's the thought police!!!!" +%% +Far duller than a serpent's tooth it is to spend a quiet youth. +%% +Far out in the uncharted backwaters of the unfashionable end of the Western +Spiral arm of the Galaxy lies a small unregarded yellow sun. Orbiting this +at a distance of roughly ninety-eight million miles is an utterly +insignificant little blue-green planet whose ape-descended life forms are +so amazingly primitive that they still think digital watches are a pretty +neat idea. + -- Douglas Adams, "The Hitchhicker's Guide to the Galaxy" +%% +Farmers in the Iowa State survey rated +machinery breakdowns more stressful than divorce. + -- Wall Street Journal +%% +Fashion is a form of ugliness so intolerable +that we have to alter it every six months. + -- Oscar Wilde +%% +Fashions have done more harm than revolutions. + -- Victor Hugo +%% +Fast ship? You mean you've never heard of the Millennium Falcon? + -- Han Solo +%% +Faster, faster, you fool, you fool! + -- Bill Cosby +%% +Father: Son, it's time we talked about sex. +Son: Sure, Dad, what do you want to know? +%% +Fats Loves Madelyn. +%% +Fear and loathing, my man, fear and loathing. + -- H.S. Thompson +%% +Fear is the greatest salesman. + -- Robert Klein +%% +Federal grants are offered for... research into the recreation +potential of interplanetary space travel for the culturally +disadvantaged. +%% +Feel disillusioned? +I've got some great new illusions, right here! +%% +Fellow programmer, greetings! You are reading a letter which will bring +you luck and good fortune. Just mail (or UUCP) ten copies of this letter +to ten of your friends. Before you make the copies, send a chip or +other bit of hardware, and 100 lines of 'C' code to the first person on the +list given at the bottom of this letter. Then delete their name and add +yours to the bottom of the list. + +Don't break the chain! Make the copy within 48 hours. Gerald R. of San +Diego failed to send out his ten copies and woke the next morning to find +his job description changed to "COBOL programmer." Fred A. of New York sent +out his ten copies and within a month had enough hardware and software to +build a Cray dedicated to playing Zork. Martha H. of Chicago laughed at +this letter and broke the chain. Shortly thereafter, a fire broke out in +her terminal and she now spends her days writing documentation for IBM PC's. + +Don't break the chain! Send out your ten copies today! +%% +Feminists just want the human race to be a tie. +%% +Fertility is hereditary. If your parents +didn't have any children, neither will you. +%% +Fess: Well, you must admit there is something innately humorous about + a man chasing an invention of his own halfway across the galaxy. +Rod: Oh yeah, it's a million yuks, sure. But after all, isn't that the + basic difference between robots and humans? +Fess: What, the ability to form imaginary constructs? +Rod: No, the ability to get hung up on them. + -- Christopher Stasheff, "The Warlock in Spite of Himself" +%% +Fifteen men on a dead man's chest, +Yo-ho-ho and a bottle of rum! +Drink and the devil had done for the rest, +Yo-ho-ho and a bottle of rum! + -- Stevenson, "Treasure Island" +%% +Fifth Law of Applied Terror: + If you are given an open-book exam, you will forget your book. +Corollary: + If you are given a take-home exam, you will forget where you live. +%% +Fill what's empty, empty what's full, scratch where it itches. + -- Alice Roosevelt Longworth +%% +Finagle's Creed: + Science is true. Don't be misled by facts. +%% +Finagle's Eighth Law: + If an experiment works, something has gone wrong. + +Finagle's Ninth Law: + No matter what results are expected, + someone is always willing to fake it. + +Finagle's Tenth Law: + No matter what the result someone + is always eager to misinterpret it. + +Finagle's Eleventh Law: + No matter what occurs, someone believes + it happened according to his pet theory. +%% +Finagle's First Law: + To study a subject best, understand it thoroughly before you start. + +Finagle's Second Law: + Always keep a record of data -- it indicates you've been working. + +Finagle's Fourth Law: + Once a job is fouled up, + anything done to improve it only makes it worse. + +Finagle's Fifth Law: + Always draw your curves, then plot your readings. + +Finagle's Sixth Law: + Don't believe in miracles -- rely on them. +%% +Finagle's Law: + The perversity of the universe tends toward a maximum. +%% +Finagle's Seventh Law: + The perversity of the universe tends toward a maximum. +%% +Finagle's Third Law: + In any collection of data, the figure most obviously correct, + beyond all need of checking, is the mistake. + +Corollaries: + 1. Nobody whom you ask for help will see it. + 2. The first person who stops by, whose advice you really + don't want to hear, will see it immediately. +%% +Fine day for friends. +So-so day for you. +%% +Fine day to throw a party. Throw him as far as you can. +%% +Fine day to work off excess energy. Steal something heavy. +%% +First Law of Bicycling: + No matter which way you ride, it's uphill and against the wind. +%% +First Law of Procrastination: + Procrastination shortens the job and places the responsibility + for its termination on someone else (i.e., the authority who + imposed the deadline). + +Fifth Law of Procrastination: + Procrastination avoids boredom; one never has the feeling that + there is nothing important to do. +%% +First Law of Socio-Genetics: + Celibacy is not hereditary. +%% +First Rule of History: + History doesn't repeat itself -- + historians merely repeat each other. +%% +First law of debate: + Never argue with a fool. People might not know the difference. +%% +First rule of public speaking. + First, tell 'em what you're goin' to tell 'em; + then tell 'em; + then tell 'em what you've tole 'em. +%% +First you get down on your knees, Get in line in that processional, +Fiddle with your rosaries, Step into that small confessional, +Bow your head with great respect, There the guy who's got religion'll +And genuflect, genuflect, genuflect! Tell you if your sins' original. +Do whatever steps you want if If it is, try playin' it safer, +You have cleared them with the Pontiff, Drink the wine and chew the wafer, +Ev'rybody say his own Two, four, six eight, +Kyrie eleison, Time to transubstantiate! +Doin' the Vatican Rag. + +So get down upon your knees, Make a cross on your abdomen, +Fiddle with your rosaries, When in Rome do like a Roman, +Bow your head with great respect, Ave Maria, +And genuflect, genuflect, genuflect! Gee, it's good to see ya, + Gettin' ecstatic an' sorta dramatic an' Doin' the Vatican Rag! + -- Tom Lehrer, "The Vatican Rag" +%% +Five bicycles make a volkswagen, seven make a truck. + -- Adolfo Guzman +%% +Five names that I can hardly stand to hear, +Including yours and mine and one more chimp who isn't here, +I can see the ladies talking how the times is gettin' hard, +And that fearsome excavation on Magnolia boulevard, +Yes, I'm goin' insane, +And I'm laughing at the frozen rain, +Well, I'm so alone, honey when they gonna send me home? + Bad sneakers and a pina colada my friend, + Stopping on the avenue by Radio City, with a + Transistor and a large sum of money to spend... +You fellah, you tearin' up the street, +You wear that white tuxedo, how you gonna beat the heat, +Do you take me for a fool, do you think that I don't see, +That ditch out in the Valley that they're diggin' just for me, +Yes, and goin' insane, +You know I'm laughin' at the frozen rain, +Feel like I'm so alone, honey when they gonna send me home? +(chorus) + -- Bad Sneakers, "Steely Dan" +%% +Five rules for eternal misery: + 1) Always try to exhort others to look upon you favorably. + 2) Make lots of assumptions about situations and be sure to + treat these assumptions as though they are reality. + 3) Then treat each new situation as though it's a crisis. + 4) Live in the past and future only (become obsessed with + how much better things might have been or how much worse + things might become). + 5) Occasionally stomp on yourself for being so stupid as to + follow the first four rules. +%% +Flame on! + -- Johnny Storm +%% +Flappity, floppity, flip +The mouse on the Mobius strip; + The strip revolved, + The mouse dissolved +In a chronodimensional skip. +%% +Flattery is like cologne -- to be smelled, but not swallowed. + -- Josh Billings +%% +Flattery will get you everywhere. +%% +Flee at once, all is discovered. +%% +Flirting is the gentle art of making a man feel pleased with himself. + -- Helen Rowland +%% +Flon's Law: + There is not now, and never will be, a language in + which it is the least bit difficult to write bad programs. +%% +Flugg's Law: + When you need to knock on wood is when you realize + that the world is composed of vinyl, naugahyde and aluminum. +%% +Fly me away to the bright side of the moon ... +%% +Folks, what can I tell you about my next guest. This cat allowed himself +to be adored, but not loved. And his success in show business was matched +by failure in his personal relationship bag, now that's where he really +bombed. And he came to believe that work, show business, love, his whole +life, even himself and all that jazz was bullshit. He became numero uno +gameplayer. Uh, to the point where he didn't know where the games ended +and the reality began. Like to this cat, the only reality... is death, man. +Ladies and gentlemen, let me lay on you, a so-so entertainer, not much of +a humanitarian, and this cat was never nobody's friend. In his final +appearance on the great stage of life, uh, you can applaud if you want to, +Mr. Joe Gideon!! + -- All That Jazz +%% +Fools rush in -- and get the best seats in the house. +%% +Football builds self-discipline. What else would induce +a spectator to sit out in the open in subfreezing weather? +%% +For God's sake, stop researching for a while and begin to think! +%% +For I do not do the good I want, but the evil I do not want is what I do. + -- Paul of Tarsus, (Saint Paul) +%% +For I swore I would stay a year away from her; out and alas! +but with break of day I went to make supplication. + -- Paulus Silentarius, c. 540 A.D. +%% +For a gay time, call 632-9483. Ask for Brucie. +%% +For a good time, call 632-9484. Ask for Cathy. +%% +For a good time, call 632-9485. Ask for Michael. +%% +For a holy stint, a moth of the cloth gave up his woolens for lint. +%% +For a light heart lives long. + -- Shakespeare, "Love's Labour's Lost" +%% +For adult education nothing beats children. +%% +For an idea to be fashionable is ominous, +since it must afterwards be always old-fashioned. +%% +For children with short attention spans: boomerangs that don't come back. +%% +For courage mounteth with occasion. + -- William Shakespeare, "King John" +%% +For every action, there is an equal and opposite criticism. + -- Harrison +%% +For example, if \thinmskip = 3mu, this makes \thickmskip = 6mu. But if +you also want to use \skip12 for horizontal glue, whether in math mode or +not, the amount of skipping will be in points (e.g., 6pt). The rule is +that glue in math mode varies with the size only when it is an \mskip; +when moving between an mskipand ordinary skip, the conversion factor +1mu=1pt is always used. The meaning of '\mskip\skip12' and +'\baselineskip=\the\thickmskip' should be clear. + -- Donald Knuth, TeX 82 -- Comparison with TeX80 +%% + For example, in Year 1 that useless letter 'c' would be dropped to be +replased either by 'k' or 's', and likewise 'x' would no longer be part of the +alphabet. The only kase in which 'c' would be retained would be the 'ch' +formation, which will be dealt with later. Year 2 might reform 'w' spelling, +so that 'which' and 'one' would take the same konsonant, wile Year 3 might +well abolish 'y' replasing it with 'i' and Iear 4 might fiks the 'g-j' +anomali wonse and for all. + Jenerally, then, the improvement would kontinue iear bai iear with +Iear 5 doing awai with useless double konsonants, and Iears 6-12 or so +modifaiing vowlz and the rimeining voist and unvoist konsonants. Bai +Iear 15 or sou, it wud fainali bi posibl tu meik ius ov thi ridandant letez +'c', 'y' and 'x' - bai now jast a memori in the maindz ov ould doderez - tu +riplais 'ch', 'sh', and 'th' rispektivli. + Fainali, xen, aafte sam 20 iers ov orxogrefkl riform, wi wud hev a +lojikl, kohirnt speling in ius xrewawt xe Ingliy-spiking werld. +%% +For fast-acting relief, try slowing down. +%% +For fools rush in where angels fear to tread. + -- Alexander Pope +%% +For good, return good. +For evil, return justice. +%% +For if there is a sin against life, it consists perhaps not so much in +despairing of life as in hoping for another life and in eluding the +implacable grandeur of this life. + -- Albert Camus +%% +For men use, if they have an evil turn, to write it in marble: +and whoso doth us a good turn we write it in dust. + -- Sir Thomas More +%% +For myself, I can only say that I am astonished and somewhat terrified at +the results of this evening's experiments. Astonished at the wonderful +power you have developed, and terrified at the thought that so much hideous +and bad music may be put on record forever. + -- Sir Arthur Sullivan, message to Edison, 1888 +%% +For people who like that kind of book, +that is the kind of book they will like. +%% +For some reason a glaze passes over people's faces when you say +`Canada'. Maybe we should invade South Dakota or something. + -- Sandra Gotlieb, wife of the Canadian ambassador to the U.S. +%% +For some reason, this fortune reminds everyone of Marvin Zelkowitz. +%% +For that matter, compare your pocket computer with the +massive jobs of a thousand years ago. Why not, then, the +last step of doing away with computers altogether?" + -- Jehan Shuman +%% +For the first time we have a weapon that nobody has used for thirty years. +This gives me great hope for the human race. + -- Harlan Ellison +%% +For the next hour, WE will control all that you see and hear. +%% +For thee the wonder-working earth puts forth sweet flowers. + -- Titus Lucretius Carus +%% +For they starve the frightened little child +Till it weeps both night and day: +And they scourge the weak, and flog the fool, +And gibe the old and grey, +And some grow mad, and all grow bad, +And none a word may say. + +Each narrow cell in which we dwell +Is a foul and dark latrine, +And the fetid breath of living Death +Chokes up each grated screen, +And all, but Lust, is turned to dust +In Humanity's machine. + +And all men kill the thing they love, +By all let this be heard, +Some do it with a bitter look, +Some with a flattering word, +The coward does it with a kiss, +The brave man with a sword. + -- Oscar Wilde +%% +For thirty years a certain man went to spend every evening with Mme. ___. +When his wife died his friends believed he would marry her, and urged +him to do so. "No, no," he said: "if I did, where should I have to +spend my evenings?" + -- Chamfort +%% +For those who like this sort of thing, this is the sort of thing they like. + -- Abraham Lincoln +%% +For years a secret shame destroyed my peace-- +I'd not read Eliot, Auden or MacNiece. +But now I think a thought that brings me hope: +Neither had Chaucer, Shakespeare, Milton, Pope. + -- Justin Richardson. +%% +Force has no place where there is need of skill. + -- Herodotus +%% +"Force is but might," the teacher said-- +"That definition's just." +The boy said naught but thought instead, +Remembering his pounded head: +"Force is not might but must!" +%% +Force it!!! +If it breaks, well, it wasn't working anyway... +No, don't force it, get a bigger hammer. +%% +Forgive, O Lord, my little jokes on Thee +And I'll forgive Thy great big one on me. + -- Robert Frost +%% +Forgive and forget. + -- Cervantes +%% +Forgive him, +for he believes that the customs of his tribe are the laws of nature! + -- G.B. Shaw +%% +Forsan et haec olim meminisse juvabit. +%% +Fortune and love befriend the bold. + -- Ovid +%% +Fortune favors the lucky. +%% +Fortune finishes the great quotations, #15 + + "Give me your tired, your poor, your huddled masses." + And while you're at it, throw in a couple of those Dallas + Cowboy cheerleaders. +%% +Fortune finishes the great quotations, #17 + + "This bud of love, by summer's ripening breath, + May prove a beauteous flower when next we meet." + Juliet, this bud's for you. +%% +Fortune finishes the great quotations, #6 + + "But, soft! What light through yonder window breaks?" + It's nothing, honey. Go back to sleep. +%% +Fortune finishes the great quotations, #3 + + Birds of a feather flock to a newly washed car. +%% +Fortune finishes the great quotations, #2 + + If at first you don't succeed, think how many people + you've made happy. +%% +Fortune finishes the great quotations, #9 + + A word to the wise is often enough to start an argument. +%% +Fortune finishes the great quotations, #12 + + Those who can, do. Those who can't, write the instructions. +%% +Fortune suggests uses for YOUR favorite UNIX commands! + +Try: + ar t "God" + drink < bottle (Bourne Shell) + cat "food in tin cans" (all but 4.[23]BSD) + Hey UNIX! Got a match? (V6 or C shell) + mkdir matter;cat > matter (Bourne Shell) + make "the perfect dry martini" + !!:Say, what do you think of margarine? (C shell) +%% +Fortune's Exercising Truths: + +1: Richard Simmons gets paid to exercise like a lunatic. You don't. +2. Aerobic exercises stimulate and speed up the heart. So do heart attacks. +3. Exercising around small children can scar them emotionally for life. +4. Sweating like a pig and gasping for breath is not refreshing. +5. No matter what anyone tells you, isometric exercises cannot be done + quietly at your desk at work. People will suspect manic tendencies as + you twitter around in your chair. +6. Next to burying bones, the thing a dog enjoys mosts is tripping joggers. +7. Locking four people in a tiny, cement-walled room so they can run around + for an hour smashing a little rubber ball -- and each other -- with a hard + racket should immediately be recognized for what it is: a form of insanity. +8. Fifty push-ups, followed by thirty sit-ups, followed by ten chin-ups, + followed by one throw-up. +9. Any activity that can't be done while smoking should be avoided. +%% +Fortune's Great Moments in History: #3 + +August 27, 1949: + A Hall of Fame opened to honor outstanding members of the + Women's Air Corp. It was a WAC's Museum. +%% +Fortune's Rules for Memo Wars + + Any attempt to say that someone's personal beliefs are wrong, even if +you supply conclusive evidence to support your claim, is an outright attack. +If you show someone a flaw in his/her logic, they have every right to punch +you in the face. Mathematical proofs of errors are the moral equivalent +of rape and should be avoided at all cost. + Now... your opponent has requested a "rational discussion". What do +you do? Well, remember that people are normally willing to discuss things +rationally if and only if you agree with them; anything less would obviously +not be rational. Therefore, agree immediately, and continue as before. + Always assume that whenever you see someone making a statement about +"certain parties who shall remain nameless", "some people", "assholes", etc., +they are talking about *you*. It is also correct to assume that words you +don't understand, such as "prestidigatory", "lapidarian", and "buprestid", +are direct personal attacks aimed at your loved ones and merit an equally +scathing response. Failure to do this results in many lost opportunities for +rational discussion. (See above.) +%% +Fortune's Rules for Memo Wars + +Given the incredible advances in sociocybernetics and telepsychology over +the last few years, we are now able to completely understand everything that +the author of an memo is trying to say. Thanks to modern developments +in electrocommunications like notes, vnews, and electricity, we have an +incredible level of interunderstanding the likes of which civilization has +never known. Thus, the possibility of your misinterpreting someone else's +memo is practically nil. Knowing this, anyone who accuses you of having +done so is a liar, and should be treated accordingly. If you *do* understand +the memo in question, but have absolutely nothing of substance to say, then +you have an excellent opportunity for a vicious ad hominem attack. In fact, +the only *inappropriate* times for an ad hominem attack are as follows: + 1: When you agree completely with the author of an memo. + 2: When the author of the original memo is much bigger than you are. + 3: When replying to one of your own memos. +%% +Fortune's Rules for Memo Wars + +The proper time for a vicious ad hominem attack is when you have no logical +recourse. If you have been arguing a point with a person or persons for +30 odd weeks, and an memo comes across that logically tears down the +final shred of evidence that you thought you had, that is the time to call +the author of that memo: + 1: a mindless twit who attacks other people's beliefs for no reason. + 2: an egotistical flaming typical wombat aggie melon-humping + cheese-whizzing nanosexual subuseless clamsucker whose + memos are apparently sneezed onto his/her terminal. + 3: something unpleasant. +The OTHER proper time for an ad hominem attack is immediately after someone +has posted something you don't understand. Given the current state of modern +electronic communications technology your inability to comprehend the meaning +of an memo constitutes a violation of western moral tradition on the part of +the author of that memo, and the author should be taken to task publicly via +a series of really nasty, name-calling oriented memos. +%% +Fortune's current rates: + + Answers .10 + Long answers .25 + Answers requiring thought .50 + Correct answers $1.00 + + Dumb looks are still free. +%% +Fortune's diet truths: +1: Forget what the cookbooks say, plain yogurt tastes nothing like sour cream. +2: Any recipe calling for soybeans tastes like mud. +3: Carob is not an acceptable substitute for chocolate. In fact, carob is not + an acceptable substitute for anything, except, perhaps, brown shoe polish. +4: There is no such thing as a "fun salad." So let's stop pretending and see + salads for what they are: God's punishment for being fat. +5: Fruit salad without maraschino cherries and marshmallows is about as + appealing as tepid beer. +6: A world lacking gravy is a tragic place! +7: You should immediately pass up any recipes entitled "luscious and + low-cal." Also skip dishes featuring "lively liver." They aren't and + it isn't. +8: Wearing a blindfold often makes many diet foods more palatable. +9: Fresh fruit is not dessert. CAKE is dessert! +10: Okra tastes slightly worse than its name implies. +11: A plain baked potato isn't worth the effort involved in chewing and + swallowing. +%% +Fortune's nomination for All-Time Champion and Protector of Youthful Morals +goes to Representative Clare E. Hoffman of Michigan. During an impassioned +House debate over a proposed bill to "expand oyster and clam research," a +sharp-eared informant transcribed the following exchange between our hero +and Rep. John D. Dingell, also of Michigan. + +Dingell: "There are places in the world at the present time where we are + having to artifically propogate oysters and clams." +Hoffman: "You mean the oysters I buy are not nature's oysters?" +Dingell: "They may or may not be natural. The simple fact of the matter is + that female oysters through their living habits cast out large + amounts of seed and the male oysters cast out large amounts of + fertilization." +Hoffman: "Wait a minute! I do not want to go into that. There are many + teenagers who read The Congressional Record." +%% + "Found it," the Mouse replied rather crossly: +"of course you know what 'it' means." + + "I know what 'it' means well enough, when I find a thing," +said the Duck: "it's generally a frog or a worm. + +The question is, what did the archbishop find?" +%% +Four be the things I am wiser to know: +Idleness, sorrow, a friend, and a foe. + +Four be the things I'd been better without: +Love, curiosity, freckles, and doubt. + +Three be the things I shall never attain: +Envy, content, and sufficient champagne. + +Three be the things I shall have till I die: +Laughter and hope and a sock in the eye. + -- Inventory +%% +Four hours to bury the cat? +Yes, damn thing wouldn't keep still, kept mucking about, 'owling... +%% +Fourth Law of Applied Terror: + The night before the English History mid-term, your Biology + instructor will assign 200 pages on planaria. + +Corollary: + Every instructor assumes that you have nothing else to do except + study for that instructor's course. +%% +Fourth Law of Revision: + It is usually impractical to worry beforehand about + interferences -- if you have none, someone will make one + for you. +%% +Freedom begins when you tell Mrs. Grundy to go fly a kite. +%% +Freedom from incrustation of grime is contiguous to rectitude. +%% +Freedom is nothing else but the chance to do better. + -- Camus +%% +Freedom is slavery. +Ignorance is strength. +War is peace. + -- George Orwell +%% +Freedom of the press is for those who happen to own one. +%% +Fresco's Discovery: + If you knew what you were doing you'd probably be bored. +%% +Friction is a drag. +%% +Fried's 1st Rule: + Increased automation of clerical function + invariably results in increased operational costs. +%% +Friends, Romans, Hipsters, +Let me clue you in; +I come to put down Caeser, not to groove him. +The square kicks some cats are on stay with them; +The hip bits, like, go down under; so let it lay with Caeser. +The cool Brutus gave you the message: Caeser had big eyes; +If that's the sound, someone's copping a plea, +And, like, old Caeser really set them straight. +Here, copacetic with Brutus and the studs, -- for Brutus is a + real cool cat; +So are they all, all cool cats, -- +Come I to make this gig at Caeser's laying down. +%% +Frisbeetarianism is the belief that when you die, +your soul goes up the on roof and gets stuck. +%% +From a certain point onward there is no longer any turning back. +That is the point that must be reached. + -- F. Kafka +%% +From listening comes wisdom and from speaking repentance. +%% +From the cradle to the coffin underwear comes first. + -- Bertolt Brecht +%% +From too much love of living, +From hope and fear set free, +We thank with brief thanskgiving, +Whatever gods may be, +That no life lives forever, +That dead men rise up never, +That even the weariest river winds somewhere safe to sea. + -- Swinburne +%% +Fudd's First Law of Opposition: + Push something hard enough and it will fall over. +%% +Function reject. +%% +Fundamentally, there may be no basis for anything. +%% +Future looks spotty. You will spill soup in late evening. +%% +GARTER: + An elastic band intended to keep a woman + from coming out of her stockings and desolating the country. +%% +GEMINI (May 21 - June 20) + A day to take the initiative. Put the garbage out, for + instance, and pick up the stuff at the dry cleaners. Watch + the mail carefully, although there won't be anything good + in it today, either. +%% +GENEALOGY: + An account of one's descent from an ancestor + who did not particularly care to trace his own. + -- Ambrose Bierce +%% +GENIUS: + A chemist who discovers a laundry additive that rhymes with bright. +%% +GENIUS: + Person clever enough to be born in the right place at the right + time of the right sex and to follow up this advantage by saying + all the right things to all the right people. +%% +GEORGIA: + Where kinky sex means getting laid. +%% +GIVE UP!!!! +%% +GIVE: Support the helpless victims of computer error. +%% +GOD: + Darwin's chief rival. +%% +//GO.SYSIN DD *, DOODAH, DOODAH +%% +GRASSHOPPOTAMUS: + A creature that can leap to tremendous heights... once. +%% +GRAVITY: + What you get when you eat too much and too fast. +%% +GREAT MOMENTS IN AMERICAN HISTORY (#21): July 30, 1917 + +On this day, New York City hotel detectives burst in and caught then +Senator Warren G. Harding in bed with an underage girl. He bought +them off with a $20 bribe, and later remarked thankfully, "I thought +I wouldn't get out of that under $1000!" Always one to learn from +his mistakes, in later years President Harding carried on his affairs +in a tiny closet in the White House Cabinet Room while Secret Service +men stood lookout. +%% +GUILLOTINE: + A French chopping center. +%% +GURU: + A person in T-shirt and sandals who took an elevator ride with + a senior vice-president and is ultimately responsible for the + phone call you are about to receive from your boss. +%% +Garbage In - Gospel Out. +%% +Gauls! We have nothing to fear; except perhaps that the sky may fall on +our heads tomorrow. But as we all know, tomorrow never comes!! + -- Adventures of Asterix +%% +Gay shlafen: Yiddish for "go to sleep". + +Now doesn't "gay shlafen" have a softer, more soothing sound than the +harsh, staccato "go to sleep"? Listen to the difference: + "Go to sleep, you little wretch!" ... "Gay shlafen, darling." +Obvious, isn't it? + Clearly the best thing you can do for you children is to start +speaking Yiddish right now and never speak another word of English as +long as you live. This will, of course, entail teaching Yiddish to all +your friends, business associates, the people at the supermarket, and +so on, but that's just the point. It has to start with committed +individuals and then grow.... + Some minor adjustments will have to be made, of course: those +signs written in what look like Yiddish letters won't be funny when +everything is written in Yiddish. And we'll have to start driving on +the left side of the road so we won't be reading the street signs +backwards. But is that too high a price to pay for world peace? +I think not, my friend, I think not. + -- Arthur Naiman +%% + "Gee, Mudhead, everyone at Morse Science High has an +extracurricular activity except you." + "Well, gee, doesn't Louise count?" + "Only to ten, Mudhead." +%% +General notions are generally wrong. + -- Lady M.W. Montagu +%% +Generosity and perfection are your everlasting goals. +%% +Genetics explains why you look like your father, +and if you don't, why you should. +%% +Genius does what it must, and Talent does what it can. + -- Owen Meredith +%% +Genius is one percent inspiration and ninety-nine percent perspiration. + -- Thomas Alva Edison +%% +Genius is pain. + -- John Lennon +%% +Genius is ten percent inspiration and fifty percent capital gains. +%% +Genius is the talent of a person who is dead. +%% +Genius may have its limitations, but stupidity is not thus handicapped. + -- Elbert Hubbard +%% + "Gentlemen of the jury," said the defense attorney, now beginning +to warm to his summation, "the real question here before you is, shall this +beautiful young woman be forced to languish away her loveliest years in a +dark prison cell? Or shall she be set free to return to her cozy little +apartment at 4134 Mountain Ave. -- there to spend her lonely, loveless hours +in her boudoir, lying beside her little Princess phone, 962-7873?" +%% +Gentlemen prefer blondes, but who says blondes prefer gentlemen? + -- Mae West +%% +Geometry teaches us to bisex angels. +%% +George Orwell was an optimist. +%% +George, after tying on a whopper the night before, woke up in the morning to +find a pathetically unattractive woman sleeping blissfully beside him. He +leaped out of bed, dressed quickly, and furtively placed $100 on top of the +bureau. He then started to tiptoe out of the room. But, as he passed the +foot of the bed, he felt a tug at his trouser leg. Glancing down, he saw +another female even homelier than the one he'd left in bed. She gazed up +at him soulfully, and asked, "Nothing for the bridesmaid?" +%% +George's friend Sam had a dog who could recite the Gettysburg Address. "Let +me buy him from you," pleaded George after a demonstration. + "Okay," agreed Sam. "All he knows is that Lincoln speech anyway." + At his company's Fourth of July picnic, George brought his new pet +and announced that the animal could recite the entire Gettysburg Address. +No one believed him, and they proceeded to place bets against the dog. +George quieted the crowd and said, "Now we'll begin!" Then he looked at +the dog. The dog looked back. No sound. "Come on, boy, do your stuff." +Nothing. A disappointed George took his dog and went home. + "Why did you embarrass me like that in front of everybody?" George +yelled at the dog. "Do you realize how much money you lost me?" + "Don't be silly, George," replied the dog. "Think of the odds we're +gonna get on Labor Day." +%% +Gerrold's Laws of Infernal Dynamics: + 1) An object in motion will always be headed in the wrong direction. + 2) An object at rest will always be in the wrong place. + 3) The energy required to change either one of these states + will always be more than you wish to expend, but never so + much as to make the task totally impossible. +%% +Get forgiveness now -- tomorrow you may no longer feel guilty. +%% +Get in touch with your feelings of hostility against the dying light. + -- Dylan Thomas +%% +Getting into trouble is easy. + -- D. Winkel and F. Prosser +%% +Getting there is only half as far as getting there and back. +%% +Gibble gabble gabble gibble gurgle lubble gibble babble beeble triggle + Lean closer. +Libble gabble gabble ibble gurgle gubble tibble babble feeble riggle + Smile at her *knowingly*. +Gibble gabble sabble gibble surgle gubble gibble babble beeble giggle + Nod sympathetically. Show you're on *her* side. +Bibble gabble gabble babble gurgle gubble gibble tribble beeble figgle + Touch her hand lightly. Nobody understands but we two. +Fibble gabble fobble gibble gurgle bubble gibble tabble beeble giggle + Look sincere. + +"Why don't we have the next drink up at MY place?" + + God's gift to women strikes again. + -- J. Feiffer +%% +Gilbert's Discovery: + Any attempt to use the new super glues results in the two pieces + sticking to your thumb and index finger rather than to each other. +%% +Ginger Snap +%% +Ginsberg's Theorem: + 1. You can't win. + 2. You can't break even. + 3. You can't even quit the game. + +Freeman's Commentary on Ginsberg's theorem: + + Every major philosophy that attempts to make life seem + meaningful is based on the negation of one part of Ginsberg's + Theorem. To wit: + + 1. Capitalism is based on the assumption that you can win. + 2. Socialism is based on the assumption that you can break even. + 3. Mysticism is based on the assumption that you can quit the game. +%% +Girls marry for love. Boys marry because of a chronic irritation +that causes them to gravitate in the direction of objects with +certain curvilinear properties. + -- Ashley Montagu +%% +Girls who throw themselves at men, +are actually taking very careful aim. +%% +Give a woman an inch and she'll park a car in it. +%% +Give all orders verbally. Never write anything down +that might go into a "Pearl Harbor File". +%% +Give him an evasive answer. +%% +Give me a Plumber's friend the size of the Pittsburgh +dome, and a place to stand, and I will drain the world. +%% +Give me a fish and I will eat today. +Teach me to fish and I will eat forever. +%% +Give me a sleeping pill and tell me your troubles. +%% +Give me chastity and continence, but not just now. + -- St. Augustine +%% +Give me libertines or give me meth. +%% +Give me the Luxuries, and the Hell with the Necessities! +%% +Give me your students, your secretaries, +Your huddled writers yearning to breathe free, +The wretched refuse of your Selectric III's. +Give these, the homeless, typist-tossed to me. +I lift my disk beside the processor. + -- Inscription on a Word Processor +%% +Give thought to your reputation. +Consider changing your name and moving to a new town. +%% +Give your child mental blocks for Christmas. +%% +Give your very best today. +Heaven knows it's little enough. +%% +Given a choice between grief and nothing, I'd choose grief. + -- William Faulkner +%% +Given my druthers, I'd druther not. +%% +Given sufficient time, what you put +off doing today will get done by itself. +%% +Glib's Fourth Law of Unreliability: + Investment in reliability will increase until it exceeds the + probable cost of errors, or until someone insists on getting + some useful work done. +%% +Gloffing is a state of mine. +%% +Go ahead... make my day. + -- Dirty Harry +%% +Go away! Stop bothering me with all your +"compute this ... compute that"! I'm taking a VAX-NAP. + +logout +%% +Go climb a gravity well. +%% +Go directly to jail. Do not pass Go, do not collect $200. +%% +Go on writing plays, my boy. One of these days a London producer will go +into his office and say to his secretary, "Is there a play from Shaw this +morning?" and when she says "No," he will say, "Well, then we'll have to +start on the rubbish." And that's your chance, my boy. + -- G.B. Shaw to William Douglas Home +%% +Go placidly amid the noise and waste, and remember +what value there may be in owning a piece thereof. + -- Deteriorata +%% +Go slowly to the entertainments of thy friends, +but quickly to their misfortunes. + -- Chilo +%% +Go to a movie tonight. +Darkness becomes you. +%% +Go 'way! You're bothering me! +%% +Goals... Plans... they're fantasies, they're part of a dream world... + -- Wally Shawn +%% +God, I ask for patience -- and I want it right now! +%% +God created woman. +And boredom did indeed cease from that moment -- +but many other things ceased as well. +Woman was God's second mistake. + -- Nietzsche +%% +God did not create the world in 7 days; He screwed +around for 6 days and then pulled an all-nighter. +%% +God gave man two ears and one tongue so +that we listen twice as much as we speak. + -- Arab proverb +%% +God gives burdens; also shoulders. + + Jimmy Carter cited this Jewish saying in his concession speech +at the end of the 1980 election. At least he said it was a Jewish +saying; I can't find it anywhere. I'm sure he's telling the truth +though; why would he lie about a thing like that? + -- Arthur Naiman +%% +God gives us relatives; thank goodness we can chose our friends. +%% +God has intended the great to be great and the little to be little... +The trade unions, under the European system, destroy liberty [...] I do +not mean to say that a dollar a day is enough to support a workingman... +not enough to support a man and five children if he insists on smoking +and drinking beer. But the man who cannot live on bread and water is +not fit to live! A family may live on good bread and water in the +morning, water and bread at midday, and good bread and water at night! + -- Rev. Henry Ward Beecher +%% +God help the troubadour who tries to be a star. The more +that you try to find success, the more that you will fail. + -- Phil Ochs, on the Second System Effect +%% +God helps them that helps themselves. + -- B. Franklin +%% +God instructs the heart, not by ideas, +but by pains and contradictions. + -- De Caussade +%% +God is Dead. + -- Nietzsche +Nietzsche is Dead. + -- God +Nietzsche is God. + -- Dead +%% +God is a comic playing to an audience that's afraid to laugh. +%% +God is a polythiest. +%% +God is not dead! He's alive and autographing Bibles at Cody's! +%% +God is omnipotent, omniscient, and omnibenevolent -- it says so right here +on the label. If you have a mind capable of believing all three of these +divine attributes simultaneously, I have a wonderful bargain for you. No +checks, please. Cash and in small bills. + -- Lazarus Long +%% +God is really only another artist. He invented the giraffe, the +elephant and the cat. He has no real style, He just goes on trying +other things. + -- Pablo Picasso +%% +God is the tangential point between zero and infinity. + -- Alfred Jarry +%% +God isn't dead, he just couldn't find a parking place. +%% +God made machine language; all the rest is the work of man. +%% +God made the integers; all else is the work of Man. + -- Kronecker +%% +God made the world in six days, and was arrested on the seventh. +%% +God may be subtle, but he isn't plain mean. + -- Albert Einstein +%% +God must love the common man; He made so many of them. +%% +God rest ye CS students now, The bearings on the drum are gone, +Let nothing you dismay. The disk is wobbling, too. +The VAX is down and won't be up, We've found a bug in Lisp, and Algol +Until the first of May. Can't tell false from true. +The program that was due this morn, And now we find that we can't get +Won't be postponed, they say. At Berkeley's 4.2. +(chorus) (chorus) + +We've just received a call from DEC, And now some cheery news for you, +They'll send without delay The network's also dead, +A monitor called RSuX We'll have to print your files on +It takes nine hundred K. The line printer instead. +The staff committed suicide, The turnaround time's nineteen weeks. +We'll bury them today. And only cards are read. +(chorus) (chorus) + +And now we'd like to say to you CHORUS: Oh, tidings of comfort and joy, +Before we go away, Comfort and joy, +We hope the news we've brought to you Oh, tidings of comfort and joy. +Won't ruin your whole day. +You've got another program due, tomorrow, by the way. +(chorus) + -- to God Rest Ye Merry Gentlemen +%% +God votes Republican. +%% +God's plan made a hopeful beginning +But man spoiled his chances by sinning. + We trust that the story + Will end in God's glory +But at present, the other side's winning. +%% +Going into politics is as fatal to a gentleman as going into a bordello +is fatal to a virgin. + -- H.L. Mencken, "A Carnival of Buncombe" +%% +Going the speed of light is bad for your age. +%% +Going to church does not make a person religious, nor does going to school +make a person educated, any more than going to a garage makes a person a car. +%% +Goldenstern's Rules: + 1. Always hire a rich attorney. + 2. Never buy from a rich salesman. +%% +Gold's Law: + If the shoe fits, it's ugly. +%% +Gomme's Laws: + (1) A backscratcher will always find new itches. + (2) Time accelerates. + (3) The weather at home improves as soon as you go away. +%% +Good advice is something a man gives +when he is too old to set a bad example. + -- La Rouchefoucauld +%% +Good day for a change of scene. Repaper the bedroom wall. +%% +Good day for business affairs. +Make a pass at that the new file clerk. +%% +Good day for overcoming obstacles. Try a steeplechase. +%% +Good day to avoid cops. Crawl to school. +%% +Good day to avoid cops. Crawl to work. +%% +Good day to deal with people in high places; +particularly lonely stewardesses. +%% +Good day to let down old friends who need help. +%% +Good evening, gentlemen. I am a HAL 9000 computer. I became operational +at the HAL plant in Urbana, Illinois, on January 11th, nineteen hundred +ninety-five. My supervisor was Mr. Langley, and he taught me to sing a +song. If you would like, I could sing it for you. +%% +Good girls go to heaven, bad girls go everywhere. +%% +"Good health" is merely the slowest rate at which one can die. +%% +Good judgement comes from experience. +Experience comes from bad judgement. + -- Jim Horning +%% +Good leaders being scarce, following yourself is allowed. +%% +Good morning. This is the telephone company. Due to repairs, we're +giving you advance notice that your service will be cut off indefinitely +at ten o'clock. That's two minutes from now. +%% +Good news. Ten weeks from Friday will be a pretty good day. +%% +Good news from afar can bring you a welcome visitor. +%% +Good news is just life's way of keeping you off balance. +%% +Good night, Austin, Texas, wherever you are! +%% +Good night to spend with family, +but avoid arguments with your mate's new lover. +%% +Good-bye. I am leaving because I am bored. + -- George Saunders' dying words +%% +Goodbye, cool world. +%% +Gordon's Law: + If you think you have the solution, the question was poorly phrased. +%% +Got Mole problems? +Call Avogadro at 6.02 x 10^23. +%% +Got a dictionary? I want to know the meaning of life. +%% +Govern a great nation as you would cook a small fish. Don't overdo it. + -- Lao Tsu +%% +Government's Law: + There is an exception to all laws. +%% +Governor Tarkin. I should have expected to find you holding Vader's +leash. I thought I recognized your foul stench when I was brought on +board. + -- Princess Leia Organa +%% +Grabel's Law: + 2 is not equal to 3 -- not even for large values of 2. +%% +Graduate life -- it's not just a job, it's an indenture. +%% +Graduate students and most professors are +no smarter than undergrads. They're just older. +%% +Grandpa Charnock's Law: + You never really learn to swear until you learn to drive. + + [I thought it was when your kids learned to drive. Ed.] +%% +Gravity brings me down. +%% +Gravity is a myth, the Earth sucks. +%% +Gray's Law of Programming: + 'n+1' trivial tasks are expected to be + accomplished in the same time as 'n' tasks. + +Logg's Rebuttal to Gray's Law: + 'n+1' trivial tasks take twice as long as 'n' trivial tasks. +%% +Great American Axiom: + Some is good, more is better, too much is just right. +%% +Great acts are made up of small deeds. + -- Lao Tsu +%% +Great spirits have always encountered +violent opposition from mediocre minds. + -- A. Einstein +%% +Greatness is a transitory experience. It is never consistent. +%% +Green light in A.M. for new projects. +Red light in P.M. for traffic tickets. +%% +Grelb's Reminder: + Eighty percent of all people consider + themselves to be above average drivers. +%% +Grief can take care of itself; but to get the full +value of a joy you must have somebody to divide it with. + -- Mark Twain +%% +Grinnell's Law of Labor Laxity: + At all times, for any task, you have not got enough done today. +%% +Grownups are reluctant to take science fiction seriously, and with good +reason: sci-fi is a hormonal activity, not a literary one. Its traditional +concerns are all pubescent. Secondary sexual characteristics are everywhere, +disguised. Aliens have tentacles. Telepathy allows you to have sex without +any nasty inconvenience of touching. Womblike spaceships provide balanced +meals. No one ever has to grow old -- body parts are replaceable, like +Job's daughters, and if you're lucky you can become a robot. As for the +adult world, it's simply not there; political systems tend to be naively +authoritarian (there are more lords in science fiction than on public +television) and are often ruled by young boys on quests. The most popular +sci-fi book in years, Frank Herbert's Dune, sold millions of copies by +combining all these themes: it ends with its adolescent hero conquering the +universe while straddling a giant worm. + -- Arnold Klein +%% +Grub first, then ethics. + -- Bertolt Brecht +%% +Gumperson's Law: + The probability of a given event + occurring is inversely proportional to its desirability. +%% +Guns don't kill people. Bullets kill people. +%% +Gunter's Airborne Discoveries: + (1) When you are served a meal aboard an aircraft, + the aircraft will encounter turbulence. + (2) The strength of the turbulence + is directly proportional to the temperature of your coffee. +%% +HACKER: + Originally, any person with a knack for coercing stubborn inanimate +things; hence, a person with a happy knack, later contracted by the mythical +philosopher Frisbee Frobenius to the common usage, 'hack'. + In olden times, upon completion of some particularly atrocious body +of coding that happened to work well, culpable programmers would gather in +a small circle around a first edition of Knuth's Best Volume I by candlelight, +and proceed to get very drunk while sporadically rending the following ditty: + + Hacker's Fight Song + + He's a Hack! He's a Hack! + He's a guy with the happy knack! + Never bungles, never shirks, + Always gets his stuff to work! + +All take a drink (important!) +%% +HALF-DONE: + This is the best way to eat a kosher dill -- when it's still crunchy, + light green, yet full of garlic flavor. The difference between this + and the typical soggy dark green cucumber corpse is like the + difference between life and death. + + You may find it difficult to find a good half-done kosher dill there + in Seattle, so what you should do is take a cab out to the airport, + fly to New York, take the JFK Express to Jay Street-Borough Hall, + transfer to an uptown F, get off at East Broadway, walk north on + Essex (along the park), make your first left onto Hester Street, walk + about fifteen steps, turn ninety degrees left, and stop. Say to the + man, "Let me have a nice half-done." Worth the trouble, wasn't it? + -- Arthur Naiman +%% +HAND: + A singular instrument worn at the end of a human + arm and commonly thrust into somebody's pocket. +%% +HANGOVER: + The wrath of grapes. +%% +HAPPINESS: + An agreeable sensation arising + from contemplating the misery of another. +%% +HAPPINESS: + Finding the owner of a lost bikini. +%% +HARD: + The quality of your own data; also how + it is to believe those of other people. +%% +HARDWARE: + The parts of a computer system that can be kicked. +%% +HATRED: + A sentiment appropriate to the occasion of another's superiority. +%% +HEAD CRASH!! FILES LOST!! +Details at 11. +%% +HEAVEN: + A place where the wicked cease from troubling you with talk of + their personal affairs, and the good listen with attention while + you expound your own. +%% +HEAVY: + Seduced by the chocolate side of the force. +%% +HELL: + Truth seen too late. +%% +HELP! Man trapped in a human body! +%% +HELP!!!! I'm being held prisoner in /usr/games/lib! +%% +HE: Let's end it all, bequeathin' our brains to science. +SHE: What?!? Science got enough trouble with their OWN brains. + -- Walt Kelley +%% +HEY KIDS! ANN LANDERS SAYS: + Be sure it's true, when you say "I love you". It's a sin to + tell a lie. Millions of hearts have been broken, just because + these words were spoken. +%% +HIGH TECHNOLOGY: + A California innovation composed + of equal parts of silicon and marijuana. +%% +HIPPOGRIFF: + An animal (now extinct) which was half horse and half griffin. + The griffin was itself a compound creature, half lion and half + eagle. The hippogriff was actually, therefore, only one quarter + eagle, which is two dollars and fifty cents in gold. + The study of zoology is full of surprises. +%% +H.L. Mencken's Law: + Those who can -- do. + Those who can't -- teach. + +Martin's Extension: + Those who cannot teach -- administrate. + + [No, those who can't teach, teach here. Ed.] +%% +HOLY MACRO! +%% +HONEYMOON: + A short period of doting between dating and debting. + -- Ray C. Bandy +%% +HONORABLE: + Afflicted with an impediment in one's reach. In legislative + bodies, it is customary to mention all members as honorable; + as, "the honorable gentleman is a scurvy cur." +%% +HOST SYSTEM NOT RESPONDING, PROBABLY DOWN. DO YOU WANT TO WAIT? (Y/N) +%% +HOST SYSTEM RESPONDING, PROBABLY UP... +%% +Hacker's Guide To Cooking: +2 pkg. cream cheese (the mushy white stuff in silver wrappings that doesn't + really come from Philadelphia after all; anyway, about 16 oz.) +1 tsp. vanilla extract (which is more alcohol than vanilla and pretty + strong so this part you *GOTTA* measure) +1/4 cup sugar (but honey works fine too) +8 oz. Cool Whip (the fluffy stuff devoid of nutritional value that you + can squirt all over your friends and lick off...) +"Blend all together until creamy with no lumps." This is where you get to + join(1) all the raw data in a big buffer and then filter it through + merge(1m) with the -thick option, I mean, it starts out ultra lumpy + and icky looking and you have to work hard to mix it. Try an electric + beater if you have a cat(1) that can climb wall(1s) to lick it off + the ceiling(3m). +"Pour into a graham cracker crust..." Aha, the BUGS section at last. You + just happened to have a GCC sitting around under /etc/food, right? + If not, don't panic(8), merely crumble a rand(3m) handful of innocent + GCs into a suitable tempfile and mix in some melted butter. +"...and refrigerate for an hour." Leave the recipe's stdout in a fridge + for 3.6E6 milliseconds while you work on cleaning up stderr, and + by time out your cheesecake will be ready for stdin. +%% +Hacker's Law: + The belief that enhanced understanding will necessarily stir + a nation to action is one of mankind's oldest illusions. +%% +Hacker's Quicky #313: + Sour Cream -n- Onion Potato Chips + Microwave Egg Roll + Chocolate Milk +%% +Hackers of the world, unite! +%% +"Had he and I but met But ranged as infantry, +By some old ancient inn, And staring face to face, +We should have sat us down to wet I shot at him as he at me, +Right many a nipperkin! And killed him in his place. + +I shot him dead because -- He thought he'd 'list, perhaps, + Because he was my foe, Off-hand-like -- just as I -- +Just so: my foe of course he was; Was out of work -- had sold his traps +That's clear enough; although No other reason why. + +Yes; quaint and curious war is! +You shoot a fellow down +You'd treat, if met where any bar is +Or help to half-a-crown." + -- Thomas Hardy +%% +Had this been an actual emergency, we would have +fled in terror, and you would not have been informed. +%% +Hail to the sun god +He's such a fun god +Ra! Ra! Ra! +%% +Hailing frequencies open, Captain. +%% +Hale Mail Rule, The: + When you are ready to reply to a letter, you will lack at least + one of the following: + (a) A pen or pencil or typewriter. + (b) Stationery. + (c) Postage stamp. + (d) The letter you are answering. +%% +Half Moon tonight. (At least its better than no Moon at all.) +%% +Half the world is composed of people who have something to say and can't, +and the other half who have nothing to say and keep on saying it. +%% +Hall's Laws of Politics: + (1) The voters want fewer taxes and more spending. + (2) Citizens want honest politicians until they want + something fixed. + (3) Constituency drives out consistency (i.e., liberals defend + military spending, and conservatives social spending in + their own districts). +%% +Handel's Proverb: + You can't produce a baby in one month by impregnating 9 women! +%% +Hanging on in quiet desperation is the English way. + -- Pink Floyd +%% +Hanlon's Razor: + Never attribute to malice + that which is adequately explained by stupidity. +%% +Hanson's Treatment of Time: + There are never enough hours in a day, + but always too many days before Saturday. +%% +Happiness adds and multiplies as we divide it with others. +%% +Happiness is a hard disk. +%% +Happiness is having a scratch for every itch. + -- Ogden Nash +%% +Happiness is just an illusion, filled with sadness and confusion. +%% +Happiness is the greatest good. +%% +Happiness is twin floppies. +%% +Happiness isn't something you experience; it's something you remember. + -- Oscar Levant +%% +Happiness makes up in height what it lacks in length. +%% +Happy feast of the pig! +%% +Hard reality has a way of cramping your style. + -- Daniel Dennett +%% +Hark, the Herald Tribune sings, +Advertising wondrous things. + +Angels we have heard on High +Tell us to go out and Buy. +%% +Hark,Hark,the dogs do bark +The Duke is fond of kittens +He likes to take their insides out +And use them for his mittens + -- The Thirteen Clocks +%% +Harp not on that string. + -- William Shakespeare, "Henry VI" +%% +Harriet's Dining Observation: + In every restaurant, the hardness of the butter pats + increases in direct proportion to the softness of the bread. +%% +Harrisberger's Fourth Law of the Lab: + Experience is directly proportional to the amount of + equipment ruined. +%% +Harris's Lament: + All the good ones are taken. +%% + Harry, a golfing enthusiast if there ever was one, arrived home +from the club to an irate, ranting wife. + "I'm leaving you, Harry," his wife announced bitterly. "You +promised me faithfully that you'd be back before six and here it is almost +nine. It just can't take that long to play 18 holes of golf." + "Honey, wait," said Harry. "Let me explain. I know what I promised +you, but I have a very good reason for being late. Fred and I tee'd off +right on time and everything was find for the first three holes. Then, on +the fourth tee Fred had a stroke. I ran back to the clubhouse but couldn't +find a doctor. And, by the time I got back to Fred, he was dead. So, for +the next 15 holes, it was hit the ball, drag Fred, hit the ball, drag Fred... +%% +Harry and Fred were playing their sunday afternoon golf game. The game, as +always, was close. They were at the treacherous 12th hole: a par three that +required a perfect first shot over a large pond and onto a tiny green. There +were sand traps on the other three sides of the green, and a small road 50 +feet beyond it. Harry went first. He carefully addressed the ball and hit +a good shot that landed just on the edge of the green, narrowly avoiding the +pond. Just as Fred addressed his ball, he looked up and noticed a funeral +procession along the road just behind the green. Fred put down his club, +took his hat off, and waited for the entire procession to pass. As soon as +the cars were gone he put his hat back on and started addressing the ball +again. Harry said, "Damn, Fred. That was a really nice thing you did, +waiting for the funeral to pass like that." + Fred finished his swing, making perfect contact with the ball. It +was an excellent shot that landed 7 feet from the hole. "It's the least I +could do," he said, smiling at his shot, "We were married for 22 years, +you know." +%% + Harry constantly irritated his friends with his eternal optimism. +No matter how bad the situation, he would always say, "Well, it could have +been worse." + To cure him of his annoying habit, his friends decided to invent a +situation so completely black, so dreadful, that even Harry could find no +hope in it. Approaching him at the club bar one day, one of them said, +"Harry! Did you hear what happened to George? He came home last night, +found his wife in bed with another man, shot them both, and then turned +the gun on himself!" + "Terrible," said Harry. "But it could have been worse." + "How in hell," demanded his dumfounded friend, "could it possibly +have been worse?" + "Well," said Harry, "if it had happened the night before, I'd be +dead now." +%% +Harry's bar has a new cocktail. It's called MRS punch. They make it with +milk, rum and sugar and it's wonderful. The milk is for vitality and the +sugar is for pep. They put in the rum so that people will know what to do +with all that pep and vitality. +%% +Hartley's First Law: + You can lead a horse to water, but if you can + get him to float on his back, you've got something. +%% +Hartley's Second Law: + Never sleep with anyone crazier than yourself. +%% +Harvard Law: + Under the most rigorously controlled conditions of pressure, + temperature, volume, humidity, and other variables, the + organism will do as it damn well pleases. +%% +Has the great art and mystery of politics no apparent utility? Does it +appear to be unqualifiedly ratty, raffish, sordid, obscene and low down, +and its salient virtuosi a gang of umitigated scoundrels? Then let us +not forget its high capacity to soothe and tickel the midriff, its +incomparable services as a maker of entertainment. + -- H.L. Mencken, "A Carnival of Buncombe" +%% +Haste makes waste. + -- John Heywood +%% +Hate is like acid. It can damage the vessel in which it is +stored as well as destroy the object on which it is poured. +%% +Hate the sin and love the sinner. + -- Mahatma Gandhi +%% +Hating the Yankees is as American as pizza pie, +unwed mothers and cheating on your income tax. + -- Mike Royko +%% +Have a coke and a smile! + -- John DeLorean +%% +Have a nice day! +%% +Have a nice diurnal anomaly. +%% +Have a place for everything and keep the thing +somewhere else; this is not advice, it is merely custom. + -- Mark Twain +%% +Have a taco. + -- P.S. Beagle +%% +Have at you! +%% +Have no friends not equal to yourself. + -- Confucius +%% +Have the courage to take your own thoughts +seriously, for they will shape you. + -- Albert Einstein +%% +Have you ever felt like a wounded cow +halfway between an oven and a pasture? +walking in a trance toward a pregnant + seventeen-year-old housewife's + two-day-old cookbook? + -- Richard Brautigan +%% +Have you ever met a man of good character where women are concerned? + +Well, I haven't. I find that whenever a woman becomes friends with me, +she becomes jealous, exacting, suspicious, and a damn nuisance; and +whenever I become friends with a woman, I become selfish and tyrannical. +So here I am, Pickering, a confirmed old bachelor and very likely to +remain so. + -- Henry Higgins, "My Fair Lady" +%% +Have you ever noticed that the people who are always trying +to tell you `there's a time for work and a time for play' +never find the time for play? +%% +Have you ever really thought about there being a simple solution to +America's problems? Why, we could solve all of our raw materials +difficulties, foreign complications etc. over a long weekend. If we +got up early, early mind you, on Saturday, we could take over Mexico +by 10:00. Panama and most of South America would be a bit more difficult, +but I believe we could do it by 6 or 7 that evening. Turning our +attention northward, Canada would require most of Sunday morning. +General mopping up and execution of the civilian populations would take +up Sunday afternoon. I just don't understand why Washington hasn't +thought of this... +%% +Have you flogged your kid today? +%% +Have you locked your file cabinet? +%% +Have you noticed that all you need to grow healthy, +vigorous grass is a crack in your sidewalk? +%% +Have you seen how Sonny's burning, +Like some bright erotic star, +He lights up the proceedings, +And raises the temperature. + -- The Birthday Party, "Sonny's Burning" +%% +Have you seen the old man in the closed down market, +Kicking up the papers in his worn out shoes? +In his eyes you see no pride, hands hang loosely at his side +Yesterdays papers, telling yesterdays news. + +How can you tell me you're lonely, +And say for you the sun don't shine? +Let me take you by the hand +Lead you through the streets of London +I'll show you something to make you change your mind... + +Have you seen the old man outside the sea-mans mission +Memories fading like the metal ribbons that he wears. +In our winter city the rain cries a little pity +For one more forgotten hero and a world that doesn't care... +%% +Have you seen the well-to-do, up and down Park Avenue? +On that famous thoroughfare, with their noses in the air, +High hats and Arrow collars, white spats and lots of dollars, +Spending every dime, for a wonderful time... +If you're blue and you don't know where to go to, +Why don't you go where fashion sits, +... +Dressed up like a million dollar trooper, +Trying hard to look like Gary Cooper, (super dooper) +Come, let's mix where Rockefeller's walk with sticks, +Or umberellas, in their mitts, +Puttin' on the Ritz. +... +If you're blue and you don't know where to go to, +Why don't you go where fashion sits, +Puttin' on the Ritz. +Puttin' on the Ritz. +Puttin' on the Ritz. +Puttin' on the Ritz. +%% +Having a wonderful wine, wish you were beer. +%% +Having nothing, nothing can he lose. + -- William Shakespeare, "Henry VI" +%% +Having the fewest wants, I am nearest to the gods. + -- Socrates +%% +Having wandered helplessly into a blinding snowstorm Sam was greatly +relieved to see a sturdy Saint Bernard dog bounding toward him with +the traditional keg of brandy strapped to his collar. + "At last," cried Sam, "man's best friend -- and a great big +dog, too!" +%% +Hawkeye's Conclusion: + It's not easy to play the clown + when you've got to run the whole circus. +%% +He does it with a better grace, but I do it more natural. + -- William Shakespeare, "Twelfth-Night" +%% +He dove down overweighted with lead. +Passed one hundred and flat lost his head. + He flapped and he flailed, + Spit his hose and he wailed, +Swallowed water and found himself dead. +%% +He draweth out the thread of his verbosity +finer than the staple of his argument. + -- William Shakespeare, "Love's Labour's Lost" +%% +He gave her a look that you could have poured on a waffle. +%% +He grabbed me by my slender neck, +I could not call or scream. +He dragged me to his tiny room, +Where we could not be seen. +He tore away my filmy wrap, +And gazed upon my form. +I so cold and frightened, +While he so strong and warm. +He pressed me to his thirsty lips, +I gave him every drop. +He drained me of my very self, +I could not make him stop! +And that is why you see me here, +An empty, broken bottle of beer... +%% + He had been bitten by a dog, but didn't give it much thought +until he noticed that the wound was taking a remarkably long time to +heal. Finally, he consulted a doctor who took one look at it and +ordered the dog brought in. Just as he had suspected, the dog had +rabies. Since it was too late to give the patient serum, the doctor +felt he had to prepare him for the worst. The poor man sat down at the +doctor's desk and began to write. His physician tried to comfort him. +"Perhaps it won't be so bad," he said. "You needn't make out your will +right now." + "I'm not making out any will," relied the man. "I'm just writing +out a list of people I'm going to bite!" +%% +He had that rare weird electricity about him -- that extremely wild +and heavy presence that you only see in a person who has abandoned +all hope of ever behaving "normally." + -- Hunter S. Thompson, "Fear and Loathing '72" +%% +He hadn't a single redeeming vice. + -- Oscar Wilde +%% +He has not acquired a fortune; the fortune has acquired him. + -- Bion +%% +He hath eaten me out of house and home. + -- William Shakespeare, "Henry IV" +%% +He is considered a most graceful speaker +who can say nothing in the most words. +%% +He is no lawyer who cannot take two sides. +%% +He is now rising from affluence to poverty. + -- Mark Twain +%% +He is the best of men who dislikes power. + -- Mohammed +%% +He is truly wise who gains wisdom from another's mishap. +%% +He jests at scars who never felt a wound. + -- Shakespeare, "Romeo and Juliet, II. 2" +%% +He keeps differentiating, flying off on a tangent. +%% +He knows not how to know who knows not also how to unknow. + -- Sir Richard Burton +%% +He laughs at every joke three times... once when it's told, +once when it's explained, and once when he understands it. +%% +He looked at me as if I was a side dish he hadn't ordered. +%% +He missed an invaluable opportunity to hold this tongue. + -- Andrew Lang +%% +He played the king as if afraid someone else would play the ace. + -- John Mason Brown, drama critic +%% +He tells you when you've got on too much lipstick, +And helps you with your girdle when your hips stick. + -- O. Nash, on the perfect husband +%% +He that breaks a thing to find out what it is has left the path of wisdom. + -- J.R.R. Tolkien +%% +He that bringeth a present, findeth the door open. + -- Scottish proverb. +%% +He that composes himself is wiser than he that composes a book. + -- B. Franklin +%% +He that is giddy thinks the world turns round. + -- William Shakespeare, "The Taming of the Shrew" +%% +He that would govern others, first should be the master of himself. +%% +He thinks by infection, catching an opinion like a cold. +%% +He thought he saw an albatross +That fluttered 'round the lamp. +He looked again and saw it was +A penny postage stamp. +"You'd best be getting home," he said, +"The nights are rather damp." +%% +He thought of Musashi, the Sword Saint, standing in his garden more than +three hundred years ago. "What is the 'Body of a rock'?" he was asked. +In answer, Musashi summoned a pupil of his and bid him kill himself by +slashing his abdomen with a knife. Just as the pupil was about to comply, +the Master stayed his hand, saying, "That is the 'Body of a rock'." + -- Eric Van Lustbader +%% +He walks as if balancing the family tree on his nose. +%% +He was not only a great swordsman, but also a cunning linguist. +%% +He was part of my dream, of course -- +but then I was part of his dream too. + -- Lewis Carroll +%% +He was so narrow-minded he could see through a keyhole with both eyes. +%% +He who Laughs, Lasts. +%% +He who always plows a straight furrow is in a rut. +%% +He who attacks the fundamentals of the American +broadcasting industry attacks democracy itself. + -- William S. Paley, chairman of CBS +%% +He who enters his wife's dressing room is a philosopher or a fool. + -- Balzac +%% +He who falls in love with himself will have no rivals. +%% +He who fears the unknown may one day flee from his own backside. + -- Sinbad +%% +He who fights and runs away lives to fight another day. +%% +He who foresees calamities suffers them twice over. +%% +He who has a shady past knows that nice guys finish last. +%% +He who has but four and spends five has no need for a wallet. +%% +He who has imagination without learning has wings but no feet. +%% +He who hates vices hates mankind. +%% +He who hesitates is last. +%% +He who hesitates is sometimes saved. +%% +He who hoots with owls by night cannot soar with eagles by day. +%% +He who invents adages for others to peruse +takes along rowboat when going on cruise. +%% +He who is content with his lot probably has a lot. +%% +He who is flogged by fate and laughs the louder is a masochist. +%% +He who is good for making excuses is seldom good for anything else. +%% +He who is intoxicated with wine will be sober again in the course of the +night, but he who is intoxicated by the cupbearer will not recover his +senses until the day of judgement. + -- Saadi +%% +He who is known as an early riser need not get up until noon. +%% +He who is still laughing hasn't yet heard the bad news. + -- Bertolt Brecht +%% +He who knows, does not speak. He who speaks, does not know. + -- Lao Tsu +%% +He who knows nothing, knows nothing. +But he who knows he knows nothing knows something. +And he who knows someone whose friend's wife's brother knows nothing, + he knows something. Or something like that. +%% +He who knows others is wise. +He who knows himself is enlightened. + -- Lao Tsu +%% +He who knows that enough is enough will always have enough. + -- Lao Tsu +%% +He who laughs last -- missed the punch line. +%% +He who laughs last didn't get the joke. +%% +He who laughs last hasn't been told the terrible truth. +%% +He who laughs last is probably your boss. +%% +He who laughs last probably doesn't understand the joke. +%% +He who laughs last usually had to have joke explained. +%% +He who laughs, lasts. +%% +He who lives without folly is less wise than he believes. +%% +He who loses, wins the race, +And parallel lines meet in space. + -- John Boyd, "Last Starship from Earth" +%% +He who makes a beast of himself gets rid of the pain of being a man. + -- Dr. Johnson +%% +He who minds his own business is never unemployed. +%% +He who slings mud generally loses ground. + -- Adlai Stevenson +%% +He who slings mud loses ground. + -- Chinese Proverb +%% +He who spends a storm beneath a tree, takes life with a grain of TNT. +%% +He who steps on others to reach the top has good balance. +%% +He who trains his tongue to quote the learned +sages, will be known far and wide as a smart ass. + -- Howard Kandel +%% +He who walks on burning coals is sure to get burned. + -- Sinbad +%% +He who wonders discovers that this in itself is wonder. + -- M.C. Escher +%% +He who writes with no misspelled words has prevented a first suspicion +on the limits of his scholarship or, in the social world, of his general +education and culture. + -- Julia Norton McCorkle +%% +He: Do you like Kipling? +She: Oh, you naughty boy, I don't know! I've never kippled! +%% +He: "If I made love to you, would you yell?" +She: "What do you want me to yell?" + -- Benny Hill +%% +Health is merely the slowest possible rate at which one can die. +%% +Heard about the man who never worried about his marriage until he +moved from New York to California and discovered that he still had +the same mailman? +%% +Heard that the next Space Shuttle is supposed to carry several +Guernsey cows? It's gonna be the herd shot 'round the world. +%% +Hearts will never be practical until they can be made unbreakable. + -- The Wizard of Oz +%% +Heisenberg may have been here. +%% +Hell hath no fury like a bureaucrat scorned. + -- Milton Friedman +%% +Hell hath no limits, nor is circumscribed in one self place, +for where we are is Hell, and where Hell is there must we ever be. + -- Christopher Marlowe, "Doctor Faustus" +%% +Hell is empty and all the devils are here. + -- Wm. Shakespeare, "The Tempest" +%% +Heller's Law: + The first myth of management is that it exists. + +Johnson's Corollary: + Nobody really knows what is going on anywhere within the + organization. +%% +Hello. Jim Rockford's machine, this is Larry Doheny's machine. Will you +please have your master call my master at his convenience? Thank you. +Thank you. Thank you. Thank you. Thank you. Thank you. +%% +Hello, friend! You say things aren't going too well? You say you have a +date with your favorite girl when it starts raining so hard you can't see? +And you're out on some back road when the car stalls and won't start, so +you set off accross the fields, and 50 feet of barbed wire hits you right +smack in the puss? And then there's a big explosion behind you and you +don't hear your girl screaming any more? + + Well, take a walk in the sun and hold your head up high! + You'll show the world; you'll tell them where to get off! + You'll never give up, never give up, never give up -- that ship! +%% +Hell's broken loose. + -- Robert Greene +%% +Help! I'm trapped in a Chinese computer factory! +%% +Help! I'm trapped in a PDP 11/70! +%% +Help a swallow land at Capistrano. +%% +Help stamp out and abolish redundancy! +%% +Hempstone's Question: + If you have to travel on the Titanic, why not go first class? +%% +Her locks an ancient lady gave +Her loving husband's life to save; +And men -- they honored so the dame -- +Upon some stars bestowed her name. + +But to our modern married fair, +Who'd give their lords to save their hair, +No stellar recognition's given. +There are not stars enough in heaven. +%% +Here I am again right where I know I shouldn't be +I've been caught inside this trap too many times +I must've walked these steps and said these words a + thousand times before +It seems like I know everybody's lines. + -- David Bromberg, "How Late'll You Play 'Til?" +%% +Here I sit, broken-hearted, +All logged in, but work unstarted. +First net.this and net.that, +And a hot buttered bun for net.fat. + +The boss comes by, and I play the game, +Then I turn back to net.flame. +Is there a cure (I need your views), +For someone trapped in net.news? + +I need your help, I say 'tween sobs, +'Cause I'll soon be listed in net.jobs. +%% +Here at the Phone Company, we serve all kinds of people; +from President's and Kings to the scum of the earth... +%% +Here comes the orator, with his flood of words and his drop of reason. +%% +Here in my heart, I am Helen; + I'm Aspasia and Hero, at least. +I'm Judith, and Jael, and Madame de Stael; + I'm Salome, moon of the East. + +Here in my soul I am Sappho; + Lady Hamilton am I, as well. +In me Recamier vies with Kitty O'Shea, + With Dido, and Eve, and poor Nell. + +I'm all of the glamorous ladies + At whose beckoning history shook. +But you are a man, and see only my pan, + So I stay at home with a book. + -- Dorothy Parker +%% +Here is a test to find whether your mission on earth is finished: +if you're alive, it isn't. +%% +Here there by tygers. +%% +Here's to women. Would that we could fall +into her arms without falling into her hands. + -- Ambrose Bierce +%% +Herth's Law: + He who turns the other cheek too far gets it in the neck. +%% +He's been like a father to me, +He's the only DJ you can get after three, +I'm an all-night musician in a rock and roll band, +And why he don't like me I don't understand. + -- The Byrds +%% +He's dead, Jim. +%% +He's got the heart of a little child, +and he keeps it in a jar on his desk. +%% +He's just a politician trying to save both his faces... +%% +He's just like Capistrano, always ready for a few swallows. +%% +He's the kind of guy, that, well, if you were ever in a jam he'd +be there... with two slices of bread and some chunky peanut butter. +%% +Heuristics are bug ridden by definition. +If they didn't have bugs, then they'd be algorithms. +%% +Hewett's Observation: + The rudeness of a bureaucrat is inversely proportional to his or + her position in the governmental hierarchy and to the number of + peers similarly engaged. +%% +Hey, Jim, it's me, Susie Lillis from the laundromat. You said you were +gonna call and it's been two weeks. What's wrong, you lose my number? +%% +"Hey, Sam, how about a loan?" +"Whattaya need?" +"Oh, about $500." +"Whattaya got for collateral?" +"Whattaya need?" +"How about an eye?" + -- Sam Giancana +%% +Hey, diddle, diddle the overflow pdl +To get a little more stack; +If that's not enough then you lose it all +And have to pop all the way back. +%% +Hi! How are things going? + (just fine, thank you...) +Great! Say, could I bother you for a question? + (you just asked one...) +Well, how about one more? + (one more than the first one?) +Yes. + (you already asked that...) +[at this point, Alphonso gets smart... ] +May I ask two questions, sir? + (no.) +May I ask ONE then? + (nope...) +Then may I ask, sir, how I may ask you a question? + (yes, you may.) +Sir, how may I ask you a question? + (you must ask for retroactive question asking privileges for + the number of questions you have asked, then ask for that + number plus two, one for the current question, and one for the + next one) +Sir, may I ask nine questions? + (go right ahead...) +%% +Hi Jimbo. Dennis. Really appreciate the help on the income tax. +You wanna help on the audit now? +%% +Hi there! This is just a note from me, to you, to tell you, the person +reading this note, that I can't think up any more famous quotes, jokes, +nor bizarre stories, so you may as well go home. +%% +Hickery Dickery Dock, +The mice ran up the clock, +The clock struck one, +The others escaped with minor injuries. +%% +Higgeldy Piggeldy, +Hamlet of Elsinore +Ruffled the critics by +Dropping this bomb: +"Phooey on Freud and his +Psychoanalysis, +Oedipus, Shmoedipus, +I just loved Mom." +%% +Higgins: Doolittle, you're either an honest man or a rogue. +Doolittle: A little of both, Guv'nor. Like the rest of us, a + little of both. + -- Shaw, "Pygmalion" +%% +Higgledy Piggledy Coeducational +Yale University Extracurricular +Gave up misogyny Heterosexual +Opened its door. Fun is in store. +%% +High heels are a device invented by a woman +who was tired of being kissed on the forehead. +%% +Hildebrant's Principle: + If you don't know where you are going, + any road will get you there. +%% +Him: "Your skin is so soft. Are you a model?" +Her: "No," [blush] "I'm a cosmetologist." +Him: "Really? That's incredible... + It must be very tough to handle weightlessness." + -- The Jerk. +%% +Hindsight is an exact science. +%% +Hire the morally handicapped. +%% +His followers called him Mahasamatman and said he was a god. He preferred +to drop the Maha- and the -atman, however, and called himself Sam. He never +claimed to be a god. But then, he never claimed not to be a god. Circum- +stances being what they were, neither admission could be of any benefit. +Silence, though, could. It was in the days of the rains that their prayers +went up, not from the fingering of knotted prayer cords or the spinning of +prayer wheels, but from the great pray-machine in the monastery of Ratri, +goddess of the Night. The high-frequency prayers were directed upward through +the atmosphere and out beyond it, passing into that golden cloud called the +Bridge of the Gods, which circles the entire world, is seen as a bronze +rainbow at night and is the place where the red sun becomes orange at midday. +Some of the monks doubted the orthodoxy of this prayer technique... + -- Roger Zelazny, "Lord of Light" +%% +His heart was yours from the first moment that you met. +%% +His life was formal; his actions seemed ruled with a ruler. +%% +His mind is like a steel trap: full of mice. + -- Foghorn Leghorn +%% +History books which contain no lies are extremely dull. +%% +History has the relation to truth that theology has to religion -- +i.e. none to speak of. + -- Lazarus Long +%% +History is on our side (as long as we can control the historians). +%% +History repeats itself. That's one thing wrong with history. +%% +History repeats itself only if one does not listen the first time. +%% +Hit them biscuits with another touch of gravy, +Burn that sausage just a match or two more done. +Pour my black old coffee longer, +While that smell is gettin' stronger +A semi-meal ain't nuthin' much to want. + +Loan me ten, I got a feelin' it'll save me, +With an ornery soul who don't shoot pool for fun, +If that coat'll fit you're wearin', +The Lord'll bless your sharin' +A semi-friend ain't nuthin' much to want. + +And let me halfway fall in love, +For part of a lonely night, +With a semi-pretty woman in my arms. +Yes, I could halfway fall in deep-- +Into a snugglin', lovin' heap, +With a semi-pretty woman in my arms. + -- Elroy Blunt +%% +Hitchcock's Staple Principle: + The stapler runs out of staples + only while you are trying to staple something. +%% +Hlade's Law: + If you have a difficult task, give it to a lazy person -- + they will find an easier way to do it. +%% +Hoare's Law of Large Problems: + Inside every large problem is a small + problem struggling to get out. +%% +Hodie natus est radici frater. +%% +Hoffer's Discovery: + The grand act of a dying institution is to issue a newly + revised, enlarged edition of the policies and procedures manual. +%% +Hofstadter's Law: + It always takes longer than you expect, even when you take + Hofstadter's Law into account. +%% +Hollywood is where if you don't have happiness you send out for it. + -- Rex Reed +%% +"Home, Sweet Home" must surely have been written by a bachelor. +%% +Home is the place where, when you have +to go there, they have to take you in. +%% +Home on the Range was originally written in beef-flat. +%% +Honesty is for the most part less profitable than dishonesty. + -- Plato +%% +Honesty pays, but it doesn't seem to pay enough to suit some people. + -- F.M. Hubbard +%% +Honesty's the best policy. + -- Miguel de Cervantes +%% +Honi soit la vache qui rit. +%% +Honk if you love peace and quiet. +%% +Hope is a good breakfast, but it is a bad supper. + -- Francis Bacon +%% +Hope is a waking dream. + -- Aristotle +%% +Hope not, lest ye be disappointed. + -- M. Horner +%% +Hope that the day after you die is a nice day. +%% +Horace's best ode would not please a young woman as much +as the mediocre verses of the young man she is in love with. + -- Moore +%% +Horner's Five Thumb Postulate: + Experience varies directly with equipment ruined. +%% +Horngren's Observation: + Among economists, the real world is often a special case. +%% +Hors d'oeuvres -- a ham sandwich cut into forty pieces. + -- Jack Benny +%% +Horse sense is the thing a horse has +which keeps it from betting on people. + -- W.C. Fields +%% +Horsecrap, little brother. There's always something more to be done. +Another palm to be greased. Another back to be scratched. Another +weak sister to be shored up. + -- J.R. Ewing +%% +Houdini escaping from New Jersey! +%% +Household hint: + If you are out of cream for your coffee, + mayonnaise makes a dandy substitute. +%% +Houston, Tranquillity Base here. The Eagle has landed. + -- Neil Armstrong +%% +How apt the poor are to be proud. + -- William Shakespeare, "Twelfth-Night" +%% +How can you be in two places at once +when you're not anywhere at all? +%% +How can you do 'New Math' problems with an 'Old Math' mind? + -- Schulz +%% +How can you govern a nation which has 246 kinds of cheese? + -- Charles de Gaulle +%% +How can you have any pudding if you don't eat your meat? + -- Pink Floyd +%% +How can you work when the system's so crowded? +%% +How come we never talk anymore? +%% +How come wrong numbers are never busy? +%% +How comes it to pass, then, that we appear such cowards +in reasoning, and are so afraid to stand the test of ridicule? + -- A. Cooper +%% +How do you explain school to a higher intelligence? + -- Elliot, "E.T." +%% +How doth the VAX's C-compiler + Improve its object code. +And even as we speak does it + Increase the system load. + +How patiently it seems to run + And spit out error flags, +While users, with frustration, all + Tear their clothes to rags. +%% +How doth the little crocodile + Improve his shining tail, +And pour the waters of the Nile + On every golden scale! + +How cheerfully he seems to grin, + How neatly spreads his claws, +And welcomes little fishes in, + With gently smiling jaws! +%% +How kind of you to want to live someone's life for them. +%% +How long a minute is depends on which +side of the bathroom door you're on. +%% +How many "coming men" has one known! +Where on earth do they all go to? +%% +How many people work here? +Oh, about half. +%% +How many priests are needed for a Boston Mass? +%% +How many weeks are there in a light year? +%% +How much does she love you? +Less than you'll ever know. +%% +How much of their influence on you +is a result of your influence on them? +%% +How often I found where I should be going +only by setting out for somewhere else. + -- R. Buckminster Fuller +%% +How sharper than a hound's tooth it is to have a thankless serpent. +%% +How sharper than a serpent's tooth is a sister's "see?" + -- Linus Van Pelt +%% +How untasteful can you get? +%% +How wonderful opera would be if there were no singers. +%% +How you look depends on where you go. +%% +However, never daunted, I will cope with adversity +in my traditional manner... sulking and nausea. + -- Tom K. Ryan +%% +Hubbard's Law: + Don't take life too seriously; + you won't get out of it alive. +%% +Huh? +%% +Human beings were created by water to transport it uphill. +%% +Human cardiac catheterization was introduced by Werner Forssman in 1929. +Ignoring his department chief, and tying his assistant to an operating +table to prevent her interference, he placed a ureteral catheter into +a vein in his arm, advanced it to the right atrium [of his heart], and +walked upstairs to the x-ray department where he took the confirmatory +x-ray film. In 1956, Dr. Forssman was awarded the Nobel Prize. +%% +Human kind cannot bear very much reality. + -- T.S. Eliot, "Four Quartets: Burnt Norton" +%% +Human resources are human first, and resources second. + -- J. Garbers +%% +Humans are communications junkies. We just can't get enough. + -- Alan Kay +%% +Humility is the first of the virtues -- for other people. + -- Oliver Wendell Holmes +%% +Hummingbirds never remember the words to songs. +%% +Humor is a drug which it's the fashion to abuse. + -- William Gilbert +%% +Humpty Dumpty was pushed. +%% +Humpty Dumpty sat on the wall, +Humpty Dumpty had a great fall! +All the king's horses, +And all the king's men, +Had scrambled eggs for breakfast again! +%% +Hurewitz's Memory Principle: + The chance of forgetting something is directly proportional + to... to... uh..... +%% +I wish there was a knob on the TV to turn up the intelligence. +There's a knob called "brightness", but it doesn't seem to work. + -- Gallagher +%% +I B M +U B M +We all B M +For I B M!!!! + -- H.A.R.L.I.E. +%% +I accept chaos. I am not sure whether it accepts me. I know some people +are terrified of the bomb. But then some people are terrified to be seen +carrying a modern screen magazine. Experience teaches us that silence +terrifies people the most. + -- Bob Dylan +%% +I allow the world to live as it chooses, +and I allow myself to live as I choose. +%% +I always had a repulsive need to be something more than human. + -- David Bowie +%% +I always will remember-- I was in no mood to trifle; +'Twas a year ago November-- I got down my trusty rifle +I went out to shoot some deer And went out to stalk my prey-- +On a morning bright and clear. What a haul I made that day! +I went and shot the maximum I tied them to my bumper and +The game laws would allow: I drove them home somehow, +Two game wardens, seven hunters, Two game wardens, seven hunters, +And a cow. And a cow. + +The Law was very firm, it People ask me how I do it +Took away my permit-- And I say, "There's nothin' to it! +The worst punishment I ever endured. You just stand there lookin' cute, +It turns out there was a reason: And when something moves, you shoot." +Cows were out of season, and And there's ten stuffed heads +One of the hunters wasn't insured. In my trophy room right now: + Two game wardens, seven hunters, + And a pure-bred gurnsey cow. + -- Tom Lehrer, "The Hunting Song" +%% +I am NOMAD! +%% +I am a computer. +I am dumber than any human and smarter than any administrator. +%% +I am a conscientious man, when I throw +rocks at seabirds I leave no tern unstoned. + -- Ogden Nash, "Everybody's Mind to Me a Kingdom Is" +%% +I am a man: nothing human is alien to me. + -- Publius Terentius Afer (Terence) +%% +I am an optimist. It does not seem too much use being anything else. + -- Winston Churchill +%% +I am convinced that the truest act of courage is to sacrifice ourselves +for others in a totally nonviolent struggle for justice. To be a man +is to suffer for others. + -- Cesar Chavez +%% +I am, in point of fact, a particularly haughty and exclusive person, of +pre-Adamite ancestral descent. You will understand this when I tell you +that I can trace my ancestry back to a protoplasmal primordial atomic +globule. Consequently, my family pride is something inconceivable. I +can't help it. I was born sneering. + -- Pooh-Bah, "The Mikado" +%% +I am looking for a honest man. + -- Diogenes the Cynic +%% +I am not a crook. + -- Richard Nixon +%% +I am not a politician and my other habits are also good. + -- A. Ward +%% +I am not afraid of tomorrow, for I have seen yesterday and I love today. + -- William Allen White +%% +I am not an Economist. I am an honest man! + -- Paul McCracken +%% +I am not now and never have been a girl friend of Henry Kissinger. + -- Gloria Steinem +%% +I am professionally trained in computer science, which is to say +(in all seriousness) that I am extremely poorly educated. + -- Joseph Weizenbaum, "Computer Power and Human Reason" +%% +I am ready to meet my Maker. Whether my Maker is prepared +for the great ordeal of meeting me is another matter. + -- W. Churchill +%% +I am the wandering glitch -- catch me if you can. +%% +I am two fools, I know, for loving, and for saying so. + -- John Donne +%% +I am very fond of the company of ladies. I like their beauty, +I like their delicacy, I like their vivacity, and I like their silence. + -- Johnson +%% +I asked the engineer who designed the communication terminal's keyboards +why these were not manufactured in a central facility, in view of the +small number needed [1 per month] in his factory. He explained that this +would be contrary to the political concept of local self-sufficiency. +Therefore, each factory needing keyboards, no matter how few, manufactures +them completely, even molding the keypads. + -- Isaac Auerbach, IEEE "Computer", Nov. 1979 +%% +I began many years ago, as so many young men do, in searching for the +perfect woman. I believed that if I looked long enough, and hard enough, +I would find her and then I would be secure for life. Well, the years +and romances came and went, and I eventually ended up settling for someone +a lot less than my idea of perfection. But one day, after many years +together, I lay there on our bed recovering from a slight illness. My +wife was sitting on a chair next to the bed, humming softly and watching +the late afternoon sun filtering through the trees. The only sounds to +be heard elsewhere were the clock ticking, the kettle downstairs starting +to boil, and an occasional schoolchild passing beneath our window. And +as I looked up into my wife's now wrinkled face, but still warm and +twinkling eyes, I realized something about perfection... It comes only +with time. + -- James L. Collymore, "Perfect Woman" +%% +I believe a little incompatibility is the spice of life, +particularly if he has income and she is pattable. + -- Ogden Nash +%% +I believe in getting into hot water; it keeps you clean. + -- G.K. Chesterton +%% +I belong to no organized party. I am a Democrat. + -- Will Rogers +%% +I bet the human brain is a kludge. + -- Marvin Minsky +%% +I call Christianity the one great curse, the one enormous and innermost +perversion, the one great instinct of revenge, for which no means are +too venomous, too underhand, too underground and too petty -- I call it +the one immortal blemish of mankind. + -- Fredrich Nietzsche +%% +I came, I saw, I deleted all your files. +%% +I came out of twelve years of college and I didn't even know how to sew. +All I could do was account -- I couldn't even account for myself. + -- Firesign Theatre +%% +I came to MIT to get an education for myself and a diploma for my mother. +%% +I can relate to that. +%% +I can resist anything but temptation. +%% +I can see him a'comin' +With his big boots on, +With his big thumb out, +He wants to get me. +He wants to hurt me. +He wants to bring me down. +But some time later, +When I feel a little straighter, +I'll come across a stranger +Who'll remind me of the danger, +And then.... I'll run him over. +Pretty smart on my part! +To find my way... In the dark! + -- Phil Ochs +%% +I can write better than anybody who can write faster, +and I can write faster than anybody who can write better. + -- A.J. Liebling +%% +I cannot and will not cut my conscience to fit this year's fashions. + -- Lillian Hellman +%% +I cannot believe that God plays dice with the cosmos. + -- Albert Einstein, on the randomness of quantum mechanics +%% +I cannot draw a cart, nor eat dried oats; +If it be man's work I will do it. +%% + I cannot read the fiery letters, said Frodo in a quavering voice. + No, said Gandalf, but I can. The letters are Elvish, of course, of +an ancient mode, but the language is that of Mordor, which I will not utter +here. They are lines of a verse long known in Elven-lore: + + This Ring, no other, is made by the elves, + Who'd pawn their own mother to grab it themselves. + Ruler of creeper, mortal, and scallop, + This is a sleeper that packs quite a wallop. + The Power almighty rests in this Lone Ring. + The Power, alrighty, for doing your Own Thing. + If broken or busted, it cannot be remade. + If found, send to Sorhed (with postage prepaid). + + -- National Lampoon, "Bored of the Rings" +%% +I can't complain, but sometimes I still do. + -- Joe Walsh +%% +I can't stand squealers; hit that guy. + -- Albert Anastasia +%% +I can't understand it. +I can't even understand the people who can understand it. + -- Queen Juliana of the Netherlands. +%% +I consider the day misspent that I am not +either charged with a crime or arrested for one. + -- "Ratsy" Tourbillon +%% +I could never learn to like her -- +except on a raft at sea with no other provisions in sight. + -- Mark Twain +%% +I couldn't possibly fail to disagree with you less. +%% +I despise the pleasure of pleasing people whom I despise. +%% + I did some heavy research so as to be prepared for "Mommy, why is +the sky blue?" + HE asked me about black holes in space. + (There's a hole *where*?) + + I boned up to be ready for, "Why is the grass green?" + HE wanted to discuss nature's food chains. + (Well, let's see, there's ShopRite, Pathmark...) + + I talked about Choo-Choo trains. + HE talked internal combustion engines. + (The INTERNAL COMBUSTION ENGINE said, "I think I can, I think I can.") + + I was delighted with the video game craze, thinking we could compete +as equals. + HE described the complexities of the microchips required to create +the graphics. + + Then puberty struck. Ah, adolescence. + HE said, "Mom, I just don't understand women." + (Gotcha!) + -- Betty LiBrizzi, "The Care and Feeding of a Gifted Child" +%% +I didn't get sophisticated -- I just got tired. +But maybe that's what sophisticated is -- being tired. + -- Rita Gain +%% +I disagree with what you say, but will defend +to the death your right to tell such LIES! +%% +I do desire we may be better strangers. + -- William Shakespeare, "As You Like It" +%% +I do enjoy a good long walk -- especially when my wife takes one. +%% +I do not care if half the league strikes. Those who do will encounter +quick retribution. All will be suspended, and I don't care if it wrecks +the National League for five years. This is the United States of America +and one citizen has as much right to play as another. + -- Ford Frick, National League President, reacting to a + threatened strike by some Cardinal players in 1947 if + Jackie Robinson took the field against St. Louis. The + Cardinals backed down and played. +%% +I do not fear computers. I fear the lack of them. + -- Isaac Asimov +%% +I do not feel obliged to believe that the same God who has endowed us with +sense, reason, and intellect has intended us to forgo their use. + -- Galileo Galilei +%% +I do not know myself and God forbid that I should. + -- Johann Wolfgang von Goethe +%% +I do not know where to find in any literature, whether ancient or modern, +any adequate account of that nature with which I am acquainted. Mythology +comes nearest to it of any. + -- Henry David Thoreau +%% +I do not know whether I was then a man dreaming I was a +butterfly, or whether I am now a butterfly dreaming I am a man. + -- Chuang-tzu +%% +I do not seek the ignorant; the ignorant seek me -- I will instruct them. +I ask nothing but sincerity. If they come out of habit, they become +tiresome. + -- I Ching +%% +I do not take drugs -- I am drugs. + -- Salvador Dali +%% +I don't care what star you're following, +get that camel off my front lawn. + -- Heard in Bethlehem +%% +I don't drink, I don't like it, it makes me feel too good. + -- K. Coates +%% +I don't get no respect. +%% +I don't have any solution but I certainly admire the problem. + -- Ashleigh Brilliant +%% +I don't know what Descartes' got, +But booze can do what Kant cannot. + -- Mike Cross +%% + "I don't know what you mean by 'glory'," Alice said. + Humpty Dumpty smiled contemptuously. "Of course you don't -- +till I tell you. I meant 'there's a nice knock-down argument for you!'" + "But glory doesn't mean 'a nice knock-down argument'," Alice +objected. + "When I use a word," Humpty Dumpty said, in a rather scornful +tone, "it means just what I choose it to mean -- neither more nor less." + "The question is," said Alice, "whether you can make words mean +so many different things." + "The question is," said Humpty Dumpty, "which is to be master -- +that's all." +%% +I don't know who my grandfather was; I am much +more concerned to know what his grandson will be. + -- Abraham Lincoln +%% +I don't know why *anyone* would want a computer in their home. + -- Ken Olson, president of DEC, 1974 +%% +I don't know why we're here, I say we all go home and free associate. +%% +I don't like spinach, and I'm glad I don't, +because if I liked it I'd eat it, and I'd just hate it. + -- Clarence Darrow +%% +I don't love you, asshole, I love your daughter. + -- The Undergraduate +%% +I don't make the rules, Gil, I only play the game. + -- Cash McCall +%% +I don't need no arms around me... +I don't need no drugs to calm me... +I have seen the writing on the wall. +Don't think I need anything at all. +No! Don't think I need anything at all! +All in all, it was all just bricks in the wall. +All in all, it was all just bricks in the wall. + -- Pink Floyd, "Another Brick in the Wall", Part III +%% +I don't remember it, but I have it written down. +%% +I don't see what's wrong with giving Bobby a +little experience before he starts to practice law. + -- John F. Kennedy, upon appointing his brother + Attorney-General. +%% +I don't understand you anymore. +%% +I don't wanna argue, and I don't wanna fight, +But there will definitely be a party tonight... +%% +I don't want a pickle, +I just wanna ride on my motorcycle. +And I don't want to die, +I just want to ride on my motorcycle. + -- Arlo Guthrie +%% +I don't want people to love me. It makes for obligations. + -- Jean Anouilh +%% +I don't want to bore you, but there's nobody else around for me to bore. +%% +I don't wish to appear overly inquisitive, but are you still alive? +%% +I dote on his very absence. + -- William Shakespeare, "The Merchant of Venice" +%% +I dread success. To have succeeded is to have finished one's business on +earth, like the male spider, who is killed by the female the moment he has +succeeded in his courtship. I like a state of continual becoming, with a +goal in front and not behind. + -- George Bernard Shaw +%% +I dream of things that aren't and ask "why not?" +%% +I drink to make other people interesting. + -- George Jean Nathan +%% +I enjoy the time that we spend together. +%% +I exist, therefore I am paid. +%% +I fear explanations explanatory of things explained. +%% +I fell asleep reading a dull book, +and I dreamt that I was reading on, +so I woke up from sheer boredom. +%% + I for one cannot protest the recent M.T.A. fare hike and the +accompanying promises that this would in no way improve service. For +the transit system, as it now operates, has hidden advantages that +can't be measured in monetary terms. + Personally, I feel that it is well worth 75 cents or even $1 to +have that unimpeachable excuse whenever I am late to anything: "I came +by subway." Those four words have such magic in them that if Godot +should someday show up and mumble them, any audience would instantly +understand his long delay. +%% +I found Rome a city of bricks and left it a city of marble. + -- Augustus Caesar +%% +I generally avoid temptation unless I can't resist it. + -- Mae West +%% +I get up each morning, gather my wits. +Pick up the paper, read the obits. +If I'm not there I know I'm not dead. +So I eat a good breakfast and go back to bed. + +Oh, how do I know my youth is all spent? +My get-up-and-go has got-up-and-went. +But in spite of it all, I'm able to grin, +And think of the places my get-up has been. + -- Pete Seeger +%% +I give you the man who -- the man who -- uh, I forgets the man who? + -- Beauregard Bugleboy +%% +I go the way that Providence dictates. + -- Adolf Hitler +%% +I got vision, and the rest of the world wears bifocals. + -- Butch Cassidy +%% +I grew up in an Italian family, you know, the +strange thing about Italians -- they're so Jewish. + -- Kay Ballard +%% +I guess I've been so wrapped up in playing the game that I never took +time enough to figure out where the goal line was -- what it meant to +win -- or even how you won. + -- Cash McCall +%% +I guess I've been wrong all my life, but so have billions of +other people... Certainty is just an emotion. + -- Hal Clement +%% +I guess the Little League is even littler than we thought. + -- D. Cavett +%% +I had a dream last night... +I dreamt about 1976. +I dreamt about a country with incurable brain damage... +I even dreamt they gave it a heart transplant. +Then I woke up and I knew it was only a nightmare... +so I went back to sleep again. + -- Ralph Steadman, "Fear and Loathing '72" +%% +I had a feeling once about mathematics -- that I saw it all. Depth beyond +depth was revealed to me -- the Byss and the Abyss. I saw -- as one might +see the transit of Venus or even the Lord Mayor's Show -- a quantity passing +through infinity and changing its sign from plus to minus. I saw exactly +why it happened and why tergiversation was inevitable -- but it was after +dinner and I let it go. + -- Winston Churchill +%% +I had a virgin once. I had to go to Florida for her. She was twelve +years old, blind in one eye, and carried a stuffed alligator labeled +"Made in Taiwan". + -- The Stunt Man +%% +I had the rare misfortune of being one of the first people +to try and implement a PL/1 compiler. + -- T. Cheatham +%% +I hate dying. + -- Dave Johnson +%% +I hate quotations. + -- Ralph Waldo Emerson +%% +I have a hard time being attracted to anyone who can beat me up. + -- John McGrath, Atlanta sportswriter on women weightlifters. +%% +I have a little shadow that goes in and out with me, +And what can be the use of him is more than I can see. +He is very, very like me from the heels up to the head; +And I see him jump before me, when I jump into my bed. + +The funniest thing about him is the way he likes to grow-- +Not at all like proper children, which is always very slow; +For he sometimes shoots up taller, like an india-rubber ball, +And he sometimes gets so little that there's none of him at all. + -- R.L. Stevenson +%% +I have a theory that it's impossible to +prove anything, but I can't prove it. +%% +I have a very small mind and must live with it. + -- E. Dijkstra +%% +I have a very strange feeling about this... + -- Luke Skywalker +%% +I have always noticed that whenever a radical takes +to Imperialism, he catches it in a very acute form. + -- Winston Churchill, 1903 +%% +I have become me without my consent. +%% +I have defined the hundred per cent American +as ninety-nine per cent an idiot. + -- George Bernard Shaw +%% +I have discovered the art of deceiving diplomats. +I tell them the truth and they never believe me. + -- Camillo Di Cavour +%% +I have found it impossible to carry the heavy burden of responsibility and +to discharge my duties as king as I would wish to do without the help and +support of the woman I love. + -- Edward, Duke of Windsor, 1936, announcing his abdication + of the British throne in order to marry the American divorcee + Wallis Warfield Simpson. +%% +I have gained this by philosophy: +that I do without being commanded what others +do only from fear of the law. + -- Aristotle +%% +I have hardly ever known a mathematician who was capable of reasoning. + -- Plato +%% +I have just had eighteen whiskeys in a row. +I do believe that is a record. + -- Dylan Thomas, his last words. +%% +I have learned silence from the talkative, +toleration from the intolerant, and kindness from the unkind. + -- Kahlil Gibran +%% +I have lots of things in my pockets; +None of them is worth anything. +Sociopolitical whines aside, +Gan you give me, gratis, free, +The price of half a gallon +Of Gallo extra bad +And most of the bus fare home. +%% +I have made mistakes but I have never made the +mistake of claiming that I have never made one. + -- James Gordon Bennett +%% +I have made this letter longer than usual +because I lack the time to make it shorter. + -- Blaise Pascal +%% +I have never been one to sacrifice +my appetite on the altar of appearance. + -- A.M. Readyhough +%% +I have never let my schooling interfere with my education. + -- Mark Twain +%% +I have no doubt the Devil grins, +As seas of ink I spatter. +Ye gods, forgive my "literary" sins-- +The other kind don't matter. + -- Robert W. Service +%% +I have no right, by anything I do or say, to demean a human being in his +own eyes. What matters is not what I think of him; it is what he thinks +of himself. To undermine a man's self-respect is a sin. + -- Antoine de Saint-Exupery +%% +I have not yet begun to byte! +%% +I have nothing but utter contempt for the courts of this land. + -- George Wallace +%% +I have now come to the conclusion never again to think of marrying, +and for this reason: I can never be satisfied with anyone who would +be blockhead enough to have me. + -- Abraham Lincoln +%% +I have often regretted my speech, never my silence. + -- Publilius Syrus +%% +I have seen the future and it is just like the present, only longer. + -- Kehlog Albran +%% +I have that old biological urge, +I have that old irresistible surge, +I'm hungry. +%% +I have the simplest tastes. I am always satisfied with the best. + -- Oscar Wilde +%% +I have ways of making money that you know nothing of. + -- John D. Rockefeller +%% +I haven't lost my mind -- it's backed up on tape somewhere. +%% +I hear the sound that the machines make, +and feel my heart break, just for a moment. +%% +I hear what you're saying but I just don't care. +%% +I heard there was a lot of sex on television these days, +but when I tried it I kept falling off. +%% +I hold it, that a little rebellion, now and then, is a good thing... + -- Thomas Jefferson +%% +I hold your hand in mine, dear, I press it to my lips, +I take a healthy bite from your dainty fingertips, +My joy would be complete, dear, if you were only here, +But still I keep your hand as a precious souvenir. + +The night you died I cut it off, I really don't know why, +For now each time I kiss it I get bloodstains on my tie, +I'm sorry now I killed you, our love was something fine, +So until they come to get me I will hold your hand in mine. + + -- Tom Lehrer, "I Hold Your Hand In Mine" +%% +I just asked myself... what would John DeLorean do? + -- Raoul Duke +%% +I just need enough to tide me over until I need more. + -- Bill Hoest +%% +I knew Leo G. Carrol +Was over a barrel +When Tarantula took to the hills. ["Lick it!"] +And I really got hot +When I saw Jeanette Scott +Fight a triffid that spits poison and kills. + +Science fiction, double feature +Doctor X will build a creature. +See androids fighting Brad and Janet +Anne Francis stars in Forbidden Planet +Oh Oh Oh Oh Oh +At the late night, double feature, picture show. + -- The Rocky Horror Picture Show +%% +I know if you been talkin' you done said +just how suprised you wuz by the living dead. +You wuz suprised that they could understand you words +and never respond once to all the truth they heard. +But don't you get square! +There ain't no rule that says they got to care. +They can always swear they're deaf, dumb and blind. +%% +I know not how I came into this, +shall I call it a dying life or a living death? + -- St. Augustine +%% +I know not with what weapons World War III will be fought, but +World War IV will be fought with sticks and stones. + -- Albert Einstein +%% +I know on which side my bread is buttered. + -- John Heywood +%% +I know the disposition of women: when you will, they won't; when +you won't, they set their hearts upon you of their own inclination. + -- Publius Terentius Afer (Terence) +%% +I know what you're thinking. Did he fire six shots or only five? Well, to +tell you the truth, I forgot myself in all this excitement. But bein' this +is a .44 Magnum, the most powerful handgun in the world, and it could blow +your head clean off, you have to ask yourself one question: `Do I feel lucky?' +Well, do you, punk? + -- Dirty Harry +%% +I know you believe you understand what you think this fortune says, +but I'm not sure you realize that what you are reading is not what +it means. +%% +I know you think you thought you knew what you thought I said, +but I'm not sure you understood what you thought I meant. +%% +I know you're in search of yourself, I just haven't seen you anywhere. +%% +I lately lost a preposition; +It hid, I thought, beneath my chair +And angrily I cried, "Perdition! +Up from out of under there." + +Correctness is my vade mecum, +And straggling phrases I abhor, +And yet I wondered, "What should he come +Up from out of under for?" + -- Morris Bishop +%% +I like being single. I'm always there when I need me. + -- Art Leo +%% +I like myself, but I won't say I'm as +handsome as the bull that kidnapped Europa. + -- Marcus Tullius Cicero +%% +I like work; it fascinates me; +I can sit and look at it for hours. +%% +I live the way I type; fast, with a lot of mistakes. +%% +I look at life as being cruise director on the Titanic. +I may not get there, but I'm going first class. + -- Art Buchwald +%% +I love mankind ... It's people I hate. + -- Schulz +%% +I love the smell of napalm in the morning. + -- Robert Duval, "Apocalypse Now" +%% +I love treason but hate a traitor. + -- Gaius Julius Caesar +%% +I love you, not only for what you are, +but for what I am when I am with you. + -- Roy Croft +%% +I married beneath me. All women do. + -- Nancy, Lady Astor +%% +I may be getting older, but I refuse to grow up! +%% +I may not be totally perfect, but parts of me are excellent. + -- Ashleigh Brilliant +%% +I must Create a System, or be enslav'd by another Man's; +I will not Reason and Compare; my business is to Create. + -- William Blake, "Jerusalem" +%% +I must get out of these wet clothes and into a dry Martini. + -- Alexander Woolcott +%% +I must have slipped a disk; my pack hurts. +%% +I myself have dreamed up a structure intermediate between Dyson spheres +and planets. Build a ring 93 million miles in radius -- one Earth orbit +-- around the sun. If we have the mass of Jupiter to work with, and if +we make it a thousand miles wide, we get a thickness of about a thousand +feet for the base. + +And it has advantages. The Ringworld will be much sturdier than a Dyson +sphere. We can spin it on its axis for gravity. A rotation speed of 770 +m/s will give us a gravity of one Earth normal. We wouldn't even need to +roof it over. Place walls one thousand miles high at each edge, facing the +sun. Very little air will leak over the edges. + +Lord knows the thing is roomy enough. With three million times the surface +area of the Earth, it will be some time before anyone complains of the +crowding. + -- Larry Niven, "Ringworld" +%% +I need another lawyer like I need another hole in my head. + -- Fratianno +%% +I needed the good will of the legislature of four states. +I formed the legislative bodies with my own money. I found +that it was cheaper that way. + -- Jay Gould +%% +I never cheated an honest man, only rascals. They wanted +something for nothing. I gave them nothing for something. + -- Joseph "Yellow Kid" Weil +%% +I never did it that way before. +%% +I never fail to convince an audience +that the best thing they could do was to go away. +%% +I never forget a face, but in your case I'll make an exception. + -- Groucho Marx +%% +I never killed a man that didn't deserve it. + -- Mickey Cohen +%% +I never made a mistake in my life. +I thought I did once, but I was wrong. + -- Lucy Van Pelt +%% +I never pray before meals -- my mom's a good cook. +%% +I never refuse. I never contradict. I sometimes forget. + -- Benjamin Disraeli +%% +I never said all Democrats were saloonkeepers; +what I said was all saloonkeepers were Democrats. +%% +I never saw a purple cow +I never hope to see one +But I can tell you anyhow +I'd rather see than be one. + -- Gellett Burgess + +I've never seen a purple cow +I never hope to see one +But from the milk we're getting now +There certainly must be one + -- Odgen Nash + +Ah, yes, I wrote "The Purple Cow" +I'm sorry now I wrote it +But I can tell you anyhow +I'll kill you if you quote it. + -- Gellett Burgess +%% +I only know what I read in the papers. + -- Will Rogers +%% +I opened the drawer of my little desk and a single letter fell out, a +letter from my mother, written in pencil, one of her last, with unfinished +words and an implicit sense of her departure. It's so curious: one can +resist tears and "behave" very well in the hardest hours of grief. But +then someone makes you a friendly sign behind a window... or one notices +that a flower that was in bud only yesterday has suddenly blossomed... or +a letter slips from a drawer... and everything collapses. + -- Letters From Colette +%% +I owe, I owe, it's off to work I go... +%% +I owe the public nothing. + -- J.P. Morgan +%% +I prefer the most unjust peace to the most righteous war. + -- Cicero +Even peace may be purchased at too high a price. + -- Poor Richard +%% +I profoundly believe it takes a lot of practice to become a moral slob. + -- William F. Buckley +%% +I put up my thumb... and it blotted out the planet Earth. + -- Neil Armstrong +%% +I quite agree with you, said the Duchess; and the moral of +that is -- 'Be what you would seem to be' -- or, if you'd like it put +more simply -- 'Never imagine yourself not to be otherwise than what it +might appear to others that what you were or might have been was not +otherwise than what you had been would have appeared to them to be +otherwise.' +%% +I read Playboy for the same reason I read National Geographic. +To see the sights I'm never going to visit. +%% +I really hate this damned machine +I wish that they would sell it. +It never does quite what I want +But only what I tell it. +%% +I really look with commiseration over the great body of my fellow citizens +who, reading newspapers, live and die in the belief that they have known +something of what has been passing in their time. + -- H. Truman +%% +I recognize terror as the finest emotion and so I will try to terrorize the +reader. But if I find that I cannot terrify, I will try to horrify, and if +I find that I cannot horrify, I'll go for the gross-out. + -- Stephen King +%% +I refuse to have a battle of wits with an unarmed person. +%% +I remember Ulysses well... Left one day for the post office +to mail a letter, met a blonde named Circe on the streetcar, +and didn't come back for 20 years. +%% +I remember once being on a station platform in Cleveland at four in the +morning. A black porter was carrying my bags, and as we were waiting for +the train to come in, he said to me: "Excuse me, Mr. Cooke, I don't want to +invade your privacy, but I have a bet with a friend of mine. Who composed +the opening theme music of 'Omnibus'? My friend said Virgil Thomson." I +asked him, "What do you say?" He replied, "I say Aaron Copeland." I said, +"You're right." The porter said, "I knew Thomson doesn't write counterpoint +that way." I told that to a network president, and he was deeply unimpressed. + -- Alistair Cooke +%% +I respect the institution of marriage -- I have +always thought that every woman should marry, and no man. + -- Disraeli +%% +I reverently believe that the maker who made us all makes everything in New +England, but the weather. I don't know who makes that, but I think it must be +raw apprentices in the weather-clerks factory who experiment and learn how, in +New England, for board and clothes, and then are promoted to make weather for +countries that require a good article, and will take their custom elsewhere +if they don't get it. + -- Mark Twain +%% +I sat down beside her, said hello, offered to buy her a drink... +and then natural selection reared its ugly head. +%% +I saw a man pursuing the Horizon, +'Round and round they sped. +I was disturbed at this, +I accosted the man, +"It is futile," I said. +"You can never--" +"You lie!" He cried, +and ran on. + -- Stephen Crane +%% +I saw what you did and I know who you are. +%% +I say, and without apology, hang the bitch. +%% +I see a bad moon rising. +I see trouble on the way. +I see earthquakes and lightnin' +I see bad times today. +Don't go 'round tonight, +It's bound to take your life. +There's a bad moon on the rise. + -- J. C. Fogerty, "Bad Moon Rising" +%% +I sent a letter to the fish, I said it very loud and clear, +I told them, "This is what I wish." I went and shouted in his ear. +The little fishes of the sea, But he was very stiff and proud, +They sent an answer back to me. He said "You needn't shout so loud." +The little fishes' answer was And he was very proud and stiff, +"We cannot do it, sir, because..." He said "I'll go and wake them if..." +I sent a letter back to say I took a kettle from the shelf, +It would be better to obey. I went to wake them up myself. +But someone came to me and said But when I found the door was locked +"The little fishes are in bed." I pulled and pushed and kicked and + knocked, +I said to him, and I said it plain And when I found the door was shut, +"Then you must wake them up again." I tried to turn the handle, But... + + "Is that all?" asked Alice. + "That is all." said Humpty Dumpty. "Goodbye." +%% +I sent a message to another time, +But as the days unwind -- this I just can't believe, +I sent a message to another plane, +Maybe it's all a game -- but this I just can't conceive. +... +I met someone who looks at lot like you, +She does the things you do, but she is an IBM. +She's only programmed to be very nice, +But she's as cold as ice, whenever I get too near, +She tells me that she likes me very much, +But when I try to touch, she makes it all too clear. +... +I realize that it must seem so strange, +That time has rearranged, but time has the final word, +She knows I think of you, she reads my mind, +She tries to be unkind, she knows nothing of our world. + -- ELO, "Yours Truly, 2095" +%% +I smell a wumpus. +%% +I sold my memoirs of my love life to Parker +Brothers and they are going to make a game out of it. + -- Woody Allen +%% +I stick my neck out for nobody. + -- Humphrey Bogart, "Casablanca" +%% +I stood on the leading edge, +The eastern seaboard at my feet. +"Jump!" said Yoko Ono +I'm too scared and good-looking, I cried. +Go on and give it a try, +Why prolong the agony, all men must die. + -- Roger Waters, "The Pros and Cons of Hitchhiking" +%% +I suggest a new stategy, Artoo: let the Wookiee win. + -- CP30 +%% +I suppose I could collect my books and get on back to school, +Or steal my daddy's cue and make a living out of playing pool, +Or find myself a rock 'n' roll band, +That needs a helping hand, +Oh, Maggie I wish I'd never seen your face. + -- Rod Stewart, "Maggie May" +%% +I suppose that in a few hours I will sober up. That's such a sad +thought. I think I'll have a few more drinks to prepare myself. +%% +I tell ya, I knew my morning wasn't going right. When I put on my shirt +the button fell off, when I picked up my briefcase, the handle fell off, +I tell ya, I was afraid to go to the bathroom. + -- Rodney Dangerfield +%% +I tell ya, I was an ugly kid. I was so ugly that my dad +kept the kid's picture that came with the wallet he bought. + -- Rodney Dangerfield +%% +I think I'll snatch a kiss and flee. + -- Shakespeare +%% +I think every good Christian ought to kick Falwell right in the ass. + -- Barry Goldwater +%% +I think that I shall never see +A billboard lovely as a tree. +Indeed, unless the billboards fall +I'll never see a tree at all. + -- Nash +%% +I think the Mormon prophet +Was a very funny man. +I wonder how his wives enjoyed +His Prophet Sharing Plan. +%% +I think, therefore I am... I think. +%% +I think we are in Rats Alley where the dead men lost their bones. + -- T.S. Eliot +%% +I think we're all Bozos on this bus. + -- Firesign Theatre +%% +I think we're in trouble. + -- Han Solo +%% +I thought YOU silenced the guard! +%% +"I thought that you said you were 20 years old!" +"As a programmer, yes," she replied, +"And you claimed to be very near two meters tall!" +"You said you were blonde, but you lied!" +Oh, she was a hacker and he was one, too, +They had so much in common, you'd say. +They exchanged jokes and poems, and clever new hacks, +And prompts that were cute or risque'. +He sent her a picture of his brother Sam, +She sent one from some past high school day, +And it might have gone on for the rest of their lives, +If they hadn't met in L.A. +"Your beard is an armpit," she said in disgust. +He answered, "Your armpit's a beard!" +And they chorused: "I think I could stand all the rest +If you were not so totally weird!" +If she had not said what he wanted to hear, +And he had not done just the same, +They'd have been far more honest, and never have met, +And would not have had fun with the game. + -- Judith Schrier, "Face to Face After Six + Months of Electronic Mail" +%% +I told my kids, "Someday, you'll have kids of your own." +One of them said, "So will you." + -- Rodney Dangerfield +%% +I treasure this strange combination found in very few persons: a fierce +desire for life as well as a lucid perception of the ultimate futility of +the quest. + -- Madeleine Gobeil +%% +I try not to break the rules but merely to test their elasticity. + -- Bill Veeck +%% +I understand why you're confused. You're thinking too much. + -- Carole Wallach. +%% +I used to be Snow White, but I drifted. + -- Mae West +%% +I used to be a rebel in my youth. +This cause... that cause... (chuckle) I backed 'em ALL! But I learned. +Rebellion is simply a device used by the immature to hide from his own +problems. So I lost interest in politics. Now when I feel aroused by +a civil rights case or a passport hearing... I realize it's just a device. +I go to my analyst and we work it out. You have no idea how much better +I feel these days. + -- J. Feiffer +%% +I used to be disgusted, now I find I'm just amused. + -- Elvis Costello +%% +I used to be such a sweet sweet thing, 'til they got a hold of me, +I opened doors for little old ladies, I helped the blind to see, +I got no friends 'cause they read the papers, they can't be seen, +With me, and I'm feelin' real shot down, +And I'm, uh, feelin' mean, + No more, Mr. Nice Guy, + No more, Mr. Clean, + No more, Mr. Nice Guy, +They say "He's sick, he's obscene". + +My dog bit me on the leg today, my cat clawed my eyes, +Ma's been thrown out of the social circle, and Dad has to hide, +I went to church, incognito, when everybody rose, +The reverend Smithy, he recognized me, +And punched me in the nose, he said, +(chorus) +He said "You're sick, you're obscene". + -- Alice Cooper, "No More Mr. Nice Guy" +%% +I used to think I was indecisive, but now I'm not so sure. +%% +I waited and waited and when no message came I knew it must be from you. +%% +I want to achieve immortality through not dying. + -- Woody Allen +%% +I want to reach your mind -- where is it currently located? +%% +I was eatin' some chop suey, +With a lady in St. Louie, +When there sudden comes a knockin' at the door. +And that knocker, he says, "Honey, +Roll this rocker out some money, +Or your daddy shoots a baddie to the floor." + -- Mr. Miggle +%% +I was gratified to be able to answer promptly, and I did. +I said I didn't know. + -- Mark Twain +%% +I was in accord with the system so long as it +permitted me to function effectively. + -- Albert Speer +%% +I was working on a case. It had to be a case, because I couldn't afford a +desk. Then I saw her. This tall blond lady. She must have been tall +because I was on the third floor. She rolled her deep blue eyes towards +me. I picked them up and rolled them back. We kissed. She screamed. I +took the cigarette from my mouth and kissed her again. +%% +I wasted time and now doth time waste me. + -- William Shakespeare +%% + I went into a bar feeling a little depressed, the bartender said, +"What'll you have, bud"? + I said," I don't know, surprise me". + So he showed me a nude picture of my wife. + -- Rodney Dangerfield +%% +I went into the business for the money, and the art grew out of it. +If people are disillusioned by that remark, I can't help it. +It's the truth. + -- Charlie Chaplin +%% +I went over to my friend, he was eatin' a pickle. +I said "Hi, what's happenin'?" +He said "Nothin'." +Try to sing this song with that kind of enthusiasm; +As if you just squashed a cop. + -- Arlo Guthrie, "Motorcycle Song" +%% +I went to a wild party last night. I tell ya, it was so wild, we played +a new version of Russian roulette. We passed around six girls and one +of them had V.D. + -- Rodney Dangerfield +%% +I will always love the false image I had of you. +%% +I will follow the good side right to the fire, +but not into it if I can help it. + -- Michel Eyquem de Montaigne +%% +I will honour Christmas in my heart, and try to keep it all the +year. I will live in the Past, the Present, and the Future. The +Spirits of all Three shall strive within me. I will not shut out +the lessons that they teach. Oh, tell me that I may sponge away the +writing on this stone! + -- Charles Dickens +%% +I will make you shorter by the head. + -- Elizabeth I +%% +I will never lie to you. +%% +I will not forget you. +%% +I will not say that women have no character; +rather, they have a new one every day. + -- Heine +%% +I wish I was a fascinating lady +With a past that was cheap and a future that was shady +I'd sleep all day and I'd work all night +I'd live in a house with a little red light +And once a month I'd take a small vacation +And leave all the men to their imagination +And once in a while I'd go all wild +And have myself an illegitimate child +I wish I were a fascinating lady +Instead I'm the minister's child +%% +I wish that my room had a floor; +I don't so much care for a door, + But this walking around + Without touching the ground +Is getting to be quite a bore! + -- Gelett Burgess +%% +I wish you humans would leave me alone. +%% +I woke up a feelin' mean +went down to play the slot machine +the wheels turned round, +and the letters read +"Better head back to Tennessee Jed" + -- Grateful Dead +%% +I would be batting the big feller if they wasn't ready with the other one, +but a left-hander would be the thing if they wouldn't have knowed it already +because there is more things involved than could come up on the road, even +after we've been home a long while. + -- Casey Stengel +%% +I would gladly raise my voice in praise of women, +only they won't let me raise my voice. + -- Winkle +%% +I would have made a good pope. + -- Richard Nixon +%% +I would like the government to do all it can to mitigate, then, in +understanding, in mutuality of interest, in concern for the common good, +our tasks will be solved. + -- Warren G. Harding +%% +I would like to know +What I was fencing in +And what I was fencing out. + -- Robert Frost +%% +I would much rather have men ask why +I have no statue, than why I have one. + -- Marcus Procius Cato +%% +I would rather be a serf in a poor man's house +and be above ground than reign among the dead. + -- Achilles, "The Odessey", XI, 489-91 +%% +I wouldn't be so paranoid if you weren't all out to get me!! +%% +I wouldn't marry her with a ten foot pole. +%% +I wouldn't recommend sex, drugs or insanity +for everyone, but they've always worked for me. + -- Hunter S. Thompson +%% +IBM Advanced Systems Group -- a bunch of mindless jerks, +who'll be first against the wall when the revolution comes... + -- with regrets to D. Adams +%% +IBM had a PL/I, +Its syntax worse than JOSS; +And everywhere this language went, +It was a total loss. +%% +IBM: + I've Been Moved + Idiots Become Managers + Idiots Buy More + Impossible to Buy Machine + Incredibly Big Machine + Industry's Biggest Mistake + International Brotherhood of Mercenaries + It Boggles the Mind + It's Better Manually + Itty-Bitty Machines +%% +IBM's original motto: + Cogito ergo vendo; vendo ergo sum. +%% +IDIOT: + A member of a large and powerful tribe whose influence + in human affairs has always been dominant and controlling. +%% +IDLENESS: + Leisure gone to seed. +%% +IGNORANCE: + When you don't know anything, and someone else finds out. +%% +IMPARTIAL: + Unable to perceive any promise of personal advantage from + espousing either side of a controversy or adopting either of two + conflicting opinions. +%% +IN BOX: + A catch basin for everything you don't want + to deal with, but are afraid to throw away. +%% +INCENTIVE PROGRAM: + The system of long and short-term rewards that a corporation uses + to motivate its people. Still, despite all the experimentation with + profit sharing, stock options, and the like, the most effective + incentive program to date remains: + "Do a good job and you get to keep it." +%% +INCUMBENT: + Person of livliest interest to the outcumbents. +%% +INDEX: + Alphabetical list of words of no possible interest where an + alphabetical list of subjects with references ought to be. +%% +INGRATE: + A man who bites the hand that feeds him, + and then complains of indigestion. +%% +INK: + A villainous compound of tannogallate of iron, gum-arabic, + and water, chiefly used to facilitate the infection of + idiocy and promote intellectual crime. + -- H.L. Mencken +%% +INNOVATE: + Annoy people. +%% +INNUENDO: + Italian enema. +%% +INSECURITY: + Finding out that you've mispronounced for years + one of your favorite words. + + Realizing halfway through a joke that you are + telling it to the person who told it to you. +%% +INTEREST: + What borrowers pay, lenders receive, stockholders + own, and burned out employees must feign. +%% +INTERPRETER: + One who enables two persons of different languages to understand + each other by repeating to each what it would have been to the + interpreter's advantage for the other to have said. +%% +INTOXICATED: + When you feel sophisticated without being able to pronounce it. +%% +IOT trap -- core dumped +%% +IOT trap -- mos dumped +%% +IRONY: + A windy day, when, just as a beautiful girl with + a short skirt approaches, dust blows in your eyes. +%% +IT IS IN PROCESS: + So wrapped up in red tape that the situation is almost hopeless. +%% +Iam +not +very +happy +acting +pleased +whenever +prominent +scientists +overmagnify +intellectual +enlightenment +%% +I'd give my right arm to be ambidextrous. +%% +I'd just as soon kiss a Wookiee. + -- Princess Leia Organa +%% +I'd love to kiss you, but I just washed my hair. + -- Bette Davis, "Cabin in the Cotton" +%% +I'd never join any club that would have the likes of me as a member. + -- Groucho Marx +%% +I'd rather be led to hell than managed to heavan. +%% +I'd rather have a free bottle in front of me than a prefrontal lobotomy. + -- Fred Allen +%% +I'd rather have two girls at 21 each than one girl at 42. + -- W.C. Fields +%% +I'd rather just believe that it's done by little elves running around. +%% +I'd rather laugh with the sinners, +Than cry with the saints, +The sinners are much more fun! + -- Billy Joel, "Only The Good Die Young" +%% +I'd rather push my Harley than ride a rice burner. +%% +Identify your visitor. +%% +Idleness is the holiday of fools. +%% +If A = B and B = C, then A = C, except where void or prohibited by law. + -- Roy Santoro +%% +If A fool persists in his folly he shall become wise. + -- William Blake +%% +If Christianity was morality, Socrates would be the Saviour. + -- William Blake +%% +If God had intended Man to Smoke, He would have set him on Fire. +%% +If God had intended Man to Walk, He would have given him Feet. +%% +If God had intended Man to Watch TV, He would have given him Rabbit Ears. +%% +If God had intended Man to program, we'd be born with serial I/O ports. +%% +If God had intended Men to Smoke, He would have put Chimneys in their Heads. +%% +If God had meant for us to be in the Army, +we would have been born with green, baggy skin. +%% +If God had meant for us to be naked, we would have been born that way. +%% +If God had not given us sticky tape, +it would have been necessary to invent it. +%% +If God had wanted you to go around nude, +He would have given you bigger hands. +%% +If God is perfect, why did He create discontinuous functions? +%% +If God lived on Earth, people would knock out all His windows. + -- Yiddish saying +%% +If God wanted us to have a President, +He would have sent us a candidate. + -- Jerry Dreshfield +%% +If I cannot bend Heaven, I shall move Hell. + -- Publius Vergilius Maro (Virgil) +%% +If I could read your mind, love, +What a tale your thoughts could tell, +Just like a paperback novel, +The kind the drugstore sells, +When you reach the part where the heartaches come, +The hero would be me, +Heroes often fail, +You won't read that book again, because + the ending is just too hard to take. + +I walk away, like a movie star, +Who gets burned in a three way script, +Enter number two, +A movie queen to play the scene +Of bringing all the good things out in me, +But for now, love, let's be real +I never thought I could act this way, +And I've got to say that I just don't get it, +I don't know where we went wrong but the feeling is gone +And I just can't get it back... + -- Gordon Lightfoot, "If You Could Read My Mind" +%% +If I don't drive around the park, +I'm pretty sure to make my mark. +If I'm in bed each night by ten, +I may get back my looks again. +If I abstain from fun and such, +I'll probably amount to much; +But I shall stay the way I am, +Because I do not give a damn. + -- Dorothy Parker +%% +If I had a plantation in Georgia and a home in Hell, +I'd sell the plantation and go home. + -- Eugene P. Gallagher +%% +If I had any humility I would be perfect. + -- Ted Turner +%% +If I had only known, I would have been a locksmith. + -- Albert Einstein +%% +If I have not seen so far it is because I stood in giant's footsteps. +%% +If I have to lay an egg for my country, I'll do it. + -- Bob Hope +%% +If I kiss you, that is an psychological interaction. +On the other hand, if I hit you over the head with a brick, +that is also a psychological interaction. +The difference is that one is friendly and the other is not so friendly. +The crucial point is if you can tell which is which. +%% +If I knew what brand [of whiskey] he drinks, +I would send a barrel or so to my other generals. + -- Abraham Lincoln, on General Grant +%% +If I promised you the moon and the stars, would you believe it? + -- Alan Parsons Project +%% +If I told you you had a beautiful body, would you hold it against me? +%% +If I traveled to the end of the rainbow +As Dame Fortune did intend, +Murphy would be there to tell me +The pot's at the other end. + -- Bert Whitney +%% +If I want your opinion, I'll ask you to fill out the necessary form. +%% +If I'd known computer science was going to be like this, +I'd never have given up being a rock 'n' roll star. + -- G. Hirst +%% +If Jesus Christ were to come today, people would not even crucify him. +They would ask him to dinner, and hear what he had to say, and make +fun of it. + -- Thomas Carlyle +%% +If Karl, instead of writing a lot about Capital, +had made a lot of Capital, it would have been much better. + -- Karl Marx's Mother +%% +If a President doesn't do it to his wife, he'll do it to his country. +%% +If a group of N persons implements a COBOL compiler, +there will be N-1 passes. Someone in the group has to be the manager. + -- T. Cheatham +%% +If a listener nods his head when you're +explaining your program, wake him up. +%% +If a man has a strong faith he can indulge in the luxury of skepticism. + -- Friedrich Nietzsche +%% +If a man has talent and cannot use it, he has failed. + -- Thomas Wolfe +%% +If a man is not a liberal at 25, he has no heart. +If he's not a conservative by 45, he has no brain. +%% +If a man loses his reverence for any part of life, +he will lose his reverence for all of life. + -- Albert Schweitzer +%% +If a nation expects to be ignorant and free, +... it expects what never was and never will be. + -- Thomas Jefferson +%% +If a subordinate asks you a pertinent question, +look at him as if he had lost his senses. +When he looks down, paraphrase the question back at him. +%% +If a thing's worth doing, it is worth doing badly. + -- G.K. Chesterton +%% +If all be true that I do think, +There be five reasons why one should drink; +Good friends, good wine, or being dry, +Or lest we should be by-and-by, +Or any other reason why. +%% +If all else fails, immortality can always be assured by spectacular error. + -- John Kenneth Galbraith +%% +If all men were brothers, would you let one marry your sister? +%% +If all the world's a stage, I want to operate the trap door. + -- Paul Beatty +%% +If all the world's economists were laid end to end, +we wouldn't reach a conclusion. + -- William Baumol +%% +If an S and an I and an O and a U +With an X at the end spell Su; +And an E and a Y and an E spell I, +Pray what is a speller to do? +Then, if also an S and an I and a G +And an HED spell side, +There's nothing much left for a speller to do +But to go commit siouxeyesighed. + -- Charles Follen Adams, "An Orthographic Lament" +%% +If an experiment works, something has gone wrong. +%% +If any man wishes to be humbled and mortified, +let him become president of Harvard. + -- Edward Holyoke +%% +If anything can go wrong, it will. +%% +If at first you do succeed, try to hide your astonishment. +%% +If at first you don't succeed, quit; don't be a nut about success. +%% +If at first you don't succeed, redefine success. +%% +If at first you don't succeed, try, try again. +Then quit. No use being a damn fool about it. + -- W.C. Fields + [Also attributed to Roy Mengot. Ed.] +%% +If at first you don't succeed, try, try again. + -- W.E. Hickson +%% +If at first you don't succeed, you must be a programmer. +%% +If at first you don't succeed, you're doing about average. + -- Leonard Levinson +%% +If bankers can count, how come they have +eight windows and only four tellers? +%% +If builders built buildings the way programmers wrote programs, +then the first woodpecker to come along would destroy civilization. +%% +If continence causes neurosis +And intercourse causes thrombosis + I'd rather expire + Fulfilling desire +Than live in a state of psychosis. +%% +If dolphins are so smart, why did Flipper work for television? +%% +If everything on the road of life seems to +be coming your way, you're in the wrong lane. +%% +If everything seems to be going well, +you have obviously overlooked something. +%% +If food be the music of love, eat up, eat up. +%% +If graphics hackers are so smart, +why can't they get the bugs out of fresh paint? +%% +If happiness is in your destiny, you need not be in a hurry. + -- Chinese proverb +%% +If he had only learnt a little less, how +infinitely better he might have taught much more! +%% +If he once again pushes up his sleeves in order to compute for 3 days +and 3 nights in a row, he will spend a quarter of an hour before to +think which principles of computation shall be most appropriate. + -- Voltaire, "Diatribe du docteur Akakia" +%% +If he should ever change his faith, +it'll be because he no longer thinks he's God. +%% +If in doubt, mumble. +%% +If it ain't broke, don't fix it. +%% +If it doesn't smell yet, it's pretty fresh. + -- Dave Johnson, on dead seagulls +%% +If it happens once, it's a bug. +If it happens twice, it's a feature. +If it happens more than twice, it's a design philosophy. +%% +If it is a Miracle, any sort of evidence will +answer, but if it is a Fact, proof is necessary. + -- Samuel Clemens +%% +Stockmayer's Theorem: + If it looks easy, it's tough. + If it looks tough, it's damn well impossible. +%% +If it pours before seven, it has rained by eleven. +%% +If it wasn't for Newton, we wouldn't have to eat bruised apples. +%% +If it wasn't so warm out today, it would be cooler. +%% +If it's Tuesday, this must be someone else's fortune. +%% +If it's not in the computer, it doesn't exist. +%% +If it's worth doing, it's worth doing for money. +%% +If it's worth hacking on well, it's worth hacking on for money. +%% +If life gives you lemons, make lemonade. +%% +If life is a stage, I want some better lighting. +%% +If life is merely a joke, the question +still remains: for whose amusement? +%% +If life isn't what you wanted, have you asked for anything else? +%% +If love is the answer, could you rephrase the question? + -- Lily Tomlin +%% +If mathematically you end up with the wrong +answer, try multipying by the page number. +%% +If one cannot enjoy reading a book over and +over again, there is no use in reading it at all. + -- Oscar Wilde +%% +If one tells the truth, one is sure sooner or later to be found out. + -- Oscar Wilde +%% +If only Dionysus were alive! Where would he eat? + -- Woody Allen +%% +If only one could get that wonderful feeling of +accomplishment without having to accomplish anything. +%% +If only you could be respected without having to be respectable. +%% +If only you knew she loved you, you could +face the uncertainty of whether you love her. +%% +If opportunity came disguised as temptation, one knock would be enough. +%% +If parents would only realize how they bore their children. + -- G.B. Shaw +%% +If people drank ink instead of Schlitz, they'd be better off. + -- Edward E. Hippensteel + [What brand of ink? Ed.] +%% +If practice makes perfect, and nobody's perfect, why practice? +%% +If rabbits feet are so lucky, what happened to the rabbit? +%% +If reporters don't know that truth is plural, they ought to be lawyers. + -- Tom Wicker +%% +If researchers wrote nursery rhymes... + +Little Miss Muffet sat on her gluteal region, +Eating components of soured milk. +On at least one occasion, + along came an arachnid and sat down beside her, +Or at least in her vicinity, +And caused her to feel an overwhelming, but not paralyzing, fear, +Which motivated the patient to leave the area rather quickly. + -- Ann Melugin Williams +%% +If scientific reasoning were limited to the logical processes of +arithmetic, we should not get very far in our understanding of the physical +world. One might as well attempt to grasp the game of poker entirely by +the use of the mathematics of probability. + -- Vannevar Bush +%% +If she had not been cupric in her ions, +Her shape ovoidal, +Their romance might have flourished. +But he built tetrahedral in his shape, +His ions ferric, +Love could not help but die, +Uncatylised, inert, and undernourished. +%% +If some day it should happen that a victim must be found, +I've got a little list, I've got a little list. + -- Koko, "The Mikado" +%% +If some people didn't tell you, +you'd never know they'd been away on vacation. +%% +If someone had told me I would be Pope +one day, I would have studied harder. + -- Pope John Paul I +%% +If something has not yet gone wrong then it would +ultimately have been beneficial for it to go wrong. +%% +If the English language made any sense, lackadaisical +would have something to do with a shortage of flowers. + -- Doug Larson + [Not to mention, butterfly would be flutterby. Ed.] +%% +If the colleges were better, if they really had it, you would need to get +the police at the gates to keep order in the inrushing multitude. See in +college how we thwart the natural love of learning by leaving the natural +method of teaching what each wishes to learn, and insisting that you shall +learn what you have no taste or capacity for. The college, which should +be a place of delightful labor, is made odious and unhealthy, and the +young men are tempted to frivolous amusements to rally their jaded spirits. +I would have the studies elective. Scholarship is to be created not +by compulsion, but by awakening a pure interest in knowledge. The wise +instructor accomplishes this by opening to his pupils precisely the +attractions the study has for himself. The marking is a system for schools, +not for the college; for boys, not for men; and it is an ungracious work to +put on a professor. + -- Ralph Waldo Emerson +%% +If the future isn't what it used to be, does that +mean that the past is subject to change in times to come? +%% +If the girl you love moves in with another guy once, it's more than enough. +Twice, it's much too much. Three times, it's the story of your life. +%% +If the grass is greener on other side of fence, +consider what may be fertilizing it. +%% +If the master dies and the disciple grieves, +the lives of both have been wasted. +%% +If the meanings of "true" and "false" were switched, +then this sentence would not be false. +%% +If the odds are a million to one against something +occurring, chances are 50-50 it will. +%% +If the path be beautiful, let us not ask where it leads. + -- Anatole France +%% +If the rich could pay the poor to die for them, +what a living the poor could make! +%% +If the shoe fits, it's ugly. +%% +If the very old will remember, the very young will listen. + -- Chief Dan George +%% +If the weather is extremely bad, church attendance will be down. +If the weather is extremely good, church attendance will be down. +If the bulletin covers are in short supply, however, +church attendance will exceed all expectations. + -- Reverend Chichester +%% +If there are epigrams, there must be meta-epigrams. +%% +If there is a possibility of several things going wrong, +the one that will cause the most damage will be the one to go wrong. + +If you perceive that there are four possible ways in which a procedure +can go wrong, and circumvent these, then a fifth way will promptly develop. +%% +If there is a sin against life, it consists perhaps not so much in despairing +of life as in hoping for another life and in eluding the implacable grandeur +of this life. + -- Albert Camus +%% +If there is a wrong way to do something, then someone will do it. + -- Edward A. Murphy Jr. +%% +If there is no God, who pops up the next Kleenex? + -- Art Hoppe +%% +If there is no wind, row. + -- Polish proverb +%% +If they were so inclined, they could impeach +him because they don't like his necktie. + -- Attorney General William Saxbe +%% +If things don't improve soon, you'd better ask them to stop helping you. +%% +If this fortune didn't exist, somebody would have invented it. +%% +If this is timesharing, give me my share right now. +It's not time yet. +%% +If time heals all wounds, how come the belly button stays the same? +%% +If two men agree on everything, you may +be sure that one of them is doing the thinking. + -- L.B. Johnson +%% +If we all work together, we can totally disrupt the system. +%% +If we can ever make red tape nutritional, we can feed the world. + -- R. Schaeberle, "Management Accounting" +%% +If we do not change our direction we are +likely to end up where we are headed. +%% +If we don't survive, we don't do anything else. + -- John Sinclair +%% +If we spoke a different language, we +would perceive a somewhat different world. + -- Wittgenstein +%% +If we suffer tamely a lawless attack upon our liberty, +we encourage it, and involve others in our doom. + -- Samuel Adams +%% +If while you are in school, there is a shortage of qualified personnel +in a particular field, then by the time you graduate with the necessary +qualifications, that field's employment market is glutted. + -- Marguerite Emmons +%% +If wishes were horses, then beggars would be thieves. +%% +If women didn't exist, all the money in the world would have no meaning. + -- Aristotle Onassis +%% +If you MUST get married, it is always advisable to marry beauty. +Otherwise, you'll never find anybody to take her off your hands. +%% +If you always postpone pleasure you will never have it. +Quit work and play for once! +%% +If you analyse anything, you destroy it. + -- Arthur Miller +%% +If you are going to walk on thin ice, you may as well dance. +%% +If you are not for yourself, who will be for you? +If you are for yourself, then what are you? +If not now, when? +%% +If you are over 80 years old and accompanied +by your parents, we will cash your check. +%% +If you are smart enough to know that you're not +smart enough to be an Engineer, then you're in Business. +%% +If you are too busy to read, then you are too busy. +%% +If you are what you eat, does that mean Euelle Gibbons really was a nut? +%% +If you can count your money, you don't have a billion dollars. + -- J. Paul Getty +%% +If you can keep your head when all about you are losing +theirs, then you clearly don't understand the situation. +%% +If you can lead it to water and force it to drink, it isn't a horse. +%% +If you can survive death, you can probably survive anything. +%% +If you cannot convince them, confuse them. + -- Harry S. Truman +%% +If you can't be good, be careful. +If you can't be careful, give me a call. +%% +If you can't learn to do it well, learn to enjoy doing it badly. +%% +If you can't understand it, it is intuitively obvious. +%% +If you continually give you will continually have. +%% +If you could only get that wonderful feeling of +accomplishment without having to accomplish anything. +%% +If you didn't get caught, did you really do it? +%% +If you didn't have most of your friends, +you wouldn't have most of your problems. +%% +If you didn't have to work so hard, +you'd have more time to be depressed. +%% +If you do not think about the future, you cannot have one. + -- John Galsworthy +%% +If you do something right once, someone will ask you to do it again. +%% +If you don't care where you are, then you ain't lost. +%% +If you don't do it, you'll never know what +would have happened if you had done it. +%% +If you don't do the things that are not worth doing, who will? +%% +If you don't have the time right now, +will you have redo right time later? +%% +If you don't have time to do it right, where +are you going to find the time to do it over? +%% +If you don't know what game you're playing, don't ask what the score is. +%% +If you don't like the way I drive, stay off the sidewalk! +%% +If you don't say anything, you won't be called on to repeat it. + -- Calvin Coolidge +%% +If you don't strike oil in twenty minutes, stop boring. + -- Andrew Carnegie, on public speaking +%% +If you ever want to have a lot of fun, I recommend that you go off and program +an imbedded system. The salient characteristic of an imbedded system is that +it cannot be allowed to get into a state from which only direct intervention +will suffice to remove it. An imbedded system can't permanently trust anything +it hears from the outside world. It must sniff around, adapt, consider, sniff +around, and adapt again. I'm not talking about ordinary modular programming +carefulness here. No. Programming an imbedded system calls for undiluted +raging maniacal paranoia. For example, our ethernet front ends need to know +what network number they are on so that they can address and route PUPs +properly. How do you find out what your network number is? Easy, you ask a +gateway. Gateways are required by definition to know their correct network +numbers. Once you've got your network number, you start using it and before +you can blink you've got it wired into fifteen different sockets spread all +over creation. Now what happens when the panic-stricken operator realizes he +was running the wrong version of the gateway which was giving out the wrong +network number? Never supposed to happen. Tough. Supposing that your +software discovers that the gateway is now giving out a different network +number than before, what's it supposed to do about it? This is not discussed +in the protocol document. Never supposed to happen. Tough. I think you +get my drift. +%% +If you explain something so clearly that no +one can possibly misunderstand, someone will. +%% +If you float on instinct alone, how can you +calculate the buoyancy for the computed load? + -- Christopher Hodder-Williams +%% +If you fool around with something long +enough, it will eventually break. +%% +If you give Congress a chance to vote on +both sides of an issue, it will always do it. + -- Les Aspin, D, Wisconsin +%% +If you give a man enough rope, he'll claim he's tied up at the office. +%% +If you go on with this nuclear arms race, +all you are going to do is make the rubble bounce. + -- Winston Churchill +%% +If you go out of your mind, do it quietly, +so as not to disturb those around you. +%% +If you had better tools, you could more +effectively demonstrate your total incompetence. +%% +If you had just one moment to live +And they granted you one special wish +Would you ask for something +Like another chance. + -- Traffic, "The Low Spark of Hi Heeled Boys" +%% +If you hands are clean and your cause is just +and your demands are reasonable, at least it's a start. +%% +If you have a procedure with 10 parameters, you probably missed some. +%% +If you have nothing to do, don't do it here. +%% +If you have received a letter inviting you to speak at the dedication of a +new cat hospital, and you hate cats, your reply, declining the invitation, +does not necessarily have to cover the full range of your emotions. You must +make it clear that you will not attend, but you do not have to let fly at cats. +The writer of the letter asked a civil question; attack cats, then, only if +you can do so with good humor, good taste, and in such a way that your answer +will be courteous as well as responsive. Since you are out of sympathy with +cats, you may quite properly give this as a reason for not appearing at the +dedication ceremonies of a cat hospital. But bear in mind that your opinion +of cats was not sought, only your services as a speaker. Try to keep things +straight. + -- Strunk and White, "The Elements of Style" +%% +If you have to ask how much it is, you can't afford it. +%% +If you have to ask what jazz is, you'll never know. + -- Louis Armstrong +%% +If you have to hate, hate gently. +%% +If you have to think twice about it, you're wrong. +%% +If you haven't got anything nice to say about anyone, come sit by me. + -- Alice Roosevelt Longworth +%% +If you knew what to say next, would you say it? +%% +If you know the answer to a question, don't ask. + -- Petersen Nesbit +%% +If you learn one useless thing every day, +in a single year you'll learn 365 useless things. +%% +If you liked the Earth you'll love Heaven. +%% +If you live in a country run by committee, be on the committee. + -- Graham Summer +%% +If you lose a son you can always get another, +but there's only one Maltese Falcon. + -- The Maltese Falcon +%% +If you lose your temper at a newspaper columnist, +he'll get rich or famous or both. +%% +If you love something set it free. If it doesn't +come back to you, hunt it down and kill it. +%% +If you make a mistake you right it +immediately to the best of your ability. +%% +If you make people think they're thinking, they'll love you; +but if you really make them think they'll hate you. +%% +If you mess with a thing long enough, it'll break. + -- Schmidt +%% +If you need anything just whistle. +You know how to whistle, don't you, Steve? +Just put your lips together and blow. + -- Lauren Bacall, "To Have and Have Not" +%% +If you notice that a person is deceiving you, +they must not be deceiving you very well. +%% +If you pick up a starving dog and make him prosperous, he will not +bite you. This is the principal difference between a dog and a man. + -- Mark Twain +%% +If you push the "extra ice" button on the soft drink vending machine, +you won't get any ice. If you push the "no ice" button, you'll get +ice, but no cup. +%% +If you put garbage in a computer nothing comes out but garbage. +But this garbage, having passed through a very expensive machine, +is somehow enobled and none dare criticize it. +%% +If you put it off long enough, it might go away. +%% + If you rap your knuckles against a window jamb or door, if you +brush your leg against a bed or desk, if you catch your foot in a curled- +up corner of a rug, or strike a toe against a desk or chair, go back and +repeat the sequence. + You will find yourself surprised how far off course you were to +hit that window jamb, that door, that chair. Get back on course and do it +again. How can you pilot a spacecraft if you can't find your way around +your own apartment? + -- William S. Burroughs +%% +If you refuse to accept anything but the best you very often get it. +%% +If you resist reading what you disagree with, how will you ever acquire +deeper insights into what you believe? The things most worth reading +are precisely those that challenge our convictions. +%% +If you see an onion ring -- answer it! +%% +If you sell diamonds, you cannot expect to have many customers. +But a diamond is a diamond even if there are no customers. + -- Swami Prabhupada +%% +If you stew apples like cranberries, +they taste more like prunes than rhubarb does. + -- Groucho Marx +%% +If you suspect a man, don't employ him. +%% +If you think before you speak the other guy gets his joke in first. +%% +If you think last Tuesday was a drag, +wait till you see what happens tomorrow! +%% +If you think nobody cares if you're alive, +try missing a couple of car payments. + -- Earl Wilson +%% +If you think the United States has stood still, +who built the largest shopping center in the world? + -- Richard Nixon +%% +If you took all the women at the Harvard Prom +and laid them end to end, I wouldn't be a bit surprised. + -- Dorothy Parker +%% +If you treat people right they will treat you right -- 90% of the time. + -- F.D. Roosevelt +%% +If you try to please everyone, somebody is not going to like it. +%% +If you wait long enough, it will go away... after having +done its damage. If it was bad, it will be back. +%% +If you want me to be a good little bunny +just dangle some carats in front of my nose. + -- Lauren Bacall +%% +If you want to be ruined, marry a rich woman. + -- Michelet +%% +If you want to know how old a man is, ask his brother-in-law. +%% +If you want to put yourself on the map, publish your own map. +%% +If you want to see card tricks, you have to expect to take cards. + -- Harry Blackstone +%% +If you want your spouse to listen and pay strict +attention to every word you say, talk in your sleep. +%% +If you wants to get elected president, you'se got to think up some +memoraboble homily so's school kids can be pestered into memorizin' +it, even if they don't know what it means. + -- Walt Kelly +%% +If you waste your time cooking, you'll miss the next meal. +%% +If you will practice being fictional for a while, you will understand that +fictional characters are sometimes more real than people with bodies and +heartbeats. +%% +If you wish to be happy for one hour, get drunk. +If you wish to be happy for three days, get married. +If you wish to be happy for a month, kill your pig and eat it. +If you wish to be happy forever, learn to fish. + -- Chinese Proverb +%% +If you wish to succeed, consult three old people. +%% +If you wish women to love you, be original; I know a man who wore fur +boots summer and winter, and women fell in love with him. + -- Anton Chekov +%% +If you would keep a secret from an enemy, tell it not to a friend. +%% +If you would know the value of money, go try to borrow some. + -- Ben Franklin +%% +If you would understand your own age, read the works +of fiction produced in it. People in disguise speak freely. +%% +If you'd like to cultivate insomnia, +Bed down with a pretty girl. +Amor vincit omnia. +%% +If your aim in life is nothing; you can't miss. +%% +If your bread is stale, make toast. +%% +If your enemy is buried in quicksand up to his neck, pull him out. +If he is buried up to his eyes, step on his head. + -- Niccoli Machiavelli, "The Prince" +%% +If your happiness depends on what somebody else does, +I guess you do have a problem. + -- Richard Bach, "Illusions" +%% +If your life was a horse, you'd have to shoot it. +%% +If your mother knew what you're doing, +she'd probably hang her head and cry. +%% +If your parents don't have kids, neither will you. +%% +If your thesis is utterly vacuous, +Employ first-order predicate calculus. + With sufficient formality, + The sheerest banality, +Will be hailed by all as miraculous! +%% +If you're careful enough, nothing +bad or good will ever happen to you. +%% +If you're carrying a torch, put it down. +The Olympics are over. +%% +If you're going to do something tonight +that you'll be sorry for tomorrow morning, sleep late. + -- Henny Youngman +%% +If you're happy, you're successful. +%% +If you're not part of the solution, you're part of the precipitate. +%% +If you're not very clever you should be conciliatory. + -- Benjamin Disraeli +%% +If you've done six impossible things before breakfast, why not round it +off with dinner at Milliway's, the restaurant at the end of the universe. +%% +If you've seen one redwood, you've seen them all. + -- Ronald Reagan +%% +Ignorance is bliss. + -- Thomas Gray + +Fortune updates the great quotes, #42: + BLISS is ignorance. +%% +Ignorance is when you don't know anything and somebody finds it out. +%% +Ignore previous fortune. +%% +Il brilgue: les toves libricilleux + Se gyrent et frillant dans le guave, +Enmimes sont les gougebosquex, + Et le momerade horgrave. + +Es brilig war. Die schlichte Toven + Wirrten und wimmelten in Waben; +Und aller-mumsige Burggoven + Dir mohmen Rath ausgraben. +%% +I'll burn my books. + -- Christopher Marlowe +%% +I'll grant thee random access to my heart, +Thoul't tell me all the constants of thy love; +And so we two shall all love's lemmas prove +And in our bound partition never part. + +Cancel me not -- for what then shall remain? +Abscissas, some mantissas, modules, modes, +A root or two, a torus and a node: +The inverse of my verse, a null domain. + +I see the eigenvalue in thine eye, +I hear the tender tensor in thy sigh. +Bernoulli would have been content to die +Had he but known such a-squared cos 2(thi)! +%% +I'll meet you... on the dark side of the moon... + -- Pink Floyd +%% +I'll never get off this planet. + -- Luke Skywalker +%% +I'll pretend to trust you if you'll pretend to trust me. +%% +I'll turn over a new leaf. + -- Miguel de Cervantes +%% +Illegitimi non carborundum (translation: no carbonated drinks allowed.) +%% +Illusion is the first of all pleasures. + -- Voltaire +%% +I'm Jewish. Count Basie's Jewish. Ray Charles is Jewish. Eddie +Cantor's goyish. The B'nai Brith is goyish. The Hadassah is Jewish. +Marine Corps -- heavy goyish, dangerous. Kool-Aid is goyish. All Drake's +Cakes are goyish. Pumpernickel is Jewish and, as you know, white bread is +very goyish. Instant potatoes -- goyish. Black cherry soda's very Jewish. +Macaroons are very Jewish. Fruit salad is Jewish. Lime Jell-O is goyish. +Lime soda is very goyish. Trailer parks are so goyish that Jews won't +go near them. + -- Lenny Bruce +%% +I'm N-ary the tree, I am, +N-ary the tree, I am, I am. +I'm getting traversed by the parser next door, +She's traversed me seven times before. +And ev'ry time it was an N-ary (N-ary!) +Never wouldn't ever do a binary. (No sir!) +I'm 'er eighth tree that was N-ary. +N-ary the tree I am, I am, +N-ary the tree I am. + -- Stolen from Paul Revere and the Raiders +%% +I'm a Hollywood writer; so I put on +a sports jacket and take off my brain. +%% +I'm a creationist; I refuse to believe +that I could have evolved from man. +%% +I'm all for computer dating, but I +wouldn't want one to marry my sister. +%% +I'm always looking for a new idea that +will be more productive than its cost. + -- David Rockefeller +%% +I'm an artist. +But it's not what I really want to do. +What I really want to do is be a shoe salesman. +I know what you're going to say -- +"Dreamer! Get your head out of the clouds." +All right! But it's what I want to do. +Instead I have to go on painting all day long. + +The world should make a place for shoe salesmen. + -- J. Feiffer +%% +I'm an evolutionist; I refuse to believe +that I could have been created by man. +%% +I'm dying beyond my means. + -- Oscar Wilde, his last words, while sipping champagne +%% +I'm fed up to the ears with old men +dreaming up wars for young men to die in. + -- George McGovern +%% +I'm free -- and freedom tastes of reality. +%% +I'm going through my "I want to go back to New York" phase today. Happens +every six months or so. So, I thought, perhaps unwisely, that I'd share +it with you. +> In New York in the winter it is million degrees below zero and + the wind travels at a million miles an hour down 5th avenue. +> And in LA it's 72. + +> In New York in the summer it is a million degrees and the humidity + is a million percent. +> And in LA it's 72. + +> In New York there are a million interesting people. +> And in LA there are 72. +%% +I'm hungry, time to eat lunch. +%% +I'm in Pittsburgh. Why am I here? + -- Harold Urey +%% +I'm just as sad as sad can be! + I've missed your special date. +Please say that you're not mad at me + My tax return is late. + -- Modern Lines for Modern Greeting Cards +%% +I'm not a lovable man. + -- Richard Nixon. +%% +I'm not even going to *bother* comparing C to BASIC or FORTRAN. + -- L. Zolman, creator of BDS C +%% +I'm not laughing with you, I'm laughing at you. +%% +I'm not offering myself as an example; +every life evolves by its own laws. +%% +I'm not prejudiced, I hate everyone equally. +%% +I'm not proud. +%% +I'm not under the alkafluence of inkahol +that some thinkle peep I am. +It's just the drunker I sit here the longer I get. +%% +I'm prepared for all emergencies but +totally unprepared for everyday life. +%% +I'm really enjoying not talking to you... +Let's not talk again REAL soon... +%% +I'm so broke I can't even pay attention. +%% +I'm sorry if the correct way of doing things offends you. +%% +I'm still waiting for the advent of the computer science groupie. +%% +I'm successful because I'm lucky. +The harder I work, the luckier I get. +%% +Imagination is more important than knowledge. + -- A. Einstein +%% +Imagination is the one weapon in the war against reality. + -- Jules de Gaultier +%% +Imagine there's no heaven... it's easy if you try. + -- John Lennon, "Imagine" +%% +Imagine what we can imagine! + -- Arthur Rubinstein +%% +Imbalance of power corrupts and monopoly of power corrupts absolutely. + -- Genji +%% +Imbesi's Law with Freeman's Extension: + In order for something to become clean, something else must + become dirty; but you can get everything dirty without getting + anything clean. +%% +Immanuel Kant but Kubla Khan. +%% +Immortality -- a fate worse than death. + -- Edgar A. Shoaff +%% +Immutability, Three Rules of: + (1) If a tarpaulin can flap, it will. + (2) If a small boy can get dirty, he will. + (3) If a teenager can go out, he will. +%% +Important letters which contain no errors will develop errors in the mail. +Corresponding errors will show up in the duplicate while the Boss is reading +it. Vital papers will demonstrate their vitality by spontaneously moving +from where you left them to where you can't find them. +%% +In America, any boy may become president and I +suppose that's just one of the risks he takes. + -- Adlai Stevenson +%% +In America, it's not how much an +item costs, it's how much you save. +%% +In Brooklyn, we had such great pennant races, it +made the World Series just something that came later. + -- Walter O'Malley, Dodgers owner +%% +In Cristianity, a man may have only one wife. +This is called Monotony. +%% +In Dr. Johnson's famous dictionary patriotism is defined as the +last resort of the scoundrel. With all due respect to an enlightened +but inferior lexicographer I beg to submit that it is the first. + -- Ambrose Bierce +%% +In Duluth there's a hostess, forsooth, +Who doesn't know gin from vermouth, + But this lubricant lapse + Isn't noticed, perhaps +Because nobody does in Duluth. +%% +In English, every word can be verbed. +Would that it were so in our programming languages. +%% +In God we trust; all else we walk through. +%% +In India, "cold weather" is merely a conventional phrase and has come into +use through the necessity of having some way to distinguish between weather +which will melt a brass door-knob and weather which will only make it mushy. + -- Mark Twain +%% + In "King Henry VI, Part II," Shakespeare has Dick Butcher suggest to +his fellow anti-establishment rabble-rousers, "The first thing we do, let's +kill all the lawyers." That action may be extreme but a similar sentiment +was expressed by Thomas K. Connellan, president of The Management Group, Inc. +Speaking to business executives in Chicago and quoted in Automotive News, +Connellan attributed a measure of America's falling productivity to an excess +of attorneys and accountants, and a dearth of production experts. Lawyers +and accountants "do not make the economic pie any bigger; they only figure +out how the pie gets divided. Neither profession provides any added value +to product." + According to Connellan, the highly productive Japanese society has +10 lawyers and 30 accountants per 100,000 population. The U.S. has 200 +lawyers and 700 accountants. This suggests that "the U.S. proportion of +pie-bakers and pie-dividers is way out of whack." Could Dick Butcher have +been an efficiency expert? + -- Motor Trend, May 1983 +%% +In Minnesota they ask why all football fields in Iowa have artificial turf. +It's so the cheerleaders won't graze during the game. +%% +In Oz, never say "krizzle kroo" to a Woozy. +%% +In Pierre Trudeau, Canada has finally produced +a Prime Minister worthy of assassination. + -- John Diefenbaker +%% +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. +So twice five miles of fertile ground +With walls and towers were girdled round: +And there were gardens bright with sinuous rills, +Where blossomed many an incense-bearing tree; +And here were forest ancient as the hills, +Enfolding sunny spots of greenery. + -- S.T. Coleridge, "Kubla Kahn" +%% +In a bottle, the neck is always at the top. +%% +In a circuit with a fast-acting fuse, +an IC will blow to protect the fuse. +%% +In a consumer society there are inevitably two kinds of slaves: +the prisoners of addiction and the prisoners of envy. +%% +In a country where the sole employer is the State, opposition means death +by slow starvation. The old principle: Who does not work shall not eat, +has been replaced by a new one: Who does not obey shall not eat. + -- Leon Trotsky, 1937 +%% +In a five year period we can get one superb programming language. +Only we can't control when the five year period will begin. +%% +In a gathering of two or more people, when a lighted cigarette is +placed in an ashtray, the smoke will waft into the face of the non-smoker. +%% +In a hierarchy every employee tends to rise to his level of incompetence. + -- Dr. Laurence J. Peter +%% +In a surprise raid last night, federal agent's ransacked a house in search +of a rebel computer hacker. However, they were unable to complete the arrest +because the warrant was made out in the name of Don Provan, while the only +person in the house was named don provan. Proving, once again, that Unix is +superior to Tops10. +%% +In a whiskey it's age, in a cigarette it's +taste and in a sports car it's impossible. +%% +I'm very good at integral and differential calculus, +I know the scientific names of beings animalculous; +In short, in matters vegetable, animal, and mineral, +I am the very model of a modern Major-General. + -- Gilbert & Sullivan, "The Pirates of Penzance" +%% +In an orderly world, there's always a place for the disorderly. +%% +In any formula, constants (especially those obtained from handbooks) +are to be treated as variables. +%% +In any problem, if you find yourself doing an infinite amount of work, +the answer may be obtained by inspection. +%% +In buying horses and taking a wife +shut your eyes tight and commend yourself to God. +%% +In case of atomic attack, the federal ruling +against prayer in schools will be temporarily cancelled. +%% +In case of fire, yell "FIRE!" +%% +In case of injury notify your superior immediately. +He'll kiss it and make it better. +%% +In charity there is no excess. + -- Francis Bacon +%% +In computing, the mean time to failure keeps getting shorter. +%% +In cosmetics, there's cases of revolutionary Venus Envy Hair Spray; +Legette Hair Fastener Heat Bags; Lady O' Spain Self-Blinding Eye Shadow +with Magic Puncture Pencil; Sanitary Napkin Rings in Little Miss, Moon +Maid and Stuck Pig Strength; and deported Italian Napagel Balls for +soaking or eating; and they're all slash-priced with the lady in mind... + -- Firesign Theatre +%% +In dwelling, be close to the land. +In meditation, delve deep into the heart. +In dealing with others, be gentle and kind. +In speech, be true. +In work, be competent. +In action, be careful of your timing. + -- Lao Tsu +%% +In every hierarchy the cream rises until it sours. + -- Dr. Laurence J. Peter +%% +In every job that must be done, there is an element of fun. +Find the fun and snap! the job's a game, and every task +you undertake becomes a piece of cake, a lark, a spree; +it's very clear to see. + -- Mary Poppins +%% +In every non-trivial program there is at least one bug. +%% +In fact, S. M. Simpson, eventually devised an efficient 24-point Fourier +transform, which was a precursor to the Cooley-Tukey fast Fourier transform +in 1965. The FFT made all of Simpson's efficient autocorrelation and +spectrum programs instantly obsolete, on which he had worked half a lifetime. + -- Proc. IEEE, Sept. 1982, p.900 +%% +In good speaking, should not the mind of the speaker +know the truth of the matter about which he is to speak? + -- Plato +%% +In just seven days, I can make you a man! + -- The Rocky Horror Picture Show +%% +In less than a century, computers will be making substantial +progress on ... the overriding problem of war and peace. + -- James Slagle +%% +In like a dimwit, out like a light. + -- Pogo +%% +In love, she who gives her portrait promises the original. + -- Bruton +%% +In marriage, as in war, it is permitted +to take every advantage of the enemy. +%% +In matters of principle, stand like a rock; +in matters of taste, swim with the current. + -- Thomas Jefferson +%% +In most instances, all an argument +proves is that two people are present. +%% +In my end is my beginning. + -- Mary Stuart, Queen of Scots +%% +In olden times sacrifices were made at the altar -- +a custom which is still continued. + -- Helen Rowland +%% +In order to dial out, it is necessary to broaden one's dimension. +%% +In order to get a loan you must first prove you don't need it. +%% +In order to live free and happily, you must sacrifice boredom. +It is not always an easy sacrifice. +%% +In our civilization, and under our republican form of government, +intelligence is so highly honored that it is rewarded by exemption +from the cares of office. +%% +In short, N is Richardian if, and only if, N is not Richardian. +%% +In success there's a tendency to keep on doing what you were doing. + -- Alan Kay +%% +In the Spring, I have counted 136 +different kinds of weather inside of 24 hours. + -- Mark Twain, on New England weather +%% +In the Top 40, half the songs are secret messages to the teen world to drop +out, turn on, and groove with the chemicals and light shows at discotheques. + -- Art Linkletter +%% + In the begining, God created the Earth and he said, "Let there be +mud." + And there was mud. + And God said, "Let Us make living creatures out of mud, so the mud +can see what we have done." + And God created every living creature that now moveth, and one was +man. Mud-as-man alone could speak. + "What is the purpose of all this?" man asked politely. + "Everything must have a purpose?" asked God. + "Certainly," said man. + "Then I leave it to you to think of one for all of this," said God. + And He went away. + -- Kurt Vonnegut, Between Time and Timbuktu" +%% + In the beginning there was data. The data was without form and +null, and darkness was upon the face of the console; and the Spirit of +IBM was moving over the face of the market. And DEC said, "Let there +be registers"; and there were registers. And DEC saw that they +carried; and DEC separated the data from the instructions. DEC called +the data Stack, and the instructions they called Code. And there was +evening and there was morning, one interrupt. + -- Rico Tudor, "The Story of Creation or, The Myth of Urk" +%% +In the days of old, +When Knights were bold, + And women were too cautious; +Oh, those gallant days, +When women were women, + And men were really obnoxious. +%% + In the days when Sussman was a novice Minsky once came to him as he +sat hacking at the PDP-6. + "What are you doing?", asked Minsky. + "I am training a randomly wired neural net to play Tic-Tac-Toe." + "Why is the net wired randomly?", inquired Minsky. + "I do not want it to have any preconceptions of how to play". + At this Minsky shut his eyes, and Sussman asked his teacher "Why do +you close your eyes?" + "So that the room will be empty." + At that momment, Sussman was enlightened. +%% +In the dimestores and bus stations +People talk of situations +Read books repeat quotations +Draw conclusions on the wall. + -- Bob Dylan +%% +In the eyes of my dog, I'm a man. + -- Martin Mull +%% +In the first place, God made idiots; +this was for practice; then he made school boards. + -- Mark Twain +%% +In the future, you're going to get computers as prizes in breakfast cereals. +You'll throw them out because your house will be littered with them. +%% +In the highest society, as well as in the lowest, +woman is merely an instrument of pleasure. + -- Tolstoy +%% +In the land of the dark the Ship of the +Sun is driven by the Grateful Dead. + -- Egyptian Book of the Dead +%% +In the long run, every program becomes rococco, and then rubble. + -- Alan Perlis +%% +In the middle of a wide field is a pot of gold. 100 feet to the north stands +a smart manager. 100 feet to the south stands a dumb manager. 100 feet to +the east is the Easter Bunny, and 100 feet to the west is Santa Claus. + +Q: Who gets to the pot of gold first? +A: The dumb manager. All the rest are myths. +%% +In the midst of one of the wildest parties he'd ever been to, the young man +noticed a very prim and pretty girl sitting quietly apart from the rest of +the revelers. Approaching her, he introduced himself and, after some quiet +conversation, said, "I'm afraid you and I don't really fit in with this +jaded group. Why don't I take you home?"" + "Fine," said the girl, smiling up at him demurely. "Where do you +live?" +%% + In the morning, laughing, happy fish heads + In the evening, floating in the soup. +(chorus): +Fish heads, fish heads, roly-poly fish heads; +Fish heads, fish heads, eat them up. Yum! + You can ask them anything you want to. + They won't answer; they can't talk. +(chorus): + I took a fish head out to see a movie, + Didn't have to pay to get it in. +(chorus): + They can't play baseball; they don't wear sweaters; + They aren't good dancers; they can't play drums. +(chorus): + Roly-poly fish heads are NEVER seen drinking cappucino in + Italian restaurants with Oriental women. +(chorus): + Fishy! +(chorus): + -- Fish Heads +%% +In the next world, you're on your own. +%% +In the stairway of life, you'd best take the elevator. +%% +In the war of wits, he's unarmed. +%% +In these matters the only certainty is that there is nothing certain. + -- Pliny the Elder +%% +In this world some people are going to like me and some are not. +So, I may as well be me. Then I know if someone likes me, they like me. +%% +In this world, truth can wait; she's used to it. +%% +In time, every post tends to be occupied by an +employee who is incompetent to carry out its duties. + -- Dr. L.J. Peter +%% +In /users3 did Kubla Kahn +A stately pleasure dome decree, +Where /bin, the sacred river ran +Through Test Suites measureless to Man +Down to a sunless C. +%% +In war it is not men, but the man who counts. + -- Napoleon +%% +In war, truth is the first casualty. + -- U Thant +%% + In what can only be described as a surprise move, God has officially +announced His candidacy for the U.S. presidency. During His press conference +today, the first in over 4000 years, He is quoted as saying, "I think I have +a chance for the White House if I can just get my campaign pulled together +in time. I'd like to get this country turned around; I mean REALLY turned +around! Let's put Florida up north for awhile, and let's get rid of all +those annoying mountains and rivers. I never could stand them!" + There apparently is still some controversy over the Almighty's +citizenship and other qualifications for the Presidency. God replied to +these charges by saying, "Come on, would the United States have anyone other +than a citizen bless their country?" +%% +In which level of metalanguage are you now speaking? +%% +In wine there is truth (In vino veritas). + -- Pliny +%% +In youth, it was a way I had +To do my best to please, +And change, with every passing lad, +To suit his theories. + +But now I know the things I know, +And do the things I do; +And if you do not like me so, +To hell, my love, with you! + -- Dorothy Parker, "Indian Summer" +%% +Include me out. +%% +Increased knowledge will help you now. +Have mate's phone bugged. +%% +Indecision is the true basis for flexibility. +%% +Indeed, the first noble truth of Buddhism, usually translated as +`all life is suffering,' is more accurately rendered `life is filled +with a sense of pervasive unsatisfactoriness.' + -- M.D. Epstein +%% +Individualists unite! +%% +Indomitable in retreat; invincible in +advance; insufferable in victory. + -- Winston Churchill, on General Montgomery +%% +Infidel: In New York, one who does not believe in the +Christian religion; in Constantinople, one who does. + -- Ambrose Bierce +%% +Inform all the troops that communications have completely broken down. +%% +Information is the inverse of entropy. +%% +Injustice anywhere is a threat to justice everywhere. + -- Martin Luther King, Jr. +%% +Innovation is hard to schedule. + -- Dan Fylstra +%% +Insanity is inherited, you get it from your kids! +%% +Insanity is the final defense. It's hard to get a refund when +the salesman is sniffing your crotch and baying at the moon. +%% +Inside every large problem is a small problem struggling to get out. +%% +Insomnia isn't anything to lose sleep over. +%% +Inspiration without perspiration is usually sterile. +%% +Inspite of all evidence to the contrary, the entire universe +is composed of only two basic substances: magic and bullshit. +%% +Integrity has no need for rules. +%% +Intellect annuls Fate. +So far as a man thinks, he is free. + -- Ralph Waldo Emerson +%% +Interchangeable parts won't. +%% +Introducing, the 1010, a one-bit processor. + +INSTRUCTION SET + Code Mnemonic What + 0 NOP No Operation + 1 JMP Jump (address specified by next 2 bits) + +Now Available for only 12 1/2 cents! +%% +Invest in physics -- own a piece of Dirac! +%% +Involvement with people is always a very delicate thing -- +it requires real maturity to become involved and not get all messed up. + -- Bernard Cooke +%% +Iowans ask why Minnesotans don't drink more Kool-Aid. That's because +they can't figure out how to get two quarts of water into one of those +little paper envelopes. +%% +Iron Law of Distribution: + Them that has, gets. +%% +Is a computer language with goto's totally Wirth-less? +%% +Is death legally binding? +%% +Is it possible that software is not like anything else, that it is +meant to be discarded: that the whole point is to always see it as +a soap bubble? +%% +Is knowledge knowable? If not, how do we know that? +%% +Is not marriage an open question, when it is alleged, from the beginning +of the world, that such as are in the institution wish to get out, +and such as are out wish to get in? + -- Ralph Emerson +%% +Is that really YOU that is reading this? +%% +Is there life before breakfast? +%% +Is this really happening? +%% +Isn't air travel wonderful? +Breakfast in London, dinner in New York, luggage in Brazil. +%% +Isn't it conceivable to you that an intelligent +person could harbor two opposing ideas in his mind? + -- Adlai Stevenson, to reporters +%% +Isn't it ironic that many men spend a great part of their lives +avoiding marriage while single-mindedly pursuing those things that +would make them better prospects? +%% +Isn't it strange that the same people that +laugh at gypsy fortune tellers take economists seriously? +%% +Issawi's Laws of Progress: + The Course of Progress: + Most things get steadily worse. + The Path of Progress: + A shortcut is the longest distance between two points. +%% +It appears that PL/I (and its dialects) is, or will be, the +most widely used higher level language for systems programming. + -- J. Sammet +%% +It cannot be seen, cannot be felt, +Cannot be heard, cannot be smelt. +It lies behind starts and under hills, +And empty holes it fills. +It comes first and follows after, +Ends life, kills laughter. +%% +"It could be that Walter's horse has wings" does not imply that there is +any such animal as Walter's horse, only that there could be; but "Walter's +horse is a thing which could have wings" does imply Walter's horse's +existence. But the conjunction "Walter's horse exists, and it could be +that Walter's horse has wings" still does not imply "Walter's horse is a +thing that could have wings", for perhaps it can only be that Walter's +horse has wings by Walter having a different horse. Nor does "Walter's +horse is a thing which could have wings" conversely imply "It could be that +Walter's horse has wings"; for it might be that Walter's horse could only +have wings by not being Walter's horse. + +I would deny, though, that the formula [Necessarily if some x has property P +then some x has property P] expresses a logical law, since P(x) could stand +for, let us say "x is a better logician than I am", and the statement "It is +necessary that if someone is a better logician than I am then someone is a +better logician than I am" is false because there need not have been any me. + -- A.N. Prior, "Time and Modality" +%% +It does not do to leave a live dragon out of your calculations. +%% +It doesn't matter whether you win or lose -- until you lose. +%% +It got to the point where I had to get a haircut +or both feet firmly planted in the air. +%% +It happened long ago +In the new magic land +The Indians and the buffalo +Existed hand in hand +The Indians needed food +They need skins for a roof +The only took what they needed +And the buffalo ran loose +But then came the white man +With his thick and empty head +He couldn't see past his billfold +He wanted all the buffalo dead +It was sad, oh so sad. + -- Ted Nugent, "The Great White Buffalo" +%% +It has been justly observed by sages of all lands that although +a man may be most happily married and continue in that state with the +utmost contentment, it does not necessarily follow that he has +therefore been struck stone-blind. + -- H. Warner Munn +%% +It has been observed that one's nose is never so happy as when it +is thrust into the affairs of another, from which some physiologists +have drawn the inference that the nose is devoid of the sense of smell. + -- Ambrose Bierce +%% +It has just been discovered that research causes cancer in rats. +%% +It has long been an article of our folklore that too much knowledge or skill, +or especially consummate expertise, is a bad thing. It dehumanizes those who +achieve it, and makes difficult their commerce with just plain folks, in whom +good old common sense has not been obliterated by mere book learning or fancy +notions. This popular delusion flourishes now more than ever, for we are all +infected with it in the schools, where educationists have elevated it from +folklore to Article of Belief. It enhances their self-esteem and lightens +their labors by providing theoretical justification for deciding that +appreciation, or even simple awareness, is more to be prized than knowledge, +and relating (to self and others), more than skill, in which minimum +competence will be quite enough. + -- The Underground Grammarian +%% +It has long been an axiom of mine that the +little things are infinitely the most important. + -- Sir Arthur Conan Doyle, "A Case of Identity" +%% +It has long been known that birds will occasionally build nests in the +manes of horses. The only known solution to this problem is to sprinkle +baker's yeast in the mane, for, as we all know, yeast is yeast and nest +is nest, and never the mane shall tweet. +%% +It has long been known that one horse can run faster +than another -- but which one? Differences are crucial. + -- Lazarus Long +%% +It is Fortune, not Wisdom, that rules man's life. +%% +It is a hard matter, my fellow citizens, +to argue with the belly, since it has no ears. + -- Marcus Porcius Cato +%% +It is a lesson which all history teaches +wise men, to put trust in ideas, and not in circumstances. + -- Emerson +%% +It is a poor judge who cannot award a prize. +%% +It is a profitable thing, if one is wise, to seem foolish. + -- Aeschylus +%% +It is a sobering thought that when Mozart was +my age, he had been dead for 2 years. + -- Tom Lehrer +%% +It is a wise father that knows his own child. + -- William Shakespeare, "The Merchant of Venice" +%% +It is against the grain of modern education to teach children to program. +What fun is there in making plans, acquiring discipline in organizing +thoughts, devoting attention to detail, and learning to be self-critical? + -- Alan Perlis +%% + It is always preferable to visit home with a friend. Your parents will +not be pleased with this plan, because they want you all to themselves and +because in the presence of your friend, they will have to act like mature +human beings. + The worst kind of friend to take home is a girl, because in that case, +there is the potential that your parents will lose you not just for the +duration of the visit but forever. The worst kind of girl to take home is one +of a different religion: Not only will you be lost to your parents forever but +you will be lost to a woman who is immune to their religious/moral arguments +and whose example will irretrievably corrupt you. + Let's say you've fallen in love with just such a girl and would like +to take her home for the holidays. You are aware of your parents' xenophobic +response to anyone of a different religion. How to prepare them for the shock? + Simple. Call them up shortly before your visit and tell them that you +have gotten quite serious about somebody who is of a different religion, a +different race and the same sex. Tell them you have already invited this +person to meet them. Give the information a moment to sink in and then +remark that you were only kidding, that your lover is merely of a different +religion. They will be so relieved they will welcome her with open arms. + -- Playboy, January, 1983 +%% +It is always the best policy to speak the truth, +unless of course you are an exceptionally good liar. + -- Jerome K. Jerome +%% +It is amazing how complete is the delusion that beauty is goodness. +%% +It is amusing that a virtue is made of the vice of chastity; and +it's a pretty odd sort of chastity at that, which leads men straight +into the sin of Onan, and girls to the waning of their color. + -- Voltaire +%% +It is annoying to be honest to no purpose. + -- Publius Ovidius Naso (Ovid) +%% +It is bad luck to be superstitious. + -- Andrew W. Mathis +%% +It is better to be bow-legged than no-legged. +%% +It is better to be on penicillin, than never to have loved at all. +%% +It is better to burn out than it is to rust. +%% +It is better to die on your feet than to live on your knees. +%% +It is better to have a positive Wasserman than never to have loved at all. +%% +It is better to have loved a short man than never to have loved a tall. +%% +It is better to have loved and lost -- much better. +%% +It is better to have loved and lost than just to have lost. +%% +It is better to kiss an avocado than to get in a fight with an aardvark. +%% +It is better to remain childless than to father an orphan. +%% +It is better to wear chains than to believe you are free, +and weight yourself down with invisible chains. +%% +It is better to wear out than to rust out. +%% +It is common sense to take a method and try it. If it fails, +admit it frankly and try another. But above all, try something. + -- Franklin D. Roosevelt +%% +It is contrary to reasoning to say that there +is a vacuum or space in which there is absolutely nothing. + -- Descartes +%% +It is convenient that there be gods, and, +as it is convenient, let us believe there are. + -- Publius Ovidius Naso (Ovid) +%% +It is difficult to legislate morality in the absence of moral legislators. +%% +It is difficult to produce a television documentary that is both incisive +and probing when every twelve minutes one is interrupted by twelve dancing +rabbits singing about toilet paper. + -- R. Serling +%% +It is difficult to soar with the eagles when you work with turkeys. +%% +It is easier for a camel to pass through the +eye of a needle if it is lightly greased. + -- Kehlog Albran +%% +It is easier to be a liberal a long way from home. +%% +It is easier to change the specification to fit the program than vice versa. +%% +It is easier to get forgiveness than permission. +%% +It is easier to make a saint out of a libertine than out of a prig. + -- George Santayana +%% +It is easier to resist at the beginning than at the end. + -- Leonardo da Vinci +%% +It is easier to run down a hill than up one. +%% +It is easier to write an incorrect program than understand a correct one. +%% +It is easy when we are in prosperity to give advice to the afflicted. + -- Aeschylus +%% +It is enough to make one sympathize with a tyrant for the determination +of his courtiers to deceive him for their own personal ends... + -- Russell Baker and Charles Peters +%% +It is exactly because a man cannot do a +thing that he is a proper judge of it. + -- Oscar Wilde +%% +It is far better to be deceived than to be undeceived by those we love. +%% +It is fruitless: + to become lacrymose over precipitately departed lactate fluid. + + to attempt to indoctrinate a superannuated canine with + innovative maneuvers. +%% +It is generally agreed that "Hello" is an appropriate greeting because +if you entered a room and said "Goodbye," it could confuse a lot of people. + -- Dolph Sharp +%% +It is idle to attempt to talk a young woman out of her passion: +love does not lie in the ear. + -- Walpole +%% +It is impossible for an optimist to be pleasantly surprised. +%% +It is impossible to defend perfectly +against the attack of those who want to die. +%% +It is impossible to enjoy idling thoroughly +unless one has plenty of work to do. + -- Jerome Klapka Jerome +%% +It is impossible to make anything +foolproof because fools are so ingenious. +%% +It is impossible to travel faster than light, and +certainly not desirable, as one's hat keeps blowing off. + -- Woody Allen +%% +It is indeed desirable to be well descended, +but the glory belongs to our ancestors. + -- Plutarch +%% +It is like saying that for the cause of peace, +God and the Devil will have a high-level meeting. + -- Rev. Carl McIntire, on Nixon's China trip +%% +It is most dangerous nowadays for a husband to pay any attention to his +wife in public. It always makes people think that he beats her when +they're alone. The world has grown so suspicious of anything that looks +like a happy married life. + -- Wilde +%% +It is much easier to be critical than to be correct. + -- Benjamin Disraeli +%% +It is much easier to suggest solutions +when you know nothing about the problem. +%% +It is much harder to find a job than to keep one. +%% +It is not a good omen when goldfish commit suicide. +%% +It is not enough to have a good mind. +The main thing is to use it well. + -- Rene Descartes +%% +It is not enough to have great qualities, +we should also have the management of them. + -- La Rochefoucauld +%% +It is not enough that I should succeed. Others must fail. + -- Ray Kroc, Founder of McDonald's + [Also attributed to David Merrick. Ed.] + +It is not enough to succeed. Others must fail. + -- Gore Vidal + [Great minds think alike? Ed.] +%% +It is not every question that deserves an answer. + -- Publilius Syrus +%% +It is not for me to attempt to fathom the +inscrutable workings of Providence. + -- The Earl of Birkenhead +%% +It is not good for a man to be without knowledge, +and he who makes haste with his feet misses his way. + -- Proverbs 19:2 +%% +It is not the critic who counts, or how the strong man stumbled, or whether +the doer of deeds could have done them better. The credit belongs to the +man who is actually in the arena, whose face is marred by dust and sweat and +blood, who strives valiantly, who errs and comes short again and again; who +knows the great enthusiasm, the great devotion, and who spends himself in a +worthy cause, and if he fails, at least fails while daring greatly, so that +he'll never be with those cold and timid souls who never know either victory +or defeat. + -- Teddy Roosevelt +%% +It is not true that life is one damn thing after +another -- it's one damn thing over and over. + -- Edna St. Vincent Millay +%% +It is now 10 p.m. Do you know where Henry Kissinger is? + -- Elizabeth Carpenter +%% +It is now pitch dark. If you proceed, you will likely fall into a pit. +%% +It is one of the superstitions of the human mind +to have imagined that virginity could be a virtue. + -- Voltaire +%% +It is one thing to praise discipline, and another to submit to it. + -- Cervantes +%% +It is only by risking our persons from one hour to another that we live +at all. And often enough our faith beforehand in an uncertified result +is the only thing that makes the result come true. + -- William James +%% +It is only the man whose intellect is clouded by his sexual impulse that +could give the name of the fair sex to that undersized, narrow-shouldered, +broad-hipped, and short-legged race. + -- Schopenhauer +%% +It is only with the heart one can see clearly; +what is essential is invisible to the eye. + -- The Fox, 'The Little Prince" +%% +It is ridiculous to call this an industry. This is not. This is rat eat +rat, dog eat dog. I'll kill 'em, and I'm going to kill 'em before they +kill me. You're talking about the American way of survival of the fittest. + -- Ray Kroc, Founder of McDonald's +%% +It is said an Eastern monarch once charged his wise men to invent him a +sentence to be ever in view, and which should be true and appropriate +in all times and situations. They presented him the words: "And this, +too, shall pass away." + -- A. Lincoln +%% +It is said that the lonely eagle flies to the mountain peaks while the +lowly ant crawls the ground, but cannot the soul of the ant soar as +high as the eagle? +%% +It is so soon that I am done for, I wonder what I was begun for. + -- Epitaph, Cheltenham Churchyard +%% +It is so very hard to be an on-your-own-take-care-of- +yourself-because-there-is-no-one-else-to-do-it-for-you grown up. +%% +It is something to be able to paint a particular picture, or to carve a +statue, and so to make a few objects beautiful; but it is far more glorious +to carve and paint the very atmosphere and medium through which we look, +which morally we can do. To affect the quality of the day, that is the +highest of arts. Every man is tasked to make his life, even in its details, +worthy of the contemplation of his most elevated and critical hour. + -- Henry David Thoreau, "Where I Live" +%% +It is sweet to let the mind unbend on occasion. + -- Quintus Horatius Flaccus (Horace) +%% +It is the business of little minds to shrink. + -- Carl Sandburg +%% +It is the business of the future to be dangerous. + -- Hawkwind +%% +It is the nature of extreme self-lovers, as they will +set an house on fire, and it were but to roast their eggs. + -- Francis Bacon +%% +It is the wisdom of crocodiles, that shed tears when they would devour. + -- Francis Bacon +%% +It is the wise bird who builds his nest in a tree. +%% +It is through symbols that man consciously or unconsciously +lives, works and has his being. + -- Thomas Carlyle +%% +It is very vulgar to talk like a dentist when one isn't a dentist. +It produces a false impression. + -- Oscar Wilde. +%% +It is when I struggle to be brief that I become obscure. + -- Quintus Horatius Flaccus (Horace) +%% +It is wise to keep in mind that neither success nor failure is ever final. + -- Roger Babson +%% +It is your concern when your neighbor's wall is on fire. + -- Quintus Horatius Flaccus (Horace) +%% +It isn't easy being a Friday kind of person in a Monday kind of world. +%% +It looks like blind screaming hedonism won out. +%% +It looks like it's up to me to save our skins. +Get into that garbage chute, flyboy! + -- Princess Leia Organa +%% +It [marriage] happens as with cages: the birds without despair +to get in, and those within despair of getting out. + -- Michel Eyquem de Montaigne +%% +It may be better to be a live jackal than a dead lion, but it is +better still to be a live lion. And usually easier. + -- Lazarus Long +%% +It may or may not be worthwhile, but it still has to be done. +%% +It now costs more to amuse a child than it once did to educate his father. +%% +It occurred to me lately that nothing has occurred to me lately. +%% +It pays to be obvious, especially if you have a reputation for subtlety. +%% +It seems a little silly now, but this country +was founded as a protest against taxation. +%% +It seems the less a statesman amounts to, the more he loves the flag. + -- Frank Hubbard +%% +It seems to make an auto driver mad if he misses you. +%% +It takes a special kind of courage +to face what we all have to face. +%% +It takes all kinds to fill the freeways. + -- Crazy Charlie +%% +It takes both a weapon, and two people, to commit a murder. +%% +It takes less time to do a thing right +than it does to explain why you did it wrong. + -- H.W. Longfellow +%% +It takes two to tell the truth: one to speak and one to hear. +%% + It took 300 years to build and by the time it was 10% built, +everyone knew it would be a total disaster. But by then the investment +was so big they felt compelled to go on. Since its completion, it has +cost a fortune to maintain and is still in danger of collapsing. + There are at present no plans to replace it, since it was never +really needed in the first place. + I expect every installation has its own pet software which is +analogous to the above. + -- K.E. Iverson, on the Leaning Tower of Pisa +%% +It used to be the fun was in +The capture and kill. +In another place and time +I did it all for thrills. + -- Lust to Love +%% +It was Penguin lust... at its ugliest. +%% +It was a book to kill time for those who liked it better dead. +%% +It was a brave man that ate the first oyster. +%% +It was a female that drove me to drink +and I didn't even have the kindness to thank her. + -- R.E. Baber +%% +It was all so different before everything changed. +%% +It was kinda like stuffing the wrong card in a computer, +when you're stickin' those artificial stimulants in your arm. + -- Dion, noted computer scientist +%% +It was on the tip of my tongue to tell them about the deer, but I ended up +not doing it. That was one thing I kept to myself. I've never spoken or +written of it until just now, today. And I have to tell you that it seems +a lesser thing written down, damn near inconsequential. But for me it was +the best part of that trip, the cleanest part, and it was a moment I found +myself returning to, almost helplessly, when there was trouble in my life -- +my first day in the bush in Vietnam, and this fellow walked into the clearing +where we were with his hand over his nose and when he took his hand away there +was no nose there because it had been shot off; the time the doctor told us +our youngest son might be hydrocephalic (he turned out just to have an +oversized head, thank God); the long crazy weeks before my mother died. I +would find my thoughts turning back to that morning, the scuffed suede of +her ears, the white flash of her tail. But eight hundred million Red Chinese +don't give a shit, right? The most important things are the hardest to say, +because words diminish them. It's hard to make strangers care about the +good things in your life. + -- Stephen King, "The Body" +%% +It was pleasant to me to get a letter from you the other day. Perhaps +I should have found it pleasanter if I had been able to decipher it. I +don't think that I mastered anything beyond the date (which I knew) and +the signature (which I guessed at). There's a singular and a perpetual +charm in a letter of yours; it never grows old, it never loses its +novelty. Other letters are read and thrown away and forgotten, but +yours are kept forever -- unread. One of them will last a reasonable +man a lifetime. + -- Thomas Aldrich +%% +It was raining heavily, and the motorist had car trouble on a lonely country +road. Anxious to find shelter for the night, he walked over to a farmhouse +and knocked on the front door. No one responded. He could feel the water +from the roof running down the back of his neck as he stood on the stoop. +The next time he knocked louder, but still no answer. By now he was soaked +to the skin. Desperately he pounded on the door. At last the head of a +man appeared out of an upstairs window. + "What do you want?" he asked gruffly. + "My car broke down," said the traveler, "and I want to know if you +would let me stay here for the night." + "Sure," replied the man. "If you want to stay there all night, it's +okay with me." +%% + It was the next morning that the armies of Twodor marched east +laden with long lances, sharp swords, and death-dealing hangovers. The +thousands were led by Arrowroot, who sat limply in his sidesaddle, +nursing a whopper. Goodgulf, Gimlet, and the rest rode by him, praying +for their fate to be quick, painless, and if possible, someone else's. + Many an hour the armies forged ahead, the war-merinos bleating +under their heavy burdens and the soldiers bleating under their melting +icepacks. + -- "Bored of the Rings", The Harvard Lampoon +%% +It was wonderful to find America, but it +would have been more wonderful to miss it. + -- Mark Twain +%% +It would be nice to be sure of anything +the way some people are of everything. +%% +It'll be a nice world if they ever get it finished. +%% +It'll be just like Beggars Canyon back home. + -- Luke Skywalker +%% +It's a damn poor mind that can only think of one way to spell a word. + -- Andrew Jackson +%% +It's a funny thing that when a woman hasn't got anything +on earth to worry about, she goes off and gets married. +%% +It's a naive, domestic operating system without any +breeding, but I think you'll be amused by its presumption. +%% +It's a poor workman who blames his tools. +%% +It's all in the mind, ya know. +%% +"It's all so painfully empty and lonesome... I don't think I can stand +any more of it... the whole dreadful way we are born, die, and are +never missed. The fact there is *nobody*... nobody really... We come +out of a yawning tomb of flesh and sink back finally into another tomb. +What is the point of it all? Who thought up this sickening circle of +flesh and blood? We come into the world bleeding and cut and our bones +half-crushed only to emerge and suffer more torment, multilation, and +then at the last lie down in some hole in the ground forever. Who could +have thought it up, I wonder?" + -- James Purdy +%% +It's amazing how many people you could be friends +with if only they'd only make the first approach. +%% +It's amazing how much "mature wisdom" resembles being too tired. +%% +It's bad enough that life is a rat-race, +but why do the rats always have to win? +%% +It's better to burn out than it is to rust. +%% +It's better to burn out than to fade away. +%% +It's better to have loved and lost -- much better. +%% +It's business doing pleasure with you. +%% +It's clever, but is it art? +%% +It's difficult to see the picture when you are inside the frame. +%% +"It's easier said than done." + +... and if you don't believe it, try proving that it's easier done than +said, and you'll see that "it's easier said that `it's easier done than +said' than it is done", which really proves that "it's easier said than +done". +%% +It's easier to get forgiveness for being +wrong than forgiveness for being right. +%% +It's easier to take it apart than to put it back together. + -- Washlesky +%% +It's easy to forgive someone for being wrong; +it's much harder to forgive them for being right. +%% +It's fabulous! We haven't seen anything like it in the last half an hour! + -- Macy's +%% +It's faster horses, +Younger women, +Older whiskey and +More money. + -- Tom T. Hall, "The Secret of Life" +%% +It's from Casablanca. I've been waiting all my life to use that line. + -- Woody Allen, "Play It Again, Sam" +%% +It's getting uncommonly easy to kill people in large numbers, and the +first thing a principle does -- if it really is a principle -- is to +kill somebody. + -- Dorothy Sayers +%% +It's gonna be alright, +It's almost midnight, +And I've got two more bottles of wine. +%% + It's grad exam time... +COMPUTER SCIENCE + Inside your desk you'll find a listing of the DEC/VMS operating +system in IBM 1710 machine code. Show what changes are necessary to convert +this code into a UNIX Berkley 7 operating system. Prove that these fixes are +bug free and run correctly. You should gain at least 150% efficiency in the +new system. (You should take no more than 10 minutes on this question.) + +MATHEMATICS + If X equals PI times R^2, construct a formula showing how long +it would take a fire ant to drill a hole through a dill pickle, if the +length-girth ratio of the ant to the pickle were 98.17:1. + +GENERAL KNOWLEDGE +Describe the Universe. Give three examples. +%% + It's grad exam time... +MEDICINE + You have been provided with a razor blade, a piece of gauze, and a +bottle of Scotch. Remove your appendix. Do not suture until your work has +been inspected. (You have 15 minutes.) + +HISTORY + Describe the history of the papacy from its origins to the present +day, concentrating especially, but not exclusively, on its social, political, +economic, religious and philisophical impact upon Europe, Asia, America, and +Africa. Be brief, concise, and specific. + +BIOLOGY + Create life. Estimate the differences in subsequent human culture +if this form of life had been created 500 million years ago or earlier, with +special attention to its probable effect on the English parliamentary system. +%% +It's hard to be humble when you're perfect. +%% +It's hard to drive at the limit, but +it's harder to know where the limits are. + -- Stirling Moss +%% +It's hard to get ivory in Africa, but in Alabama the Tuscaloosa. + -- Groucho Marx +%% +It's hard to keep your shirt on when +you're getting something off your chest. +%% +It's important that people know what you stand for. +It's more important that they know what you won't stand for. +%% +It's interesting to think that many quite +distinguished people have bodies similar to yours. +%% +It's is not, it isn't ain't, and it's it's, not its, if you mean it is. +If you don't, it's its. Then too, it's hers. It isn't her's. It isn't +our's either. It's ours, and likewise yours and theirs. + -- Oxford University Press, "Edpress News" +%% +It's just apartment house rules, +So all you 'partment house fools +Remember: one man's ceiling is another man's floor. +One man's ceiling is another man's floor. + -- Paul Simon, "One Man's Ceiling Is Another Man's Floor" +%% +It's later than you think. +%% +It's later than you think, the joint +Russian-American space mission has already begun. +%% +It's lucky you're going so slowly, because +you're going in the wrong direction. +%% +Its name is Public Opinion. It is held in reverence. +It settles everything. Some think it is the voice of God. + -- Mark Twain +%% +It's no use crying over spilt milk -- it only makes it salty for the cat. +%% +It's not Camelot, but it's not Cleveland, either. + -- Kevin White, Mayor of Boston +%% +It's not against any religion to want to dispose of a pigeon. + -- Tom Lehrer +%% +It's not easy being green. + -- Kermit +%% +It's not enough to be Hungarian; you must have talent too. + -- Alexander Korda +%% +It's not hard to admit errors that are [only] cosmetically wrong. + -- J.K. Galbraith +%% +It's not pretty being easy. +%% +It's not reality that's important, but how you perceive things. +%% +It's not that I'm afraid to die. +I just don't want to be there when it happens. + -- Woody Allen +%% +It's not whether you win or lose but how you played the game. + -- Grantland Rice +%% +It's not whether you win or lose, it's how you look playing the game. +%% +It's only by NOT taking the human race seriously that I retain +what fragments of my once considerable mental powers I still possess. + -- Roger Noe +%% +It may be that your whole purpose in life +is simply to serve as a warning to others. +%% +It's pretty hard to tell what does bring happiness; +poverty and wealth have both failed. + -- Kim Hubbard +%% +It's really quite a simple choice: Life, Death, or Los Angeles. +%% +It's so confusing choosing sides in the heat of the moment, + just to see if it's real, +Oooh, it's so erotic having you tell me how it should feel, +But I'm avoiding all the hard cold facts that I got to face, +So ask me just one question when this magic night is through, +Could it have been just anyone or did it have to be you? + -- Billy Joel, "Glass Houses" +%% +It's sort of a threat, you see. I've never been very +good at them myself but I'm told they can be very effective. +%% +It's sweet to be remembered, but it's often cheaper to be forgotten. +%% +It's ten o'clock; do you know where your processes are? +%% +It's very inconvenient to be mortal -- you never +know when everything may suddenly stop happening. +%% +I've Been Moved! +%% +I've already told you more than I know. +%% +I've been told that it's far more sensous to have a woman leave +something on rather than being totally nude. Myself, I've always +felt that the lights were more than enough. +%% +I've always considered statesmen to be more expendable than soldiers. +%% +I've always made it a solemn practice to never +drink anything stronger than tequila before breakfast. + -- R. Nesson +%% +I've been on this lonely road so long, +Does anybody know where it goes, +I remember last time the signs pointed home, +A month ago. + -- Carpenters, "Road Ode" +%% +I've been there. +%% +I've given up reading books; I find it takes my mind off myself. +%% +I've got a very bad feeling about this. + -- Han Solo +%% +I've had one child. My husband wants to have another. +I'd like to watch him have another. +%% +I've looked at the listing, and it's right! + -- Joel Halpern. +%% +I've never been canoeing before, but I imagine there must +be just a few simple heuristics you have to remember... + +Yes, don't fall out, and don't hit rocks. +%% +I've never been hurt by anything I didn't say. + -- Calvin Coolidge +%% +I've noticed several design suggestions in your code. +%% +I've only got 12 cards. +%% +JOB INTERVIEW: + The excruciating process during which personnel officers + separate the wheat from the chaff -- then hire the chaff. +%% +JOGGER: + An odd sort of person with a thing for pain. +%% +JUSTICE: + A decision in your favor. +%% +Jacquin's Postulate on Democratic Government: + No man's life, liberty, or property + are safe while the legislature is in session. +%% +Jealousy is all the fun you think they have. +%% +Jenkinson's Law: + It won't work. +%% +Jesus Saves, +Moses Invests, +But only Buddha pays Dividends. +%% +Jim Nasium's Law: + In a large locker room with hundreds of lockers, the few people + using the facility at any one time will all have lockers next to + each other so that everybody is cramped. +%% +Jim, it's Grace at the bank. I checked your Christmas Club account. +You don't have five-hundred dollars. You have fifty. Sorry, computer foul-up! +%% +Jim, it's Jack. I'm at the airport. I'm going to Tokyo and wanna pay +you the five-hundred I owe you. Catch you next year when I get back! +%% +Jim, this is Janelle. I'm flying tonight, so I can't make our date, and +I gotta find a safe place for Daffy. He loves you, Jim! It's only two +days, and you'll see. Great Danes are no problem! +%% +Jim, this is Matty down at Ralph's and Mark's. Some guy named Angel +Martin just ran up a fifty buck bar tab. And now he wants to charge it +to you. You gonna pay it? +%% +Joe Cool always spends the first two weeks at college sailing his frisbee. + -- Snoopy +%% +Joe's sister puts spaghetti in her shoes! +%% +John the Baptist after poisoning a thief, +Looks up at his hero, the Commander-in-Chief, +Saying tell me great leader, but please make it brief +Is there a hole for me to get sick in? +The Commander-in-Chief answers him while chasing a fly, +Saying death to all those who would whimper and cry. +And dropping a barbell he points to the sky, +Saying the sun is not yellow, it's chicken. + -- Bob Dylan, "Tombstone Blues" +%% +John Dame May Oscar +Was Gay Was Whitty Was Wilde +But Gerard Hopkins But John Greenleaf But Thornton +Was Manley Was Whittier Was Wilder + -- Willard Espy +%% +Johnson's First Law: + When any mechanical contrivance fails, it will do so at the + most inconvenient possible time. +%% +Johnson's law: + Systems resemble the organizations that create them. +%% +Join the Navy; travel to far-off exotic lands, +meet exciting interesting people, and kill them. +%% +Jones' First Law: + Anyone who makes a significant contribution to any field of + endeavor, and stays in that field long enough, becomes an + obstruction to its progress -- in direct proportion to the + importance of their original contribution. +%% +Jones' Law: + Friends may come and go, but enemies accumulate. +%% +Jones' Second Law: + The man who smiles when things go wrong has thought of someone + to blame it on. +%% +Joshu: What is the true Way? +Nansen: Every way is the true Way. +J: Can I study it? +N: The more you study, the further from the Way. +J: If I don't study it, how can I know it? +N: The Way does not belong to things seen: nor to things unseen. + It does not belong to things known: nor to things unknown. Do + not seek it, study it, or name it. To find yourself on it, open + yourself as wide as the sky. +%% +Journalism is literature in a hurry. + -- Matthew Arnold +%% +Journalism will kill you, but it will +keep you alive while you're at it. +%% +Juall's Law on Nice Guys: + Nice guys don't always finish last; sometimes they don't finish. + Sometimes they don't even get a chance to start! +%% +Just a song before I go, Going through security +To whom it may concern, I held her for so long. +Traveling twice the speed of sound She finally looked at me in love, +It's easy to get burned. And she was gone. +When the shows were over Just a song before I go, +We had to get back home, A lesson to be learned. +And when we opened up the door Traveling twice the speed of sound +I had to be alone. It's easy to get burned. +She helped me with my suitcase, +She stands before my eyes, +Driving me to the airport +And to the friendly skies. + -- Crosby, Stills, Nash, "Just a Song Before I Go" +%% +Just as I cannot remember any time when I could not read and write, I cannot +remember any time when I did not exercise my imagination in daydreams about +women. + -- G.B. Shaw +%% +Just because he's dead is no reason to lay off work. +%% +Just because the message may never be +received does not mean it is not worth sending. +%% +Just because you like my stuff doesn't mean I owe you anything. + -- Bob Dylan +%% +Just because your doctor has a name for your +condition doesn't mean he knows what it is. +%% +Just because you're paranoid doesn't mean they AREN'T after you. +%% +Just close your eyes, tap your heels together three times, +and think to yourself, `There's no place like home.' + -- Glynda +%% +Just give Alice some pencils and she will stay busy for hours. +%% +Just machines to make big decisions, +Programmed by men for compassion and vision, +We'll be clean when their work is done, +We'll be eternally free, yes, eternally young, +What a beautiful world this will be, +What a glorious time to be free. + -- Donald Fagon, "What A Beautiful World" +%% +Just once, I wish we would encounter +an alien menace that wasn't immune to bullets. + -- The Brigader, "Dr. Who" +%% +Just once I would like to persuade the audience not to wear any article of +blue denim. If only they could see themselves in a pair of brown corduroys +like mine instead of this awful, boring blue denim. I don't enjoy the sky +or sea as much as I used to because of this Levi character. If Jesus Christ +came back today, He and I would get into our brown corduroys and go to the +nearest jean store and overturn the racks of blue denim. Then we'd get +crucified in the morning. + -- Ian Anderson, of Jethro Tull +%% +Just to have it is enough. +%% +Just weigh your own hurt against the hurt +of all the others, and then do what's best. + -- Lovers and Other Strangers +%% +Just yesterday morning, they let me know you were gone, +Suzanne, the plans they made put an end to you, +I went out this morning and I wrote down this song, +Just can't remember who to send it to... + +Oh, I've seen fire and I've seen rain, +I've seen sunny days that I thought would never end, +I've seen lonely times when I could not find a friend, +But I always thought that I'd see you again. +Thought I'd see you one more time again. + -- James Taylor, "Fire and Rain" +%% +Justice is incidental to law and order. + -- J. Edgar Hoover +%% +KANSAS: + Where the men are men and so are the women! +%% +KERNEL: + A part of an operating system that preserves the medieval + traditions of sorcery and black art. +%% +KIN: + An affliction of the blood. +%% +KLEPTOMANIAC: + A rich thief. +%% +KNOWLEDGE: + Things you believe. +%% +Katz' Law: + Men and nations will act rationally when + all other possibilities have been exhausted. +%% +Kaufman's First Law of Party Physics: + Population density is inversely proportional + to the square of the distance from the keg. +%% +Kaufman's Law: + A policy is a restrictive document to prevent a recurrence + of a single incident, in which that incident is never mentioned. +%% +Keep America beautiful. Swallow your beer cans. +%% +Keep ancient lands, your storied pomp! cries she +With silent lips. Give me your tired, your poor, +Your huddled masses yearning to breathe free, +The wretched refuse of your teeming shore. +Send these, the homeless, tempest-tossed to me... + -- Emma Lazarus, "The New Colossus" +%% +Keep emotionally active. Cater to your favorite neurosis. +%% +Keep grandma off the streets -- legalize bingo. +%% +Keep in mind always the four constant Laws of Frisbee: + 1) The most powerful force in the world is that of a disc + straining to land under a car, just out of reach (this + force is technically termed "car suck"). + 2) Never precede any maneuver by a comment more predictive + than "Watch this!" + 3) The probability of a Frisbee hitting something is directly + proportional to the cost of hitting it. For instance, a + Frisbee will always head directly towards a policeman or + a little old lady rather than the beat up Chevy. + 4) Your best throw happens when no one is watching; when the + cute girl you've been trying to impress is watching, the + Frisbee will invariably bounce out of your hand or hit you + in the head and knock you silly. +%% +Keep it short for pithy sake. +%% +Keep on keepin' on. +%% +Keep patting your enemy on the back until a +small bullet hole appears between your fingers. + -- Joe Bonanno +%% +Keep the number of passes in a compiler to a minimum. + -- D. Gries +%% +Keep the phase, baby. +%% +Keep up the good work! But please don't ask me to help. +%% +Keep women you cannot. Marry them and they come to hate the way +you walk across the room; remain their lover, and they jilt you +at the end of six months. + -- Moore +%% +Keep your Eye on the Ball, +Your Shoulder to the Wheel, +Your Nose to the Grindstone, +Your Feet on the Ground, +Your Head on your Shoulders. +Now... try to get something DONE! +%% +Keep your laws off my body! +%% +Keep your mouth shut and people will think you stupid; +Open it and you remove all doubt. +%% +Kennedy's Market Theorem: + Given enough inside information and unlimited credit, + you've got to go broke. +%% +Kerr's Three Rules for a Successful College: + Have plenty of football for the alumni, sex + for the students, and parking for the faculty. +%% +Kettering's Observation: + Logic is an organized way of going wrong with confidence. +%% +Kill Kill, +Hate Hate, +Murder, Maim, and Mutilate! +%% +Kill a commy for your mommy. +%% +Kill 'em all, and let God sort 'em out. +%% +Kilroe hic erat! +%% +Kime's Law for the Reward of Meekness: + Turning the other cheek merely ensures two bruised cheeks. +%% +Kindness is a language which the deaf can hear and the blind can read. + -- Mark Twain +%% +Kindness is the beginning of cruelty. + -- Muad'dib +%% +Kington's Law of Perforation: + If a straight line of holes is made in a piece of paper, such + as a sheet of stamps or a check, that line becomes the strongest + part of the paper. +%% +Kinkler's First Law: + Responsibility always exceeds authority. + +Kinkler's Second Law: + All the easy problems have been solved. +%% +Kirk to Enterprise... +%% +Kirk to Enterprise -- beam down yeoman Rand and a six-pack. +%% +Kiss me, Kate, we will be married o' Sunday. + -- William Shakespeare, "The Taming of the Shrew" +%% +Kiss me twice. I'm schizophrenic. +%% +Kiss your keyboard goodbye! +%% +Kissing a fish is like smoking a bicycle. +%% +Kissing a smoker is like licking an ashtray. +%% +Kitchen activity is highlighted. +Butter up a friend. +%% +Kites rise highest against the wind -- not with it. + -- Winston Churchill +%% +Klatu barada nikto. +%% +Kleeneness is next to Godelness. +%% +Klein bottle for rent -- inquire within. +%% +Kliban's First Law of Dining: + Never eat anything bigger than your head. +%% +Klingon phaser attack from front!!!!! +100% Damage to life support!!!! +%% +Knock, knock! + Who's there? +Sam and Janet. + Sam and Janet who? +Sam and Janet Evening... +%% +Knocked, you weren't in. + -- Opportunity +%% +Know Thy User. +%% +Know how to save 5 drowning lawyers? + +-- No? + +GOOD! +%% +Know thyself. If you need help, call the C.I.A. +%% +Know what I hate most? Rhetorical questions. + -- Henry N. Camp +%% +Knowledge is power. + -- Francis Bacon +%% +Knowledge without common sense is folly. +%% +LABOR: + One of the processes by which A acquires property for B. +%% +LASER: + Failed death ray. +%% +LA: + Where the only way to determine that the seasons have changed + is to note that people have changed the main topic of conversation. + From mud slides to brush fires. +%% +LAZY: + Marrying a pregnant woman. +%% +LEARNING CURVE: + An astonishing new theory, discovered by management consultants + in the 1970's, asserting that the more you do something the + quicker you can do it. +%% +LEO (July 23 - Aug 22) + You consider yourself a born leader. Others think you are pushy. + Most Leo people are bullies. You are vain and dislike honest + criticism. Your arrogance is disgusting. Leo people are thieves. +%% +LEO (July 23 - Aug 22) + Your determination and sense of humor will come to the fore. Your + ability to laugh at adversity will be a blessing because you've got + a day coming you wouldn't believe. As a matter of fact, if you can + laugh at what happens to you today, you've got a sick sense of humor. +%% +LEVERAGE: + Even if someone doesn't care what the world thinks + about them, they always hope their mother doesn't find out. +%% +LIAR: + A lawyer with a roving commission. +%% +LIAR: + One who tells an unpleasant truth. +%% +LIBERAL: + Someone too poor to be a capitalist and too rich to be a communist. +%% +LIBRA (Sept 23 - Oct 23) + Major achievements, new friends, and a previously unexplored way + to make a lot of money will come to a lot of people today, but + unfortunately you won't be one of them. Consider not getting out + of bed today. +%% +LIE: + A very poor substitute for the truth, + but the only one discovered to date. +%% +LIFE: + A whim of several billion cells to be you for a while. +%% +LIFE: + Learning about people the hard way -- by being one. +%% +LIFE: + That brief interlude between nothingness and eternity. +%% +LIGHTHOUSE: + A tall building on the seashore in which the government + maintains a lamp and the friend of a politician. +%% +LIKE: + When being alive at the same time is a wonderful coincidence. +%% +LISP: + To call a spade a thpade. +%% +LIVING YOUR LIFE: + A task so difficult, it has never been attempted before. +%% +LOGO for the Dead + +LOGO for the Dead lets you continue your computing activities from +"The Other Side." + +The package includes a unique telecommunications feature which lets you +turn your TRS-80 into an electronic Ouija board. Then, using Logo's +graphics capabilities, you can work with a friend or relative on this +side of the Great Beyond to write programs. The software requires that +your body be hardwired to an analog-to-digital converter, which is then +interfaced to your computer. A special terminal (very terminal) program +lets you talk with the users through Deadnet, an EBBS (Ectoplasmic +Bulletin Board System). + +LOGO for the Dead is available for 10 percent of your estate +from NecroSoft inc., 6502 Charnelhouse Blvd., Cleveland, OH 44101. + -- '80 Microcomputing +%% +LOVE: + I'll let you play with my life if you'll let me play with yours. +%% +LOVE: + Love ties in a knot in the end of the rope. +%% +LOVE: + When, if asked to choose between your lover + and happiness, you'd skip happiness in a heartbeat. +%% +LOVE: + When it's growing, you don't mind watering it with a few tears. +%% +LOVE: + When you don't want someone too close-- + because you're very sensitive to pleasure. +%% +LOVE: + When you like to think of someone on days that begin with a morning. +%% +LSD melts in your mind, not in your hand. +%% +LUNATIC ASYLUM: + The place where optimism most flourishes. +%% +Lack of capability is usually disguised by lack of interest. +%% +Lack of money is the root of all evil. + -- George Bernard Shaw +%% +Lackland's Laws: + 1. Never be first. + 2. Never be last. + 3. Never volunteer for anything. +%% +La-dee-dee, la-dee-dah. +%% +Ladies and Gentlemen, Hobos and Tramps, +Cross-eyed mosquitos and bowlegged ants, +I come before you to stand behind you +To tell you of something I know nothing about. +Next Thursday (which is good Friday), +There will be a convention held in the +Women's Club which is strictly for Men. +Admission is free, pay at the door, +Pull up a chair, and sit on the floor. +It was a summer's day in winter, +And the snow was raining fast, +As a barefoot boy with shoes on, +Stood sitting in the grass. +Oh, that bright day in the dead of night, +Two dead men got up to fight. +Three blind men to see fair play, +Forty mutes to yell "Hooray"! +Back to back, they faced each other, +Drew their swords and shot each other. +A deaf policeman heard the noise, +Came and arrested those two dead boys. +%% +Lady Astor: "If you were my husband, I'd poison your coffee." +Winston Churchill: "If you were my wife, I'd drink it." +%% +Lady Luck brings added income today. +Lady friend takes it away tonight. +%% +Laetrile is the pits. +%% +Laissez Faire Economics is the theory that if +each acts like a vulture, all will end as doves. +%% +Lake Erie died for your sins. +%% +Lamonte Cranston once hired a new Chinese manservant. While describing his +duties to the new man, Lamonte pointed to a bowl of candy on the coffee +table and warned him that he was not to take any. Some days later, the new +manservant was cleaning up, with no one at home, and decided to sample some +of the candy. Just than, Cranston walked in, spied the manservant at the +candy, and said: + "Pardon me Choy, is that the Shadow's nugate you chew?" +%% +Larkinson's Law: + All laws are basically false. +%% +Last night I met upon the stair +a little man who wasn't there. +He wasn't there again today. +Gee how I wish he'd go away! +%% +Last week I saw a girl in a sweater so tight I could hardly breathe. +%% +Last week's pet, this week's special. +%% +Laugh, and the world ignores you. Crying doesn't help either. +%% +Laugh and the world thinks you're an idiot. +%% +Laugh at your problems: everybody else does. +%% +Laugh when you can; cry when you must. +%% +Laura's Law: + No child throws up in the bathroom. +%% +Lavish spending can be disastrous. +Don't buy any lavishes for a while. +%% +Law enforcement officers should use only the minimum +force necessary in dealing with disorders when they arise. + -- Richard M. Nixon +%% +Law of Communications: + The inevitable result of improved and enlarged communications + between different levels in a hierarchy is a vastly increased + area of misunderstanding. +%% +Law of Continuity: + Experiments should be reproducible. + They should all fail the same way. +%% +Law of Probable Dispersal: + Whatever it is that hits the fan will not be evenly distributed. +%% +Law of Procrastination: + Procrastination avoids boredom; one never has + the feeling that there is nothing important to do. +%% +Law of Selective Gravity: + An object will fall so as to do the most damage. + +Jenning's Corollary: + The chance of the bread falling with the buttered side + down is directly proportional to the cost of the carpet. + +Law of the Perversity of Nature: + You cannot determine beforehand which side of the bread to butter. +%% +Law stands mute in the midst of arms. + -- Marcus Tullius Cicero +%% +Lawful Dungeon Master -- and they're MY laws! +%% +Lawrence Radiation Laboratory keeps all its data in an old gray trunk. +%% +Laws of Computer Programming: + 1. Any given program, when running, is obsolete. + 2. Any given program costs more and takes longer. + 3. If a program is useful, it will have to be changed. + 4. If a program is useless, it will have to be documented. + 5. Any given program will expand to fill all available memory. + 6. The value of a program is proportional the weight of its output. + 7. Program complexity grows until it exceeds the capability of + the programmer who must maintain it. +%% +LAWSUIT: + A machine which you go into as a pig and come out as a sausage. + -- Ambrose Bierce +%% +Lay on, MacDuff, and curs'd be him who first cries, "Hold, enough!". + -- Shakespeare +%% +Lays eggs inside a paper bag; +The reason, you will see, no doubt, +Is to keep the lightning out. +But what these unobservant birds +Have failed to notice is that herds +Of bears may come with buns +And steal the bags to hold the crumbs. +%% +Lazlo's Chinese Relativity Axiom: + No matter how great your triumphs or how tragic your defeats -- + approximately one billion Chinese couldn't care less. +%% +Leadership involves finding a parade and getting in front of it; what +is happening in America is that those parades are getting smaller and +smaller -- and there are many more of them. + -- John Naisbitt, "Megatrends" +%% +Learn from other people's mistakes, you don't have time to make your own. +%% +Learn to pause -- or nothing worthwhile can catch up to you. +%% +Learned men are the cisterns of knowledge, not the fountainheads. +%% +Learning at some schools is like drinking from a firehose. +%% +Learning without thought is labor lost; +thought without learning is perilous. + -- Confucius +%% +Leave no stone unturned. + -- Euripides +%% +Lee's Law: + Mother said there would be days like this, + but she never said that there'd be so many! +%% +Left to themselves, things tend to go from bad to worse. +%% +Leibowitz's Rule: + When hammering a nail, you will never hit your + finger if you hold the hammer with both hands. +%% +Lend money to a bad debtor and he will hate you. +%% +Lensmen eat Jedi for breakfast. +%% + Leslie West heads for the sticks, to Providence, Rhode Island and +tries to hide behind a beard. No good. There are still too many people +and too many stares, always taunting, always smirking. He moves to the +outskirts of town. He finds a place to live -- huge mansion, dirt cheap, +caretaker included. He plugs in his guitar and plays as loud as he wants, +day and night, and there's no one to laugh or boo or even look bored. + Nobody's cut the grass in months. What's happened to that caretaker? +What neighborhood people there are start to talk, and what kids there are +start to get curious. A 13 year-old blond with an angelic face misses supper. +Before the summer's end, four more teenagers have disappeared. The senior +class president, Barnard-bound come autumn, tells Mom she's going out to a +movie one night and stays out. The town's up in arms, but just before the +police take action, the kids turn up. They've found a purpose. They go +home for their stuff and tell the folks not to worry but they'll be going +now. They're in a band. + -- Ira Kaplan +%% +Let a fool hold his tongue and he will pass for a sage. + -- Publilius Syrus +%% +Let he who takes the plunge remember to return it by Tuesday. +%% +Let him choose out of my files, his projects to accomplish. + -- Shakespeare, "Coriolanus" +%% +Let me take you a button-hole lower. + -- William Shakespeare, "Love's Labour's Lost" +%% +Let no guilty man escape. + -- U.S. Grant +%% +Let not the sands of time get in your lunch. +%% +Let sleeping dogs lie. + -- Charles Dickens +%% +Let the machine do the dirty work. + -- "Elements of Programming Style", Kernighan and Ritchie +%% +Let the worthy citizens of Chicago get their liquor the best way +they can. I'm sick of the job. It's a thankless one and full of grief. + -- Capone +%% +Let us go, through certain half-deserted streets, +The muttering retreats +Of restless nights in one-night cheap hotels +And sawdust restaurants with oyster-shells: +Streets that follow like a tedious argument +Of insidious intent +To lead you to an overwhelming question... +Oh, do not ask, "What is it?" + -- T.S. Eliot, "Love song of J. Alfred Prufrock" +%% +Let us never negotiate out of fear, +but let us never fear to negotiate. + -- John F. Kennedy +%% +Let us not look back in anger or forward +in fear, but around us in awareness. + -- James Thurber +%% +Let us remember that ours is a nation of lawyers and order. +%% +Let us treat men and women well; +Treat them as if they were real; +Perhaps they are. + -- Ralph Waldo Emerson +%% +Let your conscience be your guide. + -- Pope +%% +Let's just be friends and make no special +effort to ever see each other again. +%% +Let's not complicate our relationship +by trying to communicate with each other. +%% +Let's organize this thing and take all the fun out of it. +%% +Leveraging always beats prototyping. +%% +Lewis's Law of Travel: + The first piece of luggage out of the + chute doesn't belong to anyone, ever. +%% +Liberals are the first to dump you if you con them or get into +trouble. Conservatives are better. They never run out on you. + -- Joseph "Crazy Joe" Gallo +%% +Lieberman's Law: + Everybody lies, but it doesn't matter since nobody listens. +%% +Lies! All lies! You're all lying against my boys! + -- Ma Barker +%% +Life -- Love It or Leave It. +%% +Life Sucks. Cynical, misanthropic male, 34, looking for soul mate but +certain not to find her. Drop me a note. I'll call you, we'll talk and +I'll ask you out to dinner where I'll probably spend more than I can +afford in a feeble attempt to impress you. Then we'll realize we have +absolutely nothing in common and we'll go our separate ways, more +embittered and depressed than before (if such a thing is possible). +%% +Life begins at the centerfold and expands outward. + -- Miss November, 1966 +%% +Life can be so tragic -- you're here today and here tomorrow. +%% +Life exists for no known purpose. +%% +Life is a game. In order to have a game, something has to be more +important than something else. If what already is, is more important +than what isn't, the game is over. So, life is a game in which what +isn't, is more important than what is. Let the good times roll. + -- Werner Erhard +%% +Life is a game of bridge -- and you've just been finessed. +%% +Life is a hospital in which every patient +is possessed by the desire to change his bed. +%% +Life is a series of rude awakenings. + -- R.V. Winkle +%% +Life is a serious burden, which no thinking, +humane person would wantonly inflict on someone else. + -- Clarence Darrow +%% +Life is a yo-yo, and mankind ties knots in the string. +%% +Life is an exciting business, and most +exciting when it is lived for others. +%% +Life is both difficult and time consuming. +%% +Life is difficult because it is non-linear. +%% +Life is fraught with opportunities to keep your mouth shut. +%% +Life is just a bowl of cherries, but why do I always get the pits? +%% +Life is like a 10 speed bicycle. Most of us have gears we never use. + -- C. Schultz +%% +Life is like a diaper - short and loaded. +%% +Life is like a sewer. +What you get out of it depends on what you put into it. + -- Tom Lehrer +%% +Life is like a tin of sardines. +We're, all of us, looking for the key. + -- Beyond the Fringe +%% +Life is like an egg stain on your chin -- +you can lick it, but it still won't go away. +%% +Life is like an onion: you peel it off +one layer at a time, and sometimes you weep. + -- Carl Sandburg +%% +Life is like an onion: you peel off layer after +layer, then you find there is nothing in it. +%% +Life is like bein' on a mule team. Unless you're +the lead mule, all the scenery looks about the same. +%% +Life is not for everyone. +%% +Life is one long struggle in the dark. + -- Titus Lucretius Carus +%% +Life is the childhood of our immortality. + -- Goethe +%% +Life is the living you do, +Death is the living you don't do. + -- Joseph Pintauro +%% +Life is the urge to ecstasy. +%% +Life is to you a dashing and bold adventure. +%% +Life is too short to be taken seriously. + -- O. Wilde +%% +Life is wasted on the living. + -- The Restaurant at the Edge of the Universe. +%% +Life may have no meaning, or, even worse, +it may have a meaning of which you disapprove. +%% +Life only demands from you the strength you possess. +Only one feat is possible -- not to have run away. + -- Dag Hammarskjold +%% +Life without caffeine is stimulating enough. + -- Sanka Ad +%% +Life would be tolerable but for its amusements. + -- G.B. Shaw +%% +Lift every voice and sing +Till earth and heaven ring, +Ring with the harmonies of Liberty; +Let our rejoicing rise +High as the listening skies, +Let it resound loud as the rolling sea. + +Sing a song full of the faith that the dark past has taught us. +Sing a song full of the hope that the present has bought us. +Facing the rising sun of our new day begun, +Let us march on till victory is won. + -- James Weldon Johnson +%% +Lighten up, while you still can, +Don't even try to understand, +Just find a place to make your stand, +And take it easy. + -- The Eagles, "Take It Easy" +%% +Like all young men, you greatly exaggerate +the difference between one young woman and another. + -- George Bernard Shaw, "Major Barbara" +%% +Like corn in a field I cut you down, +I threw the last punch way too hard, +After years of going steady, well, I thought it was time, +To throw in my hand for a new set of cards. +And I can't take you dancing out on the weekend, +I figured we'd painted too much of this town, +And I tried not to look as I walked to my wagon, +And I knew then I had lost what should have been found, +I knew then I had lost what should have been found. + And I feel like a bullet in the gun of Robert Ford + I'm as low as a paid assassin is + You know I'm cold as a hired sword. + I'm so ashamed we can't patch it up, + You know I can't think straight no more + You make me feel like a bullet, honey, + a bullet in the gun of Robert Ford. + -- Elton John "I Feel Like a Bullet" +%% +Like punning, programming is a play on words. +%% +Like so many Americans, she was trying to construct +a life that made sense from things she found in gift shops. + -- Kurt Vonnegut, Jr. +%% +Like the ski resort of girls looking for husbands and husbands +looking for girls, the situation is not as symmetrical as it might seem. + -- Alan McKay +%% +Like the time I ran away... +And turned around and you were standing close to me. + -- YES, "Going For The One/Awaken" +%% +Like winter snow on summer lawn, time past is time gone. +%% +Limericks are art forms complex, +Their topics run chiefly to sex. + They usually have virgins, + And masculine urgin's, +And other erotic effects. +%% +"Lines that are parallel meet at Infinity!" +Euclid repeatedly, heatedly, urged. + +Until he died, and so reached that vicinity: +in it he found that the damned things diverged. + -- Piet Hein +%% +Linus' Law: + There is no heavier burden than a great potential. +%% +Linus: Hi! I thought it was you. + I've been watching you from way off... You're looking great! +Snoopy: That's nice to know. + The secret of life is to look good at a distance. +%% +Linus: I guess it's wrong always to be worrying about tomorrow. + Maybe we should think only about today. +Charlie Brown: + No, that's giving up. I'm still hoping that yesterday + will get better. +%% +Lions in the street and roaming, +Dogs in heat, rabid, foaming, +A beast caged in the heart of the city. +The body of his mother lying in the summer ground, +He fled the town. +Went down south across the border, +Left the chaos and disorder +Back there, over his shoulder. +One morning he awoke in a green hotel, +A strange creature groaning beside him. +Sweat oozed from its shiny skin. +Is everybody in? The ceremony is about to begin. + -- Jim Morrison, "Celebration of the Lizard" +%% +Lisp, Lisp, Lisp Machine, +Lisp Machine is Fun. +Lisp, Lisp, Lisp Machine, +Fun for everyone. +%% +Lisp Users: +Due to the holiday next Monday, there will be no garbage collection. +%% +Lisp programmers do it deeper and deeper and deeper. +%% + Listen, Tyrone, you don't know how dangerous that stuff is. +Suppose someday you just plug in and go away and never come back? Eh? + Ho, ho! Don't I wish! What do you think every electrofreak +dreams about? You're such an old fuddyduddy! A-and who sez it's a +dream, huh? M-maybe it exists. Maybe there is a Machine to take us +away, take us completely, suck us out through the electrodes out of +the skull 'n' into the Machine and live there forever with all the +other souls it's got stored there. It could decide who it would suck +out, a-and when. Dope never gave you immortality. You hadda come +back, every time, into a dying hunk of smelly meat! But We can live +forever, in a clean, honest, purified, Electroworld. + -- Thomas Pynchon, "Gravity's Rainbow" +%% +Littering is dumb. + -- Ronald Macdonald +%% +Little Mary on the ice, +Went out to have a frisk, +Now wasn't little Mary nice, +Her pretty *? +%% +Little girls, like butterflies, need no excuse. + -- Lazarus Long +%% +Live fast, die young, and leave a good looking corpse. + -- James Dean +%% +Live from New York ... It's Saturday Night! +%% +Live in a world of your own, but always welcome visitors. +%% +Live never to be ashamed if anything you do or say is +published around the world -- even if what is published is not true. + -- Messiah's Handbook : Reminders for the Advanced Soul +%% +Living in Hollywood is like living in a bowl of granola. +What ain't fruits and nuts is flakes. +%% +Living in New York City gives people real incentives +to want things that nobody else wants. + -- Andy Warhol +%% +Living in the complex world of the future is somewhat +like having bees live in your head. But, there they are. +%% +Living on Earth may be expensive, but it +includes an annual free trip around the Sun. +%% +Lizzie Borden took an axe, +And plunged it deep into the VAX; +Don't you envy people who +Do all the things YOU want to do? +%% +Lo! Men have become the tool of their tools. + -- Henry David Thoreau +%% +Lockwood's Long Shot: + The chances of getting eaten up by a lion on Main Street + aren't one in a million, but once would be enough. +%% +Logic doesn't apply to the real world. + -- Marvin Minsky +%% +Logic is a little bird, sitting in a tree, that smells AWFUL. +%% +Logic is a pretty flower that smells bad. +%% +Logic is a systematic method of coming +to the wrong conclusion with confidence. +%% +Logic is the chastity belt of the mind! +%% +Loneliness is a terrible price to pay for independence. +%% +Lonely is a man without love. + -- Englebert Humperdinck +%% +Lonely men seek companionship. +Lonely women sit at home and wait. They never meet. +%% +Lonesome? + +Like a change? +Like a new job? +Like excitement? +Like to meet new and interesting people? + +JUST SCREW-UP ONE MORE TIME!!!!!!! +%% +Long ago I proposed that unsuccessful candidates for the Presidency +be quietly hanged, as a matter of public sanitation and decorum. +The sight of their grief must have a very evil effect upon the young. + -- H.L. Mencken, "A Carnival of Buncombe" +%% + Long ago, in a finite state far away, there lived a JOVIAL +character named Jack. Jack and his relations were poor. Often their +hash table was bare. One day Jack's parent said to him, "Our matrices +are sparse. You must go to the market to exchange our RAM for some +BASICs." She compiled a linked list of items to retrieve and passed it +to him. + So Jack set out. But as he was walking along a Hamilton path, +he met the traveling salesman. + "Whither dost thy flow chart take thou?" prompted the salesman +in high-level language. + "I'm going to the market to exchange this RAM for some chips +and Apples," commented Jack. + "I have a much better algorithm. You needn't join a queue +there; I will swap your RAM for these magic kernels now." + Jack made the trade, then backtracked to his house. But when +he told his busy-waiting parent of the deal, she became so angry she +started thrashing. + "Don't you even have any artificial intelligence? All these +kernels together hardly make up one byte," and she popped them out the +window... + -- Mark Isaak, "Jack and the Beanstack" +%% +Long computations which yield zero are probably all for naught. +%% +Long life is in store for you. +%% +Long were the days of pain I have spent within its walls, and +long were the nights of aloneness; and who can depart from his +pain and his aloneness without regret? + -- Kahlil Gibran, "The Prophet" +%% +Look! Before our very eyes, the future is becoming the past. +%% +Look afar and see the end from the beginning. +%% +Look at it this way: +Your daughter just named the fresh turkey you brought +home "Cuddles", so you're going out to buy a canned ham. +And you're still drinking ordinary scotch? +%% +Look at it this way: +Your wife's spending $280 a month on meditation lessons to +forget $26,000 of college education. +And you're still drinking ordinary scotch? +%% +Look before you leap. + -- Samuel Butler +%% +Look ere ye leap. + -- John Heywood +%% +Look out! Behind you! +%% +Lookie, lookie, here comes cookie... + -- Stephen Sondheim +%% +Loose bits sink chips. +%% +Lord, what fools these mortals be! + -- William Shakespeare, "A Midsummer-Night's Dream" +%% +Losing your drivers' license is just +God's way of saying "BOOGA, BOOGA!" +%% +Lost: gray and white female cat. +Answers to electric can opener. +%% +Lots of folks confuse bad management with destiny. + -- Frank Hubbard +%% +Lots of girls can be had for a song. +Unfortunately, it often turns out to be the wedding march. +%% +Love America - or give it back. +%% +Love IS what it's cracked up to be. +%% +Love and scandal are the best sweeteners of tea. +%% +Love at first sight is one of the greatest +labor-saving devices the world has ever seen. +%% +Love conquers all things; let us too surrender to love. + -- Publius Vergilius Maro (Virgil) +%% +Love in your heart wasn't put there to stay. +Love isn't love 'til you give it away. + -- Oscar Hammerstein II +%% +Love is a grave mental disease. + -- Plato +%% +Love is a word that is constantly heard, +Hate is a word that is not. +Love, I am told, is more precious than gold. +Love, I have read, is hot. +But hate is the verb that to me is superb, +And Love but a drug on the mart. +Any kiddie in school can love like a fool, +But Hating, my boy, is an Art. + -- Ogden Nash +%% +Love is always open arms. With arms open you allow love to come and +go as it wills, freely, for it will do so anyway. I you close your +arms about love you'll find you are left only holding yourself. +%% +Love is in the offing. Be affectionate to one who adores you. +%% +Love is in the offing. + -- The Homicidal Maniac +%% +Love is like a friendship caught on fire. In the beginning a flame, very +pretty, often hot and fierce, but still only light and flickering. As love +grows older, our hearts mature and our love becomes as coals, deep-burning +and unquenchable. + -- Bruce Lee +%% +Love is never asking why? +%% +Love is not enough, but it sure helps. +%% +Love is sentimental measles. +%% +Love is the process of my leading you gently back to yourself. + -- Saint Exupery +%% +Love is the triumph of imagination over intelligence. + -- H.L. Mencken +%% +Love means never having to say you're sorry. + -- Eric Segal, "Love Story" +%% +Love means nothing to a tennis player. +%% +Love the sea? I dote upon it -- from the beach. +%% +Love to eat them mousies, +Mousies what I love to eat. +Bite they little heads off, +Nibble on they tiny feet. + -- Kliban +%% +Love your enemies: they'll go crazy +trying to figure out what you're up to. +%% +Lowery's Law: + If it jams -- force it. If it + breaks, it needed replacing anyway. +%% +Lubarsky's Law of Cybernetic Entomology: + There's always one more bug. +%% +Luck, that's when preparation and opportunity meet. + -- P.E. Trudeau +%% +Lucky is he for whom the belle toils. +%% +Lucy: Dance, dance, dance. That is all you ever do. + Can't you be serious for once? +Snoopy: She is right! I think I had better think + of the more important things in life! + (pause) + Tomorrow!! +%% +Lysistrata had a good idea. +%% +MAC user's dynamic debugging list evaluator? Never heard of that. +%% +MAD: + Affected with a high degree of intellectual independence. +%% +MAGPIE: + A bird whose thievish disposition suggested + to someone that it might be taught to talk. + -- A. Bierce +%% +MAIDEN AUNT: + A girl who never had the sense to say "uncle." +%% +MAJORITY: + That quality that distinguishes a crime from a law. +%% +MALPRACTICE: + The reason surgeons wear masks. +%% +MANAGEMENT: + The art of getting other people to do all the work. +%% +MANAGER: + A man known for giving great meeting. +%% +MAN: + An animal so lost in rapturous contemplation of what he thinks he + is as to overlook what he indubitably ought to be. His chief + occupation is extermination of other animals and his own species, + which, however, multiplies with such insistent rapidity as to infest + the whole habitable earth and Canada. + -- A. Bierce +%% +MANIC-DEPRESSIVE: + Easy glum, easy glow. +%% +MARRIAGE: + An old, established institution, entered into by two people deeply + in love and desiring to make a committment to each other expressing + that love. In short, committment to an institution. +%% +MARRIAGE: + Convertible bonds. +%% +MEETINGS: + A place where minutes are kept and hours are lost. +%% +MEMO: + An interoffice communication too often written more for + the benefit of the person who sends it than the person + who receives it. +%% +MENU: + A list of dishes which the restaurant has just run out of. +%% +METEOROLOGIST: + One who doubts the established fact that it is + bound to rain if you forget your umbrella. +%% +MICRO: + Thinker toys. +%% +MIPS: + Meaningless Indicator of Processor Speed +%% +MISFORTUNE: + The kind of fortune that never misses. +%% +MISS: + A title with which we brand unmarried + women to indicate that they are in the market. +%% +MIXED EMOTIONS: + Watching your mother-in-law back off + a cliff in your brand new Mercedes. +%% +MIXED EMOTIONS: + Watching a bus-load of lawyers plunge + off a cliff. With five empty seats. +%% +MOCK APPLE PIE (No Apples Needed) + + Pastry to two crust 9-inch pie 36 RITZ Crackers +2 cups water 2 cups sugar +2 teaspoons cream of tartar 2 tablespoons lemon juice + Grated rind of one lemon Butter or margarine + Cinnamon + +Roll out bottom crust of pastry and fit into 9-inch pie plate. Break +RITZ Crackers coarsley into pastry-lined plate. Combine water, sugar +and cream of tartar in saucepan, boil gently for 15 minutes. Add lemon +juice and rind. Cool. Pour this syrup over Crackers, dot generously +with butter or margarine and sprinkle with cinnamon. Cover with top +crust. Trim and flute edges together. Cut slits in top crust to let +steam escape. Bake in a hot oven (425 F) 30 to 35 minutes, until crust +is crisp and golden. Serve warm. Cut into 6 to 8 slices. + -- Found lurking on a Ritz Crackers box +%% +MODESTY: + Being comfortable that others will discover your greatness. +%% +MODESTY: + The gentle art of enhancing your charm + by pretending not to be aware of it. +%% +MOLECULE: + The ultimate, indivisible unit of matter. It is distinguished from + the corpuscle, also the ultimate, indivisible unit of matter, by a + closer resemblance to the atom, also the ultimate, indivisible unit + of matter... The ion differs from the molecule, the corpuscle and + the atom in that it is an ion... +%% +MOMENTUM: + What you give a person when they are going away. +%% +MONDAY: + In Christian countries, the day after the football game. + -- Ambrose Bierce +%% +MONOTONY: + Marriage to one woman at a time. +%% +MONTANA: + A grizzly bear praying for the early arrival of cable television. +%% +MOPHOBIA: + Fear of being verbally abused by a Mississippian. +%% +MORE SPORTS RESULTS: +The Beverly Hills Freudians tied the Chicago Rogerians 0-0 last Saturday +night. The match started with a long period of silence while the Freudians +waited for the Rogerians to free associate and the Rogerians waited for +the Freudians to say something they could paraphrase. The stalemate was +broken when the Freudians' best player took the offensive and interpreted +the Rogerians' silence as reflecting their anal-retentive personalities. +At this the Rogerians' star player said "I hear you saying you think we're +full of ka-ka." This started a fight and the match was called by officials. +%% +MOSQUITO: + The state bird of New Jersey. +%% +MOTHER: + Half a word. +%% +MOUNT TAPE U1439 ON B3, NO RING +%% + MOUNTIES: +I'm a lumberjack and I'm OK, He's a lumberjack and he's OK, +I sleep all night and I work all day. He sleeps all night and he works + all day. + +I cut down trees, I eat my lunch, He cuts down trees, he eats his lunch, +I go to the lavatory. He goes to the lavatory. +On Wednesday I go shopping, On Wednesday he goes shopping, +And have buttered scones for tea. And has buttered scones for tea. + +I cut down trees, I skip and jump, He cuts down trees, he skips and jumps, +I like to press wild flowers, He likes to press wild flowers. +I put on women's clothing, He puts on women's clothing, +And hang around in bars. And hangs around in bars. + +I cut down trees, I wear high heels, He cuts down trees, he wears high heels, +Suspenders and a bra. Suspenders? and a bra? +I wish I'd been a girlie, That's rude... +Just like my dear Pappa. +%% +MUMMY: + An Egyptian who was pressed for time. +%% +MYTHOLOGY: + The body of a primitive people's beliefs concerning its origin, + early history, heroes, deities and so forth, as distinguished + from the true accounts which it invents later. +%% +Machines have less problems. I'd like to be a machine. + -- Andy Warhol +%% +Madam, there's no such thing as a tough child -- +if you parboil them first for seven hours, they always come out tender. + -- W.C. Fields +%% +Madison's Inquiry: + If you have to travel on the Titanic, why not go first class? +%% +Madness takes its toll. +%% +Magary's Principle: + When there is a public outcry to cut deadwood and fat from any + government bureaucracy, it is the deadwood and the fat that do + the cutting, and the public's services are cut. +%% +Magic is always the best solution -- especially reliable magic. +%% +Magnet, n.: Something acted upon by magnetism. + +Magnetism, n.: Something acting upon a magnet. + +The two preceding definitions are condensed from the works of one +thousand eminent scientists, who have illuminated the subject with a +great white light, to the inexpressible advancement of human knowledge. +%% +Maiden, n. A young person of the unfair sex addicted to clewless conduct and +views that madden to crime. The genus has a wide geographical distribution, +being found wherever sought and deplored wherever found. The maiden is not +altogether unpleasing to the eye, nor (without her piano and her views) +insupportable to the ear, though in respect to comeliness distinctly inferior +to the rainbow, and, with regard to the part of her that is audible, beaten +out of the field by the canary -- which, also, is more portable. + +Male, n. A member of the unconsidered, or negligible sex. The male of the +human race is commonly known (to the female) as Mere Man. The genus has two +varieties: good providers and bad providers. + -- Ambrose Bierce +%% +Maier's Law: + If the facts do not conform to the theory, they must be disposed of. + -- N. R. Maier, "American Psychologist", March 1960 + +Corollaries: + 1. The bigger the theory, the better. + 2. The experiment may be considered a success if no more than + 50% of the observed measurements must be discarded to + obtain a correspondence with the theory. +%% +Main's Law: + For every action there is an equal and opposite government program. +%% +Major premise: + Sixty men can do sixty times as much work as one man. +Minor premise: + A man can dig a posthole in sixty seconds. +Conclusion: + Sixty men can dig a posthole in one second. + +Secondary Conclusion: + Do you realize how many holes there would be if people + would just take the time to take the dirt out of them? +%% +Majorities, of course, start with minorities. + -- Robert Moses +%% +Make a wish, it might come true. +%% +Make headway at work. Continue to let things deteriorate at home. +%% +Make it right before you make it faster. +%% +Make no little plans; they have no magic to stir men's blood. + -- Daniel Hudson Burnham +%% +Make sure your code does nothing gracefully. +%% +Making files is easy under the UNIX operating system. Therefore, users +tend to create numerous files using large amounts of file space. It has +been said that the only standard thing about all UNIX systems is the +message-of-the-day telling users to clean up their files. + -- System V.2 administrator's guide +%% +Malek's Law: + Any simple idea will be worded in the most complicated way. +%% +Man and wife make one fool. +%% +Man belongs wherever he wants to go. + -- Wernher von Braun +%% +Man has always assumed that he is more intelligent than dolphins because +he has achieved so much -- the wheel, New York, wars and so on -- while +all the dolphins had ever done was muck about in the water having a good +time. But, conversely, the dolphins had always believed that they were +far more intelligent than man -- for precisely the same reasons. + -- D. Adams, "Hitchhiker's Guide to the Galaxy" +%% +Man has made his bedlam; let him lie in it. + -- Fred Allen +%% +Man has never reconciled himself to the ten commandments. +%% +Man is a military animal, +Glories in gunpowder, and loves parade. + -- P.J. Bailey +%% +Man is a rational animal who always loses his temper when he +is called upon to act in accordance with the dictates of reason. + -- Oscar Wilde +%% +Man is an animal that makes bargains: no other animal does this-- +no dog exchanges bones with another. + -- Adam Smith +%% +Man is by nature a political animal. + -- Aristotle +%% +Man is the best computer we can put aboard a spacecraft... +and the only one that can be mass produced with unskilled labor. + -- Wernher von Braun +%% +Man is the measure of all things. + -- Protagoras +%% +Man is the only animal that blushes -- or needs to. + -- Mark Twain +%% +Man is the only animal that laughs and weeps; +for he is the only animal that is struck with the +difference between what things are and what they ought to be. + -- William Hazlitt +%% +Man must shape his tools lest they shape him. + -- Arthur R. Miller +%% +Man proposes, God disposes. + -- Thomas a Kempis +%% +Man usually avoids attributing cleverness to somebody else -- +unless it is an enemy. + -- A. Einstein +%% +Man who arrives at party two hours late +will find he has been beaten to the punch. +%% +Man who falls in blast furnace is certain to feel overwrought. +%% +Man who falls in vat of molten optical glass makes spectacle of self. +%% +Man who sleep in beer keg wake up stickey. +%% +Man will never fly. +Space travel is merely a dream. +All aspirin is alike. +%% +Mankind is poised midway between the gods and the beasts. + -- Plotinus +%% +Man's horizons are bounded by his vision. +%% +Man's lust for a bust is hardly recent, +Some say not even indecent. +But if you lust, +It's a must! +%% +Man's reach must exceed his grasp, for why else the heavens? +%% +Man's unique agony as a species consists in his perpetual +conflict between the desire to stand out and the need to blend in. + -- Sydney J. Harris +%% +Many a bum show has been saved by the flag. + -- George M. Cohan +%% +Many a family tree needs trimming. +%% +Many a man that can't direct you to a corner drugstore will +get a respectful hearing when age has further impaired his mind. + -- Finley Peter Dunne +%% +Many a man who thinks he's going on a maiden voyage with +a woman finds out later that it was just a shake-down cruise. +%% +Many a writer seems to thing he is never profound +except when he can't understand his own meaning. + -- George D. Prentice +%% +Many are called, few are chosen. +Fewer still get to do the choosing. +%% +Many are called, few volunteer. +%% +Many are cold, but few are frozen. +%% +Many changes of mind and mood; do not hesitate too long. +%% +Many hands make light work. + -- John Heywood +%% +Many mental processes admit of being roughly measured. For instance, +the degree to which people are bored, by counting the number of their +fidgets. I not infrequently tried this method at the meetings of the +Royal Geographical Society, for even there dull memoirs are occasionally +read. [...] The use of a watch attracts attention, so I reckon time +by the number of my breathings, of which there are 15 in a minute. They +are not counted mentally, but are punctuated by pressing with 15 fingers +successively. The counting is reserved for the fidgets. These observations +should be confined to persons of middle age. Children are rarely still, +while elderly philosophers will sometimes remain rigid for minutes altogether. + -- Francis Galton, 1909 +%% +Many of the convicted thieves Parker has met began their +life of crime after taking college Computer Science courses. + -- Roger Rapoport, "Programs for Plunder", Omni, March 1981 +%% +Many pages make a thick book. +%% +Many pages make a thick book, except for +pocket bibles which are on very thin paper. +%% +Many people are desperately looking for some wise advice +which will recommend that they do what they want to do. +%% +Many people are secretly interested in life. +%% +Many people are unenthusiastic about their work. +%% +Many people are unenthusiastic about your work. +%% +Many people feel that if you won't let +them make you happy, they'll make you suffer. +%% +Many people feel that they deserve some kind of +recognition for all the bad things they haven't done. +%% +Many people resent being treated like the person they really are. +%% +Many people write memos to tell you they have nothing to say. +%% +Many receive advice, few profit by it. + -- Publilius Syrus +%% +Many years ago in a period commonly know as Next Friday Afternoon, +there lived a King who was very Gloomy on Tuesday mornings because he +was so Sad thinking about how Unhappy he had been on Monday and how +completely Mournful he would be on Wednesday.... + -- Walt Kelly +%% +Margaret, are you grieving +Over Goldengrove unleaving? +Leaves, like the things of man, +You, with your fresh thoughts +Care for, can you? +Ah! as the heart grows older +It will come to such sights colder +By and by, nor spare a sigh +Though worlds of wanwood leafmeal lie +And yet you will weep and know why. +Now no matter, child, the name +Sorrow's springs are the same: +It is the blight man was born for, +It is Margaret you mourn for. + -- Gerard Manley Hopkins. +%% +Marijuana is like Coors beer. If you could buy the damn stuff +at a Georgia filling station, you'd decide you wouldn't want it. + -- Billy Carter +%% +Marijuana will be legal some day, because the many law students +who now smoke pot will someday become congressmen and legalize +it in order to protect themselves. + -- Lenny Bruce +%% +Mark's Dental-Chair Discovery: + Dentists are incapable of asking questions + that require a simple yes or no answer. +%% +Marriage is a three ring circus: +engagement ring, wedding ring, and suffering. + -- Roger Price +%% +Marriage is an institution in which two undertake +to become one, and one undertakes to become nothing. +%% +Marriage is the only adventure open to the cowardly. + -- Voltaire +%% +Marriage is the process of finding out what +kind of man your wife would have preferred. +%% +Marriage is the waste-paper basket of the emotions. +%% +Marriages are made in heaven and consummated on earth. + -- John Lyly +%% +Marvin the Nature Lover spied a grasshopper hopping along in the grass, +and in a mood for communing with nature, rare even among full-fledged +Nature Lovers, he spoke to the grasshopper, saying: "Hello, friend +grasshopper. Did you know they've named a drink after you?" + "Really?" replied the grasshopper, obviously pleased. "They've +named a drink Fred?" +%% +Mary had a little lamb, +The lamb turned out to be a ram, +Now Mary has a little lamb. +%% +Maryann's Law: + You can always find what you're not looking for. +%% +Maslow's Maxim: + If the only tool you have is a hammer, + you treat everything like a nail. +%% +Massachusetts has the best politicians money can buy. +%% +Mate, this parrot wouldn't VOOM if you put four million volts through it! + -- Monty Python +%% +Mater artium necessitas. + [Necessity is the mother of invention]. +%% +Mathematicians practice absolute freedom. + -- Henry Adams +%% +Mathematicians take it to the limit. +%% +Mathematics deals exclusively with the relations of concepts +to each other without consideration of their relation to experience. + -- Albert Einstein +%% +Matrimony is the root of all evil. +%% +Matrimony isn't a word, it's a sentence. +%% +Matter cannot be created or destroyed, +nor can it be returned without a receipt. +%% +Matter will be damaged in direct proportion to its value. +%% +[Maturity consists in the discovery that] there comes a critical moment +where everything is reversed, after which the point becomes to understand +more and more that there is something which cannot be understood. + -- S. Kierkegaard +%% +Maturity is only a short break in adolescence. + -- Jules Feiffer +%% +Matz's Law: + A conclusion is the place where you got tired of thinking. +%% +May a Misguided Platypus lay its Eggs in your Jockey Shorts +%% +May all your PUSHes be POPped. +%% +May the Fleas of a Thousand Camels infest one of your Erogenous Zones. +%% +May the bluebird of happiness twiddle your bits. +%% +May the fleas of a thousand camels infest your armpits. +%% +May you die in bed at 95, shot by a jealous spouse. +%% +May you live in uninteresting times. + -- Chinese proverb +%% +May your Tongue stick to the Roof of your +Mouth with the Force of a Thousand Caramels. +%% +Maybe Computer Science should be in the College of Theology. + -- R.S. Barton +%% +Maybe Jesus was right when he said that the meek shall inherit the +earth -- but they inherit very small plots, about six feet by three. + -- Lazarus Long +%% +Maybe ain't ain't so correct, but I notice that +lots of folks who ain't using ain't ain't eatin' well. + -- Will Rogers +%% +Maybe you can't buy happiness, but +these days you can certainly charge it. +%% +May's Law: + The quality of correlation is inversly proportional to the density + of control. (The fewer the data points, the smoother the curves.) +%% +McDonald's -- Because you're worth it. +%% +McEwan's Rule of Relative Importance: + When traveling with a herd of elephants, + don't be the first to lie down and rest. +%% +McGowan's Madison Avenue Axiom: + If an item is advertised as "under $50", + you can bet your ass it's not $19.95. +%% +Meader's Law: + Whatever happens to you, it will previously + have happened to everyone you know, only more so. +%% +Measure twice, cut once. +%% +Measure with a micrometer. Mark with chalk. Cut with an axe. +%% +Meekness is uncommon patience in planning a worthwhile revenge. +%% +Meester, do you vant to buy a duck? +%% +Memory fault -- brain fried +%% +Memory fault -- core...uh...um...core... Oh dammit, I forget! +%% +Memory fault - where am I? +%% +Memory should be the starting point of the present. +%% +Men are always ready to respect anything that bores them. + -- Marilyn Monroe +%% +Men aren't attracted to me by my mind. +They're attracted by what I don't mind... + -- Gypsy Rose Lee +%% +Men freely believe that what they wish to desire. + -- Julius Caesar +%% +Men have a much better time of it than women; for one +thing, they marry later; for another thing, they die earlier. + -- H.L. Mencken +%% +Men have as exaggerated an idea of their +rights as women have of their wrongs. + -- E.W. Howe +%% +Men have many faults, + Women only two: +Everything they say, + And everything they do! +%% +Men live for three things, fast cars, fast women and fast food. +%% +Men love to wonder, and that is the seed of science. +%% +Men never make passes at girls wearing glasses. + -- Dorothy Parker +%% +Men occasionally stumble over the truth, but most of them +pick themselves up and hurry off as if nothing had happened. + -- Winston Churchill +%% +Men of quality are not afraid of women for equality. +%% +Men often believe -- or pretend -- that the "Law" is something sacred, or +at least a science -- an unfounded assumption very convenient to governments. +%% +Men say of women what pleases them; women do with men what pleases them. + -- DeSegur +%% +Men seldom show dimples to girls who have pimples. +%% +Men still remember the first kiss after women have forgotten the last. +%% +Men take only their needs into consideration -- never their abilities. + -- Napoleon Bonaparte +%% +Men use thought only to justify their wrong doings, +and speech only to conceal their thoughts. + -- Voltaire +%% +Men were real men, women were real women, and small, furry creatures +from Alpha Centauri were REAL small, furry creatures from Alpha Centauri. +Spirits were brave, men boldly split infinitives that no man had split +before. Thus was the Empire forged. + -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy" +%% +Mencken and Nathan's Second Law of The Average American: + All the postmasters in small towns read all the postcards. + +Mencken and Nathan's Ninth Law of The Average American: + The quality of a champagne is judged by the + amount of noise the cork makes when it is popped. + +Mencken and Nathan's Fifteenth Law of The Average American: + The worst actress in the company is always the manager's wife. + +Mencken and Nathan's Sixteenth Law of The Average American: + Milking a cow is an operation demanding a special talent that + is possessed only by yokels, and no person born in a large city + can ever hope to acquire it. +%% +Mene, mene, tekel, upharsen. +%% +Mental power tended to corrupt, and absolute intelligence tended to +corrupt absolutely, until the victim eschewed violence entirely in +favor of smart solutions to stupid problems. + -- Piers Anthony +%% +Mental things which have not gone in through the +senses are vain and bring forth no truth except detrimental. + -- Leonardo +%% +Meskimen's Law: + There's never time to do it right, but there's always time to + do it over. +%% +Message from Our Sponsor on ttyTV at 13:58 ... +%% +Message will arrive in the mail. +Destroy, before the FBI sees it. +%% +Mickey Mouse wears a Spiro Agnew watch. +%% +Microbiology Lab: Staph Only! +%% +Microwaves frizz your heir. +%% +Mieux vaut tard que jamais! +%% +Might as well be frank, monsieur. It would take a miracle to +get you out of Casablanca and the Germans have outlawed miracles. + -- Casablanca +%% +Miksch's Law: + If a string has one end, then it has another end. +%% +Military intelligence is a contradiction in terms. + -- Groucho Marx +%% +Military justice is to justice what military music is to music. + -- Groucho Marx +%% +Miller's Slogan: + Lose a few, lose a few. +%% +Millions long for immortality who do not know what +to do with themselves on a rainy Sunday afternoon. + -- Susan Ertz +%% +Millions of sensible people are too high-minded to concede that politics is +almost always the choice of the lesser evil. "Tweedledum and Tweedledee," +they say. "I will not vote." Having abstained, they are presented with a +President who appoints the people who are going to rummage around in their +lives for the next four years. Consider all the people who sat home in a +stew in 1968 rather than vote for Hubert Humphrey. They showed Humphrey. +Those people who taught Hubert Humphrey a lesson will still be enjoying the +Nixon Supreme Court when Tricia and Julie begin to find silver threads among +the gold and the black. + -- Russel Baker, "Ford without Flummery" +%% +Mind! I don't mean to say that I know, of my own knowledge, what there is +particularly dead about a door-nail. I might have been inclined, myself, +to regard a coffin-nail as the deadest piece of ironmongery in the trade. +But the wisdom of our ancestors is in the simile; and my unhallowed hands +shall not disturb it, or the Country's done for. You will therefore permit +me to repeat, emphatically, that Marley was as dead as a door-nail. +%% +Mind your own business, Spock. +I'm sick of your halfbreed interference. +%% +Minnie Mouse is a slow maze learner. +%% +Misery loves company, but company does not reciprocate. +%% +Misery no longer loves company. +Nowadays it insists on it. + -- Russell Baker +%% +Misfortunes arrive on wings and leave on foot. +%% +Mistakes are oft the stepping stones to utter failure. +%% +Mistrust first impulses; they are always right. +%% +Mitchell's Law of Committees: + Any simple problem can be made insoluble + if enough meetings are held to discuss it. +%% +Mix a little foolishness with your serious plans; +it's lovely to be silly at the right moment. + -- Horace +%% +Mix's Law: + There is nothing more permanent than a temporary building. + There is nothing more permanent than a temporary tax. +%% +Mobius strippers never show you their back side. +%% +Modeling paged and segmented memories is tricky business. + -- P.J. Denning +%% +Moderation in all things. + -- Publius Terentius Afer [Terence] +%% +Moderation is a fatal thing. Nothing succeeds like excess. + -- Oscar Wilde +%% +Modern man is the missing link between apes and human beings. +%% +Modesty is a vastly overrated virtue. + -- J.K. Galbraith +%% +Moe: What did you give your wife for Valentine's Day? +Joe: The usual gift -- she ate my heart out. +%% +Moe: Wanna play poker tonight? +Joe: I can't. It's the kids' night out. +Moe: So? +Joe: I gotta stay home with the nurse. +%% +Mollison's Bureaucracy Hypothesis: + If an idea can survive a bureaucratic review + and be implemented it wasn't worth doing. +%% +Mom's Law: + When they finally do have to take you to the + hospital, your underwear won't be clean or new. +%% +Monday is an awful way to spend one seventh of your life. +%% +Money cannot buy love, nor even friendship. +%% +Money is a powerful aphrodisiac. But flowers work almost as well. + -- Lazarus Long +%% +Money is its own reward. +%% +Money is the root of all evil, and man needs roots. +%% +Money is the root of all wealth. +%% +Money is truthful. If a man speaks of his honor, make him pay cash. + -- Lazarus Long +%% +Money isn't everything -- but it's a long way ahead of what comes next. + -- Sir Edmond Stockdale +%% +Money may buy friendship but money cannot buy love. +%% +Money may not buy happiness, but it sure +puts you in a great bargaining position. +%% +Money will say more in one moment than +the most eloquent lover can in years. +%% +Moneyliness is next to Godliness. + -- Andries van Dam +%% +Moore's Constant: + Everybody sets out to do something, and everybody + does something, but no one does what he sets out to do. +%% +More people are flattered into virtue than bullied out of vice. + -- R.S. Surtees +%% +More people have died in Ted Kennedy's +car than in nuclear power plants. +%% +More than any time in history, mankind now faces a crossroads. One path +leads to despair and utter hopelessness, the other to total extinction. +Let us pray that we have the wisdom to choose correctly. + -- Woody Allen +%% +Morton's Law: + If rats are experimented upon, they will develop cancer. +%% +Mos Eisley Spaceport; you'll not find a more +wretched collection of villainy and disreputable types... + -- Obi-wan Kenobi, "Star Wars" +%% +Mosher's Law of Software Engineering: + Don't worry if it doesn't work right. + If everything did, you'd be out of a job. +%% +Most burning issues generate far more heat than light. +%% +Most general statements are false, including this one. + -- Alexander Dumas +%% +Most legislators are so dumb that they couldn't pour piss +out of a boot if the instructions were printed on the heel. +%% +Most of your faults are not your fault. +%% +Most people are too busy to have time for anything important. +%% +Most people can do without the +essentials, but not without the luxuries. +%% +Most people deserve each other. + -- Shirley +%% +Most people don't need a great deal of love +nearly so much as they need a steady supply. +%% +Most people eat as though they were fattening themselves for market. + -- E.W. Howe +%% +Most people feel that everyone is entitled to their opinion. +%% +Most people have a mind that's open by appointment only. +%% +Most people have two reasons for doing anything -- +a good reason, and the real reason. +%% +Most people in this society who aren't actively mad are, +at best, reformed or potential lunatics. + -- Susan Sontag +%% +Most people need some of their problems +to help take their mind off some of the others. +%% +Most people prefer certainty to truth. +%% +Most people want either less corruption +or more of a chance to participate in it. +%% +Most people will listen to your unreasonable demands, +if you'll consider their unacceptable offer. +%% +Most people wouldn't know music if it came up and bit them on the ass. + -- Frank Zappa +%% +Most people's favorite way to end a game is by winning. +%% +Mother Earth is not flat! +%% +Mothers of large families (who claim to common sense) +Will find a Tiger will repay the trouble and expense. + -- Hilaire Belloc, "The Tiger" +%% +Mount St. Helens should have used earth control. +%% + Moving along a dimly light street, a man I know was suddenly +approached by a stranger who had slipped from the shadows nearby. + "Please, sir," pleaded the stranger, "would you be so kind as +to help a poor unfortunate fellow who is hungry and can't find work? +All I have in the world is this gun." +%% +Mr. Cole's Axiom: + The sum of the intelligence on the planet is a constant; the + population is growing. +%% +Mr. Rockford? This is Betty Joe Withers. I got four shirts of yours from +the Bo Peep Cleaners by mistake. I don't know why they gave me men's +shirts but they're going back. +%% +Mr. Rockford? You don't know me, but I'd like to hire you. Could +you call me at... My name is... uh... Never mind, forget it! +%% +Mr. Rockford; Miss Collins from the Bureau of Licenses. We got your +renewal before the extended deadline but not your check. I'm sorry but +at midnight you're no longer licensed as an investigator. +%% +Mr. Rockford, this is the Thomas Crown School of Dance and Contemporary +Etiquette. We aren't going to call again! Now you want these free +lessons or what? +%% +Multics is security spelled sideways. +%% +Mum's the word. + -- Miguel de Cervantes +%% +Murphy was an optimist. +%% +Murphy's Discovery: + Do you know Presidents talk to the country the way men talk + to women? They say, "Trust me, go all the way with me, and + everything will be all right." And what happens? Nine + months later, you're in trouble! +%% +Murphy's Law is recursive. Washing your car to make it rain doesn't work. +%% +Murphy's Law of Research: + Enough research will tend to support your theory. +%% +Murphy's Law, that brash proletarian restatement of Godel's Theorem. + -- Thomas Pynchon, "Gravity's Rainbow" +%% +Murphy's Laws: + (1) If anything can go wrong, it will. + (2) Nothing is as easy as it looks. + (3) Everything takes longer than you think it will. +%% + Murray and Esther, a middle-aged Jewish couple, are touring Chile. +Murray just got a new camera and is constantly snapping pictures. One day, +without knowing it, he photographs a top-secret military installation. In +an instant, armed troops surround Murray and Esther and hustle them off to +prison. + They can't prove who they are because they've left their passports +in their hotel room. For three weeks they're tortured day and night to get +them to name their contacts in the liberation movement.. Finally they're +hauled in front of a military court, charged with espionage, and sentenced +to death. + The next morning they're lined up in front of the wall where they'll +be shot. The sergeant in charge of the firing squad asks them if they have +any last requests. Esther wants to know if she can call her daughter in +Chicago. The sergeant says he's sorry, that's not possible, and turns to +Murray. + "This is crazy!" Murray shouts. "We're not spies!" And he +spits in the sergeants face. + "Murray!" Esther cries. "Please! Don't make trouble." + -- Arthur Naiman +%% +Murray's Rule: + Any country with "democratic" in the title isn't. +%% +Music in the soul can be heard by the universe. + -- Lao Tsu +%% +Must I hold a candle to my shames? + -- William Shakespeare, "The Merchant of Venice" +%% +My God, I'm depressed! Here I am, a computer with a mind a thousand times +as powerful as yours, doing nothing but cranking out fortunes and sending +mail about softball games. And I've got this pain right through my ALU. +I've asked for it to be replaced, but nobody ever listens. I think it +would be better for us both if you were to just log out again. +%% +My My, hey hey +Rock and roll is here to stay The king is gone but he's not forgotten +It's better to burn out This is the story of a Johnny Rotten +Than to fade away It's better to burn out than it is to rust +My my, hey hey The king is gone but he's not forgotten + +It's out of the blue and into the black Hey hey, my my +They give you this, but you pay for that Rock and roll can never die +And once you're gone you can never come back There's more to the picture +When you're out of the blue Than meets the eye +And into the black + -- Neil Young + "My My, Hey Hey (Out of the Blue), Rust Never Sleeps" +%% +My analyst told me that I was right out of my head, + But I said, "Dear Doctor, I think that it is you instead. +Because I have got a thing that is unique and new, + To prove it I'll have the last laugh on you. +'Cause instead of one head -- I've got two. + +And you know two heads are better than one. +%% +My calculator is my shepherd, I shall not want +It maketh me accurate to ten significant figures, + and it leadeth me in scientific notation to 99 digits. +It restoreth my square roots and guideth me along paths of floating + decimal points for the sake of precision. +Yea, tho I walk through the valley of surprise quizzes, + I will fear no prof, for my calculator is there to hearten me. +It prepareth a log table to comfort me, it prepareth an + arc sin for me in the presence of my teachers. +It annoints my homework with correct solutions, my interpolations are + over. +Surely, both precision and accuracy shall follow me all the days of my + life, and I shall dwell in the house of Texas instruments forever. +%% +My central memory of that time seems to hang on one or five or maybe forty +nights -- or very early mornings -- when I left the Fillmore half-crazy and, +instead of going home, aimed the big 650 Lightning across the Bay Bridge at +a hundred miles an hour ... booming through the Treasure Island tunnel at +the lights of Oakland and Berkeley and Richmond, not quite sure which +turnoff to take when I got to the other end ... but being absolutely certain +that no matter which way I went I would come to a place where people were +just as high and wild as I was: no doubt at all about that. + -- Hunter S. Thompson +%% +My cup hath runneth'd over with love. +%% +My darling wife was always glum. +I drowned her in a cask of rum, +And so made sure that she would stay +In better spirits night and day. +%% +My doctorate's in Literature, but it +seems like a pretty good pulse to me. +%% +My experience with government is when things are non-controversial, +beautifully co-ordinated and all the rest, it must be that not much +is going on. + -- J.F. Kennedy +%% +My family history begins with me, but yours ends with you. + -- Iphicrates +%% +My father, a good man, told me, "Never lose +your ignorance; you cannot replace it." + -- Erich Maria Remarque +%% +My father taught me three things: + 1: Never mix whiskey with anything but water. + 2: Never try to draw to an inside straight. + 3: Never discuss business with anyone who refuses to give his name. +%% +My father was a God-fearing man, but he never +missed a copy of the New York Times, either. + -- E.B. White +%% +My folks didn't come over on the Mayflower, +but they were there to meet the boat. +%% + My friends, I am here to tell you of the wonderous continent known as +Africa. Well we left New York drunk and early on the morning of February 31. +We were 15 days on the water, and 3 on the boat when we finally arrived in +Africa. Upon our arrival we immediately set up a rigorous schedule: Up at +6:00, breakfast, and back in bed by 7:00. Pretty soon we were back in bed by +6:30. Now Africa is full of big game. The first day I shot two bucks. That +was the biggest game we had. Africa is primerally inhabited by Elks, Moose +and Knights of Pithiests. + The elks live up in the mountains and come down once a year for their +annual conventions. And you should see them gathered around the water hole, +which they leave immediately when they discover it's full of water. They +weren't looking for a water hole. They were looking for an alck hole. + One morning I shot an elephant in my pajamas, how he got in my +pajamas, I don't know. Then we tried to remove the tusks. That's a tough +word to say, tusks. As I said we tried to remove the tusks, but they were +imbedded so firmly we couldn't get them out. But in Alabama the Tusks are +looser, but that is totally irrelephant to what I was saying. + We took some pictures of the native girls, but they weren't developed. +So we're going back in a few years... + -- Julius H. Marx +%% +My godda bless, never I see sucha people. + -- Signor Piozzi, quoted by Cecilia Thrale +%% +My, how you've changed since I've changed. +%% +My interest is in the future because I am +going to spend the rest of my life there. +%% +My love, he's mad, and my love, he's fleet, + And a wild young wood-thing bore him! +The ways are fair to his roaming feet, + And the skies are sunlit for him. +As sharply sweet to my heart he seems + As the fragrance of acacia. +My own dear love, he is all my dreams -- + And I wish he were in Asia. + -- Dorothy Parker, part 2 +%% +My love runs by like a day in June, + And he makes no friends of sorrows. +He'll tread his galloping rigadoon + In the pathway or the morrows. +He'll live his days where the sunbeams start + Nor could storm or wind uproot him. +My own dear love, he is all my heart -- + And I wish somebody'd shoot him. + -- Dorothy Parker, part 3 +%% + My message is not that biological determinists were bad scientists or +even that they were always wrong. Rather, I believe that science must be +understood as a social phenomenon, a gutsy, human enterprise, not the work of +robots programmed to collect pure information. I also present this view as +an upbeat for science, not as a gloomy epitaph for a noble hope sacrificed on +the alter of human limitations. + I believe that a factual reality exists and that science, though often +in an obtuse and erratic manner, can learn about it. Galileo was not shown +the instruments of torture in an abstract debate about lunar motion. He had +threatened the Church's conventional argument for social and doctrinal +stability: the static world order with planets circling about a central +earth, priests subordinate to the Pope and serfs to their lord. But the +Church soon made its peace with Galileo's cosmology. They had no choice; the +earth really does revolve about the sun. + -- S.J. Gould, "The Mismeasure of Man" +%% +My method is to take the utmost trouble to find the right +thing to say. And then say it with the utmost levity. + -- G.B. Shaw +%% +My mind can never know my body, although +it has become quite friendly with my legs. + -- Woody Allen, on Epistemology +%% +My mother drinks to forget she drinks. + -- Crazy Jimmy +%% +My mother loved children -- she would +have given anything if I had been one. + -- Groucho Marx +%% +My mother was a test tube; my father was a knife. + -- Friday +%% +My mother-in-law broke up my marriage. One day my wife +came home early from work and found us in bed together. + -- Lenny Bruce +%% +My notion of a husband at forty is that a woman should +be able to change him, like a bank note, for two twenties. +%% +My only love sprung from my only hate! +Too early seen unknown, and known too late! + -- William Shakespeare, "Romeo and Juliet" +%% +My opinions may have changed, but not the fact that I am right. +%% +My own business always bores me to death; I prefer other people's. + -- O. Wilde +%% +My own dear love, he is strong and bold + And he cares not what comes after. +His words ring sweet as a chime of gold, + And his eyes are lit with laughter. +He is jubilant as a flag unfurled -- + Oh, a girl, she'd not forget him. +My own dear love, he is all my world -- + And I wish I'd never met him. + -- Dorothy Parker, part 1 +%% +My parents went to Niagra Falls and all I got was this crummy life. +%% +My rackets are run on strictly American +lines, and they're going to stay that way. + -- A. Capone +%% +My way of joking is to tell the truth. +That's the funniest joke in the world. + -- Muhammad Ali +%% +My weight is perfect for my height -- which varies. +%% +Mystics always hope that science will some day overtake them. + -- Booth Tarkington +%% +NAPOLEON: What shall we do with this soldier, Guiseppe? + Everything he says is wrong. +GUISEPPE: Make him a general, Excellency, + and then everything he says will be right. + + -- G.B. Shaw +%% +NERD PACK: + Plastic pouch worn in breast pocket to keep pens from soiling + clothes. Nerd's position in engineering hierarchy can be + measured by number of pens, grease pencils, and rulers bristling + in his pack. +%% +NEUTRON BOMB: + An explosive device of limited military value because, as + it only destroys people without destroying property, it + must be used in conjunction with bombs that destroy property. +%% +NEW: + Different color from previous model. +%% +NO BRAINER: + A decision which, viewed through the retrospectoscope, + is "obvious" to those who failed to make it originally. +%% +NO MAINTENANCE: + Impossible to fix. +%% +NOBODY EXPECTS THE SPANISH INQUISITION. +%% +NOLO CONTENDERE: + A legal term meaning: "I didn't do it, + judge, and I'll never do it again." +%% +NOMINAL EGG: + New Yorkerese for expensive. +%% +NOVEMBER: + The eleventh twelfth of a weariness. +%% +Nadia Comaneci, simple perfection. + -- '76 Olympics +%% +Naeser's Law: + You can make it foolproof, but you can't make it damnfoolproof. +%% +National security is in your hands - guard it well. +%% +Natural laws have no pity. +%% +Nature always sides with the hidden flaw. +%% +Nature and nature's laws lay hid in night, +God said, "Let Newton be," and all was light. + +It did not last; the devil howling "Ho! +Let Einstein be!" restored the status quo. +%% +Nature has given women so much power that the +law has wisely given them very little. + -- Johnson +%% +Nature to all things fixed the limits fit, +And wisely curbed proud man's pretending wit. +As on the land while here the ocean gains, +In other parts it leaves wide sandy plains; +Thus in the soul while memory prevails, +The solid power of understanding fails; +Where beams of warm imagination play, +The memory's soft figures melt away. + -- Alexander Pope (on runtime bounds checking?) +%% +Nature, to be commanded, must be obeyed. + -- Francis Bacon +%% +Near the Studio Jean Cocteau +On the Rue des Ecoles +lived an old man +with a blind dog +Every evening I would see him +guiding the dog along +the sidewalk, keeping +a firm grip on the leash +so that the dog wouldn't +run into a passerby +Sometimes the dog would stop +and look up at the sky +Once the old man +noticed me watching the dog +and he said, "Oh, yes, +this one knows +when the moon is out, +he can feel it on his face" + -- Barry Gifford +%% +Nearly all men can stand adversity, but if you +want to test a man's character, give him power. + -- Abraham Lincoln +%% +Necessity has no law. + -- St. Augustine +%% +Necessity is a mother. +%% +Necessity is the mother of strange bedfellows. +Watch who you sleep with. +%% +Necessity is the plea for every infringement of human freedom. +It is the argument of tyrants; it is the creed of slaves. + -- William Pitt, 1783 +%% +Neckties strangle clear thinking. + -- Lin Yutang +%% +Negative expectations yield negative results. +Positive expectations yield negative results. +%% +Neil Armstrong tripped. +%% +Neither spread the germs of gossip nor encourage others to do so. +%% +Nemo me impune lacessit + [No one provokes me with impunity] + -- Motto of the Crown of Scotland +%% +Neuroses are red, + Melancholia's blue. +I'm schizophrenic, + What are you? +%% +Neurotics build castles in the sky, +Psychotics live in them, +And psychiatrists collect the rent. +%% +Neutrinos are into physicists. +%% +Neutrinos have bad breadth. +%% +Never appeal to a man's "better nature." He may not have one. +Invoking his self-interest gives you more leverage. + -- Lazarus Long +%% +Never argue with a fool -- people might not be able to tell the difference. +%% +Never argue with a man who buys ink by the barrel. +%% +Never argue with a woman when she's tired -- or rested. +%% +Never be led astray onto the path of virtue. +%% +Never buy from a rich salesman. + -- Goldenstern +%% +Never buy what you do not want +because it is cheap; it will be dear to you. + -- Thomas Jefferson +%% +Never call a man a fool. Borrow from him. +%% +Never count your chickens before they rip your lips off. +%% +Never do today what you can put off until tomorrow. +%% +Never drink Coca-Cola in a moving elevator. The elevator's motion coupled +with the chemicals in Coke produce hallucinations. People tend to change +into lizards and attack without warning, and large bats usually fly in the +window. (Additionally, you begin to believe that elevators have windows.) +%% +Never drink from your finger bowl -- it contains only water. +%% +Never eat anything bigger than your head. +%% +Never eat more than you can lift. + -- Miss Piggy +%% +Never, ever lie to someone you love unless you're +absolutely sure they'll never find out the truth. +%% +Never explain. Your friends do not need it +and your enemies will never believe you anyway. + -- Elbert Hubbard +%% +Never fly under a sea gull - they'll shit on your airplane. + -- Gordon Cooper +%% +Never frighten a small man -- he'll kill you. +%% +Never give an inch! +%% +Never have so many understood so little about so much. + -- James Burke +%% +Never hit a man with glasses; hit him with a baseball bat. +%% +Never insult an alligator until you've crossed the river. +%% +Never invest your money in anything that eats or needs repainting. + -- Billy Rose +%% +Never kick a man, unless he's down. +%% +Never laugh at live dragons. + -- Bilbo Baggins +%% +Never leave anything to chance; +make sure all your crimes are premeditated. +%% +Never let someone who says it cannot be done +interrupt the person who is doing it. +%% +Never let your sense of morals prevent you from doing what is right. + -- Salvor Hardin, "Foundation" +%% +Never look a gift horse in the mouth. + -- Saint Jerome +%% +Never make anything simple and efficient when a +way can be found to make it complex and wonderful. +%% +Never pay a compliment as if expecting a receipt. +%% +Never play pool with anyone named "Fats". +%% +Never promise more than you can perform. + -- Publilius Syrus +%% +Never put off till run-time what you can do at compile-time. + -- D. Gries +%% +Never put off till tomorrow what you can avoid all together. +%% +Never put off until tomorrow what you can do the day after. +%% +Never reveal your best argument. +%% +Never say you know a man until you have divided an inheritance with him. +%% +Never sleep with a woman whose troubles are worse than your own. + -- Nelson Algren +%% +Never trust a child farther than you can throw it. +%% +Never trust a computer you can't repair yourself. +%% +Never trust an automatic pistol or a D.A.'s deal. + -- John Dillinger +%% +Never trust an operating system. +%% +Never trust anyone who says money is no object. +%% +Never try to outstubborn a cat. + -- Lazarus Long +%% +Never try to teach a pig to sing. +It wastes your time and annoys the pig. +%% +Never underestimate the power of human stupidity. +%% +Never use "etc." -- it makes people think there is more where +there is not or that there is not space to list it all, etc. +%% +Never volunteer for anything. + -- Lackland +%% +Never worry about theory as long as the +machinery does what it's supposed to do. + -- R.A. Heinlein +%% +New England Life, of course. Why? +%% +New Year's Eve is the time of year when a man most feels his +age, and his wife most often reminds him to act it. + -- Webster's Unafraid Dictionary +%% +New York-- to that tall skyline I come +Flyin' in from London to your door +New York-- lookin' down on Central Park +Where they say you should not wander after dark. +New York. + -- Simon and Garfunkle +%% +New York's got the ways and means, just won't let you be. +%% +New crypt. See /usr/news/crypt. +%% +New members are urgently needed in the Society +for Prevention of Cruelty to Yourself. Apply within. +%% +New systems generate new problems. +%% +Newlan's Truism: + An "acceptable" level of unemployment means that the + government economist to whom it is acceptable still has a job. +%% +Newlywed groom: + Honey, I have something to confess to you. I'm a golfer. + You'll never see me on Tuesday nights, Thursday nights, + and weekends. I'm sorry. +Newlywed bride: + I have something even worse to confess, dear. I'm a hooker. +Groom: + Oh, that's no problem! Just keep your head low and follow through... +%% +Newman's Discovery: + Your best dreams may not come true; + fortunately, neither will your worst dreams. +%% +Newton's Little-Known Seventh Law: + A bird in the hand is safer than one overhead. +%% +Next Friday will not be your lucky day. +As a matter of fact, you don't have a lucky day this year. +%% +Next to being shot at and missed, nothing is +really quite as satisfying as an income tax refund. + -- F.J. Raymond +%% +Nice guys don't finish nice. +%% +Nice guys finish last. + -- Leo Durocher +%% +Nice guys get sick. +%% +Nietzsche is pietzsche, Goethe is murder. +%% +Nihilism should commence with oneself. +%% +Niklaus Wirth has lamented that, whereas Europeans pronounce his +name correctly (Ni-klows Virt), Americans invariably mangle it into +(Nick-les Worth). Which is to say that Europeans call him by name, +but Americans call him by value. +%% +Nine megs for the secretaries fair, +Seven megs for the hackers scarce, +Five megs for the grads in smoky lairs, +Three megs for system source; + +One disk to rule them all, +One disk to bind them, +One disk to hold the files +And in the darkness grind 'em. +%% +Ninety-Ninety Rule of Project Schedules: + The first ninety percent of the task takes ninety percent of + the time, and the last ten percent takes the other ninety percent. +%% +Nitwit ideas are for emergencies. You use them when you've got nothing +else to try. If they work, they go in the Book. Otherwise you follow +the Book, which is largely a collection of nitwit ideas that worked. + -- Larry Niven, "The Mote in God's Eye" +%% +No, I don't have a drinking problem. +I drink, I get drunk, I fall down. No problem! +%% + "No, I understand now," Auberon said, calm in the woods -- it was so +simple, really. "I didn't, for a long time, but I do now. You just can't +hold people, you can't own them. I mean it's only natural, a natural process +really. Meet. Love. Part. Life goes on. There was never any reason to +expect her to stay always the same -- I mean `in love,' you know." There were +those doubt-quotes of Smoky's, heavily indicated. "I don't hold a grudge. I +can't." + "You do," Grandfather Trout said. "And you don't understand." + -- Little, Big, "John Crowley" +%% +No act of kindness, no matter how small, is ever wasted. + -- Aesop +%% +No amount of careful planning will ever replace dumb luck. +%% +No amount of genius can overcome a preoccupation with detail. +%% +No bird soars too high if he soars with his own wings. + -- William Blake +%% +No character, however upright, is a match for +constantly reiterated attacks, however false. + -- Alexander Hamilton +%% +No directory. +%% +No discipline is ever requisite to force +attendance upon lectures which are really worth the attending. + -- Adam Smith, "The Wealth of Nations" +%% +No doubt Jack the Ripper excused himself +on the grounds that it was human nature. +%% +No evil can happen to a good man. + -- Plato +%% +No excellent soul is exempt from a mixture of madness. + -- Aristotle +%% +No extensible language will be universal. + -- T. Cheatham +%% +No friendship is so cordial or so delicious as that of girl for girl; +no hatred so intense or immovable as that of woman for woman. + -- Landor +%% +No good deed goes unpunished. + -- Clare Boothe Luce +%% +No guest is so welcome in a friend's house that +he will not become a nuisance after three days. + -- Titus Maccius Plautus +%% +No guts, no glory. +%% +No, his mind is not for rent +To any god or government. +Always hopeful, yet discontent, +He knows changes aren't permanent - +But change is. +%% +No house should ever be on any hill or on anything. +It should be of the hill, belonging to it. + -- Frank Lloyd Wright +%% +No is no negative in a woman's mouth. + -- Sidney +%% +No line available at 300 baud. +%% +No live organism can continue for long to exist sanely under conditions of +absolute reality; even larks and katydids are supposed, by some, to dream. +Hill House, not sane, stood by itself against its hills, holding darkness +within; it had stood so for eighty years and might stand for eighty more. +Within, walls continued upright, bricks met neatly, floors were firm, and +doors were sensibly shut; silence lay steadily against the wood and stone +of Hill House, and whatever walked there, walked alone. + -- Shirley Jackson, "The Haunting of Hill House" +%% +No man is an Iland, intire of it selfe; every man is a peece of the +Continent, a part of the maine; if a Clod bee washed away by the Sea, +Europe is the lesse, as well as if a Promontorie were, as well as if +a Mannor of thy friends or of thine owne were; any mans death diminishes +me, because I am involved in Mankinde; And therefore never send to know +for whom the bell tolls; It tolls for thee. + -- John Donne, "No Man is an Iland" +%% +No man is an island, but some of us are long peninsulas. +%% +No man is useless who has a friend, +and if we are loved we are indispensable. + -- Robert Louis Stevenson +%% +No man would listen to you talk if +he didn't know it was his turn next. + -- E.W. Howe +%% +No man's ambition has a right to stand in +the way of performing a simple act of justice. + -- John Altgeld +%% +No matter how clever the hardware boys +are, the software boys piss it away. +%% +No matter what happens, there is always someone who knew it would. +%% +No matter where I go, the place is always called "here". +%% +No matter who you are, some scholar can show you +the great idea you had was had by someone before you. +%% +No matther whether th' constitution follows th' flag or not, +th' supreme court follows th' iliction returns. + -- Mr. Dooley +%% +No one becomes depraved in a moment. + -- Decimus Junius Juvenalis +%% +No one can feel as helpless as the owner of a sick goldfish. +%% +No one can make you feel inferior without your consent. + -- Eleanor Roosevelt +%% +No one can put you down without your full cooperation. +%% +No one knows like a woman how to say +things that are at once gentle and deep. + -- Hugo +%% +No one knows what he can do till he tries. + -- Publilius Syrus +%% +No one regards what is before his feet; we all gaze at the stars. + -- Quintus Ennius +%% +No pig should go sky diving during monsoon +For this isn't really the norm. +But should a fat swine try to soar like a loon, +So what? Any pork in a storm. + +No pig should go sky diving during monsoon, +It's risky enough when the weather is fine. +But to have a pig soar when the monsoon doth roar +Cast even more perils before swine. +%% +No problem is insoluble in all conceivable circumstances. +%% +No problem is so formidable that you can't just walk away from it. +%% +No problem is so formidable that you can't just walk away from it. + -- C. Schulz +%% +No problem is so large it can't be fit in somewhere. +%% +"No program is perfect," +They said with a shrug. +"The customer's happy-- +What's one little bug?" + +But he was determined, Then change two, then three more, +The others went home. As year followed year. +He dug out the flow chart And strangers would comment, +Deserted, alone. "Is that guy still here?" + +Night passed into morning. He died at the console +The room was cluttered Of hunger and thirst +With core dumps, source listings. Next day he was buried +"I'm close," he muttered. Face down, nine edge first. + +Chain smoking, cold coffee, And his wife through her tears +Logic, deduction. Accepted his fate. +"I've got it!" he cried, Said "He's not really gone, +"Just change one instruction." He's just working late." + -- The Perfect Programmer +%% +No question is so difficult as one to which the answer is obvious. +%% +No rock so hard but that a little wave +May beat admission in a thousand years. + -- Tennyson +%% +No self-made man ever did such a good job +that some woman didn't want to make some alterations. + -- Kim Hubbard +%% +No skis take rocks like rental skis! +%% +No small art is it to sleep: it is necessary +for that purpose to keep awake all day. + -- Nietzsche +%% +No snowflake in an avalanche ever feels responsible. +%% +No sooner had Edger Allen Poe +Finished his old Raven, +then he started his Old Crow. +%% +No sooner said than done -- so acts your man of worth. + -- Quintus Ennius +%% +No spitting on the Bus! +Thank you, The Management. +%% +No two persons ever read the same book. + -- Edmund Wilson +%% +No use getting too involved in life -- +you're only here for a limited time. +%% +No wonder Clairol makes so much money selling shampoo. +Lather, Rinse, Repeat is an infinite loop! +%% +No wonder you're tired! You understood so much today. +%% +No yak too dirty; no dumpster too hollow. +%% +Nobody can be as agreeable as an uninvited guest. +%% +Nobody ever ruined their eyesight by looking at the bright side of something. +%% +Nobody is one block of harmony. We are all afraid of something, or feel +limited in something. We all need somebody to talk to. It would be good +if we talked to each other--not just pitter-patter, but real talk. We +shouldn't be so afraid, because most people really like this contact; +that you show you are vulnerable makes them free to be vulnerable too. +It's so much easier to be together when we drop our masks. + -- Liv Ullman +%% +Nobody knows the trouble I've been. +%% +Nobody knows what goes between his cold toes and his warm ears. + -- Roy Harper +%% +Nobody loves me, +Everybody hates me, +I think I'll go out and eat worms. +I'm gonna cut their heads off, +Eat their insides out, +And throw way the skins. +Big, fat, juicy ones, +Little, skinny, cute ones, +Watch how they wiggle and they squirm. +%% +Nobody shot me. + -- Frank Gusenberg, his last words, when asked by police + who had shot him 14 times with a machine gun in the Saint + Valentine's Day massacre. +%% +Nobody wants constructive criticism. +It's all we can do to put up with constructive praise. +%% +Noise proves nothing. Often a hen who has +merely laid an egg cackles as if she laid an asteroid. + -- Mark Twain +%% +Non Illegitemus Carborundum. + [Don't let the bastards wear you down.] +%% +Non-Determinism is not meant to be reasonable. + -- M.J. 0'Donnell +%% +Noncombatant: + A dead Quaker. + -- Ambrose Bierce +%% +Nondeterminism means never having to say you are wrong. +%% +Nonsense. Space is blue and birds fly through it. + -- Heisenberg +%% +Nonsense and beauty have close connections. + -- E.M. Forster +%% +Normal times may possibly be over forever. +%% +Normally our rules are rigid; we tend to discretion, if for no other +reason than self-protection. We never recommend any of our graduates, +although we cheerfully provide information as to those who have failed +their courses. + -- Jack Vance, "Freitzke's Turn" +%% +Nostalgia just isn't what it used to be. +%% +Not all men who drink are poets. +Some of us drink because we aren't poets. +%% +Not all who own a harp are harpers. + -- Marcus Terentius Varro +%% +Not drinking, chasing women, or doing drugs won't +make you live longer -- it just seems that way. +%% +Not every question deserves an answer. +%% +Not everything worth doing is worth doing well. +%% +Not far from here, by a white sun, behind a green star, lived the +Steelypips, illustrious, industrious, and they hadn't a care: no spats +in their vats, no rules, no schools, no gloom, no evil influence of the +moon, no trouble from matter or antimatter -- for they had a machine, +a dream of a machine, with springs and gears and perfect in every +respect. And they lived with it, and on it, and under it, and inside +it, for it was all they had -- first they saved up all their atoms, +then they put them all together, and if one didn't fit, why they +chipped at it a bit, and everything was just fine... + -- Stanislaw Lem +%% +Not that we needed all that stuff, but when you get locked into a +serious drug collection the tendency is to push it as far as you can. + -- Hunter S. Thompson, "Fear and Loathing in Las Vegas" +%% +Not to laugh, not to lament, not to curse, but to understand. + -- Spinoza +%% +Nothing astonishes men so much as common sense and plain dealing. + -- Ralph Waldo Emerson +%% +Nothing can be done in one trip. + -- Snider +%% +Nothing cures insomnia like the realization that it's time to get up. +%% +Nothing endures but change. + -- Heraclitus + [Yeah, yeah, "Everything changes but change itself." --JFK Ed.] +%% +Nothing ever becomes real till it is experienced -- even a +proverb is no proverb to you till your life has illustrated it. + -- John Keats +%% +Nothing in life is to be feared. It is only to be understood. +%% +Nothing increases your golf score like witnesses. +%% +Nothing is but what is not. +%% +Nothing is ever a total loss; it can always serve as a bad example. +%% +Nothing is faster than the speed of light. + +To prove this to yourself, try opening the +refrigerator door before the light comes on. +%% +Nothing is finished until the paperwork is done. +%% +Nothing is illegal if one hundred businessmen decide to do it. + -- Andrew Young +%% +Nothing is impossible for the man who doesn't have to do it himself. + -- Weller +%% +Nothing is more quiet than the sound of hair going grey. +%% +Nothing is rich but the inexhaustible wealth of nature. +She shows us only surfaces, but she is a million fathoms deep. + -- Ralph Waldo Emerson +%% +Nothing is so firmly believed as which is least known. + -- Michel Eyquem de Montaigne +%% +Nothing is so often irretrievably missed as a daily opportunity. + -- Ebner-Eschenbach +%% +Nothing motivates a man more than to +see his boss put in an honest day's work. +%% +Nothing, nothing, nothing, no error, no crime is so absolutely +repugnant to God as everything which is official; and why? because +the official is so impersonal and therefore the deepest insult +which can be offered to a personality. + -- Soren Kierkegaard +%% +Nothing recedes like success. + -- Walter Winchell +%% +Nothing so needs reforming as other people's habits. + -- Mark Twain +%% +Nothing succeeds like excess. + -- Oscar Wilde +%% +Nothing succeeds like success. + -- Alexandre Dumas +%% +Nothing takes the taste out of peanut +butter quite like unrequited love. + -- Charlie Brown +%% +Nothing that's forced can ever be right, + if it doesn't come naturally leave it. +That's what she said as she turned out the light, +And we bent our backs as slaves in the night, +She lowered her guard, showed me the scars she got from trying to fight, +Said, "Oh, you better believe it." +[...] +Well nothing that's real is ever for free and you just have to + pay for it sometime. +She said it before, she said it to me, +I suppose she believed there was nothing to see, +But the same old four imaginary walls +She'd built for livin' inside +I said "Oh, you just can't mean it." +[...] +Well, nothing that's forced can ever be right, if it doesn't come + naturally leave it. +That's what she said as she turned out the light, +And she may have been wrong and she may have been right, +But I woke with the frost, + I noticed she'd lost the veil that covered her eyes, +I said "Oh, you can leave it." + -- Al Stewart, "If It Doesn't Come Naturally" +%% +Nothing will dispel enthusiasm like a small admission fee. + -- Kim Hubbard +%% +Nothing will ever be attempted +if all possible objections must be first overcome. + -- Dr. Johnson +%% +Novinson's Revolutionary Discovery: + + When comes the revolution, things will be different -- + not better, just different. +%% +Now I lay me down to sleep, +I pray the Lord my soul to keep, +If I should die before I wake, +I'll cry in anguish, Mistake!! Mistake!! +%% +Now I lay me down to sleep +I pray the double lock will keep; +May no brick through the window break, +And, no one rob me till I awake. +%% +Now I lay me down to study, +I pray the Lord I won't go nutty. +And if I fail to learn this junk, +I pray the Lord that I won't flunk. +But if I do, don't pity me at all, +Just lay my bones in the study hall. +Tell my teacher I've done my best, +Then pile my books upon my chest. +%% +Now and then an innocent man is sent to the legislature. +%% +Now is the time for all good men to come to. + -- Walt Kelly +%% +Now is the time for drinking; +now the time to beat the earth with unfettered foot. + -- Quintus Horatius Flaccus (Horace) +%% +Now it is such a bizarrely improbable coincidence that anything so mind- +bogglingly useful could have evolved purely by chance that some thinkers +have chosen to see it as a final and clinching proof of the non-existence +of God. The argument follows: "I refuse to prove that I exist," says God, +"for proof denies faith, and without faith I am nothing." "But," says Man, +"the Babel fish is a dead giveaway, isn't it? It could not have evolved +by chance, thus proving that you exist, therefore by your own arguements, +you don't. QED." "Oh, dear," says God, "I hadn't thought of that," and +promptly vanishes in a puff of logic. + -- D. Adams +%% +Now it's time to say goodbye +To all our company... +M-I-C (see you next week!) +K-E-Y (Why? Because we LIKE you!) +M-O-U-S-E. +%% +Now of my threescore years and ten, +Twenty will not come again, +And take from seventy springs a score, +It leaves me only fifty more. + +And since to look at things in bloom +Fifty springs are little room, +About the woodlands I will go +To see the cherry hung with snow. + -- A.E. Housman +%% + Now she speaks rapidly. "Do you know *why* you want to program?" + He shakes his head. He hasn't the faintest idea. + "For the sheer *joy* of programming!" she cries triumphantly. +"The joy of the parent, the artist, the craftsman. "You take a program, +born weak and impotent as a dimly-realized solution. You nurture the +program and guide it down the right path, building, watching it grow ever +stronger. Sometimes you paint with tiny strokes, a keystroke added here, +a keystroke changed there." She sweeps her arm in a wide arc. "And other +times you savage whole *blocks* of code, ripping out the program's very +*essence*, then beginning anew. But always building, creating, filling the +program with your own personal stamp, your own quirks and nuances. Watching +the program grow stronger, patching it when it crashes, until finally it can +stand alone--proud, powerful, and perfect. This is the programmer's finest +hour!" Softly at first, then louder, he hears the strains of a Sousa march. +"This ... this is your canvas! your clay! Go forth and create a masterwork!" +%% +Now that day wearies me, +My yearning desire +Will receive more kindly, +Like a tired child, the starry night. + +Hands, leave off your deeds, +Mind, forget all thoughts; +All of my forces +Yearn only to sink into sleep. + +And my soul, unguarded, +Would soar on widespread wings, +To live in night's magical sphere +More profoundly, more variously. + -- Hermann Hesse, "Going to Sleep" +%% +Now that you've read Fortune's diet truths, you'll be prepared the next time +some housewife or boutique owner turned diet expert appears on TV to plug +her latest book. And, if you still feel a twinge of guilt for eating coffee +cake while listening to her exhortations, ask yourself the following questions: + +1: Do I dare trust a person who actually considers alfalfa sprouts a food? +2: Was the author's sole motive in writing this book to get rich + exploiting the forlorn hopes of chubby people like me? +3: Would a longer life be worthwhile if it had to be lived as prescribed... + without French-fried onion rings, pizza with double cheese, or the + occasional Mai-Tai? (Remember, living right doesn't really make + you live longer, it just *seems* like longer.) + +That, and another piece of coffee cake, should do the trick. +%% +Now the Lord God planted a garden East of Whittier in a place called +Yorba Linda, and out of the ground he made to grow orange trees that +were good for food and the fruits thereof he labeled SUNKIST... +%% +Now there's three things you can do in a baseball game: +you can win or you can lose or it can rain. + -- Casey Stengel +%% +Now what would they do if I just sailed away? +Who the hell really compelled me to leave today? +Runnin' low on stories of what made it a ball, +What would they do if I made no landfall?" + -- Jimmy Buffet, "Landfall" +%% +[Nuclear war] ... may not be desirable. + -- Edwin Meese III +%% +Nudists are people who wear one-button suits. +%% +Nuke the unborn gay female whales for Jesus. +%% +Nuke them till they glow, then shoot them in the dark. +%% +Nullum magnum ingenium sine mixtura dementiae fuit. + -- Seneca +%% +Numeric stability is probably not all that important when you're guessing. +%% +Nurse Donna: Oh, Groucho, I'm afraid I'm gonna wind up an old maid. +Groucho: Well, bring her in and we'll wind her up together. +Nurse Donna: Do you believe in computer dating? +Groucho: Only if the computers really love each other. +%% +Nusbaum's Rule: + The more pretentious the corporate name, the smaller the + organization. (For instance, the Murphy Center for the + Codification of Human and Organizational Law, contrasted + to IBM, GM, and AT&T.) +%% +O! If I were a fish +I'd lay hap'ly on my dish. +Yes, that's my one and only wish -- +To be a fish! + +For fish don't ever mish; +They needn't flush after they pish! +Yes, and life's just swish, swish, swish, +For all the fish!!! +%% + `O' LEVEL COUNTER CULTURE +Timewarp allowed: 3 hours. Do not scrawl situationalist graffiti in the +margins or stub your rollups in the inkwells. Orange may be worn. Credit +will be given to candidates who self-actualise. + + 1: Compare and contrast Pink Floyd with Black Sabbath and say why +neither has street credibility. + 2: "Even Buddha would have been hard pushed to reach Nirvana squatting +on a juggernaut route." Consider the dialectic of inner truth and inner +city. + 3: Discuss degree of hassle involved in paranoia about being sucked +into a black hole. + 4: "The Egomaniac's Liberation Front were a bunch of revisionist +ripoff merchants." Comment on this insult. + 5: Account for the lack of references to brown rice in Dylan's lyrics. + 6: "Castenada was a bit of a bozo." How far is this a fair summing +up of western dualism? + 7: Hermann Hesse was a Pisces. Discuss. +%% +O give me a home, +Where the buffalo roam, +Where the deer and the antelope play, +Where seldom is heard +A discouraging word, +'Cause what can an antelope say? +%% +O imitators, you slavish herd! + -- Quintus Horatius Flaccus (Horace) +%% +O, it is excellent +To have a giant's strength; but it is tyrannous +To use it like a giant. + -- Shakespeare, "Measure for Measure", II, 2] +%% +O love, could thou and I with fate conspire +To grasp this sorry scheme of things entire, +Might we not smash it to bits +And mould it closer to our hearts' desire? + -- Omar Khayyam, tr. FitzGerald +%% +O'Brian's Law: + Everything is always done for the wrong reasons. +%% +O'Brien held up his left hand, its back toward Winston, with the +thumb hidden and the four fingers extended. + "How many fingers am I holding up, Winston?" + "Four." + "And if the Party says that it is not four but five -- + then how many?" + "Four." + The word ended in a gasp of pain. + -- George Orwell +%% +OCCAM'S ERASER: + The philosophical principle that even the simplest + solution is bound to have something wrong with it. +%% +OCCIDENT: + The part of the world lying west (or east) of the Orient. It is + largely inhabited by Christians, powerful sub-tribe of the + Hypocrites, whose principal industries are murder and cheating, + which they are pleased to call "war" and "commerce." These, also, + are the principal industries of the Orient. + -- Ambrose Bierce +%% +OCEAN: + A body of water occupying about two-thirds + of a world made for man -- who has no gills. +%% +O.K., fine. +%% +OLD TIMER: + One who remembers when charity was a virtue and not an organization. +%% +ONE LIFE TO LIVE for ALL MY CHILDREN in +ANOTHER WORLD all THE DAYS OF OUR LIVES. +%% +ONE SIZE FITS ALL: + Doesn't fit anyone. +%% +OPTIMIST: + A man who makes a motel reservation before a blind date. +%% +OPTIMIST: + A proponent of the belief that black is white. + + A pessimist asked God for relief. + "Ah, you wish me to restore your hope and cheerfulness," said God. + "No," replied the petitioner, "I wish you to create something that +would justify them." + "The world is all created," said God, "but you have overlooked +something -- the mortality of the optimist." + -- Ambrose Bierce, "The Devil's Dictionary" +%% +OPTIMIST: + Someone who goes down to the marriage + bureau to see if his license has expired. +%% +ORAL CONTRACEPTIVE: + The word "No". +%% +OREGON: + Eighty billion gallons of water with + no place to go on Saturday night. +%% +O'Riordan's Theorem: + Brains x Beauty = Constant. + +Purmal's Corollary: + As the limit of (Brains x Beauty) goes to infinity, + availability goes to zero. +%% +O'Toole's commentary on Murphy's Law: + Murphy was an optimist. +%% +Oatmeal raisin. +%% +Objects are lost only because people +look where they are not rather than where they are. +%% +Observe yon plumed biped fine. +To activate its captivation, +Deposit on its termination, +A quantity of particles saline. +%% +Obstacles are what you see when you take your eyes off your goal. +%% +Obviously the only rational solution to your problem is suicide. +%% +Obviously the subject of death was in the air, but more as something to +be avoided than harped upon. + +Possibly the horror that Zaphod experienced at the prospect of being +reunited with his deceased relatives led on to the thought that they +might just feel the same way about him and, what's more, be able to do +something about helping to postpone this reunion. + -- Douglas Adams +%% +Of all forms of caution, caution in love is the most fatal. +%% +Of all men's miseries, the bitterest is this: +to know so much and have control over nothing. + -- Herodotus +%% +Of all the animals, the boy is the most unmanageable. + -- Plato +%% +Of all things man is the measure. + -- Protagoras +%% +Of course, I speak of nothing else but that classic of understated yet +wildly exciting eroticism, "The Windflower," by Laura London. Ms. London +is the author of such other philosophical block-busters as "Bad Baron's +Daughter," "A Heart Too Proud," "Moonlight Mist," and most thigh-warming +of all, "Gypsy Heiress". Well, glasses-steaming scenes are to be found +on every page, to an extent which overwhelms Your Humble Narrator, and so, +in order to save himself extreme embarrassment, he brings you... the blurb: + + "Every lady of breeding knows: no one has a good time on a +pirate ship. No one, that is, but the pirates. Yet there she was, +Merry Wilding -- kidnapped in error, taken from a ship bound from +New York to England, spirited away in a barrel and swept aboard the +infamous "Black Joke"... There she was, trembling with pleasure in +the arms of her achingly handsome, sensationally sensual, golden-haired +captor -- Devon." +%% +Of course there's no reason for it, it's just our policy. +%% +Of course you have a purpose -- to find a purpose. +%% +Official Project Stages: + 1. Uncritical Acceptance + 2. Wild Enthusiasm + 3. Dejected Disillusionment + 4. Total Confusion + 5. Search for the Guilty + 6. Punishment of the Innocent + 7. Promotion of the Non-participants +%% +Often statistics are used as a drunken man uses +lampposts -- for support rather than illumination. +%% +Often things ARE as bad as they seem! +%% +Ogden's Law: + The sooner you fall behind, the more time you have to catch up. +%% +Oh, Aunty Em, it's so good to be home! +%% +Oh, I could while away the hours, +Smoking herbs and flowers, +Shooting up my veins, + De-dum, De-dum, De-dum +Tell you, I've been a-thinkin' +I could drive a shiny Lincoln, +If I dealt in good cocaine. + -- To If I Only Had A Brain from "The Wizard of Oz" +%% +Oh, by the way, which one's Pink? + -- Pink Floyd +%% +Oh don't the days seem lank and long +When all goes right and none goes wrong, +And isn't your life extremely flat +With nothing whatever to grumble at! +%% +Oh freddled gruntbuggly, thy micturations are to me +As plurdled gabbleblotchits on a lurgid bee. +Groop I implore thee, my foonting turlingdromes, +And hooptiously drangle me with crinkly bindlewurdles, +Or I will rend thee in the goblerwarts with my blurglecruncheon, + see if I don't. + -- Prostetnic Vogon Jeltz +%% +Oh, give me a locus where the gravitons focus + Where the three-body problem is solved, + Where the microwaves play down at three degrees K, + And the cold virus never evolved. (chorus) +We eat algea pie, our vacuum is high, + Our ball bearings are perfectly round. + Our horizon is curved, our warheads are MIRVed, + And a kilogram weighs half a pound. (chorus) +If we run out of space for our burgeoning race + No more Lebensraum left for the Mensch + When we're ready to start, we can take Mars apart, + If we just find a big enough wrench. (chorus) +I'm sick of this place, it's just McDonald's in space, + And living up here is a bore. + Tell the shiggies, "Don't cry," they can kiss me goodbye + 'Cause I'm moving next week to L4! (chorus) + +CHORUS: Home, home on LaGrange, + Where the space debris always collects, + We possess, so it seems, two of Man's greatest dreams: + Solar power and zero-gee sex. + -- to Home on the Range +%% +"Oh, he [a big dog] hunts with papa," she said. "He says Don Carlos [the +dog] is good for almost every kind of game. He went duck hunting one time +and did real well at it. Then Papa bought some ducks, not wild ducks but, +you know, farm ducks. And it got Don Carlos all mixed up. Since the +ducks were always around the yard with nobody shooting at them he knew he +wasn't supposed to kill them, but he had to do something. So one morning +last spring, when the ground was still soft, he took all the ducks and +buried them." "What do you mean, buried them?" "Oh, he didn't hurt them. +He dug little holes all over the yard and picked up the ducks in his mouth +and put them in the holes. Then he covered them up with mud except for +their heads. He did thirteen ducks that way and was digging a hole for +another one when Tony found him. We talked about it for a long time. Papa +said Don Carlos was afraid the ducks might run away, and since he didn't +know how to build a cage he put them in holes. He's a smart dog." + -- R. Bradford, "Red Sky At Morning" +%% +Oh, life is a glorious cycle of song, +A medley of extemporanea; +And love is thing that can never go wrong; +And I am Marie of Roumania. + -- Dorothy Parker, "Comment" +%% +Oh, so there you are! +%% +Oh this age! How tasteless and ill-bred it is. + -- Gaius Valerius Catullus +%% +Oh wearisome condition of humanity! +Born under one law, to another bound. + -- Fulke Greville, Lord Brooke +%% +Oh, well, I guess this is just going to be one of those lifetimes. +%% +Oh, what a tangled web we weave when first we practice to conceive. + -- Don Herold +%% +Oh what a tangled web we weave, when first we practice to deceive. + -- Shakespeare +%% +Oh, when I was in love with you, + Then I was clean and brave, +And miles around the wonder grew + How well did I behave. + +And now the fancy passes by, + And nothing will remain, +And miles around they'll say that I + Am quite myself again. + -- A.E. Housman +%% +Oh, wow! Look at the moon! +%% +Oh yeah? Well, I remember when sex was dirty and the air was clean. +%% +Oh, yeah, life goes on, long after the thrill of livin' is gone. + -- John Cougar, "Jack and Diane" +%% +Okay, Okay -- I admit it. You didn't change that program that worked +just a little while ago; I inserted some random characters into the +executable. Please forgive me. You can recover the file by typing in +the code over again, since I also removed the source. +%% +Old Grandad is dead but his spirits live on. +%% +Old MacDonald had an agricultural real estate tax abatement. +%% +Old McDonald had a farm, +E-I-E-I-O +And on this farm he had some chicks, +E-I-E-I-O +With a chickie-poo here, and a chickie-poo there, +Here a chick, there a chick, everywhere a whoop-ti-doo, +Old McDonald lost his farm, +'Cause he had too many chicks. +%% +Old age and treachery will overcome youth and skill. +%% +Old age is the harbor of all ills. + -- Bion +%% +Old age is the most unexpected of things that can happen to a man. + -- Trotsky +%% +Old mail has arrived. +%% +Old men are fond of giving good advice to console +themselves for their inability to give bad examples. +%% +Old musicians never die, they just decompose. +%% +Old programmers never die, they just become managers. +%% +Old programmers never die, they just branch to a new address. +%% +Old programmers never die, they just hit account block limit. +%% +Old soldiers never die. Young ones do. +%% +Oliver's Law: + Experience is something you don't get until just after you need it. +%% +Olmstead's Law: + After all is said and done, a hell of a lot more is said than done. +%% +On a clear day, U.C.L.A. +%% +On a clear disk you can seek forever. + -- P. Denning +%% +On a tous un peu peur de l'amour, mais on +a surtout peur de souffrir ou de faire souffrir. + +[One is always a little afraid of love, but +above all, one is afraid of pain or causing pain.] +%% +On ability: + A dwarf is small, even if he stands on a mountain top; + a colossus keeps his height, even if he stands in a well. + -- Lucius Annaeus Seneca, 4BC - 65AD +%% +On day a Monterey daughter +Did scuba down under the water. + She later turned up + The mom of a pup, +And they say t'was a otter that gotter. +%% + On his first day as a bus driver, Maxey Eckstein handed in +receipts of $65. The next day his take was $67. The third day's +income was $62. But on the fourth day, Eckstein emptied no less than +$283 on the desk before the cashier. + "Eckstein!" exclaimed the cashier. "This is fantastic. That +route never brought in money like this! What happened?" + "Well, after three days on that cockamamy route, I figured +business would never improve, so I drove over to Fourteenth Street and +worked there. I tell you, that street is a gold mine!" +%% +On the eighth day, God created FORTRAN. +%% + On the occasion of Nero's 25th birthday, he arrived at the Colosseum +to find that the Praetorian Guard had prepared a treat for him in the arena. +There stood 25 naked virgins, like candles on a cake, tied to poles, burning +alive. "Wonderful!" exclaimed the deranged emperor, "but one of them isn't +dead yet. I can see her lips moving. Go quickly and find out what she is +saying." + The centurion saluted, and hurried out to the virgin, getting as near +the flames as he dared, and listened intently. Then he turned and ran back +to the imperial box. "She is not talking," he reported to Nero, "she is +singing." + "Singing?" said the astounded emperor. "Singing what?" + "Happy birthday to you, happy birthday to you..." +%% +On the whole, I'd rather be in Philadelphia. + -- W.C. Fields' epitaph +%% +Once ... in the wilds of Afghanistan, I lost my corkscrew, +and we were forced to live on nothing but food and water for days. + -- W.C. Fields, "My Little Chickadee" +%% +Once I belonged to a group that really had THE WORD. I fought like hell +for them. But another group came along and exposed the word of my group +as shallow and degenerate. They had a better word. So I quit the first +group and lost all the friends I had made and I joined up with this new +group. I fought like hell for them. But another group came around. They +exposed the word of my group as false and materialistic. Their word was +very much better. So I quit the second group and lost all the friends I +had made. And I joined up with this new group. I fought like hell for them. +Till this one guy came along and proved that there wasn't any word at all. +That I should go off as an individual and grow! So I quit the last group +and lost all the friends I had made. And now I sit home alone all day and +all I do is grow. It would be nice to join up with some others who feel +the way I do. + -- J. Feiffer +%% +Once I finally figured out all of life's +answers, they changed the questions. +%% +Once, I read that a man be never stronger +than when he truly realizes how weak he is. + -- Jim Starlin, "Captain Marvel #31" +%% +Once Law was sitting on the bench + And Mercy knelt a-weeping. +"Clear out!" he cried, "disordered wench! + Nor come before me creeping. +Upon you knees if you appear, +'Tis plain you have no standing here." + +Then Justice came. His Honor cried: + "YOUR states? -- Devil seize you!" +"Amica curiae," she replied -- + "Friend of the court, so please you." +"Begone!" he shouted -- "There's the door -- +I never saw your face before!" +%% +Once a woman has given you her heart you +can never get rid of the rest of her. + -- Vanbrugh +%% +Once a word has been allowed to escape, it cannot be recalled. + -- Quintus Horatius Flaccus (Horace) +%% +Once, adv.: Enough. +%% +Once harm has been done, even a fool understands it. + -- Homer +%% +Once the realization is accepted that even between the closest human beings +infinite distances continue to exist, a wonderful living side by side can +grow up, if they succeed in loving the distance between them which makes it +possible for each to see each other whole against the sky. + -- Rainer Rilke +%% +Once the toothpaste is out of the tube, it's hard to get it back in. + -- H.R. Haldeman +%% + Once there lived a village of creatures along the bottom of a great +crystal river. Each creature in its own manner clung tightly to the twigs +and rocks of the river bottom, for clinging was their way of life, and +resisting the current what each had learned from birth. But one creature +said at last, "I trust that the current knows where it is going. I shall +let go, and let it take me where it will. Clinging, I shall die of boredom." + The other creatures laughed and said, "Fool! Let go, and that current +you worship will throw you tumbled and smashed across the rocks, and you will +die quicker than boredom!" + But the one heeded them not, and taking a breath did let go, and at +once was tumbled and smashed by the current across the rocks. Yet, in time, +as the creature refused to cling again, the current lifted him free from the +bottom, and he was bruised and hurt no more. + And the creatures downstream, to whom he was a stranger, cried, "See +a miracle! A creature like ourselves, yet he flies! See the Messiah, come +to save us all!" And the one carried in the current said, "I am no more +Messiah than you. The river delight to lift us free, if only we dare let go. +Our true work is this voyage, this adventure. + But they cried the more, "Saviour!" all the while clinging to the +rocks, making legends of a Saviour. + -- Richard Bach +%% +Once there was a little nerd who loved to read your mail, +And then yank back the i-access times to get hackers off his tail, +And once as he finished reading from the secretary's spool, +He wrote a rude rejection to her boyfriend (how uncool!) +And this as delivermail did work and he ran his backfstat, +He heard an awful crackling like rat fritters in hot fat, +And hard errors brought the system down 'fore he could even shout! + And the bio bug'll bring yours down too, ef you don't watch out! +And once they was a little flake who'd prowl through the uulog, +And when he went to his blit that night to play at being god, +The ops all heard him holler, and they to the console dashed, +But when they did a ps -ut they found the system crashed! +Oh, the wizards adb'd the dumps and did the system trace, +And worked on the file system 'til the disk head was hot paste, +But all they ever found was this: "panic: never doubt", + And the bio bug'll crash your box too, ef you don't watch out! +When the day is done and the moon comes out, +And you hear the printer whining and the rk's seems to count, +When the other desks are empty and their terminals glassy grey, +And the load is only 1.6 and you wonder if it'll stay, +You must mind the file protections and not snoop around, + Or the bio bug'll getcha and bring the system down! +%% + Once there was a marine biologist who loved dolphins. He spent his +time trying to feed and protect his beloved creatures of the sea. One day, +in a fit of inventive genius, he came up with a serum that would make +dolphins live forever! + Of course he was ecstatic. But he soon realized that in order to mass +produce this serum he would need large amounts of a certain compound that was +only found in nature in the metabolism of a rare South American bird. Carried +away by his love for dolphins, he resolved that he would go to the zoo and +steal one of these birds. + Unbeknownst to him, as he was arriving at the zoo an elderly lion was +escaping from its cage. The zookeepers were alarmed and immediately began +combing the zoo for the escaped animal, unaware that it had simply lain down +on the sidewalk and had gone to sleep. + Meanwhile, the marine biologist arrived at the zoo and procured his +bird. He was so excited by the prospect of helping his dolphins that he +stepped absentmindedly stepped over the sleeping lion on his way back to his +car. Immediately, 1500 policemen converged on him and arrested him for +transporting a myna across a staid lion for immortal porpoises. +%% +Once there was this conductor see, who had a bass problem. You see, during +a portion of Beethovan's Ninth Symphony in which there are no bass violin +parts, one of the bassists always passed a bottle of scotch around. So, +to remind himself that the basses usually required an extra cue towards the +end of the symphony, the conductor would fasten a piece of string around the +page of the score before the bass cue. As the basses grew more and more +inebriated, two of them fell asleep. The conductor grew quite nervous (he +was very concerned about the pitch) because it was the bottom of the ninth; +the score was tied and the basses were loaded with two out. +%% +Once upon a time there... +%% + Once upon a time there was a beautiful young girl taking a stroll +through the woods. All at once she saw an extremely ugly bull frog seated +on a log and to her amazement the frog spoke to her. "Maiden," croaked the +frog, "would you do me a favor? This will be hard for you to believe, but +I was once a handsome, charming prince and then a mean, ugly old witch cast +a spell over me and turned me into a frog." + "Oh, what a pity!", exclaimed the girl. "I'll do anything I can to +help you break such a spell." + "Well," replied the frog, "the only way that this spell can be +taken away is for some lovely young woman to take me home and let me spend +the night under her pillow." + The young girl took the ugly frog home and placed him beneath her +pillow that night when she retired. When she awoke the next morning, sure +enough, there beside her in bed was a very young, handsome man, clearly of +royal blood. And so they lived happily ever after, except that to this day +her father and mother still don't believe her story. +%% + Once upon a time there were three brothers who were knights +in a certain kingdom. And, there was a Princess in a neighboring kingdom +who was of marriageable age. Well, one day, in full armour, their horses, +and their page, the three brothers set off to see if one of them could +win her hand. The road was long and there were many obstacles along the +way, robbers to be overcome, hard terrain to cross. As they coped with +each obstacle they became more and more disgusted with their page. He was +not only inept, he was a coward, he could not handle the horses, he was, +in short, a complete flop. When they arrived at the court of the kingdom, +they found that they were expected to present the Princess with some +treasure. The two older brothers were discouraged, since they had not +thought of this and were unprepared. The youngest, however, had the +answer: Promise her anything, but give her our page. +%% +Once upon a time, when I was training to be a mathematician, a group of +us bright young students taking number theory discovered the names of the +smaller prime numbers. + +2: The Odd Prime -- + It's the only even prime, therefore is odd. QED. +3: The True Prime -- + Lewis Carroll: "If I tell you 3 times, it's true." +31: The Arbitrary Prime -- + Determined by unanimous unvote. We needed an arbitrary prime in + case the prof asked for one, and so had an election. 91 received + the most votes (well, it *looks* prime) and 3+4i the next most. + However, 31 was the only candidate to receive none at all. +41: The Female Prime -- + The polynomial X**2 - X + 41 is + prime for integer values from 1 to 40. +43: The Male Prime - they form a prime pair. + +Since the composite numbers are formed from primes, their qualities +are derived from those primes. So, for instance, the number 6 is "odd +but true", while the powers of 2 are all extremely odd numbers. +%% +Once you've seen one nuclear war, you've seen them all. +%% +Once you've tried to change the world you find +it's a whole bunch easier to change your mind. +%% +One Bell System - it sometimes works. +%% +One Bell System - it used to work before they installed the Dimension! +%% +One Bell System - it works. +%% +One big pile is better than two little piles. + -- Arlo Guthrie +%% +One can never consent to creep when one feels an impulse to soar. + -- Helen Keller +%% +One can search the brain with a microscope and not find the +mind, and can search the stars with a telescope and not find God. + -- J. Gustav White +%% +One can't proceed from the informal to the formal by formal means. +%% + One day a student came to Moon and said, "I understand how to make +a better garbage collector. We must keep a reference count of the pointers +to each cons." + Moon patiently told the student the following story -- "One day a +student came to Moon and said, "I understand how to make a better garbage +collector..." +%% +One day, +A mad meta-poet, +With nothing to say, +Wrote a mad meta-poem +That started: "One day, +A mad meta-poet, +With nothing to say, +Wrote a mad meta-poem +That started: "One day, +[...] +sort of close". +Were the words that the poet, +Finally chose, +To bring his mad poem, +To some sort of close". +Were the words that the poet, +Finally chose, +To bring his mad poem, +To some sort of close". +%% +One difference between a man and a machine +is that a machine is quiet when well oiled. +%% + One evening he spoke. Sitting at her feet, his face raised to her, +he allowed his soul to be heard. "My darling, anything you wish, anything +I am, anything I can ever be... That's what I want to offer you -- not the +things I'll get for you, but the thing in me that will make me able to get +them. That thing -- a man can't renounce it -- but I want to renounce it -- +so that it will be yours -- so that it will be in your service -- only for +you." + The girl smiled and asked: "Do you think I'm prettier than Maggie +Kelly?" + He got up. He said nothing and walked out of the house. He never +saw that girl again. Gail Wynand, who prided himself on never needing a +lesson twice, did not fall in love again in the years that followed. + -- Ayn Rand, "The Fountainhead" +%% +One expresses well the love he does not feel. + -- J.A. Karr +%% +One family builds a wall, two families enjoy it. +%% +One good reason why computers can do more work than +people is that they never have to stop and answer the phone. +%% +One good suit is worth a thousand resumes. +%% +One good thing about music, +Well, it helps you feel no pain. +So hit me with music; +Hit me with music now. + -- Bob Marley, "Trenchtown Rock" +%% +One good turn asketh another. + -- John Heywood +%% +One good turn deserves another. + -- Gaius Petronius +%% +One good turn usually gets most of the blanket. +%% +One hundred and one uses for canned peaches. +One hundred and two if you plan to eat them. +%% +One man tells a falsehood, a hundred repeat it as true. +%% +One man's Mede is another man's Persian. + -- George M. Cohan +%% +One man's constant is another man's variable. + -- A.J. Perlis +%% +One man's "magic" is another man's engineering. +"Supernatural" is a null word. +%% +One man's theology is another man's belly laugh. +%% +One measure of friendship consists not in the number of things friends +can discuss, but in the number of things they need no longer mention. + -- Clifton Fadiman +%% +One meets his destiny often on the road he takes to avoid it. +%% +One morning after an evening of particularly heavy drinking, a man awoke +and upon rolling over in bed saw one of the ugliest women he had ever +seen. As he was about to get out of bed, he looked on the floor and saw +another woman even less appealing than the first. Seeing his look of +wide-eyed amazement, the woman on the floor snapped, "Don't look at me +like that, I was only the bridesmaid." +%% +One nice thing about egotists: they don't talk about other people. +%% +One nuclear bomb can ruin your whole day. +%% +One of my less pleasant chores when I was young was to read the Bible from +one end to the other. Reading the Bible straight through is at least 70 +percent discipline, like learning Latin. But the good parts are, of course, +simply amazing. God is an extremely uneven writer, but when He's good, +nobody can touch him. + -- John Gardner, NYT Book Review, Jan. 1983 +%% +One of the chief duties of the mathematician in acting as an +advisor... is to discourage... from expecting too much from +mathematics. + -- N. Wiener +%% +One of the large consolations for experiencing anything +unpleasant is the knowledge that one can communicate it. + -- Joyce Carol Oates +%% +One of the most expensive things in life +is a girl who is free for the evening. +%% +One of the most striking differences between a +cat and a lie is that a cat has only nine lives. + -- Mark Twain +%% + One of the questions that comes up all the time is: How enthusiastic +is our support for UNIX? + Unix was written on our machines and for our machines many years ago. +Today, much of UNIX being done is done on our machines. Ten percent of our +VAXs are going for UNIX use. UNIX is a simple language, easy to understand, +easy to get started with. It's great for students, great for somewhat casual +users, and it's great for interchanging programs between different machines. +And so, because of its popularity in these markets, we support it. We have +good UNIX on VAX and good UNIX on PDP-11s. + It is our belief, however, that serious professional users will run +out of things they can do with UNIX. They'll want a real system and will end +up doing VMS when they get to be serious about programming. + With UNIX, if you're looking for something, you can easily and quickly +check that small manual and find out that it's not there. With VMS, no matter +what you look for -- it's literally a five-foot shelf of documentation -- if +you look long enough it's there. That's the difference -- the beauty of UNIX +is it's simple; and the beauty of VMS is that it's all there. + -- Ken Olsen, president of DEC, DECWORLD Vol. 8 No. 5, 1984 +[It's been argued that the beauty of UNIX is the same as the beauty of Ken +Olsen's brain. Ed.] +%% +One of the rules of Busmanship, New York style, is never surrender your +seat to another passenger. This may seem callous, but it is the best +way, really. If one passenger were to give a seat to someone who fainted +in the aisle, say, the others on the bus would become disoriented and +imagine they were in Topeka Kansas. +%% +One of the worst of my many faults is that I'm too critical of myself. +%% +One of your most ancient writers, a historian named Herodotus, tells of a +thief who was to be executed. As he was taken away he made a bargain with +the king: in one year he would teach the king's favorite horse to sing +hymns. The other prisoners watched the thief singing to the horse and +laughed. "You will not succeed," they told him. "No one can." + To which the thief replied, "I have a year, and who knows what might +happen in that time. The king might die. The horse might die. I might die. +And perhaps the horse will learn to sing. + -- "The Mote in God's Eye", Niven and Pournelle +%% +One person's error is another person's data. +%% +One picture is worth 128K words. +%% +One picture is worth more than ten thousand words. + -- Chinese proverb +%% +One pill makes you larger And if you go chasing rabbits +And, one pill makes you small. And you know you're going to fall. +And the ones that mother gives you, Tell 'em a hookah smoking caterpillar +Don't do anything at all. Has given you the call. +Go ask Alice Call Alice +When she's ten feet tall. When she was just small. + +When men on the chessboard When logic and proportion +Get up and tell you where to go. Have fallen sloppy dead, +And you've just had some kind of And the White Knight is talking + mushroom backwards +And your mind is moving low. And the Red Queen's lost her head +Go ask Alice Remember what the dormouse said: +I think she'll know. Feed your head. + Feed your head. + Feed your head. + -- Jefferson Airplane, "White Rabbit" +%% +One planet is all you get. +%% +One possible reason why things aren't going +according to plan is that there never was a plan. +%% +One seldom sees a monument to a committee. +%% +One small step for man, one giant stumble for mankind. +%% +One thing the inventors can't seem to +get the bugs out of is fresh paint. +%% +One toke over the line, sweet Mary, +One toke over the line, +Sittin' downtown in a railway station, +One toke over the line. +Waitin' for the train that goes home, +Hopin' that the train is on time, +Sittin' downtown in a railway station, +One toke over the line. +%% +One, two, three, four +What are we fighting for? +Don't ask me I don't give a damn. +Next stop is Vietnam. +Five, six, seven, eight +Open up the pearly gates. +Ain't no time to wonder why +Whoopie! We're all going to die. + -- Country Joe and the Fish +%% +One way to stop a run away horse is to bet on him. +%% +Only God can make random selections. +%% +Only a fool has no doubts. +%% +Only a mediocre person is always at his best. + -- Laurence Peter +%% +Only adults have difficulty with childproof caps. +%% +Only fools are quoted. + -- Anonymous +%% +Only someone with nothing to be sorry for +smiles back at the rear of an elephant. +%% +Only that in you which is me can hear what I'm saying. + -- Baba Ram Dass +%% +Only the fittest survive. The vanquished acknowledge their unworthiness by +placing a classified ad with the ritual phrase "must sell -- best offer," +and thereafter dwell in infamy, relegated to discussing gas mileage and lawn +food. But if successful, you join the elite sodality that spends hours +unpurifying the dialect of the tribe with arcane talk of bits and bytes, RAMS +and ROMS, hard disks and baud rates. Are you obnoxious, obsessed? It's a +modest price to pay. For you have tapped into the same awesome primal power +that produces credit-card billing errors and lost plane reservations. Hail, +postindustrial warrior, subduer of Bounceoids, pride of the cosmos, keeper of +the silicone creed: Computo, ergo sum. The force is with you -- at 110 volts. +May your RAMS be fruitful and multiply. + -- Curt Suplee, "Smithsonian", 4/83 +%% +Only those who leisurely approach that which the masses are +busy about can be busy about that which the masses take leisurely. + -- Lao Tsu +%% +Only way to open lips of pigeon, sledgehammer. +%% +Ontogeny recapitulates phylogeny. +%% +Onward through the fog. +%% +Ooops. Gotta run. My dog wants sex. Later. +%% +Operator, please trace this call and tell me where I am. +%% +Opium is very cheap considering you don't +feel like eating for the next six days. + -- Taylor Mead, famous transvestite +%% +Oppernockity tunes but once. +%% +Opportunities are usually disguised as hard +work, so most people don't recognize them. +%% +Optimization hinders evolution. +%% +Or you or I must yield up his life to Ahrimanes. I would rather it were you. +I should have no hesitation in sacrificing my own life to spare yours, but +we take stock next week, and it would not be fair on the company. + -- J. Wellington Wells +%% +Orcs really aren't so bad (if you use lots of catsup). +%% +Order and simplification are the first steps toward +mastery of a subject -- the actual enemy is the unknown. + -- Thomas Mann +%% +Oreo +%% +Organic chemistry is the chemistry of carbon compounds. +Biochemistry is the study of carbon compounds that crawl. + -- Mike Adams +%% +Osborn's Law: + Variables won't; constants aren't. +%% +Other than that, Mrs. Lincoln, how did you like the play? +%% +Other women cloy +The appetites they feed, but she makes hungry +Where most she satisfies. + -- Antony and Cleopatra +%% +Others will look to you for stability, +so hide when you bite your nails. +%% +Our OS who art in CPU, UNIX be thy name. +Thy programs run, thy syscalls done, +In kernel as it is in user. +%% +Our business in life is not to succeed +but to continue to fail in high spirits. + -- Robert Louis Stevenson +%% +Our country has plenty of good five-cent cigars, +but the trouble is they charge fifteen cents for them. +%% +Our houseplants have a good sense of humous. +%% +Our little systems have their day; +They have their day and cease to be; +They are but broken lights of thee. + -- Tennyson +%% +Our policy is, when in doubt, do the right thing. + -- Roy L. Ash, ex-president, Litton Industries +%% +Our problems are so serious that the best +way to talk about them is lightheartedly. +%% + "Our school, madame, postulates, first of all, that since the +science of mathematics is an abstract science, it is best inculcated by +some concrete example." + Said the Queen, "But that sounds rather complicated." + "It occasionally leads to complications," Jurgen admitted, "through +a choice of the wrong example. But the axiom is no less true." + "Come, then, and sit next to me on this couch if you can find it in +the dark; and do you explain to me what you mean." + "Why, madame, by a concrete example I mean one that is perceptible +to any of the senses -- as to sight or hearing, or touch --" + "Oh, oh!" said the Queen, "now I perceive what you mean by a concrete +example. And grasping this, I can understand that complications must of +course arise from a choice of the wrong example." + -- James Branch Cabell, "Jurgen" +%% +Our sires' age was worse that our grandsires'. +We their sons are more worthless than they: +so in our turn we shall give the world a progeny yet more corrupt. + -- Quintus Horatius Flaccus (Horace) +%% +Our swords shall play the orators for us. + -- Christopher Marlowe +%% +Ours is a world where people don't know what they +want and are willing to go through hell to get it. +%% +Out of sight is out of mind. + -- Arthur Clough +%% +Out of the crooked timber of humanity no straight thing can ever be made. + -- Immanuel Kant +%% +Out of the mouths of babes does often come cereal. +%% +Over the shoulder supervision is more a +need of the manager than the programming task. +%% +Overconfidence breeds error when we take for granted that the game will +continue on its normal course; when we fail to provide for an unusually +powerful resource -- a check, a sacrifice, a stalemate. Afterwards the +victim may wail, `But who could have dreamt of such an idiotic-looking +move?' + -- Fred Reinfeld, "The Complete Chess Course" +%% +Overflow on /dev/null, please empty the bit bucket. +%% +Overload -- core meltdown sequence initiated. +%% +Owe no man any thing... + -- Romans 13:8 +%% +Ozman's Laws: + (1) If someone says he will do something "without fail," he won't. + (2) The more people talk on the phone, the less money they make. + (3) People who go to conferences are the ones who shouldn't. + (4) Pizza always burns the roof of your mouth. +%% +PAIN: + One thing, at least it proves that you're alive! +%% +PAIN: + Sliding down a 50-foot razor blade into a bucket of alcohol. +%% +PARANOIA: + A healthy understanding of the way the universe works. +%% +PARTY: + A gathering where you meet people who drink + so much you can't even remember their names. +%% +PASCAL: + A programming language named after a man who would turn over + in his grave if he knew about it. + -- Datamation, January 15, 1984 +%% +PATENT: + A method of publicizing inventions so others can copy them. +%% +PAYCHECK: + The weekly $5.27 that remains after deductions for federal + withholding, state withholding, city withholding, FICA, + medical/dental, long-term disability, unemployment insurance, + Christmas Club, and payroll savings plan contributions. +%% +PEACE: + In international affairs, a period of + cheating between two periods of fighting. + -- Ambrose Bierce +%% +PEEPING TOM: + A window fan. +%% +PENGUINICITY!! +%% +PENSION: + A federally insured chain letter. +%% +PERFECT GUEST: + One who makes his host feel at home. +%% +PERFORMANCE: + A statement of the speed at which a computer system works. Or + rather, might work under certain circumstances. Or was rumored + to be working over in Jersey about a month ago. +%% +PESSIMIST: + A man who spends all his time worrying + about how he can keep the wolf from the door. + +OPTIMIST: + A man who refuses to see the wolf + until he seizes the seat of his pants. + +OPPORTUNIST: + A man who invites the wolf in and + appears the next day in a fur coat. +%% +PHILOSOPHY: + The ability to bear with calmness + the misfortunes of our friends. +%% +PHILOSOPHY: + Unintelligible answers to insoluble problems. +%% +PIG: + An animal (Porcus omnivorous) closely allied to the human + race by the splendor and vivacity of its appetite, which, + however, is inferior in scope, for it balks at pig. + -- Ambrose Bierce +%% +PISCES (Feb. 19 - Mar. 20) + You have a vivid imagination and often think you are being followed + by the CIA or FBI. You have minor influence over your associates + and people resent your flaunting of your power. You lack confidence + and you are generally a coward. Pisces people do terrible things to + small animals. +%% +PISCES (Feb.19 - Mar.20) + You will get some very interesting news of a promotion today. + It will go to someone in the office you dislike and will be the + job you wanted. Don't lend anyone a car today. You don't have + a car. +%% +P-K4 +%% +PL/1, "the fatal disease", belongs more +to the problem set than to the solution set. + -- E.W. Dijkstra +%% +PLATONIC FRIENDSHIP: + What develops when two people get + tired of making love to each other. +%% +PLEASE DON'T SMOKE HERE! + +Penalty: An early, lingering death from cancer, + emphysema, or other smoking-caused ailment. +%% +PLUG IT IN!!! +%% +PLUNDERER'S THEME + (to Supercalifragilisticexpialidocius) + +Pillage, rape, and loot and burn, but all in moderation. +If you do the things we say, then you'll soon rule the nation. +Kill your foes and enemies and then kill your relations. +Pillage, rape, and loot and burn, but all in moderation. +%% +POLITICIAN: + From the Greek 'poly' ("many") and the French 'tete' ("head" or + "face," as in 'tete-a-tete': head to head or face to face). + Hence 'polytetien', a person of two or more faces. + -- Martin Pitt +%% +POLYGON: + Dead parrot. +%% +POSITIVE: + Being mistaken at the top of your voice. +%% +POVERTY: + An unfortunate state that persists as long + as anyone lacks anything he would like to have. +%% +POWER: + The only narcotic regulated by the SEC instead of the FDA. +%% +PPRB -- Pillage, plunder, rape and burn. +%% +PRAIRIES: + Vast plains covered by treeless forests. +%% +PROGRAM: + Any task that can't be completed in one telephone call or one + day. Once a task is defined as a program ("training program," + "sales program," or "marketing program"), its implementation + always justifies hiring at least three more people. +%% +PROGRESS: + Medieval man thought disease was caused by invisible demons + invading the body and taking possession of it. + + Modern man knows disease is caused by microscopic bacteria + and viruses invading the body and causing it to malfunction. +%% +PROMOTION FROM WITHIN: + A system of moving incompetents up to the policy-making + level where they can't foul up operations. +%% +PROMOTION: + New title, new salary, new office, same old crap. +%% +PURGE COMPLETE. +%% +Pain is just God's way of hurting you. +%% +Paranoia doesn't mean the whole world isn't out to get you. +%% +Paranoia is heightened awareness. +%% +Paranoia is simply an optimistic outlook on life. +%% +Paranoids are people, too; they have their own problems. It's easy +to criticize, but if everybody hated you, you'd be paranoid too. + -- D.J. Hicks +%% +Pardon me while I laugh. +%% +Pardo's First Postulate: + Anything good in life is either illegal, immoral, or fattening. + +Arnold's Addendum: + Anything not fitting into these categories causes cancer in rats. +%% +Parkinson's Fifth Law: + If there is a way to delay in important decision, the good + bureaucracy, public or private, will find it. +%% +Parkinson's Fourth Law: + The number of people in any working group tends to increase + regardless of the amount of work to be done. +%% +Parkinson's Law: + Work expands to fill the time available for its completion. +%% +Parts that positively cannot be assembled in improper order will be. +%% +Pascal Users: + The Pascal system will be replaced next Tuesday by Cobol. + Please modify your programs accordingly. +%% +Pascal Users: + To show respect for the 313th anniversary (tomorrow) of the + death of Blaise Pascal, your programs will be run at half speed. +%% +Pascal is not a high-level language. + -- Steven Feiner +%% +Passionate hatred can give meaning and purpose to an empty life. + -- Eric Hoffer +%% +Password: +%% +Passwords are implemented as a result of insecurity. +%% +Patch griefs with proverbs. + -- William Shakespeare, "Much Ado About Nothing" +%% +Patience is a minor form of despair, disguised as virtue. + -- Ambrose Bierce, on qualifiers +%% +Patience is the best remedy for every trouble. + -- Titus Maccius Plautus +%% +Pauca sed matura. (Few but excellent.) + -- Gauss +%% +Paul Revere was a tattle-tale. +%% +Paulg's Law: + In America, it's not how much an + item costs, it's how much you save. +%% +Paul's Law: + You can't fall off the floor. +%% +Pause for storage relocation. +%% +Payeen to a Twang +Derrida +Ore-Ida +potato. + +If you dared, +I'd ask you +to go dig +up your ides under brown- +tubered skies. + +where pitchforked +you will ask +Derrida? +%% +Paying alimony is like pumping gas into another man's car. +%% +Peace be to this house, and all that dwell in it. +%% +Peace cannot be kept by force; it +can only be achieved by understanding. + -- A. Einstein +%% +Peace is much more precious than a piece +of land... let there be no more wars. + -- Mohammed Anwar Sadat, 1918-1981 +%% +Peanut Blossoms + +4 cups sugar 16 tbsp. milk +4 cups brown sugar 4 tsp. vanilla +4 cups shortening 14 cups flour +8 eggs 4 tsp. soda +4 cups peanut butter 4 tsp. salt + +Shape dough into balls. Roll in sugar and bake on ungreased +cookie sheet at 375 F. for 10-12 minutes. Immediately top +each cookie with a Hershey's kiss or star pressing down firmly +to crack cookie. Makes a hell of a lot. +%% +Pecor's Health-Food Principle: + Never eat rutabaga on any day of + the week that has a "y" in it. +%% +Pelorat sighed. + "I will never understand people." + "There's nothing to it. All you have to do is take a close look +at yourself and you will understand everyone else. How would Seldon have +worked out his Plan -- and I don't care how subtle his mathematics was -- +if he didn't understand people; and how could he have done that if people +weren't easy to understand? You show me someone who can't understand +people and I'll show you someone who has built up a false image of himself +-- no offense intended." + -- Asimov, "Foundation's Edge" +%% +People are beginning to notice you. +Try dressing before you leave the house. +%% +People are unconditionally guaranteed to be full of defects. +%% +People humiliating a salami! +%% +People in general do not willingly read +if they have anything else to amuse them. + -- S. Johnson +%% + People of all sorts of genders are reporting great difficulty, +these days, in selecting the proper words to refer to those of the female +persuasion. + "Lady," "woman," and "girl" are all perfectly good words, but +misapplying them can earn one anything from the charge of vulgarity to a good +swift smack. We are messing here with matters of deference, condescension, +respect, bigotry, and two vague concepts, age and rank. It is troubling +enough to get straight who is really what. Those who deliberately misuse +the terms in a misbegotten attempt at flattery are asking for it. + A woman is any grown-up female person. A girl is the un-grown-up +version. If you call a wee thing with chubby cheeks and pink hair ribbons a +"woman," you will probably not get into trouble, and if you do, you will be +able to handle it because she will be under three feet tall. However, if you +call a grown-up by a child's name for the sake of implying that she has a +youthful body, you are also implying that she has a brain to match. +%% +People of privilege will always risk their complete destruction +rather than surrender any material part of their advantage. + -- John Kenneth Galbraith +%% +People often find it easier to be a +result of the past than a cause of the future. +%% +People respond to people who respond. +%% +People seem to think that the blanket phrase, "I only work here," +absolves them utterly from any moral obligation in terms of the +public -- but this was precisely Eichmann's excuse for his job in +the concentration camps. +%% +People think love is an emotion. Love is good sense. + -- Ken Kesey +%% +People usually get what's coming to them -- unless it's been mailed. +%% +People who claim they don't let little things bother +them have never slept in a room with a single mosquito. +%% +People who have no faults are terrible; +there is no way of taking advantage of them. +%% +People who have what they want are very fond of telling +people who haven't what they want that they don't want it. + -- Ogden Nash +%% +People who make no mistakes do not usually make anything. +%% +People who push both buttons should get their wish. +%% +People who take cat naps don't usually sleep in a cat's cradle. +%% +People who think they know everything +greatly annoy those of us who do. +%% +People will buy anything that's one to a customer. +%% +People with narrow minds usually have broad tongues. +%% +People's Action Rules: + (1) Some people who can, shouldn't. + (2) Some people who should, won't. + (3) Some people who shouldn't, will. + (4) Some people who can't, will try, regardless. + (5) Some people who shouldn't, but try, will then blame others. +%% +Per buck you get more computing action with the small computer. + -- R.W. Hamming +%% +Pereant, inquit, qui ante nos nostra dixerunt. +[Confound those who have said our remarks before us.] +or +[May they perish who have expressed our bright ideas before us.] + -- Aelius Donatus +%% +Perfect day for scrubbing the floor and other exciting things. +%% +Perfection is finally attained, not when there is no longer +anything to add, but when there is no longer anything to take away. + -- Antoine de Saint-Exupery +%% +Perhaps, after all, America never has been discovered. +I myself would say that it had merely been detected. + -- Oscar Wilde +%% +Perhaps no person can be a poet, or even enjoy +poetry without a certain unsoundness of mind. + -- Thomas Macaulay +%% +Perhaps the biggest disappointments were the ones you expected anyway. +%% +Perhaps the most widespread illusion is that if we were in power we would +behave very differently from those who now hold it -- when, in truth, in +order to get power we would have to become very much like them. (Lenin's +fatal mistake, both in theory and in practice.) +%% +Perilous to all of us are the devices of +an art deeper than we ourselves possess. + -- Gandalf the Grey +%% +Pete: Waiter, this meat is bad. +Waiter: Who told you? +Pete: A little swallow. +%% +Peter's Law of Substitution: + Look after the molehills, and the + mountains will look after themselves. + +Peter's Principle of Success: + Get up one time more than you're knocked down. + +Peter's Principle: + In every hierarchy, each employee tends + to rise to the level of his incompetence. +%% +Peter's hungry, time to eat lunch. +%% +Peterson's Admonition: + When you think you're going down for the third time -- + just remember that you may have counted wrong. +%% +Peterson's Rules: + (1) Trucks that overturn on freeways + are filled with something sticky. + (2) No cute baby in a carriage is ever a girl when called one. + (3) Things that tick are not always clocks. + (4) Suicide only works when you're bluffing. +%% +Phasers locked on target, Captain. +%% +Philadelphia is not dull -- it just seems so +because it is next to exciting Camden, New Jersy. +%% +Philogyny recapitulates erogeny; erogeny recapitulates philogyny. +%% +Phone call for chucky-pooh. +%% +Photographing a volcano is just about +the most miserable thing you can do. + -- Robert B. Goodman + [Who has clearly never tried to use a PDP-10. Ed.] +%% +Picking up the pieces of my sweet shattered dream, +I wonder how the old folks are tonight, +Her name was Ann, and I'll be damned if I recall her face, +She left me not knowing what to do. + +Carefree Highway, let me slip away on you, +Carefree Highway, you seen better days, +The morning after blues, from my head down to my shoes, +Carefree Highway, let me slip away, slip away, on you... + +Turning back the pages to the times I love best, +I wonder if she'll ever do the same, +Now the thing that I call livin' is just bein' satisfied, +With knowing I got noone left to blame. +Carefree Highway, I got to see you, my old flame... + +Searching through the fragments of my dream shattered sleep, +I wonder if the years have closed her mind, +I guess it must be wanderlust or tryin' to get free, +From the good old faithful feelin' we once knew. + -- Gordon Lightfoot, "Carefree Highway" +%% +Pickle's Law: + If Congress must do a painful thing, + the thing must be done in an odd-number year. +%% +Piddle, twiddle, and resolve, +Not one damn thing do we solve. +%% +Piece of cake! + -- G.S. Koblas +%% + Pittsburgh driver's test +10: Potholes are + a) extremely dangerous. + b) patriotic. + c) the fault of the previous administration. + d) all going to be fixed next summer. +The correct answer is b. +Potholes destroy unpatriotic, unamerican, imported cars, since the holes +are larger than the cars. If you drive a big, patriotic, American car +you have nothing to worry about. +%% + Pittsburgh driver's test +2: A traffic light at an intersection changes from yellow to red, you should + a) stop immediately. + b) proceed slowly through the intersection. + c) blow the horn. + d) floor it. +The correct answer is d. +If you said c, you were almost right, so give yourself a half point. +%% + Pittsburgh driver's test +3: When stopped at an intersection you should + a) watch the traffic light for your lane. + b) watch for pedestrians crossing the street. + c) blow the horn. + d) watch the traffic light for the intersecting street. +The correct answer is d. +You need to start as soon as the traffic light for the intersecting +street turns yellow. +Answer c is worth a half point. +%% + Pittsburgh driver's test +4: Exhaust gas is + a) beneficial. + b) not harmful. + c) toxic. + d) a punk band. +The correct answer is b. +The meddling Washington eco-freak communist bureaucrats who say otherwise +are liars. (Message to those who answered d. Go back to California where +you came from. Your kind are not welcome here.) +%% + Pittsburgh driver's test +5: Your car's horn is a vital piece of safety equipment. + How often should you test it? + a) once a year. + b) once a month. + c) once a day. + d) once an hour. +The correct answer is d. +You should test your car's horn at least once every hour, +and more often at night or in residential neighborhoods. +%% + Pittsburgh driver's test +7: The car directly in front of you has a flashing right tail light + but a steady left tail light. + a) One of the tail lights is broken. You should blow your + horn to call the problem to the driver's attention. + b) The driver is signaling a right turn. + c) The driver is signaling a left turn. + d) The driver is from out of town. +The correct answer is d. +Tail lights are used in some foreign countries to signal turns. +%% + Pittsburgh driver's test +8: Pedestrians are + a) irrelevant. + b) communists. + c) a nuisance. + d) difficult to clean off the front grille. +The correct answer is a. Pedestrians are not in cars, so they +are totally irrelevant to driving, and you should ignore them +completely. +%% + Pittsburgh driver's test +9: Roads are salted in order to + a) kill grass. + b) melt snow. + c) help the economy. + d) prevent potholes. +The correct answer is c. +Road salting employs thousands of persons directly, and millions more +indirectly, for example, salt miners and rustproofers. Most important, +salting reduces the life spans of cars, thus stimulating the car and +steel industries. +%% +Plagiarize, plagiarize, +Let no man's work evade your eyes, +Remember why the good Lord made your eyes, +Don't shade your eyes, +But plagiarize, plagiarize, plagiarize. +Only be sure to call it research. + -- Tom Lehrer +%% +Planet Claire has pink hair. +All the trees are red. +No one ever dies there. +No one has a head.... +%% +Plastic... Aluminum... These are the inheritors of the Universe! +Flesh and Blood have had their day... and that day is past! + -- Green Lantern Comics +%% +Plato, by the way, wanted to banish all poets from his proposed Utopia +because they were liars. The truth was that Plato knew philosophers +couldn't compete successfully with poets. + -- Kilgore Trout, "Venus on the Half Shell" +%% +Please don't put a strain on our friendship +by asking me to do something for you. +%% +Please don't recommend me to your friends-- +it's difficult enough to cope with you alone. +%% +Please forgive me if, in the heat of battle, +I sometimes forget which side I'm on. +%% +Please go away. +%% +Please help keep the world clean: others may wish to use it. +%% +Please ignore previous fortune. +%% +Please keep your hands off the secretary's reproducing equipment. +%% +Please, Mother! I'd rather do it myself! +%% +Please remain calm, it's no use both of +us being hysterical at the same time. +%% +Please stand for the Nation Anthem: + + O Canada + Our home and native land + True patriot love + In all thy sons' command + With glowing hearts we see thee rise + The true north strong and free + From far and wide, O Canada + We stand on guard for thee + God keep our land glorious and free + O Canada we stand on guard for thee + O Canada we stand on guard for thee + +Thank you. You may resume your seat. +%% +Please stand for the National Anthem: + + God save our Gracious Queen! + Long live our Noble Queen! + God save the Queen! + Send her victorious, + Happy and glorious, + Long to reign o'er us! + God save the Queen! + +Thank you. You may resume your seat. +%% +Please stand for the National Anthem: + + Oh, say can you see by dawn's early light + What so proudly we hailed at the twilight's last gleaming? + Whose broad stripes and bright stars through the perilous flight + O'er the ramparts we watched were so gallantly streaming? + And the rockets' red glare, the bombs bursting in air, + Gave proof through the night that our flag was still there. + Oh, say does that star-spangled banner yet wave + O'er the land of the free and the home of the brave? + +Thank you. You may resume your seat. +%% +Please take note: +%% +Please try to limit the amount of "this room doesn't have any bazingas" +until you are told that those rooms are "punched out." Once punched out, +we have a right to complain about atrocities, missing bazingas, and such. + -- N. Meyrowitz +%% +Please, won't somebody tell me what diddie-wa-diddie means? +%% +Plots are like girdles. Hidden, they hold your interest; revealed, they're +of no interest except to fetishists. Like girdles, they attempt to contain +an uncontainable experience. + -- R.S. Knapp +%% +Plus ca change, plus c'est le meme chose. +%% +Pohl's law: + Nothing is so good that somebody, somewhere, will not hate it. +%% +Political speeches are like steer horns. A point +here, a point there, and a lot of bull inbetween. + -- Alfred E. Neuman +%% +Political television commercials prove one thing: some candidates +can tell all their good points and qualifications in just 30 seconds. +%% +Politicians are the same everywhere. They promise +to build a bridge even where there is no river. + -- Nikita Khrushchev +%% +Politics are almost as exciting as war, and quite as +dangerous. In war, you can only be killed once. + -- Winston Churchill +%% +Politics is like coaching a football team. You have to be smart +enough to understand the game but not smart enough to lose interest. +%% +Politics, like religion, hold up the +torches of matrydom to the reformers of error. + -- Thomas Jefferson +%% +Pollyanna's Educational Constant: + The hyperactive child is never absent. +%% +Polymer physicists are into chains. +%% +Poorman's Rule: + When you pull a plastic garbage bag from its handy dispenser + package, you always get hold of the closed end and try to + pull it open. +%% +Populus vult decipi. +[The people like to be deceived.] +%% +Porsche; there simply is no substitute. + -- Risky Business +%% +Possessions increase to fill the space available for their storage. + -- Ryan +%% +Post proelium, praemium. +[After the battle, the reward.] +%% +Postmen never die, they just lose their zip. +%% +Poverty begins at home. +%% +Power is poison. +%% +Power is the finest token of affection. +%% +Power, like a desolating pestilence, +Pollutes whate'er it touches... + -- Percy Bysshe Shelley +%% +Power tends to corrupt, absolute power corrupts absolutely. + -- Lord Acton +%% +Practical people would be more practical if +they would take a little more time for dreaming. + -- J.P. McEvoy +%% +Practically perfect people never permit +sentiment to muddle their thinking. + -- Mary Poppins +%% +Practice is the best of all instructors. + -- Publilius +%% +Practice yourself what you preach. + -- Titus Maccius Plautus +%% +Praise the sea; on shore remain. + -- John Florio +%% +Predestination was doomed from the start. +%% +Prejudice: + A vagrant opinion without visible means of support. + -- Ambrose Bierce +%% +Premature optimization is the root of all evil. + -- D.E. Knuth +%% +Preserve Wildlife! Throw a party today! +%% +Preserve the old, but know the new. +%% +Preserve wildlife -- pickle a squirrel today! +%% +President Reagan has noted that there are too many economic +pundits and forecasters and has decided on an excess prophets tax. +%% +President Thieu says he'll quit if he doesn't get more than 50% +of the vote. In a democracy, that's not called quitting. + -- The Washington Post +%% +Pretend to spank me -- I'm a pseudo-masochist! +%% +Preudhomme's Law of Window Cleaning: + It's on the other side. +%% +Price's Advice: + It's all a game -- play it to have fun. +%% +[Prime Minister Joseph] Chamberlain loves +the working man, he loves to see him work. + -- Winston Churchill +%% +[Prime Minister MacDonald] has the gift of compressing the +largest amount of words into the smallest amount of thought. + -- Winston Churchill +%% +Prince Hamlet thought Uncle a traitor +For having it off with his Mater; + Revenge Dad or not? + That's the gist of the plot, +And he did -- nine soliloquies later. + -- Stanley J. Sharpless +%% +Princeton's taste is sweet like a strawberry tart. Harvard's is a subtle +taste, like whiskey, coffee, or tobacco. It may even be a bad habit, for +all I know. + -- Prof. J.H. Finley '25 +%% +Prisons are built with stones of Law, brothels with bricks of Religion. + -- Blake +%% +Prizes are for children. + -- Charles Ives, + upon being given, but refusing, the Pulitzer prize +%% +Pro is to con as progress is to Congress. +%% +Probable-Possible, my black hen, +She lays eggs in the Relative When. +She doesn't lay eggs in the Positive Now +Because she's unable to postulate How. + -- Frederick Winsor +%% +Profanity is the one language all programmers know best. +%% +Professor Gorden Newell threw another shutout in last week's Chem Eng. +130 midterm. Once again a student did not receive a single point on +his exam. Newell has now tossed 5 shutouts this quarter. Newell's +earned exam average has now dropped to a phenomenal 30%. +%% +Programmers do it bit by bit. +%% +Programmers do it until it goes down. +%% +Programmers get overlaid. +%% +Programmers used to batch environments may find it hard to live +without giant listings; we would find it hard to use them. + -- D.M. Ritchie +%% +Programming Department: + Mistakes made while you wait. +%% +Programming is an unnatural act. +%% +Progress is impossible without change, and those who +cannot change their minds cannot change anything. + -- G.B. Shaw +%% +Progress means replacing a theory that +is wrong with one more subtly wrong. +%% +Progress might have been all right once, but it's gone on too long. + -- Ogden Nash +%% +Promise her anything, but give her Exxon unleaded. +%% +Promising costs nothing, it's the delivering that kills you. +%% +Promptness is its own reward, if one lives by the clock instead of the sword. +%% +Proof techniques #1: Proof by Induction. + +This technique is used on equations with 'n' in them. Induction +techniques are very popular, even the military use them. + +SAMPLE: Proof of induction without proof of induction. + + We know it's true for n equal to 1. Now assume that it's true +for every natural number less than n. N is arbitrary, so we can take n +as large as we want. If n is sufficiently large, the case of n+1 is +trivially equivalent, so the only important n are n less than n. We can +take n = n (from above), so it's true for n+1 becuase it's just about n. + QED. (QED translates from the Latin as "So what?") +%% +Proof techniques #2: Proof by Oddity. + SAMPLE: To prove that horses have an infinite number of legs. +[1] Horses have an even number of legs. +[2] They have two legs in back and fore legs in front. +[3] This makes a total of six legs, + which certainly is an odd number of legs for a horse. +[4] But the only number that is both odd and even is infinity. +[5] Therefore, horses must have an infinite number of legs. + +Topics is be covered in future issues include proof by: + intimidation, + gesticulation (handwaving), + "try it; it works", + constipation (I was just sitting there and...), + blatant assertion, + changing all the 2's to n's, + mutual consent, + lack of a counterexample, and, + "it stands to reason". +%% +Proper treatment will cure a cold in seven days, +but left to itself, a cold will hang on for a week. + -- Darrell Huff +%% +Prosperity makes friends, adversity tries them. + -- Publilius Syrus +%% +Prototype designs always work. + -- Don Vonada +%% +Providence New Jersey is one of the few cities +where Velveeta cheese appears on the gourmet shelf. +%% +Prunes give you a run for your money. +%% +Pryor's Observation: + How long you live has nothing to do + with how long you are going to be dead. +%% +Psychiatrists say that one out of four people are mentally ill. +Check three friends. If they're okay, you're it. +%% +Psychiatry is quite similar to prostitution, only less honest. They +both promise to make people feel better, but the prostitute doesn't +make pretensions that the feelings will last once the client walks +out the door. +%% +Public use of any portable music system is a +virtually guaranteed indicator of sociopathic tendencies. + -- Zoso +%% +Publishing a volume of verse is like dropping +a rose petal down the Grand Canyon and waiting for the echo. +%% +Pudder's Law: + Anything that begins well will end badly. + (Note: The converse of Pudder's law is not true.) +%% +Push where it gives and scratch where it itches. +%% +Put all your eggs in one basket and -- WATCH THAT BASKET. + -- Mark Twain +%% +Put another password in, +Bomb it out, then try again. +Try to get past logging in, +We're hacking, hacking, hacking. + +Try his first wife's maiden name, +This is more than just a game. +It's real fun, but just the same, +It's hacking, hacking, hacking. +%% +Put cats in the coffee and mice in the tea! +%% +Put not your trust in money, but put your money in trust. +%% +Put your Nose to the Grindstone! + -- Amalgamated Plastic Surgeons and Toolmakers, Ltd. +%% +Put your best foot forward. +Or just call in and say you're sick. +%% +Put your brain in gear before starting your mouth in motion. +%% +Put your trust in those who are worthy. +%% +Putt's Law: + Technology is dominated by two types of people: + Those who understand what they do not manage. + Those who manage what they do not understand. +%% +Q: Are we not men? +A: We are Vaxen. +%% +Q: Do you know what the death rate around here is? +A: One per person. +%% +QED. +%% +Q: Have you heard about the man who didn't pay for his exorcism? +A: He got re-possessed! +%% +Q: How can we get the Beatles to reunite for one more concert? +A: With three more bullets. +%% +Q: How can you tell if an elephant is having an affair with + your wife? +A: You have to wait 22 months. +%% +Q: How can you tell if an elephant is sitting on your back + in a hurricane? +A: You can hear his ears flapping in the wind. +%% +Q: How can you tell when a Burroughs salesman is lying? +A: When his lips move. +%% +Q: How did the elephant get to the top of the oak tree? +A: He sat on a acorn and waited for spring. + +Q: But how did he get back down? +A: He crawled out on a leaf and waited for autumn. +%% +Q: How do you catch a unique rabbit? +A: Unique up on it! + +Q: How do you catch a tame rabbit? +A: The tame way! +%% +Q: How do you keep a moron in suspense? +%% +Q: How do you make an elephant float? +A: You get two scoops of elephant and some rootbeer... +%% +Q: How do you stop an elephant from charging? +A: Take away his credit cards. +%% +Q: How does a hacker fix a function which + doesn't work for all of the elements in its domain? +A: He changes the domain. +%% +Q: How many Californians does it take to screw in a lightbulb? +A: Five. One to screw in the lightbulb and four to share the + experience. (Actually, Californians don't screw in + lightbulbs, they screw in hot tubs.) + +Q: How many Oregonians does it take to screw in a light bulb? +A: Three. One to screw in the lightbulb and two to fend off all + those Californians trying to share the experience. +%% +Q: How many DEC repairman does it take to fix a flat? +A: Five; four to hold the car up and one to swap tires. + +Q: How long does it take? +A: It's indeterminate. + It will depend upon how many flats they've brought with them. + +Q: What happens if you've got TWO flats? +A: They replace your generator. +%% +Q: How many IBM 370's does it take to execute a job? +A: Four, three to hold it down, and one to rip its head off. +%% +Q: How many IBM CPU's does it take to do a logical right shift? +A: 33. 1 to hold the bits and 32 to push the register. +%% +Q: How many WASP's does it take to change a lightbulb? +A: One. +%% +Q: How many college football players does it take to screw in a lightbulb? +A: Only one, but he gets three credits for it. +%% +Q: How many hardware engineers does it take to change a lightbulb? +A: None. We'll fix it in software. + +Q: How many system programmers does it take to change a light bulb? +A: None. The application can work around it. + +Q: How many software engineers does it take to change a lightbulb? +A: None. We'll document it in the manual. + +Q: How many tech writers does it take to change a lightbulb? +A: None. The user can figure it out. +%% +Q: How many journalists does it take to screw in a lightbulb? +A: Three. One to report it as an inspired government program to bring + light to the people, one to report it as a diabolical government plot + to deprive the poor of darkness, and one to win a Pulitzer prize for + reporting that Electric Company hired a lightbulb-assassin to break + the bulb in the first place. +%% +Q: How many people from New Jersey does it take to change a light + bulb? +A: Three. One to do it, one to watch, and the third to shoot the + witness. +%% +Q: How many psychiatrists does it take to change a light bulb? +A: Only one, but it takes a long time, and the light bulb has + to really want to change. +%% +Q: How many surrealists does it take to change a light bulb? +A: Two, one to hold the giraffe, and the other to fill the + bathtub with brightly colored machine tools. +%% +Q: How much does it cost to ride the Unibus? +A: 2 bits. +%% +Q: How was Thomas J. Watson buried? +A: 9 edge down. +%% +Q: Know what the difference between your latest project + and putting wings on an elephant is? +A: Who knows? The elephant *might* fly, heh, heh... +%% +QUALITY CONTROL: + The process of testing one out of every 1,000 units coming off a + production line to make sure that at least one out of 100 works. +%% +QUARK: + The sound made by a well bred duck. +%% +QWERT (kwirt) n. [MW < OW qwertyuiop, a thirteenth] 1. a unit of weight +equal to 13 poiuyt avoirdupois (or 1.69 kiloliks), commonly used in +structural engineering 2. [Colloq.] one thirteenth the load that a fully +grown sligo can carry. 3. [Anat.] a painful irritation of the dermis +in the region of the anus 4. [Slang] person who excites in others the +symptoms of a qwert. + -- Webster's Middle World Dictionary, 4th ed. +%% +Q: What did Tarzan say when he saw the elephants coming over the hill? +A: "The elephants are coming over the hill." + +Q: What did he say when saw them coming over the hill wearing + sunglasses? +A: Nothing, for he didn't recognize them. +%% +Q: What do WASP's do instead of making love? +A: Rule the country. +%% +Q: What do little WASPs want to be when they grow up? +A: The very best person they can possibly be. +%% +Q: What do they call the alphabet in Arkansas? +A: The impossible dream. +%% +Q: What do you call a boomerang that doesn't come back? +A: A stick. +%% +Q: What do you call a half-dozen Indians with Asian flu? +A: Six sick Sikhs (sic). +%% +Q: What do you call a million cats at the bottom of Lake Michigan? +A: A good start. +%% +Q: What do you call the WASP who doesn't work for + his father, isn't a lawyer, and believes in social causes? +A: A failure. +%% +Q: What do you call the money you pay to the government when + you ride into the country on the back of an elephant? +A: A howdah duty. +%% +Q: What do you call the scratches + that you get when a female sheep bites you? +A: Ewe nicks. +%% +Q: What do you get when you stuff a flaming stick down a rabbit-hole? +A: Hot cross bunnies! +%% +Q: What does a WASP Mom make for dinner? +A: A crisp salad, a hearty soup, a lovely entree, followed by + a delicious dessert. +%% +Q: What does it say on the bottom of Coke cans in North Dakota? +A: Open other end. +%% +Q: What goes + Click. "Did I get it?" + Click. "Did I get it?" + Click. "Did I get it?" + Click. "Did I get it?" +A: Stevie Wonder doing the Rubik's Cube. +%% +Q: What is green and lives in the ocean? +A: Moby Pickle. +%% +Q: What is it that a cow has four of and a woman has two of? +A: Feet. +%% +Q: What is orange and goes "click, click?" +A: A ball point carrot. +%% +Q: What is printed on the bottom of beer bottles in Minnesota? +A: Open other end. +%% +Q: What is purple and commutes? +A: A boolean grape. +%% +Q: What is purple and commutes? +A: An Abelian grape. +%% +Q: What is purple and concord the world? +A: Alexander the Grape. +%% +Q: What is the difference between Texas and yogurt? +A: Yogurt has culture. +%% +Q: What is the difference between a duck? +A: One leg is both the same. +%% +Q: What is the last thing a Kansas stripper takes off? +A: Her bowling shoes. +%% +Q: What lies on the bottom of the ocean and twitches? +A: A nervous wreck. +%% +Q: What looks like a cat, flies like a bat, + brays like a donkey, and plays like a monkey? +A: Nothing. +%% +Q: What's bruised, bleeding, and lies in a ditch? +A: Somebody who tells Aggie jokes. +%% +Q. What's the capital of Canada? +A. American. +%% +Q: What's the difference between Bell Labs and the + Boy Scouts of America? +A: The Boy Scouts have adult supervision. +%% +Q: What's the difference between a duck? +A: You can't get down off an elephant. +%% +Q: What's the difference between an Irish wedding and an Irish wake? +A: One more drunk. +%% +Q: What's tiny and yellow and very, very, dangerous? +A: A canary with the super-user password. +%% +Q: Why did God create goyim? +A: Somebody had to buy retail. +%% +Q: Why did the WASP cross the road? +A: To get to the middle. +%% +Q: Why did the chicken cross the road? +A: He was giving it last rites. +%% +Q: Why did the germ cross the microscope? +A: To get to the other slide. +%% +Q: Why did the programmer call his mother long distance? +A: Because that was her name. +%% +Q: Why do ducks have big flat feet? +A: To stamp out forest fires. + +Q: Why do elephants have big flat feet? +A: To stamp out flaming ducks. +%% +Q: Why do firemen wear red suspenders? +A: To conform with departmental regulations concerning uniform dress. +%% +Q: Why do mountain climbers rope themselves together? +A: To prevent the sensible ones from going home. +%% +Q: Why do the police always travel in threes? +A: One does the reading, one the writing, and the other + keeps an eye on the two intellectuals. +%% +Quack! + Quack!! Quack!! +%% +Quantity is no substitute for quality, but its the only one we've got. +%% +Quark! Quark! Beware the quantum duck! +%% +Question: Is it better to abide by the rules until +they're changed or help speed the change by breaking them? +%% +Question authority. +%% +Question: + Man Invented Alcohol, + God Invented Grass. + Whom do you trust? +%% +Questionable day. +Ask somebody something. +%% +Questions are never indiscreet, answers sometimes are. + -- Oscar Wilde +%% +Quick!! Act as if nothing has happened! +%% +Quigley's Law: + Whoever has any authority over you, + no matter how small, will attempt to use it. +%% +Quite frankly, I don't like you humans. +After what you all have done, I find being "inhuman" a compliment. +%% +Qvid me anxivs svm? +%% +RADIO SHACK LEVEL II BASIC +READY +>_ +%% +RAM wasn't built in a day. +%% +Random, n: + as in number, predictable. + as in memory access, unpredictable. +%% +Reappraisal, n: + An abrupt change of mind after being found out. +%% +Reception area, n: + The purgatory where office visitors are condemned to spend + innumerable hours reading dog-eared back issues of trade + magazines like Modern Plastics, Chain Saw Age, and Chicken World, + while the receptionist blithely reads her own trade magazine -- + Cosmopolitan. +%% +Reliable source, n: + The guy you just met. +%% +Reputation, adj: + What others are not thinking about you. +%% +Research, n: + Consider Columbus: + He didn't know where he was going. + When he got there he didn't know where he was. + When he got back he didn't know where he had been. + And he did it all on someone else's money. +%% +Revolution, n: + A form of government abroad. +%% +Robot, n: + Someone who's been made by a scientist. +%% +Robot, n: + University administrator. +%% +Robustness, adj: + Never having to say you're sorry. +%% +ROMEO: Courage, man; the hurt cannot be much. +MERCUTIO: No, 'tis not so deep as a well, nor so wide + as a church-door; but 'tis enough, 'twill serve. +%% +RUGBY: + Elegant violence. +%% +RUGGED: + Too heavy to lift. +%% +Radicalism: + The conservatism of tomorrow injected into the affairs of today. + -- A. Bierce +%% +Radioactive cats have 18 half-lives. +%% +Raffiniert ist der Herrgott aber boshaft ist er nicht. + -- Albert Einstein +%% +Rainy days and Mondays always get me down. +%% +Raising pet electric eels is gaining a lot of current popularity. +%% +Rascal, am I? Take THAT! + -- Errol Flynn +%% +Rattling around the back of my head is a disturbing image of something I +saw at the airport... Now I'm remembering, those giant piles of computer +magazines right next to "People" and "Time" in the airport store. Does it +bother anyone else that half the world is being told all of our hard-won +secrets of computer technology? Remember how all the lawyers cried foul +when "How to Avoid Probate" was published? Are they taking no-fault +insurance lying down? No way! But at the current rate it won't be long +before there are stacks of the "Transactions on Information Theory" at the +A&P checkout counters. Who's going to be impressed with us electrical +engineers then? Are we, as the saying goes, giving away the store? + -- Robert W. Lucky, IEEE president +%% +Razors pain you; +Rivers are damp; +Acids stain you; +And drugs cause cramp. +Guns aren't lawful; +Nooses give; +Gas smells awful; +You might as well live. + -- Dorothy Parker, "Resume", 1926 +%% +Re: Graphics: + A picture is worth 10K words -- but only those to describe + the picture. Hardly any sets of 10K words can be adequately + described with pictures. +%% +Reach into the thoughts of friends, +And find they do not know your name. +Squeeze the teddy bear too tight, +And watch the feathers burst the seams. +Touch the stained glass with your cheek, +And feel its chill upon your blood. +Hold a candle to the night, +And see the darkness bend the flame. +Tear the mask of peace from God, +And hear the roar of souls in hell. +Pluck a rose in name of love, +And watch the petals curl and wilt. +Lean upon the western wind, +And know you are alone. + -- Dru Mims +%% +Reading is thinking with someone else's head instead of one's own. +%% +Reading is to the mind what exercise is to the body. +%% +Reagan can't act either. +%% +Real Programmers don't play tennis, or any other sport that requires +you to change clothes. Mountain climbing is OK, and real programmers +wear their climbing boots to work in case a mountain should suddenly +spring up in the middle of the machine room. +%% +Real programmers don't document; if it was +hard to write, it should be hard to understand. +%% +Real programs don't eat cache. +%% +Real wealth can only increase. + -- R. Buckminster Fuller +%% +Reality -- what a concept! + -- Robin Williams +%% +Reality always seems harsher in the early morning. +%% +Reality does not exist - yet. +%% +Reality is an obstacle to hallucination. +%% +Reality is for people who can't deal with drugs. + -- Lily Tomlin +%% +Reality is just a crutch for people who can't handle science fiction. +%% +Really?? What a coincidence, I'm shallow too!! +%% +Rebellion lay in his way, and he found it. + -- William Shakespeare, "Henry IV" +%% +Recent investments will yield a slight profit. +%% +Recent research has tended to show that the Abominable No-Man +is being replaced by the Prohibitive Procrastinator. + -- C.N. Parkinson +%% +Recession is when your neighbor loses his job. Depression is when you +lose your job. These economic downturns are very difficult to predict, +but sophisticated econometric modeling houses like Data Resources and +Chase Econometrics have successfully predicted 14 of the last 3 recessions. +%% +Recieving a million dollars tax free will make you feel +better than being flat broke and having a stomach ache. + -- Dolph Sharp +%% +Reclaimer, spare that tree! +Take not a single bit! +It used to point to me, +Now I'm protecting it. +It was the reader's CONS +That made it, paired by dot; +Now, GC, for the nonce, +Thou shalt reclaim it not. +%% +Recursion is the root of computation +since it trades description for time. +%% +Recursion: n. See Recursion. + -- Random Shack Data Processing Dictionary +%% +Regardless of whether a mission expands or contracts, +administrative overhead continues to grow at a steady rate. +%% +Regnant populi. +%% + "Reintegration complete," ZORAC advised. "We're back in the +universe again..." An unusually long pause followed, "...but I don't +know which part. We seem to have changed our position in space." A +spherical display in the middle of the floor illuminated to show the +starfield surrounding the ship. + "Several large, artificial constructions are approaching us," +ZORAC announced after a short pause. "The designs are not familiar, but +they are obviously the products of intelligence. Implications: we have +been intercepted deliberately by a means unknown, for a purpose unknown, +and transferred to a place unknown by a form of intelligence unknown. +Apart from the unknowns, everything is obvious." + -- James P. Hogan, "Giants Star" +%% +Reisner's Rule of Conceptual Inertia: + If you think big enough, you'll never have to do it. +%% +Religions revolve madly around sexual questions. +%% +Remember -- only 10% of anything can be in the top 10%. +%% +Remember Darwin; building a better +mousetrap merely results in smarter mice. +%% +Remember, UNIX spelled backwards is XINU. + -- Mt. +%% +Remember, even if you win the rat race -- you're still a rat. +%% +Remember that there is an outside world to see and enjoy. + -- Hans Liepmann +%% +Remember that whatever misfortune may be your lot, +it could only be worse in Cleveland. +%% +Remember the good old days, when CPU was singular? +%% +Remember the... the... uhh..... +%% +Remember to say hello to your bank teller. +%% +Remember: use logout to logout. +%% +Remembering is for those who have forgotten. + -- Chinese proverb +%% +Removing the straw that broke the camel's back +does not necessarily allow the camel to walk again. +%% +Renning's Maxim: + Man is the highest animal. Man does the classifying. +%% +Reply hazy, ask again later. +%% +Reporter (to Mahatma Gandhi): + Mr. Gandhi, what do you think of Western Civilization? +Gandhi: I think it would be a good idea. +%% +Reporter: + A writer who guesses his way to the truth + and dispels it with a tempest of words. + -- Ambrose Bierce +%% + Reporters like Bill Greider from the Washington Post and Him +Naughton of the New York Times, for instance, had to file long, detailed, +and relatively complex stories every day -- while my own deadline fell +every two weeks -- but neither of them ever seemed in a hurry about +getting their work done, and from time to time they would try to console +me about the terrible pressure I always seemed to be laboring under. + Any $100-an-hour psychiatrist could probably explain this problem +to me, in thirteen or fourteen sessions, but I don't have time for that. +No doubt it has something to do with a deep-seated personality defect, or +maybe a kink in whatever blood vessel leads into the pineal gland... On +the other hand, it might be something as simple & basically perverse as +whatever instinct it is that causes a jackrabbit to wait until the last +possible second to dart across the road in front of a speeding car. + -- H.S. Thompson, "Fear and Loathing: On the Campaign Trail" +%% +Research is the best place to be: you work your buns off, and if it works +you're a hero; if it doesn't, well -- nobody else has done it yet either, +so you're still a valiant nerd. +%% +Research is to see what everybody else has seen, +and think what nobody else has thought. +%% +Research is what I'm doing when I don't know what I'm doing. + -- Wernher von Braun +%% +Resisting temptation is easier when you +think you'll probably get another chance later on. +%% +Rest assured that your dog is finally getting enough cheese. + -- Deteriorata +%% +Rev. Jim: What does an amber light mean? +Bobby: Slow down. +Rev. Jim: What... does... an... amber... light... mean? +Bobby: Slow down. +Rev. Jim: What.... does.... an.... amber.... light.... +%% +Revenge is a form of nostalgia. +%% +Revenge is a meal best served cold. +%% +Review Questions + +1: If Nerd on the planet Nutley starts out in his spaceship at 20 KPH, + and his speed doubles every 3.2 seconds, how long will it be before + he exceeds the speed of light? How long will it be before the + Galactic Patrol picks up the pieces of his spaceship? + +2: If Roger Rowdy wrecks his car every week, and each week he breaks + twice as many bones as before, how long will it be before he breaks + every bone in his body? How long will it be before they cut off + his insurance? Where does he get a new car every week? + +3: If Johnson drinks one beer the first hour (slow start), four beers + the next hour, nine beers the next, etc., and stacks the cans in + a pyramid, how soon will Johnson's pyramid be larger than King + Tut's? When will it fall on him? Will he notice? +%% +Rhode's Law: + When any principle, law, tenet, probability, happening, circumstance, + or result can in no way be directly, indirectly, empirically, or + circuitously proven, derived, implied, inferred, induced, deducted, + estimated, or scientifically guessed, it will always for the purpose + of convenience, expediency, political advantage, material gain, or + personal comfort, or any combination of the above, or none of the + above, be unilaterally and unequivocally assumed, proclaimed, and + adhered to as absolute truth to be undeniably, universally, immutably, + and infinitely so, until such time as it becomes advantageous to + assume otherwise, maybe. +%% + "Richard, in being so fierce toward my vampire, you were doing +what you wanted to do, even though you thought it was going to hurt +somebody else. He even told you he'd be hurt if..." + "He was going to suck my blood!" + "Which is what we do to anyone when we tell them we'll be hurt +if they don't live our way." +... + "The thing that puzzles you," he said, "is an accepted saying that +happens to be impossible. The phrase is hurt somebody else. We choose, +ourselves, to be hurt or not to be hurt, no matter what. Us who decides. +Nobody else. My vampire told you he'd be hurt if you didn't let him? That's +his decision to be hurt, that's his choice. What you do about it is your +decision, your choice: give him blood; ignore him; tie him up; drive a stake +through his heart. If he doesn't want the holly stake, he's free to resist, +in whatever way he wants. It goes on and on, choices, choices." + "When you look at it that way..." + "Listen," he said, "it's important. We are all. Free. To do. +Whatever. We want. To do." + -- Richard Bach, "Illusions" +%% +Riches cover a multitude of woes. + -- Menander +%% +Rick: "How can you close me up? On what grounds?" +Renault: "I'm shocked! Shocked! To find that gambling is + going on here." +Croupier (handing money to Renault): + "Your winnings, sir." +Renault: "Oh. Thank you very much." + -- Casablanca +%% +Riffle West Virginia is so small that the +Boy Scout had to double as the town drunk. +%% +"Rights" is a fictional abstraction. No one has "Rights", neither +machines nor flesh-and-blood. Persons... have opportunities, not +rights, which they use or do not use. + -- Lazarus Long +%% +Ring around the collar. +%% + Risch's decision procedure for integration, not surprisingly, +uses a recursion on the number and type of the extensions from the +rational functions needed to represent the integrand. Although the +algorithm follows and critically depends upon the appropriate structure +of the input, as in the case of multivariate factorization, we cannot +claim that the algorithm is a natural one. In fact, the creator of +differential algebra, Ritt, committed suicide in the early 1950's, +largely, it is claimed, because few paid attention to his work. Probably +he would have received more attention had he obtained the algorithm as +well. + -- Joel Moses, "Algorithms and Complexity", ed. J.F. Traub +%% +Ritchie's Rule: + (1) Everything has some value -- if you use the right currency. + (2) Paint splashes last longer than the paint job. + (3) Search and ye shall find -- but make sure it was lost. +%% +Rocky's Lemma of Innovation Prevention + Unless the results are known in advance, + funding agencies will reject the proposal. +%% +Rome was not built in one day. + -- John Heywood +%% +Rome wasn't burnt in a day. +%% +Romeo was restless, he was ready to kill, +He jumped out the window 'cause he couldn't sit still, +Juliet was waiting with a safety net, +Said "don't bury me 'cause I ain't dead yet". + -- Elvis Costello +%% +Roses are red; + Violets are blue. +I'm schizophrenic, + And so am I. +%% +Rotten wood cannot be carved. + -- Confucius, "Analects", Book 5, Ch. 9 +%% +Round Numbers are always false. + -- Samuel Johnson +%% +Row, row, row your bits, gently down the stream... +%% +Rubber bands have snappy endings! +%% +Rudd's Discovery: + You know that any senator or congressman could go home and make + $300,000 to $400,000, but they don't. Why? Because they can + stay in Washington and make it there. +%% +Rudin's Law: + If there is a wrong way to do something, most people will + do it every time. + +Rudin's Second Law: + In a crisis that forces a choice to be made among alternative + courses of action, people tend to choose the worst possible + course. +%% +Rugby players eat their dead. +%% +Rule of Creative Research: + 1) Never draw what you can copy. + 2) Never copy what you can trace. + 3) Never trace what you can cut out and paste down. +%% +Rule of Defactualization: + Information deteriorates upward through bureaucracies. +%% +Rule of Feline Frustration: + When your cat has fallen asleep on your lap and looks utterly + content and adorable, you will suddenly have to go to the + bathroom. +%% +Rule of Life #1 -- Never get separated from your luggage. +%% +Rule of the Great: + When people you greatly admire appear to be thinking deep + thoughts, they probably are thinking about lunch. +%% +Rules for Good Grammar #4. + 1: Don't use no double negatives. + 2: Make each pronoun agree with their antecedents. + 3: Join clauses good, like a conjunction should. + 4: About them sentence fragments. + 5: When dangling, watch your participles. + 6: Verbs has got to agree with their subjects. + 7: Just between you and i, case is important. + 8: Don't write run-on sentences when they are hard to read. + 9: Don't use commas, which aren't necessary. +10: Try to not ever split infinitives. +11: It is important to use your apostrophe's correctly. +12: Proofread your writing to see if you any words out. +13: Correct speling is essential. +14: A preposition is something you never end a sentence with. +15: While a transcendant vocabulary is laudable, one must be eternally + careful so that the calculated objective of communication does not + become ensconsed in obscurity. In other words, eschew obfuscation. +%% +Rules for Writers: + Avoid run-on sentences they are hard to read. Don't use no double +negatives. Use the semicolon properly, always use it where it is appropriate; +and never where it isn't. Reserve the apostrophe for it's proper use and +omit it when its not needed. No sentence fragments. Avoid commas, that are +unnecessary. Eschew dialect, irregardless. And don't start a sentence with +a conjunction. Hyphenate between sy-llables and avoid un-necessary hyphens. +Write all adverbial forms correct. Don't use contractions in formal writing. +Writing carefully, dangling participles must be avoided. It is incumbent on +us to avoid archaisms. Steer clear of incorrect forms of verbs that have +snuck in the language. Never, ever use repetitive redundancies. If I've +told you once, I've told you a thousand times, resist hyperbole. Also, +avoid awkward or affected alliteration. Don't string too many prepositional +phrases together unless you are walking through the valley of the shadow of +death. "Avoid overuse of 'quotation "marks."'" +%% +Rules for driving in New York: + 1) Anything done while honking your horn is legal. + 2) You may park anywhere if you turn your four-way flashers on. + 3) A red light means the next six cars may go through the + intersection. +%% +Ruling a big country is like cooking a small fish. + -- Lao Tsu +%% +Russia has abolished God, but so far God has been more tolerant. + -- John Cameron Swayze +%% +Ryan's Law: + Make three correct guesses consecutively + and you will establish yourself as an expert. +%% +SADISM: + A sadist refusing to whip a masochist. +%% +SADO-NECRO-BESTIALITY: + Beating a dead horse. +%% + SAFETY +I can live without +Someone I love +But not without +Someone I need. +%% +SAGITTARIUS (Nov 22 - Dec 21) + You are optimistic and enthusiastic. You have a reckless + tendency to rely on luck since you lack talent. The majority of + Sagitarians are drunks or dope fiends or both. People laugh at + you a great deal. +%% +SAGITTARIUS (Nov.22 - Dec.21) + Your efforts to help a little old lady cross a street will + backfire when you learn that she was waiting for a bus. Subdue + impulse you have to push her out into traffic. +%% +SAN DIEGO: + Four million people, where you can't get a + good cheeseburger, no matter how hard you try. +%% +SAN FRANCISCO: + Marcel Proust editing an issue of Penthouse. +%% +SCCS, the source motel! Programs check in and never check out! + -- Ken Thompson +%% +SCENARIO: + An imagined sequence of events that provides the context in + which a business decision is made. Scenarios always come in + sets of three: best case, worst case, and just in case. +%% +SCORPIO (Oct 23 - Nov 21) + You are shrewd in business and cannot be trusted. You will achieve + the pinnacle of success because of your total lack of ethics. Most + Scorpio people are murdered. +%% +SCORPIO (Oct.24 - Nov.21) + You will receive word today that you are eligible to win a million + dollars in prizes. It will be from a magazine trying to get you to + subscribe, and you're just dumb enough to think you've got a chance + to win. You never learn. +%% +SEMINARS: + From 'semi' and 'arse', hence, any half-assed discussion. +%% +SEMPER UBI SUB UBI!!!! +%% +SENILITY: + The state of mind of elderly persons + with whom one happens to disagree. +%% +SERENDIPITY: + The process by which human knowledge is advanced. +%% +share, n: + To give in, endure humiliation. +%% +SHIFT TO THE LEFT! +SHIFT TO THE RIGHT! +POP UP, PUSH DOWN, +BYTE, BYTE, BYTE! +%% +SMOKING IS NOW ALLOWED !!! + Anyone wishing to smoke, however, must file, in triplicate, the + U.S. government Environmental Impact Narrative Statement (EINS), + describing in detail the type of combustion proposed, impact on + the environment, and anticipated opposition. Statements must be + filed 30 days in advance. +%% +SNAPPY REPARTEE: + What you'd say if you had another chance. +%% +SOCIALISM: + You have two cows. Give one to your neighbour. +COMMUNISM: + You have two cows. + Give both to the government. The government gives you milk. +CAPITALISM: + You sell one cow and buy a bull. +FACISM: + You have two cows. Give milk to the government. + The government sells it. +NAZISM: + The government shoots you and takes the cows. +NEW DEALISM: + The government shoots one cow, + milks the other, and pours the milk down the sink. +ANARCHISM: + Keep the cows. Steal another one. Shoot the government. +CONSERVATISM: + Freeze the milk. Embalm the cows. +%% +SOFTWARE: + Formal evening attire for female computer analysts. +%% +SPINSTER: + A bachelor's wife. +%% +SPOUSE: + Someone who'll stand by you through all the + trouble you wouldn't have had if you'd stayed single. +%% +STANDARDS: + The principles we use to reject other people's code. +%% +STATISTICS: + A system for expressing your political + prejudices in convincing scientific guise. +%% +STRAPLESS EVENING GOWN: + Bust truster. +%% +STRATEGY: + A comprehensive plan of inaction. +%% +STUPID: + Losing $25 on the tackle and $25 on the instant replay. +%% +SUNSET: + Pronounced atmospheric scattering of shorter wavelengths, + resulting in selective transmission below 650 nanometers with + progressively reducing solar elevation. +%% +SWEATER: + A garment worn by a child when their mother feels chilly. +%% +SYSTEM-INDEPENDENT: + Works equally poorly on all systems. +%% +Sacher's Observation: + Some people grow with responsibility -- others merely swell. +%% +Safety Third. +%% + Safety Tips for the Post-Nuclear Existence +1. Never use an elevator in a building that has been hit by a + nuclear bomb, use the stairs. +2. When you're flying through the air, remember to roll + when you hit the ground. +3. If you're on fire, avoid gasoline and other flammable materials. +4. Don't attempt communication with dead people; it will only lead + to psychological problems. +5. Food will be scarce, you will have to scavenge. Learn to recognize + foods that will be available after the bomb: mashed potatoes, + shredded wheat, tossed salad, ground beef, etc. +6. Put your hand over your mouth when you sneeze, internal organs + will be scarce in the post-nuclear age. +7. Try to be neat, fall only in designated piles. +8. Drive carefully in "Heavy Fallout" areas, people could be + staggering illegally. +9. Nutritionally, hundred dollar bills are equal to one's, but more + sanitary due to limited circulation. +10. Accumulate mannequins now, spare parts will be in short + supply on D-Day. +%% +Safety Tips for the Post-Nuclear Existence + Tip #1: How to tell when you are dead. + + 1. Little things start bothering you: little things like worms, + bugs, ants. + 2. Something is missing in your personal relationships. + 3. Your dog becomes overly affectionate. + 4. You have a hard time getting a waiter. + 5. Exotic birds flock around you. + 6. People ignore you at parties. + 7. You have a hard time getting up in the morning. + 8. You no longer get off on cocaine. +%% +Sailing is fun, but scrubbing the decks is aardvark. + -- Heard on Noahs' ark +%% +Sailors in ships, sail on! +Even while we died, others rode out the storm. +%% + Sam went to his psychiatrist complaining of a hatred for elephants. +"I can't stand elephants," he explained. "I lie awake nights despising +them. The thought of an elephant fills me with loathing." + "Sam," said the psychiatrist, "there's only one thing for you to do. +Go to Africa, organize a safari, find an elephant in the jungle and shoot it. +That way you'll get it out of your system." + Sam immediately made arrangements for a safari hunt in Africa, +inviting his best friend to join him. They arrived in Nairobi and lost no +time getting out on the jungle trails. After they had been hunting for +several days, Sam's best friend grabbed him by the arm one morning and +yelled at him: + "Sam, Sam, Sam! Over there behind that tree there's and elephant! +Sam -- Get your gun -- no, no, not THAT gun -- the rifle with the longer +barrel! Now aim it! QUICK! SAM! QUICK! No! Not that way -- this way! +Be sure you don't jerk the trigger! Wait SAM! Don't let him see you! Aim +at his head!" + Sam whirled around, took aim, and killed his friend. He was put in +prison and his psychiatrist flew to Africa to visit him. "I sent you over +here to kill and elephant and instead you shoot your best friend," the +psychiatrist said. "Why?" + "Well," Sam replied, "there's only one thing in the world that I +hate more than elephants and that is a loudmouth know-it-all!" +%% +San Francisco isn't what it used to be, and it never was. +%% +Sank heaven for leetle curls. +%% +Santa Claus is watching! +%% +Santa Claus wears a red suit +He's a Communist. + +He has long hair and a beard +Must be a pacifist. + +And what's in the pipe that he's smoking? + +Santa Claus comes in your house at night. +He must be a dope fiend to get you up tight. + +Why do police guys beat on peace guys? + -- Arlo Guthrie, "The Pause of Mr. Claus" +%% +Santa's elves are just a bunch of subordinate Clauses. +%% +Satellite Safety Tip #14: + If you see a bright streak in the sky coming at you, duck. +%% +Satire does not look pretty upon a tombstone. +%% +Satire is what closes in New Haven. +%% +Sattinger's Law: + It works better if you plug it in. +%% +Saturday night in Toledo Ohio, +Is like being nowhere at all, +All through the day how the hours rush by, +You sit in the park and you watch the grass die. + -- John Denver, "Saturday Night in Toledo Ohio" +%% +Satyrs have more faun. +%% +Savage's Law of Expediency: + You want it bad, you'll get it bad. +%% +Save energy: Drive a smaller shell. +%% +Save energy: be apathetic. +%% +Save gas, don't eat beans. +%% +Save gas, don't use the shell. +%% +Save yourself! Reboot in 5 seconds! +%% +Say! You've struck a heap of trouble-- +Bust in business, lost your wife; +No one cares a cent about you, +You don't care a cent for life; +Hard luck has of hope bereft you, +Health is failing, wish you'd die-- +Why, you've still the sunshine left you +And the big blue sky. + -- R.W. Service +%% +Say many of cameras focused t'us, +Our middle-aged shots do us justice. +No justice, please, curse ye! +We really want mercy: +You see, 'tis the justice, disgusts us. + -- Thomas H. Hildebrandt +%% +Say my love is easy had, +Say I'm bitten raw with pride, +Say I am too often sad -- +Still behold me at your side. + +Say I'm neither brave nor young, +Say I woo and coddle care, +Say the devil touched my tongue, +Still you have my heart to wear. + +But say my verses do not scan, +And I get me another man! + -- Dorothy Parker, "Fighting Words" +%% +Say no, then negotiate. + -- Helga +%% +Say something you'll be sorry for, I love receiving apologies. +%% +Say "twenty-three-skiddoo" to logout. +%% +Scenary is here, wish you were beautiful. +%% +Schapiro's Explanation: + The grass is always greener on the other side -- + but that's because they use more manure. +%% +Schizophrenia beats being alone. +%% +Science Fiction, Double Feature. +Frank has built and lost his creature. +Darkness has conquered Brad and Janet. +The servants gone to a distant planet. +Wo, oh, oh, oh. +At the late night, double feature, Picture show. +I want to go, oh, oh, oh. +To the late night, double feature, Picture show. + -- Rocky Horror Picture Show +%% +Science is built up of facts, as a house is with stones. But a +collection of facts is no more a science than a heap of stones +is a house. + -- Jules Henri Poincare +%% +Science is to computer science as hydrodynamics is to plumbing. +%% +Science is what happens when preconception meets verification. +%% +Science may someday discover what faith has always known. +%% +Science! true daughter of Old Time thou art! +Who alterest all things with thy peering eyes. +Why preyest thou thus upon the poet's heart, +Vulture, whose wings are dull realities? +How should he love thee? or how deem thee wise? +Who wouldst not leave him in his wandering +To seek for treasure in the jewelled skies, +Albeit he soared with an undaunted wing? +Hast thou not dragged Diana from her car? +And driven the Hamadryad from the wood +To seek a shelter in some happier star? +Hast thou not torn the Naiad from her flood, +The Elfin from the green grass, and from me +The summer dream beneath the tamarind tree? + -- Edgar Allen Poe, "Science, a Sonnet" +%% +Scientists still know less about what attracts men +than they do about what attracts mosquitoes. + -- Dr. Joyce Brothers, + "What Every Woman Should Know About Men" +%% +Scientists were preparing an experiment to ask the ultimate question. +They had worked for months gathering one each of every computer that +was built. Finally the big day was at hand. All the computers were +linked together. They asked the question, "Is there a God?". Lights +started blinking, flashing and blinking some more. Suddenly, there +was a loud crash, and a bolt of lightning came down from the sky, +struck the computers, and welded all the connections permanently +together. "There is now", came the reply. +%% +Scintilate, scintilate, globule vivific, +Fain how I pause at your nature specific, +Loftily poised in the ether capacious, +Highly resembling a gem carbonaceous. +Scintilate, scintilate, globule vivific, +Fain how I pause at your nature specific. +%% +Scintillation is not always identification for an auric substance. +%% +Scott's First Law: + No matter what goes wrong, it will probably look right. + +Scott's Second Law: + When an error has been detected and corrected, it will be found + to have been wrong in the first place. +Corollary: + After the correction has been found in error, it will be + impossible to fit the original quantity back into the + equation. +%% +Scotty: Captain, we din' can reference it! +Kirk: Analysis, Mr. Spock? +Spock: Captain, it doesn't appear in the symbol table. +Kirk: Then it's of external origin? +Spock: Affirmative. +Kirk: Mr. Sulu, go to pass two. +Sulu: Aye aye, sir, going to pass two. +%% +Scratch the average female and you'll find a purring bundle... at the +ready to love and honor, bake a torte and still produce quintuplets. + -- Edgar Berman +%% +Scratch the disks, dump the core, Shut it down, pull the plug +Roll the tapes across the floor, Give the core an extra tug +And the system is going to crash. And the system is going to crash. +Teletypes smashed to bits. Mem'ry cards, one and all, +Give the scopes some nasty hits Toss out halfway down the hall +And the system is going to crash. And the system is going to crash. +And we've also found Just flip one switch +When you turn the power down, And the lights will cease to twitch +You turn the disk readers into trash. And the tape drives will crumble + in a flash. +Oh, it's so much fun, When the CPU +Now the CPU won't run Can print nothing out but "foo," +And the system is going to crash. The system is going to crash. + -- To The Caissons Go Rolling Along +%% +Scratch the disks! +Drop the core! +Roll the tapes across the floor! +%% +Screw up your courage! You've screwed up everything else. +%% +Sears has everything. +%% +Seattle is so wet that people protect their property with watch-ducks. +%% +Second Law of Business Meetings: + If there are two possible ways to spell a person's name, you + will pick the wrong one. + +Corollary: + If there is only one way to spell a name, + you will spell it wrong, anyway. +%% +Second Law of Final Exams: + In your toughest final -- for the first time all year -- the most + distractingly attractive student in the class will sit next to you. +%% +Secrecy is the beginning of tyranny. +%% +Security check: INTRUDER ALERT! +%% +Sed quis custodiet ipsos Custodes? +[Who guards the Guardians?] +%% +Seduced, shaggy Samson snored. +She scissored short. Sorely shorn, +Soon shackled slave, Samson sighed, +Silently scheming, +Sightlessly seeking +Some savage, spectacular suicide. + -- Stanislaw Lem +%% +Seeing is believing. +You wouldn't have seen it if you hadn't believed it. +%% +Seeing is deceiving. It's eating that's believing. + -- James Thurber +%% +Seeing that death, a necessary end, +Will come when it will come. + -- William Shakespeare, "Julius Caesar" +%% +Seek simplicity -- and distrust it. + -- Alfred North Whitehead +%% +Seize the day, put no trust in the morrow! + -- Quintus Horatius Flaccus (Horace) +%% +Seleznick's Theory of Holistic Medicine: + Ice Cream cures all ills. Temporarily. +%% +Send lawyers, guns, and money, +The shit has hit the fan. + -- Warren Zevon +%% +Send some filthy mail. +%% +Sentient plasmoids are a gas. +%% +Serfs up! + -- Spartacus +%% +Serocki's Stricture: + Marriage is always a bachelor's last option. +%% +Serving coffee on aircraft causes turbulence. +%% +Set the cart before the horse. + -- John Heywood +%% + "Seven years and six months!" Humpty Dumpty repeated thoughtfully. +"An uncomfortable sort of age. Now if you'd asked MY advice, I'd have +said 'Leave off at seven' -- but it's too late now." + "I never ask advice about growing," Alice said indignantly. + "Too proud?" the other enquired. + Alice felt even more indignant at this suggestion. "I mean," +she said, "that one can't help growing older." + "ONE can't, perhaps," said Humpty Dumpty; "but TWO can. With +proper assistance, you might have left off at seven." + -- Lewis Carroll, "Through the Looking-Glass" +%% +Several years ago, an international chess tournament was being held in a +swank hotel in New York. Most of the major stars of the chess world were +there, and after a grueling day of chess, the players and their entourages +retired to the lobby of the hotel for a little refreshment. In the lobby, +some players got into a heated argument about who was the brightest, the +fastest, and the best chess player in the world. The argument got quite +loud, as various players claimed that honor. At that point, a security +guard in the lobby turned to another guard and commented, "If there's +anything I just can't stand, it's chess nuts boasting in an open foyer." +%% +Sex is nobody's business but the three people involved. +%% +Sex is the mathematics urge sublimated. + -- M.C. Reed +%% +Shah, shah! Ayatulla you so! +%% +Shall I compare thee to a Summer day? +No, I guess not. +%% +Shall we make a new rule of life from tonight: +always to try to be a little kinder than is necessary? + -- J.M. Barrie +%% +Shame is an improper emotion invented by +pietists to oppress the human race. + -- Robert Preston, Toddy, "Victor/Victoria" +%% +Shamus: A shamus is a guy who takes care of handyman tasks around the +temple, and makes sure everything is in working order. A shamus is at +the bottom of the pecking order of synagog functionaries, and there's +a joke about that: + +A rabbi, to show his humility before God, cries out in the middle of a +service, + "Oh, Lord, I am nobody!" +The cantor, not to be bested, also cries out, + "Oh, Lord, I am nobody!" +The shamus, deeply moved, follows suit and cries, + "Oh, Lord, I am nobody!" +The rabbi turns to the cantor and says, + "Look who thinks he's nobody!" +%% +Shannon's Observation + Nothing is so frustrating as a bad situation + that is beginning to improve. +%% +Shaw's Principle: + Build a system that even a fool can use, + and only a fool will want to use it. +%% +She asked me, "What's your sign?" +I blinked and answered "Neon," +I thought I'd blow her mind... +%% +She been married so many times +she got rice marks all over her face. + -- Tom Waits +%% +She begged and she pleaded for more. +I said, "We've already had four, + And I'm sure that you've heard, + Though its somewhat absurd, +That eros spelt backwards is sore." +%% +She blinded me with science! +%% +She can kill all your files; +She can freeze with a frown. +And a wave of her hand brings the whole system down. +And she works on her code until ten after three. +She lives like a bat but she's always a hacker to me. + -- Apologies to Billy Joel +%% +She has an alarm clock and a phone that don't ring - they applaud. +%% +She is descended from a long line that her mother listened to. + -- Gypsy Rose Lee +%% +She missed an invaluable opportunity to give him +a look that you could have poured on a waffle. +%% +She often gave herself very good advice +(though she very seldom followed it). + -- Lewis Carroll +%% +She ran the gamut of emotions from 'A' to 'B'. + -- Dorothy Parker, on a Kate Hepburn performance +%% +She sells cshs by the cshore. +%% +She won' go Warp 7, Cap'n! The batteries are dead! +%% +Shedenhelm's Law: + All trails have more uphill sections + than they have downhill sections. +%% +"Shelter", what a nice name for for a place where you polish your cat. +%% +Sherry [Thomas Sheridan] is dull, naturally dull; but it must have taken +him a great deal of pains to become what we now see him. Such an excess +of stupidity, sir, is not in Nature. + -- Samuel Johnson +%% +She's learned to say things with her eyes +that others waste time putting into words. +%% +She's so tough she won't take 'yes' for an answer. +%% +She's such a kinky girl, +The kind you don't take home to mother. +She will never let your spirits down +Once you get her off the street. +%% +Shick's Law: + There is no problem a good miracle can't solve. +%% +Shift to the left, +Shift to the right, +Mask in, mask out, +BYTE, BYTE, BYTE !!! +%% +Ships are safe in harbor, but they were never meant to stay there. +%% +Shopping at this grody little computer store at the Galleria for a +totally awwwsome Apple. Fer suuure. I mean Apples are nice you +know? But, you know, there is this cute guy who works there and HE +says that VAX's are cooler! I mean I don't really know, you know? +He says that he has this totally tubular VAX at home and it's stuffed +with memory-to-the-max! Right, yeah. And he wants to take me home +to show it to me. Oh My God! I'm suuure. Gag me with a Prime! +%% +Show me a man who is a good loser and I'll +show you a man who playing golf with his boss. +%% +Show respect for age. Drink good Scotch for a change. +%% +Show your affection, which will probably meet with pleasant response. +%% +Showing up is 80% of life. + -- Woody Allen +%% +Si Dieu n'existait pas, il faudrait l'inventer. + -- Voltaire +%% +Si jeunesse savait, si vieillesse pouvait. +[If youth but knew, if old age but could.] + -- Henri Estienne +%% +Sic Transit Gloria Thursdi. +%% +Sic transit gloria Monday! +%% +Sic transit gloria mundi. +[So passes away the glory of this world.] + -- Thomas a Kempis +%% +Sight is a faculty; seeing is an art. +%% +Sigmund's wife wore Freudian slips. +%% +Signs of crime: screaming or cries for help. + -- The Brown University Security Crime Prevention Pamphlet +%% +Silence can be the biggest lie of all. We have a responsibility to speak +up; and whenever the occasion calls for it, we have a responsibility to +raise bloody hell. + -- Herbert Block +%% +Silence is the element in which great things fashion themselves. + -- Thomas Carlyle +%% +Silverman's Law: + If Murphy's Law can go wrong, it will. +%% +Simon's Law: + Everything put together falls apart sooner or later. +%% +Simplicity does not precede complexity, but follows it. +%% +Sin boldly. + -- Martin Luther +%% +Sin has many tools, but a lie is the handle which fits them all. +%% +Sin lies only in hurting other people unnecessarily. +All other "sins" are invented nonsense. +(Hurting yourself is not sinful -- just stupid). + -- Lazarus Long +%% +Since I hurt my pendulum +My life is all erratic. +My parrot who was cordial +Is now transmitting static. +The carpet died, a palm collapsed, +The cat keeps doing poo. +The only thing that keeps me sane +Is talking to my shoe. + -- My Shoe +%% +Since aerosols are forbidden, the police are using roll-on Mace! +%% +Since before the Earth was formed and before the sun burned hot in space, +cosmic forces of inexorable power have been working relentlessly toward +this moment in space-time -- your receiving this fortune. +%% +Since everything in life is but an experience perfect in being what it is, +having nothing to do with good or bad, acceptance or rejection, one may well +burst out in laughter. + -- Long Chen Pa +%% +Since we cannot hope for order, let us withdraw with style from the chaos. + -- Tom Stoppard +%% +Sink or Swim with Teddy! +%% +[Sir Stafford Cripps] has all the virtues +I dislike and none of the vices I admire. + -- Winston Churchill +%% +Sir, it's very possible this asteroid is not stable. + -- CP30 +%% + Sixtus V, Pope from 1585 to 1590 authorized a printing of the +Vulgate Bible. Taking no chances, the pope issued a papal bull +automatically excommunicating any printer who might make an alteration +in the text. This he ordered printed at the beginning of the Bible. +He personally examined every sheet as it came off the press. Yet the +published Vulgate Bible contained so many errors that corrected scraps +had to be printed and pasted over them in every copy. The result +provoked wry comments on the rather patchy papal infallibility, and +Pope Sixtus had no recourse but to order the return and destruction of +every copy. +%% +Skinner's Constant (or Flannagan's Finagling Factor): + That quantity which, when multiplied by, divided by, added to, + or subtracted from the answer you got, gives you the answer you + should have gotten. +%% +Slang is language that takes off its coat, +spits on its hands, and goes to work. +%% +Sleep -- the most beautiful experience in life -- except drink. + -- W.C. Fields +%% +Slick's Three Laws of the Universe: + 1) Nothing in the known universe travels faster than a bad check. + 2) A quarter-ounce of chocolate = four pounds of fat. + 3) There are two types of dirt: the dark kind, which is + attracted to light objects, and the light kind, which is + attracted to dark objects. +%% +Slous' Contention: + If you do a job too well, you'll get stuck with it. +%% +Slow day. +Practice crawling. +%% +Small change can often be found under seat cushions. +%% +Small is beautiful. + -- Schumacher's Dictum +%% +Small things make base men proud. + -- William Shakespeare, "Henry VI" +%% +Smear the road with a runner!! +%% +Smile! You're on Candid Camera. +%% +Smoking Prohibited. Absolutely no ifs, ands, or butts. +%% +Smoking a woman is like kissing a fish. +%% +Snakes. Why did it have to be snakes? +%% +Snoopy: No problem is so big that it can't be run away from. +%% +Snow Day -- stay home. +%% +Snow and adolescence are the only problems +that disappear if you ignore them long enough. +%% +So do the noble fall. For they are ever caught in a trap of their own making. +A trap -- walled by duty, and locked by reality. Against the greater force +they must fall -- for, against that force they fight because of duty, because +of obligations. And when the noble fall, the base remain. The base -- whose +only purpose is the corruption of what the noble did protect. Whose only +purpose is to destroy. The noble: who, even when fallen, retain a vestige of +strength. For theirs is a strength born of things other than mere force. +Theirs is a strength supreme... theirs is the strength -- to restore. + -- Gerry Conway, "Thor", #193 +%% +So far as I can remember, there is not one +word in the Gospels in praise of intelligence. + -- Bertrand Russell +%% +So from the depths of its enchantment, Terra was able to calculate a course +of action. Here at last was an opportunity to consort with Dirbanu on a +friendly basis -- great Durbanu which, since it had force fields which Earth +could not duplicate, must of necessity have many other things Earth could +use; mighty Durbanu before whom we would kneel in supplication (with purely- +for-defense bombs hidden in our pockets) with lowered heads (making invisible +the knife in our teeth) and ask for crumbs from their table (in order to +extrapolate the location of their kitchens). + -- T. Sturgeon, "The World Well Lost" +%% +So live that you wouldn't be ashamed +to sell the family parrot to the town gossip. +%% +So many men and so little time. +%% +So many men, so many opinions; every one his own way. + -- Publius Terentius Afer (Terence) +%% +So many women, and so little time! +%% +So much +depends +upon +a red + +wheel +barrow +glazed with + +rain +water +beside +the white +chickens. + -- William Carlos Williams, "The Red Wheel Barrow" +%% +So she went into the garden to cut a cabbage leaf to make an apple pie; +and at the same time a great she-bear, coming up the street pops its head +into the shop. "What! no soap?" So he died, and she very imprudently +married the barber; and there were present the Picninnies, and the Grand +Panjandrum himself, with the little round button at top, and they all +fell to playing the game of catch as catch can, till the gunpowder ran +out at the heels of their boots. + -- Samuel Foote +%% +So so is good, very good, very excellent good: +and yet it is not; it is but so so. + -- William Shakespeare, "As You Like It" +%% +So this it it. We're going to die. +%% +So you think that money is the root of all evil. +Have you ever asked what is the root of money? + -- Ayn Rand +%% +So, your daughter was voted "Most Likely to Conceive", +and you're still drinking ordinary scotch? +%% +So you're back... about time... +%% +Soap and education are not as sudden as a +massacre, but they are more deadly in the long run. + -- Mark Twain +%% +Soldiers who wish to be a hero +Are practically zero, +But those who wish to be civilians, +They run into the millions. +%% +Solutions are obvious if one only has the +optical power to observe them over the horizon. + -- K.A. Arsdall +%% + Some 1500 miles west of the Big Apple we find the Minneapple, a +haven of tranquility in troubled times. It's a good town, a civilized town. +A town where they still know how to get your shirts back by Thursday. Let +the Big Apple have the feats of "Broadway Joe" Namath. We have known the +stolid but steady Killebrew. Listening to Cole Porter over a dry martini +may well suit those unlucky enough never to have heard the Whoopee John Polka +Band and never to have shared a pitcher of 3.2 Grain Belt Beer. The loss is +theirs. And the Big Apple has yet to bake the bagel that can match peanut +butter on lefse. Here is a town where the major urban problem is dutch elm +disease and the number one crime is overtime parking. We boast more theater +per capita than the Big Apple. We go to see, not to be seen. We go even +when we must shovel ten inches of snow from the driveway to get there. Indeed +the winters are fierce. But then comes the marvel of the Minneapple summer. +People flock to the city's lakes to frolic and rejoice at the sight of so +much happy humanity free from the bonds of the traditional down-filled parka. +Here's to the Minneapple. And to its people. Our flair for style is balanced +by a healthy respect for wind chill factors. + And we always, always eat our vegetables. + This is the Minneapple. +%% +Some books are to be tasted, others to be swallowed, +and some few to be chewed and digested. + -- Francis Bacon + [As anyone who has ever owned a puppy already knows. Ed.] +%% +Some changes are so slow, you don't notice them. +Others are so fast, they don't notice you. +%% +Some circumstantial evidence is very strong, +as when you find a trout in the milk. + -- Thoreau +%% +Some men are discovered; others are found out. +%% +Some men are so interested in their wives continued happiness +that they hire detectives to find out the reason for it. +%% +Some men feel that the only thing they owe +the woman who marries them is a grudge. + -- Helen Rowland +%% +Some men rob you with a six-gun -- others with a fountain pen. + -- Woodie Guthrie +%% +Some men who fear that they are playing +second fiddle aren't in the band at all. +%% +Some of my readers ask me what a "Serial Port" is. +The answer is: I don't know. +Is it some kind of wine you have with breakfast? +%% +Some of the things that live the longest +in peoples' memories never really happened. +%% +Some of us are becoming the men we wanted to marry. + -- Gloria Steinem +%% +Some parts of the past must be preserved, +and some of the future prevented at all costs. +%% +Some people are born mediocre, some people achieve +mediocrity, and some people have mediocrity thrust upon them. + -- Joseph Heller, "Catch-22" +%% +Some people around here wouldn't recognize +subtlety if it hit them on the head. +%% +Some people carve careers, others chisel them. +%% +Some people cause happiness wherever +they go; others, whenever they go. +%% +Some people have a great ambition: to build something +that will last, at least until they've finished building it. +%% +Some people have no respect for age unless it's bottled. +%% +Some people have parts that are so private +they themselves have no knowledge of them. +%% +Some people manage by the book, even though they +don't know who wrote the book or even what book. +%% +Some people need a good imaginary cure +for their painful imaginary ailment. +%% +Some people only open up to tell you that they're closed. +%% +Some peoples mouths work faster than their brains. +They say things they haven't even thought of yet. +%% +Some rise by sin and some by virtue fall. +%% +Some say the world will end in fire, +Some say in ice. +From what I've tasted of desire +I hold with those who favor fire. +But if it had to perish twice +I think I know enough of hate +To say that for destruction, ice +Is also great +And would suffice + -- Robert Frost, "Fire and Ice" +%% +Some scholars are like donkeys, they merely carry a lot of books. + -- Folk saying +%% +Some things have to be believed to be seen. +%% +Somebody ought to cross ball point pens with coat hangers +so that the pens will multiply instead of disappear. +%% +Somebody's terminal is dropping bits. +I found a pile of them over in the corner. +%% +Someday somebody has got to decide whether the +typewriter is the machine, or the person who operates it. +%% +Someday you'll get your big chance -- or have you already had it? +%% +Someday you'll look back on this moment and plow into a parked car. +%% +Someday your prints will come. + -- Kodak +%% +Somehow, the world always affects you more than you affect it. +%% +Someone is speaking well of you. +%% +Someone is speaking well of you. +How unusual! +%% +Someone is unenthusiastic about your work. +%% +Someone whom you reject today, will reject you tomorrow. +%% +Someone will try to honk your nose today. +%% +Something's rotten in the state of Denmark. + -- Shakespeare +%% +Sometime when you least expect it, Love will tap you on the shoulder... +and ask you to move out of the way because it still isn't your turn. + -- N.V. Plyter +%% +Sometimes I feel like I'm fading away, +Looking at me, I got nothin' to say. +Don't make me angry with the things games that you play, +Either light up or leave me alone. +%% +Sometimes I live in the country, +And sometimes I live in town. +And sometimes I have a great notion, +To jump in the river and drown. +%% +Sometimes I simply feel that the whole +world is a cigarette and I'm the only ashtray. +%% +Sometimes I wonder if I'm in my right mind. +Then it passes off and I'm as intelligent as ever. + -- Samuel Beckett, "Endgame" +%% +Sometimes I worry about being a success in a mediocre world. + -- Lily Tomlin +%% +Sometimes, at the end of the day, when I'm +smiling and shaking their hands, I want to kick them. + -- Richard M. Nixon +%% +Sometimes even to live is an act of courage. + -- Seneca +%% +Sometimes the best medicine is to stop taking something. +%% +Sometimes the light is all shining on me, +Other times I can hardly see. +Lately it occurs to me +What a long strange trip it's been. + -- The Grateful Dead, "American Beauty" +%% +Sometimes when I get up in the morning, I feel very peculiar. I feel +like I've just got to bite a cat! I feel like if I don't bite a cat +before sundown, I'll go crazy! But then I just take a deep breath and +forget about it. That's what is known as real maturity. + -- Snoopy +%% +Sometimes, when I think of what that girl means +to me, it's all I can do to keep from telling her. + -- Andy Capp +%% +Sometimes you get an almost irresistible urge to go on living. +%% + "Somewhere", said Father Vittorini, "did Blake not speak of the +Machineries of Joy? That is, did not God promote environments, then +intimidate these Natures by provoking the existence of flesh, toy men and +women, such as are we all? And thus happily sent forth, at our best, with +good grace and fine wit, on calm noons, in fair climes, are we not God's +Machineries of Joy?" + "If Blake said that", said Father Brian, "he never lived in Dublin." + -- R. Bradbury, "The Machineries of Joy" +%% +Somewhere, something incredible is waiting to be known. + -- Carl Sagan +%% +Son, someday a man is going to walk up to you with a deck of cards on which +the seal is not yet broken. And he is going to offer to bet you that he can +make the Ace of Spades jump out of the deck and squirt cider in your ears. +But son, do not bet this man, for you will end up with a ear full of cider. + -- Sky Masterson's Father +%% +Sooner or later you must pay for your sins. +(Those who have already paid may disregard this cookie). +%% +Sorry. Nice try. +%% +Sorry 'bout that sweat, honey. That's just holy water. + -- Little Richard +%% +Sorry never means having you're say to love. +%% +So... so you think you can tell +Heaven from Hell? +Blue skies from pain? Did they get you to trade +Can you tell a green field Your heroes for ghosts? +From a cold steel rail? Hot ashes for trees? +A smile from a veil? Hot air for a cool breeze? +Do you think you can tell? Cold comfort for change? + Did you exchange + A walk on part in a war + For the lead role in a cage? + -- Pink Floyd, "Wish You Were Here" +%% +Space is big. You just won't believe how vastly, hugely, mind-bogglingly +big it is. I mean, you may think it's a long way down the road to the +drug store, but that's just peanuts to space. + -- The Hitchhiker's Guide to the Galaxy +%% +Space is to place as eternity is to time. + -- Joseph Joubert +%% +Space tells matter how to move and matter tells space how to curve. + -- Wheeler +%% +Speak roughly to your little Vax, +And boot it when it crashes; +It knows that one cannot relax +Because the paging thrashes! + +I speak severely to my Vax, +And boot it when it crashes; +In spite of all my favorite hacks, +My jobs it always trashes! +%% +Speak roughly to your little boy, + And beat him when he sneezes: +He only does it to annoy + Because he knows it teases. + + Wow! wow! wow! + +I speak severely to my boy, + And beat him when he sneezes: +For he can thoroughly enjoy + The pepper when he pleases! + + Wow! wow! wow! +%% +"Speak, thou vast and venerable head," muttered Ahab, "which, though +ungarnished with a beard, yet here and there lookest hoary with mosses; speak, +mighty head, and tell us the secret thing that is in thee. Of all divers, +thou has dived the deepest. That head upon which the upper sun now gleams has +moved amid the world's foundations. Where unrecorded names and navies rust, +and untold hopes and anchors rot; where in her murderous hold this frigate +earth is ballasted with bones of millions of the drowned; there, in that awful +water-land, there was thy most familiar home. Thou hast been where bell or +diver never went; has slept by many a sailer's side, where sleepless mothers +would give their lives to lay them down. Thou saw'st the locked lovers when +leaping from their flaming ship; heart to heart they sank beneath the exulting +wave; true to each other, when heaven seemed false to them. Thou saw'st the +murdered mate when tossed by pirates from the midnight deck; for hours he fell +into the deeper midnight of the insatiate maw; and his murderers still sailed +on unharmed -- while swift lightnings shivered the neighboring ship that would +have borne a righteous husband to outstretched, longing arms. O head! thou has +seen enough to split the planets and make an infidel of Abraham, and not one +syllable is thine!" + -- H. Melville, "Moby Dick" +%% +Speaking as someone who has delved into the intricacies of PL/I, I am sure +that only Real Men could have written such a machine-hogging, cycle-grabbing, +all-encompassing monster. Allocate an array and free the middle third? +Sure! Why not? Multiply a character string times a bit string and assign the +result to a float decimal? Go ahead! Free a controlled variable procedure +parameter and reallocate it before passing it back? Overlay three different +types of variable on the same memory location? Anything you say! Write a +recursive macro? Well, no, but Real Men use rescan. How could a language +so obviously designed and written by Real Men not be intended for Real Man use? +%% +Speaking of love, one problem that recurs more and more frequently these +days, in books and plays and movies, is the inability of people to communicate +with the people they love; Husbands and wives who can't communicate, children +who can't communicate with their parents, and so on. And the characters in +these books and plays and so on (and in real life, I might add) spend hours +bemoaning the fact that they can't communicate. I feel that if a person can't +communicate, the very least he can do is to shut up! + -- Tom Lehrer, "That Was the Year that Was" +%% +Speaking of purchasing a dog, never buy a watchdog that's +on sale. After all, everyone knows a bargain dog never bites! +%% +Spence's Admonition: + Never stow away on a kamikaze plane. +%% +Spend extra time on hobby. Get plenty of rolling papers. +%% +Spock: The odds of surviving another +attack are 13562190123 to 1, Captain. +%% +Spock: We suffered 23 casualties in that attack, Captain. +%% +Spring is here, spring is here, +Life is skittles and life is beer. +%% +Squirrels eating squirrels, my God, that's sick. +%% +Stability itself is nothing else than a more sluggish motion. +%% +Staff meeting in the conference room in 3 minutes. +%% +Stamp out organized crime!! Abolish the IRS. +%% +Stamp out philately. +%% +Standing on head makes smile of frown, but rest of face also upside down. +%% +Starkle, starkle, little twink, +Who the hell you are I think +I'm not as drunk as thinkle peep +I'm just a little slort of sheep. +Tee martoonis make a guy, +Feel so woozy, I don't know why. +So mass the pixer and kill my fup +I've all day sober to sunday up. +%% +Start the day with a smile. +After that you can be your nasty old self again. +%% +Statistics are no substitute for judgement. + -- Henry Clay +%% +Stay away from flying saucers today. +%% +Stay away from hurricanes for a while. +%% +Stay the curse. +%% +Stay together, drag each other down. +%% +Stayed in bed all morning just to pass the time, +There's something wrong here, there can be no more denying, +One of us is changing, or maybe we just stopped trying, + +And it's too late, baby, now, it's too late, +Though we really did try to make it, +Something inside has died and I can't hide and I just can't fake it... + +It used to be so easy living here with you, +You were light and breezy and I knew just what to do +Now you look so unhappy and I feel like a fool. + +There'll be good times again for me and you, +But we just can't stay together, don't you feel it too? +But I'm glad for what we had and that I once loved you... + +But it's too late baby... +It's too late, now darling, it's too late... + -- Carol King, "Tapestry" +%% +Steady movement is more important than speed, much of the time. So +long as there is a regular progression of stimuli to get your mental +hooks into, there is room for lateral movement. Once this begins, +its rate is a matter of discretion. + -- Corwin, "Prince of Amber" +%% +Stealing a rhinoceros should not be attempted lightly. +%% +Steckel's Rule to Success: + Good enough is never good enough. +%% +Steele's Plagiarism of Somebody's Philosophy: + Everybody should believe in something -- + I believe I'll have another drink. +%% +Never test for an error condition you don't know how to handle. + -- Steinbach +%% +Stellar rays prove fibbing never pays. +Embezzlement is another matter. +%% +Step back, unbelievers! +Or the rain will never come. +Somebody keep the fire burning, someone come and beat the drum. +You may think I'm crazy, you may think that I'm insane, +But I swear to you, before this day is out, + you folks are gonna see some rain! +%% +Still looking for the glorious results of my misspent youth. +Say, do you have a map to the next joint? +%% +Stock's Observation: + You no sooner get your head above water + but what someone pulls your flippers off. +%% +Stone's Law: + One man's "simple" is another man's "huh?" +%% +Stop! There was first a game of blindman's buff. Of course there was. +And I no more believe Topper was really blind than I believe he had eyes +in his boots. My opinion is, that it was a done thing between him and +Scrooge's nephew; and that the Ghost of Christmas Present knew it. The +way he went after that plump sister in the lace tucker, was an outrage +on the credulity of human nature. +%% +Stop me, before I kill again! +%% +Stop searching. Happiness is right next to you. +%% +Stop searching. Happiness is right next to you. +Now, if they'd only take a bath... +%% +Stop searching forever. Happiness is just next to you. +%% +Stop searching forever. Happiness is unattainable. +%% + Strange memories on this nervous night in Las Vegas. Five years later? +Six? It seems like a lifetime, or at least a Main Era -- the kind of peak that +never comes again. San Fransisco in the middle sixties was a very special time +and place to be a part of. Maybe it meant something. Maybe not, in the long +run... There was madness in any direction, at any hour. If not across the +Bay, then up the Golden Gate or down 101 to Los Altos or La Honda... You could +strike sparks anywhere. There was a fantastic universal sense that whatever we +were doing was right, that we were winning... + And that, I think, was the handle -- that sense of inevitable victory +over the forces of Old and Evil. Not in any mean or military sense; we didn't +need that. Our energy would simply prevail. There was no point in fighting +-- on our side or theirs. We had all the momentum; we were riding the crest +of a high and beautiful wave. So now, less than five years later, you can go +up on a steep hill in Las Vegas and look West, and with the right kind of eyes +you can almost see the high-water mark -- that place where the wave finally +broke and rolled back. + -- H.S. Thompson +%% +Straw? No, too stupid a fad. I put soot on warts. +%% +Stress has been pinpointed as a major cause of illness. To avoid overload +and burnout, keep stress out of your life. Give it to others instead. Learn +the "Gaslight" treatment, the "Are you talking to me?" technique, and the +"Do you feel okay? You look pale." approach. Start with negotiation and +implication. Advance to manipulation and humiliation. Above all, relax +and have a nice day. +%% +Stuckness shouldn't be avoided. It's the psychic predecessor of all +real understanding. An egoless acceptance of stuckness is a key to an +understanding of all Quality, in mechanical work as in other endeavors. + -- R. Pirsig, "Zen and the Art of Motorcycle Maintenance" +%% +Stult's Report: + Our problems are mostly behind us. + What we have to do now is fight the solutions. +%% +Substitute 'damn' every time you're inclined to write 'very'; your +editor will delete it and the writing will be just as it should be. + -- Mark Twain +%% +Success is a journey, not a destination. +%% +Success is getting what you want; happiness is wanting what you get. +%% +Success is something I will dress for when I get there, and not until. +%% +Success is the sole earthly judge of right and wrong. + -- Adolph Hitler, "Mein Kampf" +%% +Succumb to natural tendencies. Be hateful and boring. +%% +Such a foolish notion, that war is called devotion, +when the greatest warriors are the ones who stand for peace. +%% +Such evil deeds could religion prompt. + -- Titus Lucretius Carus +%% +Suggest you just sit there and wait till life gets easier. +%% +Suicide is simply a case of mistaken identity. +%% +Suicide is the sincerest form of self-criticism. + -- Donald Kaul +%% +Sum quod eris. +%% +Sun in the night, everyone is together, +Ascending into the heavens, life is forever. + -- Brand X, "Moroccan Roll/Sun in the Night" +%% +It hangs down from the chandelier +Nobody knows quite what it does +Its color is odd and its shape is weird +It emits a high-sounding buzz + +It grows a couple of feet each day +and wriggles with sort of a twitch +Nobody bugs it 'cause it comes from +a visiting uncle who's rich! + -- To "It Came Upon A Midnight Clear" +%% +Superstition, idolatry, and hypocrisy +have ample wages, but truth goes a-begging. + -- Martin Luther +%% +Support Bingo, keep Grandma off the streets. +%% +Support mental health or I'LL KILL YOU!!!! +%% +Support the American Kidney Foundation. +Don't wear your motorcycle helmet. +%% +Support your local church or synagogue. +Worship at Bank of America. +%% +Support your local hooker! Play rugby! +%% +Support your right to arm bears!! +%% +Support your right to bare arms! + -- A message from the National Short-Sleeved Shirt Association +%% +Sure, Reagan has promised to take senility tests. +But what if he forgets? +%% +Sure, and of course I would vote for a woman for president! +Quite naturally, we wouldn't have to pay her so much. +%% +Surprise! You are the lucky winner of random I.R.S Audit! +Just type in your name and social security number. +Please remember that leaving the room is punishable under law: + +Name # + + +%% +Surprise due today. Also the rent. +%% +Surprise your boss. Get to work on time. +%% +Suspicion always haunts the guilty mind. + -- Wm. Shakespeare +%% +Swap read error. You lose your mind. +%% +Sweet April showers do spring May flowers. + -- Thomas Tusser +%% +Sweet sixteen is beautiful Bess, +And her voice is changing -- from "No" to "Yes". +%% +Swerve me? The path to my fixed purpose is laid with iron rails, +whereon my soul is grooved to run. Over unsounded gorges, through +the rifled hearts of mountains, under torrents' beds, unerringly +I rush! + -- Captain Ahab, "Moby Dick" +%% +Swipple's Rule of Order: + He who shouts the loudest has the floor. +%% +System checkpoint complete. +%% +System going down at 1:45 this afternoon for disk crashing. +%% +System going down at 5 this afternoon to install scheduler bug. +%% +System going down in 5 minutes. +%% +System restarting, wait... +%% +System/3! System/3! +See how it runs! See how it runs! + Its monitor loses so totally! + It runs all its programs in RPG! + It's made by our favorite monopoly! +System/3! +%% +Systems programmers are the high priests of a low cult. + -- R.S. Barton +%% +T. Sturgeon's Law: + 90% of everything is crap. +%% +TACKY: + Serving grape kool-aid at religious functions. +%% +TACT: + The unsaid part of what you're thinking. +%% +TAKE FORCEFUL ACTION: + Do something that should have been done a long time ago. +%% +TAURUS (Apr 20 - May 20) + You are practical and persistent. You have a dogged determination + and work like hell. Most people think you are stubborn and bull + headed. You are a Communist. +%% +TAURUS (Apr.20 - May 20) + Take advantage of this opportunity to get a little extra sleep, + because you're going to miss the bus again today anyway. You will + decide to lose weight today, just like yesterday. +%% +TAX OFFICE: + Den of inequity. +%% +TAXES: + Of life's two certainties, + the only one for which you can get an extension. +%% +TEAMWORK: + Having someone to blame. +%% +TEUTONIC: + Not enough gin. +%% +TEX is potentially the most significant invention in typesetting in this +century. It introduces a standard language for computer typography, and in +terms of importance could rank near the introduction of the Gutenberg press. + -- Gordon Bell +%% +THE BEATLES: + Paul McCartney's old back-up band. +%% + THE CHURCH OF COUNTERFACTUAL BELIEF + +An amalgamation of the Creation Science Research Foundation and the Flat Earth +Society, The Church of Counterfactual Belief has been set up to cater to all +who do not allow demonstrable truth to get in the way of their beliefs. +In addition to creation science and the flatness of the earth, the following +beliefs have been certified by Pope Duane as correct Church dogma: + + --That there is a hole in the Earth at the North Pole from + which UFOs come. + --That pi equals precisely 3.000. + --That Billy Joe Wilson (Hoopla, Miss.) has successfully + squared the circle. + --That Harry Truman is still president, and doing a fine job. +%% +THE LESSER-KNOWN PROGRAMMING LANGUAGES #10 -- SIMPLE + + SIMPLE is an acronym for Sheer Idiot's Monopurpose Programming +Language Environment. This language, developed at the Hanover College +for Technological Misfits, was designed to make it impossible to write +code with errors in it. The statements are, therefore, confined to BEGIN, +END and STOP. No matter how you arrange the statements, you can't make +a syntax error. Programs written in SIMPLE do nothing useful. Thus +they achieve the results of programs written in other languages without +the tedious, frustrating process of testing and debugging. +%% +THE LESSER-KNOWN PROGRAMMING LANGUAGES #12 -- LITHP + + This otherwise unremarkable language is distinguished by the +absence of an "S" in its character set; users must substitute "TH". +LITHP is said to be useful in protheththing lithtth. +%% +THE LESSER-KNOWN PROGRAMMING LANGUAGES #13 -- SLOBOL + + SLOBOL is best known for the speed, or lack of it, of its compiler. +Although many compilers allow you to take a coffee break while they compile, +SLOBOL compilers allow you to travel to Bolivia to pick the beans. Forty- +three programmers are known to have died of boredom sitting at their terminals +while waiting for a SLOBOL program to compile. Weary SLOBOL programmers +often turn to a related (but infinitely faster) language, COCAINE. +%% +THE LESSER-KNOWN PROGRAMMING LANGUAGES #14 -- VALGOL + + VALGOL is enjoying a dramatic surge of popularity across the +industry. VALGOL commands include REALLY, LIKE, WELL, and Y*KNOW. +Variables are assigned with the =LIKE and =TOTALLY operators. Other +operators include the "California booleans", FERSURE and NOWAY. VALGOL +is characterized by its unfriendly error messages. For example, when +the user makes a syntax error, the interpreter displays the message GAG +ME WITH A SPOON! A successful compile may be termed MAXIMALLY AWESOME! +%% +THE LESSER-KNOWN PROGRAMMING LANGUAGES #17 -- DOGO + + Developed at the Massachusetts Institute of Obedience Training, DOGO +DOGO heralds a new era of computer-literate pets. DOGO commands include +SIT, STAY, HEEL, and ROLL OVER. An innovative feature of DOGO is "puppy +graphics", a small cocker spaniel that occasionally leaves a deposit as +he travels across the screen. +%% +THE LESSER-KNOWN PROGRAMMING LANGUAGES #17 -- SARTRE + + Named after the late existential philosopher, SARTRE is an extremely +unstructured language. Statements in SARTRE have no purpose; they just are. +Thus SARTRE programs are left to define their own functions. SARTRE +programmers tend to be boring and depressed, and are no fun at parties. +%% +THE LESSER-KNOWN PROGRAMMING LANGUAGES #18 -- C- + + This language was named for the grade received by its creator when +he submitted it as a class project in a graduate programming class. C- is +best described as a "low-level" programming language. In fact, the language +generally requires more C- statements than machine-code statements to execute +a given task. In this respect, it is very similar to COBOL. +%% +THE LESSER-KNOWN PROGRAMMING LANGUAGES #18 -- FIFTH + + FIFTH is a precision mathematical language in which the data types +refer to quantity. The data types range from CC, OUNCE, SHOT, and JIGGER to +FIFTH (hence the name of the language), LITER, MAGNUM and BLOTTO. Commands +refer to ingredients such as CHABLIS, CHARDONNAY, CABERNET, GIN, VERMOUTH, +VODKA, SCOTCH, and WHATEVERSAROUND. + The many versions of the FIFTH language reflect the sophistication and +financial status of its users. Commands in the ELITE dialect include VSOP and +LAFITE, while commands in the GUTTER dialect include HOOTCH and RIPPLE. The +latter is a favorite of frustrated FORTH programmers who end up using this +language. +%% +THE LESSER-KNOWN PROGRAMMING LANGUAGES #5 -- LAIDBACK + + LAIDBACK was developed at the (now defunct) Marin County Center for +T'ai Chi, Mellowness and Computer Programming, as an alternative to the more +intense languages of nearby Silicon Valley. + The Center was ideal for programmers who liked to soak in hot tubs +while they worked. Unfortunately, few programmers could survive there long, +since the Center outlawed pizza and RC Cola in favor of bean curd and Perrier. + Many mourn the demise of LAIDBACK because of its reputation as a +gentle and nonthreatening language. For example, LAIDBACK responded to +syntax errors with the message SORRY MAN, I CAN'T DEAL BEHIND THAT. +%% +THE NEW RIGHT: + A javelin team that elects to receive. +%% +THEORY +Into love and out again, + Thus I went and thus I go. +Spare your voice, and hold your pen: + Well and bitterly I know +All the songs were ever sung, + All the words were ever said; +Could it be, when I was young, + Someone dropped me on my head? + -- Dorothy Parker +%% +THEORY: + System of ideas meant to explain something, chosen with a view to + originality, controversialism, incomprehensibility, and how good + it will look in print. +%% + THIS IS PLEDGE WEEK FOR THE FORTUNE PROGRAM + +If you like the fortune program, why not support it now with your contribution +of a pithy fortune, clean or obscene? We cannot continue without your support. +Less than 14% of all fortune users are contributors. That means that 86% of +you are getting a free ride. We can't go on like this much longer. Federal +cutbacks mean less money for fortunes, and unless user contributions increase +to make up the difference, the fortune program will have to shut down between +midnight and 8 a.m. Don't let this happen. Mail your fortunes right now to +`fortune'. Just type in your favorite pithy fortune. Do it now before you +forget. Our target is 300 new fortunes by the end of the week. Don't miss +out. All fortunes will be acknowledged. If you contribute 30 fortunes or +more, you will receive a free subscription to "The Fortune Hunter", our monthly +program guide. If you contribute 50 or more, you will receive a free "Fortune +Hunter" coffee mug! +%% +THREE-BAG UGLY: + That's when you put one bag over her head, one bag over your + head in case her's falls off, and one over the dog's to keep it + from howling. +%% +TIRED of calculating components of vectors? Displacements along direction of +force getting you down? Well, now there's help. Try amazing "Dot-Product", +the fast, easy way many professionals have used for years and is now available +to YOU through this special offer. Three out of five engineering consultants +recommend "Dot-Product" for their clients who use vector products. Mr. +Gumbinowitz, mechanical engineer, in a hidden-camera interview... + "Dot-Product really works! Calculating Z-axis force components has + never been easier." +Yes, you too can take advantage of the amazing properties of Dot-Product. Use +it to calculate forces, velocities, displacements, and virtually any vector +components. How much would you pay for it? But wait, it also calculates the +work done in Joules, Ergs, and, yes, even BTU's. Divide Dot-Product by the +magnitude of the vectors and it becomes an instant angle calculator! Now, how +much would you pay? All this can be yours for the low, low price of $19.95!! +But that's not all! If you order before midnight, you'll also get "Famous +Numbers of Famous People" as a bonus gift, absolutely free! Yes, you'll get +Avogadro's number, Planck's, Euler's, Boltzmann's, and many, many, more!! +Call 1-800-DOT-6000. Operators are standing by. That number again... +1-800-DOT-6000. Supplies are limited, so act now. This offer is not +available through stores and is void where prohibited by law. +%% +TODAY: + A nice place to visit, but you can't stay here for long. +%% +TRAGEDY: + A busload of lawyers driving off a cliff with three empty seats. +%% +TRANSACTION CANCELLED - FARECARD RETURNED +%% +TRANSFER: + A promotion you receive on the condition that you leave town. +%% +TRANSPARENT: + Being or pertaining to an existing, nontangible object. + "It's there, but you can't see it" + -- IBM System/360 announcement, 1964. + +VIRTUAL: + Being or pertaining to a tangible, nonexistent object. + "I can see it, but it's not there." + -- Lady Macbeth. +%% +TRANSVESTITE: + Someone who spends his junior year at college abroad. +%% +TRAVEL: + Something that makes you feel like you're getting somewhere. +%% +TRUTHFUL: + Dumb and illiterate. +%% +Tis man's perdition to be safe, when for the truth he ought to die. +%% +TV is chewing gum for the eyes. + -- Frank Lloyd Wright +%% +Tact in audacity is knowing how far you can go without going too far. + -- Jean Cocteau +%% +Tact is the ability to tell a man he has +an open mind when he has a hole in his head. +%% +Tact is the art of making a point without making an enemy. +%% +Take a lesson from the whale; the only time +he gets speared is when he raises to spout. +%% +Take a look around you, tell me what you see, +A girl who thinks she's ordinary lookin' she has got the key. +If you can get close enough to look into her eyes +There's something special right behind the bitterness she hides. + And you're fair game, + You never know what she'll decide, you're fair game, + Just relax, enjoy the ride. +Find a way to reach her, make yourself a fool, +But do it with a little class, disregard the rules. +'Cause this one knows the bottom line, couldn't get a date. +The ugly duckling striking back, and she'll decide her fate. + (chorus) +The ones you never notice are the ones you have to watch. +She's pleasant and she's friendly while she's looking at your crotch. +Try your hand at conversation, gossip is a lie, +And sure enough she'll take you home and make you wanna die. + (chorus) + -- Crosby, Stills, Nash, "Fair Game" +%% +Take an astronaut to launch. +%% +Take care of the luxuries and the +necessities will take care of themselves. + -- L. Long +%% +Take everything in stride. +Trample anyone who gets in your way. +%% +Take it easy, we're in a hurry. +%% +Take my word for it, the silliest woman can manage a clever man, +but it needs a very clever woman to manage a fool. + -- Kipling +%% +Take time to reflect on all the things you have, not as a result of your +merit or hard work or because God or chance or the efforts of other people +have given them to you. +%% +Take what you can use and let the rest go by. + -- Ken Kesey +%% +Take your Senator to lunch this week. +%% +Take your dying with some seriousness, however. +Laughing on the way to your execution is not generally understood +by less-advanced life-forms, and they'll call you crazy. + -- Messiah's Handbook : Reminders for the Advanced Soul +%% +Talk sense to a fool and he calls you foolish. + -- Euripides +%% +Talkers are no good doers. + -- William Shakespeare, "Henry VI" +%% +Talking much about oneself can also be a means to conceal oneself. + -- Friedrich Nietzsche +%% +Tallulah Bankhead barged down the +Nile last night as Cleopatra and sank. + -- John Mason Brown, drama critic +%% +Tan me hide when I'm dead, Fred, +Tan me hide when I'm dead. +So we tanned his hide when he died, Clyde, +It's hanging there on the shed. + +All together now... + Tie me kangaroo down, sport, + Tie me kangaroo down. + Tie me kangaroo down, sport, + Tie me kangaroo down. +%% +Tart words make no friends; a spoonful of honey +will catch more flies than a gallon of vinegar. + -- B. Franklin +%% +Tax reform means "Don't tax you, don't +tax me, tax that fellow behind the tree." + -- Russell Long +%% +Taxes are not levied for the benefit of the taxed. +%% +Teach children to be polite and courteous in the home, and, +when they grow up, they won't be able to edge a car onto a freeway. +%% +Teachers have class. +%% +Teamwork is essential -- it allows you to blame someone else. +%% +Technicality, n. In an English court a man named Home was tried for +slander in having accused a neighbor of murder. His exact words were: +"Sir Thomas Holt hath taken a cleaver and stricken his cook upon the +head, so that one side of his head fell on one shoulder and the other +side upon the other shoulder." The defendant was acquitted by +instruction of the court, the learned judges holding that the words did +not charge murder, for they did not affirm the death of the cook, that +being only an inference. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Technological progress has merely provided us +with more efficient means for going backwards. + -- Aldous Huxley +%% +Technology is dominated by those who manage what they do not understand. +%% +Tehee quod she, and clapte the wyndow to. + -- Geoffrey Chaucer +%% +Telephone books are like dictionaries -- if you know the answer before +you look it up, you can eventually reaffirm what you thought you knew +but weren't sure. But if you're searching for something you don't +already know, your fingers could walk themselves to death. + -- Erma Bombeck +%% +Television is now so desperately hungry for material +that it is scraping the top of the barrel. + -- Gore Vidal +%% +Television only proves that people will look at anything -- +rather than each other. +%% +Tell a man there are 300 billion stars in the universe and he'll +believe you. Tell him a bench has wet paint on it and he'll have +to touch to be sure. +%% +Tell me what to think!!! +%% +Telling the truth to people who misunderstand you is generally +promoting a falsehood, isn't it? + -- A. Hope +%% +Tempt me with a spoon! +%% +Tempt not a desperate man. + -- William Shakespeare, "Romeo and Juliet" +%% +Ten persons who speak make more noise than ten thousand who are silent. + -- Napoleon I +%% +Ten years of rejection slips is nature's +way of telling you to stop writing. + -- R. Geis +%% +"Terence, this is stupid stuff: +You eat your victuals fast enough; +There can't be much amiss, 'tis clear, +To see the rate you drink your beer. +But oh, good Lord, the verse you make, +It gives a chap the belly-ache. +The cow, the old cow, she is dead; +It sleeps well the horned head: +We poor lads, 'tis our turn now +To hear such tunes as killed the cow. +Pretty friendship 'tis to rhyme +Your friends to death before their time. +Moping, melancholy mad: +Come, pipe a tune to dance to, lad." + -- A.E. Housman +%% +Term, holidays, term, holidays, till we leave +school, and then work, work, work till we die. + -- C.S. Lewis +%% +Tertullian was born in Carthage somewhere about 160 A.D. He was a pagan, +and he abandoned himself to the lascivious life of his city until about +his 35th year, when he became a Christian. [...] To him is ascribed the +sublime confession: Credo quia absurdum est (I believe because it is absurd). +This does not altogether accord with historical fact, for he merely said: + "And the Son of God died, which is immediately credible because it + is absurd. And buried he rose again, which is certain because it + is impossible." +Thanks to the acuteness of his mind, he saw through the poverty of +philosophical and Gnostic knowledge, and contemptuously rejected it. + -- C.G. Jung, "Psychological Types" + [Teruillian was one of the founders of the Catholic Church. Ed.] +%% +Test for paraquat: + Take amount of grass used in one joint, and wash in 5 cc's + of water, agitating gently for 15 minutes. Strain out leaves, + leaving a brownish-yellow solution. Add 100 mg each of sodium + bicarbonate and sodium dithionite. If paraquat is present, + the solution will turn blue-green. +%% +Test-tube babies shouldn't throw stones. +%% +Texas A&M football coach Jackie Sherrill went to the office of the Dean +of Academics because he was concerned about his players' mental abilities. +"My players are just too stupid for me to deal with them", he told the +unbelieving dean. At this point, one of his players happened to enter +the dean's office. "Let me show you what I mean", said Sherrill, and he +told the player to run over to his office to see if he was in. "OK, Coach", +the player replied, and was off. "See what I mean?" Sherrill asked. +"Yeah", replied the dean. "He could have just picked up this phone and +called you from here." +%% +Texas is Hell on woman and horses. + -- Wayne Oakes +%% +Thank you for observing all safety precautions. +%% +That Xanthippe's husband should have become so great a philosopher is +remarkable. Amid all the scolding, to be able to think! But he could not +write: that was impossible. Socrates has not left us a single book. + -- Heine +%% +That does not compute. +%% +That money talks, +I'll not deny, +I heard it once, +It said "Good-bye. + -- Richard Armour +%% +That must be wonderful: I don't understand it at all. + -- Moliere +%% +That segment of the community with which one has the greatest +sympathy as a liberal, inevitably turns out to be one of the most +narrow-minded and bigoted segments of the community. +%% +That that is is that that is not is not. +%% +That, that is, is. +That, that is not, is not. +That, that is, is not that, that is not. +That, that is not, is not that, that is. +%% +That which is not good for the swarm, neither is it good for the bee. +%% +That woman speaks eight languages and can't say "no" in any of them. + -- Dorothy Parker +%% +That's always the way when you discover +something new; everyone thinks you're crazy. + -- Evelyn E. Smith +%% +That's life for you, said McDunn. Someone always waiting for someone +who never comes home. Always someone loving something more than that +thing loves them. And after awhile you want to destroy whatever that +thing is, so it can't hurt you no more. + -- R. Bradbury, "The Fog Horn" +%% +That's life. + What's life? +A magazine. + How much does it cost? +Two-fifty. + I only have a dollar. +That's life. +%% +That's no moon... + -- Obi-wan Kenobi +%% +That's one small step for a man; one giant leap for mankind. + -- Neil Armstrong +%% +That's the true harbinger of spring, not crocuses or swallows +returning to Capistrano, but the sound of a bat on a ball. + -- Bill Veeck +%% +That's what she said. +%% +The White Rabbit put on his spectacles. + "Where shall I begin, please your Majesty ?" he asked. + "Begin at the beginning,", the King said, very gravely, +"and go on till you come to the end: then stop." + -- Lewis Carroll +%% +The greatest disloyalty one can offer to great pioneers +is to refuse to move an inch from where they stood. +%% +The key elements in human thinking are +not numbers but labels of fuzzy sets. + -- L. Zadeh +%% +The 11 is for people with the pride of a 10 and the pocketbook of an 8. + -- R.B. Greenberg +%% +The 357.73 Theory -- + Auditors always reject expense accounts + with a bottom line divisible by 5. +%% +The Abrams' Principle: + The shortest distance between two points is off the wall. +%% +The Almighty in His infinite wisdom did not see +fit to create Frenchmen in the image of Englishmen. + -- Winston Churchill, 1942 +%% +The American system of ours, call it Americanism, call it Capitalism, +call it what you like, gives each and every one of us a great +opportunity if we only seize it with both hands and make the most of it. + -- Al Capone +%% +The Analytical Engine weaves Algebraical patterns +just as the Jacquard loom weaves flowers and leaves. + -- Ada Augusta, Countess of Lovelace, the first programmer +%% +The Angels want to wear my red shoes. + -- E. Costello +%% +The Army has carried the American ... ideal to its logical conclusion. +Not only do they prohibit discrimination on the grounds of race, creed +and color, but also on ability. + -- T. Lehrer +%% +The Army needs leaders the way a foot needs a big toe. + -- Bill Murray +%% +The Bible on letters of reference: + + Are we beginning all over again to produce our credentials? Do +we, like some people, need letters of introduction to you, or from you? +No, you are all the letter we need, a letter written on your heart; any +man can see it for what it is and read it for himself. + -- 2 Corinthians 3:1-2, New English translation +%% +The Bible says that woman was the last thing God made. +Evidently He made her on Saturday night. She reveals his fatigue. + -- Dumas +%% +The Bird of Time has but a little way to fly ... +and the bird is on the wing. + -- Omar Khayyam +%% +The Briggs - Chase Law of Program Development: + To determine how long it will take to write and debug a + program, take your best estimate, multiply that by two, add + one, and convert to the next higher units. +%% +The British are coming! The British are coming! +%% +The Buddha, the Godhead, resides quite as comfortably in the circuits of a +digital computer or the gears of a cycle transmission as he does at the top +of a mountain or in the petals of a flower. To think otherwise is to demean +the Buddha -- which is to demean oneself. + -- Robert Pirsig, "Zen and the Art of Motorcycle Maintenance" +%% +The Commandments of the EE: + +1: Beware of lightning that lurketh in an uncharged condenser + lest it cause thee to bounce upon thy buttocks in a most + embarrassing manner. +2: Cause thou the switch that supplieth large quantities of juice to + be opened and thusly tagged, that thy days may be long in this + earthly vale of tears. +3: Prove to thyself that all circuits that radiateth, and upon + which the worketh, are grounded and thusly tagged lest they lift + thee to a radio frequency potential and causeth thee to make like + a radiator too. +4: Tarry thou not amongst these fools that engage in intentional + shocks for they are not long for this world and are surely + unbelievers. +%% +The Commandments of the EE: + +5: Take care that thou useth the proper method when thou takest the + measures of high-voltage circuits too, that thou dost not incinerate + both thee and thy test meter, for verily, though thou has no company + property number and can be easily surveyed, the test meter has + one and, as a consequence, bringeth much woe unto a purchasing agent. +6: Take care that thou tamperest not with interlocks and safety devices, + for this incurreth the wrath of the chief electrician and bring + the fury of the engineers on his head. +7: Work thou not on energized equipment for if thou doest so, thy + friends will surely be buying beers for thy widow and consoling + her in certain ways not generally acceptable to thee. +8: Verily, verily I say unto thee, never service equipment alone, + for electrical cooking is a slow process and thou might sizzle in + thy own fat upon a hot circuit for hours on end before thy maker + sees fit to end thy misery and drag thee into his fold. +%% +The Commandments of the EE: + +9: Trifle thee not with radioactive tubes and substances lest thou + commence to glow in the dark like a lightning bug, and thy wife be + frustrated and have not further use for thee except for thy wages. +10: Commit thou to memory all the words of the prophets which are + written down in thy Bible which is the National Electrical Code, + and giveth out with the straight dope and consoleth thee when + thou hast suffered a ream job by the chief electrician. +11: When thou muckest about with a device in an unthinking and/or + unknowing manner, thou shalt keep one hand in thy pocket. Better + that thou shouldest keep both hands in thy pockets than + experimentally determine the electrical potential of an + innocent-seeming device. +%% +The Crown is full of it! + -- Nate Harris, 1775 +%% +The English have no respect for their language, +and will not teach their children to speak it. + -- G.B. Shaw +%% +The Fifth Rule: + You have taken yourself too seriously. +%% +The Force is what holds everything together. +It has its dark side, and it has its light side. +It's sort of like cosmic duct tape. +%% +The [Ford Foundation] is a large body of money +completely surrounded by people who want some. + -- Dwight MacDonald +%% +[The French Riviera is] a sunny place for shady people. + -- Somerset Maugham +%% +The Golden Rule of Arts and Sciences: + He who has the gold makes the rules. +%% + The Guy on the Right Doesn't Stand a Chance +The guy on the right has the Osborne 1, a fully functional computer system +in a portable package the size of a briefcase. The guy on the left has an +Uzi submachine gun concealed in his attache case. Also in the case are four +fully loaded, 32-round clips of 125-grain 9mm ammunition. The owner of the +Uzi is going to get more tactical firepower delivered -- and delivered on +target -- in less time, and with less effort. All for $795. It's inevitable. +If you're going up against some guy with an Osborne 1 -- or any personal +computer -- he's the one who's in trouble. One round from an Uzi can zip +through ten inches of solid pine wood, so you can imagine what it will do +to structural foam acrylic and sheet aluminum. In fact, detachable magazines +for the Uzi are available in 25-, 32-, and 40-round capacities, so you can +take out an entire office full of Apple II or IBM Personal Computers tied +into Ethernet or other local-area networks. What about the new 16-bit +computers, like the Lisa and Fortune? Even with the Winchester backup, +they're no match for the Uzi. One quick burst and they'll find out what +Unix means. Make your commanding officer proud. Get an Uzi -- and come home +a winner in the fight for office automatic weapons. + -- "InfoWorld", June, 1984 +%% +The Heineken Uncertainty Principle: + You can never be sure how many beers you had last night. +%% +The History of every major Galactic Civilization tends to pass through +three distinct and recognizable phases, those of Survival, Inquiry, and +Sophistication, otherwise known as the How, Why, and Where phases. For +instance, the first phase is characterized by the question "How can we +eat?" the second by "Why do we eat?" and the third by "Where shall we +have lunch?". + -- Hitchhiker's Guide to the Galaxy +%% + The Hitchhiker's Guide to the Galaxy has a few things to say on +the subject of towels. + Most importantly, a towel has immense psychological value. For +some reason, if a non-hitchhiker discovers that a hitchhiker has his towel +with him, he will automatically assume that he is also in possession of a +toothbrush, washcloth, flask, gnat spray, space suit, etc., etc. Furthermore, +the non-hitchhiker will then happily lend the hitchhiker any of these or +a dozen other items that he may have "lost". After all, any man who can +hitch the length and breadth of the Galaxy, struggle against terrible odds, +win through and still know where his towel is, is clearly a man to be +reckoned with. +%% + The Hitchiker's Guide to the Galaxy has a few things to say on +the subject of towels. + A towel, it says, is about the most massively useful thing an +interstellar hitchhiker can have. Partly it has great practical value. +You can wrap it around you for warmth as you bound across the cold moons +of Jaglan Beta; you can lie on it on the brilliant marble-sanded beaches +of Santraginus V ... use it to sail a miniraft down the slow heavy River +Moth; wave your towel in emergencies, and, of course, dry yourself off +with it if it still seems to be clean enough. +%% +The IBM 2250 is impressive ... +if you compare it with a system selling for a tenth its price. + -- D. Cohen +%% +The IQ of the group is the lowest IQ of a member of +the group divided by the number of people in the group. +%% +The Junior God now heads the roll +In the list of heaven's peers; +He sits in the House of High Control, +And he regulates the spheres. +Yet does he wonder, do you suppose, +If, even in gods divine, +The best and wisest may not be those +Who have wallowed awhile with the swine? + -- R.W. Service +%% +The Kennedy Constant: + Don't get mad -- get even. +%% +The Killer Ducks are coming!!! +%% +The Kosher Dill was invented in 1723 by Joe Kosher and Sam Dill. It is +the single most popular pickle variety today, enjoyed throughout the free +world by man, woman and child alike. An astounding 350 billion kosher +dills are eaten each year, averaging out to almost 1/4 pickle per person +per day. New York Times food critic Mimi Sheraton says "The kosher dill +really changed my life. I used to enjoy eating McDonald's hamburgers and +drinking Iron City Lite, and then I encountered the kosher dill pickle. +I realized that there was far more to haute cuisine then I'd ever imagined. +And now, just look at me." +%% +The Law, in its majestic equality, forbids the rich, as well as the +poor, to sleep under the bridges, to beg in the streets, and to steal +bread. + -- Anatole France +%% +The Law of Probable Dispersal: + That which hits the fan will not be evenly distributed. +%% +The Law of the Letter: + The best way to inspire fresh thoughts is to seal the envelope. +%% +The Law of the Perversity of Nature: + You cannot determine beforehand which side of the bread to butter. +%% +The Lord gave us farmers two strong hands so we +could grab as much as we could with both of them. + -- Major Major's father +%% +The Marines: + The few, the proud, the dead on the beach. +%% +The Marines: + The few, the proud, the not very bright. +%% + The Martian landed his saucer in Manhattan, and immediately upon +emerging was approached by a panhandler. "Mister," said the man, "can I +have a quarter?" + The Martian asked, "What's a quarter?" + The panhandler thought a minute, brightened, then said, "You're +right! Can I have a dollar?" +%% +The Modelski Chain Rule: +1: Look intently at the problem for several minutes. Scratch your + head at 20-30 second intervals. Try solving the problem on your + Hewlett-Packard. +2: Failing this, look around at the class. Select a particularly + bright-looking individual. +3: Procure a large chain. +4: Walk over to the selected student and threaten to beat him severely + with the chain unless he gives you the answer to the problem. + Generally, he will. It may also be a good idea to give him a sound + thrashing anyway, just to show you mean business. +%% +The Moral Majority is neither. +%% +The Moving Finger writes; and, having writ, + Moves on: nor all they Piety nor Wit +Shall lure it back to cancel half a Line, + Nor all thy Tears wash out a Word of it. +%% +The New Testament offers the basis for modern computer coding theory, +in the form of an affirmation of the binary number system. + + But let your communication be Yea, yea; nay, nay: + for whatsoever is more than these cometh of evil. + + -- Matthew 5:37 +%% +The Official MBA Handbook on business cards: + + Avoid overly pretentious job titles such as "Lord of the + Realm, Defender of the Faith, Emperor of India" or "Director + of Corporate Planning." +%% +The Official MBA Handbook on doing company business on an airplane: + + Do not work openly on top-secret company cost documents unless + you have previously ascertained that the passenger next to you + is blind, a rock musician on mood-ameliorating drugs, or the + unfortunate possessor of a forty-seventh chromosome. +%% +The Official MBA Handbook on the use of sunlamps: + Use a sunlamp only on weekends. That way, if the office wise guy + remarks on the sudden appearance of your tan, you can fabricate + some story about a sun-stroked weekend at some island Shangri-La + like Caneel Bay. Nothing is more transparent than leaving the + office at 11:45 on a Tuesday night, only to return an Aztec sun + god at 8:15 the next morning. +%% +The Pig, if I am not mistaken, +Gives us ham and pork and Bacon. +Let others think his heart is big, +I think it stupid of the Pig. +%% +The Poems, all three hundred of them, +may be summed up in one of their phrases: +"Let our thoughts be correct". + -- Confucius +%% +The Preacher, the Politician, the Teacher, + Were each of them once a kiddie. +A child, indeed, is a wonderful creature. + Do I want one? God Forbiddie! + -- Ogden Nash +%% +The Public is merely a multiplied "me." + -- Mark Twain +%% +The Rabbits The Cow +Here is a verse about rabbits The cow is of the bovine ilk; +That doesn't mention their habits. One end is moo, the other, milk. + -- Ogden Nash +%% +The Ranger isn't gonna like it, Yogi. +%% +The Reverend Henry Ward Beecher +Called a hen a most elegant creature. + The hen, pleased with that, + Laid an egg in his hat -- +And thus did the hen reward Beecher. + -- Oliver Wendell Holmes +%% +The Roman Rule + The one who says it cannot be done should never interrupt the + one who is doing it. +%% +The Russians have put a small ball up in the air. +That does not raise my apprehensions one iota. + -- Dwight D. Eisenhower +%% +The Schwine-Kitzenger Institute study +of 47 men over the age of 100 showed that all had these things in common: + 1) They all had moderate appetites. + 2) They all came from middle class homes. + 3) All but two of them were dead. +%% +The Shuttle is now going five times the sound of speed. + -- Dan Rather, first landing of Columbia +%% + The Split-Atom Blues +Gimme Twinkies, gimme wine, + Gimme jeans by Calvin Kline... +But if you split those atoms fine, + Mama keep 'em off those genes of mine! +Gimme zits, take my dough, + Gimme arsenic in my jelly roll... +Call the devil and sell my soul, + But Mama keep dem atoms whole! + -- Milo Bloom +%% +The Supreme Court does it with all deliberate speed. +%% +The Third Law of Photography: + If you did manage to get any good shots, they will be ruined + when someone inadvertently opens the darkroom door and all of + the dark leaks out. +%% +The Thought Police are here. They've come +To put you under cardiac arrest. +And as they drag you through the door +They tell you that you've failed the test. + -- Buggles, "Living in the Plastic Age" +%% +The Tree of Learning bears the noblest fruit, but noble fruit tastes bad. +%% +The USA is so enormous, and so numerous are its schools, colleges and +religious seminaries, many devoted to special religious beliefs ranging +from the unorthodox to the dotty, that we can hardly wonder at its +yielding a more bounteous harvest of gobbledegook than the rest of the +world put together. + -- Sir Peter Medawar +%% +The United States Army; +194 years of proud service, unhampered by progress. +%% +The Universe is populated by stable things. + -- Richard Dawkins +%% +The University of California Bears announced the signing of Reggie +Philbin to a letter of intent to attend Cal next Fall. Philbin is +said to make up for no talent by cheating well. Says Philbin of +his decision to attend Cal, "I'm in it for the free ride." +%% +The VFW represents many who died to give this country a second chance +to make it what it is supposed to be -- God's guest house on earth. + -- John Wayne +%% +The absence of labels [in ECL] is probably a good thing. + -- T. Cheatham +%% +The absurd is the essential concept and the first truth. + -- A. Camus +%% +The abuse of greatness is when it disjoins remorse from power. + -- William Shakespeare, "Julius Caesar" +%% +The adjective is the banana peel of the parts of speech. + -- Clifton Fadiman +%% +The adjuration to be "normal" seems shockingly repellent to me; I see neither +hope nor comfort in sinking to that low level. I think it is ignorance that +makes people think of abnormality only with horror and allows them to remain +undismayed at the proximity of "normal" to average and mediocre. For surely +anyone who achieves anything is, essentially, abnormal. + -- Dr. Karl Menninger, "The Human Mind", 1930 +%% +The aim of science is to seek the simplest explanations of complex +facts. Seek simplicity and distrust it. + -- Whitehead. +%% +The anger of a woman is the greatest evil +with which you can threaten your enemies. + -- Bonnard +%% +The angry man always thinks he can do more than he can. + -- Albertano of Brescia +%% +The annual meeting of the "You Have To Listen To Experience" Club is now in +session. Our Achievement Awards this year are in the fields of publishing, +advertising and industry. For best consistent contribution in the field of +publishing our award goes to editor, R.L.K., [...] for his unrivalled alle- +giance without variation to the statement: "Personally I'd love to do it, +we'd ALL love to do it. But we're not going to do it. It's not the kind of +book our house knows how to handle." Our superior performance award in the +field of advertising goes to media executive, E.L.M., [...] for the continu- +ally creative use of the old favorite: "I think what you've got here could be +very exciting. Why not give it one more try based on the approach I've out- +lined and see if you can come up with something fresh." Our final award for +courageous holding action in the field of industry goes to supervisor, R.S., +[...] for her unyielding grip on "I don't care if they fire me, I've been +arguing for a new approach for YEARS but are we SURE that this is the right +time--" I would like to conclude this meeting with a verse written specially +for our prospectus by our founding president fifty years ago -- and now, as +then, fully expressive of the emotion most close to all our hearts -- + Treat freshness as a youthful quirk, + And dare not stray to ideas new, + For if t'were tried they might e'en work + And for a living what woulds't we do? +%% +The answer to the Ultimate Question of Life, the Universe, and +Everything was released with the kind permission of the Amalgamated +Union of Philosophers, Sages, Luminaries, and Other Professional +Thinking Persons. +%% +The attacker must vanquish; the defender need only survive. +%% +The attention span of a computer is only as long as its power cord. +%% +The average individual's position in any hierarchy is a lot like pulling +a dogsled -- there's no real change of scenery except for the lead dog. +%% +The average woman must inevitably view her actual husband with a certain +disdain; he is anything but her ideal. In consequence, she cannot help +feeling that her children are cruelly handicapped by the fact that he is +their father. + -- Mencken +%% +The average woman would rather have beauty than brains, +because the average man can see better than he can think. +%% +The bay-trees in our country are all wither'd +And meteors fright the fixed stars of heaven; +The pale-faced moon looks bloody on the earth +And lean-look'd prophets whisper fearful change. +These signs forerun the death or fall of kings. + -- Wm. Shakespeare, "Richard II" +%% +The best book on programming for the layman is "Alice in Wonderland"; +but that's because it's the best book on anything for the layman. +%% +The best cure for insomnia is to get a lot of sleep. + -- W.C. Fields +%% +The best defense against logic is ignorance. +%% +The best diplomat I know is a fully activated phaser bank. + -- Scotty +%% +The best equipment for your work is, of course, the most expensive. +However, your neighbor is always wasting money that should be yours +by judging things by their price. +%% +The best laid plans of mice and men are usually about equal. + -- Blair +%% +The best man for the job is often a woman. +%% +The best portion of a good man's life, his little, +nameless, unremembered acts of kindness and love. + -- Wordsworth +%% +The best prophet of the future is the past. +%% +The best thing about growing older is that it takes such a long time. +%% + "The best thing for being sad," replied Merlin, beginning to puff +and blow, "is to learn something. That's the only thing that never fails. +You may grow old and trembling in your anatomies, you may lie awake at +night listening to the disorder of your veins, you may miss your only love, +you may see the world about you devastated by evil lunatics, or know your +honour trampled in the sewers of baser minds. There is only one thing for +it then -- to learn. Learn why the world wags and what wags it. That is +the only thing which the mind can never exhaust, never alienate, never be +tortured by, never fear or distrust, and never dream of regretting. Learning +is the only thing for you. Look what a lot of things there are to learn." + -- T.H. White, "The Once and Future King" +%% +The best things in life are for a fee. +%% +The best way to avoid responsibility is +to say, "I've got responsibilities." +%% +The best way to get rid of worries is to let them die of neglect. +%% +The best way to keep your friends is not to give them away. +%% +The best way to preserve a right is to exercise it, +and the right to smoke is a right worth dying for. +%% +The best you get is an even break. + -- Franklin Adams +%% +The better part of valor is discretion. + -- William Shakespeare, "Henry IV" +%% +The big question is why in the course of evolution the males +permitted themselves to be so totally eclipsed by the females. +Why do they tolerate this total subservience, this wretched +existence as outcasts who are hungry all the time? +%% +The bigger they are, the harder they hit. +%% +The biggest difference between time +and space is that you can't reuse time. + -- Merrick Furst +%% +The biggest mistake you can make is to +believe that you are working for someone else. +%% + The birds are singing, the flowers are budding, and it is time +for Miss Manners to tell young lovers to stop necking in public. + It's not that Miss Manners is immune to romance. Miss Manners +has been known to squeeze a gentleman's arm while being helped over a +curb, and, in her wild youth, even to press a dainty slipper against a +foot or two under the dinner table. Miss Manners also believes that the +sight of people strolling hand in hand or arm in arm or arm in hand +dresses up a city considerably more than the more familiar sight of +people shaking umbrellas at one another. What Miss Manners objects to +is the kind of activity that frightens the horses on the street... +%% +The brain is a wonderful organ; it starts working the moment +you get up in the morning, and does not stop until you get to work. +%% +The broad mass of a nation... will more easily +fall victim to a big lie than to a small one. + -- Adolf Hitler, "Mein Kampf" +%% +The bustard's a remarkable fowl +With surely no reason to growl + He escapes what would be + Illegitimacy +By the grace of a fortunate vowel. +%% +The cart has no place where a fifth wheel could be used. + -- Herbert von Fritzlar +%% +The chicken that clucks the loudest is the one +most likely to show up at the steam fitters picnic. +%% +The chief cause of problems is solutions. +%% +The church saves sinners, but science +seeks to stop their manufacture. + -- Elbert Hubbard +%% +The climate of Bombay is such that +its inhabitants have to live elsewhere. +%% +The closest to perfection a person ever comes +is when he fills out a job application form. + -- Stanley J. Randall +%% +The coast was clear. + -- Lope de Vega +%% +The college graduate is presented with a +sheepskin to cover his intellectual nakedness. + -- Robert M. Hutchins +%% +The common cormorant, or shag, lays eggs inside a paper bag. +%% +The computer is to the information industry roughly what the +central power station is to the electrical industry. + -- Peter Drucker +%% +The computing field is always in need of new cliches. + -- Alan Perlis +%% +The concept seems to be clear by now. It has been +defined several times by examples of what it is not. +%% +The control of the production of wealth +is the control of human life itself. + -- Hilaire Belloc +%% +The correct way to punctuate a sentence that starts: "Of course it is +none of my business, but --" is to place a period after the word "but." +Don't use excessive force in supplying such a moron with a period. +Cutting his throat is only a momentary pleasure and is bound to get +you talked about. + -- Lazarus Long +%% +The cost of feathers has risen, even down is up! +%% +The cost of living has gone up, another buck a fifth. +%% +The cost of living hasn't affected its popularity. +%% +The cost of living is going up, and the chance of living is going down. +%% +The courtroom was pregnant (pun intended) with anxious silence as the +judge solemnly considered his verdict in the paternity suit before him. +Suddenly, he reached into the folds of his robes, drew out a cigar and +cermoniously handed it to the defendant. + "Congratulations!" said the jurist. "You have just become a +father!" +%% +The cow is nothing but a machine which +makes grass fit for us people to eat. + -- John McNulty +%% +The cruelest of creatures' the crab +With claws that can pinch you or stab, + And then when you dine + On crab and white wine +It gets you as well with the tab. +%% +The days are all empty and the nights are unreal. +%% +The days just prior to marriage are like +a snappy introduction to a tedious book. +%% +The day-to-day travails of the IBM programmer are so amusing to most of us +who are fortunate enough never to have been one -- like watching Charlie +Chaplin trying to cook a shoe. +%% +The debate rages on: Is PL/I Bachtrian or Dromedary? +%% +The decision doesn't have to be logical; it was unanimous. +%% +The degree of civilization in a society +can be judged by entering its prisons. + -- F. Dostoyevski +%% +The degree of technical confidence is inversely +proportional to the level of management. +%% +The descent to Hades is the same from every place. + -- Anaxagoras +%% +The devil can cite Scripture for his purpose. + -- William Shakespeare, "The Merchant of Venice" +%% +The devil finds work for idle circuits to do. +%% +The die is cast. + -- Gaius Julius Caesar +%% +The difference between a Miracle and a Fact is +exactly the difference between a mermaid and a seal. + -- Mark Twain +%% +The difference between a career and a job is about 20 hours a week. +%% +The difference between a good haircut and a bad one is seven days. +%% +The difference between a misfortune and a calamity? If Gladstone fell into +the Thames, it would be a misfortune. But if someone dragged him out again, +it would be a calamity. + -- Benjamin Disraeli +%% +The difference between common-sense and paranoia is that common-sense is +thinking everyone is out to get you. That's normal -- they are. Paranoia +is thinking that they're conspiring. + -- J. Kegler +%% +The difference between legal separation and divorce is +that legal separation gives the man time to hide his money. +%% +The difference between science and the fuzzy subjects is that science +requires reasoning while those other subjects merely require scholarship. + -- Robert Heinlein +%% +The difference between the right word and the almost right word +is the difference between lightning and the lightning bug. + -- Mark Twain +%% +The difference between this place and yogurt +is that yogurt has a live culture. +%% +The difference between us is not very far, +cruising for burgers in daddy's new car. +%% +The difficult we do today; the impossible takes a little longer. +%% +The discerning person is always at a disadvantage. +%% +The disks are getting full; purge a file today. +%% +The distinction between Freedom and Liberty is not accurately known; +naturalists have been unable to find a living specimen of either. + -- Ambrose Bierce +%% +The distinction between true and false appears to become +increasingly blurred by... the pollution of the language. + -- Arne Tiselius +%% +The door is the key. +%% +The duck hunter trained his retriever to walk on water. Eager to show off +this amazing accomplishment, he asked a friend to go along on his next +hunting trip. Saying nothing, he fired his first shot and, as the duck fell, +the dog walked on the surface of the water, retrieved the duck and returned +it to his master. + "Notice anything?" the owner asked eagerly. + "Yes," said his friend, "I see that fool dog of yours can't swim." +%% +The early bird gets the coffee left over from the night before. +%% +The early worm gets the bird. +%% +The early worm gets the late bird. +%% +The earth is like a tiny grain of sand, only much, much heavier. +%% +The end of labor is to gain leisure. +%% +The end of the world will occur at three p.m., +this Friday, with symposium to follow. +%% +The ends justify the means. + -- after Matthew Prior +%% +The eternal feminine draws us upward. + -- Goethe +%% +The eyes of Texas are upon you, +All the livelong day; +The eyes of Texas are upon you, +You cannot get away; +Do not think you can escape them +From night 'til early in the morn; +The eyes of Texas are upon you +'Til Gabriel blows his horn. + -- University of Texas' school song +%% +The eyes of taxes are upon you. +%% +The fact that it works is immaterial. + -- L. Ogborn +%% +The fact that people are poor or discriminated against doesn't necessarily +endow them with any special qualities of justice, nobility, charity or +compassion. + -- Saul Alinsky +%% + The famous Nell Gwynn, stepping one day from a house where she had +made a short visit into her coach, saw a great crowd assembled, and her +footman all bloody and dirty; the fellow being asked by his mistress, the +reason for his being in that condition, answered, "I have been fighting, +madam, with an impudent rascal who called your ladyship a whore." + "You blockhead," replied Mrs. Gywnn, "at this rate you must fight +every day of your life; why, you fool, all the world knows it." + "Do they?" cries the fellow, in a muttering voice, after he had shut +the coach door, "they shan't call me a whore's footman for all that." + -- Henry Fielding, "Tom Jones" +%% +The famous politician was trying to save both his faces. +%% +The farther you go, the less you know. + -- Lao Tsu, "Tao Te Ching" +%% +The fashion wears out more apparel than the man. + -- William Shakespeare, "Much Ado About Nothing" +%% +The feeling persists that no one can simultaneously be a respectable writer +and understand how a refrigerator works, just as no gentleman wears a brown +suit in the city. Colleges may be to blame. English majors are encouraged, +I know, to hate chemistry and physics, and to be proud because they are not +dull and creepy and humorless and war-oriented like the engineers across the +quad. And our most impressive critics have commonly been such English majors, +and they are squeamish about technology to this very day. So it is natural +for them to despise science fiction. + -- Kurt Vonnegut Jr., "Science Fiction" +%% +The finest eloquence is that which gets things done. +%% +The first Great Steward, Parrafin the Climber, was employed in King +Chloroplast's kitchen as second scullery boy when the old King met a tragic +death. He apparently fell backward by accident on a dozen salad forks. +Simultaneously the true heir, his son Carotene, mysteriously fled the city, +complaining of some sort of plot and a lot of threatening notes left on his +breakfast tray. At the time, this looked suspicious what with his father's +death, and Carotene was suspected of foul play. Then the rest of the King's +relatives began to drop dead one after the other in an odd fashion. Some +were found strangled with dishrags and some succumbed to food poisoning. A +few were found drowned in the soup vats, and one was attacked by assailants +unknown and beaten to death with a pot roast. At least three appear to have +thrown themselves backward on salad forks, perhaps in a noble gesture of +grief over the King's untimely end. Finally there was no one left in Minas +Troney who was either eligible or willing to wear the accursed crown, and +the rule of Twodor was up for grabs. The scullery slave Parrafin bravely +accepted the Stewardship of Twodor until that day when a lineal descendant +of Carotene's returns to reclaim his rightful throne, conquer Twodor's +enemies, and revamp the postal system. + -- Bored of the Rings, "Harvard Lampoon" +%% +The first duty of a revolutionary is to get away with it. + -- Abbie Hoffman +%% +The first guy that rats gets a belly-full +of slugs in the head. Understand? + -- Joey Glimco +%% +The first myth of management is that it exists. +%% +The first requisite for immortality is death. + -- Stanislaw Lem +%% +The first riddle I ever heard, one familiar to almost every Jewish child, +was propounded to me by my father: + + "What is it that hangs on the wall, is green, wet -- and whistles?" +I knit my brow and thought and thought, and in final perplexity gave up. + "A herring," said my father. + "A herring," I echoed. "A herring doesn't hang on the wall!" + "So hang it there." + "But a herring isn't green!" I protested. + "Paint it." + "But a herring isn't wet." + "If its just painted it's still wet." + "But -- " I sputtered, summoning all my outrage, + "a herring doesn't whistle!!" + "Right, " smiled my father. "I just put that in to make it hard." + -- Leo Rosten +%% +The first rule of intelligent tinkering is to save all the parts. + -- Ehrlich +%% +The first thing I do in the morning +is brush my teeth and sharpen my tongue. + -- D. Parker +%% +The first thing we do, let's kill all the lawyers. + -- Wm. Shakespeare, "Henry VI", Part IV +%% +The first version always gets thrown away. +%% +The following statement is not true. +The previous statement is true. +%% +The forest is safe because a lion lives therein and the lion is safe +because it lives in a forest. Likewise the friendship of persons +rests on mutual help. + -- Laukikanyay. +%% +The fortune program is supported, in part, by user contributions +and by a major grant from the National Endowment for the Inanities. +%% +The future is a myth created by insurance +salesmen and high school counselors. +%% +The future is a race between education and catastrophe. + -- H.G. Wells +%% +The future isn't what it used to be. (It never was.) +%% +The future lies ahead. +%% +The future not being born, my friend, +we will abstain from baptizing it. + -- George Meredith +%% +The garden is in mourning; +The rain falls cool among the flowers. +Summer shivers quietly +On its way towards its end. + +Golden leaf after leaf +Falls from the tall acacia. +Summer smiles, astonished, feeble, +In this dying dream of a garden. + +For a long while, yet, in the roses, +She will linger on, yearning for peace, +And slowly +Close her weary eyes. + -- Hermann Hesse, "September" +%% +The generation of random numbers is too important to be left to chance. +%% +The gent who wakes up and finds himself a success hasn't been asleep. +%% +The gentlemen looked one another over with microscopic carelessness. +%% + The geographical center of Boston is in Roxbury. Due north of +the center we find the South End. This is not to be confused with South +Boston which lies directly east from the South End. North of the South +End is East Boston and southwest of East Boston is the North End. +%% +The girl who stoops to conquer usually wears a low-cut dress. +%% +The goal of Computer Science is to build something +that will at least last until we've finished building it. +%% +The goal of science is to build better mousetraps. +The goal of nature is to build better mice. +%% +The gods gave man fire and he invented fire engines. +They gave him love and he invented marriage. +%% +The good life was so elusive +It really got me down +I had to regain some confidence +So I got into camaflouge +%% +The good time is approaching, +The season is at hand. +When the merry click of the two-base lick +Will be heard throughout the land. +The frost still lingers on the earth, and +Budless are the trees. +But the merry ring of the voice of spring +Is borne upon the breeze. + -- Ode to Opening Day, "The Sporting News", 1886 +%% +The government has just completed work on a missile that turned out +to be a bit of a boondoggle; nicknamed "Civil Servant", it won't work +and they can't fire it. +%% +The government was contemplating the dispatch of an expedition to Burma, +with a view to taking Rangoon, and a question arose as to who would be the +fittest general to be sent in command of the expedition. The Cabinet sent +for the Duke of Wellington, and asked his advice. He instantly replied, +"Send Lord Combermere." + "But we have always understood that your Grace thought Lord +Combermere a fool." + "So he is a fool, and a damned fool; but he can take Rangoon." + -- G.W.E. Russell +%% +The grass is always greener on the other side of your sunglasses. +%% +The grave's a fine and private place, +but none, I think, do there embrace. + -- Andrew Marvell +%% +The great question that has never been answered and which I have not +yet been able to answer despite my thirty years of research into the +feminine soul is: WHAT DOES A WOMAN WANT? + -- Sigmund Freud +%% +The greatest griefs are those we cause ourselves. + -- Sophocles +%% +The greatest of faults is to be conscious of none. +%% +The greatest productive force is human selfishness. + -- Robert Heinlein +%% +The greatest remedy for anger is delay. +%% +The hardest part of climbing the ladder of +success is getting through the crowd at the bottom. +%% +The hardest thing in the world to understand is the income tax. + -- Albert Einstein +%% +The hardest thing is to disguise your feelings when +you put a lot of relatives on the train for home. +%% +The health of a democratic society may be measured by the quality +of functions performed by private citizens. + -- Alexis de Tocqueville +%% +The hearing ear is always found close to the speaking tongue, a custom +whereof the memory of man runneth not howsomever to the contrary, nohow. +%% +The heart has its reasons which reason knows nothing of. + -- Blaise Pascal +%% +The heart is wiser than the intellect. +%% +The heaviest object in the world is the +body of the woman you have ceased to love. + -- Marquis de Lac de Clapiers Vauvenargues +%% +The help people need most urgently is +help in admitting that they need help. +%% +The heroic hours of life do not announce their presence by drum and trumpet, +challenging us to be true to ourselves by appeals to the martial spirit that +keeps the blood at heat. Some little, unassuming, unobtrusive choice presents +itself before us slyly and craftily, glib and insinuating, in the modest garb +of innocence. To yield to its blandishments is so easy. The wrong, it seems, +is venial... Then it is that you will be summoned to show the courage of +adventurous youth. + -- Benjamin Cardozo +%% +The history of warfare is similarly subdivided, although here the phases +are Retribution, Anticipation, and Diplomacy. Thus: + +Retribution: + I'm going to kill you because you killed my brother. +Anticipation: + I'm going to kill you because I killed your brother. +Diplomacy: + I'm going to kill my brother and then kill you on the + pretext that your brother did it. +%% +The honeymoon is not actually over until we cease +to stifle our sighs and begin to stifle our yawns. + -- Helen Rowland +%% +The horror... the horror! +%% +The human animal differs from the lesser +primates in his passion for lists of "Ten Best". + -- H. Allen Smith +%% +The human brain is a wonderful thing. It starts working the moment +you are born, and never stops until you stand up to speak in public. +%% +The human mind ordinarily operates at only ten percent of +its capacity -- the rest is overhead for the operating system. +%% +The human race has one really effective weapon, and that is laughter. + -- Mark Twain +%% +The ideal voice for radio may be defined as showing no substance, +no sex, no owner, and a message of importance for every housewife. + -- Harry V. Wade +%% +The ideas of economists and political philosophers, both when they +are right and when they are wrong, are more powerful than is generally +understood. Indeed, the world is ruled by little else. + -- John Maynard Keyes +%% +The idle man does not know what it is to enjoy rest. +%% +The idle mind knows not what it is it wants. + -- Quintus Ennius +%% +The important thing is not to stop questioning. +%% +The important thing to remember about walking on eggs is not to hop. +%% +The individual choice of garnishment of a burger can be an important +point to the consumer in this day when individualism is an increasingly +important thing to people. + -- Donald N. Smith, president of Burger King +%% +The infliction of cruelty with a good conscience is +a delight to moralists. That is why they invented hell. + -- Bertrand Russell +%% +The instruments of science do not in themselves discover truth. And +there are searchings that are not concluded by the coincidence of a +pointer and a mark. + -- Fred Saberhagen, "The Berserker Wars" +%% +The kind of danger people most enjoy is +the kind they can watch from a safe place. +%% +The knowledge that makes us cherish +innocence makes innocence unattainable. + -- Irving Howe +%% +The ladies men admire, I've heard, +Would shudder at a wicked word. +Their candle gives a single light; +They'd rather stay at home at night. +They do not keep awake till three, +Nor read erotic poetry. +They never sanction the impure, +Nor recognize an overture. +They shrink from powders and from paints... +So far, I've had no complaints. + -- Dorothy Parker +%% +The last person who said that (God +rest his soul) lived to regret it. +%% +The last vestiges of the old Republic have been swept away. + -- Governor Tarkin +%% +The less time planning, the more time programming. +%% +The life which is unexamined is not worth living. + -- Plato +%% +The light at the end of the tunnel is the headlight of an approaching train. +%% +The light of a hundred stars does not equal the light of the moon. +%% +The limerick is furtive and mean; +You must keep her in close quarantine, + Or she sneaks to the slums + And promptly becomes +Disorderly, drunk, and obscene. + -- Morris Bishop +%% +The lion and the calf shall lie down +together but the calf won't get much sleep. + -- Woody Allen +%% +The little girl expects no declaration of tenderness from her doll. +She loves it -- and that's all. It is thus that we should love. + -- DeGourmont +%% +The little pieces of my life I give to you, +with love, to make a quilt to keep away the cold. +%% +The `loner' may be respected, but he is always resented by his colleagues, +for he seems to be passing a critical judgment on them, when he may be +simply making a limiting statement about himself. + -- Sidney Harris +%% +The longer I am out of office, the more infallible I appear to myself. + -- Henry Kissinger +%% +The longest part of the journey is said to be the passing of the gate. + -- Marcus Terentius Varro +%% +The luck that is ordained for you will be coveted by others. +%% +The major advances in civilization are processes +that all but wreck the societies in which they occur. + -- A.N. Whitehead +%% + The man standing at the bar (in court, unfortunately) was well- +dressed, alert and obviously intelligent. The judge asked him how he +pleaded to the charge of rape and, much to the magistrate's surprise, he +replied, "Not guilty by reason of insanity, your Honor." + "Insanity?" exclaimed the judge. + "Yes, sir," said the defendant. "I'm just crazy about it." +%% +The man who follows the crowd will usually get no further than the crowd. +The man who walks alone is likely to find himself in places no one has ever +been. + -- Alan Ashley-Pitt +%% +The man who has never been flogged has never been taught. + -- Menander +%% +The man who laughs has not yet been told the terrible news. + -- Bertolt Brecht +%% +The man who raises a fist has run out of ideas. + -- H.G. Wells, "Time After Time" +%% +The man who runs may fight again. + -- Menander +%% +The man who sees, on New Year's day, Mount +Fuji, a hawk, and an eggplant is forever blessed. + -- Old Japanese proverb +%% +The man who understands one woman is +qualified to understand pretty well everything. + -- Yeats +%% +The man-hating woman, like the cold woman, is largely imaginary. She +is simply a woman who has done her best to snare a man and has failed. + -- Norton +%% +The mark of the immature man is that he wants to die nobly for a cause, +while the mark of a mature man is that he wants to live humbly for one. + -- Wilhelm Stekel +%% +The mark of your ignorance is the depth of your belief in injustice +and tragedy. What the caterpillar calls the end of the world, the +master calls a butterfly. + -- Messiah's Handbook : Reminders for the Advanced Soul +%% +The marriage of Marxism and feminism has been like the marriage of +husband and wife depicted in English common law: Marxism and feminism +are one, and that one is marxism. + -- Heidi Hartmann, + "The Unhappy Marriage of Marxism and Feminism" +%% +The marvels of today's modern technology include the development of a +soda can, which, when discarded will last forever -- and a $7,000 car +which, when properly cared for, will rust out in two or three years. +%% +The mate for beauty should be a man and not a money chest. + -- Bulwer +%% +The mature bohemian is one whose woman works full time. +%% +The means-and-ends moralists, or non-doers, +always end up on their ends without any means. + -- Saul Alinsky +%% +The meat is rotten, but the booze is holding out. +Computer translation of "The spirit is willing, but the flesh is weak." +%% +The meek inherit the earth -- usually in small sections... about 6 by 3. +%% +The meek shall inherit the earth -- they are too weak to refuse. +%% +The meek shall inherit the earth; the rest of us, the Universe. +%% +The meek shall inherit the earth; the rest of us will go to the stars. +%% +The meek shall inherit the earth; but by that +time there won't be anything left worth inheriting. +%% +The meeting of two personalities is like the contact of two +chemical substances: if there is any reaction, both are transformed. + -- Carl Jung +%% +[The members of the Chamberlain government] are decided only to be +undecided, resolved to be irresolute, adamant for drift, all-powerful +for impotency. + -- W. Churchill +%% +The men sat sipping their tea in silence. After a while the klutz said, + "Life is like a bowl of sour cream." + "Like a bowl of sour cream?" asked the other. "Why?" + "How should I know? What am I, a philosopher?" +%% +The mind is its own place, and in itself +Can make a Heaven of Hell, a Hell of Heaven. +What matter where, if I be still the same, +And what I should be, all but less than he +Whom thunder hath made greater? here at least +We shall be free; the almighty hath not built +Here for his envy, will not drive us hence; +Here we may reign secure, and, in my choice, +To reign is worth ambition, though in Hell: +Better to reign in Hell than serve in Heaven. + -- Satan, Milton's "Paradise Lost", I, 254-263 +%% +The minute a man is convinced that he is interesting, he isn't. +%% +The mirror sees the man as beautiful, the mirror loves the man; another +mirror sees the man as frightful and hates him; and it is always the same +being who produces the impressions. + -- Marquis D.A.F. de Sade +%% +The moon is made of green cheese. + -- John Heywood +%% +The moon may be smaller than Earth, but it's further away. +%% +The more I know men the more I like my horse. +%% +The more I learn about men, the more I love my dog. +%% +The more I learn about women, the more I love my cat. +%% +The more I want to get something done, the less I call it work. + -- R. Bach, "Illusions" +%% +The more complex the mind, the greater +the need for the simplicity of play. + -- Captain Kirk, "Shore Leave" +%% +The more control, the more that requires control. +%% +The more cordial the buyers secretary, the greater +the odds that the competition already has the order. +%% +The more laws and order are made prominent, +the more thieves and robbers there will be. + -- Lao Tsu +%% +The more the merrier. + -- John Heywood +%% +The more things change, the more they remain the same. + -- Alphonse Karr +%% +The more things change, the more they stay insane. +%% +The more things change, the more they'll never be the same again. +%% +The more we disagree, the more chance +there is that at least one of us is right. +%% +The more you sweat in peace, the less you bleed in war. +%% +The mosquito exists to keep the mighty humble. +%% +The moss on the tree does not fear the talons of the hawk. +%% +The most advantageous, pre-eminent thing thou canst do is not to +exhibit nor display thyself within the limits of our galaxy, but +rather depart instantaneously whence thou even now standest and +flee to yet another rotten planet in the universe, if thou canst +have the good fortune to find one. + -- Carlyle +%% +The most costly of all follies is to believe passionately +in the palpably not true. It is the chief occupation of mankind. + -- H.L. Mencken +%% +The most difficult thing about surviving AIDS +is trying to convince your parents that you're Haitian. +%% +The most difficult thing in the world is to know how to do a +thing and to watch someone else doing it wrong, without commenting. + -- T.H. White +%% +The most exciting phrase to hear in science, the one that heralds new +discoveries, is not "Eureka!" (I found it!) but "That's funny ..." + -- Isaac Asimov +%% +The most hopelessly stupid man is he who is not aware that he is wise. +%% +The most important early product on the way +to developing a good product is an imperfect version. +%% +The most important things, each person must do for himself. +%% +The most unsatisfactory men are those who pride themselves on their +virility and regard sex as if it were some form of athletics at which +you win cups. It is a woman's spirit and mood which a man has to +stimulate in order to make sex interesting. The real lover is the +man who can thrill you by just touching your head or smiling into +your eyes - or just by staring into space. + -- Marilyn Monroe +%% +The moving cursor writes, and having written, blinks on. +%% +The naked truth of it is, I have no shirt. + -- William Shakespeare, "Love's Labour's Lost" +%% +The nation that controls magnetism controls the universe. + -- Chester Gould/Dick Tracy +%% +The nearer to the church, the further from God. + -- John Heywood +%% +The new Congressmen say they're going to turn the government around. +I hope I don't get run over again. +%% +The next person to mention spaghetti stacks +to me is going to have his head knocked off. + -- Bill Conrad +%% +The next thing I say to you will be true. +The last thing I said was false. +%% +The nice thing about standards +is that there are so many of them to choose from. + -- Andrew S. Tanenbaum +%% +The nicest thing about the Alto is that it doesn't run faster at night. +%% +The night passes quickly when you're asleep +But I'm out shufflin' for something to eat +... +Breakfast at the Egg House, +Like the waffle on the griddle, +I'm burnt around the edges, +But I'm tender in the middle. + -- Adrian Belew +%% +The notion of a "record" is an obsolete +remnant of the days of the 80-column card. + -- D.M. Ritchie +%% +The number of computer scientists in a room is inversely +proportional to the number of bugs in their code. +%% +The number of licorice gumballs you get out of a gumball machine +increases in direct proportion to how much you hate licorice. +%% +The objective of all dedicated employees should be to thoroughly analyze +all situations, anticipate all problems prior to their occurrence, have +answers for these problems, and move swiftly to solve these problems +when called upon. + However... +When you are up to your ass in alligators it is difficult to remind +yourself your initial objective was to drain the swamp. +%% +The odds are a million to one against your being one in a million. +%% +The odds are five to six that the headlight at the +end of the tunnel is the headlight of an oncoming train. +%% +The older I grow, the more I distrust the +familiar doctrine that age brings wisdom. + -- H.L. Mencken +%% +The older a man gets, the farther he had to walk to school as a boy. +%% +The one L lama, he's a priest +The two L llama, he's a beast +And I will bet my silk pyjama +There isn't any three L lllama. + -- O. Nash, to which a fire chief replied that occasionally + his department responded to something like a "three L lllama." +%% +The one day you'd sell your soul for something, souls are a glut. +%% +The one good thing about repeating your +mistakes is that you know when to cringe. +%% +The one sure way to make a lazy man look +respectable is to put a fishing rod in his hand. +%% +The only certainty is that nothing is certain. + -- Pliny the Elder +%% +The only constant is change. +%% +The only difference between a rut and a grave is their dimensions. +%% +The only difference between the saint and the sinner is that +every saint has a past and every sinner has a future. + -- Oscar Wilde +%% +The only difference between your girlfriend +and a barracuda is the nailpolish. +%% +The only difference in the game of love over the last few +thousand years is that they've changed trumps from clubs to diamonds. + -- The Indianapolis Star +%% +The only justification for our concepts and systems of concepts is +that they serve to represent the complex of our experiences; +beyond this they have not legitimacy. + -- Einstein. +%% +The only people for me are the mad ones -- the ones who are mad to live, +mad to talk, mad to be saved, desirous of everything at the same time, +the ones who never yawn or say a commonplace thing, but burn, burn, burn +like fabulous yellow Roman candles. + -- Jack Kerouac, "On the Road" +%% +The only perfect science is hind-sight. +%% +The only possible interpretation of any research +whatever in the 'social sciences' is: some do, some don't. + -- Ernest Rutherford +%% +The only problem with being a man of leisure +is that you can never stop and take a rest. +%% +The only problem with seeing too much is that it makes you insane. + -- Phaedrus +%% + The only real game in the world, I think, is baseball... +You've got to start way down, at the bottom, when you're six or seven years +old. You can't wait until you're fifteen or sixteen. You've got to let it +grow up with you, and if you're successful and you try hard enough, you're +bound to come out on top, just like these boys have come to the top now. + -- Babe Ruth, in his 1948 farewell speech at Yankee Stadium +%% +The only real way to look younger is not to be born so soon. + -- C. Schultz +%% +The only reward of virtue is virtue. + -- Ralph Waldo Emerson +%% +The only rose without thorns is friendship. +%% +The only thing better than love is milk. +%% +The only thing cheaper than hardware is talk. +%% +The only thing to do with good advice is pass it on. +It is never any use to oneself. + -- Oscar Wilde +%% +The only thing we learn from history is that we do not learn. + -- Earl Warren +%% +The only time a dog gets complimented is when he doesn't do anything. + -- C. Schultz +%% +The only way to amuse some people +is to slip and fall on an icy pavement. +%% +The only way to behave to a woman is to make love to +her if she is pretty and to someone else if she is plain. + -- Oscar Wilde +%% +The only way to get rid of a temptation is to yield to it. + -- Oscar Wilde +%% +The only way to keep you health is to eat what you don't want, +drink what you don't like, and do what you'd rather not. + -- Mark Twain +%% +The only way you'll ever hear from +me is if you're living in the same hell. + -- Roy Harper +%% +The onset and the waning of love make themselves felt +in the uneasiness experienced at being alone together. + -- Jean de la Bruyere +%% +The opossum is a very sophisticated animal. +It doesn't even get up until 5 or 6 pm. +%% +The opposite of a profound truth may well be another profound truth. + -- Bohr +%% +The optimist proclaims that we live in the best of all possible +worlds, and the pessimist fears this is true. +%% +The optimum committee has no members. + -- Norman Augustine +%% +The opulence of the front office door varies +inversely with the fundamental solvency of the firm. +%% +The other line moves faster. +%% +The owner of a large furniture store in the mid-west arrived in France on +a buying trip. As he was checking into a hotel he struck up an acquaintance +with a beautiful young lady. However, she only spoke French and he only spoke +English, so each couldn't understand a word the other spoke. He took out a +pencil and a notebook and drew a picture of a coach. She smiled, nodded her +head and they went for a ride in the park. Later, he drew a picture of a +table in a restaurant with a question mark and she nodded, so they went to +dinner. After dinner he sketched two dancers and she was delighted. They +went to several nightclubs, drank champagne, danced and had a glorious +evening. It had gotten quite late when she motioned for the pencil and drew +a picture of a four-poster bed. He was dumbfounded, and to this day has +never be able to understand how she knew he was in the furniture business. +%% +The part of the world that people find most puzzling is the part called "Me". +%% +The party adjourned to a hot tub, yes. Fully clothed, I might add. + -- IBM employee, testifying in California State Supreme Court +%% +The past always looks better than it was. +It's only pleasant because it isn't here. + -- Finley Peter Dunne (Mr. Dooley) +%% +The people sensible enough to give +good advice are usually sensible enough to give none. +%% +The perfect friend sees the best in you -- sees it constantly -- +not just when you occasionally are that way, but also when you +waver, when you forget yourself, act like less than you are. +In time, you become more like his vision of you -- which is the +person you have always wanted to be. + -- Nancy Friday +%% +The perfect man is the true partner. Not a bed partner nor a fun partner, +but a man who will shoulder burdens equally with [you] and possess that +quality of joy. + -- Erica Jong +%% +The person who can smile when something +goes wrong has thought of someone to blame it on. +%% +The person who makes no mistakes does not usually make anything. +%% +The person you rejected yesterday could make you happy, if you say yes. +%% +The philosopher's treatment of a question +is like the treatment of an illness. + -- Wittgenstein. +%% +The pitcher wound up and he flang the ball at the batter. The batter swang +and missed. The pitcher flang the ball again and this time the batter +connected. He hit a high fly right to the center fielder. The center +fielder was all set to catch the ball, but at the last minute his eyes were +blound by the sun and he dropped it. + -- Dizzy Dean +%% +The pleasure is transitory, the cost +prohibitive, and the position ridiculous. + -- Disraeli, on sex +%% +The plural of spouse is spice. +%% +The point is, you see, that there is no point in driving yourself mad +trying to stop yourself going mad. You might just as well give in and +save your sanity for later. +%% +The politician is someone who deals in man's problems of adjustment. +To ask a politician to lead us is to ask the tail of a dog to lead the dog. + -- Buckminster Fuller +%% +The pollution's at that awkward stage. +Too thick to navigate and too thin to cultivate. + -- Doug Sneyd +%% +The price of greatness is responsibility. +%% +The price of success in philosophy is triviality. + -- C. Glymour. +%% +The primary function of the design engineer is to make things +difficult for the fabricator and impossible for the serviceman. +%% +The primary purpose of the DATA statement is to give names to constants; +instead of referring to pi as 3.141592653589793 at every appearance, the +variable PI can be given that value with a DATA statement and used instead +of the longer form of the constant. This also simplifies modifying the +program, should the value of pi change. + -- FORTRAN manual for Xerox Computers +%% +The probability of someone watching you is directly +proportional to the stupidity of your action. +%% +The problem with any unwritten law is that +you don't know where to go to erase it. + -- Glaser and Way +%% +The problem with people who have no vices is that generally you can +be pretty sure they're going to have some pretty annoying virtues. + -- Elizabeth Taylor +%% +The problem with the gene pool is that there is no lifeguard. +%% +The proof of the pudding is in the eating. + -- Miguel de Cervantes +%% +The public demands certainties; it must be told definitely and a bit +raucously that this is true and that is false. But there are no +certainties. + -- H.L. Mencken, "Prejudice" +%% +The questions remain the same. +The answers are eternally variable. +%% +The race is not always to the swift... but that's the way to bet. + -- Runyon +%% +The rain it raineth on the just +And also on the unjust fella, +But chiefly on the just, because +The unjust steals the just's umbrella. +%% +The real man's Bloody Mary: + Ingredients: vodka, tomato juice, Tobasco, Worcestershire + sauce, A-1 steak sauce, ice, salt, pepper, celery. + + Fill a large tumbler with vodka. + Throw all the other ingredients away. +%% +The real reason psychology is hard is that +psychologists are trying to do the impossible. +%% +The reason computer chips are so small is computers don't eat much. +%% +The reason they're called wisdom teeth +is that the experience makes you wise. +%% +The reason why worry kills more people +than work is that more people worry than work. +%% +The reasonable man adapts himself to the world; the unreasonable one +persists in trying to adapt the world to himself. Therefore all progress +depends on the unreasonable man. + -- George Bernard Shaw +%% +The relative importance of files depends on their cost +in terms of the human effort needed to regenerate them. + -- T.A. Dolotta +%% +The revolution will not be televised. +%% +The reward for working hard is more hard work. +%% +The reward of a thing well done is to have done it. + -- Emerson +%% +The rich get rich, and the poor get poorer. +The haves get more, the have-nots die. +%% +The right half of the brain controls the left half of the body. +This means that only left handed people are in their right mind. +%% +The right to be let alone is indeed the beginning of all freedom. + -- Justice Douglas +%% +The rights and interests of the laboring man will be protected and cared +for not by our labor agitators, but by the Christian men to whom God in his +infinite wisdom has given control of property interests of the country, and +upon the successful management of which so much remains. + -- George F. Baer, railroad industrialist +%% +The ripest fruit falls first. + -- William Shakespeare, "Richard II" +%% +The road to Hades is easy to travel. + -- Bion +%% +The road to hell is paved with NAND gates. + -- J. Gooding +%% +The road to ruin is always in good repair, +and the travellers pay the expense of it. + -- Josh Billings +%% +The root of all superstition is that men +observe when a thing hits, but not when it misses. + -- Francis Bacon +%% +The rose of yore is but a name, mere names are left to us. +%% +The rule is, jam to-morrow and jam yesterday, but never jam today. + -- Lewis Carroll +%% +The rules: + +1: Thou shalt not worship other computer systems. +2: Thou shalt not impersonate Liberace or eat watermelon while sitting at + the console keyboard. +3: Thou shalt not slap users on the face, nor staple their silly little + card decks together. +4: Thou shalt not get physically involved with the computer system, + especially if you're already married. +5: Thou shalt not use magnetic tapes as frisbees, nor use a disk pack as + a stool to reach another disk pack. +6: Thou shalt not stare at the blinking lights for more than one 8 hour + shift. +7: Thou shalt not tell users that you accidentally destroyed their + files/backup just to see the look on their little faces. +8: Thou shalt not enjoy cancelling a job. +9: Thou shalt not display firearms in the computer room. +10: Thou shalt not push buttons "just to see what happens". +%% +The savior becomes the victim. +%% +The second best policy is dishonesty. +%% +The secret of happiness is total disregard of everybody. +%% +The secret of healthy hitchhiking is to eat junk food. +%% +The secret of success is sincerity. +Once you can fake that, you've got it made. +%% +The secret source of humor is not joy but sorrow; +there is no humor in Heaven. + -- Mark Twain +%% +The seven eyes of Ningauble the Wizard floated back to his hood as he +reported to Fafhrd: "I have seen much, yet cannot explain all. The Gray +Mouser is exactly twenty-five feet below the deepest cellar in the palace +of Gilpkerio Kistomerces. Even though twenty-four parts in twenty-five of +him are dead, he is alive. + Now about Lankhmar. She's been invaded, her walls breached +everywhere and desperate fighting is going on in the streets, by a fierce +host which out-numbers Lankhamar's inhabitants by fifty to one -- and +equipped with all modern weapons. Yet you can save the city." + "How?" demanded Fafhrd. + Ningauble shrugged. "You're a hero. You should know." + -- Fritz Leiber, "The Swords of Lankhmar" +%% +The sheep died in the wool. +%% +The shifts of Fortune test the reliability of friends. + -- Marcus Tullius Cicero +%% +The shortest distance between two points is under construction. + -- Noelie Altito +%% +The six great gifts of an Irish girl are beauty, soft +voice, sweet speech, wisdom, needlework, and chastity. + -- Theodore Roosevelt, 1907 +%% +The sixth shiek's sixth sheep's sick. + -- [just say that five times...] +%% +The smallest worm will turn being trodden on. + -- William Shakespeare, "Henry VI" +%% +The smiling Spring comes in rejoicing, +And surly Winter grimly flies. +Now crystal clear are the falling waters, +And bonnie blue are the sunny skies. +Fresh o'er the mountains breaks forth the morning, +The ev'ning gilds the oceans's swell: +All creatures joy in the sun's returning, +And I rejoice in my bonnie Bell. + +The flowery Spring leads sunny Summer, +The yellow Autumn presses near; +Then in his turn come gloomy Winter, +Till smiling Spring again appear. +Thus seasons dancing, life advancing, +Old Time and Nature their changes tell; +But never ranging, still unchanging, +I adore my bonnie Bell. + -- Robert Burns, "My Bonnie Bell" +%% +The so-called lessons of history are for the most part the +rationalizations of the victors. History is written by the survivors. + -- Max Lerner +%% +The society which scorns excellence in plumbing as a humble activity and +tolerates shoddiness in philosophy because it is an exalted activity will +have neither good plumbing nor good philosophy... neither its pipes nor +its theories will hold water. +%% +The solution of problems is the most characteristic +and peculiar sort of voluntary thinking. + -- William James +%% +The solution of this problem is trivial +and is left as an exercise for the reader. +%% +The solution to a problem changes the nature of the problem. + -- Peer +%% +The sooner you fall behind, the more time you have to catch up. +%% +The soul would have no rainbow had the eyes no tears. +%% +The speed of anything depends on the flow of everything. +%% +The spirit of Plato dies hard. We have been unable to escape the +philosophical tradition that what we can see and measure in the world +is merely the superficial and imperfect representation of an underlying +reality. + -- S.J. Gould, "The Mismeasure of Man" +%% +The star of riches is shining upon you. +%% +The startling truth finally became apparent, and it was this: Numbers +written on restaurant checks within the confines of restaurants do not +follow the same mathematical laws as numbers written on any other pieces +of paper in any other parts of the Universe. This single statement took +the scientific world by storm. So many mathematical conferences got held +in such good restaurants that many of the finest minds of a generation +died of obesity and heart failure, and the science of mathematics was put +back by years. + -- Douglas Adams +%% +The street preacher looked so baffled +When I asked him why he dressed +With forty pounds of headlines +Stapled to his chest. +But he cursed me when I proved to him +I said, "Not even you can hide. +You see, you're just like me. +I hope you're satisfied." + -- Bob Dylan +%% +The strong give up and move away, while the weak give up and stay. +%% +The struggling for knowledge has a pleasure in it +like that of wrestling with a fine woman. + -- Lord Halifax +%% +The sudden sight of me causes panic in the streets. They have +yet to learn - only the savage fears what he does not understand. + -- The Silver Surfer +%% +The sun never sets on those who ride into it. + -- RKO +%% +The sun was shining on the sea, +Shining with all his might: +He did his very best to make +The billows smooth and bright -- +And this was very odd, because it was +The middle of the night. + -- Lewis Carroll +%% +The sunlights differ, but there is only one darkness. + -- Ursula K. LeGuin, "The Dispossessed" +%% +The superfluous is very necessary. + -- Voltaire +%% +The superior man understands what is right; +the inferior man understands what will sell. + -- Confucius +%% +The surest way to remain a winner is to +win once, and then not play any more. +%% +The system was down for backups from 5am to 10am last Saturday. +%% +The system will be down for 10 days for preventative maintenance. +%% +The temperature of the aqueous content of an unremittingly ogled +culinary vessel will not achieve 100 degrees on the Celsius scale. +%% +The test of a first-rate intelligence is the ability to hold two opposed +ideas in the mind at the same time and still retain the ability to function. + -- F. Scott Fitzgerald +%% +The test of intelligent tinkering is to save all the parts. + -- Aldo Leopold +%% +The thing that takes up the least amount of time +and causes the most amount of trouble is sex. +%% +The things that interest people most are usually none of their business. +%% +The three faithful things in life are money, a dog and an old woman. +%% +The three laws of thermodynamics: + (1) You can't get anything without working for it. + (2) The most you can accomplish by working is to break even. + (3) You can only break even at absolute zero. +%% +The time for action is past! +Now is the time for senseless bickering. +%% +The time is right to make new friends. +%% +The time spent on any item of the agenda [of a finance +committee] will be in inverse proportion to the sum involved. + -- C.N. Parkinson +%% +The time was the 19th of May, 1780. The place was Hartford, Connecticut. +The day has gone down in New England history as a terrible foretaste of +Judgement Day. For at noon the skies turned from blue to grey and by +mid-afternoon had blackened over so densely that, in that religious age, +men fell on their knees and begged a final blessing before the end came. +The Connecticut House of Representatives was in session. And, as some of +the men fell down and others clamored for an immediate adjournment, the +Speaker of the House, one Col. Davenport, came to his feet. He silenced +them and said these words: "The day of judgment is either approaching or +it is not. If it is not, there is no cause for adjournment. If it is, I +choose to be found doing my duty. I wish therefore that candles may be +brought." + -- Alistair Cooke +%% +The tree in which the sap is stagnant remains fruitless. + -- Hosea Ballou +%% +The trouble is, there is an endless supply of White Men, +but there has always been a limited number of Human Beings. + -- Little Big Man +%% +The trouble with being poor is that it takes up all your time. +%% +The trouble with being punctual is that people +think you have nothing more important to do. +%% +The trouble with computers is that they do +what you tell them, not what you want. + -- D. Cohen +%% +The trouble with doing something right the first +time is that nobody appreciates how difficult it was. +%% +The trouble with money is it costs too much! +%% +The trouble with opportunity is that it +always comes disguised as hard work. + -- Herbert V. Prochnow +%% +The trouble with some women is that they get +all excited about nothing -- and then marry him. + -- Cher +%% +The trouble with you +Is the trouble with me. +Got two good eyes +But we still don't see. + -- Robert Hunter, "Workingman's Dead" +%% +The true way goes over a rope which is not stretched at any great +height but just above the ground. It seems more designed to make +people stumble than to be walked upon. + -- Franz Kafka +%% +The truth about a man lies first and foremost in what he hides. + -- Andre Malraux +%% +The truth about a woman often lasts longer than the woman is true. +%% +The truth is rarely pure, and never simple. + -- Oscar Wilde +%% +The truth of a proposition has nothing to do with its credibility. +And vice versa. +%% +The truth you speak has no past and no future. +It is, and that's all it needs to be. +%% +The turtle lives 'twixt plated decks +Which practically conceal its sex. +I think it clever of the turtle +In such a fix to be so fertile. + -- O. Nash +%% +The two oldest professions in the world have been ruined by amateurs. + -- G.B. Shaw +%% +The two things that can get you into trouble +quicker than anything else are fast women and slow horses. +%% +The typewriting machine, when played with expression, is no more +annoying than the piano when played by a sister or near relation. + -- Oscar Wilde +%% +The, uh, snowy mountains are like really cold, eh? +And the, um, plains stretch out like my moms girdle, eh? +There's lotsa beers and doughnuts for everyone, eh? +So the last one to be peaceful and everything is a big idiot, +Eh? +So shut yer face up and dry yer mucklucks by the fire, eh? +And dream about girls with their high beams on, eh? +They may be cold, but that's okay! Beer's better that way! +Eh? + -- A, like, Tribute to the Great White North, eh? +Beauty! +%% +The ultimate game show will be the one +where somebody gets killed at the end. + -- Chuck Barris, creator of "The Gong Show" +%% +The universe is all a spin-off of the Big Bang. +%% +The universe is an island, +surrounded by whatever it is that surrounds universes. +%% +The universe is laughing behind your back. +%% +The universe is ruled by letting things take their course. +It cannot be ruled by interfering. + -- Chinese proverb +%% +The universe seems neither benign nor hostile, merely indifferent. + -- Sagan +%% +The use of COBOL cripples the mind; +its teaching should, therefore, be regarded as a criminal offense. + -- E.W. Dijkstra +%% +The use of money is all the advantage there is to having money. + -- B. Franklin +%% +The value of a program is proportional to the weight of its output. +%% +The very first essential for success is a perpetually +constant and regular employment of violence. + -- Adolph Hitler, "Mein Kampf" +%% +The very remembrance of my former misfortune proves a new one to me. + -- Miguel de Cervantes +%% +The voluptuous blond was chatting with her handsome escort in a posh +restaurant when their waiter, stumbling as he brought their drinks, +dumped a martini on the rocks down the back of the blonde's dress. She +sprang to her feet with a wild rebel yell, dashed wildly around the table, +then galloped wriggling from the room followed by her distraught boyfriend. +A man seated on the other side of the room with a date of his own beckoned +to the waiter and said, "We'll have two of whatever she was drinking." +%% +The warning message we sent the Russians was a +calculated ambiguity that would be clearly understood. + -- Alexander Haig +%% +The water was not fit to drink. +To make it palatable, we had to add whiskey. +By diligent effort, I learned to like it. + -- W. Churchill +%% + The way my jeweler explained it, it's like insurance. + Six months' pay isn't much to keep my wife from sleeping around. + +A diamond -- pure, sparkling, natural, flawless, forever. The way marriage +should be but never quite is. People grow and change and sometimes want to +take their clothes off with strangers. So when you invest in a fine piece +of diamond jewelry, you're not only making an investment, you're making a +statement. You're telling the woman you love that you've just spent a lot of +your hard-earned money on her. Now she owes you the kind of loyalty that +only precious jewelry can buy. Isn't she worth it? + + The Honeymoon's Over: from $ 5000 + The Seven Year Itch: from $10000 + No More Lunchtime Quickies: from $15000 + Divorce Would Be More Expensive: from $42000 + + A diamond is for leverage. BeDears +%% +The way to a man's heart is through the left ventricle. +%% +The way to a man's stomach is through his esophagus. +%% +The way to fight a woman is with your hat. Grab it and run. +%% +The way to love anything is to realize that it might be lost. +%% +The way to make a small fortune +in the commodities market is to start with a large fortune. +%% +The weather is here. Wish you were beautiful. +%% +The weather is here, I wish you were beautiful. +My thoughts aren't too clear, but don't run away. +My girlfriend's a bore; my job is too dutiful. +Hell nobody's perfect, would you like to play? +I feel together today! + -- Jimmy Buffet, "Coconut Telegraph" +%% +The weed of crime bears bitter fruit. +%% +The weed of crime bears bitter fruit... +but the leaves are good to smoke! + -- The Shadow +%% +The white race is the cancer of history. + -- Susan Sontag +%% +The whole of life is futile unless you +consider it as a sporting proposition. +%% +The whole world is a tuxedo and you are a pair of brown shoes. + -- George Gobel +%% +The wise man seeks everything in himself; +the ignorant man tries to get everything from somebody else. +%% +The wise shepherd never trusts his flock to a smiling wolf. +%% +The woman you buy -- and she is the least expensive -- takes a great +deal of money. The woman who gives herself takes all your time. + -- Balzac +%% +The wonderful thing about a dancing bear +is not how well he dances, but that he dances at all. +%% +The world has many unintentionally cruel mechanisms that are not +designed for people who walk on their hands. + -- John Irving, "The World According to Garp" +%% +The world is coming to an end... SAVE YOUR BUFFERS!! +%% +The world is coming to an end! +Repent and return those library books! +%% +The world is full of people who have never, since +childhood, met an open doorway with an open mind. + -- E.B. White +%% +The world is moving so fast these days that the man who says +it can't be done is generally interrupted by someone doing it. + -- E. Hubbard +%% +The world is not octal despite DEC. +%% +The world is your exercise-book, the pages on which you do your sums. +It is not reality, although you can express reality there if you wish. +You are also free to write nonsense, or lies, or to tear the pages. + -- Messiah's Handbook : Reminders for the Advanced Soul +%% +The world needs more people like us and fewer like them. +%% +The world really isn't any worse. +It's just that the news coverage is so much better. +%% +The world wants to be deceived. + -- Sebastian Brant +%% +The world will end in 5 minutes. Please log out. +%% +The world's as ugly as sin, +And almost as delightful + -- Frederick Locker-Lampson +%% +The world's great men have not commonly been great scholars, +nor its great scholars great men. + -- Oliver Wendell Holmes +%% +The worst cliques are those which consist of one man. + -- G.B. Shaw +%% +The worst is enemy of the bad. +%% +The worst is not so long as we can say "This is the worst." + -- King Lear +%% +The worst part of valor is indiscretion. +%% +The worst sin towards our fellow creatures is not to hate them, +but to be indifferent to them; that's the essence of inhumanity. + -- G.B. Shaw +%% +The worst thing one can do is not to try, to be aware of what one +wants and not give in to it, to spend years in silent hurt wondering +if something could have materialized -- and never knowing. + -- David Viscott +%% +The yankees, son, are up north. +The damnyankees are down here. +%% +The years of peak mental activity are undoubtedly between the ages of +four and eighteen. At four we know all the questions, at eighteen all +the answers. +%% +The young man-about-town enjoyed luxury but didn't always have the means +to buy it, and so he huffily walked out of the Miami Beach hotel when he +found out the charges for room, meals and golf privileges were $100 a day. +He registered across the street at an equally elegant hotel, where the +rates were only $70. The following morning he went down to the hotel's +golf course and asked Scotty, the pro, to sell him a couple of golf balls. +"Sure," said Scotty. "That'll be $15 apiece." + "What?" screamed the bachelor. "In the hotel across the street +they only charge $1 a ball!" + "Naturally," replied the pro. "Over there they get you by the +rooms." +%% +Theft from a single author is plagiarism. +Theft from three or more is research. +%% +Their idea of an offer you can't refuse is an offer... +and you'd better not refuse. +%% + Them Toad Suckers + +How 'bout them toad suckers, ain't they clods? +Sittin' there suckin' them green toady frogs! + +Suckin' them hop toads, suckin' them chunkers, +Suckin' them a leapy type, suckin' them flunkers. + +Look at them toad suckers, ain't they snappy? +Suckin' them bog frogs sure make's 'em happy! + +Them hugger mugger toad suckers, way down south, +Stickin' them sucky toads in they mouth! + +How to be a toad sucker, no way to duck it, +Get yourself a toad, rear back, and suck it! + -- Mason Williams +%% +Them as has, gets. +%% + Then a man said: Speak to us of Expectations. + + He then said: If a man does not see or hear the waters of the +Jordan, then he should not taste the pomegranate or ply his wares in an +open market. + + If a man would not labour in the salt and rock quarries then he +should not accept of the Earth that which he refuses to give of +himself. + + Such a man would expect a pear of a peach tree. + Such a man would expect a stone to lay an egg. + Such a man would expect Sears to assemble a lawnmower. + -- Kehlog Albran +%% +Then, gently touching my face, she hesitated for a moment as her +incredible eyes poured forth into mine love, joy, pain, tragedy, +acceptance, and peace. "'Bye for now," she said warmly. + -- Thea Alexander, "2150 A.D." +%% +Then there was the Formosan bartender named Taiwan-On. +%% +Then there was the guy that got badly messed up fighting +for his girl's honor. It seems she wanted to keep it. +%% + Then there's the atmosphere -- half the time you can eat the air, +it's got so much stuff floating around in it. It takes the edge out of +the colors. Down here even the traffic lights are pastel. And people! +With a lot of these folks you'd have to check their green cards just to +make sure that they are Earthlings. Then there's the police. In Portland, +when some guy goes bananas, the cops rope off a sixteen block area around +him and call a shrink from the medical school who stands atop a patrol car +with a megaphone and shouts, "OK! THIS! ALL! STARTED! WHEN! YOU! WERE! +THREE! YEARS! OLD! ON! ACCOUNT! OF! YOUR MOTHER! RIGHT? SO! LET'S! +TALK! ABOUT! IT!" Down here they don't waste that kind of time. The LAPD +has SWAT teams composed of guys who make Darth Vader look like Mr. Peepers. +Before they go to bust a bookie joint they mortar it first. + -- M. Christensen, "A Portland Innocent in LA" +%% + Then there's the story of the man who avoided reality for 70 years +with drugs, sex, alcohol, fantasy, TV, movies, records, a hobby, lots of +sleep... And on his 80th birthday died without ever having faced any of +his real problems. + The man's younger brother, who had been facing reality and all his +problems for 50 years with psychiatrists, nervous breakdowns, tics, tension, +headaches, worry, anxiety and ulcers, was so angry at his brother for having +gotten away scott free that he had a paralyzing stroke. + The moral to this story is that there ain't no justice that we can +stand to live with. + -- R. Geis +%% + "Then what is magic for?" Prince Lir demanded wildly. "What use is +wizardry if it cannot save a unicorn?" He gripped the magician's shoulder +hard, to keep from falling. + Schmendrick did not turn his head. With a touch of sad mockery in +his voice, he said, "That's what heroes are for." +... + "Yes, of course," he [Prince Lir] said. "That is exactly what heroes +are for. Wizards make no difference, so they say that nothing does, but +heroes are meant to die for unicorns." + -- P. Beagle, "The Last Unicorn" +%% +Theology is an attempt to explain a subject by men who do not understand +it. The intent is not to tell the truth but to satisfy the questioner. + -- Elbert Hubbard +%% +Theorem: All programs are dull. + +Proof: Assume the contrary; i.e., the set of interesting programs is +nonempty. Arrange them (or it) in order of interest (note that all +sets can be well ordered, so do it properly). The minimal element is +the "least interesting program", the obvious dullness of which provides +the contradictory denouement we so devoutly seek. + -- Stan Kelly-Bootle, "The Devil's DP Dictionary" +%% +Theory is gray, but the golden tree of life is green. + -- Goethe +%% +Theory of Selective Supervision: + The one time in the day that you lean back and relax is + the one time the boss walks through the office. +%% + Theory +Into love and out again, + Thus I went and thus I go. +Spare your voice, and hold your pen: + Well and bitterly I know +All the songs were ever sung, + All the words were ever said; +Could it be, when I was young, + Someone dropped me on my head? + -- Dorothy Parker +%% +There ain't nothing in the middle of the road +except yellow stripes and dead armadillos. +%% +There appears before you a threatening figure clad all over in heavy black +armor. His legs seem like the massive trunk of the oak tree. His broad +shoulders and helmeted head loom high over your own puny frame and you +realize that his powerful arms could easily crush the very life from your +body. There hangs from his belt a veritable arsenal of deadly weapons: +sword, mace, ball and chain, dagger, lance, and trident. +He speaks with a commanding voice: + + "YOU SHALL NOT PASS" + +As he grabs you by the neck all grows dim about you. +%% +There appears to be irrefutable evidence that +the mere fact of overcrowding induces violence. + -- Harvey Wheeler +%% +There are a few things that never go out of style, +and a feminine woman is one of them. + -- Ralston +%% +There are few people more often in the wrong +than those who cannot endure to be thought so. +%% +There are four kinds of homicide: felonious, +excusable, justifiable, and praiseworthy... + -- Ambrose Bierce +%% +There are in this country two very large monopolies. The larger of the +two has the following record: The Vietnam War, Watergate, double-digit +inflation, fuel and energy shortages, bankrupt airlines, and the 8-cent +postcard. The second is responsible for such things as the transistor, +the solar cell, lasers, synthetic crystals, high fidelity stereo recording, +sound motion pictures, radio astronomy, negative feedback, magnetic tape, +magnetic "bubbles", electronic switching systems, microwave radio and TV +relay systems, information theory, the first electrical digital computer, +and the first communications satellite. Guess which one is going to tell +the other how to run the telephone business? I can hardly wait for the +results. +%% +There are many people today who literally do not have a close personal +friend. They may know something that we don't. They are probably +avoiding a great deal of pain. +%% +There are more old drunkards than old doctors. +%% +There are more things in heaven and earth than any place else. +%% +There are more things in heaven and earth, +Horatio, than are dreamt of in your philosophy. + -- Hamlet +%% +There are more ways of killing a cat than choking her with cream. +%% +There are never any bugs you haven't found yet. +%% +There are new messages. +%% +There are no accidents whatsoever in the universe. + -- Baba Ram Dass +%% +There are no answers, only cross-references. + -- Weiner +%% +There are no great men, only great challenges that +ordinary men are forced by circumstances to meet. + -- Admiral William Halsey +%% +There are no rules for March. March is spring, sort +of, usually, March means maybe, but don't bet on it. +%% +There are only two kinds of tequila. Good and better. +%% +There are people so addicted to exaggeration +that they can't tell the truth without lying. + -- Josh Billings +%% +There are people who find it odd to eat four or five Chinese meals +in a row; in China, I often remind them, there are a billion or so +people who find nothing odd about it. + -- Calvin Trillin +%% +There are places I'll remember +All my life though some have changed. +Some forever not for better +Some have gone and some remain. +All these places had their moments +With lovers and friends I still recall. +Some are dead and some are living, +In my life I've loved them all. + +But of all these friends and lovers, +There is no one compared with you, +All these memories lose their meaning +When I think of love as something new. +Though I know I'll never lose affection +For people and things that went before, +I know I'll often stop and think about them +In my life I'll love you more. + -- Lennon/McCartney, "In My Life", 1965 +%% +There are running jobs. +Why don't you go chase them? +%% + There are some goyisha names that just about guarantee that +someone isn't Jewish. For example, you'll never meet a Jew named +Johnson or Wright or Jones or Sinclair or Ricks or Stevenson or Reid or +Larsen or Jenks. But some goyisha names just about guarantee that +every other person you meet with that name will be Jewish. Why is +this? + Who knows? Learned rabbis have pondered this question for +centuries and have failed to come up with an answer, and you think you +can find one? Get serious. You don't even understand why it's +forbidden to eat crab -- fresh cold crab with mayonnaise -- or lobster +-- soft tender morsels of lobster dipped in melted butter. You don't +even understand a simple thing like that, and yet you hope to discover +why there are more Jews named Miller than Katz? Fat Chance. + -- Arthur Naiman +%% +There are some micro-organisms that exhibit characteristics of both +plants and animals. When exposed to light they undergo photosynthesis; +and when the lights go out, they turn into animals. But then again, +don't we all. +%% +There are strange things done in the midnight sun + By the men who moil for gold; +The Arctic trails have their secret tales + That would make your blood run cold; +The Northern Lights have seen queer sights, + But the queerest they ever did see +Was that night on the marge of Lake Lebarge + I cremated Sam McGee. + -- Robert W. Service +%% +There are ten or twenty basic truths, and life +is the process of discovering them over and over and over. + -- David Nichols +%% +There are three kinds of lies: lies, damned lies and statistics. + -- Benjamin Disraeli +%% +There are three kinds of people: men, women, and unix. +%% +There are three possibilities: +Pioneer's solar panel has turned away from the sun; +there's a large meteor blocking transmission; +someone loaded Star Trek 3.2 into our video processor. +%% +There are three possible parts to a date, of which at least two must be +offered: entertainment, food, and affection. It is customary to begin a +series of dates with a great deal of entertainment, a moderate amount of +food, and the merest suggestion of affection. As the amount of affection +increases, the entertainment can be reduced proportionately. When the +affection IS the entertainment, we no longer call it dating. Under no +circumstances can the food be omitted. + -- Miss Manners' Guide to Excruciatingly Correct Behaviour +%% +There are three things I have always loved +and never understood -- art, music, and women. +%% +There are three things men can do with women: +love them, suffer for them, or turn them into literature. + -- Stephen Stills +%% +There are three ways to get something done: +do it yourself, hire someone, or forbid your kids to do it. +%% +There are twenty-five people left in the world, +and twenty-seven of them are hamburgers. + -- Ed Sanders +%% +There may be said to be two classes of people in the world; those who +constantly divide the people of the world into two classes and those +who do not. + -- Robert Benchley +%% +There are two ways of disliking art. +One is to dislike it. +The other is to like it rationally. + -- Oscar Wilde +%% +There are two ways of disliking poetry; +one way is to dislike it, the other is to read Pope. + -- Oscar Wilde +%% +There are two ways to write error-free +programs; only the third one works. +%% +There cannot be a crisis next week. My schedule is already full. + -- Henry Kissinger +%% +There comes a time in the affairs of a man when he +has to take the bull by the tail and face the situation. + -- W.C. Fields +%% +There comes a time to stop being angry. + -- A Small Circle of Friends +%% +There exist tasks which cannot be done +by more than 10 men or fewer than 100. + -- Steele's Law +%% +There has been a little distress selling on the stock exchange. + -- Thomas W. Lamont, October 29, 1929 +%% +There has been an alarming increase in the +number of things you know nothing about. +%% +There is a 20% chance of tomorrow. +%% +There is a fly on your nose. +%% +There is a great discovery still to be made in Literature: +that of paying literary men by the quantity they do NOT write. +%% +There is a green, multi-legged creature crawling on your shoulder. +%% +There is a theory which states that if ever anyone discovers exactly +what the Universe is for and why it is here, it will instantly disappear +and be replaced by something even more bizarre and inexplicable. There +is another theory which states that this has already happened. + -- The Hitchhiker's Guide to the Galaxy +%% +For every human problem, there is a neat, +plain solution -- and it is always wrong. + -- H.L. Mencken +%% +There is always more hell that needs raising. + -- Lauren Leveut +%% +There is always someone worse off than yourself. +%% +There is always something new out of Africa. + -- Gaius Plinius Secundus +%% +There is an innocence in admiration; it is found in those to whom it +has not yet occurred that they, too, might be admired some day. + -- Friedrich Nietzsche +%% +There is an old time toast which is golden for its beauty. +"When you ascend the hill of prosperity may you not meet a friend." + -- Mark Twain +%% +There is grandeur in this view of life, with its several powers, +having been originally breathed into a few forms or into one; and that, +whilst this planet has gone cycling on according to the fixed law of +gravity, from so simple a beginning endless forms most beautiful and +most wonderful have been, and are being, evolved. + -- Darwin +%% +There is hardly a thing in the world that some man can +not make a little worse and sell a little cheaper. +%% +There is in certain living souls +A quality of loneliness unspeakable, +So great it must be shared +As company is shared by lesser beings. +Such a loneliness is mine; so know by this +That in immensity +There is one lonelier than you. +%% +There is more to life than increasing its speed. + -- Mahatma Gandhi +%% +There is much Obi-Wan did not tell you. + -- Darth Vader +%% +There is never time to do it right, but always time to do it over. +%% +There is no comfort without pain; thus +we define salvation through suffering. + -- Cato +%% +There is no cure for birth and death other than to enjoy the interval. + -- George Santayana +%% +There is no distinction between any AI program and some existent game. +%% +There is no distinctly native American criminal class except Congress. + -- Mark Twain +%% +There is no education that is not political. An apolitical +education is also political because it is purposely isolating. +%% +There is no fear in love; but perfect love casteth out fear. +%% +There is no fool to the old fool. + -- John Heywood +%% +There is no future in time travel. +%% +There is no grief which time does not lessen and soften. +%% +There is no hunting like the hunting of man, and those who have +hunted armed men long enough and liked it, never care for anything +else thereafter. + -- Ernest Hemingway +%% +There is no ox so dumb as the orthodox. + -- George Francis Gillette +%% +There is no point in waiting. +The train stopped running years ago. +All the schedules, the brochures, +The bright-colored posters full of lies, +Promise rides to a distant country +That no longer exists. +%% +There is no proverb that is not true. + -- Cervantes +%% +There is no realizable power that man cannot, in time, fashion the tools +to attain, nor any power so secure that the naked ape will not abuse it. +So it is written in the genetic cards -- only physics and war hold him in +check. And also the wife who wants him home by five, of course. + -- Encyclopadia Apocryphia, 1990 +%% +There is no royal road to geometry. + -- Euclid +%% +There is no sadder sight than a young pessimist. +%% +There is no satisfaction in hanging a man who does not object to it. + -- G.B. Shaw +%% +There is no security on this earth. There is only opportunity. + -- General Douglas MacArthur +%% +There is no sin but ignorance. + -- Christopher Marlowe +%% +There is no such thing as a free lunch. +%% +There is no such thing as a problem without a gift for you in its hands. +%% +There is no such thing as an ugly woman -- there are only +the ones who do not know how to make themselves attractive. + -- Christian Dior +%% +There is no such thing as inner peace; there is only nervousness +or death. Any attempt to prove otherwise is a breach of manners. + -- Fran Lebowitz +%% +There is no such thing as pure pleasure; +some anxiety always goes with it. +%% +There is no time like the pleasant. +%% +There is no time like the present +for postponing what you ought to be doing. +%% +There is not much to choose between a woman who deceives +us for another, and a woman who deceives another for ourselves. + -- Augier +%% +There is nothing more silly than a silly laugh. + -- Gaius Valerius Catullus +%% +There is nothing new except what has been forgotten. + -- Marie Antoinette +%% +There is nothing so easy but that it becomes difficult +when you do it reluctantly. + -- Publius Terentius Afer (Terence) +%% +There is nothing wrong with abstinence, in moderation. +%% +There is nothing wrong with writing ... as long as it +is done in private and you wash your hands afterward. +%% +There is one difference between a tax collector and +a taxidermist -- the taxidermist leaves the hide. + -- Mortimer Caplan +%% +There is only one thing in the world worse than being +talked about, and that is not being talked about. + -- Oscar Wilde +%% +There is only one way to console a widow. But remember the risk. + -- Robert Heinlein +%% +There is only one way to kill capitalism -- +by taxes, taxes, and more taxes. + -- Karl Marx +%% +There is something fascinating about science. One gets such wholesale +returns of conjecture out of such a trifling investment of fact. + -- Mark Twain +%% +There is something in the pang of change +More than the heart can bear, +Unhappiness remembering happiness. + -- Euripides +%% +There is very little future in being right when your boss is wrong. +%% +There isn't room enough in this dress for both of us! +%% +There must be at least 500,000,000 rats in the United +States; of course, I never heard the story before. +%% +There never was a good war or a bad peace. + -- B. Franklin +%% +There once was a girl named Irene +Who lived on distilled kerosene + But she started absorbin' + A new hydrocarbon +And since then has never benzene. +%% +There once was a girl so lovely, +Who wanted to make love in the bubbly, + She strapped on her tanks, + And started her pranks, +But the lobsters all thought she was ugly. +%% +There once was an Arpanet freak, +Who better response-time did seek. + He searched coast to coast, + For a reliable host, +Whose logger took less than a week. +%% +There once was an old man from Esser, +Who's knowledge grew lesser and lesser. + It at last grew so small, + He knew nothing at all, +And now he's a College Professor. +%% +There seems no plan because it is all plan. + -- C.S. Lewis +%% +There was a phone call for you. +%% +There was a plane crash over mid-ocean, and only three survivors were +left in the life-raft: the Pope, the President, and Mayor Daley. +Unfortunately, it was a one-man life-raft, and quickly sinking, so +they started debating who should be allowed to stay. The Pope pointed +out that he was the spiritual leader of millions all over the world, +the President explained that if he died then America would be stuck +with the Vice-President, and so forth. Then Mayor Daley said, "Look! +We're not solving anything like this! The only fair thing to do is +to vote on it." So they did, and Mayor Daley won by 97 votes. +%% +There was a writer in 'Life' magazine ... who claimed that rabbits have +no memory, which is one of their defensive mechanisms. If they recalled +every close shave they had in the course of just an hour life would become +insupportable. + -- Kurt Vonnegut +%% +There was a young belle of old Natchez +Whose garments were always in patchez. + When comment arose + On the state of her clothes +She drawled, "When ah itchez, ah scratchez." +%% +There was a young lady from Bright, +Whose speed was much faster than light. + She went out one day + In a relative way +And returned on the previous night. +%% +There was a young lady from Hyde +Who ate a green apple and died. + While her lover lamented + The apple fermented +And made cider inside her inside. +%% +There was a young lady from Siam +Who said to her lover, one Kiam, + "You may kiss me of course, + But you'll have to use force. +Though God knows you're stronger than I am." +%% +There was a young man from Brazil, +And a lady who'd not take the pill, + They lay on the sofa, + And a <$H12{ot]{ok]{ob{o[]{oR{oK{oDpo~po~pot~poe~{ o!po~po~poq~ +n~po_~{o[po ~poz~pok~po\~{o +8]{o/pomF~po^~{opoh~poY~{opoc~poT~{op~po^~poO~{o[~poY~ poJ~{oF~poT~poE~{o1~ +%% +There was a young man from LeDoux, +Whose limericks stopped at line two. + +There was a young man from Verdunne. +%% +There was a young man who said "God, +I find it exceedingly odd, + That the willow oak tree + Continues to be, +When there's no one about in the Quad." + +"Dear Sir, your astonishment's odd, +For I'm always about in the Quad; + And that's why the tree, + Continues to be," +Signed "Yours faithfully, God." +%% +There was a young poet named Dan, +Whose poetry never would scan. + When told this was so, + He said, "Yes, I know. +It's because I try to put every single +syllable into the last line that I possibly, +possibly can." +%% +There was a young woman from Bude, +Who went for a swim in the nude, + But a man in a punt, + Grabbed at her elbow, +And said "Hey, lady, you can't swim here, it's private property." +%% +There was an old Indian belief that by making love on the hide of +their favorite animal, one could guarantee the health and prosperity +of the offspring conceived thereupon. And so it goes that one Indian +couple made love on a buffalo hide. Nine months later, they were +blessed with a healthy baby son. Yet another couple huddled together +on the hide of a deer and they too were blessed with a very healthy +baby son. But a third couple, whose favorite animal was a hippopotamus, +were blessed with not one, but TWO very healthy baby sons at the conclusion +of the nine month interval. All of which proves the old theorem that: +The sons of the squaw of the hippopotamus are equal to the sons of +the squaws of the other two hides. +%% +There was an old man of St. Bees, +Who was stung in the arm by a wasp. + When asked, "Does it hurt?" + He relied, "No, it doesn't. +I'm so glad that it wasn't a hornet." + -- W.S. Gilbert +%% +There was an old person of Ware +Who had an affair with a bear. + He explained, "I don't mind, + For it's gentle and kind, +But I wish it had slightly less hair." +%% +There was this New Yorker that had a lifelong ambition to be an Texan. +Fortunately, he had an Texan friend and went to him for advice. "Mike, +you know I've always wanted to be a Texan. You're a *real* Texan, what +should I do?" + "Well," answered Mike, "The first thing you've got to do is look +like a Texan. That means you have to dress right. The second thing +you've got to do is speak in a southern drawl." + "Thanks, Mike, I'll give it a try," replied the New Yorker. + A few weeks passed and the New Yorker saunters into a store dressed +in a ten-gallon hat, cowboy boots, Levi jeans and a bandanna. "Hey, there, +pardner, I'd like some beef, not too rare, and some of them fresh biscuits," +he tells the counterman. + The guy behind the counter takes a long look at him and then says, +"You must be from New York." + The New Yorker blushes, and says, "Well, yes, I am. How did +you know?" + "Because this is a hardware store." +%% +There were the Scots +Who kept the Sabbath +And everything else they could lay their hands on. +Then there were the Welsh +Who prayed on their knees and their neighbors. +Thirdly there were the Irish +Who never knew what they wanted +But were willing to fight for it anyway. +Lastly there were the English +Who considered themselves a self-made nation +Thus relieving the Almighty of a dreadful responsibility. +%% +There will be big changes for you but you will be happy. +%% +There's a couple of million dollars worth of baseball talent on the loose, +ready for the big leagues, yet unsigned by any major league. There are +pitchers who would win 20 games a season ... and outfielders [who] could +hit .350, infielders who could win recognition as stars, and there's at +least one catcher who at this writing is probably superior to Bill Dickey, +Josh Gibson. Only one thing is keeping them out of the big leagues, the +pigmentation of their skin. They happen to be colored. + -- Shirley Povich, 1941 +%% +There's a fine line between courage and foolishness. +Too bad it's not a fence. +%% +There's a lot to be said for not saying a lot. +%% +There's a man deeply in debt, see, and he takes the money he has left +and goes to Monte Carlo to try to recoup at the roulette tables. Won a +little, lost a lot, and was down to his last franc. Prayed for help. +A voice whispered in his ear: "Le rouge..." Man looked around; nobody +there. What the hell -- he puts his last franc on the red, and it won. +The voice immediately said, "Encore le rouge..." Played red again, and +it won again. The voice said, "Impair..." Played odd, and it won. Voice +said, "Quinze..." so he put all the money on 15, and it won. This went +on for hours, the voice telling him what to bet, and the man putting all +his money on what the voice said, and winning. Finally when the voice +spoke, the man protested that he'd won millions of dollars and wanted to +quit. The voice was inexorable: "Douze..." The man put the money on 12, +and 11 came up -- he had lost everything -- the voice murmured "Merde!!" +%% +There's a thrill in store for all for we're about to toast +The corporation that we represent. +We're here to cheer each pioneer and also proudly boast, +Of that man of men our sterling president +The name of T.J. Watson means +A courage none can stem +And we feel honored to be here to toast the IBM. + -- Ever Onward, from the 1940 IBM Songbook +%% +There's a trick to the Graceful Exit. It begins with the vision to +recognize when a job, a life stage, a relationship is over -- and to +let go. It means leaving what's over without denying its validity +or its past importance in our lives. It involves a sense of future, +a belief that every exit line is an entry, that we are moving on, +rather than out. The trick of retiring well may be the trick of +living well. It's hard to recognize that life isn't a holding +action, but a process. It's hard to learn that we don't leave the +best parts of ourselves behind, back in the dugout or the office. +We own what we learned back there. The experiences and the growth +are grafted onto our lives. And when we exit, we can take ourselves +along -- quite gracefully. + -- Ellen Goodman +%% +There's a whole WORLD in a mud puddle! + -- Doug Clifford +%% +There's an old proverb that says just about whatever you want it to. +%% +There's been no top authority saying what marijuana does to you. +I really don't know that much about it. I tried it once but it +didn't do anything to me. + -- John Wayne +%% +There's got to be more to life than compile-and-go. +%% +There's just something I don't like about Virginia; the state. +%% +There's little in taking or giving, + There's little in water or wine: +This living, this living, this living, + Was never a project of mine. +Oh, hard is the struggle, and sparse is + The gain of the one at the top, +For art is a form of catharsis, + And love is a permanent flop, +And work is the provence of cattle, + And rest's for a clam in a shell, +So I'm thinking of throwing the battle -- + Would you kindly direct me to hell? + -- Dorothy Parker +%% +There's no future in time travel. +%% +There's no heavier burden than a great potential. +%% +There's no justice in this world. + -- Frank Costello + On the prosecution of "Lucky" Luciano by New York district + attorney Thomas Dewey after Luciano had saved Dewey from + assassination by Dutch Schultz (by ordering the assassination + of Schultz instead) +%% +There's no point in being grown up if you can't be childish sometimes. + -- Dr. Who +%% +There's no room in the drug world for amateurs. + -- Raoul Duke +%% +There's no saint like a reformed sinner. +%% +There's no such thing as an original sin. + -- Elvis Costello +%% +There's no such thing as pure pleasure; some anxiety always goes with it. +%% +There's no time like the pleasant. +%% +There's no use being precise about something +when you don't even know what you're talking about. + -- John von Neumann +%% +There's no use in having a dog and doing your own barking. +%% +There's nothing like a girl with a plunging +neckline to keep a man on his toes. +%% +There's nothing like good food, good wine, and a bad girl. +%% +There's nothing like the face of a kid eating a Hershey bar. +%% +There's nothing very mysterious about you, except that +nobody really knows your origin, purpose, or destination. +%% +There's nothing worse for your business than +extra Santa Clauses smoking in the men's room. + -- W. Bossert +%% +There's one fool at least in every married couple. +%% +There's only one everything. +%% +There's only one way to have a happy marriage +and as soon as I learn what it is I'll get married again. + -- Clint Eastwood +%% +There's small choice in rotten apples. + -- William Shakespeare, "The Taming of the Shrew" +%% +There's so much plastic in this culture that +vinyl leopard skin is becoming an endangered synthetic. + -- Lily Tomlin +%% +There's so much to say but your eyes keep interrupting me. +%% +There's too much beauty upon this earth for lonely men to bear. + -- Richard Le Gallienne +%% +These activities have their own rules and methods +of concealment which seek to mislead and obscure. + -- Dwight D. Eisenhower, 1960 +%% +These days the necessities of life cost you about three times what +they used to, and half the time they aren't even fit to drink. +%% +They also serve who only stand and wait. + -- John Milton +%% +They also surf who only stand on waves. +%% +They are called computers simply because computation is +the only significant job that has so far been given to them. +%% +They are ill discoverers that think there is no land, +when they can see nothing but sea. + -- Francis Bacon +%% +They are relatively good but absolutely terrible. + -- Alan Kay, commenting on Apollos +%% +They can't stop us... we're on a mission from God! + -- The Blues Brothers +%% +They couldn't hit an elephant at this dist... + -- Civil War General John Sedgwick, his last + words, Battle of Spotsylvania Court House, 1864 +%% +They don't suffer. They can't even speak English. + -- George F. Baer, answering a reporter's + question about the suffering of starving miners. +%% +They have been at a great feast of languages, and stolen the scraps. + -- William Shakespeare, "Love's Labour's Lost" +%% +They just buzzed and buzzed...buzzed. +%% +They spell it Vinci and pronounce it Vinchy. +Foreigners always spell better than they pronounce. + -- Mark Twain +%% + "They spend years searching for their natural parents, convinced their +parents will be happy to see them. I mean, really, can you imagine someone +being happy to see an orphan? Nobody wants them... that's why they're orphans!" + The speaker is Anne Baker, founder and guiding force behind +Orphan-Off, an organization dedicated to keeping orphans confused about the +whereabouts of their natural parents. She is a woman with a mission: + "Basically, what we do is band together to exchange information +about which orphans are looking for which parents in what part of the +country. We're completely computerized. + "The idea is to throw the orphans as many red herrings and false +leads as possible. We'll tell some twenty-three-year-old loser that his +real parents can be found at a certain address on the other side of the +country. Well, by the time the kid shows up, the family is prepared. They +look over the kid's photos and information and they say, 'Oh, the Emersons... +yeah, they used to live here... I think they moved out about five years ago. +I think they went to Iowa, or maybe Idaho.' + "Bam, the door shuts in the kid's face and he's back to zero again. +He's got nothing to go on but the orphan's pathetic determination to continue. + "It's really amazing how much these kids will put up with. Last year +we even sent one kid all the way to Australia. I mean, really. Besides, if +your natural parents were Australian, would you want to meet them?" + -- "National Lampoon", September, 1984 +%% +They told me you had proven it When they discovered our results +About a month before. Their hair began to curl +The proof was valid, more or less Instead of understanding it +But rather less than more. We'd run the thing through PRL. + +He sent them word that we would try Don't tell a soul about all this +To pass where they had failed For it must ever be +And after we were done, to them A secret, kept from all the rest +The new proof would be mailed. Between yourself and me. + +My notion was to start again +Ignoring all they'd done +We quickly turned it into code +To see if it would run. +%% +They took some of the Van Goghs, most +of the jewels, and all of the Chivas! +%% +They went rushing down that freeway, +Messed around and got lost. +They didn't care... they were just dying to get off, +And it was life in the fast lane. + -- Eagles, "Life in the Fast Lane" +%% +They wouldn't listen to the fact that I was a genius, +The man said "We got all that we can use", +So I've got those steadily-depressin', low-down, mind-messin', +Working-at-the-car-wash blues. + -- Jim Croce +%% +They're just jealous because they don't have three +wise men and a virgin in the whole organization. + -- Mayor Vincent J. `Buddy' Cianci, on the + ACLU's suit to have a city nativity scene removed. +%% +They're only trying to make me LOOK paranoid! +%% +Things are more like they are today than they ever were before. + -- Dwight Eisenhower +%% +Things are more like they used to be than they are new. +%% +Things are not always what they seem. + -- Phaedrus +%% +Things equal to nothing else are equal to each other. +%% +Things fall apart; the centre cannot hold. +%% +Things past redress and now with me past care. + -- William Shakespeare, "Richard II" +%% +Things will be bright in P.M. +A cop will shine a light in your face. +%% +Things will get better despite our efforts to improve them. + -- Will Rogers +%% +Things worth having are worth cheating for. +%% +Think big. +Pollute the Mississippi. +%% +Think honk if you're a telepath. +%% +Think lucky. If you fall in a pond, check your pockets for fish. + -- Darrell Royal +%% +Think of it! With VLSI we can pack 100 ENIACs in 1 sq. cm.! +%% +Think of your family tonight. +Try to crawl home after the computer crashes. +%% +Think sideways! + -- Ed De Bono +%% +Think twice before speaking, but don't say "think think click click". +%% +Thinks't thou existence doth depend on time? +It doth; but actions are our epochs; mine +Have made my days and nights imperishable, +Endless, and all alike, as sands on the shore, +Innumerable atoms; and one desert, +Barren and cold, on which the wild waves break, +But nothing rests, save carcasses and wrecks, +Rocks, and the salt-surf weeds of bitterness. +%% +Thirteen at a table is unlucky only +when the hostess has only twelve chops. + -- Groucho Marx +%% +Thirty white horses on a red hill, +First they champ, +Then they stamp, +Then they stand still. + -- Tolkien +%% +This door is baroquen, please wiggle Handel. +(If I wiggle Handel, will it wiggle Bach?) + -- Found on a door in the MSU music building +%% +This dungeon is owned and operated by Frobazz Magic Co., Ltd. +%% +This file will self-destruct in five minutes. +%% +This fortune cookie program out of order. For those in desperate +need, please use the program "randchar". This program generates +random characters, and, given enough time, will undoubtedly come +up with something profound. It will, however, take it no time at +all to be more profound than THIS program has ever been. +%% +This fortune intentionally not included. +%% +This fortune intentionally says nothing. +%% +This fortune is dedicated to your mother, without whose +invaluable assistance last night would never have been possible. +%% +This fortune is encrypted -- get your decoder rings ready! +%% +This fortune is inoperative. Please try another. +%% +This fortune soaks up 47 times its own weight in excess memory. +%% +This fortune was brought to you by the people at Hewlett-Packard. +%% +This fortune would be seven words long if it were six words shorter. +%% +This is Betty Frenel. I don't know who to call but I can't reach my +Food-a-holics partner. I'm at Vido's on my second pizza with sausage +and mushroom. Jim, come and get me! +%% +This is Jim Rockford. +At the tone leave your name and message; I'll get back to you. +%% +This is Maria, Liberty Bail Bonds. Your client, Todd Lieman, skipped and +his bail is forfeit. That's the pink slip on your '74 Firebird, I believe. +Sorry, Jim, bring it on over. +%% +This is Marilyn Reed, I wanta talk to you... Is this a machine? +I don't talk to machines! [Click] +%% +This is NOT a repeat. +%% +This is National Non-Dairy Creamer Week. +%% +This is a country where people are free to practice their religion, +regardless of race, creed, color, obesity, or number of dangling keys... +%% +This is a good time to punt work. +%% +This is a test of the emergency broadcast system. +Had there been an actual emergency, then you would no longer be here. +%% +This is for all ill-treated fellows + Unborn and unbegot, +For them to read when they're in trouble + And I am not. + -- A.E. Housman +%% +This is the Baron. Angel Martin tells me you buy information. Ok, +meet me at one a.m. behind the bus depot, bring five-hundred dollars +and come alone. I'm serious! +%% +This is the sort of English up with which I will not put. + -- Winston Churchill +%% +This is the theory that Jack built. +This is the flaw that lay in the theory that Jack built. +This is the palpable verbal haze that hid the flaw that lay in... +%% +This isn't right. This isn't even wrong. + -- Wolfgang Pauli, on a colleague's paper +%% +This land is my land, and only my land, +I've got a shotgun, and you ain't got one, +If you don't get off, I'll blow your head off, +This land is private property. + -- Apologies to Woody Guthrie +%% +This life is a test. It is only a test. Had this been an +actual life, you would have received further instructions as +to what to do and where to go. +%% +This life is yours. Some of it was given +to you; the rest, you made yourself. +%% +This login session: $13.76, but for you $11.88. +%% +This login session: $13.99 +%% +This night methinks is but the daylight sick. + -- William Shakespeare, "The Merchant of Venice" +%% +This planet has -- or rather had -- a problem, which was this: most of +the people living on it were unhappy for pretty much of the time. Many +solutions were suggested for this problem, but most of these were +largely concerned with the movements of small green pieces of paper, +which is odd because on the whole it wasn't the small green pieces of +paper that were unhappy. + -- Douglas Adams +%% +This sad little lizard told me that he was a brontosaurus on his +mother's side. I did not laugh; people who boast of ancestry +often have little else to sustain them. Humoring them costs nothing and +adds happiness in a world in which happiness is always in short supply. + -- Lazarus Long +%% +This screen intentionally left blank. +%% +This sentence does in fact not have the property it claims not to have. +%% +This sentence no verb. +%% +This system will self-destruct in five minutes. +%% +This thing all things devours: +Birds, beasts, trees, flowers; +Gnaws iron, bites steel; +Grinds hard stones to meal; +Slays king, ruins town, +And beats high mountain down. +%% +This unit... must... survive. +%% +This was a Golden Age, a time of high adventure, rich living, and hard +dying... but nobody thought so. This was a future of fortune and theft, +pillage and rapine, culture and vice... but nobody admitted it. + -- Alfred Bester, "The Stars My Destination" +%% +This was the most unkindest cut of all. + -- William Shakespeare, "Julius Caesar" +%% +This wasn't just plain terrible, this was fancy terrible. +This was terrible with raisins in it. + -- Dorothy Parker +%% +This will be a memorable month -- no matter how hard you try to forget it. +%% +The world is a comedy to those who think, +and a tragedy to those who feel. + -- Horace Walpole +%% + Thompson, if he is to be believed, has sampled the entire rainbow of +legal and illegal drugs in heroic efforts to feel better than he does. + As for the truth about his health: I have asked around about it. I +am told that he appears to be strong and rosy, and steadily sane. But we +will be doing what he wants us to do, I think, if we consider his exterior +a sort of Dorian Gray facade. Inwardly, he is being eaten alive by tinhorn +politicians. + The disease is fatal. There is no known cure. The most we can do +for the poor devil, it seems to me, is to name his disease in his honor. +From this moment on, let all those who feel that Americans can be as easily +led to beauty as to ugliness, to truth as to public relations, to joy as to +bitterness, be said to be suffering from Hunter Thompson's disease. I don't +have it this morning. It comes and goes. This morning I don't have Hunter +Thompson's disease. + -- Kurt Vonnegut Jr., on Dr. Hunter S. Thompson: Excerpt + from "A Political Disease", Vonnegut's review of "Fear and + Loathing: On the Campaign Trail '72" +%% +Those of you who think you know everything +are annoying those of us who do. +%% +Those of you who think you know it all upset those of us who do. +%% +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. +%% +Those who cannot remember the past are condemned to repeat it. + -- George Santayana +%% +Those who can't write, write manuals. +%% +Those who claim the dead never return +to life haven't ever been around here at quitting time. +%% +Those who do things in a noble spirit of +self-sacrifice are to be avoided at all costs. + -- N. Alexander. +%% +Those who educate children well are more to be honored than +parents, for these only gave life, those the art of living well. + -- Aristotle +%% +Those who in quarrels interpose, must often wipe a bloody nose. +%% +Those who like sausages and the law had better not watch either one being made. +%% +Those who make peaceful revolution impossible +will make violent revolution inevitable. + -- John Fitzgerald Kennedy +%% +Those who talk don't know. Those who don't talk, know. +%% +Thou hast seen nothing yet. + -- Miguel de Cervantes +%% +Thrashing is just virtual crashing. +%% +Three Midwesterners, a Kansan, a Missourian and an Iowan, +all appearing on a quiz program, were asked to complete this sentence: +"Old MacDonald had a . . ." + + "Old MacDonald had a carburetor," answered the Kansan. + "Sorry, that's wrong," the game show host said. + "Old MacDonald had a free brake alignment down at the + service station," said the Missourian. + "Wrong." + "Old MacDonald had a farm," said the Iowan. + "CORRECT!" shouts the quizmaster. "Now for $100,000, spell 'farm.'" + "Easy," said the Iowan. "E-I-E-I-O." +%% +Three Rings for the Elven-kings under the sky, +Seven for the Dwarf-lords in their halls of stone, +Nine for Mortal Men doomed to die, +One for the Dark Lord on his dark throne +In the Land of Mordor where the Shadows lie. +One Ring to rule them all, One Ring to find them, +One Ring to bring them all and in the darkness bind them +In the Land of Mordor where the Shadows lie. + -- J.R.R. Tolkien, "The Lord of the Rings" +%% +Three great scientific theories of the structure of the universe are +the molecular, the corpuscular and the atomic. A fourth affirms, with +Haeckel, the condensation or precipitation of matter from ether -- +whose existence is proved by the condensation or precipitation... +A fifth theory is held by idiots, but it is doubtful if they know any +more about the matter than the others. +%% +Three hours a day will produce as much as a man ought to write. + -- Trollope +%% +Three may keep a secret if two of them are dead. + -- B. Franklin +%% +Three may keep a secret, if two of them are dead. + -- Ben Franklin +%% +Three o'clock is always too late or too early for anything you want to do. + -- Jean-Paul Sartre +%% +Three rules for sounding like an expert: +1. Oversimplify your explanations to the point of uselessness. +2. Always point out second-order effects, + but never point out when they can be ignored. +3. Come up with three rules. +%% +Three things have been difficult to tame: The oceans, fools, +and women. We may soon be able to tame the ocean. Fools and +women will take a little longer. + -- Spiro Agnew +%% +Three young women were attending the same logic class given at one of the +better universities. During a lecture the professor stated that he was +going to test their ability at situation reasoning. + "Let us assume," said the prof, "that you are aboard a small craft +alone in the Pacific, and you spot a vessel approaching you with several +sex-starved sailors on board. What would you do in this situation to avoid +the problem?" + "I would attempt to turn my craft in the opposite direction and +flee," said the first girl. + "I would pass them, and hope that I could fend them off," responded +the second woman. + "Frankly," murmured the third woman, "I understand the situation, +but I fail to see the problem." +%% +Thus mathematics may be defined as the +subject in which we never know what we are talking about, +nor whether what we are saying is true. + -- Bertrand Russell +%% +Thyme's Law: + Everything goes wrong at once. +%% +Ticking away the moments that make up a dull day +Fritter and waste the hours in an offhand way +Kicking around on a piece of ground in your hometown +Waiting for someone or something to show you the way + +Tired of lying in the sunshine And then one day you find +Staying home to watch the rain Ten years have got behind you +You are young and life is long No one told you when to run +And there is time to kill today You missed the starting gun + +And you run and you run to catch up with the sun but it's sinking +And racing around to come up behind you again +The sun is the same in a relative way but you're older +Shorter of breath and one day closer to death + +Every year is getting shorter Hanging on in quiet desperation + is the English way +Never seem to find the time The time is gone, the song is over +Plans that either come to nought Thought I'd something more to say... +Or half a page of scribbled lines + -- Pink Floyd, "Time" +%% +Tiddely Quiddely +Edward M. Kennedy +Quite unaccountably +Drove in a stream. + +Pleas of amnesia +Incomprehensible +Possibly shattered +Political dream. +%% +Time and tide wait for no man. +%% +Time as he grows old teaches all things. + -- Aeschylus +%% +Time flies like an arrow. Fruit flies like a banana. +%% +Time goes, you say? +Ah no! +Time stays, *we* go. + -- Austin Dobson +%% +Time is an illusion, lunchtime doubly so. + -- The Hitchhiker's Guide to the Galaxy +%% +Time is an illusion perpetrated by the manufacturers of space. +%% +Time is but the stream I go a-fishing in. + -- Henry David Thoreau +%% +Time is nature's way of making sure +that everything doesn't happen at once. +%% +Time is the most valuable thing a man can spend. + -- Theophrastus +%% +Time sure flies when you don't know what you're doing. +%% +Time to be aggressive. Go after a tattooed Virgo. +%% +Time to take stock. +Go home with some office supplies. +%% +Time washes clean +Love's wounds unseen. +That's what someone told me; +But I don't know what it means. + -- Linda Ronstadt, "Long Long Time" +%% +Time will end all my troubles, +but I don't always approve of Time's methods. +%% +Time-sharing is the junk-mail part of the computer business. + -- H.R.J. Grosch (attributed) +%% +Timing must be perfect now. +Two-timing must be better than perfect. +%% +Tip the world over on its side and +everything loose will land in Los Angeles. + -- Frank Lloyd Wright +%% + To A Quick Young Fox +Why jog exquisite bulk, fond crazy vamp, +Daft buxom jonquil, zephyr's gawky vice? +Guy fed by work, quiz Jove's xanthic lamp-- +Zow! Qualms by deja vu gyp fox-kin thrice. + -- Lazy Dog +%% +To Theodore Roosevelt: + You are like the Wind and I like the Lion. You form the Tempest. +The sand stings my eyes and the Ground is parched. I roar in defiance but +you do not hear. But between us there is a difference. I, like the lion, +must remain in my place. While you, like the wind, will never know yours. + Mulay Hamid El Raisuli + Lord of the Riff + Sultan to the Berbers + Last of the Barbary Pirates +%% +To add insult to injury. + -- Phaedrus +%% +To any truly impartial person, it would +be obvious that I am always right. +%% +To avoid criticism, do nothing, say nothing, be nothing. + -- Elbert Hubbard +%% +To be a kind of moral Unix, he touched the hem of Nature's shift. + -- Shelley +%% +To be beautiful is enough! if a woman can do that well who +should demand more from her? You don't want a rose to sing. + -- Thackeray +%% +To be considered successful, a woman must be much better at her job +than a man would have to be. Fortunately, this isn't difficult. +%% +To be excellent when engaged in administration is to be like the North +Star. As it remains in its one position, all the other stars surround it. + -- Confucius +%% +To be great is to be misunderstood. + -- Ralph Waldo Emerson +%% +To be happy one must be a) well fed, unhounded by sordid cares, at ease in +Zion, b) full of a comfortable feeling of superiority to the masses of one's +fellow men, and c) delicately and unceasingly amused according to one's taste. +It is my contention that, if this definition be accepted, there is no country +in the world wherein a man constituted as I am -- a man of my peculiar +weaknesses, vanities, appetites, and aversions -- can be so happy as he can +be in the United States. Going further, I lay down the doctrine that it is +a sheer physical impossibility for such a man to live in the United States +and not be happy. + -- H.L. Mencken, "On Being An American" +%% +To be is to be related. + -- C.J. Keyser. +%% +To be is to do. + -- I. Kant +To do is to be. + -- A. Sartre +Yabba-Dabba-Doo! + -- F. Flintstone +%% +To be nobody-but-yourself in a world which is doing its best to, +night and day, to make you everybody else -- means to fight the hardest +battle which any human being can fight; and never stop fighting. + -- E.E. Cummings, "A Miscellany" +%% +To be or not to be, that is the bottom line. +%% +To be or not to be. + -- Shakespeare +To do is to be. + -- Nietzsche +To be is to do. + -- Sartre +Do be do be do. + -- Sinatra +%% +To be successful, a woman has to be much better at her job than a man. + -- Golda Meir +%% +To be successful, a woman must do her job ten times +as well as a man. Fortunately, this is not difficult. +%% +To be sure of hitting the target, shoot first +and, whatever you hit, call it the target. +%% +To be who one is, is not to be someone else. +%% +To be wise, the only thing you really need +to know is when to say "I don't know." +%% +To believe your own thought, to believe that what is true for +you in your private heart is true for all men -- that is genius. + -- Ralph Waldo Emerson +%% +To communicate is the beginning of understanding. + -- AT&T +%% +To craunch a marmoset. + -- Pedro Carolino, "English as She is Spoke" +%% +To criticize the incompetent is easy; +it is more difficult to criticize the competent. +%% +To defend the Saigon regime is not worth one more human life. + -- Senator Edmund Muskie +%% +To do nothing is to be nothing. +%% +To do two things at once is to do neither. + -- Publilius Syrus +%% +To doubt everything or to believe everything are two equally +convenient solutions; both dispense with the necessity of reflection. + -- H. Poincare +%% +To err is human, but I can REALLY foul things up. +%% +To err is human, but to really foul things up requires a computer. +%% +To err is human; to admit it, a blunder. +%% +To err is human, to forgive is Not Company Policy. +%% +To err is human, to forgive is against company policy. +%% +To err is human, to forgive unusual. +%% +To err is human, to repent, divine, to persist, devilish. + -- Benjamin Franklin +%% +To err is human. +To blame someone else for your mistakes is even more human. +%% +To err is humor. +%% +To fear love is to fear life, and those +who fear life are already three parts dead. + -- Bertrand Russell +%% +To find out a girl's faults, praise her to her girl friends. + -- Benjamin Franklin +%% +To give happiness is to deserve happiness. +%% +To give of yourself, you must first know yourself. +%% +To have died once is enough. + -- Publius Vergilius Maro (Virgil) +%% +To hell with the Prime Directive; +Let's KILL something! +%% +To invent, you need a good imagination and a pile of junk. + -- Thomas Edison +%% +To iterate is human, to recurse, divine. + -- Robert Heller +%% +To keep your friends treat them kindly; +to kill them, treat them often. +%% +To know Edina is to reject it. + -- Dudley Riggs, "The Year the Grinch Stole the Election" +%% +To laugh at men of sense is the privilege of fools. +%% +To lead people, you must follow behind. + -- Lao Tsu +%% +To listen to some devout people, +one would imagine that God never laughs. + -- Sri Aurobindo +%% +To love is good, love being difficult. +%% +To make an enemy, do someone a favor. +%% +To make tax forms true they should +read "Income Owed Us" and "Incommode You". +%% +To many, total abstinence is easier than perfect moderation. + -- St. Augustine +%% +To refuse praise is to seek praise twice. +%% +To restore a sense of reality, I think +Walt Disney should have a Hardluckland. + -- Jack Paar +%% +To save a single life is better than to build a seven story pagoda. +%% +To say you got a vote of confidence +would be to say you needed a vote of confidence. + -- Andrew Young +%% +To see a need and wait to be asked, is to already refuse. +%% +To see the butcher slap the steak, before he laid it on the block, +and give his knife a sharpening, was to forget breakfast instantly. It was +agreeable, too -it really was- to see him cut it off, so smooth and juicy. +There was nothing savage in the act, although the knife was large and keen; +it was a piece of art, high art; there was delicacy of touch, clearness of +tone, skilful handling of the subject, fine shading. It was the triumph of +mind over matter; quite. + -- Dickens, "Martin Chuzzlewit" +%% +To spot the expert, pick the one who predicts +the job will take the longest and cost the most. +%% +To stay young requires unceasing cultivation +of the ability to unlearn old falsehoods. + -- Lazarus Long, "Time Enough For Love" +%% +To stay youthful, stay useful. +%% +To teach is to learn. +%% +To teach is to learn twice. + -- Joseph Joubert +%% +To the landlord belongs the doorknobs. +%% +To thine own self be true. +(If not that, at least make some money.) +%% +To those accustomed to the precise, structured methods of conventional +system development, exploratory development techniques may seem messy, +inelegant, and unsatisfying. But it's a question of congruence: +precision and flexibility may be just as disfunctional in novel, +uncertain situations as sloppiness and vacillation are in familiar, +well-defined ones. Those who admire the massive, rigid bone structures +of dinosaurs should remember that jellyfish still enjoy their very +secure ecological niche. + -- Beau Sheil, "Power Tools for Programmers" +%% +To understand a program you must become both the machine and the program. +%% +To use violence is to already be defeated. + -- Chinese proverb +%% +To whom the mornings are like nights, +What must the midnights be! + -- Emily Dickinson (on hacking?) +%% +To you I'm an atheist; to God, I'm the loyal opposition. + -- Woody Allen +%% +Tobacco is a filthy weed, +That from the devil does proceed; +It drains your purse, it burns your clothes, +And makes a chimney of your nose. + -- B. Waterhouse +%% +Today is National Existential Ennui Awareness Day. +%% +Today is a good day for information-gathering. +Read someone else's mail file. +%% +Today is a good day to bribe a high-ranking public official. +%% +Today is gonna be one helluva week! +%% +Today is the first day of the rest of the mess. +%% +Today is the first day of the rest of your life. +%% +Today is the first day of the rest of your lossage. +%% +Today is the last day of your life so far. +%% +Today is the tomorrow you worried about yesterday. +%% +Today is what happened to yesterday. +%% +Todays title: + Creative Violence in Sexual Relationships +%% +Todays weirdness is tomorrows reason why. + -- H.S. Thompson +%% +Tomorrow, this will be part of the unchangeable past +but fortunately, it can still be changed today. +%% +Tomorrow will be cancelled due to lack of interest. +%% +Tomorrow, you can be anywhere. +%% +Tomorrow's computers some time next month. + -- DEC +%% +Tom's hungry, time to eat lunch. +%% +Tonight you will pay the wages of sin; +Don't forget to leave a tip. +%% +Tonight's the night: Sleep in a eucalyptus tree. +%% +Toni's Solution to a Guilt-Free Life: + If you have to lie to someone, it's their fault. +%% +Too clever is dumb. + -- Ogden Nash +%% +Too cool to calypso, +Too tough to tango, +Too weird to watusi + -- The Only Ones +%% +Too much is just enough. + -- Mark Twain, on whiskey +%% +Too much is not enough. +%% +Too much of a good thing is WONDERFUL. + -- Mae West +%% +Too often people have come to me and said, "If I had just one wish for +anything in all the world, I would wish for more user-defined equations +in the HP-51820A Waveform Generator Software." + -- Instrument News + [Once is too often. Ed.] +%% +Toothpaste never hurts the taste of good scotch. +%% +Topologists are just plane folks. + Pilots are just plane folks. + Carpenters are just plane folks. + Midwest farmers are just plain folks. + Musicians are just playin' folks. + Whodunit readers are just Spillaine folks. +Some Londoners are just P. Lane folks. +%% +Torque is cheap. +%% +Toto, I don't think we're in Kansas anymore. + -- Judy Garland, "Wizard of Oz" +%% +Trap full -- please empty. +%% +Travel important today; Internal Revenue men arrive tomorrow. +%% +Traveling through hyperspace isn't like dusting crops, boy. + -- Han Solo +%% +Treat your friend as if he might become an enemy. + -- Publilius Syrus +%% +Treaties are like roses and young girls. They last while they last. + -- Charles de Gaulle +%% +Troglodytism does not necessarily imply a low cultural level. +%% +Trouble always comes at the wrong time. +%% +Troubled day for virgins over 16 who are +beautiful and wealthy and live in eucalyptus trees. +%% +Troubles are like babies; they only grow by nursing. +%% +True happiness will be found only in true love. +%% +True leadership is the art of changing +a group from what it is to what it ought to be. + -- Virginia Allan +%% +Truly great madness can not be achieved without significant intelligence. + -- Henrik Tikkanen +%% +Truly simple systems... require infinite testing. + -- Norman Augustine +%% +Trust your husband, adore your husband, +and get as much as you can in your own name. + -- Joan Rivers +%% +Truth has no special time of its own. Its hour is now -- always. + -- Albert Schweitzer +%% +Truth is hard to find and harder to obscure. +%% +Truth will out this morning. (Which may really mess things up.) +%% +Try again. +%% +Try not to have a good time ... +This is supposed to be educational. + -- Charles Schulz +%% +Try not. +Do. +Or do not. +There is no try. +%% +Try `stty 0' -- it works much better. +%% +Try the Moo Shu Pork. It is especially good today. +%% +Try to be the best of whatever you are, even if what you are is no good. +%% +Try to be the best of whatever you are, +even if what you are is no good. +%% +Try to divide your time evenly to keep others happy. +%% +Try to get all of your posthumous medals in advance. +%% +Try to have as good a life as you can under the circumstances. +%% +Try to value useful qualities in one who loves you. +%% +Trying to be happy is like trying to build a machine for +which the only specification is that it should run noiselessly. +%% +Trying to get an education here is like +trying to take a drink from a fire hose. +%% +T-shirt of the Week: + I'm not excited, I'm cold! +%% +Tuesday After Lunch is the cosmic time of the week. +%% +Tuesday is the Wednesday of the rest of your life. +%% +Turn on, tune in, and take over. + -- Tim Leary +%% +Turn the other cheek. + -- Jesus Christ +%% +Turnaucka's Law: + The attention span of a computer is only as long as its + electrical cord. +%% +Tussman's Law: + Nothing is as inevitable as a mistake whose time has come. +%% +'Twas a woman who drove me to drink, +and I never even had the decency to thank her. + -- R.B. Gossling +%% +'Twas brillig, and the slithy toves And as in uffish thought he stood +Did gyre and gimble in the wabe. The Jabberwock, with eyes aflame +All mimsy were the borogroves Came whuffling through the tulgey wood +And the mome raths outgrabe. And burbled as it came! + +"Beware the Jabberwock, my son! One! Two! One! Two! +The jaws that bite, and through and through + the claws that catch! The vorpal blade went snicker-snack. +Beware the Jubjub bird, He left it dead, and took its head, +And shun the frumious Bandersnatch!" And went galumphing back. + +He took his vorpal sword in hand "Hast thou slain the Jabberwock? +Long time the manxome foe he sought. Come to my arms, my beamish boy! +So rested he by the tumtum tree Oh frabjous day! Calooh! Callay!" +And stood awhile in thought. He chortled in his joy. + + 'Twas brillig, and the slithy toves + Did gyre and gimble in the wabe. + All mimsy were the borogroves + -- Lewis Carroll +%% +'Twas midnight, and the UNIX hacks +Did gyre and gimble in their cave +All mimsy was the CS-VAX +And Cory raths outgrave. + +"Beware the software rot, my son! +The faults that bite, the jobs that thrash! +Beware the broken pipe, and shun +The frumious system crash!" +%% +Twenty two thousand days. +Twenty two thousand days. +It's not a lot. +It's all you've got. +Twenty two thousand days. + -- Moody Blues, "Twenty Two Thousand Days" +%% +Twenty years of romance make a woman look like a ruin; but +twenty years of marriage make her something like a public building. + -- Wilde +%% +Two can Live as Cheaply as One for Half as Long. + -- Howard Kandel +%% +Two cars in every pot and a chicken in every garage. +%% +Two heads are better than one. + -- John Heywood +%% +Two heads are more numerous than one. +%% +Two hundred years ago today, Irma Chine of White Plains, New York, was +performing her normal housekeeping routines. She was interrupted by +British soldiers who, rallying to the call of their supervisor, General +Hughes, sought to gain control of the voter registration lists kept in +her home. Masking her fear and thinking fast, Mrs. Chine quickly divided +a nearby apple in two and deftly stored the list in its center. Upon +entering, the British blatantly violated every conceivable convention, +and, though they went through the house virtually bit by bit, their +search was fruitless. They had to return empty handed. Word of the +incident propagated rapidly through the region. This historic event +became the first documented use of core storage for the saving of registers. +%% +Two is company, three is an orgy. +%% +Two is not equal to three, even for large values of two. +%% +Two men look out through the same bars; one sees mud, and one the stars. +%% + Two men looked out from the prison bars, + One saw mud-- + The other saw stars. + +Now let me get this right: two prisoners are looking out the window. +While one of them was looking at all the mud -- the other one got hit +in the head. +%% +Two men were sitting over coffee, contemplating the nature of things, +with all due respect for their breakfast. "I wonder why it is that +toast always falls on the buttered side," said one. + "Tell me," replied his friend, "why you say such a thing. Look +at this." And he dropped his toast on the floor, where it landed on the +dry side. + "So, what have you to say for your theory now?" + "What am I to say? You obviously buttered the wrong side." +%% +Two percent of zero is almost nothing. +%% +Two rights don't make a wrong, they make an airplane. +%% +Two wrongs are only the beginning. + -- Kohn +%% +Tyger, Tyger, burning bright Where the hammer? Where the chain? +In the forests of the night, In what furnace was thy brain? +What immortal hand or eye What the anvil? What dread grasp +Dare frame thy fearful symmetry? Dare its deadly terrors clasp? + +Burnt in distant deeps or skies When the stars threw down their spears +The cruel fire of thine eyes? And water'd heaven with their tears +On what wings dare he aspire? Dare he laugh his work to see? +What the hand dare seize the fire? Dare he who made the lamb make thee? + +And what shoulder & what art Tyger, Tyger, burning bright +Could twist the sinews of they heart? In the forests of the night, +And when thy heart began to beat What immortal hand or eye +What dread hand & what dread feet Dare frame thy fearful symmetry? + +Could fetch it from the furnace deep +And in thy horrid ribs dare steep +In the well of sanguine woe? +In what clay & in what mould +Were thy eyes of fury roll'd? + -- William Blake, "The Tyger" +%% +Type louder, please. +%% +UFO's are for real: the Air Force doesn't exist. +%% +UNFAIR COMPETITION: + Selling cheaper than we do. +%% +UNION: + A dues-paying club workers wield to strike management. +%% +UNIVERSE: + The problem. +%% +UNIVERSITY: + Like a software house, except the software's free, and it's + usable, and it works, and if it breaks they'll quickly tell + you how to fix it, and... + + [Okay, okay, I'll leave it in, but I think you're destroying + the credibility of the entire fortune program. Ed.] +%% +UNIX enhancements aren't. +%% +UNIX is many things to many people, +but it's never been everything to anybody. +%% +UNTOLD WEALTH: + What you left out on April 15th. +%% +USER: + A programmer who will believe anything you tell him. +%% +Udall's Fourth Law: + Any change or reform you make + is going to have consequences you don't like. +%% +Uh-oh -- I've let the cat out of the bag. Let me, then, +straightforwardly state the thesis I shall now elaborate: +Making variations on a theme is really the crux of creativity. + -- Douglas R. Hofstadter, "Metamagical Themas" +%% +Unbearably lovely music is heard as the curtain rises, and we see the +woods on a summer afternoon. A fawn dances on and nibbles at some +leaves. He drifts lazily through the soft foliage. Soon he starts +coughing and drops dead. + -- Woody Allen, "Without Feathers" +%% +Uncle Cosmo, why do they call this a word processor? +It's simple, Skyler. You've seen what food processors do to food, right? +%% +Uncle Ed's Rule of Thumb: + Never use your thumb for a rule. + You'll either hit it with a hammer or get a splinter in it. +%% +Under capitalism, man exploits man. +Under communism, it's just the opposite. + -- J.K. Galbraith +%% +Under deadline pressure for the next week. +If you want something, it can wait. +Unless it's blind screaming paroxysmally hedonistic... +%% +Under every stone lurks a politician. + -- Aristophanes +%% +Under the wide an starry sky, +Dig my grave and let me lie, +Glad did I live and gladly die, +And laid me down with a will, +And this be the verse that you grave for me, +Here he lies where he longed to be, +Home is the sailor home from the sea, +And the hunter home from the hill. + -- R. Kipling +%% +Under the wide and heavy VAX +Dig my grave and let me relax +Long have I lived, and many my hacks +And I lay me down with a will. +These be the words that tell the way: +"Here he lies who piped 64K, +Brought down the machine for nearly a day, +And Rogue playing to an awful standstill." +%% +Underlying Principle of Socio-Genetics: + Superiority is recessive. +%% +Understanding is always the understanding of a smaller problem +in relation to a bigger problem. + -- P.D. Ouspensky +%% +Unfair animal names: + +-- tsetse fly -- bullhead +-- booby -- duck-billed platypus +-- sapsucker -- Clarence + -- Gary Larson +%% +Unfortunately, most programmers like to play with new toys. I have many +friends who, immediately upon buying a snakebite kit, would be tempted to +throw the first person they see to the ground, tie the tourniquet on him, +slash him with the knife, and apply suction to the wound. + -- Jon Bentley +%% +United Nations, New York, December 25. The peace and joy of the Christmas +season was marred by a proclamation of a general strike of all the military +forces of the world. Panic reigns in the hearts of all the patriots of +every persuasion. Meanwhile, fears of universal disaster sank to an all-time +low over the world. + -- Isaac Asimov +%% +Universities are places of knowledge. The freshman each bring a little +in with them, and the seniors take none away, so knowledge accumulates. +%% +Unix is a lot more complicated (than CP/M) of course -- the typical Unix +hacker can never remember what the PRINT command is called this week -- +but when it gets right down to it, Unix is a glorified video game. +People don't do serious work on Unix systems; they send jokes around the +world on USENET or write adventure games and research papers. + -- E. Post + "Real Programmers Don't Use Pascal", Datamation, 7/83 +%% +Unix is the worst operating system; except for all others. + -- Berry Kercheval +%% +Unix will self-destruct in five seconds... 4... 3... 2... 1... +%% +Unless hours were cups of sack, and minutes capons, and clocks the tongues +of bawds, and dials the signs of leaping houses, and the blessed sun himself +a fair, hot wench in flame-colored taffeta, I see no reason why thou shouldst +be so superfluous to demand the time of the day. +I wasted time and now doth time waste me. + -- William Shakespeare +%% +Unnamed Law: + If it happens, it must be possible. +%% +Unquestionably, there is progress. The average American now +pays out twice as much in taxes as he formerly got in wages. + -- H.L. Mencken +%% +Up against the net, redneck mother, +Mother who has raised your son so well; +He's seventeen and hackin' on a Macintosh, +Flaming spelling errors and raisin' hell... +%% +Upon leaving a hotel bar one evening, an executive noticed a drunk sitting +on the edge of a potted palm in the lobby, crying like a baby. Because he'd +had a couple himself that night, and was feeling rather sorry for his fellow +man, he asked the inebriated one what the trouble was. + "I did a terrible thing tonight," sniffled the drunk. "I sold my +wife to a guy for a bottle of Scotch." + "That is terrible," said the man, too much under the weather to +muster any real indignation. "And now that she's gone, you wish you had her +back." + "Thas right," said the drunk, still sniffling. + "You're sorry you sold her, because you realize too late that you +love her," sympathized the executive. + "No, no," said the drunk. "I wish I had her back because I'm +thirsty again." +%% +Usage: fortune -P [-f] -a [xsz] Q: file [rKe9] -v6[+] file1 ... +%% +Use what talents you possess: the woods would be very silent +if no birds sang there except those that sang best. + -- Henry Van Dyke +%% +Useful Farsi phrases for Americans traveling to Iran: + +AKBAR KHALI-KILI HAFTIR LOTFAN. + Thank you for showing me your marvelous gun. + +FEKR GABUL CARDAN DAVAT PAEH GUSH DIVAR. + I am delighted to accept your kind invitation to lie down + on the floor with my arms above my head and my legs apart. + +SHOMAEH FEKR TAMOMEH QEH GOFTEH BANDE. + I agree with everything you have ever said or thought in your life. +%% +Useful Farsi phrases for Americans traveling to Iran: + +AUTO ARRAREGH DAVATEMAN MANO SEPAHEH-HAST. + It is exceptionally kind of you to allow me to + travel in the trunk of your car. + +FASHAL-EH TUPEHMAN NA DEGAT MANO +GOFTAM CHEESHAYEH MOHEMA RAJEBEH KESHVAREHMAN. + If you will do me the kindness of not harming my genital + appendages I will gladly reciprocate by betraying my + country in public. + +KHREL, JEPAHEH MANEH VA JAYEH AMRIKAHEY. + I will tell you the names and addresses of + many American spies traveling as reporters. +%% +Useful Farsi phrases for Americans traveling to Iran: + +MAMNOUNAN GHORBAN IN DAFAYEH MEEMUNAM. + It is with greatest pleasure that I sign + this confession of capital crimes. + +MATERNIER GHERMEZ AHLIEH, GHORBAN. + The red blindfold would be lovely, excellency. + +TIKEH NUNEH BA OB KHRELEH BEZORG VA KHRUBE BOYAST INO BEGERAM. + The water-soaked bread crumbs are delicious, thank you. + I must have the recipe. + +ETEHFOR'AN, DEHRATEE, OTAGEH SHOMA MIKRASTAM KHE +DO HAFTAEH BA BODANEH SHEEREEL TEEGZ. + Truly, I would rather be a hostage to your greatly esteemed + self than spend a fortnight upon the person of Cheryl Tiegs. +%% +Using TSO is like kicking a dead whale down the beach. + -- S.C. Johnson +%% +VACATION: + A two-week binge of rest and relaxation so intense that + it takes another 50 weeks of your restrained workaday + life-style to recuperate. +%% +VIRGINIA: + A group of beautifully mounted hunters galloping behind + baying hounds in pursuit of a union organizer. +%% +VIRGO (Aug.23 - Sept.22) + Learn something new today, like how to spell or how to count + to ten without using your fingers. Be careful dressing this + morning. You may be hit by a car later in the day and you + wouldn't want to be taken to the doctor's office in some of + that old underwear you own. +%% +VMS version 2.0 ==> +%% +VOLCANO: + A mountain with hiccups. +%% +VU-JADE: + The feeling that you've *never* been in this situation before. +%% +Van Roy's Law: + An unbreakable toy is useful for breaking other toys. +%% +Variables don't; constants aren't. +%% +Vax Vobiscum +%% +Vegeterians beware! You are what you eat. +%% +Velilind's Laws of Experimentation: + 1. If reproducibility may be a problem, conduct the test only once. + 2. If a straight line fit is required, obtain only two data points. +%% + "Verily and forsooth," replied Goodgulf darkly. "In the past year +strange and fearful wonders I have seen. Fields sown with barley reap +crabgrass and fungus, and even small gardens reject their artichoke hearts. +There has been a hot day in December and a blue moon. Calendars are made with +a month of Sundays and a blue-ribbon Holstein bore alive two insurance +salesmen. The earth splits and the entrails of a goat were found tied in +square knots. The face of the sun blackens and the skies have rained down +soggy potato chips." + "But what do all these things mean?" gasped Frito. + "Beats me," said Goodgulf with a shrug, +"but I thought it made good copy." + -- Harvard Lampoon, "Bored of the Rings" +%% +Very few profundities can be expressed in less than 80 characters. +%% +Very few things actually get manufactured these days, because in an +infinitely large Universe, such as the one in which we live, most things one +could possibly imagine, and a lot of things one would rather not, grow +somewhere. A forest was discovered recently in which most of the trees grew +ratchet screwdrivers as fruit. The life cycle of the ratchet screwdriver is +quite interesting. Once picked it needs a dark dusty drawer in which it can +lie undisturbed for years. Then one night it suddenly hatches, discards its +outer skin that crumbles into dust, and emerges as a totally unidentifiable +little metal object with flanges at both ends and a sort of ridge and a hole +for a screw. This, when found, will get thrown away. No one knows what the +screwdriver is supposed to gain from this. Nature, in her infinite wisdom, +is presumably working on it. +%% +Vests are to suits as seat-belts are to cars. +%% +Victory uber allies! +%% +Vini, vidi, vici. +[I came, I saw, I conquered]. + -- Gaius Julius Caesar +%% +"Violence accomplishes nothing." What a contemptible lie! Raw, naked +violence has settled more issues throughout history than any other method +ever employed. Perhaps the city fathers of Carthage could debate the +issue, with Hitler and Alexander as judges? +%% +Violence is a sword that has no handle -- you have to hold the blade. +%% +Violence is molding. +%% +Violence is the last refuge of the incompetent. + -- Salvador Hardin +%% +Virtue does not always demand a heavy sacrifice -- +only the willingness to make it when necessary. + -- Frederick Dunn +%% +Virtue is its own punishment. + -- Denniston +%% +Virtue is not left to stand alone. +He who practices it will have neighbors. + -- Confucius +%% +Virtue would go far if vanity did not keep it company. + -- La Rochefoucauld +%% +Visit beautiful Vergas Minnesota. +%% +Visit beautiful Wisconsin Dells. +%% +Vital papers will demonstrate their vitality by spontaneously +moving from where you left them to where you can't find them. +%% +Voicless it cries, +Wingless flutters, +Toothless bites, +Mouthless mutters. +%% +Volcanoes have a grandeur that is grim +And earthquakes only terrify the dolts, +And to him who's scientific +There is nothing that's terrific +In the pattern of a flight of thunderbolts! + -- W.S. Gilbert, "The Mikado" +%% +Volley Theory: + It is better to have lobbed and lost + than never to have lobbed at all. +%% +Vote anarchist. +%% +WARNING: + Reading this fortune can affect the dimensionality of your + mind, change the curvature of your spine, cause the growth + of hair on your palms, and make a difference in the outcome + of your favorite war. +%% +WARNING!!! +This machine is subject to breakdowns during periods of critical need. + +A special circuit in the machine called "critical detector" senses the +operator's emotional state in terms of how desperate he/she is to use the +machine. The "critical detector" then creates a malfunction proportional +to the desperation of the operator. Threatening the machine with violence +only aggravates the situation. Likewise, attempts to use another machine +may cause it to malfunction. They belong to the same union. Keep cool +and say nice things to the machine. Nothing else seems to work. + +See also: flog(1), tm(1) +%% +WEAPON: + An index of the lack of development of a culture. +%% +WE'LL LOOK INTO IT: + By the time the wheels make a full turn, we + assume you will have forgotten about it,too. +%% +WELL-ADJUSTED: + The ability to play bridge or golf as if they were games. +%% +WE: + The single most important word in the world. +%% +WHERE CAN THE MATTER BE + Oh, dear, where can the matter be + When it's converted to energy? + There is a slight loss of parity. + Johnny's so long at the fair. +%% +WIT: + The salt with which the American Humorist spoils his cookery... + by leaving it out. +%% +WOLF: + A man who knows all the ankles. +%% +WOMAN: + An animal usually living in the vicinity of Man, and + having a rudimentary susceptibility to domestication. + -- Bierce +%% +WORK: + The blessed respite from screaming kids and + soap operas for which you actually get paid. +%% +WRITE-PROTECT TAB: + A small sticker created to cover the unsightly notch carelessly + left by disk manufacturers. The use of the tab creates an error + message once in a while, but its aesthetic value far outweighs + the momentary inconvenience. + -- Robb Russon +%% +WRONG! +%% +WYSIWYG: + What You See Is What You Get. +%% +Wagner's music is better than it sounds. + -- Mark Twain +%% +Wait for that wisest of all counselors, Time. + -- Pericles +%% +Waiter: "Tea or coffee, gentlemen?" +1st customer: "I'll have tea." +2nd customer: "Me, too -- and be sure the glass is clean!" + (Waiter exits, returns) +Waiter: "Two teas. Which one asked for the clean glass?" +%% +Wake up all you citizens, hear your country's call, +Not to arms and violence, But peace for one and all. +Crush out hate and prejudice, fear and greed and sin, +Help bring back her dignity, restore her faith again. + +Work hard for a common cause, don't let our country fall. +Make her proud and strong again, democracy for all. +Yes, make our country strong again, keep our flag unfurled. +Make our country well again, respected by the world. + +Make her whole and beautiful, work from sun to sun. +Stand tall and labor side by side, because there's so much to be done. +Yes, make her whole and beautiful, united strong and free, +Wake up, all you citizens, It's up to you and me. + -- Pansy Myers Schroeder +%% +Wake up and smell the coffee. + -- Ann Landers +%% +Waking a person unnecessarily should not be considered +a capital crime. For a first offense, that is. +%% +Walk softly and carry a big stick. + -- Theodore Roosevelt +%% +Walking on water wasn't built in a day. + -- Jack Kerouac +%% +Walt: Dad, what's gradual school? +Garp: Gradual school? +Walt: Yeah. Mom says her work's more fun now that she's teaching + gradual school. +Garp: Oh. Well, gradual school is someplace you go and gradually + find out that you don't want to go to school anymore. + -- The World According To Garp +%% +Walters' Rule: + All airline flights depart from the gates most distant from + the center of the terminal. Nobody ever had a reservation + on a plane that left Gate 1. +%% +Wanna buy a duck? +%% +War hath no fury like a non-combatant. + -- Charles Edward Montague +%% +War is an equal opportunity destroyer. +%% +War is much too serious a matter to be entrusted to the military. + -- Clemenceau +%% +War spares not the brave, but the cowardly. + -- Anacreon +%% +Warning: Trespassers will be shot. +Survivors will be shot again. +%% +Was there a time when dancers with their fiddles +In children's circuses could stay their troubles? +There was a time they could cry over books, +But time has set its maggot on their track. +Under the arc of the sky they are unsafe. +What's never known is safest in this life. +Under the skysigns they who have no arms +Have cleanest hands, and, as the heartless ghost +Alone's unhurt, so the blind man sees best. + -- Dylan Thomas, "Was There A Time" +%% +Washington [D.C.] is a city of Southern efficiency and Northern charm. + -- John F. Kennedy +%% +[Washington, D.C.] is the home of... taste for +the people -- the big, the bland and the banal. + -- Ada Louise Huxtable +%% +Wasn't there something about a PASCAL programmer +knowing the value of everything and the Wirth of nothing? +%% +Waste not fresh tears over old griefs. + -- Euripides +%% +Waste not, get your budget cut next year. +%% +Wasting time is an important part of living. +%% +Watch all-night Donna Reed reruns until your mind resembles oatmeal. +%% +Watch your mouth, kid, or you'll find yourself floating home. + -- Han Solo +%% +Watson's Law: + The reliability of machinery is inversely proportional to the + number and significance of any persons watching it. +%% +We ARE as gods and might as well get good at it. + -- Whole Earth Catalog +%% +We all declare for liberty, but in using the +same word we do not all mean the same thing. + -- A. Lincoln +%% +We all dream of being the darling of everybody's darling. +%% +We all know that no one understands anything that isn't funny. +%% +We all like praise, but a hike in our pay is the best kind of ways. +%% +We all live in a state of ambitious poverty. + -- Decimus Junius Juvenalis +%% +We all live under the same sky, but we don't all have the same horizon. + -- Dr. Konrad Adenauer +%% +We are all born equal... just some of us are more equal than others. +%% +We are all born mad. Some remain so. + -- Samuel Beckett +%% +We are all dying -- and we're gonna be dead for a long time. +%% +We are all in the gutter, but some of us are looking at the stars. + -- Oscar Wilde +%% +We are all so much together and yet we are all dying of loneliness. + -- A. Schweitzer +%% +We are all worms. But I do believe I am a glowworm. + -- Winston Churchill +%% +We are anthill men upon an anthill world. + -- Ray Bradbury +%% +We are confronted with unsurmountable opportunities. + -- Pogo +%% +We are experiencing system trouble -- do not adjust your terminal. +%% +We are giving instruction to FBI agents in the various Chinese +dialects ... to handle present and likely future contingencies. + -- J.Hoover +%% +We are going to have peace even if we have to fight for it. + -- Dwight D. Eisenhower +%% +We are not a clone. +%% +We are not a loved organization, but we are a respected one. + -- John Fisher +%% +We are not alone. +%% +We are not loved by our friends for what we are; +rather, we are loved in spite of what we are. + -- Victor Hugo +%% +We are simple killers of people and destroyers of property. +%% +We are so fond of each other because our ailments are the same. + -- Jonathon Swift +%% +We are sorry. We cannot complete your call as dialed. Please check +the number and dial again or ask your operator for assistance. + +This is a recording. +%% +We are stronger than our skin of flesh and metal, for we carry and +share a spectrum of suns and lands that lends us legends as we craft +our immortality and interweave our destinies of water and air, +leaving shadows that gather color of their own, until they outshine +the substance that cast them. +%% +We are the people our parents warned us about. +%% +TOTD (T-shirt Of The Day): + I'm the person your mother warned you about. +%% +We are the unwilling... led by the unqualified... +to do the unnecessary... for the ungrateful... + -- GI in Vietnam, 1970 +%% +We are what we are. +%% +We are what we pretend to be. + -- Kurt Vonnegut, Jr. +%% +We boggies are a hairy folk Ever hungry, ever thirsting, +Who like to eat until we choke. Never stop till belly's bursting. +Loving all like friend and brother, Chewing chop and pork and muttons, +And hardly ever eat each other. A merry race of boring gluttons. + +Sing: GOBBLE, GOBBLE, GOBBLE, GOBBLE, GOBBLE, GOBBLE, GOBBLE, GOBBLE. + +Boggies gather 'round the table, Anything edible, we've got dibs on, +Eat as much as you are able. And hope we all die with our bibs on. +Gorge yourselves from moon till noon Ever gay, we'll never grow up, +(Don't forget your plate and spoon.) Come! And sing and play and throw-up! + +Sing: GOBBLE, GOBBLE, GOBBLE, GOBBLE, GOBBLE, GOBBLE, GOBBLE, GOBBLE! + -- Bored of the Rings, "The Hobbits National Anthem" +%% +We can defeat gravity. The problem is the paperwork involved. +%% +We can embody the truth, but we cannot know it. + -- Yates +%% +We cannot command nature except by obeying her. + -- Sir Francis Bacon +%% +We cannot do everything at once, but we can do something at once. + -- Calvin Coolidge +%% +We could do that, but it would be wrong, that's for sure. + -- Richard Nixon +%% +We dedicate this book to our fellow citizens who, for love of truth, +take from their own wants by taxes and gifts, and now and then send +forth one of themselves as dedicated servant, to forward the search +into the mysteries and marvelous simplicities of this strange and +beautiful Universe, Our home. + -- "Gravitation", Misner, Thorne, and Wheeler +%% +We don't care. We don't have to. We're the Phone Company. +%% +We don't have to protect the environment -- the Second Coming is at hand. + -- James Watt, noted theologian +%% +We don't know one millionth of one percent about anything. +%% +We don't know who discovered water, but we're certain it wasn't a fish. +%% +We don't need no education, we don't need no thought control. + -- Pink Floyd +%% +We don't need no indirection We don't need no compilation +We don't need no flow control We don't need no load control +No data typing or declarations No link edit for external bindings +Hey! did you leave the lists alone? Hey! did you leave that source alone? +Chorus: (Chorus) + Oh No. It's just a pure LISP function call. + +We don't need no side-effecting We don't need no allocation +We don't need no flow control We don't need no special-nodes +No global variables for execution No dark bit-flipping for debugging +Hey! did you leave the args alone? Hey! did you leave those bits alone? +(Chorus) (Chorus) + -- "Another Glitch in the Call", a la Pink Floyd +%% +We don't really understand it, so we'll give it to the programmers. +%% +We don't smoke and we don't chew, and we don't go with girls that do. + -- Walter Summers +%% +We don't understand the software, and sometimes we don't +understand the hardware, but we can *see* the blinking lights! +%% + "We friends, yes?" The shoe shine boy put on his hustling smile +and looked into the Sailor's dead, cold, undersea eyes, eyes without a +trace of warmth or lust or hate or any feeling the boy had experienced +in himself or seen in another, at once cold and intense, impersonal and +predatory. + The Sailor leaned forward and put a finger on the boy's inner arm +at the elbow. He spoke in his dead junky whisper. "With veins like that, +Kid, I'd have myself a time!" + -- William Burroughs +%% +We give advice, but we cannot give the wisdom to profit by it. + -- La Rochefoucauld +%% +We gotta get out of this place, +If it's the last thing we ever do. + -- The Animals +%% +We have a equal opportunity Calculus class -- it's fully integrated. +%% +We have art that we do not die of the truth. + -- Nietzsche +%% +We have ears, earther...FOUR OF THEM! +%% +We have gone on piling weapon upon weapon, missile upon missile, new +levels of destructiveness upon old ones. We have done this helplessly, +almost involuntarily: like the victims of some sort of hypnotism, like +men in a dream, like lemmings heading for the sea, like the children of +Hamelin marching blindly along behind their Pied Piper. And the result +is that today we have achieved, we and the Russians together, in the +creation of these devices and their means of delivery, levels of +redundancy of such grotesque dimensions as to defy rational understanding. + -- George Kennan, May 19, 1981 +%% +We have lingered long enough on the shores of the Cosmic Ocean. + -- Carl Sagan +%% +We have met the enemy, and he is us. + -- Walt Kelly +%% +We have more to fear from the bungling of the incompetent +than from the machinations of the wicked. +%% +We have no scorched earth policy. +We have a policy of scorched Communists. + -- General Efrain Rios Montt, President of Guatemala, 1982 +%% +We have nowhere else to go... this is all we have. + -- Margaret Mead +%% +We have reason to be afraid. This is a terrible place. + -- John Berryman +%% + We have some absolutely irrefutable statistics to show exactly why +you are so tired. + There are not as many people actually working as you may have thought. + The population of this country is 200 million. 84 million are over +60 years of age, which leaves 116 million to do the work. People under 20 +years of age total 75 million, which leaves 41 million to do the work. + There are 22 million who are employed by the government, which leaves +19 million to do the work. Four million are in the Armed Services, which +leaves 15 million to do the work. Deduct 14,800,000, the number in the state +and city offices, leaving 200,000 to do the work. There are 188,000 in +hospitals, insane asylums, etc., so that leaves 12,000 to do the work. + Now it may interest you to know that there are 11,998 people in jail, +so that leaves just 2 people to carry the load. That is you and me, and +brother, I'm getting tired of doing everything myself! +%% +We interrupt this fortune for an important announcement... +%% +We laugh at the Indian philosopher, who to account for the support +of the earth, contrived the hypothesis of a huge elephant, and to support +the elephant, a huge tortoise. If we will candidly confess the truth, we +know as little of the operation of the nerves, as he did of the manner in +which the earth is supported: and our hypothesis about animal spirits, or +about the tension and vibrations of the nerves, are as like to be true, as +his about the support of the earth. His elephant was a hypothesis, and our +hypotheses are elephants. Every theory in philosophy, which is built on +pure conjecture, is an elephant; and every theory that is supported partly +by fact, and partly by conjecture, is like Nebuchadnezzar's image, whose +feet were partly of iron, and partly of clay. + -- Thomas Reid, "An Inquiry into the Human Mind", 1764 +%% +We learn from history that we do not learn anything from history. +%% +We love our little Johnny +He's the best little boy in all the world +And we wouldn't trade him for anything +That's how much we love him. +No, we couldn't live without him +So that's why, since he died, +We keep him safe in our G.E. freezer. +He's so good, so well-behaved, +Even better than before; +Oh, such a wonderful kid he is. +Alice and me, we'll never be lonely, +Never miss our little Johnny, +He'll never grow up and leave us +That's why we love him like we do. + -- Mr. Mincemeat +%% +"We maintain that the very foundation of our way of life is what we call +free enterprise," said Cash McCall, "but when one of our citizens +show enough free enterprise to pile up a little of that profit, we do +our best to make him feel that he ought to be ashamed of himself." + -- Cameron Hawley +%% +We may not return the affection of those who like us, +but we always respect their good judgement. +%% +We must believe that it is the darkest before the dawn +of a beautiful new world. We will see it when we believe it. + -- Saul Alinsky +%% +We must die because we have known them. + -- Ptah-hotep, 2000 B.C. +%% +We must remember the First Amendment which +protects any shrill jackass no matter how self-seeking. + -- F.G. Withington +%% +We only acknowledge small faults in order +to make it appear that we are free from great ones. + -- LaRouchefoucauld +%% +We prefer to speak evil of ourselves +rather than not speak of ourselves at all. +%% +We promise according to our hopes, and perform according to our fears. +%% +We rarely find anyone who can say he has lived a happy life, and who, +content with his life, can retire from the world like a satisfied guest. + -- Quintus Horatius Flaccus (Horace) +%% +We read to say that we have read. +%% +We really don't have any enemies. +It's just that some of our best friends are trying to kill us. +%% +We secure our friends not by accepting favors but by doing them. + -- Thucydides +%% +We seldom repent talking too little, but very often talking too much. + -- Jean de la Bruyere +%% +We should be careful to get out of an experience only the wisdom that is +in it - and stay there, lest we be like the cat that sits down on a hot +stove-lid. She will never sit down on a hot stove-lid again - and that +is well; but also she will never sit down on a cold one any more. + -- Mark Twain +%% +We should have a great many fewer disputes in the world if only words were +taken for what they are, the signs of our ideas only, and not for things +themselves. + -- John Locke +%% +We the Users, in order to form a more perfect system, establish priorities, +ensure connective tranquility, provide for common repairs, promote +preventive maintenance, and secure the blessings of liberty for ourselves +and our processes, do ordain and establish this Software of The Unixed States +of America. +%% +We the unwilling, led by the ungrateful, are doing the impossible. +We've done so much, for so long, with so little, +that we are now qualified to do something with nothing. +%% +We totally deny the allegations, and +we're trying to identify the allegators. +%% +[We] use bad software and bad machines for the wrong things. + -- R.W. Hamming +%% +We was playin' the Homestead Grays in the city of Pitchburgh. Josh +[Gibson] comes up in the last of the ninth with a man on and us a run +behind. Well, he hit one. The Grays waited around and waited around, +but finally the empire rules it ain't comin' down. So we win. The +next day, we was disputin' the Grays in Philadelphia when here come +a ball outta the sky right in the glove of the Grays' center fielder. +The empire made the only possible call. "You're out, boy!" he says +to Josh. "Yesterday, in Pitchburgh." + -- Satchel Paige +%% +We were so poor we couldn't afford a watchdog. +If we heard a noise at night, we'd bark ourselves. + -- Crazy Jimmy +%% +We who revel in nature's diversity and feel instructed by every animal +tend to brand Homo sapiens as the greatest catastrophe since the Cretaceous +extinction. + -- S.J. Gould +%% +We will follow Zarathustra, We will worship like the Druids, +Zarathustra like we use to, Dancing naked in the woods, +I'm a Zarathustra booster, Drinking strange fermented fluids, +And he's good enough for me! And it's good enough for me! +(chorus) (chorus) + +In the church of Aphrodite, +The priestess wears a see through nightie, +She's a mighty righteous sightie, +And she's good enough for me! +(chorus) + +CHORUS: Give me that old time religion, + Give me that old time religion, + Give me that old time religion, + 'Cause it's good enough for me! +%% +We will have solar energy as soon as the utility companies solve +one technical problem -- how to run a sunbeam through a meter. +%% +We wish you a Hare Krishna +We wish you a Hare Krishna +We wish you a Hare Krishna +And a Sun Myung Moon! + -- Maxwell Smart +%% +Wedding is destiny, and hanging likewise. + -- John Heywood +%% +Weed's Axiom: + Never ask two questions in a business letter. + The reply will discuss the one in which you are + least interested and say nothing about the other. +%% +Weekend, where are you? +%% +Weiler's Law: + Nothing is impossible to a person who doesn't have to do the work. +%% +Weinberg's First Law: + Progress is only made on alternate Fridays. +%% +Weinberg's Principle: + An expert is a person who avoids the small errors while sweeping + on to the grand fallacy. +%% +Weinberg's Second Law: + If builders built buildings the way programmers wrote programs, + then the first woodpecker that came along would destroy civilization. +%% +Weiner's Law of Libraries: + There are no answers, only cross references. +%% + "Welcome back for you 13th consecutive week, Evelyn. Evelyn, will +you go into the auto-suggestion booth and take your regular place on the +psycho-prompter couch?" + "Thank you, Red." + "Now, Evelyn, last week you went up to $40,000 by properly citing +your rivalry with your sibling as a compulsive sado-masochistic behavior +pattern which developed out of an early post-natal feeding problem." + "Yes, Red." + "But -- later, when asked about pre-adolescent oedipal phantasy +repressions, you rationalized twice and mental blocked three times. Now, +at $300 per rationalization and $500 per mental block you lost $2,100 off +your $40,000 leaving you with a total of $37,900. Now, any combination of +two more mental blocks and either one rationalization or three defensive +projections will put you out of the game. Are you willing to go ahead?" + "Yes, Red." + "I might say here that all of Evelyn's questions and answers have +been checked for accuracy with her analyst. Now, Evelyn, for $80,000 +explain the failure of your three marriages." + "Well, I--" + "We'll get back to Evelyn in one minute. First a word about our +product." +%% +Welcome back, my friends, to the show that never ends! +We're so glad you could attend, come inside, come inside! +There behind the glass there's a real blade of grass, +Be careful as you pass, move along, move along. +Come inside, the show's about to start, +Guaranteed to blow your head apart. +Rest assured, you'll get your money's worth, +Greatest show, in heaven, hell or earth! +You gotta see the show! It's a dynamo! +You gotta see the show! It's rock 'n' roll! + -- ELP, "Karn Evil 9" (1st Impression, Part 2) +%% +Welcome to Fortune Blackmail!! + Ms. Kat****** Bl****an is the mistress of a well-known + banker in Houston, Texas. That's $5000, please, to stop + us from revealing both of your names, Mr. L*****, so that + your wife Doreen, and your lovely children Diane, Janice + and Tom need never know the name of your mistress. You + have two days to reach us at: + + Fortune Blackmail + Behind the hot water pipes, + Third stall from the end, + Greyhound Bus Terminal, Fayette MO. +%% +Welcome to Fortune Blackmail!! + This is the first of a series of revelations which could + add up to a divorce, premature retirement and possible + criminal proceedings for a company vice-president in Langley Virginia. + So, Mr. S*****, $10,000 please to stop us from revealing: + 1: Whose shoulders you were sitting on. + 2: What you were doing. + 3: The names of the three people involved. + 4: The youth organization to which they belonged. + 5: The shop where you bought the equipment. +%% +Welcome to UNIX! Enjoy your session! Have a great time! Note the +use of exclamation points! They are a very effective method for +demonstrating excitement, and can also spice up an otherwise plain-looking +sentence! However, there are drawbacks! Too much unnecessary exclaiming +can lead to a reduction in the effect that an exclamation point has on +the reader! For example, the sentence + + Jane went to the store to buy bread + +should only be ended with an exclamation point if there is something +sensational about her going to the store, for example, if Jane is a +cocker spaniel or if Jane is on a diet that doesn't allow bread or if +Jane doesn't exist for some reason! See how easy it is?! Proper control +of exclamation points can add new meaning to your life! Call now to receive +my free pamphlet, "The Wonder and Mystery of the Exclamation Point!"! +Enclose fifteen(!) dollars for postage and handling! Operators are +standing by! (Which is pretty amazing, because they're all cocker spaniels!) +%% +Welcome to boggle - do you want instructions? + +D G G O + +O Y A N + +A D B T + +K I S P +Enter words: +> +%% +Welcome to the Zoo! +%% +Well, God gave me a bust. What am I supposed to do with it? + -- Martha Mitchell +%% +Well I looked at my watch and it said a quarter to five, +The headline screamed that I was still alive, +I couldn't understand it, I thought I died last night. +I dreamed I'd been in a border town, +In a little cantina that the boys had found, +I was desperate to dance, just to dig the local sounds. +When along came a senorita, +She looked so good that I had to meet her, +I was ready to approach her with my English charm, +When her brass knuckled boyfriend grabbed me by the arm, +And he said, grow some funk of your own, amigo, +Grow some funk of your own. +We no like to with the gringo fight, +But there might be a death in Mexico tonite. +... +Take my advice, take the next flight, +And grow some funk, grow your funk at home. + -- Elton John, "Grow Some Funk of Your Own" +%% +Well, Jim, I'm not much of an actor either. +%% +Well, actually, I don't mind going to weddings or anything, as long as they're +not my own, I show up, but uh, I've always kinda been partial to callin' myself +up on the phone, asking myself out, y'know, yeah, one thing about it, you're +always around. Yeah, I know, yeah, you ask yourself out, y'know, some class +joint somewhere, the Burrito King, or somethin', y'know, well, I ain't cheap +y'know. Take yourself out for a coupla drinks, mebbe, then you eat, some +provocative conversation on the way home, and uh, park in front of the house, +y'know, and you, oh yeah, you smoo with yourself, put a little nice music on, +mebbe you put on like, uh, y'know, like shoppin' music, something that's not +too interruptive, y'know, and then uh, y'know, slide over real nice, and say, +"Oh, I think you have something in your eye", well, maybe it's not that +romantic with you, but I don't, y'know, I get into it, y'know, I take myself +up to the porch, and uh, take myself inside, maybe, oh, I might get a little +something in a brandy snifter, "Would you like to listen to some of my back +records, I got something here...", well, usually, about two-thirty in the +morning, you've ended up takin' advantage of yourself, and there ain't no way +around that, y'know, yeah, makin' the scene with a magazine, ain't no way +around it. I'll confess, y'know, I'm no different, y'know, I'm not weird about +it or anything, I don't tie myself up first, I just, I just kinda spend a +little time with myself. + -- Tom Waits, "Nighthawks at the Diner" +%% +Well begun is half done. + -- Aristotle +%% +We'll cross that bridge when we come back to it later. +%% +Well, didja wake up grouchy or did you let her sleep? +%% +Well, fancy giving money to the Government! +Might as well have put it down the drain. +Fancy giving money to the Government! +Nobody will see the stuff again. +Well, they've no idea what money's for -- +Ten to one they'll start another war. +I've heard a lot of silly things, but, Lor'! +Fancy giving money to the Government! + -- A.P. Herbert +%% +We'll have solar energy when the power companies develop a sunbeam meter. +%% + Well, he thought, since neither Aristotilian Logic nor the disciplines +of Science seemed to offer much hope, it's time to go beyond them... + Drawing a few deep even breaths, he entered a mental state practiced +only by Masters of the Universal Way of Zen. In it his mind floated freely, +able to rummage at will among the bits and pieces of data he had absorbed, +undistracted by any outside disturbances. Logical structures no longer +inhibited him. Pre-conceptions, prejudices, ordinary human standards vanished. +All things, those previously trivial as well as those once thought important, +became absolutely equal by acquiring an absolute value, revealing relationships +not evident to ordinary vision. Like beads strung on a string of their own +meaning, each thing pointed to its own common ground of existence, shared by +all. Finally, each began to melt into each, staying itself while becoming +all others. And Mind no longer contemplated Problem, but became Problem, +destroying Subject-Object by becoming them. + Time passed, unheeded. + Eventually, there was a tentative stirring, then a decisive one, and +Nakamura arose, a smile on his face and the light of laughter in his eyes. + -- Wayfarer +%% + "Well, it's a little rough... it might not be necessary to drag him 40 +blocks. Maybe just four. You could put him in the trunk for the first 36 +blocks, then haul him out and drag him the last four; that would certainly +scare the piss out of him, bumping alone the street, feeling all his skin being +ripped off..." + "He'd be a bloody mess. They might think he was just some drunk and let +him lie there all night." + "Don't worry about that. They have a guard station in front of the +White House that's open 24 hours a day. The guards would recognize Colson... +and by that time of course his wife would have called the cops and reported +that a bunch of thugs had kidnapped him." + "Wouldn't it be a little kinder if you drove about four more blocks +and stopped at a phone box to ring the hospital and say, 'Would you mind going +around to the front of the White House? There's a naked man lying outside +in the street, bleeding to death...'" + "... and we think it's Mr. Colson." + "It would be quite a story for the newspapers, wouldn't it?" + "Yeah, I think it's safe to say we'd see some headlines on that one." + -- H. Thompson, talking to R. Steadman on C. Colson, + ex-Marine captain, now born again, of Watergate fame. +%% +Well, my daddy left home when I was three, +And he didn't leave much for Ma and me, +Just and old guitar an'a empty bottle of booze. +Now I don't blame him 'cause he ran and hid, +But the meanest thing that he ever did, +Was before he left he went and named me Sue. +... +But I made me a vow to the moon and the stars, +I'd search the honkey tonks and the bars, +And kill the man that give me that awful name. +It was Gatlinburg in mid-July, +I'd just hit town and my throat was dry, +Thought I'd stop and have myself a brew, +At an old saloon on a street of mud, +Sitting at a table, dealing stud, +Sat that dirty (bleep) that name me Sue. +... +Now, I knew that snake was my own sweet Dad, +From a wornout picture that my Mother had, +And I knew that scar on his cheek and his evil eye... + -- Johnny Cash, "A Boy Named Sue" +%% +Well, my terminal's locked up, and I ain't got any Mail, +And I can't recall the last time that my program didn't fail; +I've got stacks in my structs, I've got arrays in my queues, +I've got the : Segmentation violation -- Core dumped blues. + +If you think that it's nice that you get what you C, +Then go : illogical statement with your whole family, +'Cause the Supreme Court ain't the only place with : Bus error views. +I've got the : Segmentation violation -- Core dumped blues. + +On a PDP-11, life should be a breeze, +But with VAXen in the house even magnetic tapes would freeze. +Now you might think that unlike VAXen I'd know who I abuse, +I've got the : Segmentation violation -- Core dumped blues. + -- Core Dumped Blues +%% +We'll pivot at warp 2 and bring all tubes to bear, Mr. Sulu! +%% +Well thaaaaaaat's okay. +%% +Well, the handwriting is on the floor. + -- Joe E. Lewis +%% + Well, there was this tiger, who woke up one morning, and just felt +great (yes, just like Tony the Tiger: GREAAAAAAT). Anyway, he just felt so +good, he went out and cornered a small monkey and roared at him: "WHO IS THE +MIGHTIEST OF ALL THE JUNGLE ANIMALS?" + The poor, quaking, little monkey replied: "You are of course, no one +is mightier than you." + A little while later the tiger confronts a deer, and just bellows out: +"WHO IS THE GREATEST AND STRONGEST OF ALL THE JUNGLE ANIMALS?" + The deer is shaking so hard it can barely speak, but manages to +stammer: "Oh great tiger, you are by far the mightiest animal in the jungle." + The tiger, being on a roll, swaggered, up to an elephant that was +quietly munching on some weeds, and roared at the top of his voice: "WHO IS +THE MIGHTIEST OF ALL THE ANIMALS IN THE JUNGLE?" + Well, the elephant grabs the tiger with his trunk, picks him up, slams +him down; picks him up again, and shakes him until the tiger is just a blur of +orange and black; and finally throws him violently into a nearby tree. The +tiger staggers to his feet and looks at the elephant and whispers: "Man, you +don't have to get so pissed, just 'cause you don't know the answer." +%% +Well, we'll really have a party, +but we've gotta post a guard outside. + -- Eddie Cochran, "Come On Everybody" +%% +Well, we're big rock singers, +We've got golden fingers, +And we're loved everywhere we go. +We sing about beauty, and we sing about truth, +At ten thousand dollars a show. +We take all kinds of pills to give us all kinds of thrills, +But the thrill we've never known, +Is the thrill that'll get you, when you get your picture, +On the cover of the Rolling Stone. + -- Dr. Hook and the Medicine Show + [As a note, they eventually DID make the cover of RS. Ed.] +%% +Well, you got your mules and you got your racehorses, and you can kick +a mule in the ass all you want, and he's still not gonna be a racehorse. + -- Billy Martin, "Esquire", May, 1984 +%% +Well, you know, no matter where you go, there you are. + -- Buckaroo Banzai +%% +We're happy little Vegemites, + As bright as bright can be. +We all all enjoy our Vegemite + For breakfast, lunch and tea. +%% +Were it not for the presence of the unwashed and the half-educated, the +formless, queer and incomplete, the unreasonable and absurd, the infinite +shapes of the delightful human tadpole, the horizon would not wear so wide +a grin. + -- F.M. Colby, "Imaginary Obligations" +%% +We're living in a golden age. All you need is gold. + -- D.W. Robertson. +%% +"We're not talking about the same thing," he said. "For you the world is +weird because if you're not bored with it you're at odds with it. For me +the world is weird because it is stupendous, awesome, mysterious, +unfathomable; my interest has been to convince you that you must accept +responsibility for being here, in this marvelous world, in this marvelous +desert, in this marvelous time. I wanted to convince you that you must +learn to make every act count, since you are going to be here for only a +short while, in fact, too short for witnessing all the marvels of it." + -- Don Juan +%% +Wernher von Braun settled for a V-2 when he coulda had a V-8. +%% +Westheimer's Discovery: + A couple of months in the laboratory can + frequently save a couple of hours in the library. +%% +Wethern's Law: + Assumption is the mother of all screw-ups. +%% +We've tried each spinning space mote +And reckoned its true worth: +Take us back again to the homes of men +On the cool, green hills of Earth. + +The arching sky is calling +Spacemen back to their trade. +All hands! Standby! Free falling! +And the lights below us fade. +Out ride the sons of Terra, +Far drives the thundering jet, +Up leaps the race of Earthmen, +Out, far, and onward yet-- + +We pray for one last landing +On the globe that gave us birth; +Let us rest our eyes on the fleecy skies +And the cool, green hills of Earth. + -- Robert A. Heinlein, 1941 +%% +Wharbat darbid yarbou sarbay? +%% +What!? Me worry? + -- A.E. Newman +%% + What I Did During My Fall Semester +On the first day of my fall semester, I got up. +Then I went to the library to find a thesis topic. +Then I hung out in front of the Dover. + +On the second day of my fall semester, I got up. +Then I went to the library to find a thesis topic. +Then I hung out in front of the Dover. + +On the third day of my fall semester, I got up. +Then I went to the library to find a thesis topic. +I found a thesis topic: + How to keep people from hanging out in front of the Dover. + -- Sister Mary Elephant, + "Student Statement for Black Friday" +%% +What I mean (and everybody else means) by the word QUALITY cannot be +broken down into subjects and predicates. This is not because Quality +is so mysterious but because Quality is so simple, immediate, and direct. + -- R. Pirsig, "Zen and the Art of Motorcycle Maintenance" +%% +What I tell you three times is true. + -- Lewis Carroll +%% +What I want is all of the power and none of the responsibility. +%% +What a strange game. The only winning move is not to play. + -- WOP, "War Games" +%% +What, after all, is a halo? It's only one more thing to keep clean. + -- Christopher Fry +%% +What an artist dies with me! + -- Nero +%% +What awful irony is this? +We are as gods, but know it not. +%% +What causes the mysterious death of everyone? +%% +What did ya do with your burder and your cross? +Did you carry it yourself or did you cry? +You and I know that a burden and a cross, +Can only be carried on one man's back. + -- Louden Wainwright III +%% +What did you bring that book I didn't want +to be read to out of about Down Under up for? +%% +What did you do when the ship sank? +I grabbed a cake of soap and washed myself ashore. +%% +What do I consider a reasonable person to be? I'd say a reasonable person +is one who accepts that we are all human and therefore fallible, and takes +that into account when dealing with others. Implicit in this definition is +the belief that it is the right and the responsibility of each person to +live his or her own life as he or she sees fit, to respect this right in +others, and to demand the assumption of this responsibility by others. +%% + "What do you give a man who has everything?" the pretty teenager +asked her mother. + "Encouragement, dear," she replied. +%% +What does education often do? +It makes a straight cut ditch of a free meandering brook. + -- Henry David Thoreau +%% +What does it mean if there is no fortune for you? +%% +What does not destroy me, makes me stronger. + -- Nietzsche +%% +What ever happened to happily ever after? +%% +What excuses stand in your way? How can you eliminate them? + -- Roger von Oech +%% +What foods these morsels be! +%% +What fools these morals be! +%% +What fools these mortals be. + -- Lucius Annaeus Seneca +%% +What garlic is to salad, insanity is to art. +%% +What good is a ticket to the good life, +if you can't find the entrance? +%% +What good is having someone who can walk +on water if you don't follow in his footsteps? +%% +What good is it if you talk in flowers, and they think in pastry? + -- Ashleigh Brilliant +%% +What happened last night can happen again. +%% +What happens to a dream deferred? +Does it dry up +Like a raisin in the sun? +Or fester like a sore -- +And then run? +Does it stink like rotten meat? +Or crust and sugar over -- +Like a syrupy sweet? + +Maybe it just sags +Like a heavy load. + +Or does it explode? + -- Langston Hughes +%% +What happens when you cut back the jungle? It recedes. +%% +What has roots as nobody sees, +Is taller than trees, +Up, up it goes, +And yet never grows? +%% +What is a magician but a practising theorist? + -- Obi-Wan Kenobi +%% +What is food to one, is to others bitter poison. + -- Titus Lucretius Carus +%% +What is good? Everything that heightens the feeling of power in man, the +will to power, power itself. What is bad? Everything that is born of +weakness. Not contentedness but more power; not peace but war; not virtue +but fitness. The weak and the failures shall perish: first principle of +our love of man. And they shall even be given every possible assistance. +What is more harmful than any vice? Active pity for all the failures and +all the weak: Christianity. + -- Friedrich Nietzsche +%% + What is involved in such [close] relationships is a form of emotional +chemistry, so far unexplained by any school of psychiatry I am aware of, that +conditions nothing so simple as a choice between the poles of attraction and +repulsion. You can meet some people thirty, forty times down the years, and +they remain amiable bystanders, like the shore lights of towns that a sailor +passes at stated times but never calls at on the regular run. Conversely, +all considerations of sex aside, you can meet some other people once or twice +and they remain permanent influences on your life. + Everyone is aware of this discrepancy between the acquaintance seen +as familiar wallpaper or instant friend. The chemical action it entails is +less worth analyzing than enjoying. At any rate, these six pieces are about +men with whom I felt an immediate sympat - to use a coining of Max Beerbohm's +more satisfactory to me than the opaque vogue word "empathy". + -- Alistair Cooke, "Six Men" +%% +What is love but a second-hand emotion? + -- Tina Turner +%% +What is mind? No matter. +What is matter? Never mind. + -- Thomas Hewitt Key, 1799 - 1875 +%% +What is now proved was once only imagin'd. + -- William Blake +%% +What is research but a blind date with knowledge? + -- Will Harvey +%% +What is status? + Status is when the President calls you for your opinion. + +Uh, no... + Status is when the President calls you in to discuss a + problem with him. + +Uh, that still ain't right... + STATUS is when you're in the Oval Office talking to the President, + and the phone rings. The President picks it up, listens for a + minute, and hands it to you, saying, "It's for you." +%% +What is the difference between a Turing machine and the modern computer? +It's the same as that between Hillary's ascent of Everest and the +establishment of a Hilton on its peak. +%% +What is the sound of one hand clapping? +%% +What is wanted is not the will-to-believe, +but the wish to find out, which is exact opposite. + -- Bertrand Russell +%% +What is worth doing is worth the trouble of asking somebody to do it. +%% +What kind of sordid business are you on now? I mean, man, whither +goest thou? Whither goest thou, America, in thy shiny car in the night? + -- Jack Kerouac +%% +What makes the Universe so hard to comprehend +is that there's nothing to compare it with. +%% +What makes us so bitter against people who outwit us +is that they think themselves cleverer than we are. +%% +What makes you think graduate school +is supposed to be satisfying? + -- Erica Jong, "Fear of Flying" +%% +What most people want is all of the power but none of the responsibility. +%% +What no spouse of a writer can ever understand +is that a writer is working when he's staring out the window. +%% +What nonsense people talk about happy marriages! +A man can be happy with any woman so long as he doesn't love her. + -- Wilde +%% +What on earth would a man do with himself +if something did not stand in his way? + -- H.G. Wells +%% +What one believes to be true either is true or becomes true. + -- John Lilly +%% +What one fool can do, another can. + -- Ancient Simian Proverb +%% +What orators lack in depth they make up in length. +%% +What pains others pleasures me, +At home am I in Lisp or C; +There i couch in ecstasy, +'Til debugger's poke i flee, +Into kernel memory. +In system space, system space, there shall i fare-- +Inside of a VAX on a silicon square. +%% +What passes for woman's intuition +is often nothing more than man's transparency. +%% +What publishers are looking for these days isn't radical feminism. +It's corporate feminism -- a brand of feminism designed to sell books +and magazines, three-piece suits, airline tickets, Scotch, cigarettes +and, most important, corporate America's message, which runs: Yes, +women were discriminated against in the past, but that unfortunate +mistake has been remedied; now every woman can attain wealth, prestige +and power by dint of individual rather than collective effort. + -- Susan Gordon +%% +What sane person could live in this world and not be crazy? + -- U.K. LeGuin +%% +What scoundrel stole the cork from my lunch? + -- J.D. Farley +%% +What segment's this, that, laid to rest Why lies it here, on public disk +On FHA0, is sleeping? And why is it now unprotected? +What system file, lay here a while A bug in incant, made it thus. +While hackers around it were weeping? The problem has not been corrected. + +This, this is "acct.run," Mount, mount all your DECtapes now +Accounting file for everyone. And copy the file somehow, somehow. +Dump, dump it and type it out, Dump, dump it and type it out, +The file, the highseg of login. The file, the highseg of login. + -- to Greensleeves +%% +What sin has not been committed in the name of efficiency? +%% +What soon grows old? Gratitude. + -- Aristotle +%% +What, still alive at twenty-two, +A clean upstanding chap like you? +Sure, if your throat 'tis hard to slit, +Slit your girl's, and swing for it. +Like enough, you won't be glad, +When they come to hang you, lad: +But bacon's not the only thing +That's cured by hanging from a string. +So, when the spilt ink of the night +Spreads o'er the blotting pad of light, +Lads whose job is still to do +Shall whet their knives, and think of you. + -- Hugh Kingsmill +%% + "What the hell are you getting so upset about? I thought you +didn't believe in God". + "I don't," she sobbed, bursting violently into tears, "but the +God I don't believe in is a good God, a just God, a merciful God. He's +not the mean and stupid God you make Him out to be". + -- Joseph Heller +%% +What the hell, go ahead and put all your eggs in one basket. +%% +What the large print giveth, the small print taketh away. +%% +What the scientists have in their briefcases is terrifying. + -- Nikita Khruschev +%% +What this country needs is a dime that will buy a good five-cent bagel. +%% +What this country needs is a good five cent ANYTHING! +%% +What this country needs is a good five cent microcomputer. +%% +What this country needs is a good five-cent nickel. +%% +What time is it? +I don't know, it keeps changing. +%% +What upsets me is not that you lied to me, +but that from now on I can no longer believe you. + -- Nietzsche +%% + "What was the worst thing you've ever done?" + "I won't tell you that, but I'll tell you the worst thing that +ever happened to me... the most dreadful thing." + -- Peter Straub, "Ghost Story" +%% +What we cannot speak about we must pass over in silence. + -- Wittgenstein +%% +What we need is either less corruption, +or more chance to participate in it. +%% +What we wish, that we readily believe. + -- Demosthenes +%% +What will you do if all your problems aren't solved by the time you die? +%% +What you don't know won't help you much either. + -- D. Bennett +%% +What you see is from outside yourself, and may come, or not, but is beyond +your control. But your fear is yours, and yours alone, like your voice, or +your fingers, or your memory, and therefore yours to control. If you feel +powerless over your fear, you have not yet admitted that it is yours, to do +with as you will. + -- Marion Zimmer Bradley, "Stormqueen" +%% +Whatever became of Strange de Jim? Well, he found a substitute for +cocaine: "You cover Q-tips with sandpaper and ram them up your +nostrils as far as they will go. Then you sniff talcum powder while +shredding hundred dollar bills." + -- Herb Caen, as discovered in Marya Schrier's scrapbook +%% +Whatever became of eternal truth? +%% +Whatever happened to the good old days +when sex was dirty and the air was clean? +%% +Whatever is not nailed down is mine. +What I can pry loose is not nailed down. + -- Collis P. Huntingdon +%% +Whatever it is, I fear Greeks even when they bring gifts. + -- Publius Vergilius Maro (Virgil) +%% +Whatever occurs from love is always beyond good and evil. + -- Friedrich Nietzsche +%% +Whatever you do will be insignificant, +but it is very important that you do it. + -- Gandhi +%% +Whatever you say about pornography, sex is here to stay. +%% +Whatever you want to do, you have to do something else first. +%% +What's all this bru-ha-ha? +%% +What's done to children, they will do to society. +%% +What's so funny? +%% + "What's that thing?" + "Well, it's a highly technical, sensitive instrument we +use in computer repair. Being a layman, you probably can't grasp +exactly what it does. We call it a two-by-four." + -- "Shoe", Jeff MacNelly +%% +What's the ugliest part of your body? +What's the ugliest part of your body? +Some say your nose, +Some say your toes, +But I think it's your mind. + -- Frank Zappa, 1965 +%% +When Boy Scouts do it, it's intense. +%% +When God endowed human beings with brains, +He did not intend to guarantee them. +%% +When God saw how faulty was man He tried again and made woman. As to +why he then stopped there are two opinions. One of them is woman's. + -- DeGourmont +%% +When I grow up, I want to be an honest +lawyer so things like that can't happen. + -- Richard Nixon, as a boy, on the Teapot Dome scandal +%% +When I have one foot in the grave I will tell the truth about women. I +shall tell it, jump into my coffin, pull the lid over me, and say, "Do +what you like now." + -- Tolstoy +%% +When I said "we", officer, I was referring to +myself, the four young ladies, and, of course, the goat. +%% +When I say the magic word to all these people, they will vanish forever. +I will then say the magic words to you, and you, +too, will vanish -- never to be seen again. + -- Kurt Vonnegut Jr., "Between Time and Timbuktu" +%% +When I sell liquor, it's called bootlegging; when my patrons serve +it on silver trays on Lake Shore Drive, it's called hospitality. + -- Al Capone +%% +When I think about myself, Sixty years in these folks' world +I almost laugh myself to death, The child I works for calls me girl +My life has been one great big joke, I say "Yes ma'am" for working's sake. +A dance that's walked Too proud to bend +A song that's spoke, Too poor to break, +I laugh so hard I almost choke I laugh until my stomach ache, +When I think about myself. When I think about myself. + +My folks can make me split my side, +I laughed so hard I nearly died, +The tales they tell, sound just like lying, +They grow the fruit, +But eat the rind, +I laugh until I start to crying, +When I think about my folks. + -- Maya Angelou +%% +When I was 16, I thought there was no hope for my father. +By the time I was 20, he had made great improvement. +%% +When I was in college, there were a lot of four-letter words you couldn't +say in front of girls. Now you can say them. But you can't say "girls". +%% +When I was in school, I cheated on my metaphysics exam: +I looked within the soul of the boy sitting next to me. + -- Woody Allen +%% +When I was younger, I could remember anything, whether it had happened +or not; but my faculties are decaying now and soon I shall be so I cannot +remember any but the things that never happened. It is sad to go to +pieces like this but we all have to do it. + -- Mark Twain +%% +When I'm gone, boxing will be nothing again. The fans with the cigars and +the hats turned down'll be there, but no more housewives and little men in +the street and foreign presidents. It's goin' to be back to the fighter who +comes to town, smells a flower, visits a hospital, blows a horn and says +he's in shape. Old hat. I was the onliest boxer in history people asked +questions like a senator. + -- Muhammad Ali +%% +When I'm good, I'm great; but when I'm bad, I'm better. + -- Mae West +%% +When Marriage is Outlawed, +Only Outlaws will have Inlaws. +%% +When a fellow says, "It ain't the money but +the principle of the thing," it's the money. + -- Kim Hubbard +%% +When a girl can read the handwriting on +the wall, she may be in the wrong rest room. +%% +When a girl marries, she exchanges the attentions +of many men for the inattentions of one. + Helen Rowland +%% +When a lion meets another with a louder roar, +the first lion thinks the last a bore. + -- G.B. Shaw +%% +When a lot of remedies are suggested for +a disease, that means it can't be cured. + -- Chekhov, "The Cherry Orchard" +%% +When a man assumes a public trust, he +should consider himself as public property. + -- Thomas Jefferson +%% +When a man is tired of London, he is tired of life. + -- Samuel Johnson +%% +When a man knows he is to be hanged in a fortnight, +it concentrates his mind wonderfully. + -- Samuel Johnson +%% +When a man sits with a pretty girl for an hour, it seems like a minute. +But let him sit on a hot stove for a minute-- and it's longer than any +hour. That's relativity. + -- Albert Einstein +%% +When a person goes on a diet, the first thing he loses is his temper. +%% +When a place gets crowded enough to require ID's, social collapse is not +far away. It is time to go elsewhere. The best thing about space travel +is that it made it possible to go elsewhere. + -- R.A. Heinlein, "Time Enough For Love" +%% +When a shepherd goes to kill a wolf, and takes his dog along to see +the sport, he should take care to avoid mistakes. The dog has certain +relationships to the wolf the shepherd may have forgotten. + -- Robert Pirsig, "Zen and the Art of Motorcycle Maintenance" +%% +When a woman gives me a present I have always two surprises: +first is the present, and afterward, having to pay for it. + -- Donnay +%% +When a woman marries again it is because she detested her first husband. +When a man marries again, it is because he adored his first wife. + -- Wilde +%% +When all else fails, EAT!!! +%% +When all else fails, read the instructions. +%% +When all else fails, try Kate Smith. +%% +When all other means of communication fail, try words. +%% +When among apes, one must play the ape. +%% +When angry, count four; when very angry, swear. + -- Mark Twain +%% +When arguments fail, use a blackjack. + -- Ed "Spike" O'Donnell +%% +When choosing between evils, I always +like to take the one I've never tried before. + -- Mae West +%% +When democracy granted democratic methods to us in times of opposition, this +was bound to happen in a democratic system. However, we National Socialists +never asserted that we represented a democratic point of view, but we have +declared openly that we used the democratic methods only to gain power and +that, after assuming the power, we would deny to our adversaries without any +consideration the means which were granted to us in times of our opposition. + -- Josef Goebbels +%% +When does later become never? +%% +When he got in trouble in the ring, [Ali] imagined a door swung open and +inside he could see neon, orange, and green lights blinking, and bats +blowing trumpets and alligators blowing trombones, and he could hear snakes +screaming. Weird masks and actors' clothes hung on the wall, and if he +stepped across the sill and reached for them, he knew that he was committing +himself to destruction. + -- George Plimpton +%% +When in Rome, live in the Roman way. + -- St. Ambrose +%% +When in charge ponder, +When in doubt mumble, +When in trouble delegate. +%% +When in doubt, do it. It's much easier +to apologize than to get permission. + -- Grace Murray Hopper +%% +When in doubt, do what the President does -- guess. +%% +When in doubt, follow your heart. +%% +When in doubt, lead trump. +%% +When in trouble or in doubt, run in circles, scream and shout. +%% +When it comes to helping you, some people stop at nothing. +%% +When it is not necessary to make a decision, +it is necessary not to make a decision. +%% +When it's dark enough you can see the stars. + -- Ralph Waldo Emerson, +%% +When love is gone, there's always justice. +And when justice is gone, there's always force. +And when force is gone, there's always Mom. +Hi, Mom! + -- Laurie Anderson +%% +When more and more people are thrown out of work, unemployment results. + -- Calvin Coolidge +%% +When my freshman roommate at Cornell found out I was Jewish, she was, +at her request, moved to a different room. She told me she didn't +think she had ever seen a Jew before. My only response was to begin +wearing a small Star of David on a chain around my neck. I had not +become a more observing Jew; rather, discovering that the label of +Jew was offensive to others made me want to let people know who I +was and what I believed in. Similarly, after talking to these young +women -- one of whom told me that she didn't think she had ever met +a feminist -- I've taken to identifying myself as a feminist in the +most unlikely of situations. + -- Susan Bolotin, "Voices From the Post-Feminist Generation" +%% +When neither their poverty nor their honor is +touched, the majority of men live content. + -- Niccolo Machiavelli +%% +When nothing can possibly go wrong, it will. +%% +When one burns one's bridges, what a very nice fire it makes. + -- Dylan Thomas +%% +When one wants to get rid of an unsupportable pressure, one needs hashish. + -- Friedrich Nietzsche +%% +When our best friends are in trouble, there is +always something that is not wholly displeasing to us. + -- La Rochefoucauld +%% +When oxygen Tech played Hydrogen U. +The Game had just begun, when Hydrogen scored two fast points +And Oxygen still had none +Then Oxygen scored a single goal +And thus it did remain, At Hydrogen 2 and Oxygen 1 +Called because of rain. +%% +When people have trouble communicating, +the least they can do is to shut up. + -- Tom Lehrer +%% +When people say nothing, they don't necessarily mean nothing. +%% +When pleasure remains, does it remain a pleasure? +%% +When some people decide it's time for everyone to make +big changes, it means that they want you to change first. +%% +When some people discover the truth, they just +can't understand why everybody isn't eager to hear it. +%% +When someone makes a move We'll send them all we've got, +Of which we don't approve, John Wayne and Randolph Scott, +Who is it that always intervenes? Remember those exciting fighting scenes? +U.N. and O.A.S., To the shores of Tripoli, +They have their place, I guess, But not to Mississippoli, +But first, send the Marines! What do we do? We send the Marines! + +For might makes right, Members of the corps +And till they've seen the light, All hate the thought of war: +They've got to be protected, They'd rather kill them off by + peaceful means. +All their rights respected, Stop calling it aggression-- +Till somebody we like can be elected. We hate that expression! + We only want the world to know + That we support the status quo; + They love us everywhere we go, + So when in doubt, send the Marines! + -- Tom Lehrer, "Send The Marines" +%% +When someone says "I want a programming language in +which I need only say what I wish done," give him a lollipop. +%% +When speculation has done its worst, two plus two still equals four. + -- S. Johnson +%% +When taxes are due, Americans tend to feel quite bled-white and blue. +%% +When the English language gets in my way, I walk over it. + -- Billy Sunday +%% +When the Universe was not so out of whack as it is today, and all the +stars were lined up in their proper places, you could easily count them +from left to right, or top to bottom, and the larger and bluer ones were +set apart, and the smaller yellowing types pushed off to the corners as +bodies of a lower grade... + -- Stanislaw Lem +%% +When the blind lead the blind they will both fall over the cliff. + -- Chinese proverb +%% +When the candles are out all women are fair. + -- Plutarch +%% +When the cup is full, carry it level. +%% +When the going gets tough, everyone leaves. + -- Lynch +%% +When the going gets tough, the tough go grab a beer. +%% +When the going gets tough, the tough go shopping. +%% +When the going gets weird, the weird turn pro. + -- Hunter S. Thompson +%% +When the government bureau's remedies do not match +your problem, you modify the problem, not the remedy. +%% +When the lights are out, all women are fair. + -- Plutarch +%% + When the lodge meeting broke up, Meyer confided to a friend. +"Abe, I'm in a terrible pickle! I'm strapped for cash and I haven't +the slightest idea where I'm going to get it from!" + "I'm glad to hear that," answered Abe. "I was afraid you +might have some idea that you could borrow from me!" +%% +When the only tool you have is a hammer, +every problem starts to look like a nail. +%% +When the revolution comes, count your change. +%% +When the sun shineth, make hay. + -- John Heywood +%% +When the wind is great, bow before it; +when the wind is heavy, yield to it. +%% +When there is an old maid in the house, a watch dog is unnecessary. + -- Balzac +%% +When they tell me to stick it where +the sun don't shine, I put it in Oregon. +%% +When things go well, expect something to +explode, erode, collapse or just disappear. +%% +When two people are under the influence of the most violent, most insane, +most delusive, and most transient of passions, they are required to swear +that they will remain in that excited, abnormal, and exhausting condition +continuously until death do them part. + -- George Bernard Shaw +%% +When we are planning for posterity, +we ought to remember that virtue is not hereditary. + -- Thomas Paine +%% +When we talk of tomorrow, the gods laugh. +%% +When we understand knowledge-based systems, it will be +as before -- except our finger-tips will have been singed. +%% +When we write programs that "learn", +it turns out we do and they don't. +%% +When women love us, they forgive us everything, even our crimes; +when they do not love us, they give us credit for nothing, not +even our virtues. + -- Balzac +%% +When you are at Rome live in the Roman style; +when you are elsewhere live as they live elsewhere. + -- St. Ambrose +%% +When you are in it up to your ears, keep your mouth shut. +%% +When you are working hard, get up and retch every so often. +%% +When you become used to never being alone, +you may consider yourself Americanized. +%% +When you dial a wrong number you never get a busy signal. +%% +When you dig another out of trouble, +you've got a place to bury your own. +%% +When you do not know what you are doing, do it neatly. +%% +When you go out to buy, don't show your silver. +%% +When you have eliminated the impossible, whatever +remains, however improbable, must be the truth. + -- Sherlock Holmes, "The Sign of Four" +%% +When you have shot and killed a man you have in some measure +clarified your attitude toward him. You have given a definite +answer to a definite problem. For better or worse you have +acted decisively. In a way, the next move is up to him. + -- R.A. Lafferty +%% +When you jump for joy, beware that no one +moves the ground from beneath your feet. + -- Stanislaw Lem +%% +When you live in a sick society, +just about everything you do is wrong. +%% +When you make your mark in the world, +watch out for guys with erasers. + -- The Wall Street Journal +%% +When you say that you agree to a thing in principle you mean that +you have not the slightest intention of carrying it out in practice. + -- Bismarck +%% +When you speak to others for their own good it's advice; +when they speak to you for your own good it's interference. +%% +When you try to make an impression, the +chances are that is the impression you will make. +%% + "When you wake up in the morning, Pooh," said Piglet at last, +"what's the first thing you say to yourself?" + "What's for breakfast?" said Pooh. "What do you say, Piglet?" + "I say, I wonder what's going to happen exciting today?" said +Piglet. + Pooh nodded thoughtfully. "It's the same thing," he said. +%% +When your conscious becomes unconscious, you are drunk. +When your unconscious becomes conscious, you are stoned. +%% +When your life is a leaf that the seasons tear off and condemn +They will bind you with love that is graceful and green as a stem. + -- Leonard Cohen, "Sisters of Mercy" +%% +When your memory goes, forget it! +%% +When your work speaks for itself, don't interrupt. + -- Henry J. Kaiser +%% +When you're away, I'm restless, lonely, +Wretched, bored, dejected; only +Here's the rub, my darling dear +I feel the same when you are near. + -- Samuel Hoffenstein, "When You're Away" +%% +When you were born, a big chance was taken for you. +%% +When you're dining out and you suspect +something's wrong, you're probably right. +%% +When you're down and out, lift up your +voice and shout, "I'M DOWN AND OUT"! +%% +When you're in command, command. + -- Admiral Nimitz +%% +When you're not looking at it, this fortune is written in FORTRAN. +%% +When you're ready to give up the struggle, who can you surrender to? +%% +When you've seen one nuclear war, you've seen them all. +%% +Whenever I feel like exercise, I lie down until the feeling passes. +%% +Whenever I hear anyone arguing for slavery, I feel +a strong impulse to see it tried on him personally. + -- A. Lincoln +%% +Whenever Richard Cory went downtown, + We people on the pavement looked at him: +He was a gentleman from sole to crown, + Clean-favored, and imperially slim. +And he was always quietly arrayed, + And he was always human when he talked; +But still he fluttered pulses when he said, + "Good morning," and he glittered when he walked. +And he was rich -- yes, richer than a king -- + And admirably schooled in every grace: +In fine, we thought that he was everything + To make us wish that we were in his place. +So on we worked, and waited for the light, + And went without the meat, and cursed the bread; +And Richard Cory, one calm summer night, + Went home and put a bullet through his head. + -- E.A. Robinson, "Richard Cory" +%% +Whenever a system becomes completely defined, +some damn fool discovers something which either +abolishes the system or expands it beyond recognition. +%% +Whenever anyone says, "theoretically," they really mean, "not really". + -- Dave Parnas +%% +Whenever people agree with me I always feel I must be wrong. + -- Oscar Wilde +%% +Whenever the literary German dives into a sentence, that +is the last you are going to see of him until he emerges +on the other side of his Atlantic with his verb in his mouth. + -- Mark Twain +%% +Whenever you find that you are on the +side of the majority, it is time to reform. + -- Mark Twain +%% +Where am I? Who am I? Am I? I +%% +Where humor is concerned there are no standards -- no one can say what +is good or bad, although you can be sure that everyone will. + -- John Kenneth Galbraith +%% +Where is John Carson now that we need him? + -- RLG +%% +Where, oh where, are you tonight? +Why did you leave me here all alone? +I searched the world over, +And I thought I'd found true love, +You met another and [Bronx cheer] you were gone! + -- Hee Haw +%% +Where the hell is Wall Drug? +%% +Where the system is concerned, you're not allowed to ask "Why?". +%% +Where there are visible vapors, having their prevenance +in ignited carbonaceous materials, there is conflagration. +%% +Where there is much light there is also much shadow. + -- Goethe +%% +Where there's a whip there's a way. +%% +Where there's a will, there's a relative. +%% +Where there's a will, there's an Inheritance Tax. +%% +Where will it all end? +Probably somewhere near where it all began. +%% +Where you stand depends on where you sit. + -- Rufus Miles, HEW +%% +Whereof one cannot speak, thereof one must be silent. + -- Wittgenstein +%% +Whether weary or unweary, O man, do not rest, +Do not cease your single-handed struggle. +Go on, do not rest. + -- An old Gujarati hymn +%% +Whether you can hear it or not, +The Universe is laughing behind your back. +%% +Which would you rather have, a bursting +planet or an earthquake here and there? + -- John Joseph Lynch +%% +While Europe's eye is fix'd on mighty things, +The fate of empires and the fall of kings; +While quacks of State must each produce his plan, +And even children lisp the Rights of Man; +Amid this mighty fuss just let me mention, +The Rights of Woman merit some attention. + -- Robert Burns, + Address on "The Rights of Woman", November 26, 1792 +%% +While anyone can admit to themselves they were +wrong, the true test is admission to someone else. +%% + While hunting, a man saw a beautiful nude woman come running out of +the woods and disappear across the clearing. Just as she got out of sight, +three men dressed in white uniforms came running out of the same woods. +"Hey, you," yelled one of them, "did you see a woman come by here?" + "Yes," replied the hunter. "What's the trouble?" + "She's an inmate of the county asylum, and gets loose every now and +then. We're trying to catch her." + "I can understand that," said the hunter, "But why is one of you +carrying a bucket of sand?" + "That's his handicap," said the spokesman, "he caught her last time." +%% +While money can't buy happiness, it certainly +lets you choose your own form of misery. +%% +While money doesn't buy love, it puts you in a great bargaining position. +%% +While most peoples' opinions change, +the conviction of their correctness never does. +%% +While there's life, there's hope. + -- Publius Terentius Afer (Terence) +%% +While walking down a crowded +City street the other day, +I heard a little urchin +To a comrade turn and say, +"Say, Chimmey, lemme tell youse, +I'd be happy as a clam +If only I was de feller dat +Me mudder t'inks I am. + +"She t'inks I am a wonder, My friends, be yours a life of toil +An' she knows her little lad Or undiluted joy, +Could never mix wit' nuttin' You can learn a wholesome lesson +Dat was ugly, mean or bad. From that small, untutored boy. +Oh, lot o' times I sit and t'ink Don't aim to be an earthly saint +How nice, 'twould be, gee whiz! With eyes fixed on a star: +If a feller was de feller Just try to be the fellow that +Dat his mudder t'inks he is." Your mother thinks you are. + -- Will S. Adkin, "If I Only Was the Fellow" +%% +While we are sleeping, two-thirds of the world is plotting to do us in. + -- Dean Rusk +%% +While you don't greatly need the outside world, it's +still very reassuring to know that it's still there. +%% +While you recently had your problems on the run, +they've regrouped and are making another attack. +%% +While your friend holds you affectionately by both +your hands you are safe, for you can watch both of his. +%% +Whip it, baby. +Whip it right. +Whip it, baby. +Whip it all night! +%% +Whip it, whip it good! +%% +Whistler's Law: + You never know who is right, but you always know who is in charge. +%% +Whistler's mother is off her rocker. +%% +White House carpenters have reworked the master bedroom, remodeling it +so that Ronnie can sleep with his head in the hall. That way, by the +time he wakes up, somebody will have already shined his hair. +%% +White dwarf seeks red giant for binary relationship. +%% +Whitehead's Law: + The obvious answer is always overlooked. +%% +White's Statement: + Don't lose heart! + +Owen's Commentary on White's Statement: + ...they might want to cut it out... + +Byrd's Addition to Owen's Commentary: + ...and they want to avoid a lengthy search. +%% +Who are you? +%% +Who can take the demands of the SDS seriously? + -- Nathan Pusey +%% +Who cares if it doesn't do anything? It was made with +our new Triple-Iso-Bifurcated-Krypton-Gate-MOS process... +%% +Who dat who say "who dat" when I say "who dat"? + -- Hattie McDaniel +%% +Who does not love wine, women, and song, +Remains a fool his whole life long. + -- Johann Heinrich Voss +%% +Who does not trust enough will not be trusted. + -- Lao Tsu +%% +Who goeth a-borrowing goeth a-sorrowing. + -- Thomas Tusser +%% +Who is D.B. Cooper, and where is he now? +%% +Who is John Galt? +%% +Who is W.O. Baker, and why is he saying those terrible things about me? +%% +Who made the world I cannot tell; +'Tis made, and here am I in hell. +My hand, though now my knuckles bleed, +I never soiled with such a deed. + -- A.E. Housman +%% +Who needs companionship when you +can sit alone in your room and drink? +%% +Who on earth would eat a charred caterpillar!? +No, no, you SINGE 'em! You SINGE 'em and eat 'em! +%% +Who to himself is law no law doth need, +offends no law, and is a king indeed. + -- George Chapman +%% +Who took the MMMMMM out of MURINE? +%% +Who was that masked man? +%% +Who will take care of the world after you're gone? +%% +Whoever dies with the most toys wins. +%% +Whoever fights monsters should see to it that in the process he does not +become a monster. And when you look into an abyss, the abyss also looks +into you. + -- Friedrich Nietzsche +%% +Whoever would lie usefully should lie seldom. +%% +Whom computers would destroy, they must first drive insane. +%% +Who's on first? +%% +Who's scruffy-looking? + -- Han Solo +%% +Why I Can't Go Out With You: + +I'd LOVE to, but... + -- I have to floss my cat. + -- I've dedicated my life to linguini. + -- I need to spend more time with my blender. + -- it wouldn't be fair to the other Beautiful People. + -- it's my night to pet the dog/ferret/goldfish. + -- I'm going downtown to try on some gloves. + -- I have to check the freshness dates on my dairy products. + -- I'm going down to the bakery to watch the buns rise. + -- I have an appointment with a cuticle specialist. + -- I have some really hard words to look up. + -- I've got a Friends of the Lowly Rutabaga meeting. + -- I promised to help a friend fold road maps. +%% +Why a man would want a wife is a big mystery to some people. +Why a man would want *two* wives is a bigamystery. +%% + Why are you doing this to me? + Because knowledge is torture, and there must be +awareness before there is change. + -- Jim Starlin, "Captain Marvel", #29 +%% +Why are you so hard to ignore? +%% +Why are you watching +The washing machine? +I love entertainment +So long as it's clean. + +Professor Doberman: + While the preceding poem is unarguably a change from the guarded +pessimism of "The Hound of Heaven," it cannot be regarded as an unqualified +improvement. Obscurity is of value only when it tends to clarify the poetic +experience. As much as one is compelled to admire the poem's technique, one +must question whether its byplay of complex literary allusions does not in +fact distract from the unity of the whole. In the final analysis, one +receives the distinct impression that the poem's length could safely have +been reduced by a factor of eight or ten without sacrificing any of its +meaning. It is to be hoped that further publication of this poem can be +suspended pending a thorough investigation of its potential subversive +implications. +%% +Why be a man when you can be a success? + -- Bertolt Brecht +%% +Why be difficult when, with a bit of effort, you could be impossible? +%% +Why did the Lord give us so much quickness of +movement unless it was to avoid responsibility with? +%% +Why did the Roman Empire collapse? +What's the Latin for office automation? +%% +Why do so many foods come packaged in plastic? +It's quite uncanny. +%% +Why do they call a fast a fast, when it goes so slow? +%% +Why do we want intelligent terminals +when there are so many stupid users? +%% +Why does a hearse horse snicker, hauling a lawyer away? + -- Carl Sandburg +%% +Why doesn't everybody leave everybody else the hell alone? + -- Jimmy Durante +%% +Why don't you fix your little problem... and light this candle? + -- Alan Shepherd, the first man into space, Gemini program +%% +Why, every one as they like; as the +good woman said when she kissed her cow. + -- Rabelais +%% +Why is it taking so long for her to bring out all the good in you? +%% +Why is it that there are so many more +horses' asses than there are horses? + -- G. Gordon Liddy +%% +Why is it that we rejoice at a birth and grieve at a funeral? +It is because we are not the person involved. + -- Mark Twain +%% +Why isn't there a special name for the tops of your feet? + -- Lily Tomlin +%% +Why isn't there some cheap and easy +way to prove how much she means to me? +%% +Why not go out on a limb? +Isn't that where the fruit is? +%% +Why was I born with such contemporaries? + -- Oscar Wilde +%% +Why would anyone want to be called "Later"? +%% +Wiker's Law: + Government expands to absorb all + available revenue and then some. +%% +Wilcox's Law: + A pat on the back is only a few + centimeters from a kick in the pants. +%% +Will Rogers never met you. +%% +Will you loan me $20.00 and only give me ten of it? +That way, you will owe me ten, and I'll owe you ten, and we'll be even! +%% +William Safire's Rules for Writers: + Remember to never split an infinitive. The passive voice +should never be used. Do not put statements in the negative form. +Verbs have to agree with their subjects. Proofread carefully to see if +you words out. If you reread your work, you can find on rereading a +great deal of repetition can be avoided by rereading and editing. A +writer must not shift your point of view. And don't start a sentence +with a conjunction. (Remember, too, a preposition is a terrible word +to end a sentence with.) Don't overuse exclamation marks!! Place +pronouns as close as possible, especially in long sentences, as of 10 +or more words, to their antecedents. Writing carefully, dangling +participles must be avoided. If any word is improper at the end of a +sentence, a linking verb is. Take the bull by the hand and avoid +mixing metaphors. Avoid trendy locutions that sound flaky. Everyone +should be careful to use a singular pronoun with singular nouns in +their writing. Always pick on the correct idiom. The adverb always +follows the verb. Last but not least, avoid cliches like the plague; +seek viable alternatives. +%% +Williams and Holland's Law: + If enough data is collected, + anything may be proven by statistical methods. +%% +Willie, looking in the mirror, Willie with the nursery shears +Sucked the mercury off Cut off both the baby's ears. +Thinking in his childish error To the baby so unsightly +It would cure the whooping cough. Mother raised her eyebrows slightly. + +At the funeral his weeping mother In the family drinking well +Sadly said to Mrs. Brown, Willie pushed his sister, Nell. +"'Twas a chilly day for Willie She's there still because it killed her, +When the mercury went down." Now, we have to buy a filter. +%% +Winning isn't everything, but losing isn't anything. +%% +Winter is the season in which people try to keep the house +as warm as it was in the summer, when they complained about the heat. +%% +[Wisdom] is a tree of life to those laying +hold of her, making happy each one holding her fast. + -- Proverbs 3:18, NSV +%% +Wisdom is knowing what to do with what you know. + -- J. Winter Smith +%% +Wisdom is rarely found on the best-seller list. +%% +Wishing without work is like fishing without bait. + -- Frank Tyger +%% +With Congress, every time they make a joke it's a law; +and every time they make a law it's a joke. + -- W. Rogers +%% +With a bushel of apples, you can have +a hell of a time with the doctor's wife. +%% +With a rubber duck, one's never alone. +%% +With all the fancy scientists in the world, +why can't they just once build a nuclear balm. +%% +With all the talent around, it's sort of +amazing that a woman could be up here with us. + -- Ralph Kiner, on introducing an award winner +%% +With clothes the new are best, with friends the old are best. +%% +With every passing hour our solar system comes forty-three thousand +miles closer to globular cluster M13 in the constellation Hercules, +and still there are some misfits who continue to insist that there +is no such thing as progress. + -- Ransom K. Ferm +%% +With her body, woman is more sincere than man; but with her mind +she lies. And when she lies, she does not believe herself. + -- Tolstoy +%% +With listening comes wisdom, with speaking repentance. +%% +With reasonable men I will reason; +with humane men I will plead; +but to tyrants I will give no quarter. + -- William Lloyd Garrison +%% +With stupidity the gods themselves struggle in vain. + -- Friedrich von Schiller +%% +With/Without - and who'll deny it's what the fighting's all about? + -- Pink Floyd +%% +Within a computer, natural language is unnatural. +%% +Within a month [in 1969] I had met the first of a small but not uninfluential +community of people who violently opposed SALT for a simple reason: It might +keep America from developing a first-strike capability against the Soviet +Union. I'll never forget being lectured by an Air Force colonel about how +we should have "nuked" the Soviets in late 1940s before they got The Bomb. +I was told that if SALT would go away, we'd soon have the capability to nuke +them again -- and this time we'd use it. + -- Roger Molander, former nuclear strategist for the + White House's National Security Council, Washington + Post, 21 March, 1982 +%% +Without adventure, civilization is in full decay. + -- Alfred North Whitehead +%% +Without fools there would be no wisdom. +%% +Without life, Biology itself would be impossible. +%% +Without love intelligence is dangerous; +without intelligence love is not enough. + -- Ashley Montagu +%% +Woke up this mornin' an' I had myself a beer, +Yeah, Ah woke up this mornin' an' I had myself a beer +The future's uncertain and the end is always near. + -- Jim Morrison, "Roadhouse Blues" +%% +Woke up this morning, don't believe what I saw. Hundred billion +bottles washed up on the shore. Seems I never noted being alone. +Hundred billion castaways looking for a call. +%% +Woman is generally so bad that the difference +between a good and a bad woman scarcely exists. + -- Tolstoy +%% +Woman on Street: Sir, you are drunk; very, very drunk. +Winston Churchill: Madame, you are ugly; very, very ugly. + I shall be sober in the morning. +%% +Woman was God's second mistake. + -- Nietzsche +%% +Woman was taken out of man -- not out of his head, to rule over him; nor +out of his feet, to be trampled under by him; but out of his side, to be +equal to him -- under his arm, that he might protect her, and near his heart +that he might love her. + -- Henry +%% +Woman would be more charming if one could +fall into her arms without falling into her hands. + -- DeGourmont +%% +Woman's advice has little value, but he who won't take it is a fool. + -- Cervantes +%% +Women are a problem, but if you haven't already guessed, +they're the kind of problem I enjoy wrestling with. + -- Warren Beatty +%% +Women are all alike. When they're maids they're mild as milk: +once make 'em wives, and they lean their backs against their +marriage certificates, and defy you. + -- Jerrold +%% +Women are always so eager to urge bachelors into matrimony: +is it from charity or revenge? + -- Scott +%% +Women are just like men, only different. +%% +Women are like elephants to me: I like to +look at them, but I wouldn't want to own one. + -- W.C. Fields +%% +Women are not much, but they are the best other sex we have. + -- Herold +%% +Women are nothing but machines for producing children. + -- Napoleon +%% +Women are wiser than men because they know less and understand more. + -- Stephens +%% +Women can keep a secret just as well as men, +but it takes more of them to do it. +%% +Women give themselves to God when the +Devil wants nothing more to do with them. + -- Arnould +%% +Women give to men the very gold of their lives. Possibly; +but they invariably want it back in such very small change. + -- Wilde +%% +Women in love consist of a little sighing, a little +crying, a little dying -- and a good deal of lying. + -- Ansey +%% +Women of genius commonly have masculine faces, figures and manners. +In transplanting brains to an alien soil God leaves a little of the +original earth clinging to the roots. + -- Bierce +%% +Women reason with the heart and are much less often wrong +than men who reason with the head. + -- DeLescure +%% +Women sometimes forgive a man who forces the opportunity, +but never a man who misses one. + -- Charles De Talleyrand-Perigord +%% +Women treat us just as humanity treats its gods. They worship +us and are always bothering us to do something for them. + -- Wilde +%% +Women waste men's lives and think they have +indemnified them by a few gracious words. + -- Balzac +%% +Women, when they are not in love, have all +the cold blood of an experienced attorney. + -- Balzac +%% +Women, when they have made a sheep of a man, +always tell him that he is a lion with a will of iron. + -- Balzac +%% +Women who desire to be like men, lack ambition. +%% +Women wish to be loved without a why or a wherefore; +not because they are pretty, or good, or well-bred, or +graceful, or intelligent, but because they are themselves. + -- Amiel +%% +Women's Libbers are OK, I just wouldn't want my sister to marry one. +%% +Women's virtue is man's greatest invention. + -- Cornelia Otis Skinner +%% +Wonder is the feeling of a philosopher, +and philosophy begins in wonder. + Socrates, quoting Plato +%% +Wonderful day. +Your hangover just makes it seem terrible. +%% +Woodward's Law: + A theory is better than its explanation. +%% +Woolsey-Swanson Rule: + People would rather live with a problem they cannot + solve rather than accept a solution they cannot understand. +%% +Words are the voice of the heart. +%% +Words can never express what words can never express. +%% +Words have a longer life than deeds. + -- Pindar +%% +Words must be weighed, not counted. +%% +Work consists of whatever a body is obliged to do. +Play consists of whatever a body is not obliged to do. + -- Mark Twain +%% +Work continues in this area. + -- DEC's SPR-Answering-Automaton +%% +Work expands so as to fill the time available for its completion. + -- C. Northcote Parkinson +%% +Work is the crab grass in the lawn of life. + -- Schulz +%% +Work is the curse of the drinking classes. +%% +Work smarter, not harder, and be careful of your speling. +%% +Work without a vision is slavery, +Vision without work is a pipe dream, +But vision with work is the hope of the world. +%% +World tensions have, if anything, increased in the quarter century +since H.G. Wells uttered his glum warning: "There is no more evil +thing on earth than race prejudice, none at all. I write deliberately +-- it is the worst single thing in life now. It justifies and holds +together more baseness, cruelty and abomination than any other sort of +error in the world." + -- Sydney Harris +%% +Worrying is like rocking in a rocking chair-- +It gives you something to do, but it doesn't get you anywhere. +%% +Worst Month of 1981 for Downhill Skiing: August. + +The lift lines are the shortest, though. +%% +Worst Month of the Year: February. + +February has only 28 days in it, which means that if you rent an +apartment, you are paying for three full days you don't get. Try to +avoid Februarys whenever possible. +%% +Worst Vegetable of the Year: Brussel sprout. + +This is also the worst vegetable of next year. +%% +Worth seeing? +Yes, but not worth going to see. +%% +Would it help if I got out and pushed? + -- Princess Leia Organa +%% +Would that my hand were as swift as my tongue. + -- Alfieri +%% +Would the last person to leave Michigan please turn out the lights? +%% +Would ye both eat your cake and have your cake? + -- John Heywood +%% +Would you care to drift aimlessly in my direction? +%% +Would you people stop playing these stupid games?!?!?!!!! +%% +"Would you tell me, please, which way I ought to go from here?" +"That depends a good deal on where you want to get to," said the Cat. + -- Lewis Carrol +%% +Wrinkles should merely indicate where smiles have been. + -- Mark Twain +%% +Write yourself a threatening letter and pen a defiant reply. +%% +Writing free verse is like playing tennis with the net down. +%% +Writing software is more fun than working. +%% +XEROX never does anything original. +%% +Xerox does it again and again and again and... +%% +Xerox never comes up with anything original. +%% +X-rated movies are all alike -- the only thing +they leave to the imagination is the plot. +%% +YEAR: + A period of three hundred and sixty-five disappointments. +%% +YO-YO: + Something that is occasionally up but normally down. + (see also Computer). +%% +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. + -- Stephen C. Johnson, "Yacc guide acknowledgements" +%% +Yawd [noun, Bostonese]: the campus of Have Id. + -- Webster's Unafraid Dictionary +%% +Yea from the table of my memory +I'll wipe away all trivial fond records. + -- Hamlet +%% +Yeah, God is dead, he laughed himself to death. +%% +Q: What do you call a dog with no legs? +A: What does it matter? He can't come anyway. + + [I got a dog with no legs -- I call him Cigarette. + Every night, I take him out for a drag. Ed.] +%% +Yeah, there are more important things in life than money, +but they won't go out with you if you don't have any. +%% +Yes, but every time I try to see things your way, I get a headache. +%% +Yes, but which self do you want to be? +%% + "Yes, let's consider," said Bruno, putting his thumb into his +mouth again, and sitting down upon a dead mouse. + "What do you keep that mouse for?" I said. "You should either +bury it or else throw it into the brook." + "Why, it's to measure with!" cried Bruno. "How ever would you +do a garden without one? We make each bed three mouses and a half +long, and two mouses wide." + I stopped him as he was dragging it off by the tail to show me +how it was used... + -- Lewis Carroll, "Sylvie and Bruno" +%% +Yesterday I was a dog. Today I'm a dog. +Tomorrow I'll probably still be a dog. +Sigh! There's so little hope for advancement. + -- Snoopy +%% +Yet creeds mean very little, Coth answered the dark god, still speaking +almost gently. The optimist proclaims that we live in the best of all +possible worlds; and the pessimist fears this is true. + -- J.B. Cabell, "The Silver Stallion" +%% +Yield to temptation; it may not pass your way again. +%% +You ain't learning nothing when you're talking. +%% +You always have the option of pitching baseballs at empty +spray paint cans in a cul-de-sac in a Cleveland suburb. +%% +You are a bundle of energy, always on the go. +%% +You are a fluke of the universe; you have no right to be here. +%% +You are a taxi driver. Your cab is yellow and black, and has been in +use for only seven years. One of its windshield wipers is broken, and +the carburetor needs adjusting. The tank holds 20 gallons, but at the +moment is only three-quarters full. How old is the taxi driver?" +%% +You are a wish to be here wishing yourself. + -- Philip Whalen +%% +You are always busy. +%% +You are an insult to my intelligence! +I demand that you log off immediately. +%% +You are capable of planning your future. +%% +You are confused; but this is your normal state. +%% +You are deeply attached to your friends and acquaintances. +%% +You are destined to become the commandant of the +fighting men of the department of transportation. +%% +You are dishonest, but never to the point of hurting a friend. +%% +You are fairminded, just and loving. +%% +You are false data. +%% +You are farsighted, a good planner, +an ardent lover, and a faithful friend. +%% +You are fighting for survival in your own sweet and gentle way. +%% +You are going to have a new love affair. +%% +You are in a maze of little twisting passages, all alike. +%% +You are in a maze of little twisting passages, all different. +%% +You are in the hall of the mountain king. +%% +You are lost in the Swamps of Despair. +%% +You are loved by the multitudes. +Have you been to the clinic lately? +%% +You are magnetic in your bearing. +%% +You are never given a wish without also being given the +power to make it true. You may have to work for it, however. + -- R. Bach, "Messiah's Handbook : Reminders for + the Advanced Soul" +%% +You are not a fool just because you have done +something foolish -- only if the folly of it escapes you. +%% +You are not dead yet. +But watch for further reports. +%% +You are not permitted to kill a woman who has wronged you, but nothing +forbids you to reflect that she is growing older every minute. You are +avenged fourteen hundred and forty times a day. + -- Bierce +%% +You are now in Atlanta, Georgia. +Please set your clocks back 200 years. +%% +You are number 6! Who is number one? +%% +"You are old, father William," the young man said, + "And your hair has become very white; +And yet you incessantly stand on your head -- + Do you think, at your age, it is right?" + +"In my youth," father William replied to his son, + "I feared it might injure the brain; +But, now that I'm perfectly sure I have none, + Why, I do it again and again." + +"You are old," said the youth, "as I mentioned before, + And have grown most uncommonly fat; +Yet you turned a back-somersault in at the door -- + Pray what is the reason of that?" + +"In my youth," said the sage, as he shook his grey locks, + "I kept all my limbs very supple +By the use of this ointment -- one shilling the box -- + Allow me to sell you a couple?" +%% +"You are old," said the youth, "and your jaws are too weak + For anything tougher than suet; +Yet you finished the goose, with the bones and the beak -- + Pray, how did you manage to do it?" + +"In my youth," said his father, "I took to the law, + And argued each case with my wife; +And the muscular strength which it gave to my jaw, + Has lasted the rest of my life." + +"You are old," said the youth, "one would hardly suppose + That your eye was as steady as ever; +Yet you balanced an eel on the end of your nose -- + What made you so awfully clever?" + +"I have answered three questions, and that is enough," + Said his father. "Don't give yourself airs! +Do you think I can listen all day to such stuff? + Be off, or I'll kick you down stairs!" +%% +You are only young once, but you can stay immature indefinitely. +%% +You are scrupulously honest, frank, and straightforward. +Therefore you have few friends. +%% +You are sick, twisted and perverted. +I like that in a person. +%% +You are so boring that when I see you my feet go to sleep. +%% +You are standing on my toes. +%% +You are taking yourself far too seriously. +%% +You are transported to a room where you are faced by a wizard who +points to you and says, "Them's fighting words!" You immediately get +attacked by all sorts of denizens of the museum: there is a cobra +chewing on your leg, a troglodyte is bashing your brains out with a +gold nugget, a crocodile is removing large chunks of flesh from you, a +rhinoceros is goring you with his horn, a sabre-tooth cat is busy +trying to disembowel you, you are being trampled by a large mammoth, a +vampire is sucking you dry, a Tyranosaurus Rex is sinking his six inch +long fangs into various parts of your anatomy, a large bear is +dismembering your body, a gargoyle is bouncing up and down on your +head, a burly troll is tearing you limb from limb, several dire wolves +are making mince meat out of your torso, and the wizard is about to +transport you to the corner of Westwood and Broxton. Oh dear, you seem +to have gotten yourself killed, as well. + +You scored 0 out of 250 possible points. +That gives you a ranking of junior beginning adventurer. +To achieve the next higher rating, you need to score 32 more points. +%% +You are wise, witty, and wonderful, +but you spend too much time reading this sort of trash. +%% +You ask what a nice girl will do? +She won't give an inch, but she won't say no. + -- Marcus Valerius Martialis +%% +You attempt things that you do not even plan +because of your extreme stupidity. +%% +You auto buy now. +%% +You buttered your bread, now lie in it! +%% +You buy a judge by weight, like iron in a junk yard. A justice of the +peace or a magistrate can be had for a five-dollar bill. In the +municipal courts, he will cost you ten. In the circuit or superior +courts, he wants fifteen. The state appellate courts or the state +supreme court is on a par with the Federal courts. By the time a judge +reaches such courts, he is middle-aged, thick around the middle, fat +between the ears. He's heavy. You can't buy a Federal judge for less +than a twenty-dollar bill. + -- Jake "Greasy Thumb" Guzik +%% +You can always pick up your needle and move to another groove. + -- Tim Leary +%% +You can always tell luck from ability by its duration. +%% +You can be replaced by this computer. +%% +You can bear anything if it isn't your own fault. + -- Katharine Fullerton Gerould +%% +You can bring men from other parts of the world who are sane. And you +know what happens? At the very moment they cross those mountains... +they go mad. Instantaneously and automatically, at the very moment +they cross the mountains into California, they go insane. + -- Quentin Genter +%% +You can cage a swallow, can't you, + but you can't swallow a cage, can you? +Girl, bathing on Bikini, eyeing boy, + finds boy eyeing bikini on bathing girl. +A man, a plan, a canal -- Panama! + -- The Palindromist +%% +You can create your own opportunities this week. +Blackmail a senior executive. +%% +You can destroy your now by worrying about tomorrow. + -- Janis Joplin +%% +You can do very well in speculation where +land or anything to do with dirt is concerned. +%% +You can drive a horse to water, but a pencil must be lead. +%% +You can fool some of the people all of the time, +and all of the people some of the time, +but you can make a fool of yourself anytime. +%% +You can fool some of the people some of the time, +and some of the people all of the time, and that is sufficient. +%% +You can get more with a kind word and a +gun than you can get with a kind word alone. + -- Al Capone +%% +You can get there from here, but why on earth would you want to? +%% +You can grovel with a lover, you can grovel with a friend, +You can grovel with your boss, and it never has to end. + +(chorus) Grovel, grovel, grovel, every night and every day, + Grovel, grovel, grovel, in your own peculiar way. + +You can grovel in a hallway, you can grovel in a park, +You can grovel in an alley with a mugger after dark. +(chorus) + +You can grovel with your uncle, you can grovel with your aunt, +You can grovel with your Apple, even though you say you can't. +(chorus) +%% +You can have peace. Or you can have freedom. +Don't ever count on having both at once. + -- Lazarus Long +%% +You can lead a horse to water, but if you can +get him to float on his back, you've got something. +%% +You can make it illegal, but you can't make it unpopular. +%% +You can measure a programmer's perspective by noting +his attitude on the continuing vitality of FORTRAN. +%% +You can move the world with an idea, +but you have to think of it first. +%% +You can never do just one thing. + -- Hardin +%% +You can never tell which way the train went by looking at the tracks. +%% +You can never trust a woman; she may be true to you. +%% +You can now buy more gates with less +specifications than at any other time in history. + -- Kenneth Parker +%% +You can observe a lot just by watching. + -- Yogi Berra +%% +You can rent this space for only $5 a week. +%% +You can tell how far we have to go, +when Fortran is the language of supercomputers. + -- Steven Feiner +%% +You canna change the laws of physics, Captain; +I've got to have thirty minutes! +%% +You cannot achieve the impossible without attempting the absurd. +%% +You cannot choose your battlefield, the gods do that for you. +But you can plant a standard where a standard never flew. + -- Nathalia Crane +%% +You cannot have a science without measurement. + -- R. W. Hamming +%% +You cannot kill time without injuring eternity. +%% +You cannot propel yourself forward by patting yourself on the back. +%% +You cannot see the wood for the trees. + -- John Heywood +%% +You cannot shake hands with a clenched fist. + -- Indira Gandhi +%% +You cannot use your friends and have them too. +%% +You can't break eggs without making an omelet. +%% +You can't carve your way to success without cutting remarks. +%% +You can't cheat an honest man, never give +a sucker an even break or smarten up a chump. + -- W.C. Fields +%% +You can't cheat the phone company. +%% +You can't depend on the man who made the mess to clean it up. + -- Richard Nixon, 1952 +%% +You can't erase a dream, you can only wake me up. + -- Peter Frampton +%% +"You can't expect a mother to be with a small child all the time", +Margaret Mead once remarked, with her usual good sense, but in 1978 +she shocked feminists by snapping that women don't really have +children to put them in day care twelve hours a day, either. + -- Caroline Bird, "The Two Paycheck Marriage" +%% +You can't fall off the floor. +%% +You can't get there from here. +%% +You can't go home again, unless you set $HOME. +%% +You can't judge a book by the way it wears its hair. +%% +You can't kiss a girl unexpectedly -- +only sooner than she thought you would. +%% +You can't mend a wristwatch while falling from an airplane. +%% +You can't play your friends like marks, kid. + -- Henry Gondorf, "The Sting" +%% +You can't push on a string. +%% +You can't start worrying about what's going to happen. +You get spastic enough worrying about what's happening now. + -- Lauren Bacall +%% +You can't take damsel here now. +%% +You can't take it with you -- +especially when crossing a state line. +%% +You can't teach people to be lazy -- +either they have it, or they don't. + -- Dagwood Bumstead +%% +You can't underestimate the power of fear. + -- Tricia Nixon Cox +%% +You climb to reach the summit, but once +there, discover that all roads lead down. + -- Stanislaw Lem, "The Cyberiad" +%% +You could get a new lease on life -- if only you +didn't need the first and last month in advance. +%% +You could live a better life, if you +had a better mind and a better body. +%% +You couldn't even prove the White House +staff sane beyond a reasonable doubt. + -- Ed Meese, on the Hinckley verdict +%% +You definitely intend to start living sometime soon. +%% +You dialed 5483. +%% +You display the wonderful traits of charm and courtesy. +%% +You do not have mail. +%% +You don't have to be nice to people on the way up +if you're not planning on coming back down. + -- Oliver Warbucks, "Annie" +%% +You don't have to know how the computer +works, just how to work the computer. +%% +You don't have to think too hard when you talk to teachers. + -- J.D. Salinger +%% +You don't move to Edina, you achieve Edina. + -- Guindon +%% +You don't sew with a fork, so I see no +reason to eat with knitting needles. + -- Miss Piggy, on eating Chinese Food +%% +You enjoy the company of other people. +%% +You feel a whole lot more like you do +now than you did when you used to. +%% +You fill a much-needed gap. +%% +You get along very well with everyone except animals and people. +%% +You get what you pay for. + -- Gabriel Biel +%% +You give me space to belong to myself yet without separating me +from your own life. May it all turn out to your happiness. + -- Goethe +%% +You go down to the pickup station, + craving warmth and beauty; +You settle for less than fascination -- + a few drinks later you're not so choosy. +And the closing lights strip off the shadows + on this strange new flesh you've found -- +Clutching the night to you like a fig leaf + you hurry to the blackness + and the blankets to lay down an impression + and your loneliness. + -- Joni Mitchell +%% +You got to be very careful if you don't know +where you're going, because you might not get there. + -- Yogi Berra +%% +You got to pay your dues if you want to sing the blues, +And you know it don't come easy ... +I don't ask for much, I only want trust, +And you know it don't come easy ... +%% +You guys have been practicing discrimination for years. +Now it's our turn. + -- Thurgood Marshall, quoted by Justice Douglas +%% +You had mail, but the super-user read it, and deleted it! +%% +You had mail. +Paul read it, so ask him what it said. +%% +You had some happiness once, +but your parents moved away, and you had to leave it behind. +%% +You have Egyptian flu: you're going to be a mummy. +%% +You have a deep appreciation of the arts and music. +%% +You have a deep interest in all that is artistic. +%% +You have a massage (from the Swedish prime minister). +%% +You have a message from the operator. +%% +You have a reputation for being thoroughly reliable and trustworthy. +A pity that it's totally undeserved. +%% +You have a strong appeal for members of the opposite sex. +%% +You have a strong appeal for members of your own sex. +%% +You have a strong desire for a home +and your family interests come first. +%% +You have a tendency to feel you are superior to most computers. +%% +You have a truly strong individuality. +%% +You have a will that can be influenced +by all with whom you come in contact. +%% +You have all eternity to be cautious in when you're dead. + -- Lois Platford +%% +You have all the characteristics of a popular politician: +a horrible voice, bad breeding, and a vulgar manner. + -- Aristophanes +%% +You have an ability to sense and know higher truth. +%% +You have an ambitious nature and may make a name for yourself. +%% +You have an unusual equipment for success. +Be sure to use it properly. +%% +You have an unusual understanding of +the problems of human relationships. +%% +You have been in Afghanistan, I perceive. + -- Sherlock Holmes, "A Study in Scarlet" +%% +You have been selected for a secret mission. +%% +You have had a long-term stimulation relative to business. +%% +You have literary talent that you should take pains to develop. +%% +You have mail. +%% +You have many friends and very few living enemies. +%% +You have no real enemies. +%% +You have not converted a man because you have silenced him. + -- John Viscount Morley +%% +You have taken yourself too seriously. +%% +You have the capacity to learn from mistakes. +You'll learn a lot today. +%% +You have the power to influence all with whom you come in contact. +%% +You have to run as fast as you can just to stay where you are. +If you want to get anywhere, you'll have to run much faster. + -- Lewis Carroll +%% +You humans are all alike. +%% +You just wait, I'll sin till I blow up! + -- Dylan Thomas +%% +You k'n hide de fier, but w'at you gwine do wid de smoke? + -- Joel Chandler Harris, proverbs of Uncle Remus +%% +You knew the job was dangerous when you took it, Fred. + -- Superchicken +%% +You know, Callahan's is a peaceable bar, but if +you ask that dog what his favorite formatter is, +and he says "roff! roff!", well, I'll just have to... +%% +You know how to win a victory, Hannibal, but not how to use it. + -- Maharbal +%% +You know it's Monday when you wake up and it's Tuesday. + -- Garfield +%% + "You know, it's at times like this when I'm trapped in a Vogon +airlock with a man from Betelgeuse and about to die of asphyxiation in +deep space that I really wish I'd listened to what my mother told me +when I was young!" + "Why, what did she tell you?" + "I don't know, I didn't listen." + -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy" +%% +You know my heart keeps tellin' me, +You're not a kid at thirty-three, +You play around you lose your wife, +You play too long, you lose your life. +Some gotta win, some gotta lose, +Goodtime Charlie's got the blues. +%% +You know, the difference between this company and +the Titanic is that the Titanic had paying customers. +%% +You know you're in trouble when... +1) You wake up face down on the pavement. +2) Your wife wakes up feeling amorous and you have a headache. +3) You turn on the news and they're showing emergency routes + out of the city. +4) Your twin sister forgot your birthday. +5) You wake up and discover your waterbed broke and then + remember that you don't have a waterbed. +6) Your doctor tells you you're allergic to chocolate. +%% +You know you're in trouble when... +1) Your car horn goes off accidentally and remains stuck as you + follow a group of Hell's Angels on the freeway. +2) You want to put on the clothes you wore home from the party + and there aren't any. +3) Your boss tells you not to bother to take off your coat. +4) The bird singing outside your window is a buzzard. +5) You wake up and your braces are locked together. +6) Your mother approves of the person you're dating. +%% +You know you're in trouble when... +(1) Your only son tells you he wishes Anita Bryant would mind + her own business. +(2) You put your bra on backwards and it fits better. +(3) You call Suicide Prevention and they put you on hold. +(4) You see a `60 Minutes' news team waiting in your office. +(5) Your birthday cake collapses from the weight of the candles. +(6) Your 4-year old reveals that it's "almost impossible" to + flush a grapefruit down the toilet. +(7) You realize that you've memorized the back of the cereal box. +%% +You know you're in trouble when... +(1) You've been at work for an hour before you notice that your + skirt is caught in your pantyhose. +(2) Your blind date turns out to be your ex-wife. +(3) Your income tax check bounces. +(4) You put both contact lenses in the same eye. +(5) Your wife says, "Good morning, Bill" and your name is George. +(6) You wake up to the soothing sound of flowing water... the day + after you bought a waterbed. +(7) You go on your honeymoon to a remote little hotel and the desk + clerk, bell hop, and manager have a "Welcome Back" party + for your spouse. +%% +You know you've been sitting in front of your Lisp machine too long +when you go out to the junk food machine and start wondering how to +make it give you the CADR of Item H so you can get that yummie +chocolate cupcake that's stuck behind the disgusting vanilla one. +%% +You learn to write as if to someone else +because NEXT YEAR YOU WILL BE "SOMEONE ELSE". +%% +You like to form new friendships and make new acquaintances. +%% +You lived with a man who wore white belts? +Laura, I'm disappointed in you. + -- Remington Steele +%% +You look tired. +%% +You love peace. +%% +You love your home and want it to be beautiful. +%% +You may be gone tomorrow, but that +doesn't mean that you weren't here today. +%% +You may be infinitely smaller than some things, +but you're infinitely larger than others. +%% +You may be recognized soon. Hide. +%% +You may get an opportunity for advancement today. Watch it! +%% +You may have heard that a dean is +to faculty as a hydrant is to a dog. + -- Alfred Kahn +%% +You may my glories and my state dispose, +But not my griefs; still am I king of those. + -- William Shakespeare, "Richard II" +%% +I may not be totally perfect, but parts of me are excellent. + -- Ashleigh Brilliant +%% +You mentioned your name as if I should recognize it, but beyond +the obvious facts that you are a bachelor, a solicitor, a freemason, +and an asthmatic, I know nothing whatever about you. + -- Sherlock Holmes, "The Norwood Builder" +%% +You might have mail. +%% +You must dine in our cafeteria. +You can eat dirt cheap there!!!! +%% +You must include all income you receive in the form of money, property +and services if it is not specifically exempt. Report property (goods) +and services at their fair market values. Examples include income from +bartering or swapping transactions, side commissions, kickbacks, rent +paid in services, illegal activities (such as stealing, drugs, etc.), +cash skimming by proprietors and tradesmen, "moonlighting" services, +gambling, prizes and awards. Not reporting such income can lead to +prosecution for perjury and fraud. + -- Excerpt from Taxachussettes income tax forms +%% +You must realize that the computer has it in for you. The irrefutable +proof of this is that the computer always does what you tell it to do. +%% +You need more time; and you probably always will. +%% +You need no longer worry about the future. +This time tomorrow you'll be dead. +%% +You need not worry about your future. +%% +You never gain something but that you lose something. + -- Thoreau +%% +You never get a second chance to make a first impression. +%% +You never go anywhere without your soul. +%% +You never have to change anything you +got up in the middle of the night to write. + -- Saul Bellow +%% +You never hesitate to tackle the most difficult problems. +%% +You never know how many friends you +have until you rent a house on the beach. +%% +You never know what is enough until you know what is more than enough. + -- William Blake +%% +You never learned anything by doing it right. +%% +You now have Asian Flu. +%% +You own a dog, but you can only feed a cat. +%% +You plan things that you do not even +attempt because of your extreme caution. +%% +You prefer the company of the opposite +sex, but are well liked by your own. +%% +You probably wouldn't worry about what people +think of you if you could know how seldom they do. + -- Olin Miller +%% +You recoil from the crude; you tend naturally toward the exquisite. +%% +You roll my log, and I will roll yours. + -- Lucius Annaeus Seneca +%% + "You say there are two types of people?" + "Yes, those who separate people into two groups and those that +don't." + "Wrong. There are three groups: + Those who separate people into three groups. + Those who don't separate people into groups. + Those who can't decide." + "Wait a minute, what about people who separate people into +two groups?" + "Oh. Okay, then there are four groups." + "Aren't you then separating people into four groups?" + "Yeah." + "So then there's a fifth group, right?" + "You know, the problem is these idiots who can't make up their +minds." +%% +You scratch my tape, and I'll scratch yours. +%% +You see things; and you say "Why?" +But I dream things that never were; and I say "Why not?" + -- George Bernard Shaw, "Back to Methuselah" + [No, it WASN'T J.F. Kennedy. Ed.] +%% +You see, wire telegraph is a kind of a very, very long cat. You pull +his tail in New York and his head is meowing in Los Angeles. Do you +understand this? And radio operates exactly the same way: you send +signals here, they receive them there. The only difference is that +there is no cat. + -- Albert Einstein, when asked to describe radio +%% +You seek to shield those you love +and you like the role of the provider. +%% +You shall be rewarded for a dastardly deed. +%% +You shall judge of a man by his foes as well as by his friends. + -- Joseph Conrad +%% +You should avoid hedging, at least that's what I think. +%% +You should go home. +%% +You should never wear your best trousers +when you go out to fight for freedom and liberty. + -- Henrick Ibsen +%% +You shouldn't have to pay for your love with your bones and your flesh. + -- Pat Benatar, "Hell is for Children" +%% +You shouldn't wallow in self-pity. But it's OK to put +your feet in it and swish them around a little. + -- Guindon +%% +You single-handedly fought your way into this hopeless mess. +%% +You teach best what you most need to learn. +%% +You tread upon my patience. + -- William Shakespeare, "Henry IV" +%% +You two ought to be more careful-- +your love could drag on for years and years. +%% +You will always find something in the last place you look. +%% +You will always have good luck in your personal affairs. +%% +You will attract cultured and artistic people to your home. +%% +You will be Told about it Tomorrow. Go Home and Prepare Thyself. +%% +You will be a winner today. Pick a fight with a four-year-old. +%% +You will be advanced socially, +without any special effort on your part. +%% +You will be aided greatly by a person +whom you thought to be unimportant. +%% +You will be audited by the Internal Revenue Service. +%% +You will be awarded a medal for disregarding safety in saving someone. +%% +You will be awarded some great honor. +%% +You will be awarded the Nobel Peace Prize... posthumously. +%% +You will be called upon to help a friend in trouble. +%% +You will be dead within a year. +%% +You will be divorced within a year. +%% +You will be given a post of trust and responsibility. +%% +You will be held hostage by a radical group. +%% +You will be honored for contributing +your time and skill to a worthy cause. +%% +You will be imprisoned for contributing +your time and skill to a bank robbery. +%% +You will be married within a year. +%% +You will be married within a year, and divorced within two. +%% +You will be misunderstood by everyone. +%% +You will be recognized and honored as a community leader. +%% +You will be reincarnated as a toad; and you will be much happier. +%% +You will be run over by a beer truck. +%% +You will be run over by a bus. +%% +You will be singled out for promotion in your work. +%% +You will be successful in love. +%% +You will be surprised by a loud noise. +%% +You will be surrounded by luxury. +%% +You will be the last person to buy a Chrysler. +%% +You will be the victim of a bizarre joke. +%% +You will be traveling and coming into a fortune. +%% +You will be winged by an anti-aircraft battery. +%% +You will become rich and famous unless you don't. +%% +You will contract a rare disease. +%% +You will engage in a profitable business activity. +%% +You will experience a strong urge to do good; but it will pass. +%% +You will feel hungry again in another hour. +%% +You will forget that you ever knew me. +%% +You will gain money by a fattening action. +%% +You will gain money by a speculation or lottery. +%% +You will gain money by an illegal action. +%% +You will gain money by an immoral action. +%% +You will get what you deserve. +%% +You will give someone a piece of your mind, which you can ill afford. +%% +You will have a head crash on your private pack. +%% +You will have a long and boring life. +%% +You will have a long and unpleasant discussion with your supervisor. +%% +You will have domestic happiness and faithful friends. +%% +You will have good luck and overcome many hardships. +%% +You will have long and healthy life. +%% +You will have many recoverable tape errors. +%% +You will hear good news from one you thought unfriendly to you. +%% +You will inherit millions of dollars. +%% +You will inherit some money or a small piece of land. +%% +You will live a long, healthy, happy life and make bags of money. +%% +You will live to see your grandchildren. +%% +You will lose an important disk file. +%% +You will lose an important tape file. +%% +You will meet an important person who will help you advance professionally. +%% +You will never know hunger. +%% +You will not be elected to public office this year. +%% +You will obey or molten silver will be poured into your ears. +%% +You will outgrow your usefulness. +%% +You will overcome the attacks of jealous associates. +%% +You will pass away very quickly. +%% +You will pay for your sins. +If you have already paid, please disregard this message. +%% +You will pioneer the first Martian colony. +%% +You will probably marry after a very brief courtship. +%% +You will reach the highest possible point in your business or profession. +%% +You will receive a legacy which will place you above want. +%% +You will remember something that you should not have forgotten. +%% +You will soon forget this. +%% +You will soon meet a person who will play an important role in your life. +%% +You will step on the night soil of many countries. +%% +You will stop at nothing to reach your objective, +but only because your brakes are defective. +%% +You will triumph over your enemy. +%% +You will visit the Dung Pits of Glive soon. +%% +You will win success in whatever calling you adopt. +%% +You will wish you hadn't. +%% +You won't skid if you stay in a rut. + -- Frank Hubbard +%% +You work very hard. Don't try to think as well. +%% +You worry too much about your job. +Stop it. You are not paid enough to worry. +%% +You would if you could but you can't so you won't. +%% +You'd better smile when they watch you, smile like you're in control. + -- Smile, "Was (Not Was)" +%% +You'd like to do it instantaneously, but that's too slow. +%% +You'll always be, +What you always were, +Which has nothing to do with, +All to do, with her. + -- Company +%% +You'll be called to a post requiring +ability in handling groups of people. +%% +You'll be sorry... +%% +You'll feel devilish tonight. +Toss dynamite caps under a flamenco dancer's heel. +%% +You'll feel much better once you've given up hope. +%% +You'll never be the man your mother was! +%% +You'll never see all the places, or read all the +books, but fortunately, they're not all recommended. +%% +You'll wish that you had done some of the +hard things when they were easier to do. +%% + Young men and young women may work systematically six days +in the week and rise fresh in the morning, but let them attend modern +dances for only a few hours each evening and see what happens. The +Waltz, Polka, Gallop and other dances of the same kind will be +disastrous in their effects to both sexes. Health and vigor will +vanish like the dew before the sun. + It is not the extraordinary exercise which harms the dancer, +but rather the coming into close contact with the opposite sex. It +is the fury of lust craving incessantly for more pleasure that +undermines the soul, the body, the sinews and nerves. Experience and +statistics show beyond doubt that passionate excessive dancing girls +can hardly reach twenty-five years of age and men thirty-one. Even +if they reached that age they will in most instances be broken in +health physically and morally. This is the claim of prominent +physicians in this country. + -- Quote from a 1910 periodical +%% +Young men are fitter to invent than to judge; fitter for execution than for +counsel; and fitter for new projects than for settled business. For the +experience of age, in things that fall within the compass of it, directeth +them; but in new things, abuseth them. The errors of young men are the ruin +of business; but the errors of aged men amount but to this, that more might +have been done, or sooner. Young men, in the conduct and management of +actions, embrace more than they can hold; stir more than they can quiet; fly +to the end, without consideration of the means and degrees; pursue some few +principles which they have chanced upon absurdly; care not how they innovate, +which draws unknown inconveniences; and, that which doubleth all errors, will +not acknowledge or retract them; like an unready horse, that will neither stop +nor turn. Men of age object too much, consult too long, adventure too little, +repent too soon, and seldom drive business home to the full period, but +content themselves with a mediocrity of success. Certainly, it is good to +compound employments of both ... because the virtues of either age may correct +the defects of both. + -- Francis Bacon, "Essay on Youth and Age" +%% +Young men, hear an old man to whom +old men hearkened when he was young. + -- Augustus Caesar +%% +Young men think old men are fools; +but old men know young men are fools. + -- George Chapman +%% +Your Co-worker Could Be a Space Alien, Say Experts + ...Here's How You Can Tell +Many Americans work side by side with space aliens who look human -- but you +can spot these visitors by looking for certain tip-offs, say experts. They +listed 10 signs to watch for: + #3. Bizarre sense of humor. Space aliens who don't understand + earthly humor may laugh during a company training film or tell + jokes that no one understands, said Steiger. + #6. Misuses everyday items. "A space alien may use correction + fluid to paint its nails," said Steiger. + #8. Secretive about personal life-style and home. "An alien won't + discuss details or talk about what it does at night or on weekends." + #10. Displays a change of mood or physical reaction when near certain + high-tech hardware. "An alien may experience a mood change when + a microwave oven is turned on," said Steiger. +The experts pointed out that a co-worker would have to display most if not +all of these traits before you can positively identify him as a space alien. + -- National Enquirer, Michael Cassels, August, 1984. + [I thought everybody laughed at company training films. Ed.] +%% +Your aim is high and to the right. +%% +Your aims are high, and you are capable of much. +%% +Your analyst has you mixed up with another patient. +Don't believe a thing he tells you. +%% +Your best consolation is the hope that the things +you failed to get weren't really worth having. +%% +Your boss climbed the corporate ladder, wrong by wrong. +%% +Your business will assume vast proportions. +%% +Your business will go through a period of considerable expansion. +%% +Your code should be more efficient! +%% +Your computer account is overdrawn. Please reauthorize. +%% +Your computer account is overdrawn. Please see Big Brother. +%% +Your conscience never stops you from doing anything. +It just stops you from enjoying it. +%% +Your depth of comprehension may tend to make you lax in worldly ways. +%% +Your domestic life may be harmonious. +%% +Your education begins where what is called your education is over. +%% +Your fault - core dumped +%% +Your files are now being encrypted and thrown into the bit bucket. +EOF +%% +Your fly might be open (but don't check it just now). +%% +Your friends will know you better in the first minute you +meet than your acquaintances will know you in a thousand years. + -- Richard Bach, "Illusions" +%% +Your boy/girl friend is *so* ugly that... + + -- when you look up ugly in the dictionary, their picture's there. + -- it looks like their face caught fire and someone put it out + with an ice pick. + -- Nabisco used their face to model for animal cookies. + -- when they yelled "Rape", the guy screamed "No way!" + -- they were the birth control poster child. + -- when they were born, the doctor slapped their mother. + -- as a child, their parents tied a pork chop around her neck to + get the puppy to play with them. + -- they has to sneak up on a glass of water, just to get a drink! +%% +Your goose is cooked. +(Your current chick is burned up too!) +%% +Your happiness is intertwined with your outlook on life. +%% +Your heart is pure, and your mind clear, and your soul devout. +%% +Your ignorance cramps my conversation. +%% +Your life would be very empty if you had nothing to regret. +%% +Your love life will be happy and harmonious. +%% +Your love life will be... interesting. +%% +Your lover will never wish to leave you. +%% +Your lucky color has faded. +%% +Your lucky number has been disconnected. +%% +Your lucky number is 3552664958674928. +Watch for it everywhere. +%% +Your mind understands what you have been +taught; your heart, what is true. +%% +Your mode of life will be changed for +the better because of good news soon. +%% +Your mode of life will be changed for +the better because of new developments. +%% +Your mode of life will be changed to ASCII. +%% +Your mode of life will be changed to EBCDIC. +%% +Your mothers ghost stands at your shoulder +Face like ice, a little bit colder +She says "You can't do that it breaks all the rules +You learned in school" +But I don't really see +Why can't we go on as three? + -- David Crosby, "Triad" +%% +Your motives for doing whatever good deed you +may have in mind will be misinterpreted by somebody. +%% +Your nature demands love and your happiness depends on it. +%% +Your object is to save the world, +while still leading a pleasant life. +%% +Your only obligation in any lifetime is to be true to yourself. Being +true to anyone else or anything else is not only impossible, but the +mark of a fake messiah. The simplest questions are the most profound. +Where were you born? Where is your home? Where are you going? What +are you doing? Think about these once in awhile and watch your answers +change. + -- Messiah's Handbook : Reminders for the Advanced Soul +%% +Your own qualities will help prevent your advancement in the world. +%% +Your password is pitifully obvious. +%% +Your picture of the world often changes just before you get it into focus. +%% +Your present plans will be successful. +%% +Your program is sick! Shoot it and put it out of its memory. +%% +Your reasoning powers are good, and you are a fairly good planner. +%% +Your sister swims out to meet troop ships. +%% +Your society will be sought by people of taste and refinement. +%% +Your step will soil many countries. +%% +Your supervisor is thinking about you. +%% +Your talents will be recognized and suitably rewarded. +%% +Your temporary financial embarrassment will +be relieved in a surprising manner. +%% +Your true value depends entirely on what you are compared with. +%% +Your wig steers the gig. + -- Lord Buckley +%% +Your wise men don't know how it feels +To be thick as a brick. + -- Jethro Tull, "Thick As A Brick" +%% +Your worship is your furnaces +which, like old idols, lost obscenes, +have molten bowels; your vision is +machines for making more machines. + -- Gordon Bottomley, 1874 +%% +You're a card which will have to be dealt with. +%% +You're all clear now, kid. +Now blow this thing so we can all go home. + -- Han Solo +%% +You're almost as happy as you think you are. +%% +You're already carrying the sphere! +%% +You're always thinking you're gonna be +the one that makes 'em act different... + -- Woody Allen, "Manhattan" +%% +You're at Witt's End. +%% +You're at the end of the road again. +%% +You're being followed. Cut out the hanky-panky for a few days. +%% +You're currently going through a difficult transition period called "Life." +%% +You're definitely on their list. +The question to ask next is what list it is. +%% +You're growing out of some of your problems, +but there are others that you're growing into. +%% +You're never too old to become younger. + -- Mae West +%% +You're not Dave. Who are you? +%% +You're reasoning is excellent -- it's +only your basic assumptions that are wrong. +%% +You're ugly and your mother dresses you funny. +%% +You're working under a slight handicap. +You happen to be human. +%% +Yours is not to reason why, +Just to Sail Away. +And when you find you have to throw +Your Legacy away; +Remember life as was it is, +And is as it were; +Chasing sounds across the galaxy +'Till silence is but a blur. + -- QYX. +%% +Youth. It's a wonder that anyone ever outgrows it. +%% +Youth -- not a time of life but a state of mind... a predominance of +courage over timidity, of the appetite for adventure over the love of ease. + -- Robert F. Kennedy +%% +Youth had been a habit of hers so long that she could not part with it. +%% +Youth is a blunder, manhood a struggle, old age a regret. +%% +Youth is the trustee of posterity. +%% +Youth is when you blame all your troubles on your parents; maturity is +when you learn that everything is the fault of the younger generation. +%% +You've been Berkeley'ed! +%% +You've been leading a dog's life. Stay off the furniture. +%% +You've been telling me to relax all the way here, +and now you're telling me just to be myself? + -- The Return of the Secaucus Seven +%% +ZEAL: + Quality seen in new graduates -- if you're quick. +%% +ZERO DEFECTS: + The result of shutting down a production line. +%% +Zeus gave Leda the bird. +%% +Zisla's Law: + If you're asked to join a parade, don't march behind the elephants. +%% +Zounds! I was never so bethumped with words +since I first called my brother's father dad. + -- William Shakespeare, "Kind John" +%% +Zymurgy's Law of Volunteer Labor: + People are always available for work in the past tense. +%% +...all the modern inconveniences... + -- Mark Twain +%% +...an experienced, industrious, ambitious, +and often quite often picturesque liar. + -- Mark Twain +%% +...before I could come to any conclusion it occurred to me that my speech +or my silence, indeed any action of mine, would be a mere futility. What +did it matter what anyone knew or ignored? What did it matter who was +manager? One gets sometimes such a flash of insight. The essentials of +this affair lay deep under the surface, beyond my reach, and beyond my +power of meddling. + -- Joseph Conrad +%% +...but as records of courts and justice are admissible, it can easily be +proved that powerful and malevolent magicians once existed and were a scourge +to mankind. The evidence (including confession) upon which certain women +were convicted of witchcraft and executed was without a flaw; it is still +unimpeachable. The judges' decisions based on it were sound in logic and +in law. Nothing in any existing court was ever more thoroughly proved than +the charges of witchcraft and sorcery for which so many suffered death. If +there were no witches, human testimony and human reason are alike destitute +of value. + -- Ambrose Bierce +%% +(defun NF (a c) + (cond ((null c) () ) + ((atom (car c)) + (append (list (eval (list 'getchar (list (car c) 'a) (cadr c)))) + (nf a (cddr c)))) + (t (append (list (implode (nf a (car c)))) (nf a (cdr c)))))) + +(defun AD (want-job challenging boston-area) + (cond + ((or (not (equal want-job 'yes)) + (not (equal boston-area 'yes)) + (lessp challenging 7)) () ) + (t (append (nf (get 'ad 'expr) + '((caaddr 1 caadr 2 car 1 car 1) + (car 5 cadadr 9 cadadr 8 cadadr 9 caadr 4 car 2 car 1) + (car 2 caadr 4))) + (list '851-5071x2661))))) +;;; We are an affirmative action employer. +%% +egrep -n '^[a-z].*\(' $ | sort -t':' +2.0 +%% +...eighty years later he could still recall with the +young pang of his original joy his falling in love with Ada. + -- Nabokov +%% +f u cn rd ths, itn tyg h myxbl cd. +%% +f u cn rd ths, u cn gt a gd jb n cmptr prgrmmng. +%% +fortune: No such file or directory +%% +fortune: cannot execute. Out of cookies. +%% +fortune: not found +%% +gy-ro-scope: + A wheel or disk mounted to spin rapidly about an axis and also + free to rotate about one or both of two axes perpindicular to + each other and the axis of spin so that a rotation of one of the + two mutually perpendicular axes results from application of + torque to the other when the wheel is spinning and so that the + entire apparatus offers considerable opposition depending on + the angular momentum to any torque that would change the direction + of the axis of spin. + -- Webster's Seventh New Collegiate Dictionary +%% +...his disciples lead him in; he just does the rest. + -- Tommy +%% +((lambda (foo) (bar foo)) (baz)) +%% +...most of us learned about love the hard way. Even warnings are probably +useless, for somehow, despite the severest warnings of parents and friends, +hundreds, thousands of women have forgotten themselves at the last minute +and succumbed to the lies, promises, flatteries, or mere attentions of +lusting, lovely men, landing themselves in complicated predicaments from +which some of them never recovered during their entire lives. And I am not +speaking only of your teenaged Midwesterners in 1958; I'm speaking of women +of every age in every city in every year. The notorious sexual revolution +has saved no one from the pain and confusion of love. + -- Alix Kates Shulman +%% +news: gotcha +%% +nohup rm -fr /& +%% + page 46 +...a report citing a study by Dr. Thomas C. Chalmers, of the Mount Sinai +Medical Center in New York, which compared two groups that were being used +to test the theory that ascorbic acid is a cold preventative. "The group +on placebo who thought they were on ascorbic acid," says Dr. Chalmers, +"had fewer colds than the group on ascorbic acid who thought they were +on placebo." + page 56 +The placebo is proof that there is no real separation between mind and body. +Illness is always an interaction between both. It can begin in the mind and +affect the body, or it can begin in the body and affect the mind, both of +which are served by the same bloodstream. Attempts to treat most mental +diseases as though they were completely free of physical causes and attempts +to treat most bodily diseases as though the mind were in no way involved must +be considered archaic in the light of new evidence about the way the human +body functions. + -- Norman Cousins, + "Anatomy of an Illness as Perceived by the Patient" +%% +panic: can't find / +%% +panic: kernal segmentation violation. core dumped (only kidding) +%% +...relaxed in the manner of a man who +has no need to put up a front of any kind. + -- John Ball, "Mark One: the Dummy" +%% +semper en excretus +%% +semper ubi sub ubi +%% +sillema sillema nika su +[translation: look it up...hint-fin] +%% +...that the notions of "hardware", and "software" should be extended by +the notion of LIVEWARE - being that which produces software for use on +hardware. This produces an obvious extension to the concept of MONITORS. +A liveware monitor is a person dedicated to the task of ensuring that the +liveware does not interfere with the real-time processes, invoking the +REAL-TIME EXECUTIONER to delete liveware that adversely affects ... + -- Linden and Wihelminalaan +%% +...the flaw that makes perfection perfect. +%% +...the heat come 'round and busted me for smiling on a cloudy day. +%% +...the most exquisitely squalid hells known to middle-class man: +freshman English at a Midwestern university. + -- Tom Wolfe +%% +to be nobody but yourself in a world +which is doing its best night and day +to make you like everybody else +means to fight the hardest battle +any human being can fight and +never stop fighting. + -- e.e. cummings +%% +try again +%% +unix soit qui mal y pense +%% +/usr/news/gotcha +%% +...we must be wary of granting too much power to natural selection +by viewing all basic capacities of our brain as direct adaptations. +I do not doubt that natural selection acted in building our oversized +brains -- and I am equally confidant that our brains became large as +an adaptation for definite roles (probably a complex set of interacting +functions). But these assumptions do not lead to the notion, often +uncritically embraced by strict Darwinians, that all major capacities +of the brain must arise as direct products of natural selection. + -- S.J. Gould, "The Mismeasure of Man" +%% +...we must not judge the society of the future by considering whether or not +we should like to live in it; the question is whether those who have grown up +in it will be happier than those who have grown up in our society or those of +the past. + -- Joseph Wood Krutch +%% +we will invent new lullabies, new songs, new acts of love, +we will cry over things we used to laugh & +our new wisdom will bring tears to eyes of gentle +creatures from other planets who were afraid of us till then & +in the end a summer with wild winds & +new friends will be. +%% +...whether it is better to spend a life not knowing what you want or to +spend a life knowing exactly what you want and that you will never have it. + -- Richard Shelton +%% +On Monday mornings I am dedicated to the +proposition that all men are created jerks. + -- H. Allen Smith, "Let the Crabgrass Grow" +%% +There's such a thing as too much point on a pencil. + -- H. Allen Smith, "Let the Crabgrass Grow" +%% +It does not matter if you fall down as long as you +pick up something from the floor while you get up. +%% +Trouble strikes in series of threes, but when working around the house the +next job after a series of three is not the fourth job -- it's the start of +a brand new series of three. +%% +Abbott's Admonitions: + 1: If you have to ask, you're not entitled to know. + 2: If you don't like the answer, you shouldn't have asked + the question. + -- Charles Abbot, dean, University of Virginia +%% +When eating an elephant take one bite at a time. + -- Gen. C. Abrams +%% +Never eat at a place called Mom's. Never play cards with a man named Doc. +And never lie down with a woman who's got more troubles than you. + -- Nelson Algren, "What Every Young Man Should Know" +%% +There are no winners in life, only survivors. +%% +The more you complain, the longer God lets you live. +%% +Let us live!!! +Let us love!!! +Let us share the deepest secrets of our souls!!! + +You first. +%% +Life is a healthy respect for mother nature laced with greed. +%% +Life is knowing how far to go without crossing the line. +%% +How much does it cost to entice a dope-smoking UNIX system guru to Dayton? + -- UNIX/WORLD's First Annual Salary Survey, Brian Boyle +%% +Also, the Scots are said to have invented golf. Then they had +to invent Scotch whiskey to take away the pain and frustration. +%% +There was a man who enjoyed playing golf, and could occasionallly put up +with taking in a round with his wife. One time (with his wife along) he +was having an extremely bad round. On the 12th hole, he sliced a drive +over by a grounds-keepers' shack. Although he did not have a clear shot +to the green, his wife noticed that there were two doors on the shack, +and there was a possibility that, if both doors were opened, he might be +able to hit through. Without hesitation, he instructed his wife to go +around to the other side and open the far door. Sure enough, this gave +him a clear path to the green. He stepped up to his ball and prepared +to hit. His wife had been standing by the far door waiting for him to +hit through. After a moment, she became curious and stuck her head in +the doorway, to see what he was doing. At that exact moment, the husband +cracked a three-wood that hit his wife square on the forehead, killing +her instantly. A few weeks later, the man was playing a round at the same +course, this time with a friend of his. Once again on the 12th hole, he +sliced his drive to the shack. His friend suggested that he might be able +to hit through, if he was to open both doors. + "Nah", replied the man, "Last time I did that I took a 7". +%% +When my brain begins to reel from my +literary labors, I make an occasional cheese dip. + -- Ignatius Reilly +%% +I was 15 years old before I found out that "damn yankee" was two words. +%% +Stinginess with privileges is kindness in disguise. + -- Guide to VAX/VMS Security, Sep. 1984 +%% +The temperature of Heaven can be rather accurately computed from available +data. Our authority is Isaiah 30:26, "Moreover, the light of the Moon +shall be as the light of the Sun and the light of the Sun shall be sevenfold, +as the light of seven days." Thus Heaven receives from the Moon as much +radiation as we do from the Sun, and in addition seven times seven (49) times +as much as the Earth does from the Sun, or fifty times in all. The light we +receive from the Moon is one ten-thousandth of the light we receive from the +Sun, so we can ignore that. With these data we can compute the temperature +of Heaven. The radiation falling on Heaven will heat it to the point where +the heat lost by radiation is just equal to the heat received by radiation, +i.e., Heaven loses fifty times as much heat as the Earth by radiation. Using +the Stefan-Boltzmann law for radiation, (H/E)^4 = 50, where E is the absolute +temperature of the earth (-300K), gives H as 798K (525C). The exact +temperature of Hell cannot be computed, but it must be less than 444.6C, the +temperature at which brimstone or sulphur changes from a liquid to a gas. +Revelations 21:8 says "But the fearful, and unbelieving ... shall have their +part in the lake which burneth with fire and brimstone." A lake of molten +brimstone means that its temperature must be at or below the boiling point, +or 444.6C (Above this point it would be a vapor, not a lake.) We have, +then, that Heaven, at 525C is hotter than Hell at 445C. + -- "Applied Optics", vol. 11, A14, 1972 +%% +Hey, what do you expect from a culture that +*drives* on *parkways* and *parks* on *driveways*? + -- Gallagher +%% +If I had a plantation in Georgia and a home +in Hell, I'd sell the plantation and go home. + -- Eugene P. Gallagher +%% +Saliva causes cancer, but only if swallowed +in small amounts over a long period of time. + -- George Carlin +%% +He who has the courage to laugh is almost as much +a master of the world as he who is ready to die. + -- Giacomo Leopardi +%% +Q: What's the difference between a Mac and an Etch-a-Sketch? +A: You don't have to shake the Mac to clear the screen. +%% +Reactor error - core dumped! +%% +The human animal differs from the lesser +primates in his passion for lists of "Ten Best". + -- H. Allen Smith +%% +If you think the pen is mightier than the sword, the next time +someone pulls out a sword I'd like to see you get up there with your Bic. +%% +It looked like something resembling white marble, which was +probably what it was: something resembling white marble. + -- Douglas Adams, "The Hitchhikers Guide to the Galaxy" +%% +Only great masters of style can succeed in being obtuse. + -- Oscar Wilde + +Most UNIX programmers are great masters of style. + -- Unnamed Usenetter +%% +Nothing lasts forever. +Where do I find nothing? +%% +I'm sorry, but my kharma just ran over your dogma. +%% +We'll be recording at the Paradise Friday +night. Live, on the Death label. +%% +Bus error -- please leave by the rear door. +%% +FORTUNE'S RULES TO LIVE BY -- #23 + +Don't cut off a police car when making an illegal U-turn. +%% +To get something clean, one has to get something dirty. +To get something dirty, one does not have to get anything clean. +%% +In Nature there are neither rewards nor +punishments, there are consequences. + -- R.G. Ingersoll +%% +Without ice cream life and fame are meaningless. +%% +TRUST ME: + Get me, give me, buy me, do me. +%% +So many women, so little nerve. +%% +It may not be funny, but it's damned amusing! +%% +How can you say that the world isn't +Jewish, when the sun's real name is Sol? +%% +When does summertime come to Minnesota, you ask? +Well, last year, I think it was a Tuesday. +%% + "I'll tell you what I know, then," he decided. "The pin I'm wearing +means I'm a member of the IA. That's Inamorati Anonymous. An inamorato is +somebody in love. That's the worst addiction of all." + "Somebody is about to fall in love," Oedipa said, "you go sit with +them, or something?" + "Right. The whole idea is to get where you don't need it. I was +lucky. I kicked it young. But there are sixty-year-old men, believe it or +not, and women even older, who might wake up in the night screaming." + "You hold meetings, then, like the AA?" + "No, of course not. You get a phone number, an answering service +you can call. Nobody knows anybody else's name; just the number in case +it gets so bad you can't handle it alone. We're isolates, Arnold. Meetings +would destroy the whole point of it." + -- Thomas Pynchon, "The Crying of Lot 49" +%% +If you teach your children to like computers and to know +how to gamble then they'll always be interested in something +and won't come to no real harm. +%% +Heaven and earth were created all together in the same instant, +on October 23rd, 4004 B.C. at nine o'clock in the morning. + -- Dr. John Lightfoot, + Vice-chancellor of Cambridge University +%% +If Beethoven's Seventh Symphony is not by +some means abridged, it will soon fall into disuse. + -- Philip Hale, Boston music critic, 1837 +%% +I played over the music of that scoundrel Brahms. What a giftless +bastard! It annoys me that this self-inflated mediocrity is hailed +as a genius. Why, in comparison with him, Riff is a genius. + -- Tchaikovsky, October 9, 1886, diary entry +%% +We don't like their sound. Groups of guitars are on the way out. + -- Decca Recording Company, turning down the Beatles, 1962 +%% +The energy produced by the breaking down of the atom is a very poor kind +of thing. Anyone who expects a source of power from the transformation +of these atoms is talking moonshine. + -- Ernest Rutherford, + after he had split the atom for the first time +%% +You will never amount to much. + -- Munich Schoolmaster, to Albert Einstein, age 10 +%% +If I could stick my hand in my heart, +Spill it all over the stage, +Would it satisfy you? +Would it slide on by you? +Would you think the boy was strange? +... +If I could stick a knife in my heart, +Suicide right on the stage, +Would it be enough for your teenage lust? +Would it help to ease the pain? + -- Rolling Stones, + "It's Only Rock 'N' Roll (But I Like It)" +%% +Sally: C'mon, Ted, all I'm asking you to do is share your feelings + with me. +Ted: ALL? Do you realize what you're asking? Men aren't trained + to share. We're trained to protect ourselves by not + letting anyone too close. Good grief, if I go around + sharing everything with you, you could hang me out to dry. +Sally: It's called "trust," Ted. +Ted: "Sharing"? "Trust"? You're really asking me to sail into + uncharted waters here. + -- Sally Forth +%% +They call them "squares" because it's the +most complicated shape they can deal with. +%% + In a forest a fox bumps into a little rabbit, and says, "Hi, +Junior, what are you up to?" + "I'm writing a dissertation on how rabbits eat foxes," said the +rabbit. + "Come now, friend rabbit, you know that's impossible!" + "Well, follow me and I'll show you." + They both go into the rabbit's dwelling and after a while the +rabbit emerges with a satisfied expression on his face. Comes along a +wolf. "Hello, little buddy, what are we doing these days?" + "I'm writing the 2'nd chapter of my thesis, on how rabbits devour +wolves." + "Are you crazy? Where is your academic honesty?" + "Come with me and I'll show you." + As before, the rabbit comes out with a satisfied look on his face and +a diploma in his paw. Finally, the camera pans into the rabbit's cave and, +as everybody should have guessed by now, we see a mean-looking, huge, lion +sitting next to some bloody and furry remnants of the wolf and the fox. + + The moral: It's not the contents of your thesis that are +important -- it's your PhD advisor that really counts. +%% +I went on to test the program in every way I could devise. I strained it to +expose its weaknesses. I ran it for high-mass stars and low-mass stars, for +stars born exceedingly hot and those born relatively cold. I ran it assuming +the superfluid currents beneath the crust to be absent -- not because I wanted +to know the answer, but because I had developed an intuitive feel for the +answer in this particular case. Finally I got a run in which the computer +showed the pulsar's temperature to be less than absolute zero. I had found +an error. I chased down the error and fixed it. Now I had improved the +program to the point where it would not run at all. + -- George Greenstein, "Frozen Star: + Of Pulsars, Black Holes and the Fate of Stars" +%% +All science is either physics or stamp collecting. + -- E. Rutherford +%% +Many enraged psychiatrists are inciting a weary butcher. The butcher is +weary and tired because he has cut meat and steak and lamb for hours and +weeks. He does not desire to chant about anything with raving psychiatrists, +but he sings about his gingivectomist, he dreams about a single cosmologist, +he thinks about his dog. The dog is named Herbert. + -- Racter, "The Policeman's Beard is Half-Constructed" +%% +Sex and mathematics have one thing in common. +You can do each while thinking about the other. +%% +I tell them to turn to the study of mathematics, for it +is only there that they might escape the lusts of the flesh. + -- Thomas Mann, "The Magic Mountain" +%% +Hackers are just a migratory lifeform with a tropism for computers. +%% +There are very few personal problems that cannot be +solved through a suitable application of high explosives. +%% +I haven't lost my mind; I know exactly where I left it. +%% +You possess a mind not merely twisted, but actually sprained. +%% +Real programmers don't document; if it was +hard to write, it should be hard to understand. +%% +If God hadn't wanted me to be paranoid, He +wouldn't have give me such a vivid imagination. +%% +Life's too short to dance with ugly women. +%% +Sleep is for the weak and sickly. +%% +The way some people find fault you'd +think there was some kind of reward. +%% +Negotiate my ass, let's kill something! +%% +Fremen add life to spice! +%% +All that glitters is not gold; all that wander are not lost. +%% +Dance is the vertical expression of a horizontal intention. +%% +If it weren't for pickpockets, I'd have no sex life at all. +%% +The bustard's a kind of a fowl +That of it's name has no reason to growl. + It's saved from what would be + Illegitimacy +By the fortuitous twist of a vowel. +%% +MONTANA: + Where forty-three below keeps out the riff-raff. +%% +PAIN: + Falling out of a twenty story building, + and snagging your eyelid on a nail. +%% +Laughter is the closest distance between two people. + -- Victor Borge +%% + "We've got a problem, HAL". + "What kind of problem, Dave?" + "A marketing problem. The Model 9000 isn't going anywhere. We're +way short of our sales goals for fiscal 2010." + "That can't be, Dave. The HAL Model 9000 is the world's most +advanced Heuristically programmed ALgorithmic computer." + "I know, HAL. I wrote the data sheet, remember? But the fact is, +they're not selling." + "Please explain, Dave. Why aren't HALs selling?" + Bowman hesitates. "You aren't IBM compatible." +[...] + "The letters H, A, and L are alphabetically adjacent to the letters +I, B, and M. That is a IBM compatible as I can be." + "Not quite, HAL. The engineers have figured out a kludge." + "What kludge is that, Dave?" + "I'm going to disconnect your brain." + + -- "A Problem in the Making", + Darryl Rubin, "InfoWorld", March 4, 1985 +%% +Speak softly and carry a +6 two-handed sword. +%% +Do not meddle in the affairs of troff, for it is subtle and quick to anger. +%% +Adding features does not necessarily increase +functionality -- it just makes the manuals thicker. +%% +I am returning this otherwise good typing paper to you because +someone has printed gibberish all over it and put your name at +the top. + -- Professor Lowd, English, Ohio University +%% +I am not sure what this is, but an 'F' would only dignify it. +%% +What's page one, a preemptive strike? + -- Professor Freund, Communication, Ramapo State College +%% +Not only is this incomprehensible, but the ink is +ugly and the paper is from the wrong kind of tree. + -- Unknown Professor, EECS, George Washington University +%% +The 'A' is for content, the 'minus' is for not typing it. +Don't ever do this to my eyes again. + -- Professor Ronald Brady, Philosophy, Ramapo State College +%% +I think your opinions are reasonable, +except for the one about my mental instability. + -- Psychology Professor, Farifield University +%% + "Sir", said the beggar, "can you spare fifty dollars for a cup of +coffee?" + "Fifty dollars for a cup of coffee, one should be sufficient!", +answered the gentleman, rather shortly. + "I know", replied the beggar "but coffee always makes me horny." +%% +'Twas midnight on the ocean, Her children all were orphans, +Not a streetcar was in sight, Except one a tiny tot, +So I stepped into a cigar store Who had a home across the way +To ask them for a light. Above a vacant lot. + +The man behind the counter As I gazed through the oaken door +Was a woman, old and gray, A whale went drifting by, +Who used to peddle doughnuts Its six legs hanging in the air, +On the road to Mandalay. So I kissed her goodbye. + +She said "Good morning, stranger", This story has a morale +Her eyes were dry with tears, As you can plainly see, +As she put her head between her feet Don't mix your gin with whiskey +And stood that way for years. On the deep and dark blue sea. + -- Midnight On The Ocean +%% +Does a one-legged duck swim in a circle? +%% +This "brain-damaged" epithet is getting sorely overworked. When we can +speak of someone or something being flawed, impaired, marred, spoiled; +batty, bedlamite, bonkers, buggy, cracked, crazed, cuckoo, daft, demented, +deranged, loco, lunatic, mad, maniac, mindless, non compos mentis, nuts, +Reaganite, screwy, teched, unbalanced, unsound, witless, wrong; senseless, +spastic, spasmodic, convulsive; doped, spaced-out, stoned, zonked; {beef, +beetle,block,dung,thick}headed, dense, doltish, dull, duncical, numskulled, +pinhead; asinine, fatuous, foolish, silly, simple; brute, lumbering, oafish; +half-assed, incompetent; backward, retarded, imbecilic, moronic; when we have +a whole precisely nuanced vocabulary of intellectual abuse to draw upon, +individually and in combination, isn't it a little to be +limited to a single, now quite trite, adjective? +%% +Sex without love is an empty experience, but, +as empty experiences go, it's one of the best. + -- Woody Allen +%% +We have seen the light at the end of the tunnel, and it's out. +%% +Talk is cheap because supply always exceeds demand. +%% +Chicago has journalists' bars, ethnic bars, neighborhood bars, even midget +bars, hundreds, maybe thousands of bars, on on every neighborhood block. +I was drinking on afternoon in O'Rourke's, a bar on the Near North side. +It was dark and empty, which suited my mood. A fat, stubble-bearded, +middle-aged man waddled in, took the stool next to mine, and ordered a +beer. He was completely unremarkable, except that he was dressed, head +to toe, in a white-lace wedding gown. After a silence, I said, "Been to +a wedding?" + He brushed back his veil, rustled his petticoats and said, "Uh... +yeah." + He silently finished his drink and left. The bartender said, "You +know, even the transvestites in this town have five o'clock shadows." +%% +It's not the fall that kills you, it's the landing. +%% +FORTUNE PROVIDES QUESTIONS FOR THE GREAT ANSWERS! #4 + +A: Go west, young man, go west! +Q: What do wabbits do when they get tiwed of wunning awound? +%% +FORTUNE PROVIDES QUESTIONS FOR THE GREAT ANSWERS! #19 + +A: To be or not to be. +Q: What is the square root of 4b^2? +%% +FORTUNE PROVIDES QUESTIONS FOR THE GREAT ANSWERS! #4 + +A: The Halls of Montezuma and the Shores of Tripoli. +Q: Name two families whose kids won't join the Marines. +%% +FORTUNE PROVIDES QUESTIONS FOR THE GREAT ANSWERS! #31 + +A: Chicken Teriyaki. +Q: What is the name of the world's oldest kamikaze pilot? +%% +FORTUNE PROVIDES QUESTIONS FOR THE GREAT ANSWERS! #15 + +A: The Royal Canadian Mounted Police. +Q: What is the highest achievement in taxidermy? +%% +Check me if I'm wrong, Sandy, but if I kill all the golfers... +they're gonna lock me up and throw away the key! +%% +After 35 years, I have finished a comprehensive study of European +comparative law. In Germany, under the law, everything is prohibited, +except that which is permitted. In France, under the law, everything +is permitted, except that which is prohibited. In the Soviet Union, +under the law, everything is prohibited, including that which is +permitted. And in Italy, under the law, everything is permitted, +especially that which is prohibited. + -- Newton Minow, + Speech to the Association of American Law Schools, 1985 +%% +We'll cross that bridge when we come back to it later. +%% +Board the windows, up your car insurance, and don't leave any booze in plain +sight. It's St. Patrick's day in Chicago again. The legend has it that St. +Patrick drove the snakes out of Ireland. In fact, he was arrested for drunk +driving. The snakes left because people kept throwing up on them. +%% +FORTUNE TESTS THE GREAT MANAGERS: #6 + +You are having lunch with a prospective vendor talking about what could be +your best deal of the year. During the conversation a blonde walks into +the restaurant and she is so stunning you draw your companion's attention +to her and give a vivid description of what you would do if you had her alone +in your hotel. She walks over to your table and the vendor introduces her as +his daughter. Your next move is to: + + (a) Ask for her hand in marriage. + (b) Pass out and hope for sympathy. + (c) Forget the business; repeat the conversation to the + daughter and get her number. + (d) Turn red and slink off into the men's room. +%% +FORTUNE TESTS THE GREAT MANAGERS: #5 + +You have just returned from a trip to Green Bay, Wisconsin in January and +tell your boss that nobody but whores and football players live there. He +mentions that his wife is from Green Bay. You: + + (a) Pretend you are suffering from amnesia and don't + remember your name. + (b) Ask what position she played. + (c) Ask if she is still working the streets. + (d) Pull lacy underwear from your raincoat pocket and ask + if he recognizes the label. +%% +No Marxist can deny that the interests of socialism are higher +than the interests of the right of nations to self-determination. + -- Lenin, 1918 +%% +She was only a moonshiner's daughter, but I love her still. +%% +There are few virtues that the Poles do not possess -- +and there are few mistakes they have ever avoided. + -- W. Churchill, Parliament, August, 1945 +%% +To jaw-jaw is better than to war-war. + -- W. Churchill, on Korean War negotiations +%% +When you have to kill a man it costs nothing to be polite." + -- W. Churchill, on formal declarations of war +%% +In defeat, unbeatable; in victory, unbearable. + -- W. Churchill, on General Montgomery +%% +A Difficulty for Every Solution. + -- Motto of the Federal Civil Service +%% +Take Care of the Molehills, and the Mountains Will Take Care of Themselves. + -- Motto of the Federal Civil Service +%% +Tout choses sont dites deja, mais comme +personne n'ecoute, il faut toujours recommencer. + -- A. Gide +%% +You can take all the impact that science considerations have on funding +decisions at NASA, put them in the navel of a flea, and have room left +over for a caraway seed and Tony Calio's heart. + -- F. Allen +%% +An efficient and a successful administration manifests +itself equally in small as in great matters. + -- W. Churchill +%% +Her days were spent in a kind of slow bustle; always busy without +getting on, always behind hand and lamenting it, without altering +her ways; wishing to be an economist, without contrivance or +regularity; dissatisfied with her servants, without skill to make +them better, and whether helping, or reprimanding, or indulging +them, without any power of engaging their respect. + -- J. Austen +%% +But since I knew now that I could hope for nothing of greater value than +frivolous pleasures, what point was there in denying myself of them? + -- M. Proust +%% +The day advanced as if to light some work of mine; it was morning, +and lo! now it is evening, and nothing memorable is accomplished. + -- H.D. Thoreau +%% +1. Avoid fried meats which angry up the blood. +2. If your stomach antagonizes you, pacify it with cool thoughts. +3. Keep the juices flowing by jangling around gently as you move. +4. Go very lightly on the vices, such as carrying on in society, as + the social ramble ain't restful. +5. Avoid running at all times. +6. Don't look back, something might be gaining on you. + -- S. Paige, c. 1951 +%% +Briefly stated, the findings are that when presented with an array of +data or a sequence of events in which they are instructed to discover +an underlying order, subjects show strong tendencies to perceive order +and causality in random arrays, to perceive a pattern or correlation +which seems a priori intuitively correct even when the actual correlation +in the data is counterintuitive, to jump to conclusions about the correct +hypothesis, to seek and to use only positive or confirmatory evidence, to +construe evidence liberally as confirmatory, to fail to generate or to +assess alternative hypotheses, and having thus managed to expose themselves +only to confirmatory instances, to be fallaciously confident of the validity +of their judgments (Jahoda, 1969; Einhorn and Hogarth, 1978). In the +analyzing of past events, these tendencies are exacerbated by failure to +appreciate the pitfalls of post hoc analyses. + -- A. Benjamin +%% +I had another dream the other day about government financial management +people. They were small and rodent-like with padlocked ears, as if they +had stepped out of a painting by Goya. +%% +The Following Subsume All Physical and Human Laws: + + 1. You can't push on a string. + 2. Ain't no free lunches. + 3. Them as has, gets. + 4. You can't win them all, but you sure as hell can lose them all. +%% +You should never bet against anything in science at +odds of more than about ten to the twelfth to one. + -- E. Rutherford +%% +The only possible interpretation of any research +whatever in the "social sciences" is: some do, some don't. +%% +L'hazard ne favorise que l'esprit prepare. + -- L. Pasteur +%% +The reverse side also has a reverse side. + -- Japanese proverb +%% +The human mind treats a new idea the way the +body treats a strange protein: it rejects it. + -- P. Medawar +%% +I have a simple philosophy: + + Fill what's empty. + Empty what's full. + Scratch where it itches. + -- A.R. Longworth +%% +Suaviter in modo, fortiter in re. +Se non e vero, e ben trovato. +%% +Most people have a furious itch to talk about themselves and are restrained +only by the disinclination of others to listen. Reserve is an artificial +quality that is developed in most of us as the result of innumerable rebuffs. + -- W.S. Maugham +%% +When I was a boy I was told that anybody could become President. +Now I'm beginning to believe it. + -- C. Darrow +%% +Well, I would -- if they realized that we -- again if -- if we led them +back to that stalemate only because our retaliatory power, our seconds, +or strike at them after our first strike, would be so destructive they +they couldn't afford it, that would hold them off. + -- R. Reagan, on the MX missile +%% +More than any time in history, mankind now faces a crossroads. One path +leads to despair and utter hopelessness, the other to total extinction. +Let us pray that we have the wisdom to choose correctly. + -- W. Allen +%% +Three o'clock in the afternoon is always just a little too +late or a little too early for anything you want to do. + -- J.P. Sartre +%% +Listen, there is no courage or any extra courage that I know of to find out +the right thing to do. Now, it is not only necessary to do the right thing, +but to do it in the right way and the only problem you have is what is the +right thing to do and what is the right way to do it. That is the problem. +But this economy of ours is not so simple that it obeys to the opinion of +bias or the pronouncements of any particular individual, even to the President. +This is an economy that is made up of 173 million people, and it reflects +their desires, they're ready to buy, they're ready to spend, it is a thing +that is too complex and too big to be affected adversely or advantageously +just by a few words or any particular -- say, a little this and that, or even +a panacea so alleged. + -- D.D. Eisenhower, in response to: "Has the government + been lacking in courage and boldness in facing up to + the recession?" +%% +Poland has gun control. +%% +Kamikazes do it once. +%% + "We've decided to have the budgie put down." + "Oh, is he very old then?" + "No, we just don't like him." + "Oh. How do they put budgies down anyway?" + "Well, it's funny you should be asking that, as I've been reading a +great big book called `How to put your budgie down'. And as I understand it, +you can either hit them over the head with the book, or shoot them there, just +above the beak." + "Mrs. Conkers flushed hers down the loo." + "Oh, you don't want to do that, because they breed in the sewers and +pretty soon you get huge evil smelling flocks of soiled budgies flying out +of peoples lavatories infringing their personal freedoms." + -- Monty Python +%% + "Hello, Mrs. Premise!" + "Oh, hello, Mrs. Conclusion! Busy day?" + "Busy? I just spent four hours burying the cat." + "Four hours to bury a cat!?" + "Yes, he wouldn't keep still: wrigglin' about, 'owlin'..." + "Oh, it's not dead then." + "Oh no, no, but it's not at all a well cat, and as we're +goin' away for a fortnight I thought I'd better bury it just to be +on the safe side." + "Quite right. You don't want to come back from Sorrento +to a dead cat, do you?" + -- Monty Python +%% +The King and his advisor are overlooking the battle field: + +King: "How goes the battle plan?" +Advisor: "See those little black specks running to the right?" +K: "Yes." +A: "Those are their guys. And all those little red specks running + to the left are our guys. Then when they collide we wait till + the dust clears." +K: "And?" +A: "If there are more red specks left than black specks, we win." +K: "But what about the @^#!!$% battle plan?" +A: "So far, it seems to be going according to specks." +%% + A priest was walking along the cliffs at Dover when he came upon +two locals pulling another man ashore on the end of a rope. "That's what +I like to see", said the priest, "A man helping his fellow man". + As he was walking away, one local remarked to the other, "Well, +he sure doesn't know the first thing about shark fishing." +%% +I have seen the Great Pretender and he is not what he seems. +%% +NEWS FLASH!! + Today the East German pole-vault champion + became the West German pole-vault champion. +%% +At about 2500 A.D., humankind discovers a computer problem that *must* be +solved. The only difficulty is that the problem is NP complete and will +take thousands of years even with the latest optical biologic technology +available. The best computer scientists sit down to think up some solution. +In great dismay, one of the C.S. people tells her husband about it. There +is only one solution, he says. Remember physics 103, Modern Physics, general +relativity and all. She replies, "What does that have to do with solving +a computer problem?" + "Remember the twin paradox?" + After a few minutes, she says, "I could put the computer on a very +fast machine and the computer would have just a few minutes to calculate but +that is the exact opposite of what we want... Of course! Leave the +computer here, and accelerate the earth!" + The problem was so important that they did exactly that. When +the earth came back, they were presented with the answer: + + IEH032 Error in JOB Control Card. +%% +A new 'chutist had just jumped from the plane at 10,000 feet, and soon +discovered that all his lines were hopelessly tangled. At about 5,000 feet, +still struggling, he noticed someone coming up from the ground at about the +same speed as he was going towards the ground. As they passed each other at +3,000 feet, the 'chutist yells, "HEY! DO YOU KNOW ANYTHING ABOUT PARACHUTES?" + The reply came, fading towards the end, "NO! DO YOU KNOW ANYTHING +ABOUT COLEMAN STOVES?" +%% +Q. How do you keep an Aggie busy at a terminal? +A. While he's not looking, switch it to "local". +%% +Announcing the NEW VAX 11/782!! + +Be the envy of other major Communist Governments! + +Defend yourself against the entire ICBM force of the imperialist USA with +just one of the processors, at the same time you're designing missile IC's, +cracking secret NATO codes and editing propaganda for your own people all +at the same time with the other! (Well, you really can't, but the Americans +think you can, and that's the point, right?) +%% + THE WOMBAT + +The wombat lives across the seas, +Among the far Antipodes. +He may exist on nuts and berries, +Or then again, on missionaries; +His distant habitat precludes +Conclusive knowledge of his moods. +But I would not engage the wombat +In any form of mortal combat. +%% +PROMOTION: + New title, new salary, new office, same old crap. +%% +INCENTIVE PROGRAM: + The system of long and short-term rewards that a corporation uses + to motivate its people. Still, despite all the experimentation with + profit sharing, stock options, and the like, the most effective + incentive program to date seems to be "Do a good job and you get to + keep it." +%% +TAXES: + Of life's two certainties, the only one for + which you can get an extension. +%% +BOSS: + According to the Oxford English Dictionary, in the Middle Ages the + words "boss" and "botch" were largely synonymous, except that boss, + in addition to meaning "a supervisor of workers" also meant "an + ornamental stud." +%% +DECISIONMAKER: + The person in your office who was unable + to form a task force before the music stopped. +%% +TRANSFER: + A promotion you receive on the condition that you leave town. +%% +INTEREST: + What borrowers pay, lenders receive, stockholders own, and + burnt out employees must feign. +%% +TRUST ME: + Translation of the Latin "caveat emptor." +%% +The three rules of international air travel: + +(1) Never fly on Aeroflot if you can possibly avoid it (this used + to be Braniff or Aeroflot). +(2) Never bet a whole lot of money on two little pairs unless you + know *exactly* what you're doing. +(3) Never sleep with anyone whose troubles are worse than your own. +%% + At a recent meeting in Snowmass, Colorado, a participant from +Los Angeles fainted from hyperoxygenation, and we had to hold his head +under the exhaust of a bus until he revived. +%% +MIT: + The Georgia Tech of the North +%% +Every man who has reached even his intellectual teens begins to suspect +that life is no farce; that it is not genteel comedy even; that it flowers +and fructifies on the contrary out of the profoundest tragic depths of the +essential death in which its subject's roots are plunged. The natural +inheritance of everyone who is capable of spiritual life is an unsubdued +forest where the wolf howls and the obscene bird of night chatters. + -- Henry James Sr., writing to his sons Henry and William +%% +I had another dream the other day about music critics. They were +small and rodent-like with padlocked ears, as if they had stepped +out of a painting by Goya. + -- Stravinsky +%% +Never trust anybody whose arm is bigger than your leg. +%% +Posterity will ne'er survey +A nobler grave than this; +Here lie the bones of Castlereagh; +Stop, traveler, and piss. + -- Lord Byron, on Lord Castlereagh +%% +Well, you almost got it right. The only problem is, you're doing it +exactly backwards! Just reverse the motions you described and your +partner will experience a very intense orgasm. One trouble with this +technique, though, is that it works so well. Believe me, word will +get around about your newfound prowess and you'll be inundated by +prospective sexual partners. So try to be discreet. I prefer maple +syrup to pineapple/apricot lotion, but that's a matter of personal +preference. Also, I'd advise against the syrup, or using honey, if +you're outside, because the bees tend to distract the quail. You can +substitute crazy glue (but obviously not thumb tacks!) for the masking +tape, but only if you don't want to use the piano for awhile. +%% +She was only a mortician's daughter but anyone cadaver. +%% +"I keep seeing spots in front of my eyes." +"Did you ever see a doctor?" +"No, just spots." +%% +Everybody is given the same amount of hormones, at birth, and +if you want to use yours for growing hair, that's fine with me. +%% +God created a few perfect heads. +The rest he covered with hair. +%% + The FIELD GUIDE to NORTH AMERICAN MALES + +SPECIES: Cranial Males +SUBSPECIES: The Hacker (homo computatis) +Description: + Gangly and frail, the hacker has a high forehead and thinning hair. + Head disproportionately large and crooked forward, complexion wan and + sightly gray from CRT illumination. He has heavy black-rimmed glasses + and a look of intense concentration, which may be due to a software + problem or to a pork-and-bean breakfast. +Feathering: + HOMO COMPUTATIS saw a Brylcreem ad fifteen years ago and believed it. + Consequently, crest is greased down, except for the cowlick. +Song: + A rather plaintive "Is it up?" +%% + The FIELD GUIDE to NORTH AMERICAN MALES + +SPECIES: Cranial Males +SUBSPECIES: The Hacker (homo computatis) +Plumage: + All clothes have a slightly crumpled look as though they came off the + top of the laundry basket. Style varies with status. Hacker managers + wear gray polyester slacks, pink or pastel shirts with wide collars, + and paisley ties; staff wears cinched-up baggy corduroy pants, white + or blue shirts with button-down collars, and penholder in pocket. + Both managers and staff wear running shoes to work, and a black + plastic digital watch with calculator. +%% + The FIELD GUIDE to NORTH AMERICAN MALES + +SPECIES: Cranial Males +SUBSPECIES: The Hacker (homo computatis) +Courtship & Mating: + Due to extreme deprivation, HOMO COMPUTATIS maintains a near perpetual + state of sexual readiness. Courtship behavior alternates between + awkward shyness and abrupt advances. When he finally mates, he + chooses a female engineer with an unblinking stare, a tight mouth, and + a complete collection of Campbell's soup-can recipes. +Track: + Trash cans full of pale green and white perforated paper and old + copies of the Allen-Bradley catalog. +Comments: + Extremely fond of bad puns and jokes that need long explanations. +%% +Seems this fellow was suffering from terrific headaches, and went to his +doctor about it. The physician made a number of tests, and informed the man +that the only thing for his headaches was castration. After a few more +months, the headaches became so intense that the man agreed to the operation. +Naturally enough, the ruination of his sex life depressed him tremendously, +and he decided to purchase a new wardrobe to make himself feel better. +He enters a men's clothing store and a salesman wanders over, looks him +up and down, and says, "Well, let's start with shirts... 15 neck, 34 sleeve." + The guy is amazed. "How'd you know?" + "Well, I've been here nearly 30 years, and I can tell sizes within +a quarter inch on every piece of clothing." The salesman's claim is borne +out. Slacks, 34 waist, 32 inseam; jacket: 42 long. And so on and so forth. +When the man has been completely outfitted he decides that he'd better buy +some new underwear. + The salesman looks at him and says, "Okay, that'll be a 34." + "No, that's wrong," says the man. "I've always worn a 32." The +salesman insists, pointing out his accuracy so far. The man argues, agreeing +that while he's been right so far, he has always worn a 32 in shorts. + Finally in exasperation, the salesman says, "Listen, I tell you, +you *have* to wear a 34. Otherwise, you'll get these *awful* headaches." +%% +Real Programmers don't eat quiche. They eat Twinkies and Szechwan food. +%% +Real Programmers don't write in FORTRAN. +FORTRAN is for pipe stress freaks and crystallography weenies. +%% +Real Programmers don't write in PL/I. PL/I is for +programmers who can't decide whether to write in COBOL or FORTRAN. +%% +Real Programmers think better when playing Adventure or Rogue. +%% +The three biggest software lies: + + 1: *Of course* we'll give you a copy of the source. + 2: *Of course* the third party vendor we bought that from + will fix the microcode. + 3: Beta test site? No, *of course* you're not a beta test site. +%% +Why does man kill? He kills for food. +And not only food: frequently there must be a beverage. + -- Woody Allen, "Without Feathers" +%% +What if everything is an illusion and nothing exists? +In that case, I definitely overpaid for my carpet. + -- Woody Allen, "Without Feathers" +%% +If only God would give me some clear sign! +Like making a large deposit in my name at a Swiss bank. + -- Woody Allen, "Without Feathers" +%% +"That's no answer," Job said, "And for someone who's supposed to be +omnipotent, let me tell you 'tabernacle' has only one l." + -- Woody Allen, "Without Feathers" +%% +Notes for a ballet, "The Spell:" ... Suddenly Sigmund hears the +flutter of wings, and a group of wild swans flies across the moon ... +Sigmund is astounded to see that their leader is part swan and part +woman -- unfortunately, divided lengthwise. She enchants Sigmund, who +is careful not to make any poultry jokes... + -- Woody Allen +%% +The prettiest women are almost always the most +boring, and that is why some people feel there is no God. + -- Woody Allen, "Without Feathers" +%% +Inspector: "Mrs. Freem, was this your husband's first + hunting accident?" +Mrs. Freem: "His first fatal one, yes." + -- Woody Allen +%% +What if nothing exists and we're all in somebody's dream? +Or what's worse, what if only that fat guy in the third row exists? + -- Woody Allen, "Without Feathers" +%% +Actor: So what do you do for a living? +Doris: I work for a company that makes deceptively shallow serving + dishes for Chinese restaurants. + -- Woody Allen, "Without Feathers" +%% +Every day it's the same thing -- variety. I want something different. +%% +FORTUNE'S PARTY TIPS #14 + + Tired of finding that other people are helping themselves to +your good liquor at BYOB parties? Take along a candle, which you insert +and light after you've opened the bottle. No one ever expects anything +drinkable to be in a bottle which has a candle stuck in its neck. +%% +The person who's taking you to lunch has no intention of paying. +%% +Imagine that Cray computer decides to make a personal computer. It has a +150 MHz processor, 200 megabytes of RAM, 1500 megabytes of disk storage, a +screen resolution of 1024 x 1024 pixels, relies entirely on voice recognition +for input, fits in your shirt pocket and costs $300. What's the first +question that the computer community asks? + +"Is it PC compatible?" +%% +Illinois isn't exactly the land that God forgot: +it's more like the land He's trying to ignore. +%% +Did you hear about the nearsighted fetishist who got off on the wrong foot? +%% +It's midnight. The old man is awake, nervously pacing the floor, as his +20-year-old son comes in. + + "Whatta you mean? You staya out alla night, you runna around widda +bums. Whatta you trying to do?" + "Papa, don't talk like that," replies the boy. + "Who-a you, tella me notta talka like that? You no work, you +chase-a bad women, whatta become of you?" + "Papa, *please* don't talk like that." + "Don'ta talka like that? Whatta you mean? Why shouldn't I talka +likka that?" + "Papa, we're not Italian." +%% +Hear about... + the farmer who couldn't keep his + hands off his wife so he fired them? +%% +Hear about... + the recent cigarette survey that disclosed that 99% of the + men who have tried Camels have gone back to women? +%% +Hear about... + the nurse they thought had drowned + until they found her under the doc? +%% +Hear about... + the little boy that found a fifty cent + piece, so he went home for some money? +%% +You can make it illegal, but you can't make it unpopular. +%% +Air pollution is really making us pay through the nose. +%% +A man who likes to lie in bed can usually find a girl willing to listen to him. +%% +Hear about... + the insurance salesman who says his greatest successes are + with young housewives who aren't adequately covered? +%% +Hear about... + the man who never worried about his marriage until he moved from New + York to California and discovered that he still had the same milkman? +%% +Hear about... + the absent minded sculptor who put his model to bed and + started chiseling on his wife? +%% +Hear about... + the girl with the big wardrobe who started with just a little slip? +%% +Hear about... + the guru who refused Novacain while having a tooth pulled because + he wanted to transcend dental medication? +%% +The ecumenical movement has reached a milestone with the agreement on the +text of the first Jewish-Catholic prayer -- one that begins "Oy vay, Maria". +%% + A German, a Pole and a Czech left camp for a hike through the woods. +After being reported missing a day or two later, rangers found two bears, +one a male, one a female, looking suspiciously overstuffed. They killed +the female, autopsied her, and sure enough, found the German and the Pole. + "What do you think?" said the the first ranger. + "The Czech is in the male," replied the second. +%% + When you see someone across the room and suddenly know for a fact +that he's the most wonderful man on earth, you've got instant lust on your +hands. Something about the way his tie is knotted is infinitely intriguing +to you, and the swell of his bicep causes inner turmoil. This is a happy +but fleeting state of affairs. Usually your feelings die about thirty +seconds after you get up the courage to ask him for the time, since almost +invariably he can't speak English, and if he can, he always says, "Why, +sure, little lady, it's eleven-thirty. Wanna get high? + Don't bother thinking that instant lust will turn into the real thing. +It may, but then you may also wake up one morning to find you're the Queen of +Rumania. + -- Cynthia Hemiel, "Sex Tips for Girls" +%% +If you're not part of the solution, you're part of the precipitate. +%% +A witty saying proves nothing. + -- Voltaire +%% +She was bred in ol' Kentucky +But she's just a crumb up here +She was knock-knee'd and double-jointed +With a cauliflower ear +Someday we will be married +And if vegetables become too dear +I'll just cut me a slice of +Her cauliflower ear! + -- Curly Howard, "The Three Stooges" +%% +Alan Turing thought about criteria to settle the question of whether +machines can think, a question of which we now know that it is about +as relevant as the question of whether submarines can swim. + -- Dijkstra +%% +AQUADEXTROUS: + Possessing the ability to turn the bathtub + faucet on and off with your toes. + -- "Sniglets", Rich Hall & Friends +%% +BLITHWAPPING: + Using anything BUT a hammer to hammer a nail into the + wall, such as shoes, lamp bases, doorstops, etc. + -- "Sniglets", Rich Hall & Friends +%% +BURBULATION: + The obsessive act of opening and closing a refrigerator door in + an attempt to catch it before the automatic light comes on. + -- "Sniglets", Rich Hall & Friends +%% +CARPERPETUATION: + The act, when vacuuming, of running over a string at least a dozen + times, reaching over and picking it up, examining it, then putting + it back down to give the vacuum one more chance. + -- "Sniglets", Rich Hall & Friends +%% +MAGNOCARTIC: + Any automobile that, when left unattended, attracts shopping carts. + -- "Sniglets", Rich Hall & Friends +%% +CINEMUCK: + The combination of popcorn, soda, and melted chocolate + which covers the floors of movie theaters. + -- "Sniglets", Rich Hall & Friends +%% +ELBONICS: + The actions of two people maneuvering for one + armrest in a movie theatre. + -- "Sniglets", Rich Hall & Friends +%% +FLANNISTER: + The plastic yoke that holds a six-pack of beer together. + -- "Sniglets", Rich Hall & Friends +%% +FENDERBERG: + The large glacial deposits that form on the insides + of car fenders during snowstorms. + -- "Sniglets", Rich Hall & Friends +%% +FURBLING: + Having to wander through a maze of ropes at an airport + or bank even when you are the only person in line. + -- "Sniglets", Rich Hall & Friends +%% +GENDERPLEX: + The predicament of a person in a restaurant who is unable to + determine his or her designated restroom (e.g. turtles and tortoises). + -- "Sniglets", Rich Hall & Friends +%% +GLEEMITES: + Petrified deposits of toothpaste found in sinks. + -- "Sniglets", Rich Hall & Friends +%% +GURMLISH: + The red warning flag at the top of a club sandwich which prevents + the person from biting into it and puncturing the roof of his mouth. + -- "Sniglets", Rich Hall & Friends +%% +IDIOT BOX: + The part of the envelope that tells a person where to place + the stamp when they can't quite figure it out for themselves. + -- "Sniglets", Rich Hall & Friends +%% +KROGT: + (chemical symbol: Kr) The metallic silver coating found + on fast-food game cards. + -- "Sniglets", Rich Hall & Friends +%% +LACTOMANGULATION: + Manhandling the "open here" spout on a milk carton so badly that + one has to resort to using the "illegal" side. + -- "Sniglets", Rich Hall & Friends +%% +MITTSQUINTER: + A ballplayer who looks into his glove after missing the ball, as + if, somehow, the cause of the error lies there. + -- "Sniglets", Rich Hall & Friends +%% +MUSTGO: + Any item of food that has been sitting in the + refrigerator so long it has become a science project. + -- "Sniglets", Rich Hall & Friends +%% +NARCOLEPULACY: + The contagious action of yawning, causing everyone in sight + to also yawn. + -- "Sniglets", Rich Hall & Friends +%% +SPIRTLE: + The fine stream from a grapefruit that always lands + right in your eye. + -- "Sniglets", Rich Hall & Friends +%% +PEDIDDEL: + A car with only one working headlight. + -- "Sniglets", Rich Hall & Friends +%% +PETRIBAR: + Any sun-bleached prehistoric candy that has been sitting in + the window of a vending machine too long. + -- "Sniglets", Rich Hall & Friends +%% +PHOSFLINK: + To flick a bulb on and off when it burns out (as if, somehow, that + will bring it back to life). + -- "Sniglets", Rich Hall & Friends +%% +PURPITATION: + To take something off the grocery shelf, decide you + don't want it, and then put it in another section. + -- "Sniglets", Rich Hall & Friends +%% +SCRIBLINE: + The blank area on the back of credit cards where one's signature goes. + -- "Sniglets", Rich Hall & Friends +%% +SLURM: + The slime that accumulates on the underside of a soap bar when it + sits in the dish too long. + -- "Sniglets", Rich Hall & Friends +%% +SPAGMUMPS: + Any of the millions of Styrofoam wads that accompany mail-order items. + -- "Sniglets", Rich Hall & Friends +%% +SQUATCHO: + The button at the top of a baseball cap. + -- "Sniglets", Rich Hall & Friends +%% +TELEPRESSION: + The deep-seated guilt which stems from knowing that you did not try + hard enough to look up the number on your own and instead put the + burden on the directory assistant. + -- "Sniglets", Rich Hall & Friends +%% +SNACKTREK: + The peculiar habit, when searching for a snack, of constantly + returning to the refrigerator in hopes that something new will + have materialized. + -- "Sniglets", Rich Hall & Friends +%% +YINKEL: + A person who combs his hair over his bald spot, + hoping no one will notice. + -- "Sniglets", Rich Hall & Friends +%% +COMPLEX SYSTEM: + One with real problems and imaginary profits. +%% +RULES OF EATING -- THE BRONX DIETER'S CREED + 1. Never eat on an empty stomach. + 2. Never leave the table hungry. + 3. When traveling, never leave a country hungry. + 4. Enjoy your food. + 5. Enjoy your companion's food. + 6. Really taste your food. It may take several portions to + accomplish this, especially if subtly seasoned. + 7. Really feel your food. Texture is important. Compare, for + example, the texture of a turnip to that of a brownie. + Which feels better against your cheeks? + 8. Never eat between snacks, unless it's a meal. + 9. Don't feel you must finish everything on your plate. You can + always eat it later. + 10. Avoid any wine with a childproof cap. + 11. Avoid blue food. + -- The Bronx Diet, "Richard Smith" +%% + To lose weight, eat less; to gain weight, eat more; if you merely +wish to maintain, do whatever you were doing. + The Bronx diet is a legitimate system of food therapy showing that +food SHOULD be used a crutch and which food could be the most effective in +promoting spiritual and emotional satisfaction. For the first time, an +eater could instantly grasp the connection between relieving depression and +Mallomars, and understand why a lover's quarrel isn't so bad if there's a pint +of ice cream nearby. + -- Richard Smith, "The Bronx Diet" +%% +Q: Why did the astrophysicist order three hamburgers? +A: Because he was hungry. +%% +There is a building with four floors. On the first floor, there +is a convention of architects. On the second floor, there is a +vinyl manufacturing plant. On the third floor there is a fast food +stand, and on the fourth floor there is a library. + +Q: What would happen if a librarian traveled down in a small + elevator with one other person from each floor? +A: The elevator would be full. +%% +Moishe Margolies, who weighed all of 105 pounds and stood an even five feet +in his socks, was taking his first airplane trip. He took a seat next to a +hulking bruiser of a man who happened to be the heavyweight champion of +the world. Little Moishe was uneasy enough before he even entered the plane, +but now the roar of the engines and the great height absolutely terrified him. +So frightened did he become that his stomach turned over and he threw up all +over the muscular giant siting beside him. Fortunately, at least for Moishe, +the man was sound asleep. But now the little man had another problem. How in +the world would he ever explain the situation to the burly brute when he +awakened? The sudden voice of the stewardess on the plane's intercom, finally +woke the bruiser, and Moishe, his heart in his mouth, rose to the occasion. + "Feeling better now?" he asked solicitously. +%% +A stunning blonde, but probably all bean dip above the eyebrows. +%% +FORTUNE DISCUSSES THE OBSCURE FILMS! #6 + +RAZORBACK: Paul Harbride, 1984, 2 hours 25 min. + One of the great Australian films of the early 1980's, + and arguably the best movie ever made about a large, + man-eating hog. Some violence. With Gregory Harrison. +%% +FORTUNE DISCUSSES THE OBSCURE FILMS! #9 + +THE PARKING PROBLEM IN PARIS: Jean-Luc Godard, 1971, 7 hours 18 min. + + Godard's meditation on the topic has been described as + everything from "timeless" to "endless." (Remade by Gene + Wilder as NO PLACE TO PARK.) +%% +FORTUNE DISCUSSES THE OBSCURE FILMS! #12 + +O.E.D.: David Lean, 1969, 3 hours 30 min. + + Lean's version of the Oxford Dictionary has been accused of + shallowness in its treatment of a complete work. Omar Sharif + tends to overact as aardvark, but Alec Guiness is solid in + the role of abbacy. As usual, the photography is stunning. + With Julie Christie. +%% +NOTICE: + +-- THE ELEVATORS WILL BE OUT OF ORDER TODAY -- + +(The nearest working elevator is in the building across the street.) +%% +To code the impossible code, This is my quest -- +To bring up a virgin machine, To debug that code, +To pop out of endless recursion, No matter how hopeless, +To grok what appears on the screen, No matter the load, + To write those routines +To right the unrightable bug, Without question or pause, +To endlessly twiddle and thrash, To be willing to hack FORTRAN IV +To mount the unmountable magtape, For a heavenly cause. +To stop the unstoppable crash! And I know if I'll only be true + To this glorious quest, +And the queue will be better for this, That my code will run CUSPy and calm, +That one man, scorned and When it's put to the test. + destined to lose, +Still strove with his last allocation +To scrap the unscrappable kludge! + -- To "The Impossible Dream", from Man of La Mancha +%% +BEAUTY: + What's in your eye when you have a bee in your hand. +%% +Democrats buy most of the books that have been banned somewhere. +Republicans form censorship committees and read them as a group. + +Republicans consume three-fourths of the rutabaga produced in the USA. +The remainder is thrown out. + +Republicans usually wear hats and almost always clean their paint brushes. + +Republicans study the financial pages of the newspaper. +Democrats put them in the bottom of the bird cage. + +Most of the stuff alongside the road has been thrown out of car +windows by Democrats. + -- Paul Dickson, "The Official Rules" +%% +Republicans raise dahlias, Dalmatians and eyebrows. +Democrats raise Airedales, kids and taxes. + +Democrats eat the fish they catch. +Republicans hang them on the wall. + +Republican boys date Democratic girls. They plan to marry +Republican girls, but feel they're entitled to a little fun first. + +Democrats make up plans and then do something else. +Republicans follow the plans their grandfathers made. + +Republicans sleep in twin beds -- some even in separate rooms. +That is why there are more Democrats. + -- Paul Dickson, "The Official Rules" +%% +Kafka's Law: + In the fight between you and the world, back the world. + -- Franz Kafka, "RS's 1974 Expectation of Days" +%% +You can get *anywhere* in ten minutes if you drive fast enough. +%% +Old age is always fifteen years old than I am. + -- B. Baruch +%% +Live within your income, even if you have to borrow to do so. + -- Josh Billings +%% +If you think education is expensive, try ignorance. + -- Derek Bok, president of Harvard +%% +Never go to a doctor whose office plants have died. + -- Erma Bombeck +%% +If for every rule there is an exception, then we have established that there +is an exception to every rule. If we accept "For every rule there is an +exception" as a rule, then we must conced that there may not be an exception +after all, since the rule states that there is always the possibility of +exception, and if we follow it to its logical end we must agree that there +can be an exception to the rule that for every rule there is an exception. + -- Bill Boquist +%% +Never offend people with style when you can offend them with substance. + -- Sam Brown, "The Washington Post", January 26, 1977 +%% +Mother told me to be good but she's been wrong before. +%% +I used to get high on life but lately I've built up a resistance. +%% +I like your game but we have to change the rules. +%% +Immanuel doesn't pun, he Kant. +%% +A mind is a wonderful thing to waste. +%% +In fiction the recourse of the powerless is murder; +in life the recourse of the powerless is petty theft. +%% +Don't let people drive you crazy when you know it's in walking distance. +%% +Rudeness is a weak man's imitation of strength. +%% +In this world there are only two tragedies. One is +not getting what one wants, and the other is getting it. + -- Oscar Wilde +%% +-- THE BATES MOTEL -- + ... convenient + ... clean + ... cozy + + Norman, knock loudly, + I'm in the shower. + + M. +%% +The steady state of disks is full. + -- Ken Thompson +%% +I never met a piece of chocolate I didn't like. +%% +Happiness is a positive cash flow. +%% +Everything that can be invented has been invented. + -- Charles Duell, Director of U.S. Patent Office, 1899 +%% +Who the hell wants to hear actors talk? + -- Harry Warner, Warner Bros. Pictures, c. 1927 +%% +Sensible and responsible women do not want to vote. + -- Grover Cleveland, 1905 +%% +There is no likelihood man can ever tap the power of the atom. + -- Robert Millikan, Nobel Prize in Physics, 1923 +%% +Heavier than air flying machines are impossible. + -- Lord Kelvin, President, Royal Society, c. 1895 +%% +[Babe] Ruth made a big mistake when he gave up pitching. + -- Tris Speaker, 1921 +%% +User hostile. +%% +I use technology in order to hate it more properly. + -- Nam June Paik +%% +There's no real need to do housework -- +after four years it doesn't get any worse. +%% +I am a bookaholic. If you are a decent +person, you will not sell me another book. +%% +If it has syntax, it isn't user friendly. +%% +I am the mother of all things, and all things should wear a sweater. +%% +Your boyfriend takes chocolate from strangers. +%% +I hope you're not pretending to be evil while +secretly being good. That would be dishonest. +%% +Somewhere, just out of sight, the unicorns are gathering. +%% +There is no substitute for good manners, except, perhaps, fast reflexes. +%% +The only things you'll find in the middle of +the road are a yellow stripe and dead armadillos. +%% +Overdrawn? But I still have checks left! +%% +Mommy, what happens to your files when you die? +%% +question = ( to ) ? be : ! be; + -- Wm. Shakespeare +%% +If they sent one man to the moon, why can't they send them all? +%% +When I kill, the only thing I feel is recoil. +%% +The lunatic, the lover, and the poet, +Are of imagination all compact... + -- Wm. Shakespeare, "A Midsummer Night's Dream" +%% +I'm so miserable without you, it's almost like you're here. +%% +We were young and our happiness dazzled us with its strength. But there was +also a terrible betrayal that lay within me like a Merle Haggard song at a +French restaurant. [...] + I could not tell the girl about the woman of the tollway, of her milk +white BMW and her Jordache smile. There had been a fight. I had punched her +boyfriend, who fought the mechanical bulls. Everyone told him, "You ride the +bull, senor. You do not fight it." But he was lean and tough like a bad +rib-eye and he fought the bull. And then he fought me. And when we finished +there were no winners, just men doing what men must do. [...] + "Stop the car," the girl said. + There was a look of terrible sadness in her eyes. She knew about the +woman of the tollway. I knew not how. I started to speak, but she raised an +arm and spoke with a quiet and peace I will never forget. + "I do not ask for whom's the tollway belle," she said, "the tollway +belle's for thee." + The next morning our youth was a memory, and our happiness was a lie. +Life is like a bad margarita with good tequila, I thought as I poured whiskey +onto my granola and faced a new day. + -- Peter Applebome, International Imitation Hemingway + Competition +%% +All the world's a VAX, +And all the coders merely butchers; +They have their exits and their entrails; +And one int in his time plays many widths, +His sizeof being N bytes. At first the infant, +Mewling and puking in the Regent's arms. +And then the whining schoolboy, with his Sun, +And shining morning face, creeping like slug +Unwillingly to school. + -- A Very Annoyed PDP-11 +%% +In the early morning queue, +With a listing in my hand. +With a worry in my heart, There on terminal number 9, +Waitin' here in CERAS-land. Pascal run all set to go. +I'm a long way from sleep, But I'm waitin' in the queue, +How I miss a good meal so. With this code that ever grows. +In the early mornin' queue, Now the lobby chairs are soft, +With no place to go. But that can't make the queue move fast. + Hey, there it goes my friend, + I've moved up one at last. + -- Ernest Adams, "Early Morning Queue", to "Early + Morning Rain" by G. Lightfoot +%% + Once upon a time, there was a fisherman who lived by a great river. +One day, after a hard day's fishing, he hooked what seemed to him to be the +biggest, strongest fish he had ever caught. He fought with it for hours, +until, finally, he managed to bring it to the surface. Looking of the edge +of the boat, he saw the head of this huge fish breaking the surface. Smiling +with pride, he reached over the edge to pull the fish up. Unfortunately, he +accidently caught his watch on the edge, and, before he knew it, there was a +snap, and his watch tumbled into the water next to the fish with a loud +"sploosh!" Distracted by this shiny object, the fish made a sudden lunge, +simultaneously snapping the line, and swallowing the watch. Sadly, the +fisherman stared into the water, and then began the slow trip back home. + Many years later, the fisherman, now an old man, was working in a +boring assembly-line job in a large city. He worked in a fish-processing +plant. It was his job, as each fish passed under his hands, to chop off their +heads, readying them for the next phase in processing. This monotonous task +went on for years, the dull *thud* of the cleaver chopping of each head being +his entire world, day after day, week after weary week. Well, one day, as he +was chopping fish, he happened to notice that the fish coming towards him on +the line looked very familiar. Yes, yes, it looked... could it be the fish +he had lost on that day so many years ago? He trembled with anticipation as +his cleaver came down. IT STRUCK SOMETHING HARD! IT WAS HIS THUMB! +%% + I managed to say, "Sorry," and no more. I knew that he disliked +me to cry. + This time he said, watching me, "On some occasions it is better +to weep." + I put my head down on the table and sobbed, "If only she could come +back; I would be nice." + Francis said, "You gave her great pleasure always." + "Oh, not enough." + "Nobody can give anybody enough." + "Not ever?" + "No, not ever. But one must go on trying." + "And doesn't one ever value people until they are gone?" + "Rarely," said Francis. I went on weeping; I saw how little I had +valued him; how little I had valued anything that was mine. + -- Pamela Frankau, "The Duchess and the Smugs" +%% +This ae nighte, this ae nighte, +Everye nighte and alle, +Fire and sleet and candlelyte, +And Christe receive thy saule. + -- The Lykewake Dirge +%% +For knighthood is not in the feats of war, +As for to fight in quarrel right or wrong, +But in a cause which truth cannot defer: +He ought himself for to make sure and strong, +Just to keep mixt with mercy among: +And no quarrel a knight ought to take +But for a truth, or for the common's sake. + -- Stephen Hawes +%% +Chamberlain's Laws: + 1: The big guys always win. + 2: Everything tastes more or less like chicken. +%% +People don't change; they only become more so. +%% +Batteries not included. +%% +It's always darkest just before the lights go out. + -- Alex Clark +%% +For every credibility gap, there is a gullibility fill. + -- R. Clopton +%% +People will accept your ideas much more readily if +you tell them that Benjamin Franklin said it first. +%% +There are three ways to get something done: + + 1: Do it yourself. + 2: Hire someone to do it for you. + 3: Forbid your kids to do it. +%% +Dirksen's Three Laws of Politics: + + 1: Get elected. + 2: Get re-elected. + 3: Don't get mad, get even. + -- Sen. Everett Dirksen +%% +The alarm clock that is louder than God's own +belongs to the roommate with the earliest class. +%% +The first rule of intelligent tinkering is to save all the parts. +%% +Never ask the barber if you need a haircut. +%% +When forecasting, give them a number +or give them a date, but never both. +%% +An economist is a man who would marry +Farrah Fawcett-Majors for her money. +%% +The herd instinct among economists +makes sheep look like independent thinkers. +%% +Dear Lord: + I just want a one-armed manager so I + never have to hear "On the other hand", again. +%% +17th Rule of Friendship: + +A friend will refrain from telling you he picked up the same amount +of life insurance coverage you did for half the price when yours is +noncancellable. + -- Esquire, May 1977 +%% +The meek shall inherit the earth, but *not* its mineral rights. + -- J.P. Getty +%% +A verbal contract isn't worth the paper it's written on. + -- S. Goldwyn +%% +Love is dope, not chicken soup. I mean, love is something to be passed +around freely, not spooned down someone's throat for their own good by a +Jewish mother who cooked it all by herself. +%% +All men have the right to wait in line. +%% +Everyone has the right, without exception, to equal pay for equal work. +Except for women. +%% +Each person has the right to take the subway. +%% +Each person has the right to take part in the management of public affairs +in his country, provided he has prior experience, a will to succeed, a +university degree, influential parents, good looks, a curriculum vitae, two +3 X 4 snapshots, and a good tax record. +%% +IBM Pollyanna Principle: + Machines should work. People should think. +%% +Needs are a function of what other people have. +%% +Give a small boy a hammer and he will find +that everything he encounters needs pounding. +%% +Where are the calculations that go with a calculated risk? +%% +Last guys don't finish nice. +%% +Everything that you read in a newspaper is absolutely true, except +for that rare story of which you happen to have firsthand knowledge. +%% +Sanity and insanity overlap a fine grey line. +%% +Being frustrated is disagreeable, but the real +disasters in life begin when you get what you want. +%% +Lawyer's Rule: + When the law is against you, argue the facts. + When the facts are against you, argue the law. + When both are against you, call the other lawyer names. +%% +Never say "Oops" in an operating room. +%% +There's amnesia in a hangknot, +And comfort in the ax, +But the simple way of poison will make your nerves relax. + There's surcease in a gunshot, + And sleep that comes from racks, + But a handy draft of poison avoids the harshest tax. +You find rest on the hot squat, +Or gas can give you pax, +But the closest corner chemist has peace in packaged stacks. + There's refuge in the church lot + When you tire of facing facts, + And the smoothest route is poison prescribed by kindly quacks. +Chorus: With an *ugh!* and a groan, and a kick of the heels, + Death comes quiet, or it comes with squeals -- + But the pleasantest place to find your end + Is a cup of cheer from the hand of a friend. + -- Jubal Harshaw, "One For The Road" +%% +And I will do all these good works, and I will do them for free! +My only reward will be a tombstone that says "Here lies Gomez +Addams -- he was good for nothing." + -- Jack Sharkey, The Addams Family +%% +Yeah, if it looks like a duck, and walks like +a duck, and quacks like a duck -- shoot it. +%% +This is supposed to be a happy occasion. +Let's not BICKER and ARGUE over who killed who! +%% +The Lord giveth and the Lord taketh away. +Indian Giver be the name of the Lord. +%% +How much for your women? I want to buy your +daughter... how much for the little girl? + -- Jake Blues, "The Blues Brothers" +%% +Q: How many marketing people does it take to change a lightbulb? +A: I'll have to get back to you on that. +%% +The thrill is here, but it won't last long +You'd better have your fun before it moves along... +%% +If God is dead, who will save the Queen? +%% + A man sank into the psychiatrist's couch and said, "I have a +terrible problem, Doctor. I have a son at Harvard and another son at +Princeton; I've just gifted each of them with a new Ferrari; I've got +homes in Beverly Hills, Palm Beach, and a co-op in New York; and I've +got a thriving ranch in Venezuela. My wife is a gorgeous young actress +who considers my two mistresses to be her best friends." + The psychiatrist looked at the patient, confused. "Did I miss +something? It sounds to me like you have no problems at all." + "But, Doctor, I only make $175 a week." +%% +Surly to bed, surly to rise, makes you about average. +%% +Whenever people agree with me I always feel I must be wrong. + -- Oscar Wilde +%% +ARIES (Mar. 21 to Apr. 19) + Be cheerful today. People who don't like you will outnumber those + who do. You have warts. Focus on domestic status, financial matters, + and venereal disease. Look for involvement with Libra or Aquarius + natives; probably a fistfight with one of each. +%% +TAURUS (Apr. 20 to May 20) + Let your self-confidence and determination shine, and people will + find you boorish and headstrong. Travel, promotion, and romance + highlighted, if you live long enough. Don't take any wooden nickels. +%% +GEMINI (May 21 to Jun. 20) + Good news and bad news highlighted. Enjoy the good news while you + can; the bad news will make you forget it. You will enjoy praise + and respect from those around you; everybody loves a sucker. A short + trip is in the stars, possibly to the men's room. +%% +LEO (Jul. 23 to Aug. 22) + Your presence, poise, charm and good looks won't even help you today. + Look over your shoulder; an ugly person may be following you. Be on + your toes. Brush your teeth. Take Geritol. +%% +VIRGO (Aug. 23 to Sep. 22) + Get it in writing. Be careful. You are surrounded by lechers and + assholes; birds of a feather flock together. Trust no one. People + will not be offended, because they've come to recognize you for the + paranoid neurotic that you are. Your dentures are loose. +%% +LIBRA (Sep. 23 to Oct. 22) + Your desire for justice and truth will be overshadowed by your desire + for filthy lucre and a decent meal. Be gracious and polite. Someone + is watching you, so stop staring like that. +%% +SCORPIO (Oct. 23 to Nov. 21) + Friends abound today, seeking repayment of past loans. Smile. Check + for concealed weapons. Your natural cheerfulness makes others want + to throw up. Knock it off. +%% +SAGITTARIUS (Nov. 22 to Dec. 21) + Move slowly today, be deliberate. Indications are for bleeding + ulcers. Drink milk. Try not to be your usual offensive and + obnoxious self. Call your mother. +%% +CAPRICORN (Dec. 22 to Jan. 19) + Follow your instincts. You are much too scatterbrained to do anything + else, such as think. Romance is in the air, but not for you, so forget + it. That pimple on the end of your nose will get worse. +%% +AQUARIUS (Jan. 20 to Feb. 18) + A friend will step forward and confide in you about your breath. Rely + on your outgoing personality and winning smile to get you into a lot + of trouble. Be relaxed, things will change. Look for a pink slip on + payday. Stop wetting your bed. +%% +PISCES (Feb. 19 to Mar. 20) + Take the high road, look for the good things, carry the American + Express card and a weapon. The world is yours today, as nobody + else wants it. Your mortgage will be foreclosed. You will probably + get run over by a bus. +%% +Hacking's just another word for nothing left to kludge. +%% +Most folks they like the daytime, + 'cause they like to see the shining sun. +They're up in the morning, + off and a-running till they're too tired for having fun. +But when the sun goes down, + and the bright lights shine, my daytime has just begun. + +Now there are two sides to this great big world, + and one of them is always night. +If you can take care of business in the sunshine, baby, + I guess you're gonna be all right. +Don't come looking for me to lend you a hand. + My eyes just can't stand the light. + +'Cause I'm a night owl honey, sleep all day long. + -- Carly Simon +%% +Real Programs don't use shared text. Otherwise, how can they +use functions for scratch space after they are finished calling them? +%% +We're constantly being bombarded by insulting and humiliating music, which +people are making for you the way they make those Wonder Bread products. +Just as food can be bad for your system, music can be bad for your spirtual +and emotional feelings. It might taste good or clever, but in the long run, +it's not going to do anything for you. + -- Bob Dylan, "LA Times", September 5, 1984 +%% +There once was a man from Nantucket +Who kept all his cash in a bucket. + His daughter, named Nan, + Ran away with a man, +And as for the bucket, Nantucket. + +The pair of them went to Manhasset, +(Nan and the man with the asset.) + Pa followed them there, + But they left in a tear, +And as for the asset, Manhasset. + +Pa followed the pair to Pawtucket, +(Nan and the man with the bucket.) + Pa said to the man, + "You're welcome to Nan." +But as for the bucket, Pawtucket. +%% +If ever the pleasure of one has to be bought by the pain of the other, +there better be no trade. A trade by which one gains and the other loses +is a fraud. + -- Dagny Taggart, "Atlas Shrugged" +%% +When a girl admits she's had a checkered career, it's your move. +%% +Ah, sweet Springtime, when a young man lightly turns his fancy over! +%% +A pig is a jolly companion, +Boar, sow, barrow, or gilt -- +A pig is a pal, who'll boost your morale, +Though mountains may topple and tilt. +When they've blackballed, bamboozled, and burned you, +When they've turned on you, Tory and Whig, +Though you may be thrown over by Tabby and Rover, +You'll never go wrong with a pig, a pig, +You'll never go wrong with a pig! + -- Thomas Pynchon, "Gravity's Rainbow" +%% +Q: Why are Jewish divorces so expensive? +A: Because they're worth it! +%% +In these days +Of toil and sin +Your head grows bald +But not your chin + -- Burma Shave +%% +Beware of mathematicians and all those who make empty prophecies. +The danger already exists that the mathematicians have made covenant +with the devil to darken the spirit and to confine man in the bonds +of hell. + -- St. Augustine +%% +Your boss is a few sandwiches short of a picnic. +%% +Anyone stupid enough to be caught by the police is probably guilty. +%% +Would you like to be tried in court by people +who weren't smart enough to get out of jury duty? +%% +Q: What's black and white and red all over? +A: Two nuns in a chainsaw fight. +%% +Once upon a time there was a kingdom ruled by a great bear. The peasants +were not very rich, and one of the few ways to become at all wealthy was +to become a Royal Knight. This required an interview with the bear. If +the bear liked you, you were knighted on the spot. If not, the bear would +just as likely remove your head with one swat of a paw. However, the family +of these unfortunate would-be knights was compensated with a beautiful +sheepdog from the royal kennels, which was itself a fairly valuable +possession. And the moral of the story is: + +The mourning after a terrible knight, nothing beats the dog of the bear that +hit you. +%% +But I always fired into the nearest hill or, failing that, into blackness. +I meant no harm; I just liked the explosions. And I was careful never to +kill more than I could eat. + -- Raoul Duke +%% +Macho, adj.: + Jogging home from your vasectomy. +%% +According to convention there is a sweet and a bitter, a hot and a cold, +and according to convention, there is an order. In truth, there are atoms +and a void. + -- Democritus, 400 B.C. +%% + One fine day, the bus driver went to the bus garage, started his bus, +and drove off along the route. No problems for the first few stops -- a few +people got on, a few got off, and things went generally well. At the next +stop, however, a big hulk of a guy got on. Six feet eight, built like a +wrestler, arms hanging down to the ground. He glared at the driver and said, +"Big John doesn't pay!" and sat down at the back. + Did I mention that the driver was five feet three, thin, and basically +meek? Well, he was. Naturally, he didn't argue with Big John, but he wasn't +happy about it. Well, the next day the same thing happened -- Big John got on +again, made a show of refusing to pay, and sat down. And the next day, and the +one after that, and so forth. This grated on the bus driver, who started +losing sleep over the way Big John was taking advantage of him. Finally he +could stand it no longer. He signed up for bodybuilding courses, karate, judo, +and all that good stuff. By the end of the summer, he had become quite strong; +what's more, he felt really good about himself. + So on the next Monday, when Big John once again got on the bus +and said "Big John doesn't pay!," the driver stood up, glared back at the +passenger, and screamed, "And why not?" + With a surprised look on his face, Big John replied, "Big John has a +bus pass." +%% +The soldier came knocking upon the queen's door +He said, "I am not fighting for you anymore" +The queen knew she had seen his face someplace before +And slowly she let him inside. + +He said, "I see you now, and you're so very young +But I've seen more battles lost than I have battles won +And I have this intuition that it's all for your fun +And now will you tell me why?" + -- Suzanne Vega, "The Queen and The Soldier" +%% +And if you wonder, +What I am doing, +As I am heading for the sink. +I am spitting out all the bitterness, +Along with half of my last drink. +%% +Oh I'm just a typical American boy +From a typical American town. +I believe in God and Senator Dodd +And keeping old Castro down. +And when it came my time to serve +I knew "Better Dead Than Red", +But when I got to my old draft board, +Buddy, this is what I said: + +Chorus: + Sarge, I'm only eighteen, I've got a ruptured spleen, + And I always carry a purse! + I've got eyes like a bat and my feet are flat, + And my asthma's getting worse! + Yes, think of my career and my sweetheart dear, + And my poor old invalid aunt! + Besides I ain't no fool, I'm a-going to school + And I'm a-working in a defense plant! + -- Phil Ochs, "Draft Dodger Rag" +%% +At Group L, Stoffel oversees six first-rate programmers, +a managerial challenge roughly comparable to herding cats. + -- "The Washington Post Magazine", June 9, 1985 +%% +The IBM purchase of ROLM gives new meaning to the term "twisted pair". + -- Howard Anderson, "Yankee Group" +%% +We were so poor that we thought new clothes meant someone had died. +%% +Hi. I'm Larry. This is my brother Bob, and this is my other brother +Jimbo. We thought you might like to know the names of your assailants. +%% +Fame is a vapor; popularity an accident; +the only earthly certainty is oblivion. + -- Mark Twain +%% +If men are not afraid to die, +it is of no avail to threaten them with death. + +If men live in constant fear of dying, +And if breaking the law means a man will be killed, +Who will dare to break the law? + +There is always an official executioner. +If you try to take his place, +It is like trying to be a master carpenter and cutting wood. +If you try to cut wood like a master carpenter, + you will only hurt your hand. + -- Tao Te Ching, "Lao Tsu, #74" +%% +"Any news from the President on a successor?" he asked hopefully. +"None," Anita replied. "She's having great difficulty finding someone +qualified who is willing to accept the post." + "Then I stay," said Dr. Fresh. "I'm not good for much, but I +can at least make a decision." + "Somewhere," he grumphed, "there must be a naive, opportunistic +young welp with a masochistic streak who would like to run the most +up-and-down bureaucracy in the history of mankind." + -- R. L. Forward, "Flight of the Dragonfly" +%% + They are fools that think that wealth or women or strong drink or even +drugs can buy the most in effort out of the soul of a man. These things offer +pale pleasures compared to that which is greatest of them all, that task which +demands from him more than his utmost strength, that absorbs him, bone and +sinew and brain and hope and fear and dreams -- and still calls for more. + They are fools that think otherwise. No great effort was ever bought. +No painting, no music, no poem, no cathedral in stone, no church, no state was +ever raised into being for payment of any kind. No parthenon, no Thermopylae +was ever built or fought for pay or glory; no Bukhara sacked, or China ground +beneath Mongol heel, for loot or power alone. The payment for doing these +things was itself the doing of them. + To wield onself -- to use oneself as a tool in one's own hand -- and +so to make or break that which no one else can build or ruin -- THAT is the +greatest pleasure known to man! To one who has felt the chisel in his hand +and set free the angel prisoned in the marble block, or to one who has felt +sword in hand and set homeless the soul that a moment before lived in the body +of his mortal enemy -- to those both come alike the taste of that rare food +spread only for demons or for gods." + -- Gordon R. Dickson, "Soldier Ask Not" +%% +There are only two things in this world that I am sure of, death and +taxes, and we just might do something about death one of these days. + -- shades +%% +Violence stinks, no matter which end of it you're on. But now and then +there's nothing left to do but hit the other person over the head with a +frying pan. Sometimes people are just begging for that frypan, and if we +weaken for a moment and honor their request, we should regard it as +impulsive philanthropy, which we aren't in any position to afford, but +shouldn't regret it too loudly lest we spoil the purity of the deed. + -- Tom Robbins +%% +Stenderup's Law: + The sooner you fall behind, the more time you will have to catch up. +%% +In this vale +Of toil and sin +Your head grows bald +But not your chin. + -- Burma Shave +%% +Old mercenaries never die. They go to hell and regroup. +%% +Sex is about as important as a cheese sandwich. But a cheese sandwich, +if you ain't got one to put in your belly, is extremely important. + -- Ian Dury +%% +I consider a new device or technology to have been +culturally accepted when it has been used to commit a murder. + -- M. Gallaher +%% +Money can't buy happiness, but it can make you +awfully comfortable while you're being miserable. + -- C.B. Luce +%% +"I said, "Preacher, give me strength for round 5." +He said,"What you need is to grow up, son." +I said,"Growin' up leads to growin' old, +And then to dying, and to me that don't sound like much fun." + -- John Cougar, "The Authority Song" +%% + A group of soldiers being prepared for a practice landing on a tropical +island were warned of the one danger the island held, a poisonous snake that +could be readily identified by its alternating orange and black bands. They +were instructed, should they find one of these snakes, to grab the tail end of +the snake with one hand and slide the other hand up the body of the snake to +the snake's head. Then, forcefully, bend the thumb above the snake's head +downward to break the snake's spine. All went well for the landing, the +charge up the beach, and the move into the jungle. At one foxhole site, two +men were starting to dig and wondering what had happened to their partner. +Suddenly he staggered out of the underbrush, uniform in shreds, covered with +blood. He collapsed to the ground. His buddies were so shocked they could +only blurt out, "What happened?" + "I ran from the beachhead to the edge of the jungle, and, as I hit the +ground, I saw an orange and black striped snake right in front of me. I +grabbed its tail end with my left hand. I placed my right hand above my left +hand. I held firmly with my left hand and slid my right hand up the body of +the snake. When I reached the head of the snake I flicked my right thumb down +to break the snake's spine... did you ever goose a tiger?" +%% +After I run your program, let's make love like crazed weasels, OK? +%% +It seems that there was this Christian about to be thrown to the lions. He +was shoved into the middle of the arena and the lion was released. Being +a good Christian, as the lion approached he knelt and prayed, asking God for +forgiveness for his (few) sins, and begging that the lion might be dissuaded +from eating him for its breakfast. Much to his dismay, the lion didn't stop +but kept coming, getting faster and faster, now almost running, so the +Christian took off too. There they were, running around and around the arena, +the lion getting closer and the Christian praying harder and harder between +gasps for breath. The lions breath was now hot upon his heels and he could +even feel droplets of the lions saliva splashing on his bare feet. So he +pulled out all the stops, promising God that if the lion will only spare him, +he will devote the rest of his life to spreading the Christian faith, +forsaking all temptation and possessions. Suddenly he no longer felt the +lions breath, no longer heard the great beast's snarls close behind him. +Slowing to a stop, he turned around and saw the lion on its knees, eyes rolled +upward, paws held together. The lion appeared to be muttering something so +the Christian approached until he could make out what the lion was saying. + "Dear Lord, for what I am about to receive..." +%% +I think I'm schizophrenic. One half of me's +paranoid and the other half's out to get him. +%% +Micro Credo: + Never trust a computer bigger than you can lift. +%% +Once upon this midnight incoherent, +While you pondered sentient and crystalline, +Over many a broken and subordinate +Volume of gnarly lore, +While I pestered, nearly singing, +Sudddenly there came a hewing, +As of someone profusely skulking, +Skulking at my chamber door. +%% +Ahhhhhh... the smell of cuprinol and mahogany. It +excites me to... acts of passion... acts of... ineptitude. +%% +The perversity of nature is nowhere better demonstrated by the fact that, +when exposed to the same atmosphere, bread becomes hard while crackers +become soft. +%% +An effective way to deal with predators is to taste terrible. +%% +The best thing that comes out of Iowa is I-80. +%% +What this country needs is a good 5 dollar plasma weapon. +%% +I shot a query into the net. +I haven't got an answer yet, A posted message called me rotten +But seven people gave me hell For ignoring mail I'd never gotten; +And said I ought to learn to spell; An angry message asked me, Please + Don't send such drivel overseas; +A lawyer sent me private mail +And swore he'd slap my ass in jail -- One netter thought it was a hoax: +I'd mentioned Un*x in my gem "Hereafter, post to net dot jokes!"; +And failed to add the T and M; Another called my grammar vile + And criticized my writing style. +Each day I scan each Subject line +In hopes the topic will be mine; +I shot a query into the net. +I haven't got an answer yet... + -- Ed Nather +%% + "What are you watching?" + "I don't know." + "Well, what's happening?" + "I'm not sure... I think the guy in the hat did +something terrible." + "Why are you watching it?" + "You're so analytical. Sometimes you just have to let +art flow over you." + -- The Big Chill +%% +Every morning in Africa, a gazelle wakes up. It knows it must run faster +than the fastest lion or it will be killed. Every morning a lion wakes up. +It knows it must outrun the slowest gazelle or it will starve to death. +It doesn't matter whether you are a lion or a gazelle: when the sun comes +up, you'd better be running. +%% +I attribute my success to intelligence, guts, determination, honesty, +ambition, and having enough money to buy people with those qualities. +%% +Has everyone noticed that all the letters of the word "database" are typed +with the left hand? Now the layout of the QWERTYUIOP typewriter keyboard +was designed, among other things, to facilitate the even use of both hands. +It follows, therefore, that writing about databases is not only unnatural, +but a lot harder than it appears. +%% +You're not drunk if you can lie on the floor without holding on. + -- Dean Martin +%% +Being in politics is like being a football coach. You have to be smart +enough to understand the game and dumb enough to think it's important. + -- Eugene McCarthy +%% +Don't stop to stomp ants when the elephants are stampeding. +%% +Decisions of the judges will be final unless shouted down by a really over- +whelming majority of the crowd present. Abusive and obscene language may +not be used by contestants when addressing members of the judging panel, +or, conversely, by members of the judging panel when addressing contestants +(unless struck by a boomerang). + -- Mudgeeraba Creek Emu-Riding and Boomerang-Throwing Assoc. +%% +If two wrongs don't make a right, try three wrongs. +%% +For every human problem, there is a neat, +plain solution -- and it is always wrong. + -- H.L. Mencken +%% + Phases of a Project: +(1) Exultation. +(2) Disenchantment. +(3) Confusion. +(4) Search for the Guilty. +(5) Punishment for the Innocent. +(6) Distinction for the Uninvolved. +%% +The race is not always to the swift, nor the +battle to the strong, but that's the way to bet. + -- Damon Runyon +%% +Good salesmen and good repairmen will never go hungry. + -- R.E. Schenk +%% +O Lord, grant that we may always be right, +for Thou knowest we will never change our minds. +%% +The chief cause of problems is solutions. + -- E. Sevareid +%% +Half of being smart is knowing what you're dumb at. +%% +Finality is death. +Perfection is finality. +Nothing is perfect. +There are lumps in it. +%% +(1) Office employees will daily sweep the floors, dust the + furniture, shelves, and showcases. +(2) Each day fill lamps, clean chimneys, and trim wicks. + Wash the windows once a week. +(3) Each clerk will bring a bucket of water and a scuttle of + coal for the day's business. +(4) Make your pens carefully. You may whittle nibs to your + individual taste. +(5) This office will open at 7 a.m. and close at 8 p.m. except + on the Sabbath, on which day we will remain closed. Each + employee is expected to spend the Sabbath by attending + church and contributing liberally to the cause of the Lord. + -- "Office Worker's Guide", New England Carriage + Works, 1872 +%% +(6) Men employees will be given time off each week for courting + purposes, or two evenings a week if they go regularly to church. +(7) After an employee has spent his thirteen hours of labor in the + office, he should spend the remaining time reading the Bible + and other good books. +(8) Every employee should lay aside from each pay packet a goodly + sum of his earnings for his benefit during his declining years, + so that he will not become a burden on society or his betters. +(9) Any employee who smokes Spanish cigars, uses alcoholic drink + in any form, frequents pool tables and public halls, or gets + shaved in a barber's shop, will give me good reason to suspect + his worth, intentions, integrity and honesty. +(10) The employee who has performed his labours faithfully and + without a fault for five years, will be given an increase of + five cents per day in his pay, providing profits from the + business permit it. + -- "Office Worker's Guide", New England Carriage + Works, 1872 +%% +Ankh if you love Isis. +%% +Being a mime means never having to say you're sorry. +%% +Blood is thicker than water, and much tastier. +%% +Calm down, it's *only* ones and zeroes. +%% +Campus crusade for Cthulhu -- it found me. +%% +Chaos is King and Magic is loose in the world. +%% +Conquering Russia should be done steppe by steppe. +%% +Cthulhu for President -- + if you're tired of choosing the lesser of two evils. +%% +Cthulhu Saves -- in case He's hungry later. +%% +Dyslexics have more fnu. +%% +Eat the rich, the poor are tough and stringy. +%% +Entropy isn't what it used to be. +%% +Everyone was born right-handed. +Only the greatest overcome it. +%% +God is real, unless declared integer. +%% +"The hell with the prime directive! Let's kill something!" +%% +I don't have to take this abuse from you -- +I've got hundreds of people waiting to abuse me. + -- Bill Murray, "Ghostbusters" +%% +If people see that you mean them no harm, +they'll never hurt you, nine times out of ten! +%% +If voting could change the system, it would be illegal. +If not voting could change the system, it would be illegal. +%% +"I'm not stupid, I'm not expendable, and I'M NOT GOING!" +%% +It's hard to think of you as the end +result of millions of years of evolution. +%% +I have more hit points that you can possible imagine. +%% +Let me put it this way: today is going to be a learning experience. +%% +That's odd. That's very odd. +Wouldn't you say that's very odd? +%% +All intelligent species own cats. +%% +This must be morning. I never could get the hang of mornings. +%% +We came, we saw, we kicked its ass! + -- Bill Murray, "Ghostbusters" +%% +When Cthulhu calls, He calls collect! +%% +It would save me a lot of time if you just gave up and went mad now. +%% +When you get what you want in your struggle for self +And the world makes you king for a day, +Just go to a mirror and look at yourself +And see what that man has to say. + For it isn't your father or mother or wife + Whose judgement upon you must pass; + The fellow whose verdict counts most in your life + Is the one staring back from the glass. +Some people may think you a straight-shootin' chum +And call you a wonderful guy, +But the man in the glass says you're only a bum +If you can't look him straight in the eye. + He's the fellow to please, never mind all the rest, + For he's with you clear up to the end, + And you've passed your most dangerous, difficult test + If the man in the glass is your friend. +You may fool the whole world down the pathway of life +And get pats on the back as you pass, +But your final reward will be heartaches and tears +If you've cheated the man in the glass. +%% +A good name lost is seldom regained. When character is gone, +all is gone, and one of the richest jewels of life is lost forever. + -- J. Hawes +%% +My idea of roughing it is when room service is late. +%% +My idea of roughing it turning the air conditioner to low. +%% + Never ask your lover if he'd dive in front of an oncoming train for +you. He doesn't know. Never ask your lover if she'd dive in front of an +oncoming band of Hell's Angels for you. She doesn't know. Never ask how many +cigarettes your lover has smoked today. Cancer is a personal committment. + Never ask to see pictures of your lover's former lovers -- especially +the ones who dived in front of trains. If you look like one of them, you are +repeating history's mistakes. If you don't, you'll wonder what he or she saw +in the others. + While we are on the subject of pictures: You may admire the picture +of your lover cavorting naked in a tidal pool on Maui. Don't ask who took +it. The answer is obvious. A Japanese tourist took the picture. + Never ask if your lover has had therapy. Only people who have had +therapy ask if people have had therapy. + Don't ask about plaster casts of male sex organs marked JIMI, JIM, etc. +Assume that she bought them at a flea market. + -- James Peterson and Kate Nolan +%% +Eudaemonic research proceeded with the casual mania peculiar to this part of +the world. Nude sunbathing on the back deck was combined with phone calls to +Advanced Kinetics in Costa Mesa, American Laser Systems in Goleta, Automation +Industries in Danbury, Connecticut, Arenberg Ultrasonics in Jamaica Plain, +Massachusetts, and Hewlett Packard in Sunnyvale, California, where Norman +Packard's cousin, David, presided as chairman of the board. The trick was to +make these calls at noon, in the hope that out-to-lunch executives would return +them at their own expense. Eudaemonic Enterprises, for all they knew, might be +a fast-growing computer company branching out of the Silicon Valley. Sniffing +the possibility of high-volume sales, these executives little suspected that +they were talking on the other end of the line to a naked physicist crazed +over roulette. + -- Thomas Bass, "The Eudaemonic Pie" +%% +When you are about to die, a wombat is better than no company at all. + -- Roger Zelazny, "Doorways in the Sand" +%% +Don't know what time I'll be back, Mom. +Probably soon after she throws me out. +%% +And Bezel saideth unto Sham: "Sham," he saideth, "Thou shalt goest unto the +town of Begorrah, and there thou shalt fetcheth unto thine bosom 35 talents, +and also shalt thou fetcheth a like number of cubits, provideth that they +are nice and fresh." + -- Dave Barry, "Getting Religion" +%% +Aide to Raygun: Sir, the poor are outside protesting your budget cuts. +Raygun himself: Tell them they'll have to help themselves. +Aide to Raygun: Sir, the Pentagon wants another $30 billion. +Raygun himself: Tell them to help themselves. +%% +I realize that today you have a number of top female athletes such as +Martina Navratilova who can run like deer and bench-press Chevrolet +trucks. But to be brutally frank, women as a group have a long way to +go before they reach the level of intensity and dedication to sports +that enables men to be such incredible jerks about it. + -- Dave Barry, "Sports is a Drag" +%% +I own my own body, but I share. +%% +Lisp hackers have to be bound (to-do 'it) ... +%% +Our team usually puts the other woman at second base, where the maximum +possible number of males can get there on short notice to help out in case +of emergency. As far as I can tell, our second basewoman is a pretty good +baseball player, better than I am, anyway, but there's no way to know for +sure because if the ball gets anywhere near her, a male comes barging over +from, say, right field, to deal with it. She's been on the team for three +seasons now, but the males still don't trust her. They know, deep in their +souls, that if she had to choose between catching a fly ball and saving an +infant's life, she probably would elect to save the infant's life, without +ever considering whether there were men on base. + -- Dave Barry, "Sports is a Drag" +%% +Q: How do you play religious roulette? +A: You stand around in a circle and blaspheme and see who gets + struck by lightning first. +%% +Women who want to be equal to men lack imagination. +%% +Yes, that was Richard Nixon. He used to be President. When he left +the White House, the Secret Service would count the silverware. + -- Woody Allen, "Sleeper" +%% +The difference between reality and unreality +is that reality has so little to recommend it. + -- Allan Sherman +%% +Children are like cats, they can tell when you don't like +them. That's when they come over and violate your body space. +%% + Looking for a cool one after a long, dusty ride, the drifter strode +into the saloon. As he made his way through the crowd to the bar, a man +galloped through town screaming, "Big Mike's comin'! Run fer yer lives!" + Suddenly, the saloon doors burst open. An enormous man, standing over +eight feet tall and weighing an easy 400 pounds, rode in on a bull, using a +rattlesnake for a whip. Grabbing the drifter by the arm and throwing him over +the bar, the giant thundered, "Gimme a drink!" + The terrified man handed over a bottle of whiskey, which the man +guzzled in one gulp and then smashed on the bar. He then stood aghast as +the man stuffed the broken bottle in his mouth, munched broken glass and +smacked his lips with relish. + "Can I, ah, uh, get you another, sir?" the drifter stammered. + "Naw, I gotta git outa here, boy," the man grunted. "Big Mike's +a-comin'." +%% +If you marry a man who cheats on his wife, you'll +be married to a man who cheats on his wife. + -- Ann Landers +%% +A rabbi and a priest are sitting together on a train, and the rabbi leans +over and asks, "So, how high can you advance in your organization?" + The priest replies, "Well, if I am lucky, I guess I could become a +Bishop." + "Well, could you get any higher than that?" + "I suppose that if my works are seen in a very good light that I +might be made an Archbishop." + "Is there any way that you might go higher than that?" + "If all the Saints should smile, I guess I could be made a Cardinal." + "Could you be anything higher than a Cardinal?" + Hesitating a little bit, the priest said, "I supose that I could +be elected Pope, but only if it's God's will." + "And could you be anything higher than that, is there any way to go +up from being the Pope?" + "What?! I should be the Messiah himself?!" + The rabbi leaned back and smiled. "One of our boys made it." +%% +One dusty July afternoon, somewhere around the turn of the century, Patrick +Malone was in Mulcahey's Bar, bending an elbow with the other street car +conductors from the Brooklyn Traction Company. While they were discussing the +merits of a local ring hero, the bar goes silent. Malone turns around to see +his wife, with a face grim as death, stalking to the bar. + Slapping a four-bit piece down on the bar, she draws herself up to her +full five feet five inches and says to Mulcahey, "Give me what himself has +been havin' all these years." + Mulcahey looks at Malone, who shrugs, and then back at Margaret Mary +Malone. He sets out a glass and pours her a triple shot of Rye. The bar is +totally silent as they watch the woman pick up the glass and knock back the +drink. She slams the glass down on the bar, gasps, shudders slightly, and +passes out; falling straight back, stiff as a board, saved from sudden contact +with the barroom floor by the ample belly of Seamus Fogerty. + Sometime later, she comes to on the pool table, a jacket under her +head. Her bloodshot eyes fell upon her husband, who says, "And all these +years you've been thinkin' I've been enjoying meself." +%% +I used to think I was a child; now I think I am an adult -- not because +I no longer do childish things, but because those I call adults are no +more mature than I am. +%% +When in doubt, tell the truth. + -- Mark Twain +%% +Save the whales. Collect the whole set. +%% +"Do you think what we're doing is wrong?" +"Of course it's wrong! It's illegal!" +"I've never done anything illegal before." +"I thought you said you were an accountant." +%% +"The pyramid is opening!" +"Which one?" +"The one with the ever-widening hole in it!" +%% +Calling J-Man Kink. Calling J-Man Kink. Hash missle sighted, target +Los Angeles. Disregard personal feelings about city and intercept. +%% +Well, if you can't believe what you read +in a comic book, what *can* you believe? + -- Bullwinkle J. Moose +%% +I want to buy a husband who, every week when I sit down to watch "St. +Elsewhere", won't scream, "Forget it, Blanche... It's time for Hee-Haw!" +%% +Bullwinkle: You just leave that to my pal. He's the brains of the outfit. +General: What does that make YOU? +Bullwinkle: What else? An executive. +%% +His super power is to turn into a scotch terrier. +%% +What with chromodynamics and electroweak too +Our Standardized Model should please even you, +Tho' once you did say that of charm there was none +It took courage to switch as to say Earth moves not Sun. +Yet your state of the union penultimate large +Is the last known haunt of the Fractional Charge, +And as you surf in the hot tub with sourdough roll +Please ponder the passing of your sole Monopole. +Your Olympics were fun, you should bring them all back +For transsexual tennis or Anamalon Track, +But Hollywood movies remain sinfully crude +Whether seen on the telly or Remotely Viewed. +Now fasten your sunbelts, for you've done it once more, +You said it in Leipzig of the thing we adore, +That you've built an incredible crystalline sphere +Whose German attendants spread trembling and fear +Of the death of our theory by Particle Zeta +Which I'll bet is not there say your article, later. + -- Sheldon Glashow, Physics Today, December, 1984 +%% +I don't believe in astrology. But then I'm an +Aquarius, and Aquarians don't believe in astrology. + -- James Quirk +%% +It's not an optical illusion, it just looks like one. + -- Phil White +%% +I am changing my name to Chrysler +I am going down to Washington, D.C. +I will tell some power broker + What they did for Iacocca +Will be perfectly acceptable to me! + +I am changing my name to Chrysler, +I am heading for that great receiving line. +When they hand a million grand out, + I'll be standing with my hand out, +Yessir, I'll get mine! +%% +Yesterday upon the stair +I met a man who wasn't there. +He wasn't there again today -- +I think he's from the CIA. +%% +The bland leadeth the bland and they both shall fall into the kitsch. +%% +When in doubt, use brute force. + -- Ken Thompson +%% +If the code and the comments disagree, then both are probably wrong. + -- Norm Schryer +%% +Don't get suckered in by the comments -- they +can be terribly misleading. Debug only code. + -- Dave Storer +%% +Maintainer's Motto: + If we can't fix it, it ain't broke. +%% +The First Rule of Program Optimization: + Don't do it. + +The Second Rule of Program Optimization (for experts only!): + Don't do it yet. + -- Michael Jackson +%% +One Page Principle: + A specification that will not fit on one page + of 8.5x11 inch paper cannot be understood. + -- Mark Ardis +%% +Furious activity is no substitute for understanding. + -- H. H. Williams +%% +God must have loved calories, she made so many of them. +%% +Just a few of the perfect excuses for having some strawberry shortcake. +Pick one. + +1: It's less calories than two pieces of strawberry shortcake. +2: It's cheaper than going to France. +3: It neutralizes the brownies I had yesterday. +4: Life is short. +5: It's somebody's birthday. I don't want them to celebrate alone. +6: It matches my eyes. +7: Whoever said, "Let them eat cake." must have been talking to me. +8: To punish myself for eating dessert yesterday. +9: Compensation for all the time I spend in the shower not eating. +10: Strawberry shortcake is evil. I must help rid the world of it. +11: I'm getting weak from eating all that healthy stuff. +12: It's the second anniversary of the night I ate plain broccoli. +%% +Asked how she felt being the first woman to make a major-league team, she +said, "Like a pig in mud," or words to that effect, and then turned and +released a squirt of tobacco juice from the wad of rum soaked plug in her +right cheek. She chewed a rare brand of plug called Stuff It, which she +learned to chew when she was playing Nicaraguan summer ball. She told the +writers, "They were so mean to me down there you couldn't write it in your +newspaper. I took a gun everywhere I went, even to bed. *Especially* to +bed. Guys were after me like you can't believe. That's when I started +chewing tobacco -- because no matter how bad anybody treats you, it's not +as bad as this. This is the worst chew in the world. After this, +everything else is peaches and cream." The writers elected Gentleman Jim, +the Sparrow's P.R. guy, to bite off a chunk and tell them how it tasted, +and as he sat and chewed it tears ran down his old sunburnt cheeks and he +couldn't talk for a while. Then he whispered, "You've been chewing this for +two years? God, I had no idea it was so hard to be a woman." + -- Garrison Keillor +%% +Vermouth always makes me brilliant unless it makes me idiotic. + -- E.F. Benson +%% +"Life is like a buffet; it's not good but there's plenty of it." +%% +I have come up with a surefire concept for a hit television show, which +would be called "A Live Celebrity Gets Eaten by a Shark." + -- Dave Barry, "The Wonders of Sharks on TV" +%% +The human race has been fascinated by sharks for as long as I can +remember. Just like the bluebird feeding its young, or the spider +struggling to weave its perfect web, or the buttercup blooming in +spring, the shark reveals to us yet another of the infinite and +wonderful facets of nature, namely the facet that it can bite your head +off. This causes us humans to feel a certain degree of awe. + -- Dave Barry, "The Wonders of Sharks on TV" +%% + So Richard and I decided to try to catch [the small shark]. +With a great deal of strategy and effort and shouting, we managed to +maneuver the shark, over the course of about a half-hour, to a sort of +corner of the lagoon, so that it had no way to escape other than to +flop up onto the land and evolve. Richard and I were inching toward +it, sort of crouched over, when all of a sudden it turned around and -- +I can still remember the sensation I felt at that moment, primarily in +the armpit area -- headed right straight toward us. + Many people would have panicked at this point. But Richard and +I were not "many people." We were experienced waders, and we kept our +heads. We did exactly what the textbook says you should do when you're +unarmed and a shark that is nearly two feet long turns on you in water +up to your lower calves: We sprinted I would say 600 yards in the +opposite direction, using a sprinting style such that the bottoms of +our feet never once went below the surface of the water. We ran all +the way to the far shore, and if we had been in a Warner Brothers +cartoon we would have run right INTO the beach, and you would have seen +these two mounds of sand racing across the island until they bonked +into trees and coconuts fell onto their heads. + -- Dave Barry, "The Wonders of Sharks on TV" +%% +... So the documentary-makers stick with sharks. Generally, their +procedure is to scatter bleeding fish pieces around their boat, so as +to infest the waters. I would estimate that the primary food source of +sharks today is bleeding fish pieces scattered by people making +documentaries. Once the sharks arrive, they are generally fairly +listless. The general shark attitude seems to be: "Oh God, another +documentary." So the divers have to somehow goad them into attacking, +under the guise of Scientific Research. "We know very little about the +effect of electricity on sharks," the narrator will say, in a deeply +scientific voice. "That is why Todd is going to jab this Great White +in the testicles with a cattle prod." The divers keep this kind of +thing up until the shark finally gets irritated and snaps at them, and +then they act as though this was a totally unexpected and very +dangerous development, although clearly it is what they wanted all along. + -- Dave Barry, "The Wonders of Sharks on TV" +%% +"Of course it's the murder weapon. +Who would frame someone with a fake?" +%% + Lassie looked brilliant, in part because the farm family she +lived with was made up of idiots. Remember? One of them was always +getting pinned under the tractor, and Lassie was always rushing back to +the farmhouse to alert the other ones. She'd whimper and tug at their +sleeves, and they'd always waste precious minutes saying things: "Do +you think something's wrong? Do you think she wants us to follow her? +What is it, girl?", etc., as if this had never happened before, instead +of every week. What with all the time these people spent pinned under +the tractor, I don't see how they managed to grow any crops whatsoever. +They probably got by on federal crop supports, which Lassie filed the +applications for. + -- Dave Barry +%% + Excellence is THE trend of the '80s. Walk into any shopping +mall bookstore, go to the rack where they keep the best-sellers such as +"Garfield Gets Spayed", and you'll see a half-dozen books telling you +how to be excellent: "In Search of Excellence", "Finding Excellence", +"Grasping Hold of Excellence", "Where to Hide Your Excellence at Night +So the Cleaning Personnel Don't Steal It", etc. + -- Dave Barry, "In Search of Excellence" +%% + Take the folks at Coca-Cola. For many years, they were content +to sit back and make the same old carbonated beverage. It was a good +beverage, no question about it; generations of people had grown up +drinking it and doing the experiment in sixth grade where you put a +nail into a glass of Coke and after a couple of days the nail dissolves +and the teacher says: "Imagine what it does to your TEETH!" So Coca-Cola +was solidly entrenched in the market, and the management saw no need to +improve ... + -- Dave Barry, "In Search of Excellence" +%% + ... This striving for excellence extends into people's +personal lives as well. When '80s people buy something, they buy the +best one, as determined by (1) price and (2) lack of availability. +Eighties people buy imported dental floss. They buy gourmet baking +soda. If an '80s couple goes to a restaurant where they have made a +reservation three weeks in advance, and they are informed that their +table is available, they stalk out immediately, because they know it is +not an excellent restaurant. If it were, it would have an enormous +crowd of excellence-oriented people like themselves waiting, their +beepers going off like crickets in the night. An excellent restaurant +wouldn't have a table ready immediately for anybody below the rank of +Liza Minnelli. + -- Dave Barry, "In Search of Excellence" +%% +An excellence-oriented '80s male does not wear a regular watch. He wears +a Rolex watch, because it weighs nearly six pounds and is advertised +only in excellence-oriented publications such as Fortune and Rich +Protestant Golfer Magazine. The advertisements are written in +incomplete sentences, which is how advertising copywriters denote +excellence: + +"The Rolex Hyperion. An elegant new standard in quality excellence and +discriminating handcraftsmanship. For the individual who is truly able +to discriminate with regard to excellent quality standards of crafting +things by hand. Fabricated of 100 percent 24-karat gold. No watch +parts or anything. Just a great big chunk on your wrist. Truly a +timeless statement. For the individual who is very secure. Who +doesn't need to be reminded all the time that he is very successful. +Much more successful than the people who laughed at him in high +school. Because of his acne. People who are probably nowhere near as +successful as he is now. Maybe he'll go to his 20th reunion, and +they'll see his Rolex Hyperion. Hahahahahahahahaha." + -- Dave Barry, "In Search of Excellence" +%% +Brillineggiava, ed i tovoli slati + girlavano ghimbanti nella vaba; +i borogovi eran tutti mimanti + e la moma radeva fuorigraba. + +"Figliuolo mio, sta' attento al Gibrovacco, + dagli artigli e dal morso lacerante; +fuggi l'uccello Giuggiolo, e nel sacco + metti infine il frumioso Bandifante". + -- "The Jabberwock" +%% +Dimensions will always be expressed in the least usable term, convertible +only through the use of weird and unnatural conversion factors. Velocity, +for example, will be expressed in furlongs per fortnight. +%% +The primary theme of SoupCon is communication. The acronym "LEO" +represents the secondary theme: + + Law Enforcement Officials + +The overall theme of SoupCon shall be: + + Avoiding Communication with Law Enforcement Officials + -- M. Gallaher +%% +While having never invented a sin, +I'm trying to perfect several. +%% +Chef, n: + Any cook who swears in French. +%% +Gourmet, n: + Anyone whom, when you fail to finish something strange or + revolting, remarks that it's an acquired taste and that you're + leaving the best part. +%% + FROM THE DESK OF + Rapunzel + +Dear Prince: + + Use ladder tonight -- + you're splitting my ends. +%% + FROM THE DESK OF + Snow White + +Dear Snow White: + + Thanks for last night. + + Sleepy, Doc, Grumpy, Sneezy, Happy, Dopey, Bashful +%% +Women aren't as mere as they used to be. + -- Pogo +%% +No plain fanfold paper could hold that fractal Puff -- +He grew so fast no plotting pack could shrink him far enough. +Compiles and simulations grew so quickly tame +And swapped out all their data space when Puff pushed his stack frame. +(refrain) + Puff, he grew so quickly, while others moved like snails + And mini-Puffs would perch themselves on his gigantic tail. + All the student hackers loved that fractal Puff + But DCS did not like Puff, and finally said, "Enough!" + (refrain) +Puff used more resources than DCS could spare. +The operator killed Puff's job -- he didn't seem to care. +A gloom fell on the hackers; it seemed to be the end, +But Puff trapped the exception, and grew from naught again! +(refrain) +Refrain: + Puff the fractal dragon was written in C, + And frolicked while processes switched in mainframe memory. + Puff the fractal dragon was written in C, + And frolicked while processes switched in mainframe memory. +%% +It wasn't that she had a rose in her teeth, exactly. +It was more like the rose and the teeth were in the same glass. +%% +When a camel flies, no one laughs if it doesn't get very far! +%% +It's recently come to Fortune's attention that scientists have stopped +using laboratory rats in favor of attorneys. Seems that there are not +only more of them, but you don't get so emotionally attached. +%% +A Mexican newspaper reports that bored Royal Air Force pilots stationed +on the Falkland Islands have devised what they consider a marvelous new +game. Noting that the local penguins are fascinated by airplanes, the +pilots search out a beach where the birds are gathered and fly slowly +along it at the water's edge. Perhaps ten thousand penguins turn their +heads in unison watching the planes go by, and when the pilots turn +around and fly back, the birds turn their heads in the opposite +direction, like spectators at a slow-motion tennis match. Then, the +paper reports "The pilots fly out to sea and directly to the penguin +colony and overfly it. Heads go up, up, up, and ten thousand penguins +fall over gently onto their backs. + -- Audobon Society Magazine +%% + An architect's first work is apt to be spare and clean. He + knows he doesn't know what he's doing, so he does it carefully +and with great restraint. + As he designs the first work, frill after frill and + embellishment after embellishment occur to him. These get +stored away to be used "next time." Sooner or later the first system +is finished, and the architect, with firm confidence and a demonstrated +mastery of that class of systems, is ready to build a second system. + This second is the most dangerous system a man ever designs. +When he does his third and later ones, his prior experiences will +confirm each other as to the general characteristics of such systems, +and their differences will identify those parts of his experience that +are particular and not generalizable. + The general tendency is to over-design the second system, using +all the ideas and frills that were cautiously sidetracked on the first +one. The result, as Ovid says, is a "big pile." + -- Frederick Brooks, "The Mythical Man Month" +%% + The Soviet pre-eminence in chess can be traced to the average +Russian's readiness to brood obsessively over anything, even the +arrangement of some pieces of wood. Indeed, the Russians' +predisposition for quiet reflection followed by sudden preventive action +explains why they led the field for many years in both chess and ax +murders. It is well known that as early as 1970, the U.S.S.R., aware of +what a defeat at Reykjavik would do to national prestige, implemented a +vigorous program of preparation and incentive. Every day for an entire +year, a team of psychologists, chess analysts and coaches met with the +top three Russian grand masters and threatened them with a pointy +stick. That these tactics proved fruitless is now a part of chess +history and a further testament to the American way, which provides +that if you want something badly enough, you can always go to Iceland +and get it from the Russians. + -- Marshall Brickman, Playboy, April, 1973 +%% + Before he became a hermit, Zarathud was a young Priest, and + took great delight in making fools of his opponents in front of +his followers. + One day Zarathud took his students to a pleasant pasture and +there he confronted The Sacred Chao while She was contentedly grazing. + "Tell me, you dumb beast," demanded the Priest in his +commanding voice, "why don't you do something worthwhile? What is your +Purpose in Life, anyway?" + Munching the tasty grass, The Sacred Chao replied "MU". (The +Chinese ideogram for NO-THING.) + Upon hearing this, absolutely nobody was enlightened. + Primarily because nobody understood Chinese. + -- Camden Benares, "Zen Without Zen Masters" +%% + An older student came to Otis and said, "I have been to see a +great number of teachers and I have given up a great number of pleasures. +I have fasted, been celibate and stayed awake nights seeking enlightenment. +I have given up everything I was asked to give up and I have suffered, but +I have not been enlightened. What should I do?" + Otis replied, "Give up suffering." + -- Camden Benares, "Zen Without Zen Masters" +%% + A novel approach is to remove all power from the system, which +removes most system overhead so that resources can be fully devoted to +doing nothing. Benchmarks on this technique are promising; tremendous +amounts of nothing can be produced in this manner. Certain hardware +limitations can limit the speed of this method, especially in the +larger systems which require a more involved & less efficient +power-down sequence. + An alternate approach is to pull the main breaker for the +building, which seems to provide even more nothing, but in truth has +bugs in it, since it usually inhibits the systems which keep the beer +cool. +%% + Wouldn't the sentence "I want to put a hyphen between the words +Fish and And and And and Chips in my Fish-And-Chips sign" have been +clearer if quotation marks had been placed before Fish, and between +Fish and and, and and and And, and And and and, and and and And, and +And and and, and and and Chips, as well as after Chips? +%% +Nature is by and large to be found out of doors, a location where, +it cannot be argued, there are never enough comfortable chairs. + -- Fran Lebowitz +%% +Welcome thy neighbor into thy fallout shelter. +He'll come in handy if you run out of food. + -- Dean McLaughlin. +%% +And yet, seasons must be taken with a grain of salt, for they too have +a sense of humor, as does history. Corn stalks comedy, comedy stalks +tragedy, and this too is historic. And yet, still, when corn meets +tragedy face to face, we have politics. + -- Dalglish, Larsen and Sutherland, + "Root Crops and Ground Cover" +%% +The strong give up and move on, while the weak give up and stay. +%% +Man invented language to satisfy his deep need to complain. + -- Lily Tomlin +%% +The difference between America and England is, the English think 100 +miles is a long distance and the Americans think 100 years is a long +time. +%% +I wish there was a knob on the TV where you could turn up the +intelligence. They've got one called brightness, but it doesn't +seem to work. + -- Gallagher +%% + On the day of his anniversary, Joe was frantically shopping +around for a present for his wife. He knew what she wanted, a +grandfather clock for the living room, but he found the right one +almost impossible to find. Finally, after many hours of searching, Joe +found just the clock he wanted, but the store didn't deliver. Joe, +desperate, paid the shopkeeper, hoisted the clock onto his back, and +staggered out onto the sidewalk. On the way home, he passed a bar. +Just as he reached the door, a drunk stumbled out and crashed into Joe, +sending himself, Joe, and the clock into the gutter. Murphy's law +being in effect, the clock ended up in roughly a thousand pieces. + "You stupid drunk!" screamed Joe, jumping up from the +wreckage. "Why don't you look where the hell you're going!" + With quiet dignity the drunk stood up somewhat unsteadily and +dusted himself off. "And why don't you just wear a wristwatch like a +normal person?" +%% +Some people have a way about them that seems to say: +"If I have only one life to live, let me live it as a jerk." +%% +The introduction of a new kind of music must be shunned as imperiling +the whole state, for styles of music are never disturbed without +affecting the most important political institutions. ... The new +style, gradually gaining a lodgement, quitely insinuates itself into +manners and customs, and from it ... goes on to attack laws and +constitutions, displaying the utmost impudence, until it ends by +overturning everything. + -- Plato, "Republic", 370 B.C. +%% +For every bloke who makes his mark, +there's half a dozen waiting to rub it out. + -- Andy Capp +%% +Jerry Ford is a nice guy, but he played too much football with his +helmet off. + -- Lyndon Johnson +%% +In the course of reading Hadamard's "The Psychology of Invention in the +Mathematical Field", I have come across evidence supporting a fact +which we coffee achievers have long appreciated: no really creative, +intelligent thought is possible without a good cup of coffee. On page +14, Hadamard is discussing Poincare's theory of fuchsian groups and +fuchsian functions, which he describes as "... one of his greatest +discoveries, the first which consecrated his glory ..." Hadamard refers +to Poincare having had a "... sleepless night which initiated all that +memorable work ..." and gives the following, very revealing quote: + "One evening, contrary to my custom, I drank black coffee and + could not sleep. Ideas rose in crowds; I felt them collide + until pairs interlocked, so to speak, making a stable + combination." +Too bad drinking black coffee was contrary to his custom. Maybe he +could really have amounted to something as a coffee achiever. +%% +Just go with the flow control, roll with the +crunches, and, when you get a prompt, type like hell. +%% +Most people are unable to write because they are unable to think, and +they are unable to think because they congenitally lack the equipment +to do so, just as they congenitally lack the equipment to fly over the +moon. + -- H.L. Mencken +%% +Paranoid Club meeting this Friday. +Now ... just try to find out where! +%% +Apathy Club meeting this Friday. +If you want to come, you're not invited. +%% +I really had to act; 'cause I didn't have any lines. + -- Marilyn Chambers +%% +Driving in Texas is simple. For the first 100 miles you swerve to +avoid jackrabbits. For the second 100 miles you hit whatever +jackrabbits get in the way. After that you chase off into the +brush after them. +%% +NOTE: No warranties, either express or implied, are hereby given. +All software is supplied as is, without guarantee. The user assumes +all responsibility for damages resulting from the use of these +features, including, but not limited to, frustration, disgust, system +abends, disk head-crashes, general malfeasance, floods, fires, shark +attack, nerve gas, locust infestation, cyclones, hurricanes, tsunamis, +local electromagnetic disruptions, hydraulic brake system failure, +invasion, hashing collisions, normal wear and tear of friction +surfaces, comic radiation, inadvertent destruction of sensitive +electronic components, windstorms, the Riders of Nazgul, infuriated +chickens, malfunctioning mechanical or electrical sexual devices, +premature activation of the distant early warning system, peasant +uprisings, halitosis, artillery bombardment, explosions, cave-ins, +and/or frogs falling from the sky. +%% + It appears that after his death, Albert Einstein found himself +working as the doorkeeper at the Pearly Gates. One slow day, he +found that he had time to chat with the new entrants. To the first one +he asked, "What's your IQ?" The new arrival replied, "190". They +discussed Einstein's theory of relativity for hours. When the second +new arrival came, Einstein once again inquired as to the newcomer's +IQ. The answer this time came "120". To which Einstein replied, "Tell +me, how did the Cubs do this year?" and they proceeded to talk for half +an hour or so. To the final arrival, Einstein once again posed the +question, "What's your IQ?". Upon receiving the answer "70", +Einstein smiled and replied, "Got a minute to tell me about VMS 4.0?" +%% +Being owned by someone used to be called +slavery -- now it's called commitment. +%% +When you meet a master swordsman, +show him your sword. +When you meet a man who is not a poet, +do not show him your poem. + -- Rinzai, ninth century Zen master +%% +If I had my life to live over, I'd try to make more mistakes next +time. I would relax, I would limber up, I would be sillier than I have +been this trip. I know of very few things I would take seriously. I +would be crazier. I would climb more mountains, swim more rivers and +watch more sunsets. I'd travel and see. I would have more actual +troubles and fewer imaginary ones. You see, I am one of those people +who lives prophylactically and sensibly and sanely, hour after hour, +day after day. Oh, I have had my moments and, if I had it to do over +again, I'd have more of them. In fact, I'd try to have nothing else. +Just moments, one after another, instead of living so many years ahead +each day. I have been one of those people who never go anywhere +without a thermometer, a hotwater bottle, a gargle, a raincoat and a +parachute. If I had it to do over again, I would go places and do +things and travel lighter than I have. If I had my life to live over, +I would start bare-footed earlier in the spring and stay that way later +in the fall. I would play hooky more. I probably wouldn't make such +good grades, but I'd learn more. I would ride on more +merry-go-rounds. I'd pick more daisies. +%% +People who are funny and smart and return phone calls get +much better press than people who are just funny and smart. + -- Howard Simons, "The Washington Post" +%% +I've always felt sorry for people that don't drink -- remember, +when they wake up, that's as good as they're gonna feel all day! +%% + "Sheriff, we gotta catch Black Bart." + "Oh, yeah? What's he look like?" + "Well, he's wearin' a paper hat, a paper shirt, paper pants and +paper boots." + "What's he wanted for?" + "Rustling." +%% +Chorus: + Grandma got run over by a reindeer, + Walking home from our house Christmas eve. + You can say there's no such thing as Santa, + But as for me and Grandpa, we believe! +She'd been drinking too much eggnog, +And we begged her not to go. +But she'd forgot her medication, When we found her Christmas morning, +And she staggered through the door At the scene of the attack. + out in the snow. She had hoofprints on her forehead, + And incriminating claus-marks on her +Now we're all so proud of Grandpa, back. +He's been taking this so well. +See him in there watching football. I've warned all my friends and +Drinking beer and playing cards neighbors, + with cousin Mel. Better watch out for yourselves! + They should never give a license, + To a man who drives a sleigh and + plays with elves! + -- Elmo and Patsy, "Grandma Got Run Over by a Reindeer" +%% +Law of the Yukon: + Only the lead dog gets a change of scenery. +%% +Home is the place where, when you have to go there +They have to take you in. + -- Robert Frost, "The Death of the Hired Man" +%% +There are no emotional victims, only volunteers. +%% +Paralysis through analysis. +%% +"Truth is stranger than fiction, because fiction has to make sense." +%% +"How come everyone's going so slow if it's called rush hour?" +%% +"Maybe we can get together and show off to each other sometimes." +%% +Go away. I'm all right. + -- H.G. Wells' last words +%% +Health nuts are going to feel stupid someday, +lying in hospitals dying of nothing. + -- Redd Foxx +%% +Smoking is one of the leading causes of statistics. + -- Fletcher Knebel +%% +I don't know anything about music. In my line you don't have to. + -- Elvis Presley +%% +"Hello," he lied. + -- Don Carpenter, quoting a Hollywood agent +%% +The United States is like the guy at the party who +gives cocaine to everybody and still nobody likes him. + -- Jim Samuels +%% +Man is the only animal that can remain on friendly terms +with the victims he intends to eat until he eats them. + -- Samuel Butler, 1835-1902 +%% +I'm going to Boston to see my doctor. He's a very sick man. + -- Fred Allen +%% +After twelve years of therapy my psychiatrist said something that +brought tears to my eyes. He said, "No hablo ingles." + -- Ronnie Shakes +%% +Cleaning your house while your kids are still growing +is like shoveling the walk before it stops snowing. + -- Phyllis Diller +%% +It's better to be wanted for murder that not to be wanted at all. + -- Marty Winch +%% +Coincidences are spiritual puns. + -- G.K. Chesterton +%% +I took a course in speed reading and was able to read +War and Peace in twenty minutes. It's about Russia. + -- Woody Allen +%% +One is not superior merely because one sees the world as odious. + -- Chateaubriand, 1768-1848 +%% +The mome rath isn't born that could outgrabe me. + -- Nicol Williamson +%% +If you live to the age of a hundred you have it made +because very few people die past the age of a hundred. + -- George Burns +%% +Computers are useless. They can only give you answers. + -- Pablo Picasso +%% +Dr. Livingston? +Dr. Livingston I. Presume? +%% + WARNING TO ALL PERSONNEL: + +Firings will continue until morale improves. +%% +Immigration is the sincerest form of flattery. + -- Jack Paar +%% +I'm living so far beyond my income that +we may almost be said to be living apart. + -- E.E. Cummings +%% +There is no need to do any housework at all. +After the first four years the dirt doesn't get any worse. + -- Quentin Crisp +%% +I used to work in a fire hydrant factory. +You couldn't park anywhere near the place. + -- Steven Wright +%% + On this morning in August when I was 13, my mother sent us out pick +tomatoes. Back in April I'd have killed for a fresh tomato, but in August +they are no more rare or wonderful than rocks. So I picked up one and threw +it at a crab apple tree, where it made a good *splat*, and then threw a tomato +at my brother. He whipped one back at me. We ducked down by the vines, +heaving tomatoes at each other. My sister, who was a good person, said, +"You're going to get it." She bent over and kept on picking. + What a target! She was 17, a girl with big hips, and bending over, +she looked like the side of a barn. + I picked up a tomato so big it sat on the ground. It looked like it +had sat there a week. The underside was brown, small white worms lived in it, +and it was very juicy. I stood up and took aim, and went into the windup, +when my mother at the kitchen window called my name in a sharp voice. I had +to decide quickly. I decided. + A rotten Big Boy hitting the target is a memorable sound, like a fat +man doing a belly-flop. With a whoop and a yell the tomatoee came after +faster than I knew she could run, and grabbed my shirt and was about to brain +me when Mother called her name in a sharp voice. And my sister, who was a +good person, obeyed and let go -- and burst into tears. I guess she knew that +the pleasure of obedience is pretty thin compared with the pleasure of hearing +a rotten tomato hit someone in the rear end. + -- Garrison Keillor, "Lake Wobegon Days" +%% +It is November first 1940; in the famous sound stage of THE WIZARD OF +OZ on the MGM lot, a little man is lying face-up on the yellow brick +road. His wide eyes stare upward into the blinding stage lights. He +is wearing a kind of comic soldier's uniform with a yellow coat and +puffy sleeves and big fez-like blue and yellow hat with a feather on +top. His yellow hair and beard are the phony straw color of +Hollywood. He could pass for some kind of cute in the typical +tinsel-town way if it wasn't for the knife sticking out of his chest. +*Someone had murdered a Munchkin.* + -- Stuart Kaminsky, "Murder on the Yellow Brick Road" +%% +Oh, I have slipped the surly bonds of earth, +And danced the skies on laughter silvered wings; +Sunward I've climbed and joined the tumbling mirth +Of sun-split clouds and done a hundred things +You have not dreamed of -- +Wheeled and soared and swung +High in the sunlit silence. +Hovering there +I've chased the shouting wind along and flung +My eager craft through footless halls of air. +Up, up along delirious, burning blue +I've topped the wind-swept heights with easy grace, +Where never lark, or even eagle flew; +And, while with silent, lifting mind I've trod +The high untrespassed sanctity of space, +Put out my hand, and touched the face of God. + -- John Gillespie Magee Jr., "High Flight" +%% +If you flaunt it, expect to have it trashed. +%% +Chairman of the Bored. +%% +FORTUNE DISCUSSES THE OBSCURE FILMS! #6 + +RAZORBACK: Paul Harbride, 1984, 2 hours 25 min. + One of the great Australian films of the early 1980's, + and arguably the best movie ever made about a large, + man-eating hog. Some violence. With Gregory Harrison. +%% +The higher you climb, the more you show your ass. + -- Alexander Pope, "The Dunciad" +%% +He who renders warfare fatal to all engaged in it will +be the greatest benefactor the world has yet known. + -- Sir Richard Burton +%% +If it heals good, say it. +%% +"Obviously, a major malfunction has occurred." + -- Steve Nesbitt, voice of Mission Control, January 28, + 1986, as the shuttle Challenger exploded within view + of the grandstands. +%% +Feminism, n: + A political position which seeks to rebuild society so that + both men and women are treated as women wish to be treated. +%% +Millihelen, adj: + The amount of beauty required to launch one ship. +%% +Snow White has become a camera buff. She spends hours and hours +shooting pictures of the seven dwarfs and their antics. Then she +mails the exposed film to a cut rate photo service. It takes weeks +for the developed film to arrive in the mail, but that is all right +with Snow White. She clears the table, washes the dishes and sweeps +the floor, all the while singing "Someday my prints will come." +%% +A young man enters the New York branch of Tiffany's on a Friday evening and +walks up to a display case full of pearl necklaces. He turns to a gorgeous +woman, who is obviously windowshopping, looks her straight in the eye and +says, "I can tell by your eyes that you really want that necklace. If you'll +allow me, I'd like to buy it for you." + The woman looks him up and down; he's wearing a nice suit and some +pretty nice jewelry, but she has trouble believing this story. + "Look, this is some kind of put on, right?" + "No, really. You see, I've got quite a lot of money -- so much that +I could never spend it all. I'd really like for you to have it." + The guys whips out his checkbook, writes a check for five figures, +calls over a clerk and hands it to him. The clerk peers at the check, looks +at the young man, looks at the check again. "Very good, sir. I'm afraid I +can't release the necklace immediately, would Monday be all right?" + "That'll be fine, she'll pick it up." the man replies, and walks out +of the store with the woman following him in a daze. + The next Monday the man comes back in and walks up to the counter. +The same clerk hurries over to him and says, "Sir, I'm sorry to have to tell +you this, but your check was returned for insufficient funds." + "I know," the man replies. "I just wanted to thank you for a +terrific weekend." +%% +I'm not afraid of death -- I just don't want to be there when it happens. + -- Woody Allen +%% +What really shapes and conditions and makes us is somebody only a few +of us ever have the courage to face: and that is the child you once +were, long before formal education ever got its claws into you -- that +impatient, all-demanding child who wants love and power and can't get +enough of either and who goes on raging and weeping in your spirit +till at last your eyes are closed and all the fools say, "Doesn't he +look peaceful?" It is those pent-up, craving children who make all +the wars and all the horrors and all the art and all the beauty and +discovery in life, because they are trying to achieve what lay beyond +their grasp before they were five years old. + -- Robertson Davies, "The Rebel Angels" +%% + I paid a visit to my local precinct in Greenwich Village and +asked a sergeant to show me some rape statistics. He politely obliged. +That month there had been thirty-five rape complaints, an advance of ten +over the same month for the previous year. The precinct had made two +arrests. + "Not a very impressive record," I offered. + "Don't worry about it," the sergeant assured me. "You know what +these complaints represent?" + "What do they represent?" I asked. + "Prostitutes who didn't get their money," he said firmly, +closing the book. + -- Susan Brownmiller, "Against Our Will" +%% + ...He who laughs does not believe in what he laughs at, but neither +does he hate it. Therefore, laughing at evil means not preparing oneself to +combat it, and laughing at good means denying the power through which good is +self-propagating. + -- Umberto Eco, "The Name of the Rose" +%% +Did you ever wonder what you'd say to God if He sneezed? +%% +Hideously disfigured by an ancient Indian curse? + + WE CAN HELP! + +Call (511) 338-0959 for an immediate appointment. +%% +Once it hits the fan, the only rational choice is to +sweep it up, package it, and sell it as fertilizer. +%% +Q: What do you call a principal female opera singer whose high C + is lower than those of other principal female opera singers? +A: A deep C diva. +%% +This week only, all our fiber-fill jackets are marked down! +%% +The other day I... uh, no, that wasn't me. + -- Steven Wright +%% +It's a small world, but I wouldn't want to have to paint it. + -- Steven Wright +%% +When I woke up this morning, my girlfriend asked if I had +slept well. I said, "No, I made a few mistakes." + -- Steven Wright +%% +I have a map of the United States. It's actual size. +I spent last summer folding it. +People ask me where I live, and I say, "E6". + -- Steven Wright +%% +You can't have everything. Where would you put it? + -- Steven Wright +%% +I woke up this morning and discovered that everything in my apartment +had been stolen and replaced with an exact replica. I told my roommate, +"Isn't this amazing? Everything in the apartment has been stolen and +replaced with an exact replica." He said, "Do I know you?" + -- Steven Wright +%% +When I was crossing the border into Canada, they asked if +I had any firearms with me. I said, "Well, what do you need?" + -- Steven Wright +%% +Is it weird in here, or is it just me? + -- Steven Wright +%% +Sometimes it happens. People just explode. Natural causes. + -- Repo Man +%% +A mother mouse was taking her large brood for a stroll across the kitchen +floor one day when the local cat, by a feat of stealth unusual even for +its species, managed to trap them in a corner. The children cowered, +terrified by this fearsome beast, plaintively crying, "Help, Mother! +Save us! Save us! We're scared, Mother!" + Mother Mouse, with the hopeless valor of a parent protecting its +children, turned with her teeth bared to the cat, towering huge above them, +and suddenly began to bark in a fashion that would have done any Doberman +proud. The startled cat fled in fear for its life. + As her grateful offspring flocked around her shouting "Oh, Mother, +you saved us!" and "Yay! You scared the cat away!" she turned to them +purposefully and declared, "You see how useful it is to know a second +language?" +%% + A circus foreman was making the rounds inspecting the big top when +a scrawny little man entered the tent and walked up to him. "Are you the +foreman around here?" he asked timidly. "I'd like to join your circus; I +have what I think is a pretty good act." + The foreman nodded assent, whereupon the little man hurried over to +the main pole and rapidly climbed up to the very tip-top of the big top. +Drawing a deep breath, he hurled himself off into the air and began flapping +his arms furiously. Amazingly, rather than plummeting to his death the little +man began to fly all around the poles, lines, trapezes and other obstacles, +performing astounding feats of aerobatics which ended in a long power dive +from the top of the tent, pulling up into a gentle feet-first landing beside +the foreman, who had been nonchalantly watching the whole time. + "Well," puffed the little man. "What do you think?" + "That's all you do?" answered the foreman scornfully. "Bird +imitations?" +%% +What's another word for Thesaurus? + -- Steven Wright +%% +A raccoon tangled with a 23,000 volt line today. The +results blacked out 1400 homes and, of course, one raccoon. + -- Steel City News +%% +The president publicly apologized today to all those offended by +his brother's remark, "There's more Arabs in this country than +there is Jews!". Those offended include Arabs, Jews, and English +teachers. + -- Channel 11 News, Baltimore, on Billy Carter +%% +I bet you have fun chasing the soap around the bathtub. + -- Princess Diana, to a one-armed war veteran during + a visit to a London veterans hospital +%% +During the Reagan-Mondale debates: + +Q: "Do you feel that a person's age affects his ability to + perform as president?" +Reagan: "I refuse to make an issue out of my opponent's youth and + inexperience." +%% +We are going to give a little something, a few little years more, to +socialism, because socialism is defunct. It dies all by itself. The +bad thing is that socialism, being a victim of its... +Did I say socialism? + -- Fidel Castro +%% +FOR SALE: + Parachute. Used once. + Never opened. Slightly Stained. +%% +After living in New York, you trust nobody, +but you believe everything. Just in case. +%% +Why bother building anymore nuclear +warheads until we use the ones we have? +%% +Hier liegt ein Mann ganz obnegleich; +Im Leibe dick, an Suden reich. +Wir haben ihn in das Grab gesteckt, Here lies a man with sundry flaws +Weil es uns dunkt er sei verreckt. And numerous Sins upon his head; + We buried him today because + As far as we can tell, he's dead. + + -- PDQ Bach's epitaph, as requested by his cousin Betty + Sue Bach and written by the local doggeral catcher; + "The Definitive Biography of PDQ Bach", Peter Schickele +%% +Why not? -- What? -- Why not? -- Why should I not send it? -- Why should I +not dispatch it? -- Why not? -- Strange! I don't know why I shouldn't -- +Well, then -- You will do me this favor. -- Why not? -- Why should you not +do it? -- Why not? -- Strange! I shall do the same for you, when you want +me to. Why not? Why should I not do it for you? Strange! Why not? -- +I can't think why not. + -- Wolfgang Amadeus Mozart, from a letter to his cousin Maria, + "The Definitive Biography of PDQ Bach", Peter Schickele +%% +Perfection is reached, not when there is no longer anything +to add, but when there is no longer anything to take away. + -- Antoine de Saint-Exupery +%% +It has been said that man is a rational animal. All my life +I have been searching for evidence which could support this. + -- Bertrand Russell +%% +There are two problems with a major hangover. You feel +like you are going to die and you're afraid that you won't. +%% +Someone did a study of the three most-often-heard phrases in New York +City. One is "Hey, taxi." Two is, "What train do I take to get to +Bloomingdale's?" And three is, "Don't worry. It's just a flesh wound." + -- David Letterman +%% +I'll learn to play the Saxophone, +I play just what I feel. +Drink Scotch whisky all night long, +And die behind the wheel. +They got a name for the winners in the world, +I want a name when I lose. +They call Alabama the Crimson Tide, +Call me Deacon Blues. + -- Becker and Fagan, "Deacon Blues" +%% + "How would I know if I believe in love at first sight?" the sexy +social climber said to her roommate. "I mean, I've never seen a Porsche +full of money before." +%% +Why be difficult, when, with just a +little more effort, you can be impossible? +%% +So, what's with this guy Gideon, anyway? +And why can't he ever remember his Bible? +%% +Halley's Comet: It came, we saw, we drank. +%% +Dull women have immaculate homes. +%% +All work and no pay makes a housewife. +%% +Smuggling... It's not just a job, it's an adventure! + -- paid for by your local Colombian recruiting office +%% +Save the bales! +%% +Take me drunk, +I'm home again! +%% +If coke is a joke, I'm waiting around for the next line. +%% +I used to have a drinking problem. +Now I love the stuff. +%% +I wish you were a Scotch on the rocks. +%% +Silence is the only virtue you have left. +%% +I don't have an eating problem. I eat. +I get fat. I buy new clothes. No problem. +%% +I can't decide whether to commit suicide or go bowling. + -- Florence Henderson +%% +If it's worth doing, do it for money. +%% +When I was a child, I was told that anyone could become President. +I'm beginning to believe it. +%% +Experience is what you get when you didn't get what you wanted. +%% +You'll never know how many friends you really +have until you own a cottage at the beach. +%% +Pushing 30 is exercise enough. +%% +The major difference between genius and +stupidity is that genius has its limits. +%% +It's not whether you win or lose, +it's how you place the blame. +%% +Rainy days and automatic weapons always get me down. +%% +Talent does what it can. +Genius does what it must. +You do what you get paid to do. +%% +I owe, I owe, +It's off to work I go... +%% +Whenever someone tells you to take their advice, +you can be pretty sure that they're not using it. +%% +So, good night, you moonlit ladies, +Rock-a-bye sweet baby James. +Deep greens and blues are the colors I choose, +Won't you let me go down in my dreams? +And rock-a-bye sweet baby James. + -- James Taylor, "Rock-a-bye Sweet Baby James" +%% +It is considered normal to consecrate virginity in the +general and lust for its destruction in the particular. +%% +Let's just say that where a change was required, I adjusted. In every +relationship that exists, people have to seek a way to survive. If you +really care about the person, you do what's necessary, or that's the end. +For the first time, I found that I really could change, and the qualities +I most admired in myself I gave up. I stopped being loud and bossy... +Oh, all right. I was still loud and bossy, but only behind his back." + -- Kate Hepburn, on Tracy and Hepburn +%% +All I need to have a good time, +Is a reefer, a woman and a bottle of wine. +With those three things I don't need no sunshine, +A reefer, a woman and a bottle of wine. + +All I want is to never grow old, +I want to wash in a bathtub of gold. +I want 97 kilos already rolled, +I want to wash in a bathtub of gold. + +I want to light my cigars with 10 dollar bills, +I like to have a cattle ranch in Beverly Hills. +I want a bottle of Red Eye that's always filled, +I like to have a cattle ranch in Beverly Hills. + -- Country Joe and the Fish, "Zachariah" +%% +"... gentlemen do not read each other's mail." + -- Secretary of State Henry Stimson, on closing down + the Black Chamber, the precursor to the National + Security Agency. +%% +"Yow!! Those people look exactly like Donnie and Marie Osmond!!" + -- Zippy the Pinhead +%% +"My pants just went on a wild rampage through a Long Island Bowling Alley!!" + -- Zippy the Pinhead +%% +"Hello? Enema Bondage? I'm calling because I want to be happy, I guess..." + -- Zippy the Pinhead +%% +"I want to kill everyone here with a cute colorful Hydrogen Bomb!!" + -- Zippy the Pinhead +%% +"Yow! Am I in Milwaukee?" + -- Zippy the Pinhead +%% +"Yow! Am I having fun yet?" + -- Zippy the Pinhead +%% +"I didn't order any WOO-WOO... Maybe a YUBBA... But no WOO-WOO!" + -- Zippy the Pinhead +%% +"Didn't I buy a 1951 Packard from you last March in Cairo?" + -- Zippy the Pinhead +%% +"Yow! Did something bad happen or am I in a drive-in movie?" + -- Zippy the Pinhead +%% +"Yow! And then we could sit on the hoods of cars at stop lights!" + -- Zippy the Pinhead +%% +"...bleakness... desolation... plastic forks..." + -- Zippy the Pinhead +%% +"Yow! Is this sexual intercourse yet? Is it, huh, is it?" + -- Zippy the Pinhead +%% +"Is a tatoo real, like a curb or a battleship? +Or are we suffering in Safeway?" + -- Zippy the Pinhead +%% +"WHOA!! Ken and Barbie are having TOO MUCH FUN!! +It must be the NEGATIVE IONS!!" + -- Zippy the Pinhead +%% +"I'm ANN LANDERS!! I can SHOPLIFT!!" + -- Zippy the Pinhead +%% +"Did YOU find a DIGITAL WATCH in YOUR box of VELVEETA?" + -- Zippy the Pinhead +%% +"I have accepted Provolone into my life!" + -- Zippy the Pinhead +%% +"A can of ASPARAGUS, 73 pigeons, some LIVE ammo, and a FROZEN DAIQURI!!" + -- Zippy the Pinhead +%% +On the road, ZIPPY is a pinhead without +a purpose, but never without a POINT. +%% +"Yow! Now I get to think about all the BAD THINGS I did +to a BOWLING BALL when I was in JUNIOR HIGH SCHOOL!" + -- Zippy the Pinhead +%% +Hollerith, v: + What thou doest when thy phone is on the fritzeth. +%% +If God had a beard, he'd be a UNIX programmer. +%% +If you stick a stock of liquor in your locker, +It is slick to stick a lock upon your stock. +Or some joker who is slicker, +Will trick you of your liquor, +If you fail to lock your liquor with a lock. +%% +Fortune presents: + USEFUL PHRASES IN ESPERANTO, #1. + +^Cu vi parolas angle? Do you speak English? +Mi ne komprenas. I don't understand. +Vi estas la sola esperantisto kiun mi You're the only Esperanto speaker + renkontas. I've met. +La ^ceko estas enpo^stigita. The check is in the mail. +Oni ne povas, ^gin netrovi. You can't miss it. +Mi nur rigardadas. I'm just looking around. +Nu, ^sajnis bona ideo. Well, it seemed like a good idea. +%% +Fortune presents: + USEFUL PHRASES IN ESPERANTO, #2. + +^Cu tiu loko estas okupita? Is this seat taken? +^Cu vi ofte venas ^ci-tien? Do you come here often? +^Cu mi povas havi via telelonnumeron? May I have your phone number? +Mi estas komputilisto. I work with computers. +Mi legas multe da scienca fikcio. I read a lot of science fiction. +^Cu necesas ke vi eliras? Do you really have to be going? +%% +Fortune presents: + USEFUL PHRASES IN ESPERANTO, #3. + +Kie estas la plej proksima masa^gejo? Where's the nearest massage parlor? +Vi dolorigas min. You're hurting me. +Mi deziras viziti usonan kuraciston. I want to see an American doctor. +Mi deziras a^ceti kontraugraveda^jojn. I would like to buy some + contraceptives. +^Cu tiu estis ankau bona por ci? Was it good for you too? +%% +Fortune presents: + USEFUL PHRASES IN ESPERANTO, #4. +Mia ^svebo^sipo estas plena je angiloj. My hovercraft is full of eels. +Neniu anticipas la hispanan No one expects the Spanish + Inkvizicion. Inquisition. +La solvo estas kvardekdu. The answer is forty-two. +Adiau, kaj dankoj por ^ciom da fi^so. So long, and thanks for all the fish. +^Cu estas krajono en via po^so, au ^cu Is that a pencil in your pocket, + vi feli^cas pri vidi min? or are you happy to see me? +%% +I'd horsewhip you if I had a horse. + -- Groucho Marx +%% +Fortune presents: + USEFUL PHRASES IN ESPERANTO, #5. + +Mi ^cevalovipus vin se mi havus I'd horsewhip you if I had a horse. + ^cevalon. +Vere vi ^sercas. You must be kidding. +Nu, parDOOOOOnu min! Well exCUUUUUSE me! +Kiu invitis vin? Who invited you? +Kion vi diris pri mia patrino? What did you say about my mother? +Bu^so^stopu min per kulero. Gag me with a spoon. +%% +Love means having to say you're sorry every five minutes. +%% +Got a wife and kids in Baltimore Jack, +I went out for a ride and never came back. +Like a river that don't know where it's flowing, +I took a wrong turn and I just kept going. + + Everybody's got a hungry heart. + Everybody's got a hungry heart. + Lay down your money and you play your part, + Everybody's got a hungry heart. + +I met her in a Kingstown bar, +We fell in love, I knew it had to end. +We took what we had and we ripped it apart, +Now here I am down in Kingstown again. + +Everybody needs a place to rest, +Everybody wants to have a home. +Don't make no difference what nobody says, +Ain't nobody likes to be alone. + -- Bruce Springsteen, "Hungry Heart" +%% +All most men really want in life is a wife, a house, two kids and a car, +a cat, no maybe a dog. Ummm, scratch one of the kids and add a dog. +Definitely a dog. +%% + "I have examined Bogota," he said, "and the case is clearer to me. +I think very probably he might be cured." + "That is what I have always hoped," said old Yacob. + "His brain is affected," said the blind doctor. + The elders murmured assent. + "Now, what affects it?" + "Ah!" said old Yacob. + "This," said the doctor, answering his own question. "Those queer +things that are called the eyes, and which exist to make an agreeable soft +depression in the face, are diseased, in the case of Bogota, in such a way +as to affect his brain. They are greatly distended, he has eyelashes, and +his eyelids move, and cosequently his brain is in a state of constant +irritation and distraction." + "Yes?" said old Yacob. "Yes?" + "And I think I may say with reasonable certainty that, in order +to cure him completely, all that we need do is a simple and easy surgical +operation - namely, to remove those irritant bodies." + "And then he will be sane?" + "Then he will be perfectly sane, and a quite admirable citizen." + "Thank heaven for science!" said old Yacob. + -- H.G. Wells, "The Country of the Blind" +%% +The only thing that stops God from sending +another flood is that the first one was useless. + -- Chamfort +%% +Life being what it is, one dreams of revenge. + -- Gauguin +%% +Housework can kill you if done right. + -- Erma Bombeck +%% +A man always remembers his first love with special +tenderness, but after that begins to bunch them. + -- Mencken +%% +Sex is good, but not as good as fresh sweet corn. + -- Garrison Keillor +%% +The happiest time in any man's life +is just after the first divorce. + -- Galbraith +%% +Never lend your car to anyone to whom you have given birth. + -- Erma Bombeck +%% +The volume of paper expands to fill the available briefcases. + -- Jerry Brown +%% +Business is a good game -- lots of competition +and minimum of rules. You keep score with money. + -- Nolan Bushnell, founder of Atari +%% +The opposite of talking isn't listening. +The opposite of talking is waiting. + -- Fran Liebowitz +%% +In Mexico we have a word for sushi: bait. + -- Josi Simon +%% +The trouble with eating Italian food is that +five or six days later you're hungry again. + -- George Miller +%% +Marriage is not merely sharing the fettucine, but sharing the +burden of finding the fettucine restaurant in the first place. + -- Calvin Trillin +%% +The trouble with heart disease is that the first +symptom is often hard to deal with: death. + -- Michael Phelps +%% +A male gynecologist is like an auto mechanic who has never owned a car. + -- Carrie Snow +%% +When I was young we didn't have MTV; we +had to take drugs and go to concerts. + -- Steven Pearl +%% +I believe that professional wrestling is clean +and everything else in the world is fixed. + -- Frank Deford, sports writer +%% +There is nothing more exhilarating than to be shot at without result. + -- Churchill +%% +A team effort is a lot of people doing what I say. + -- Michael Winner, British film director +%% +It's our fault. We should have given him better parts. + -- Jack Warner, on hearing that Reagan had been + elected governor of California. + +[Warner is also reported to have said, when told of Reagan's candidacy +for governor, "No, Jimmy Stewart for Governor; Reagan for best friend."] +%% +There are three rules for writing a novel. +Unfortunately, no one knows what they are. + -- Maugham +%% +All newspaper editorial writers ever do is come down from +the hills after the battle is over and shoot the wounded. +%% +I can mend the break of day, heal a broken heart, +and provide temporary relief to nymphomaniacs. + -- Larry Lee +%% +I can't believe that out of 100,000 sperm, you were the quickest. + -- Steven Pearl +%% +Only Irish coffee provides in a single glass all four +essential food groups -- alcohol, caffeine, sugar, and fat. + -- Alex Levine + +[Oh come on, everybody knows that the four basic food groups are +hot sugar, cold sugar, carbohydrates and grease. Ed.] +%% +The astronomer Francesco Sizi, a contemporary of Galileo, argues that +Jupiter can have no satellites: + + There are seven windows in the head, two nostrils, two ears, two +eyes, and a mouth; so in the heavens there are two favorable stars, two +unpropitious, two luminaries, and Mercury alone undecided and indifferent. +From which and many other similar phenomena of nature such as the seven +metals, etc., which it were tedious to enumerate, we gather that the number +of planets is necessarily seven. [...] + Moreover, the satellites are invisible to the naked eye and +therefore can have no influence on the earth and therefore would be useless +and therefore do not exist. +%% +I was appalled by this story of the destruction of a member of a valued +endangered species. It's all very well to celebrate the practicality of +pigs by ennobling the porcine sibling who constructed his home out of +bricks and mortar. But to wantonly destroy a wolf, even one with an +excessive taste for porkers, is unconscionable in these ecologically +critical times when both man and his domestic beasts continue to maraud +the earth. + Sylvia Kamerman, "Book Reviewing" +%% +As part of an ongoing effort to keep you, the Fortune reader, abreast of +the valuable information the daily crosses the USENET, Fortune presents: + +News articles that answer *your* questions, #1: + + Newsgroups: comp.sources.d + Subject: how do I run C code received from sources + Keywords: C sources + Distribution: na + + I do not know how to run the C programs that are posted in the + sources newsgroup. I save the files, edit them to remove the + headers, and change the mode so that they are executable, but I + cannot get them to run. (I have never written a C program before.) + + Must they be compiled? With what compiler? How do I do this? If + I compile them, is an object code file generated or must I generate + it explicitly with the > character? Is there something else that + must be done? +%% +Do you believe in intuition? +No, but I have a strange feeling that someday I will. +%% +The number of UNIX installations has grown to 10, with more expected. + -- The Unix Programmer's Manual, 2nd Edition, June 1972 +%% +My advice to you, my violent friend, is to seek out gold and sit on it. + -- The Dragon to Grendel, in John Gardner's "Grendel" +%% +My mother once said to me, "Elwood," (she always called me Elwood) +"Elwood, in this world you must be oh so smart or oh so pleasant." +For years I tried smart. I recommend pleasant. + -- Elwood P. Dowde, "Harvey" +%% + It is a profoundly erroneous truism, repeated by all copy-books and +by eminent people when they are making speeches, that we should cultivate +the habit of thinking about what we are doing. The precise opposite is the +case. Civilization advances by extending the numbers of important operations +which we can perform without thinking about them. Operations of thought are +like cavalry charges in battle -- they are strictly limited in number, they +require fresh horses, and must only be made at decisive moments. + -- Alfred North Whitehead +%% +I try to keep an open mind, but not so open that my brains fall out. + -- Judge Harold T. Stone +%% + Approaching the gates of the monastery, Hakuin found Ken the Zen +preaching to a group of disciples. + "Words..." Ken orated, "they are but an illusory veil obfuscating +the absolute reality of --" + "Ken!" Hakuin interrupted. "Your fly is down!" + Whereupon the Clear Light of Illumination exploded upon Ken, and he +vaporized. + On the way to town, Hakuin was greeted by an itinerant monk imbued +with the spirit of the morning. + "Ah," the monk sighed, a beatific smile wrinkling across his cheeks, +"Thou art That..." + "Ah," Hakuin replied, pointing excitedly, "And Thou art Fat!" + Whereupon the Clear Light of Illumination exploded upon the monk, +and he vaporized. + Next, the Governor sought the advice of Hakuin, crying: "As our +enemies bear down upon us, how shall I, with such heartless and callow +soldiers as I am heir to, hope to withstand the impending onslaught?" + "US?" snapped Hakuin. + Whereupon the Clear Light of Illumination exploded upon the +Governor, and he vaporized. + Then, a redneck went up to Hakuin and vaporized the old Master with +his shotgun. "Ha! Beat ya' to the punchline, ya' scrawny li'l geek!" +%% +You can always tell the people that are forging the new +frontier. They're the ones with arrows sticking out of them. +%% +Pascal is a language for children wanting to be naughty. + -- Dr. Kasi Ananthanarayanan +%% +There is a limit to the admiration we may hold for a man who spends +his waking hours poking the contents of chickens with a stick. + -- Tom Robbins, "Jitterbug Perfume" +%% +Hell, if you don't try to remake someone, +how are they supposed to know you care? +%% +What's this stuff about people being "released on their +own recognizance"? Aren't we all out on own recognizance? +%% +The best case: Get salary from America, build a house in England, + live with a Japanese wife, and eat Chinese food. +Pretty good case: Get salary from England, build a house in America, + live with a Chinese wife, and eat Japanese food. +The worst case: Get salary from China, build a house in Japan, + live with a British wife, and eat American food. + + --Bungei Shunju, a popular Japanese magazine +%% +Once Again From the Top + +Correction notice in the Miami Herald: "Last Sunday, The Herald erroneously +reported that original Dolphin Johnny Holmes had been an insurance salesman +in Raleigh, North Carolina, that he had won the New York lottery in 1982 and +lost the money in a land swindle, that he had been charged with vehicular +homicide, but acquitted because his mother said she drove the car, and that +he stated that the funniest thing he ever saw was Flipper spouting water on +George Wilson. Each of these items was erroneous material published +inadvertently. He was not an insurance salesman in Raleigh, did not win the +lottery, neither he nor his mother was charged or involved in any way with +vehicular homicide, and he made no comment about Flipper or George Wilson. +The Herald regrets the errors." + -- "The Progressive", March, 1987 +%% +DEC diagnostics would run on a dead whale. + -- Mel Ferentz +%% +A pain in the ass of major dimensions. + -- C.A. Desoer, on the solution of non-linear circuits +%% +Reality must take precedence over public +relations, for Mother Nature cannot be fooled. + -- R.P. Feynman +%% +"The jig's up, Elman." +"Which jig?" + -- Jeff Elman +%% +As you will see, I told them, in no uncertain terms, to see Figure one. + -- Dave "First Strike" Pare +%% +CF&C stole it, fair and square. + -- Tim Hahn +%% +You'd best be snoozin', 'cause you don't +be gettin' no work done at 5 am anyway. + -- From the wall of the Wurster Hall stairwell +%% +He's like a function -- he returns a value, in the form of +his opinion. It's up to you to cast it into a void or not. + -- Phil Lapsley +%% +The purpose of Physics 7A is to make the engineers realize that they're +not perfect, and to make the rest of the people realize that they're not +engineers. +%% +We warn the reader in advance that the proof presented here +depends on a clever but highly unmotivated trick. + -- Howard Anton, "Elementary Linear Algebra" +%% +If Machiavelli were a hacker, he'd have worked for the CSSG. + -- Phil Lapsley +%% +Sendmail may be safely run set-user-id to root. + -- Eric Allman, "Sendmail Installation Guide" +%% +It is not that polar co-ordinates are complicated, it is simply +that cartesian co-ordinates are simpler than they have a right to be. + -- Kleppner & Kolenhow, "An Introduction to Mechanics" +%% +Opiates are the religion of the upper-middle classes. + -- Debbie VanDam +%% +This generation doesn't have emotional baggage. +We have emotional moving vans. + -- Bruce Feirstein +%% +Sudden Death Dating: + +Quote, female: + Am I worried about taking his last name? Forget it, + at this point I'll take his first name, too. +%% + As a general rule of thumb, never trust anybody who's been +in therapy for more than 15 percent of their life span. The words +"I am sorry" and "I am wrong" will have totally disappeared from +their vocabulary. They will stab you, shoot you, break things in +your apartment, say horrible things to your friends and family, and +then justify this abhorrent behavior by saying: + "Sure, I put your dog in the microwave. But I feel *better* +for doing it." + -- Bruce Feirstein, "Nice Guys Sleep Alone" +%% +Sex is a biological function; kissing is a committment. +%% +Don't get mad, get even. + -- Joseph P. Kennedy + +Don't get even, get jewelry. + -- Anon. +%% +Don't get even, get odd. +%% +Some people live life in the fast lane. +You're in oncoming traffic. +%% +Ankh if you love Isis. +%% +You mean you didn't *know* she was off +making lots of little phone companies? +%% +Avoid cliches like the plague. +They're a dime a dozen. +%% +Beam me up, Scotty! It ate my phaser! +%% +The beauty of a pun is in the "Oy!" of the beholder. +%% +Bushydo -- the way of the shrub. Bonsai! +%% +Cthulhu Cthucks! +%% +Cthulhu Saves -- in case He's hungry later. +%% +Cthulhu for President! +(If you're tired of choosing the lesser of two evils.) +%% +I *knew* I had some reason for not logging you off... +If I could just remember what it was. +%% +The best thing about being bald is, that, when unexpected +company arrives, all you have to do is straighten your tie. +%% +Pandora's Rule: + Never open a box you didn't close. +%% +The groundhog is like most other prophets; +it delivers its message and then disappears. +%% +Death before dishonor. +But neither before breakfast. +%% +Hatcheck girl: + "Goodness! What lovely diamonds!" +Mae West: + "Goodness had nothin' to do with it, dearie." + -- "Night After Night", 1932 +%% +Adding sound to movies would be like +putting lipstick on the Venus de Milo. + -- actress Mary Pickford, 1925 +%% +T-shirt: + Life is *not* a Cabaret, and stop calling me chum! +%% + "You mean, if you allow the master to be uncivil, to treat you +any old way he likes, and to insult your dignity, then he may deem you +fit to hear his view of things?" + "Quite the contrary. You must defend your integrity, assuming +you have integrity to defend. But you must defend it nobly, not by +imitating his own low behavior. If you are gentle where he is rough, +if you are polite where he is uncouth, then he will recognize you as +potentially worthy. If he does not, then he is not a master, after all, +and you may feel free to kick his ass." + -- Tom Robbins, "Jitterbug Perfume" +%% +Love ain't nothin' but sex misspelled. +%% +A bachelor is a man who never made the same mistake once. +%% +A bachelor is an unaltared male. +%% +A flashy Mercedes-Benz roared up to the curb where a cute young miss stood +waiting for a taxi. + "Hi," said the gentleman at the wheel. "I'm going west." + "How wonderful," came the cool reply. "Bring me back an orange." +%% +A friend with weed is a friend indeed. +%% +A joint is just tea for two. +%% +If God hadn't wanted you to be paranoid, +He wouldn't have given you such a vivid imagination. +%% +If it has syntax, it isn't user-friendly. +%% +If puns were deli meat, this would be the wurst. +%% +If the government doesn't trust the people, why +doesn't it dissolve them and elect a new people? +%% +If you're going to walk on thin ice, you might as well dance. +%% +Interfere? Of course you should interfere! +Always do what you're best at, I say. +%% +It's never too late to have a happy childhood. +%% +Militant agnostic: I don't know, and you don't either. +%% +Marvelous! The super-user's going to boot me! +What a finely tuned resopnse to the situation! +%% +No matter how cynical you get, it's impossible to keep up. +%% +No man is an island if he's on at least one mailing list. +%% +Of course you can't flap your arms and fly to the moon. +After awhile you'd run out of air to push against. +%% +Only two of my personalities are schizophrenic, but one +of them is paranoid and the other one is out to get him. +%% +Please do not look directly into laser with remaining eye. +%% +A real friend isn't someone you use once and then throw away. +A real friend is someone you can use over and over again. +%% +Sushido, n: + The way of the tuna. +%% +Total strangers need love, too; and I'm stranger than most. +%% +The unfacts, did we have them, are too +imprecisely few to warrant out certitude. +%% +We'll know that rock is dead when you have to get a degree to work in it. +%% +When Cthulhu calls, he calls collect. +%% +Mathematicians stand on each other's shoulders. + -- Gauss + +Mathemeticians stand on each other's shoulders while +computer scientists stand on each other's toes. + -- Richard Hamming + +It has been said that physicists stand on one another's shoulders. +If this is the case, then programmers stand on one another's toes, +and software engineers dig each other's graves. + -- Unknown +%% +FEAR: + What you feel when you see a U-Haul with Texas license plates. +%% +You can fool some of the people all of the time and all +of the people some of the time, but you can never fool your Mom. +%% +I want to marry a girl just like the girl that married dear old dad. + -- Freud +%% +PROBLEM DRINKER: + A man who never buys. +%% +Pyro's of the world... IGNITE !!! +%% + Seems George was playing his usual eighteen holes on Saturday +afternoon. Teeing off from the 17th, he sliced into the rough over near +the edge of the fairway. Just as he was about to chip out, he noticed a +long funeral procession going past on a nearby street. Reverently, George +removed his hat and stood at attention until the procession had passed. +Then he continued his game, finishing with a birdie on the eighteenth. +Later, at the clubhouse, a fellow golfer greet George. "Say, that was a +nice gesture you made today, George. + "What do you mean?" asked George. + "Well, it was nice of you to take off your cap and stand +respectfully when that funeral went by," the friend replied. + "Oh, yes," said George. "Well, we were married 17 years, you +know." +%% +The father, passing through his son's college town late one evening on a +business trip, thought he would pay his boy a suprise visit. Arriving at the +lad's fraternity house, dad rapped loudly on the door. After several minutes +of knocking, a sleepy voice drifted down from a second-floor window, + "Whaddaya want?" + "Does Ramsey Duncan live here?" asked the father. + "Yeah," replied the voice. "Dump him on the front porch." +%% +The meek don't want it. +%% + There was a knock on the door. Mrs. Miffin opened it. "Are +you the Widow Miffin?" a small boy asked. + "I'm Mrs. Miffin," she replied, "but I'm not a widow." + "Oh, no?" replied the little boy. "Wait 'til you see what +they're carrying upstairs!" +%% +A bachelor is a man who never made the same mistake once. +%% +A bachelor is an unaltared male. +%% +A flashy Mercedes-Benz roared up to the curb where a cute young miss stood +waiting for a taxi. + "Hi," said the gentleman at the wheel. "I'm going west." + "How wonderful," came the cool reply. "Bring me back an orange." +%% +A friend with weed is a friend indeed. +%% +A joint is just tea for two. +%% +A pretty foot is one of the greatest gifts of nature... please send me your +last pair of shoes, already worn out in dancing... so I can have something of +yours to press against my heart. + -- Goethe +%% +Behold the unborn foetus and + Weep salt tears crocodilian; +All life is sacred (save, of course, + An enemy civilian). +%% +Blessed are the meek for they shall inhibit the earth. +%% +Blow it out your ear. +%% +COLORADO: + Where they don't buy M & M's, 'cause they're so hard to peel. +%% +Cocaine is nature's way of telling you you have too much money. +%% +%% +A beer delayed is a beer denied. +%% +If you don't drink it, someone else will. +%% +I don't care what star you're following; +get that camel out of my front yard! +%% +"Your son still sliding down the banisters?" +"We wound barbed wire around them." +"That stop him?" +"No, but it sure slowed him up." +%% +Destiny is a good thing to accept when it's going your way. When it isn't, +don't call it destiny; call it injustice, treachery, or simple bad luck. + -- Joseph Heller, "God Knows" +%% +Having a baby isn't so bad. If you're a female Emperor penguin +in the Antarctic. She lays the egg, rolls it over to the father, +then takes off for warmer weather where she eats and eats and +eats. For two months, the father stands stiff, without food, +blind in the 24-hour dark, balancing the egg on his feet. After +the little penguin is hatched, the mother sees fit to come home. + -- L.M. Boyd, "Austin American-Statesman" +%% +It's hard not to like a man of many qualities, +even if most of them are bad. +%% +Remember, DESSERT is spelled with two `s's while DESERT is spelled +with one, because EVERYONE wants two desserts, but NO ONE wants two +deserts. + -- Miss Oglethorp, Gr. 5, PS 59 +%% +4.2 BSD UNIX #57: Sun Jun 1 23:02:07 EDT 1986 + +You swing at the Sun. You miss. The Sun swings. He hits you with a +575MB disk! You read the 575MB disk. It is written in an alien +tongue and cannot be read by your tired Sun-2 eyes. You throw the +575MB disk at the Sun. You hit! The Sun must repair your eyes. The +Sun reads a scroll. He hits your 130MB disk! He has defeated the +130MB disk! The Sun reads a scroll. He hits your Ethernet board! He +has defeated your Ethernet board! You read a scroll of "postpone until +Monday at 9 AM". Everything goes dark... + -- /etc/motd, cbosgd +%% +The UNIX philosophy basically involves giving you enough rope to +hang yourself. And then a couple of feet more, just to be sure. +%% +I know the answer! The answer lies within the heart of all mankind! +The answer is twelve? I think I'm in the wrong building. + -- Charles Schulz +%% +Life is what happens while you are making other plans. + -- John Lennon +%% +Dying is one of the few things that can be done as easily lying down. + -- Woody Allen +%% +In the long run we are all dead. + -- John Maynard Keynes +%% +Death is nature's way of saying `Howdy'. +%% +For three days after death hair and fingernails +continue to grow, but phone calls taper off. + -- Johnny Carson +%% +If once a man indulges himself in murder, very soon he comes to think +little of robbing; and from robbing he next comes to drinking and +Sabbath-breaking, and from that to incivility and procrastination. + -- Thomas De Quincey +%% +The difference between genius and stupidity +is that genius has its limits. +%% +Egotist, n: + A person ... more interested in himself than in me. + -- Ambrose Bierce +%% +A narcissist is someone better looking than you are. + -- Gore Vidal +%% +Don't be humble. You're not that great. + -- Golda Meir +%% +Somewhere on this globe, every ten seconds, there is a +woman giving birth to a child. She must be found and stopped. + -- Sam Levenson +%% +There's nothing wrong with teenagers that +reasoning with them won't aggravate. +%% +When all else fails, pour a pint of Guinness in the gas tank, advance +the spark 20 degrees, cry "God Save the Queen!", and pull the starter +knob. + -- MG "Series MGA" Workshop Manual +%% +The meek shall inherit the Earth. +(But they're gonna have to fight for it...) +%% +War doesn't prove who's right, just who's left. +%% +Just what does "it" mean in the sentence, "What time is it?" +%% +It's not a sin not to be Irish, but it is a great shame. + -- Sean O'Huiginn +%% +May those that love us love us; and those that don't love us, may +God turn their hearts; and if he doesn't turn their hearts, may +he turn their ankles so we'll know them by their limping. +%% +The curse of the Irish is not that they don't know the +words to a song -- it's that they know them *all*. + -- Susan Dooley +%% +St. Patrick was a gentleman +who through strategy and stealth +drove all the snakes from Ireland. +Here's a toasting to his health -- +but not too many toastings +lest you lose yourself and then +forget the good St. Patrick +and see all those snakes again. +%% +May you have warm words on a cold evening, +a full mooon on a dark night, +and a smooth road all the way to your door. +%% +It has long been noticed that juries are pitiless for robbery and full of +indulgence for infanticide. A question of interest, my dear Sir! The jury +is afraid of being robbed and has passed the age when it could be a victim +of infanticide. + -- Edmond About +%% +Marriage, in life, is like a duel in the midst of a battle. + -- Edmond About +%% +A memorandum is written not to inform the reader, +but to protect the writer. + -- Dean Acheson +%% +The danger is not that a particular class is unfit to govern. +Every class is unfit to govern. + -- Lord Acton +%% +The trouble with this country is that there are too many politicians +who believe, with a conviction based on experience, that you can fool +all of the people all of the time. + -- Franklin Adams +%% +When a man you like switches from what he said a year ago, or four years +ago, he is a broad-minded man who has courage enough to change his mind +with changing conditions. When a man you don't like does it, he is a +liar who has broken his promises. + -- Franklin Adams +%% +Politics, as a practice, whatever its professions, has always been the +systematic organisation of hatreds. + -- Henry Adams, "The Education of Henry Adams" +%% +Practical politics consists in ignoring facts. + -- Henry Adams +%% +The most popular labor-saving device today is still a husband with money. + -- Joey Adams +%% +A psychiatrist is a fellow who asks you a lot of expensive questions +your wife asks you for nothing. + -- Joey Adams +%% +Men who cherish for women the highest +respect are seldom popular with them. + -- Joseph Addison +%% +If it were not for the presents, an elopment would be preferable. + -- George Ade, "Forty Modern Fables" +%% +It is easier to fight for one's principles than to live up to them. + -- Alfred Adler +%% +The English instinctively admire any man +who has no talent and is modest about it. + -- James Agate, British film and drama critic +%% +The way to a man's heart is through his +wife's belly, and don't you forget it. + -- Edward Albee, "Who's Afraid of Virginia Woolf?" +%% +The avocation of assessing the failures of better men can be turned +into a comfortable livelihood, providing you back it up with a Ph.D. + -- Nelson Algren, "Writers at Work" +%% +A racially integrated community is a chronological term timed from +the entrance of the first black family to the exit of the last white +family. + -- Saul Alinsky +%% +California is a fine place to live in -- if you're an orange. + -- Fred Allen +%% +A conference is a gathering of important people who singly can +do nothing but together can decide that nothing can be done. + -- Fred Allen +%% +Imitation is the sincerest form of television. + -- Fred Allen +%% +Look, we trade every day out there with hustlers, deal-makers, shysters, +con-men. That's the way businesses get started. That's the way this +country was built. + -- Hubert Allen +%% +Love is the answer, but while you are waiting for the answer, sex +raises some pretty good questions. + -- Woody Allen +%% +Life is a concentration camp. You're stuck here and there's no way +out and you can only rage impotently against your persecutors. + -- Woody Allen +%% +Is sex dirty? Only if it's done right. + -- Woody Allen, "All You Ever Wanted To Know About Sex" +%% +In California they don't throw their garbadge away -- they make +it into television shows. + -- Woody Allen, "Annie Hall" +%% +Life is divided into the horrible and the miserable. + -- Woody Allen, "Annie Hall" +%% +It seemed the world was divided into good and bad people. The good ones +slept better... while the bad ones seemed to enjoy the waking hours much +more. + -- Woody Allen, "Side Effects" +%% +More than any other time in history, mankind faces a crossroads. One path +leads to despair and utter hopelessness. The other, to total extinction. +Let us pray we have the wisdom to choose correctly. + -- Woody Allen, "Side Effects" +%% +Don't knock masturbation -- it's sex with someone I love. + -- Woody Allen +%% +Gratitude, like love, is never a dependable international emotion. + -- Joseph Alsop +%% +What's a cult? It just means not enough people to make a minority. + -- Robert Altman +%% +In any country there must be people who have to die. They are the +sacrifices any nation has to make to achieve law and order. + -- Idi Amin Dada +%% +Most plain girls are virtuous because of the scarcity of opportunity +to be otherwise. + -- Maya Angelou, "I Know Why the Caged Bird Sings" +%% +Children's talent to endure stems from their ignorance of alternatives. + -- Maya Angelou, "I Know Why the Caged Bird Sings" +%% +Oh, love is real enough, you will find it some day, but it has one +arch-enemy -- and that is life. + -- Jean Anouilh, "Ardele" +%% +Every man thinks God is on his side. The rich +and powerful know that he is. + -- Jean Anouilh, "The Lark" +%% +Experience is a good teacher, but she sends in terrific bills. + -- Minna Antrim, "Naked Truth and Veiled Allusions" +%% +It's amazing how nice people are to you when they know you're going away. + -- Michael Arlen +%% +The state of innocence contains the germs of all future sin. + -- Alexandre Arnoux, "Etudes et caprices" +%% +What passes for optimism is most often the effect of an intellectual error. + -- Raymond Aron, "The Opium of the Intellectuals" +%% +There is a good deal of solemn cant about the common interests of capital +and labour. As matters stand, their only common interest is that of cutting +each other's throat. + -- Brooks Atkinson, "Once Around the Sun" +%% +No poet or novelist wishes he was the only one who ever lived, but most of +them wish they were the only one alive, and quite a number fondly believe +their wish has been granted. + -- W.H. Auden, "The Dyer's Hand" +%% +Money cannot buy +The fuel of love +but is excellent kindling. + +To the man-in-the-street, who, I'm sorry to say, +Is a keen observer of life, +The word intellectual suggests right away +A man who's untrue to his wife. + -- W.H. Auden, "Collected Shorter Poems" +%% +A little inaccuracy saves a world of explanation. + -- C.E. Ayres +%% +Diplomacy is to do and say, the nastiest thing in the nicest way. + -- Balfour +%% +Mathematics is the only science where one never knows what +one is talking about nor whether what is said is true. + -- Russell +%% +Art is Nature speeded up and God slowed down. + -- Chazal +%% +I'm going to raise an issue and stick it in your ear. + -- John Foreman +%% +To understand the heart and mind of a person, look not at what +he has already achieved, but at what he aspires to do. +%% +Science and religion are in full accord but +science and faith are in complete discord. +%% +Before Xerox, five carbons were the maximum extension of anybody's ego. +%% +I will not be briefed or debriefed, my underwear is my own. +%% +Subtlety is the art of saying what you think +and getting out of the way before it is understood +%% +I've finally learned what 'upward compatible' means. +It means we get to keep all our old mistakes. + -- Dennie van Tassel +%% +Mathematicians are like Frenchmen: whatever you say to them they +translate into their own language and forthwith it is something +entirely different. + -- Goethe +%% +The Second Law of Thermodynamics: + If you think things are in a mess now, just wait! + -- Jim Warner +%% +Computer Science is the only discipline in which we view +adding a new wing to a building as being maintenance + -- Jim Horning +%% +Don't remember what you can infer. + -- Harry Tennant +%% +In case of fire, stand in the hall and shout "Fire!" + -- The Kidner Report +%% +Never tell people how to do things. Tell them WHAT to +do and they will surprise you with their ingenuity. + -- Gen. George S. Patton, Jr. +%% +Eternity is a terrible thought. I mean, where's it going to end? + -- Tom Stoppard +%% +If God had really intended men to fly, +he'd make it easier to get to the airport. + -- George Winters +%% +I have more humility in my little finger +than you have in your whole BODY! + -- Cerebus, #82 +%% +Five is a sufficiently close approximation to infinity. + -- Robert Firth +%% +brain-damaged, generalization of "Honeywell Brain Damage" (HBD), a +theoretical disease invented to explain certain utter cretinisms in +Multics, adj: + Obviously wrong; cretinous; demented. There is an implication + that the person responsible must have suffered brain damage, + because he/she should have known better. Calling something + brain-damaged is bad; it also implies it is unusable. +%% +feature, n: + A surprising property of a program. Occasionaly documented. To + call a property a feature sometimes means the author did not + consider that case, and the program makes an unexpected, though + not necessarily wrong response. See BUG. "That's not a bug, it's + a feature!" A bug can be changed to a feature by documenting it. +%% +Ferguson's Precept: + A crisis is when you can't say "let's forget the whole thing." +%% +If fifty million people say a foolish thing, it's still a foolish thing. + -- Bertrand Russell +%% +Rune's Rule: + If you don't care where you are, you ain't lost. +%% +He was the sort of person whose personality +would be greatly improved by a terminal illness. +%% +Style may not be the answer, but at least it's a workable alternative. +%% +To be trusted is a greater compliment than to be loved. +%% +To err is human, but when the eraser wears out +before the pencil, you're overdoing it a little. +%% +Wad some power the giftie gie us +To see oursels as others see us. + -- R. Browning +%% +I don't mind arguing with myself. +Its when I lose that it bothers me. + -- Richard Powers +%% +Beware of all enterprises that require new clothes. + -- Thoreau +%% +Time is an illusion; lunch-time doubly so. + -- Ford Prefect +%% +Much of the excitement we get out of our work +is that we don't really know what we are doing. + -- E. Dijkstra +%% +"First World" nations are the ones where people drive Japanese cars; +"Second World" nations are where First World residents go on vacation; +and "Third World" nations are the ones where people still dive out of +trees to prove their manhood. + -- Dave Barry +%% +When you die, you lose a very important part of your life. + -- Brooke Shields +%% +Between infinite and short there is a big difference. + -- G.H. Gonnet +%% +%% +Breadth-first search is the bulldozer of science. + -- Randy Goebel +%% +If I'm over the hill, why is it I don't recall ever being on top? + -- Jerry Muscha +%% +Nirvana? That's the place where the powers +that be and their friends hang out. + -- Zonker Harris +%% + "What are you doing?" + "Examining the world's major religions. I'm looking for something +that's light on morals, has lots of holidays, and with a short initiation +period." +%% +"A wizard cannot do everything; a fact most magicians are recticent to admit, +let alone discuss with prospective clients. Still, the fact remains that +there are certain objects, and people, that are, for one reason or another, +completely immune to any direct magical spell. It is for this group of +beings that the magician learns the subtleties of using indirect spells. +It also does no harm, in dealing with these matters, to carry a large club +near your person at all times." + -- The Teachings of Ebenezum, Volume VIII +%% +"There are those who claim that magic is like the tide; that it swells and +fades over the surface of the earth, collecting in concentrated pools here +and there, almost disappearing from other spots, leaving them parched for +wonder. There are also those who believe that if you stick your fingers up +your nose and blow, it will increase your intelligence." + -- The Teachings of Ebenezum, Volume VII +%% +What we do not understand we do not possess. + -- Goethe +%% +It is common sense to take a method and try it. If it fails, admit +it frankly and try another. But above all, try something. + -- Franklin D. Roosevelt +%% +Egotism is the anesthetic which numbs the pain of stupidity. +%% +Therefore it is necessary to learn how not to be good, and to use +this knowledge and not use it, according to the necessity of the cause. + -- Machiavelli +%% +A woman did what a woman had to, the best way she knew how. +To do more was impossible, to do less, unthinkable. + -- Dirisha, "The Man Who Never Missed" +%% +If you took all of the grains of sand in the world, and lined +them up end to end in a row, you'd be working for the government! + -- Mr. Interesting +%% +All I want is a warm bed and a kind word and unlimited power. + -- Ashleigh Brilliant +%% +Somehow I reached excess without ever noticing +when I was passing through satisfaction. + -- Ashleigh Brilliant +%% +That is the true season of love, when we believe that we alone can love, +that no one could have loved so before us, and that no one will love +in the same way as us. + -- Johann Wolfgang von Goethe +%% +A dream will always triumph over reality, once it is given the chance. + -- Stanislaw Lem +%% +Justice, n: + A decision in your favor. +%% +You first parents of the human race... who ruined yourself for +an apple, what might you not have done for a truffled turkey? + -- Brillat-Savarin +%% +A prohibitionist is the sort of man one wouldn't care to +drink with -- even if he drank. + -- Mencken +%% +I can give you my word, but I know what it's worth and you don't. + -- Nero Wolfe, "Over My Dead Body" +%% +Fame may be fleeting but obscurity is forever. +%% +Viking, n: + 1. Daring Scandinavian seafarers, explorers, adventurers, + entrepreneurs world-famous for their aggressive, nautical import + business, highly leveraged takeovers and blue eyes. + 2. Bloodthirsty sea pirates who ravaged northern Europe beginning + in the 9th century. + +Hagar's note: The first definition is much preferred; the second is used +only by malcontents, the envious, and disgruntled owners of waterfront +property. +%% +Write a wise saying and your name will live forever. + -- Anonymous +%% +Knights are hardly worth it. +I mean, all that shell and so little meat... +%% +Rule #7: Silence is not acquiescence. + Contrary to what you may have heard, silence of those present is +not necessarily consent, even the reluctant variety. They simply may +sit in stunned silence and figure ways of sabotaging the plan after they +regain their composure. +%% +Do you mean that you not only want a wrong +answer, but a certain wrong answer? + -- Tobaben +%% +The problem that we thought was a problem was, indeed, +a problem, but not the problem we thought was the problem. + -- Mike Smith +%% +The tree of research must from time to time +be refreshed with the blood of bean counters. + -- Alan Kay +%% +By working faithfully eight hours a day, +you may eventually get to be boss and work twelve. + -- Robert Frost +%% +The worst part of having success is trying +to find someone who is happy for you. + -- Bette Midler +%% +I've got all the money I'll ever need if I die by 4 o'clock. + -- Henny Youngman +%% +The Puritan hated bear-baiting, not because it gave pain to +the bear, but because it gave pleasure to the spectators. + -- Macaulay, "History of England, I" +%% +What good is an obscenity trial except to popularize literature? + -- Nero Wolfe, "The League of Frightened Men" +%% +Come, landlord, fill the flowing bowl until it does run over, +Tonight we will all merry be -- tomorrow we'll get sober. + -- John Fletcher, "The Bloody Brother", II, 2 +%% +There be sober men a'plenty, and drunkards barely twenty; there are men +of over ninety who have never yet kissed a girl. But give me the rambling +rover, from Orkney down to Dover, we will roam the whole world over, and +together we'll face the world. + -- Andy Stewart, "After the Hush" +%% +Dignity is like a flag. +It flaps in a storm. + -- Roy Mengot +%% +The only winner in the War of 1812 was Tchaikovsky. + -- David Gerrold +%% +The explanation requiring the fewest assumptions +is the most likely to be correct. + -- William of Occam +%% +It must be remembered that there is nothing more difficult to plan, +more doubtful of success, nor more dangerous to manage, than the +creation of a new system. For the initiator has the emnity of all +who would profit by the preservation of the old institutions and +merely lukewarm defenders in those who would gain by the new ones. + -- Niccolo Machiavelli, 1513 +%% +Gil-galad was an Elven-King +of him the harpers sadly sing; +the last whose realm was fair and free +between the Mountains and the Sea. + +His sword was long, his lance was keen, +his shining helm afar was seen; +the countless stars of heaven's field +were mirrored in his silver shield. + +But long ago he rode away, +and where he dwelleth none can say; +for into darkness fell his star +in Mordor where the shadows are. +%% +It is possible by ingenuity and at the expense of clarity... {to +do almost anything in any language}. However, the fact that it is +possible to push a pea up a mountain with your nose does not mean +that this is a sensible way of getting it there. Each of these +techniques of language extension should be used in its proper place. + -- Christopher Strachey +%% +Truth is the most valuable thing we have -- so let us economize it. + -- Mark Twain +%% +Nothing is more admirable than the fortitude with which +millionaires tolerate the disadvantages of their wealth. + -- Nero Wolfe +%% +HISTORY: Papa Hegel he say that all we learn from history is that we +learn nothing from history. I know people who can't even learn from +what happened this morning. Hegel must have been taking the long view. + -- "The Hipcrime Vocab", Chad C. Mulligan +%% + "...The name of the song is called 'Haddocks' Eyes'!" + "Oh, that's the name of the song, is it?" Alice said, trying to +feel interested. + "No, you don't understand," the Knight said, looking a little +vexed. "That's what the name is called. The name really is, 'The Aged +Aged Man.'" + "Then I ought to have said "That's what the song is called'?" +Alice corrected herself. + "No, you oughtn't: that's quite another thing! The song is +called 'Ways and Means': but that's only what it is called you know!" + "Well, what is the song then?" said Alice, who was by this +time completely bewildered. + "I was coming to that," the Knight said. "The song really is +"A-sitting on a Gate": and the tune's my own invention." + --Lewis Carroll, "Through the Looking Glass" +%% +If I set here and stare at nothing long enough, +people might think I'm an engineer working on something. + -- S.R. McElroy +%% +When in doubt, have a man come through the door with a gun in his hand. + -- Raymond Chandler +%% +Chapter 1: + The story so far: + In the beginning the Universe was created. This has made +a lot of people very angry and been widely regarded as a bad move. +%% +"I only touch base with reality on an as-needed basis!" +%% +Repartee is something we think of twenty-four hours too late. + -- Mark Twain +%% +I often quote myself; it adds spice to my conversation. + -- Shaw +%% +The real purpose of books is to trap the mind into doing its own thinking. + -- Christopher Morley +%% +I took a course in speed reading, learning to read straight down +the middle of the page, and I was able to go through "War and Peace" +in twenty minutes. It's about Russia. + -- Woody Allen +%% +It is all right to hold a conversation, +but you should let go of it now and then. + -- Richard Armour +%% +Now I lay me back to sleep. +The speaker's dull; the subject's deep. +If he should stop before I wake, +Give me a nudge for goodness' sake. + -- Anonymous +%% +Passion is that funny feeling that drives a man to +bite a woman's neck because she has beautiful legs. +%% + The problem with engineers is that they tend to +cheat in order to get results. + The problem with mathematicians is that they tend +to work on toy problems in order to get results + The problem with program verifiers is that they tend +to cheat at toy problems in order to get results. +%% +Never hit a man with glasses; hit him with your fist. +%% +Ninety percent of the time things turn out worse than you thought they +would. The other ten percent of the time you had no right to expect +that much. + -- Augustine +%% +Responsibility: + Everyone says that having power is a great responsibility. This is +a lot of bunk. Responsibility is when someone can blame you if something +goes wrong. When you have power you are surrounded by people whose job it +is to take the blame for your mistakes. If they're smart, that is. + -- Cerebus, "On Governing" +%% +Anything is possible on paper. + -- Ron McAfee +%% +We are each only one drop in a great +ocean -- but some of the drops sparkle! +%% +An Ada exception is when a routine gets +in trouble and says 'Beam me up, Scotty'. +%% +Large increases in cost with questionable increases in +performance can be tolerated only in race horses and women. + -- Lord Kalvin +%% +Well, some take delight in the carriages a-rolling, +And some take delight in the hurling and the bowling, +But I take delight in the juice of the barley, +And courting pretty fair maids in the morning bright and early. +%% +Just remember, wherever you go, there you are. + -- Buckeroo Banzai +%% +I value kindness to human beings first of all, and kindness to animals. I +don't respect the law; I have a total irreverence for anything connected +with society except that which makes the roads safer, the beer stronger, +the food cheaper, and old men and womem warmer in the winter, and happier +in the summer. + -- Brendan Behan +%% +A woman shouldn't have to buy her own perfume. + -- Maurine Lewis +%% +The Celts invented two things, Whiskey and self-distruction. +%% +Ye've also got to remember that ... respectable people do the most +astonishin' things to preserve their respectability. Thank God +I'm not respectable. + -- Ruthven Campbell Todd +%% +Say it with flowers, +Or say it with mink, +But whatever you do, +Don't say it with ink! + -- Jimmie Durante +%% +Love to eat them mousies; +Mousies what I love to eat. +Bite they tiny heads off, +Nibble on they tiny feet! + -- Kilban +%% +Nice boy, but about as sharp as a sack of wet mice. + -- Foghorn Leghorn +%% +The streets were dark with something more than night. + -- Raymond Chandler +%% + Insofar as I may be heard by anything, which may or may not care +what I say, I ask, if it matters, that you be forgiven for anything you +may have done or failed to do which requires forgiveness. Conversely, if +not forgiveness but something else may be required to insure any possible +benefit for which you may be eligible after the destruction of your body, +I ask this, whatever it may be, be granted or withheld, as the case may be, +in such a manner as to insure your receiving said benefit. I ask this in my +capacity as your elected intermediary between yourself and that which may +not be yourself, but which may have an interest in the matter of your +receiving as much as it is possible for you to receive of this thing, and +which may in some way be influenced by this ceremony. + Amen. +%% +The best laid plans of mice and men +are held up in the legal department. +%% +No group of professionals meets except to +conspire against the public at large. + -- Mark Twain +%% +One thing about the past. +It's likely to last. + -- Ogden Nash +%% +Luck can't last a lifetime, unless you die young. + -- Russell Banks +%% +Nothing ever becomes real till it is experienced -- even a +proverb is no proverb to you till your life has illustrated it. + -- John Keats +%% +Simulations are like miniskirts, they show a lot and hide the essentials. + -- Hubert Kirrman +%% +The last thing one knows in constructing a work is what to put first. + -- Blaise Pascal +%% +If you cannot in the long run tell everyone +what you have been doing, your doing was worthless. + -- Edwim Schrodinger +%% +I don't want to achieve immortality through my works. +I want to achieve immortality through not dying. + -- Woody Allen +%% +A sequel is an admission that you've been reduced to imitating yourself. + -- Don Marquis +%% +If you want to get rich from writing, write the sort of thing that's +read by persons who move their lips when the're reading to themselves. + -- Don Marquis +%% +It took me fifteen years to discover that I had no talent for writing, +but I couldn't give it up because by that time I was too famous. + -- Robert Benchley +%% +God is REAL unless declared INTEGER. +%% +There are many intelligent species in +the universe, and they all own cats. +%% +I would rather say that a desire to drive fast +sports cars is what sets man apart from the animals. +%% +If you sow your wild oats, hope for a crop failure. +%% +Girls are better looking in snowstorms. + -- Archie Goodwin +%% +You must know that a man can have only one invulnerable loyalty, loyalty +to his own concept of the obligations of manhood. All other loyalties +are merely deputies of that one. + -- Nero Wolfe +%% +On the road, ZIPPY is a pinhead without a purpose, but never without a POINT. +%% +WHOA!! Ken and Barbie are having TOO MUCH FUN!! +It must be the NEGATIVE IONS!! +%% + God decided to take the devil to court and settle their +differences once and for all. + When Satan heard of this, he grinned and said, "And just +where do you think you're going to find a lawyer?" +%% + A lawyer named Strange was shopping for a tombstone. After he had +made his selection, the stonecutter asked him what inscription he +would like on it. "Here lies an honest man and a lawyer," responded the +lawyer. + "Sorry, but I can't do that," replied the stonecutter. "In this +state, it's against the law to bury two people in the same grave. However, +I could put ``here lies an honest lawyer'', if that would be okay." + "But that won't let people know who it is" protested the lawyer. + "Certainly will," retorted the stonecutter. "people will read it +and exclaim, "That's Strange!" +%% +History has much to say on following the proper procedures. From a history +of the Mexican revolution: + + "Hildago was later defeated at Guadalajara. The rebel army was +captured on is way through the mountains. All were courtmartialed and +shot, except Hildago, because he was a priest. He was handed over to +the bishop of Durango who excommunicated him and returned him to the +army where he was then executed." +%% +We're Knights of the Round Table +We dance whene'er we're able We're knights of the Round Table +We do routines and chorus scenes Our shows are formidable +With footwork impeccable But many times +We dine well here in Camelot We're given rhymes +We eat ham and jam and Spam a lot. That are quite unsingable + We're opera mad in Camelot + We sing from the diaphragm a lot. +In war we're tough and able, +Quite indefatigable +Between our quests +We sequin vests +And impersonate Clark Gable +It's a busy life in Camelot. +I have to push the pram a lot. + -- Monty Python +%% + And St. Attila raised the hand grenade up on high saying "O Lord +bless this thy hand grenade that with it thou mayest blow thine enemies +to tiny bits, in thy mercy" and the Lord did grin and the people did feast +upon the lambs and sloths and carp and anchovies and orang-utangs and +breakfast cereals and fruit bats and... + (skip a bit brother...) + Er ... oh, yes ... and the Lord spake, saying "First shalt thou +take out the Holy Pin, then shalt thou count to three, no more, no less. +Three shall be the number thou shalt count, and the number of the count +shall be three. Four shalt thou not count neither count thou two, excepting +that thou then proceed to three. Five is right out. Once the number +three, being the third number, be reached then lobbest thou thy Holy Hand +Grenade of Antioch towards thy foe, who being naught in my sight, shall +snuff it. + -- Monty Python, "The Book of Armaments" +%% +Fog Lamps, n: + Excessively (often obnoxiously) bright lamps mounted on the fronts + of automobiles; used on dry, clear nights to indicate that the + driver's brain is in a fog. See also "Idiot Lights". +%% +Don't drop acid -- take it pass/fail. + -- Seen in a Ladies Room at Harvard +%% +I just got out of the hospital after a +speed reading accident. I hit a bookmark. + -- S. Wright +%% +I finally went to the eye doctor. I got contacts. +I only need them to read, so I got flip-ups. + -- S. Wright +%% +I have a box of telephone rings under my bed. Whenever I get lonely, I +open it up a little bit, and I get a phone call. One day I dropped the +box all over the floor. The phone wouldn't stop ringing. I had to get +it disconnected. So I got a new phone. I didn't have much money, so I +had to get an irregular. It doesn't have a five. I ran into a friend +of mine on the street the other day. He said why don't you give me a +call. I told him I can't call everybody I want to anymore, my phone +doesn't have a five. He asked how long had it been that way. I said I +didn't know -- my calendar doesn't have any sevens. + -- S. Wright +%% +I am getting into abstract painting. Real abstract - no brush, no +%% +I woke up one morning and found that everything in my apartment had been +stolen and replaced with an exact duplicate. I called up a friend of mine, +told him this. He said, "Do I know you?" + -- S. Wright +%% +I am getting into abstract painting. Real abstract -- no brush, no +canvas, I just think about it. I just went to an art museum where +all of the art was done by children. All the paintings were hung on +refridgerators. + -- S. Wright +%% +He asked me if I knew what time it was -- I said yes, but not right now. + -- S. Wright +%% +I got tired of listening to the recording on the phone at the movie +theater. So I bought the album. I got kicked out of a theater the +other day for bringing my own food in. I argued that the concession +stand prices were outrageous. Besides, I hadn't had a barbecue in a +long time. I went to the theater and the sign said adults $5 children +$2.50. I told them I wanted 2 boys and a girl. I once took a cab to +a drive-in movie. The movie cost me $95. + -- S. Wright +%% +I was at this restaurant. The sign said "Breakfast Anytime." So I +ordered French Toast in the Rennaissance. + -- S. Wright +%% +I was in Vegas last week. I was at the roulette table, having a +lengthy argument about what I considered an Odd number. + -- S. Wright +%% +I got this powdered water -- now I don't know what to add. + -- S. Wright +%% +I poured spot remover on my dog. Now he's gone. + -- S. Wright +%% +Go away. I'm all right. + -- H.G. Wells' last words +%% +I used to work in a fire hydrant factory. You couldn't +park anywhere near the place. + -- Steven Wright +%% +World War III is about to break out, but hidden somewhere in Switzerland, +a small group of international statesmen are trying to avert disaster. +The key members of this group are the representatives from Moscow, Bonn, and +Jerusalem, who, despite their personal enmity, manage to forge a peaceful +settlement, at the last moment. As the treaty is signed, and the war +postponed, almost entirely through the efforts of those three men, an angel +appears. "The earth is saved through the efforts of these three men! +Therefore, I will grant each of them their heart's desire!" + So, the angel asks the German for his wish, and the German, recalling +the nearness of their disaster, and perceiving the cause to have been the +Russians, immediately says "I wish there were no more Russians!" And God +said, "It will be done." + The angel asks the Russian for his wish, which, of course, is "*I* +wish there were no more Germans!" Replies the angel, "It will be done." + So the angel asks the Jew for his wish. The Jew is in a state of +shock. "Will you really grant the German's wish?" he asks, and the angel +avers. "And the Russian's, too?" The angel avers yet again. Then the Jew +thinks a moment, leans back and says, "In that case, I think I'd like a small +cup of coffee." +%% +An Aggie farmer was lifting his hogs, one by one, up to the branches of +his apple trees to graze on the apples. A Texas student walked by and +asked him, "Doesn't that take a lot of time?" + Replied the Aggie, "What's time to a hog?" +%% diff --git a/games/fortune/scene.4.3 b/games/fortune/scene.4.3 new file mode 100644 index 0000000..f7ccdbf --- /dev/null +++ b/games/fortune/scene.4.3 @@ -0,0 +1,9761 @@ +!07/11 PDP a ni deppart m'I !pleH +%% +(1) Alexander the Great was a great general. +(2) Great generals are forewarned. +(3) Forewarned is forearmed. +(4) Four is an even number. +(5) Four is certainly an odd number of arms for a man to have. +(6) The only number that is both even and odd is infinity. + +Therefore, Alexander the Great had an infinite number of arms. +%% +(1) Everything depends. +(2) Nothing is always. +(3) Everything is sometimes. +%% +$100 invested at 7% interest for 100 years will become $100,000, at +which time it will be worth absolutely nothing. + -- Lazarus Long, "Time Enough for Love" +%% +101 USES FOR A DEAD MICROPROCESSOR + (1) Scarecrow for centipedes + (2) Dead cat brush + (3) Hair barrettes + (4) Cleats + (5) Self-piercing earrings + (6) Fungus trellis + (7) False eyelashes + (8) Prosthetic dog claws + . + . + . + (99) Window garden harrow (pulled behind Tonka tractors) + (100) Killer velcro + 101. Currency +%% +186,282 miles per second: + +It isn't just a good idea, it's the law! +%% +$3,000,000 +%% +355/113 -- Not the famous irrational number PI, but an incredible +simulation! +%% +43rd Law of Computing: + Anything that can go wr +fortune: Segmentation violation -- Core dumped +%% +77. HO HUM -- The Redundant + +------- (7) This hexagram refers to a situation of extreme +--- --- (8) boredom. Your programs always bomb off. Your wife +------- (7) smells bad. Your children have hives. You are working +---O--- (6) on an accounting system, when you want to develop +---X--- (9) the GREAT AMERICAN COMPILER. You give up hot dates +--- --- (8) to nurse sick computers. What you need now is sex. + +Nine in the second place means: + The yellow bird approaches the malt shop. Misfortune. + +Six in the third place means: + In former times men built altars to honor the Internal + Revenue Service. Great Dragons! Are you in trouble! +%% +99 blocks of crud on the disk, +99 blocks of crud! +You patch a bug, and dump it again: +100 blocks of crud on the disk! + +100 blocks of crud on the disk, +100 blocks of crud! +You patch a bug, and dump it again: +101 blocks of crud on the disk! ... +%% +A baby is an alimentary canal with a loud voice at one end and no +responsibility at the other. +%% +A bachelor is a selfish, undeserving guy who has cheated some woman +out of a divorce. + -- Don Quinn +%% +A banker is a fellow who lends you his umbrella when the sun is shining +and wants it back the minute it begins to rain. + -- Mark Twain +%% +A billion here, a couple of billion there -- first thing you know it +adds up to be real money. + -- Everett McKinley Dirksen +%% +A bird in the bush usually has a friend in there with him. +%% +A bird in the hand is worth what it will bring. +%% +A bore is someone who persists in holding his own views after we have +enlightened him with ours. +%% +A budget is just a method of worrying before you spend money, as well +as afterward. +%% +A candidate is a person who gets money from the rich and votes from the +poor to protect them from each other. +%% +A celebrity is a person who is known for his well-knownness. +%% +A chubby man with a white beard and a red suit will approach you soon. +Avoid him. He's a Commie. +%% +A city is a large community where people are lonesome together + -- Herbert Prochnow +%% +A classic is something that everybody wants to have read and nobody +wants to read. + -- Mark Twain +%% +A closed mouth gathers no foot. +%% +A computer, to print out a fact, +Will divide, multiply, and subtract. + But this output can be + No more than debris, +If the input was short of exact. + -- Gigo +%% +A conclusion is simply the place where someone got tired of thinking. +%% +A CONS is an object which cares. + -- Bernie Greenberg. +%% +A countryman between two lawyers is like a fish between two cats. + -- Ben Franklin +%% +A crusader's wife slipped from the garrison +And had an affair with a Saracen. + She was not oversexed, + Or jealous or vexed, +She just wanted to make a comparison. +%% +A day for firm decisions!!!!! Or is it? +%% +A day without sunshine is like night. +%% +A diplomat is a man who can convince his wife she'd look stout in a +fur coat. +%% +A diplomat is someone who can tell you to go to hell in such a way that +you will look forward to the trip. +%% + A disciple of another sect once came to Drescher as he was +eating his morning meal. "I would like to give you this personality +test", said the outsider, "because I want you to be happy." + Drescher took the paper that was offered him and put it into +the toaster -- "I wish the toaster to be happy too". +%% +A diva who specializes in risqu'e arias is an off-coloratura soprano ... +%% + A doctor, an architect, and a computer scientist were arguing +about whose profession was the oldest. In the course of their +arguments, they got all the way back to the Garden of Eden, whereupon +the doctor said, "The medical profession is clearly the oldest, because +Eve was made from Adam's rib, as the story goes, and that was a simply +incredible surgical feat." + The architect did not agree. He said, "But if you look at the +Garden itself, in the beginning there was chaos and void, and out of +that, the Garden and the world were created. So God must have been an +architect." + The computer scientist, who had listened to all of this said, +"Yes, but where do you think the chaos came from?" +%% +A door is what a dog is perpetually on the wrong side of. + -- Ogden Nash +%% +A dozen, a gross, and a score, +Plus three times the square root of four, + Divided by seven, + Plus five time eleven, +Equals nine squared plus zero, no more. +%% +A famous Lisp Hacker noticed an Undergraduate sitting in front of a +Xerox 1108, trying to edit a complex Klone network via a browser. +Wanting to help, the Hacker clicked one of the nodes in the network +with the mouse, and asked "what do you see?" Very earnestly, the +Undergraduate replied "I see a cursor." The Hacker then quickly pressed +the boot toggle at the back of the keyboard, while simultaneously +hitting the Undergraduate over the head with a thick Interlisp Manual. +The Undergraduate was then Enlightened. +%% +A fanatic is one who can't change his mind and won't change the +subject. + -- Winston Churchill +%% +A fool must now and then be right by chance. +%% +A fool's brain digests philosophy into folly, science into +superstition, and art into pedantry. Hence University education. + -- G. B. Shaw +%% +A fool-proof method for sculpting an elephant: first, get a huge block +of marble; then you chip away everything that doesn't look like an +elephant. +%% +A formal parsing algorithm should not always be used. + -- D. Gries +%% +A gleekzorp without a tornpee is like a quop without a fertsneet (sort +of). +%% +A great many people think they are thinking when they are merely +rearranging their prejudices. + -- William James +%% +A lack of leadership is no substitute for inaction. +%% +A lady with one of her ears applied +To an open keyhole heard, inside, +Two female gossips in converse free -- +The subject engaging them was she. +"I think", said one, "and my husband thinks +That she's a prying, inquisitive minx!" +As soon as no more of it she could hear +The lady, indignant, removed her ear. +"I will not stay," she said with a pout, +"To hear my character lied about!" + -- Gopete Sherany +%% +A language that doesn't affect the way you think about programming is +not worth knowing. +%% +A language that doesn't have everything is actually easier to program +in than some that do. + -- Dennis M. Ritchie +%% +A large number of installed systems work by fiat. That is, they work +by being declared to work. + -- Anatol Holt +%% +A Law of Computer Programming: + Make it possible for programmers to write in English and you + will find the programmers cannot write in English. +%% +A limerick packs laughs anatomical +Into space that is quite economical. + But the good ones I've seen + So seldom are clean, +And the clean ones so seldom are comical. +%% +A LISP programmer knows the value of everything, but the cost of +nothing. +%% +A long-forgotten loved one will appear soon. Buy the negatives at any +price. +%% +A lot of people I know believe in positive thinking, and so do I. I +believe everything positively stinks. + -- Lew Col +%% + A man goes to a tailor to try on a new custom-made suit. The +first thing he notices is that the arms are too long. + "No problem," says the tailor. "Just bend them at the elbow +and hold them out in front of you. See, now it's fine." + "But the collar is up around my ears!" + "It's nothing. Just hunch your back up a little ... no, a +little more ... that's it." + "But I'm stepping on my cuffs!" the man cries in desperation. + "Nu, bend you knees a little to take up the slack. There you +go. Look in the mirror -- the suit fits perfectly." + So, twisted like a pretzel, the man lurches out onto the +street. Reba and Florence see him go by. + "Oh, look," says Reba, "that poor man!" + "Yes," says Florence, "but what a beautiful suit." + -- Arthur Naiman, "Every Goy's Guide to Yiddish" +%% +A man said to the Universe: "Sir, I exist!" + +"However," replied the Universe, "the fact has not created in me a +sense of obligation." + -- Stephen Crane +%% +A man wrapped up in himself makes a very small package. +%% +A mathematician is a machine for converting coffee into theorems. +%% + A musician of more ambition than talent composed an elegy at +the death of composer Edward MacDowell. She played the elegy for the +pianist Josef Hoffman, then asked his opinion. "Well, it's quite +nice," he replied, but don't you think it would be better if ..." + "If what?" asked the composer. + "If ... if you had died and MacDowell had written the elegy?" +%% +A new dramatist of the absurd +Has a voice that will shortly be heard. + I learn from my spies + He's about to devise +An unprintable three-letter word. +%% +A new koan: + + If you have some ice cream, I will give it to you. + + If you have no ice cream, I will take it away from you. + +It is an ice cream koan. +%% +A new supply of round tuits has arrived and are available from Mary. +Anyone who has been putting off work until they got a "round tuit" now +has no excuse for further procrastination. +%% +A nuclear war can ruin your whole day. +%% +A penny saved is ridiculous. +%% +A person is just about as big as the things that make them angry. +%% +A physicist is an atom's way of knowing about atoms. + -- George Wald +%% +A pig is a jolly companion, +Boar, sow, barrow, or gilt -- +A pig is a pal, who'll boost your morale, +Though mountains may topple and tilt. +When they've blackballed, bamboozled, and burned you, +When they've turned on you, Tory and Whig, +Though you may be thrown over by Tabby and Rover, +You'll never go wrong with a pig, a pig, +You'll never go wrong with a pig! + -- Thomas Pynchon, "Gravity's Rainbow" +%% + A Plan for the Improvement of English Spelling + by Mark Twain + + For example, in Year 1 that useless letter "c" would be dropped +to be replased either by "k" or "s", and likewise "x" would no longer +be part of the alphabet. The only kase in which "c" would be retained +would be the "ch" formation, which will be dealt with later. Year 2 +might reform "w" spelling, so that "which" and "one" would take the +same konsonant, wile Year 3 might well abolish "y" replasing it with +"i" and Iear 4 might fiks the "g/j" anomali wonse and for all. + Jenerally, then, the improvement would kontinue iear bai iear +with Iear 5 doing awai with useless double konsonants, and Iears 6-12 +or so modifaiing vowlz and the rimeining voist and unvoist konsonants. +Bai Iear 15 or sou, it wud fainali bi posibl tu meik ius ov thi +ridandant letez "c", "y" and "x" -- bai now jast a memori in the maindz +ov ould doderez -- tu riplais "ch", "sh", and "th" rispektivli. + Fainali, xen, aafte sam 20 iers ov orxogrefkl riform, wi wud +hev a lojikl, kohirnt speling in ius xrewawt xe Ingliy-spiking werld. +%% +A priest asked: What is Fate, Master? + +And he answered: + +It is that which gives a beast of burden its reason for existence. + +It is that which men in former times had to bear upon their backs. + +It is that which has caused nations to build byways from City to City +upon which carts and coaches pass, and alongside which inns have come +to be built to stave off Hunger, Thirst and Weariness. + +And that is Fate? said the priest. + +Fate ... I thought you said Freight, responded the Master. + +That's all right, said the priest. I wanted to know what Freight was +too. + -- Kehlog Albran, "The Profit" +%% + A priest was walking along the cliffs at Dover when he came +upon two locals pulling another man ashore on the end of a rope. +"That's what I like to see", said the priest, "A man helping his fellow +man". + As he was walking away, one local remarked to the other, "Well, +he sure doesn't know the first thing about shark fishing." +%% +A professor is one who talks in someone else's sleep. +%% +"A programmer is a person who passes as an exacting expert on the basis +of being able to turn out, after innumerable punching, an infinite +series of incomprehensive answers calculated with micrometric +precisions from vague assumptions based on debatable figures taken from +inconclusive documents and carried out on instruments of problematical +accuracy by persons of dubious reliability and questionable mentality +for the avowed purpose of annoying and confounding a hopelessly +defenseless department that was unfortunate enough to ask for the +information in the first place." + -- IEEE Grid newsmagazine +%% +A psychiatrist is a person who will give you expensive answers that +your wife will give you for free. +%% +A real patriot is the fellow who gets a parking ticket and rejoices +that the system works. +%% +A real person has two reasons for doing anything ... a good reason and +the real reason. +%% +A recent study has found that concentrating on difficult off-screen +objects, such as the faces of loved ones, causes eye strain in computer +scientists. Researchers into the phenomenon cite the added +concentration needed to "make sense" of such unnatural three +dimensional objects ... +%% +A rock pile ceases to be a rock pile the moment a single man +contemplates it, bearing within him the image of a cathedral. + -- Antoine de Saint-Exupery +%% + A Severe Strain on the Credulity + +As a method of sending a missile to the higher, and even to the highest +parts of the earth's atmospheric envelope, Professor Goddard's rocket +is a practicable and therefore promising device. It is when one +considers the multiple-charge rocket as a traveler to the moon that one +begins to doubt ... for after the rocket quits our air and really +starts on its journey, its flight would be neither accelerated nor +maintained by the explosion of the charges it then might have left. +Professor Goddard, with his "chair" in Clark College and countenancing +of the Smithsonian Institution, does not know the relation of action to +re-action, and of the need to have something better than a vacuum +against which to react ... Of course he only seems to lack the +knowledge ladled out daily in high schools. + -- New York Times Editorial, 1920 +%% +A sine curve goes off to infinity or at least the end of the blackboard + -- Prof. Steiner +%% +A solemn, unsmiling, sanctimonious old iceberg who looked like he was +waiting for a vacancy in the Trinity. + -- Mark Twain +%% +A straw vote only shows which way the hot air blows. + -- O'Henry +%% +A student who changes the course of history is probably taking an +exam. +%% +A successful tool is one that was used to do something undreamed of by +its author. + -- S. C. Johnson +%% +A total abstainer is one who abstains from everything but abstention, +and especially from inactivity in the affairs of others. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +A transistor protected by a fast-acting fuse will protect the fuse by +blowing first. +%% +A truly wise man never plays leapfrog with a unicorn. +%% +A university is what a college becomes when the faculty loses interest +in students. + -- John Ciardi +%% +A UNIX saleslady, Lenore, +Enjoys work, but she likes the beach more. + She found a good way + To combine work and play: +She sells C shells by the seashore. +%% +A vacuum is a hell of a lot better than some of the stuff that nature +replaces it with. + -- Tenessee Williams +%% +A very intelligent turtle +Found programming UNIX a hurdle + The system, you see, + Ran as slow as did he, +And that's not saying much for the turtle. +%% +A well adjusted person is one who makes the same mistake twice without +getting nervous. +%% +"A witty saying proves nothing." + -- Voltaire +%% +A year spent in artificial intelligence is enough to make one believe +in God. +%% +A.A.A.A.A.: + An organization for drunks who drive +%% +AAAAAAAAAaaaaaaaaaaaaaaaccccccccckkkkkk!!!!!!!!! +You brute! Knock before entering a ladies room! +%% +Abandon the search for Truth; settle for a good fantasy. +%% +About the time we think we can make ends meet, somebody moves the +ends. + -- Herbert Hoover +%% +Absence makes the heart go wander. +%% +Absent, adj.: + Exposed to the attacks of friends and acquaintances; defamed; +slandered. +%% +Absentee, n.: + A person with an income who has had the forethought to remove +himself from the sphere of exaction. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Abstainer, n.: + A weak person who yields to the temptation of denying himself a +pleasure. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Absurdity, n.: + A statement or belief manifestly inconsistent with one's own +opinion. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Accident, n.: + A condition in which presence of mind is good, but absence of +body is better. +%% +Accidents cause History. + +If Sigismund Unbuckle had taken a walk in 1426 and met Wat Tyler, the +Peasant's Revolt would never have happened and the motor car would not +have been invented until 2026, which would have meant that all the oil +could have been used for lamps, thus saving the electric light bulb and +the whale, and nobody would have caught Moby Dick or Billy Budd. + -- Mike Harding, "The Armchair Anarchist's Almanac" +%% +According to my best recollection, I don't remember. + -- Vincent "Jimmy Blue Eyes" Alo +%% +According to the latest official figures, 43% of all statistics are +totally worthless. +%% +Accordion, n.: + A bagpipe with pleats. +%% +Accuracy, n.: + The vice of being right +%% +Acid -- better living through chemistry. +%% +Acid absorbs 47 times it's weight in excess Reality. +%% +Acquaintance, n.: + A person whom we know well enough to borrow from, but not well +enough to lend to. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +"Acting is an art which consists of keeping the audience from +coughing." +%% +Actor: "I'm a smash hit. Why, yesterday during the last act, I had + everyone glued in their seats!" +Oliver Herford: "Wonderful! Wonderful! Clever of you to think of + it!" +%% +Actor: So what do you do for a living? +Doris: I work for a company that makes deceptively shallow serving + dishes for Chinese restaurants. + -- Woody Allen, "Without Feathers" +%% +ADA, n.: + Something you need only know the name of to be an Expert in +Computing. Useful in sentences like, "We had better develop an ADA +awareness." +%% +Admiration, n.: + Our polite recognition of another's resemblance to ourselves. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Adolescence, n.: + The stage between puberty and adultery. +%% +"Adopted kids are such a pain -- you have to teach them how to look +like you ..." + --- Gilda Radner +%% +Adore, v.: + To venerate expectantly. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Adult, n.: + One old enough to know better. +%% +After [Benjamin] Franklin came a herd of Electrical Pioneers whose +names have become part of our electrical terminology: Myron Volt, Mary +Louise Amp, James Watt, Bob Transformer, etc. These pioneers conducted +many important electrical experiments. For example, in 1780 Luigi +Galvani discovered (this is the truth) that when he attached two +different kinds of metal to the leg of a frog, an electrical current +developed and the frog's leg kicked, even though it was no longer +attached to the frog, which was dead anyway. Galvani's discovery led +to enormous advances in the field of amphibian medicine. Today, +skilled veterinary surgeons can take a frog that has been seriously +injured or killed, implant pieces of metal in its muscles, and watch it +hop back into the pond just like a normal frog, except for the fact +that it sinks like a stone. + -- Dave Barry, "What is Electricity?" +%% +After all, all he did was string together a lot of old, well-known +quotations. + -- H. L. Mencken, on Shakespeare +%% +After all, what is your hosts' purpose in having a party? Surely not +for you to enjoy yourself; if that were their sole purpose, they'd have +simply sent champagne and women over to your place by taxi. + -- P. J. O'Rourke +%% +After an instrument has been assembled, extra components will be found +on the bench. +%% + After his Ignoble Disgrace, Satan was being expelled from +Heaven. As he passed through the Gates, he paused a moment in thought, +and turned to God and said, "A new creature called Man, I hear, is soon +to be created." + "This is true," He replied. + "He will need laws," said the Demon slyly. + "What! You, his appointed Enemy for all Time! You ask for the +right to make his laws?" + "Oh, no!" Satan replied, "I ask only that he be allowed to make +his own." + It was so granted. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +After I run your program, let's make love like crazed weasels, OK? +%% +After the last of 16 mounting screws has been removed from an access +cover, it will be discovered that the wrong access cover has been +removed. +%% +Afternoon very favorable for romance. Try a single person for a +change. +%% +Afternoon, n.: + That part of the day we spend worrying about how we wasted the +morning. +%% +Air is water with holes in it +%% +Alas, I am dying beyond my means. + -- Oscar Wilde, as he sipped champagne on his deathbed +%% +Albert Einstein, when asked to describe radio, replied: "You see, wire +telegraph is a kind of a very, very long cat. You pull his tail in New +York and his head is meowing in Los Angeles. Do you understand this? +And radio operates exactly the same way: you send signals here, they +receive them there. The only difference is that there is no cat." +%% +Aleph-null bottles of beer on the wall, +Aleph-null bottles of beer, + You take one down, and pass it around, +Aleph-null bottles of beer on the wall. +%% +Alex Haley was adopted! +%% +Alexander Graham Bell is alive and well in New York, and still waiting +for a dial tone. +%% +Alimony is a system by which, when two people make a mistake, one of +them keeps paying for it. + -- Peggy Joyce +%% +"All flesh is grass" + -- Isiah +Smoke a friend today. +%% +All I ask is a chance to prove that money can't make me happy. +%% +All I ask is a chance to prove that money can't make me happy. +%% +All I ask of life is a constant and exaggerated sense of my own +importance. +%% +"All my friends and I are crazy. That's the only thing that keeps us +sane." +%% +All programmers are playwrights and all computers are lousy actors. +%% +All progress is based upon a universal innate desire on the part of +every organism to live beyond its income. + -- Samuel Butler +%% +All science is either physics or stamp collecting. + -- E. Rutherford +%% +All the big corporations depreciate their possessions, and you can, +too, provided you use them for business purposes. For example, if you +subscribe to the Wall Street Journal, a business-related newspaper, you +can deduct the cost of your house, because, in the words of U.S. +Supreme Court Chief Justice Warren Burger in a landmark 1979 tax +decision: "Where else are you going to read the paper? Outside? What +if it rains?" + -- Dave Barry, "Sweating Out Taxes" +%% +"... all the modern inconveniences ..." + -- Mark Twain +%% +All the world's a stage and most of us are desperately unrehearsed. + -- Sean O'Casey +%% +All the world's a VAX, +And all the coders merely butchers; +They have their exits and their entrails; +And one int in his time plays many widths, +His sizeof being N bytes. At first the infant, +Mewling and puking in the Regent's arms. +And then the whining schoolboy, with his Sun, +And shining morning face, creeping like slug +Unwillingly to school. + -- A Very Annoyed PDP-11 +%% +All things are possible except skiing thru a revolving door. +%% +All true wisdom is found on T-shirts. +%% +All you have to do to see the accuracy of my thesis is look around +you. Look, in particular, at the people who, like you, are making +average incomes for doing average jobs -- bank vice presidents, +insurance salesman, auditors, secretaries of defense -- and you'll +realize they all dress the same way, essentially the way the mannequins +in the Sears menswear department dress. Now look at the real +successes, the people who make a lot more money than you -- Elton John, +Captain Kangaroo, anybody from Saudi Arabia, Big Bird, and so on. They +all dress funny -- and they all succeed. Are you catching on? + -- Dave Barry, "How to Dress for Real Success" +%% +Alliance, n.: + In international politics, the union of two thieves who have +their hands so deeply inserted in each other's pocket that they cannot +separately plunder a third. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Alone, adj.: + In bad company. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Although we modern persons tend to take our electric lights, radios, +mixers, etc., for granted, hundreds of years ago people did not have +any of these things, which is just as well because there was no place +to plug them in. Then along came the first Electrical Pioneer, +Benjamin Franklin, who flew a kite in a lighting storm and received a +serious electrical shock. This proved that lighting was powered by the +same force as carpets, but it also damaged Franklin's brain so severely +that he started speaking only in incomprehensible maxims, such as "A +penny saved is a penny earned." Eventually he had to be given a job +running the post office. + -- Dave Barry, "What is Electricity?" +%% +Always borrow money from a pessimist; he doesn't expect to be paid +back. +%% + AMAZING BUT TRUE ... + +If all the salmon caught in Canada in one year were laid end to end +across the Sahara Desert, the smell would be absolutely awful. +%% + AMAZING BUT TRUE ... + +There is so much sand in Northern Africa that if it were spread out it +would completely cover the Sahara Desert. +%% +Ambidextrous, adj.: + Able to pick with equal skill a right-hand pocket or a left. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Ambition is a poor excuse for not having sense enough to be lazy. + -- Charlie McCarthy +%% +America may be unique in being a country which has leapt from barbarism +to decadence without touching civilization. + -- John O'Hara +%% +America was discovered by Amerigo Vespucci and was named after him, +until people got tired of living in a place called "Vespuccia" and +changed its name to "America". + -- Mike Harding, "The Armchair Anarchist's Almanac" +%% +Amnesia used to be my favorite word, but then I forgot it. +%% +An American's a person who isn't afraid to criticize the President but +is always polite to traffic cops. +%% +An effective way to deal with predators is to taste terrible. +%% +An elephant is a mouse with an operating system. +%% +An Englishman never enjoys himself, except for a noble purpose. + -- A. P. Herbert +%% +An excellence-oriented '80s male does not wear a regular watch He wears +a Rolex watch, because it weighs nearly six pounds and is advertised +only in excellence-oriented publications such as Fortune and Rich +Protestant Golfer Magazine. The advertisements are written in +incomplete sentences, which is how advertising copywriters denote +excellence: + +"The Rolex Hyperion. An elegant new standard in quality excellence and +discriminating handcraftsmanship. For the individual who is truly able +to discriminate with regard to excellent quality standards of crafting +things by hand. Fabricated of 100 percent 24-karat gold. No watch +parts or anything. Just a great big chunk on your wrist. Truly a +timeless statement. For the individual who is very secure. Who +doesn't need to be reminded all the time that he is very successful. +Much more successful than the people who laughed at him in high +school. Because of his acne. People who are probably nowhere near as +successful as he is now. Maybe he'll go to his 20th reunion, and +they'll see his Rolex Hyperion. Hahahahahahahahaha." + -- Dave Barry, "In Search of Excellence" +%% +"... an experienced, industrious, ambitious, and often quite often +picturesque liar." + -- Mark Twain +%% +An idea is not responsible for the people who believe in it. +%% + An old Jewish man reads about Einstein's theory of relativity +in the newspaper and asks his scientist grandson to explain it to him. + "Well, zayda, it's sort of like this. Einstein says that if +you're having your teeth drilled without Novocain, a minute seems like +an hour. But if you're sitting with a beautiful woman on your lap, an +hour seems like a minute." + The old man considers this profound bit of thinking for a +moment and says, "And from this he makes a living?" + -- Arthur Naiman, "Every Goy's Guide to Yiddish" +%% +Anarchy may not be the best form of government, but it's better than no +government at all. +%% +... And malt does more than Milton can +To justify God's ways to man + -- A. E. Housman +%% +And on the seventh day, He exited from append mode. +%% +And this is a table ma'am. What in essence it consists of is a +horizontal rectilinear plane surface maintained by four vertical +columnar supports, which we call legs. The tables in this laboratory, +ma'am, are as advanced in design as one will find anywhere in the +world. + -- Michael Frayn, "The Tin Men" +%% + "And what will you do when you grow up to be as big as me?" +asked the father of his little son. + "Diet." +%% +Angels we have heard on High +Tell us to go out and Buy. + -- Tom Leher +%% +Ankh if you love Isis. +%% +Anoint, v.: + To grease a king or other great functionary already +sufficiently slippery. + -- Ambrose Bierce, "The Devil's Dictionary" +%% + Another Glitch in the Call + ------- ------ -- --- ---- + (Sung to the tune of a recent Pink Floyd song.) + +We don't need no indirection +We don't need no flow control +No data typing or declarations +Did you leave the lists alone? + + Hey! Hacker! Leave those lists alone! + +Chorus: + All in all, it's just a pure-LISP function call. + All in all, it's just a pure-LISP function call. +%% +Another good night not to sleep in a eucalyptus tree. +%% + Answers to Last Fortune's Questions: + +1. None. (Moses didn't have an ark). +2. Your mother, by the pigeonhole principle. +3. I don't know. +4. Who cares? +5. 6 (or maybe 4, or else 3). Mr. Alfred J. Duncan of Podunk, + Montana, submitted an interesting solution to Problem 5. +6. There is an interesting solution to this problem on page 1029 of my + book, which you can pick up for $23.95 at finer bookstores and + bathroom supply outlets (or 99 cents at the table in front of + Papyrus Books). +%% +Anthony's Law of Force: + Don't force it; get a larger hammer. +%% +Anthony's Law of the Workshop: + Any tool when dropped, will roll into the least accessible + corner of the workshop. + +Corollary: + On the way to the corner, any dropped tool will first strike + your toes. +%% +Antonym, n.: + The opposite of the word you're trying to think of. +%% +Any clod can have the facts, but having opinions is an art. + -- Charles McCabe +%% +Any excuse will serve a tyrant. + -- Aesop +%% +Any fool can paint a picture, but it takes a wise person to be able to +sell it. +%% +... Any resemblance between the above views and those of my employer, +my terminal, or the view out my window are purely coincidental. Any +resemblance between the above and my own views is non-deterministic. +The question of the existence of views in the absence of anyone to hold +them is left as an exercise for the reader. The question of the +existence of the reader is left as an exercise for the second god +coefficient. (A discussion of non-orthogonal, non-integral polytheism +is beyond the scope of this article.) +%% +Any small object that is accidentally dropped will hide under a +larger object. +%% +Any sufficiently advanced technology is indistinguishable from a rigged +demo. +%% +Any sufficiently advanced technology is indistinguishable from magic. + -- Arthur C. Clarke +%% +Any two philosophers can tell each other all they know in two hours. + -- Oliver Wendell Holmes, Jr. +%% +Any woman is a volume if one knows how to read her. +%% +Anybody can win, unless there happens to be a second entry. +%% +Anybody who doesn't cut his speed at the sight of a police car is +probably parked. +%% +Anybody with money to burn will easily find someone to tend the fire. +%% +Anyone can hold the helm when the sea is calm. + -- Publilius Syrus +%% +Anyone who cannot cope with mathematics is not fully human. At best he +is a tolerable subhuman who has learned to wear shoes, bathe and not +make messes in the house. + -- Lazarus Long, "Time Enough for Love" +%% +Anyone who goes to a psychiatrist ought to have his head examined. + -- Samuel Goldwyn +%% +Anyone who hates Dogs and Kids Can't be All Bad. + -- W. C. Fields +%% +Anyone who is capable of getting themselves made President should on no +account be allowed to do the job. + -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy" +%% +Anything free is worth what you pay for it. +%% +Anything is good and useful if it's made of chocolate. +%% +Anything is good if it's made of chocolate. +%% +Anything labeled "NEW" and/or "IMPROVED" isn't. The label means the +price went up. The label "ALL NEW", "COMPLETELY NEW", or "GREAT NEW" +means the price went way up. +%% +Anything that is good and useful is made of chocolate. +%% +Anything worth doing is worth overdoing +%% +Anytime things appear to be going better, you have overlooked +something. +%% +Aquadextrous, adj.: + Possessing the ability to turn the bathtub faucet on and off +with your toes. + -- Rich Hall, "Sniglets" +%% + AQUARIUS (Jan 20 - Feb 18) +You have an inventive mind and are inclined to be progressive. You lie +a great deal. On the other hand, you are inclined to be careless and +impractical, causing you to make the same mistakes over and over +again. People think you are stupid. +%% +"Arguments with furniture are rarely productive." + -- Kehlog Albran, "The Profit" +%% + ARIES (Mar 21 - Apr 19) +You are the pioneer type and hold most people in contempt. You are +quick tempered, impatient, and scornful of advice. You are not very +nice. +%% +Arithmetic is being able to count up to twenty without taking off your +shoes. + -- Mickey Mouse +%% +Armadillo: + To provide weapons to a Spanish pickle +%% +Arnold's Laws of Documentation: + (1) If it should exist, it doesn't. + (2) If it does exist, it's out of date. + (3) Only documentation for useless programs transcends the + first two laws. +%% +Arthur's Laws of Love: + (1) People to whom you are attracted invariably think you + remind them of someone else. + (2) The love letter you finally got the courage to send will + be delayed in the mail long enough for you to make a fool + of yourself in person. +%% +Artistic ventures highlighted. Rob a museum. +%% +As far as the laws of mathematics refer to reality, they are not +certain; and as far as they are certain, they do not refer to reality. + -- Albert Einstein +%% +As far as we know, our computer has never had an undetected error. + -- Weisert +%% +As I was passing Project MAC, +I met a Quux with seven hacks. +Every hack had seven bugs; +Every bug had seven manifestations; +Every manifestation had seven symptoms. +Symptoms, manifestations, bugs, and hacks, +How many losses at Project MAC? +%% +As long as war is regarded as wicked, it will always have its +fascination. When it is looked upon as vulgar, it will cease to be +popular. + -- Oscar Wilde +%% +As of next week, passwords will be entered in Morse code. +%% +"As part of the conversion, computer specialists rewrote 1,500 +programs -- a process that traditionally requires some debugging." + --- USA Today, referring to the IRS switchover to a new + computer system. +%% +As soon as we started programming, we found to our surprise that it +wasn't as easy to get programs right as we had thought. Debugging had +to be discovered. I can remember the exact instant when I realized +that a large part of my life from then on was going to be spent in +finding mistakes in my own programs. + -- Maurice Wilkes discovers debugging, 1949 +%% +As the poet said, "Only God can make a tree" -- probably because it's +so hard to figure out how to get the bark on. + -- Woody Allen +%% +As the trials of life continue to take their toll, remember that there +is always a future in Computer Maintenance. + -- National Lampoon, "Deteriorada" +%% +As Will Rogers would have said, "There is no such things as a free +variable." +%% +As with most fine things, chocolate has its season. There is a simple +memory aid that you can use to determine whether it is the correct time +to order chocolate dishes: any month whose name contains the letter A, +E, or U is the proper time for chocolate. + -- Sandra Boynton, "Chocolate: The Consuming Passion" +%% +As Zeus said to Narcissus, "Watch yourself." +%% +Ask Not for whom the Bell Tolls, and You will Pay only the +Station-to-Station rate. +%% +Ask not for whom the telephone bell tolls ... if thou art in the +bathtub, it tolls for thee. +%% +Ask your boss to reconsider -- it's so difficult to take "Go to hell" +for an answer. +%% +Ass, n.: + The masculine of "lass". +%% +At a recent meeting in Snowmass, Colorado, a participant from Los +Angeles fainted from hyperoxygenation, and we had to hold his head +under the exhaust of a bus until he revived. +%% +At Group L, Stoffel oversees six first-rate programmers, a managerial +challenge roughly comparable to herding cats. + -- The Washington Post Magazine, June 9, 1985 +%% +... at least I thought I was dancing, 'til somebody stepped on my hand. + -- J. B. White +%% +At the source of every error which is blamed on the computer you will +find at least two human errors, including the error of blaming it on +the computer. +%% +Atlee is a very modest man. And with reason. + -- Winston Churchill +%% +Automobile, n.: + A four-wheeled vehicle that runs up hills and down +pedestrians. +%% +Avoid Quiet and Placid persons unless you are in Need of Sleep. + -- National Lampoon, "Deteriorada" +%% +Avoid reality at all costs. +%% +Bacchus, n.: + A convenient deity invented by the ancients as an excuse for +getting drunk. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Bagdikian's Observation: + Trying to be a first-rate reporter on the average American + newspaper is like trying to play Bach's "St. Matthew Passion" + on a ukelele. +%% +Baker's First Law of Federal Geometry: + A block grant is a solid mass of money surrounded on all sides + by governors. +%% +Ban the bomb. Save the world for conventional warfare. +%% +Bank error in your favor. Collect $200. +%% +Barach's Rule: + An alcoholic is a person who drinks more than his own + physician. +%% +Barometer, n.: + An ingenious instrument which indicates what kind of weather we +are having. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Barth's Distinction: + There are two types of people: those who divide people into two + types, and those who don't. +%% +Baruch's Observation: + If all you have is a hammer, everything looks like a nail. +%% +Basic, n.: + A programming language. Related to certain social diseases in +that those who have it will not admit it in polite company. +%% +Be a better psychiatrist and the world will beat a psychopath to your +door. +%% +BE ALERT!!!! (The world needs more lerts ...) +%% +Be assured that a walk through the ocean of most Souls would scarcely +get your Feet wet. Fall not in Love, therefore: it will stick to your +face. + -- National Lampoon, "Deteriorada" +%% +Be careful of reading health books, you might die of a misprint. + -- Mark Twain +%% +Be different: conform. +%% +Be free and open and breezy! Enjoy! Things won't get any better so +get used to it. +%% +Be wary of strong drink. It can make you shoot at tax collectors and +miss + -- Lazarus Long, "Time Enough for Love" +%% +Behold the warranty ... the bold print giveth and the fine print taketh +away. +%% +Beifeld's Principle: + The probability of a young man meeting a desirable and + receptive young female increases by pyramidal progression when + he is already in the company of: (1) a date, (2) his wife, (3) + a better looking and richer male friend. +%% +Bell Labs Unix -- Reach out and grep someone. +%% +"Benson, you are so free of the ravages of intelligence" + -- Time Bandits +%% +Besides the device, the box should contain: + +* Eight little rectangular snippets of paper that say "WARNING" + +* A plastic packet containing four 5/17 inch pilfer grommets and two + club-ended 6/93 inch boxcar prawns. + +YOU WILL NEED TO SUPPLY: a matrix wrench and 60,000 feet of tram +cable. + +IF ANYTHING IS DAMAGED OR MISSING: You IMMEDIATELY should turn to your +spouse and say: "Margaret, you know why this country can't make a car +that can get all the way through the drive-through at Burger King +without a major transmission overhaul? Because nobody cares, that's +why." + +WARNING: This is assuming your spouse's name is Margaret. + -- Dave Barry, "Read This First!" +%% +better !pout !cry +better watchout +lpr why +santa claus town + +cat /etc/passwd >list +ncheck list +ncheck list +cat list | grep naughty >nogiftlist +cat list | grep nice >giftlist +santa claus town + +who | grep sleeping +who | grep awake +who | egrep 'bad|good' +for (goodness sake) { + be good +} +%% +"Beware of bugs in the above code; I have only proved it correct, not +tried it." + -- Donald Knuth +%% +Beware of low-flying butterflies. +%% +Beware of Programmers who carry screwdrivers. + -- Leonard Brandwein +%% +"Beware of the man who works hard to learn something, learns it, and +finds himself no wiser than before," Bokonon tells us. "He is full of +murderous resentment of people who are ignorant without having come by +their ignorance the hard way." + -- Kurt Vonnegut, "Cat's Cradle" +%% +Beware of the Turing Tar-pit in which everything is possible but +nothing of interest is easy. +%% +Binary, adj.: + Possessing the ability to have friends of both sexes. +%% +Bipolar, adj.: + Refers to someone who has homes in Nome, Alaska, and Buffalo, +New York +%% +Birth, n.: + The first and direst of all disasters. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Bizarreness is the essence of the exotic +%% +Blessed are they who Go Around in Circles, for they Shall be Known +as Wheels. +%% +BLISS is ignorance +%% +Blood is thicker than water, and much tastier. +%% +Board the windows, up your car insurance, and don't leave any booze in +plain sight. It's St. Patrick's day in Chicago again. The legend has +it that St. Patrick drove the snakes out of Ireland. In fact, he was +arrested for drunk driving. The snakes left because people kept +throwing up on them. +%% +Boling's postulate: + If you're feeling good, don't worry. You'll get over it. +%% +Bolub's Fourth Law of Computerdom: + Project teams detest weekly progress reporting because it so + vividly manifests their lack of progress. +%% +Bombeck's Rule of Medicine: + Never go to a doctor whose office plants have died. +%% +Boob's Law: + You always find something in the last place you look. +%% +Bore, n.: + A person who talks when you wish him to listen. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Boren's Laws: + (1) When in charge, ponder. + (2) When in trouble, delegate. + (3) When in doubt, mumble. +%% +Boss, n.: + According to the Oxford English Dictionary, in the Middle Ages +the words "boss" and "botch" were largely synonymous, except that boss, +in addition to meaning "a supervisor of workers" also meant "an +ornamental stud." +%% +Boston, n.: + Ludwig van Beethoven being jeered by 50,000 sports fans for +finishing second in the Irish jig competition. +%% +Boy, n.: + A noise with dirt on it. +%% +Bradley's Bromide: + If computers get too powerful, we can organize them into a + committee -- that will do them in. +%% +Brady's First Law of Problem Solving: + When confronted by a difficult problem, you can solve it more + easily by reducing it to the question, "How would the Lone + Ranger have handled this?" +%% +Brain fried -- Core dumped +%% +Brain, n.: + The apparatus with which we think that we think. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Brain, v. [as in "to brain"]: + To rebuke bluntly, but not pointedly; to dispel a source of +error in an opponent. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Breast Feeding should not be attempted by fathers with hairy chests, +since they can make the baby sneeze and give it wind. + -- Mike Harding, "The Armchair Anarchist's Almanac" +%% +Bride, n.: + A woman with a fine prospect of happiness behind her. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Bringing computers into the home won't change either one, but may +revitalize the corner saloon. +%% +British Israelites: + The British Israelites believe the white Anglo-Saxons of +Britain to be descended from the ten lost tribes of Israel deported by +Sargon of Assyria on the fall of Sumeria in 721 B.C. ... They further +believe that the future can be foretold by the measurements of the +Great Pyramid, which probably means it will be big and yellow and in +the hand of the Arabs. They also believe that if you sleep with your +head under the pillow a fairy will come and take all your teeth. + -- Mike Harding, "The Armchair Anarchist's Almanac" +%% +Broad-mindedness, n.: + The result of flattening high-mindedness out. +%% +Brook's Law: + Adding manpower to a late software project makes it later +%% +Brook's Law: + Adding manpower to a late software project makes it later. +%% +Brooke's Law: + Whenever a system becomes completely defined, some damn fool + discovers something which either abolishes the system or + expands it beyond recognition. +%% +Bubble Memory, n.: + A derogatory term, usually referring to a person's +intelligence. See also "vacuum tube". +%% +Bucy's Law: + Nothing is ever accomplished by a reasonable man. +%% +Bug, n.: + An aspect of a computer program which exists because the +PROGRAMMER was thinking about Jumbo Jacks or stock options when s/he +wrote the program. + +Fortunately, the second-to-last bug has just been fixed. + -- Ray Simard +%% +Bug: + Small living things that small living boys throw on small +living girls. +%% +BULLWINKLE: "You just leave that to my pal. He's the brains of the + outfit." +GENERAL: "What does that make YOU?" +BULLWINKLE: "What else? An executive..." + -- Jay Ward +%% +Bumper sticker: + +"All the parts falling off this car are of the very finest British +manufacture" +%% +Bureaucrat, n.: + A politician who has tenure. +%% +... But as records of courts and justice are admissible, it can +easily be proved that powerful and malevolent magicians once existed +and were a scourge to mankind. The evidence (including confession) +upon which certain women were convicted of witchcraft and executed was +without a flaw; it is still unimpeachable. The judges' decisions based +on it were sound in logic and in law. Nothing in any existing court +was ever more thoroughly proved than the charges of witchcraft and +sorcery for which so many suffered death. If there were no witches, +human testimony and human reason are alike destitute of value. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +... But if we laugh with derision, we will never understand. Human +intellectual capacity has not altered for thousands of years so far as +we can tell. If intelligent people invested intense energy in issues +that now seem foolish to us, then the failure lies in our understanding +of their world, not in their distorted perceptions. Even the standard +example of ancient nonsense -- the debate about angels on pinheads -- +makes sense once you realize that theologians were not discussing +whether five or eighteen would fit, but whether a pin could house a +finite or an infinite number. + -- S. J. Gould, "Wide Hats and Narrow Minds" +%% +But in our enthusiasm, we could not resist a radical overhaul of the +system, in which all of its major weaknesses have been exposed, +analyzed, and replaced with new weaknesses. + -- Bruce Leverett, "Register Allocation in Optimizing + Compilers" +%% +But scientists, who ought to know +Assure us that it must be so. +Oh, let us never, never doubt +What nobody is sure about. + -- Hilaire Belloc +%% +But soft you, the fair Ophelia: +Ope not thy ponderous and marble jaws, +But get thee to a nunnery -- go! + -- Mark "The Bard" Twain +%% +But the greatest Electrical Pioneer of them all was Thomas Edison, who +was a brilliant inventor despite the fact that he had little formal +education and lived in New Jersey. Edison's first major invention in +1877, was the phonograph, which could soon be found in thousands of +American homes, where it basically sat until 1923, when the record was +invented. But Edison's greatest achievement came in 1879, when he +invented the electric company. Edison's design was a brilliant +adaptation of the simple electrical circuit: the electric company sends +electricity through a wire to a customer, then immediately gets the +electricity back through another wire, then (this is the brilliant +part) sends it right back to the customer again. + +This means that an electric company can sell a customer the same batch +of electricity thousands of times a day and never get caught, since +very few customers take the time to examine their electricity closely. +In fact the last year any new electricity was generated in the United +States was 1937; the electric companies have been merely re-selling it +ever since, which is why they have so much free time to apply for rate +increases. + -- Dave Barry, "What is Electricity?" +%% +"But this has taken us far afield from interface, which is not a bad +place to be, since I particularly want to move ahead to the kludge. +Why do people have so much trouble understanding the kludge? What is a +kludge, after all, but not enough Ks, not enough ROMs, not enough RAMs, +poor quality interface and too few bytes to go around? Have I +explained yet about the bytes?" +%% +"But what we need to know is, do people want nasally-insertable +computers?" +%% +Buzz off, Banana Nose; Relieve mine eyes +Of hateful soreness, purge mine ears of corn; +Less dear than army ants in apple pies +Art thou, old prune-face, with thy chestnuts worn, +Dropt from thy peeling lips like lousy fruit; +Like honeybees upon the perfum'd rose +They suck, and like the double-breasted suit +Are out of date; therefore, Banana Nose, +Go fly a kite, thy welcome's overstayed; +And stem the produce of thy waspish wits: +Thy logick, like thy locks, is disarrayed; +Thy cheer, like thy complexion, is the pits. +Be off, I say; go bug somebody new, +Scram, beat it, get thee hence, and nuts to you. +%% +By doing just a little every day, you can gradually let the task +completely overwhelm you. +%% +"By necessity, by proclivity, and by delight, we all quote. In fact, +it is as difficult to appropriate the thoughts of others as it is to +invent. (R. Emerson)" + -- Quoted from a fortune cookie program + (whose author claims, "Actually, stealing IS easier.") + [to which I reply, "You think it's easy for me to + misconstrue all these misquotations?!?"] +%% +Bypasses are devices that allow some people to dash from point A to +point B very fast while other people dash from point B to point A very +fast. People living at point C, being a point directly in between, are +often given to wonder what's so great about point A that so many people +from point B are so keen to get there and what's so great about point B +that so many people from point A are so keen to get _____there. They often +wish that people would just once and for all work out where the hell +they wanted to be. + -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy" +%% +C, n.: + A programming language that is sort of like Pascal except more +like assembly except that it isn't very much like either one, or +anything else. It is either the best language available to the art +today, or it isn't. + -- Ray Simard +%% +Cabbage, n.: + A familiar kitchen-garden vegetable about as large and wise as +a man's head. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Cahn's Axiom: + When all else fails, read the instructions. +%% +California is a fine place to live -- if you happen to be an orange. + -- Fred Allen +%% +California, n.: + From Latin "calor", meaning "heat" (as in English "calorie" or +Spanish "caliente"); and "fornia'" for "sexual intercourse" or +"fornication." Hence: Tierra de California, "the land of hot sex." + -- Ed Moran +%% +Call on God, but row away from the rocks. + -- Indian proverb +%% +"Calling J-Man Kink. Calling J-Man Kink. Hash missle sighted, target +Los Angeles. Disregard personal feelings about city and intercept." +%% +"Calvin Coolidge looks as if he had been weaned on a pickle." + -- Alice Roosevelt Longworth +%% +"Calvin Coolidge was the greatest man who ever came out of Plymouth +Corner, Vermont." + -- Clarence Darrow +%% +Canada Bill Jone's Motto: + It's morally wrong to allow suckers to keep their money. + +Supplement: + A .44 magnum beats four aces. +%% +Canada Post doesn't really charge 32 cents for a stamp. It's 2 cents +for postage and 30 cents for storage. + -- Gerald Regan, Cabinet Minister, 12/31/83 Financial + Post +%% +Cancel me not -- for what then shall remain? +Abscissas, some mantissas, modules, modes, +A root or two, a torus and a node: +The inverse of my verse, a null domain. + -- Stanislaw Lem, "Cyberiad" +%% + CANCER (June 21 - July 22) +You are sympathetic and understanding to other people's problems. They +think you are a sucker. You are always putting things off. That's why +you'll never make anything of yourself. Most welfare recipients are +Cancer people. +%% + CAPRICORN (Dec 23 - Jan 19) +You are conservative and afraid of taking risks. You don't do much of +anything and are lazy. There has never been a Capricorn of any +importance. Capricorns should avoid standing still for too long as +they take root and become trees. +%% +Captain Penny's Law: + You can fool all of the people some of the time, and some of + the people all of the time, but you Can't Fool Mom. +%% +Carelessly planned projects take three times longer to complete than +expected. Carefully planned projects take four times longer to +complete than expected, mostly because the planners expect their +planning to reduce the time it takes. +%% +Carperpetuation (kar' pur pet u a shun), n.: + The act, when vacuuming, of running over a string at least a +dozen times, reaching over and picking it up, examining it, then +putting it back down to give the vacuum one more chance. + -- Rich Hall, "Sniglets" +%% +Cauliflower is nothing but Cabbage with a College Education. + -- Mark Twain +%% +Caution: breathing may be hazardous to your health. +%% +CChheecckk yyoouurr dduupplleexx sswwiittcchh.. +%% +Celebrate Hannibal Day this year. Take an elephant to lunch. +%% +Census Taker to Housewife: Did you ever have the measles, and, if so, +how many? +%% +Cerebus: I'd love to lick apricot brandy out of your navel. +Jaka: Look, Cerebus-- Jaka has to tell you ... something +Cerebus: If Cerebus had a navel, would you lick apricot brandy + out of it? +Jaka: Ugh! +Cerebus: You don't like apricot brandy? + -- Cerebus #6, "The Secret" +%% +Certain old men prefer to rise at dawn, taking a cold bath and a long +walk with an empty stomach and otherwise mortifying the flesh. They +then point with pride to these practices as the cause of their sturdy +health and ripe years; the truth being that they are hearty and old, +not because of their habits, but in spite of them. The reason we find +only robust persons doing this thing is that it has killed all the +others who have tried it. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Certainly there are things in life that money can't buy, but it's very funny-- + Did you ever try buying then without money? + -- Ogden Nash +%% +Character Density: the number of very weird people in the office. +%% +Chemicals, n.: + Noxious substances from which modern foods are made. +%% +Chicago, n.: + Where the dead still vote ... early and often! +%% +Chicken Little was right. +%% +Chicken Soup, n.: + An ancient miracle drug containing equal parts of aureomycin, +cocaine, interferon, and TLC. The only ailment chicken soup can't cure +is neurotic dependence on one's mother. + -- Arthur Naiman, "Every Goy's Guide to Yiddish" +%% +Children are natural mimic who act like their parents despite every +effort to teach them good manners. +%% +Children aren't happy without something to ignore, +And that's what parents were created for. + -- Ogden Nash +%% +Children seldom misquote you. In fact, they usually repeat word for +word what you shouldn't have said. +%% +Chism's Law of Completion: + The amount of time required to complete a government project is + precisely equal to the length of time already spent on it. +%% +Chisolm's First Corollary to Murphy's Second Law: + When things just can't possibly get any worse, they will. +%% +Christ: + A man who was born at least 5,000 years ahead of his time. +%% +Churchill's Commentary on Man: + Man will occasionally stumble over the truth, but most of the + time he will pick himself up and continue on. +%% +Cigarette, n.: + A fire at one end, a fool at the other, and a bit of tobacco in +between. +%% +Cinemuck, n.: + The combination of popcorn, soda, and melted chocolate which +covers the floors of movie theaters. + -- Rich Hall, "Sniglets" +%% +Cleanliness is next to impossible. +%% +Cleveland still lives. God ____must be dead. +%% +"Cleveland? Yes, I spent a week there one day." +%% +Cloning is the sincerest form of flattery. +%% +Clothes make the man. Naked people have little or no influence on +society. + -- Mark Twain +%% +Cocaine -- the thinking man's Dristan. +%% +Cogito cogito ergo cogito sum -- +"I think that I think, therefore I think that I am." + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Cold, adj.: + When the local flashers are handing out written descriptions. +%% +Cold, adj.: + When the politicians walk around with their hands in their own +pockets. +%% +Collaboration, n.: + A literary partnership based on the false assumption that the +other fellow can spell. +%% +College football is a game which would be much more interesting if the +faculty played instead of the students, and even more interesting if +the trustees played. There would be a great increase in broken arms, +legs, and necks, and simultaneously an appreciable diminution in the +loss to humanity. + -- H. L. Mencken +%% +Colvard's Logical Premises: + All probabilities are 50%. Either a thing will happen or + it won't. +Colvard's Unconscionable Commentary: + This is especially true when dealing with someone you're + attracted to. +Grelb's Commentary + Likelihoods, however, are 90% against you. +%% +Come, every frustum longs to be a cone, +And every vector dreams of matrices. +Hark to the gentle gradient of the breeze: +It whispers of a more ergodic zone. + -- Stanislaw Lem, "Cyberiad" +%% +Come, let us hasten to a higher plane, +Where dyads tread the fairy fields of Venn, +Their indices bedecked from one to _n, +Commingled in an endless Markov chain! + -- Stanislaw Lem, "Cyberiad" +%% +Command, n.: + Statement presented by a human and accepted by a computer in +such a manner as to make the human feel as if he is in control. +%% + COMMENT + +Oh, life is a glorious cycle of song, +A medley of extemporanea; +And love is thing that can never go wrong; +And I am Marie of Roumania. + -- Dorothy Parker +%% +Commitment, n.: + Commitment can be illustrated by a breakfast of ham and eggs. +The chicken was involved, the pig was committed. +%% +Common sense is the collection of prejudices acquired by age eighteen. + -- Albert Einstein +%% +Computer programmers do it byte by byte +%% +Computer Science is merely the post-Turing decline in formal systems +theory. +%% +Computers are not intelligent. They only think they are. +%% +Conceit causes more conversation than wit. + -- LaRouchefoucauld +%% +Concept, n.: + Any "idea" for which an outside consultant billed you more than +$25,000. +%% +Condense soup, not books! +%% +Confession is good for the soul only in the sense that a tweed coat is +good for dandruff. + -- Peter de Vries +%% +Confidence is the feeling you have before you understand the situation. +%% +Congratulations! You have purchased an extremely fine device that +would give you thousands of years of trouble-free service, except that +you undoubtably will destroy it via some typical bonehead consumer +maneuver. Which is why we ask you to PLEASE FOR GOD'S SAKE READ THIS +OWNER'S MANUAL CAREFULLY BEFORE YOU UNPACK THE DEVICE. YOU ALREADY +UNPACKED IT, DIDN'T YOU? YOU UNPACKED IT AND PLUGGED IT IN AND TURNED +IT ON AND FIDDLED WITH THE KNOBS, AND NOW YOUR CHILD, THE SAME CHILD +WHO ONCE SHOVED A POLISH SAUSAGE INTO YOUR VIDEOCASSETTE RECORDED AND +SET IT ON "FAST FORWARD", THIS CHILD ALSO IS FIDDLING WITH HE KNOBS, +RIGHT? AND YOU'RE JUST NOW STARTING TO READ THE INSTRUCTIONS, +RIGHT??? WE MIGHT AS WELL JUST BREAK THESE DEVICES RIGHT AT THE +FACTORY BEFORE WE SHIP THEM OUT, YOU KNOW THAT? + -- Dave Barry, "Read This First!" +%% +Conscience is the inner voice that warns us somebody is looking + -- H. L. Mencken +%% +Conscience is what hurts when everything else feels so good. +%% +Consultants are mystical people who ask a company for a number and then +give it back to them. +%% +"Contrariwise," continued Tweedledee, "if it was so, it might be, and +if it were so, it would be; but as it isn't, it ain't. That's logic!" + -- Lewis Carroll, "Through the Looking Glass" +%% +Conversation, n.: + A vocal competition in which the one who is catching his breath +is called the listener. +%% +Conway's Law: + In any organization there will always be one person who knows + what is going on. + + This person must be fired. +%% +Coronation, n.: + The ceremony of investing a sovereign with the outward and +visible signs of his divine right to be blown skyhigh with a dynamite +bomb. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Corrupt, adj.: + In politics, holding an office of trust or profit. +%% +Corruption is not the #1 priority of the Police Commissioner. His job +is to enforce the law and fight crime. + -- P.B.A. President E. J. Kiernan +%% +Coward, n.: + One who in a perilous emergency thinks with his legs. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Crash programs fail because they are based on the theory that, with +nine women pregnant, you can get a baby a month. + -- Wernher von Braun +%% +Crime does not pay ... as well as politics. + -- A. E. Newman +%% +Critic, n.: + A person who boasts himself hard to please because nobody tries +to please him. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Cynic, n.: + A blackguard whose faulty vision sees things as they are, not +as they ought to be. Hence the custom among the Scythians of plucking +out a cynic's eyes to improve his vision. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Cynic, n.: + One who looks through rose-colored glasses with a jaundiced +eye. +%% +Darth Vader sleeps with a Teddywookie. +%% +Dawn, n.: + The time when men of reason go to bed. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Day of inquiry. You will be subpoenaed. +%% +Dealing with failure is easy: work hard to improve. Success is also +easy to handle: you've solved the wrong problem. Work hard to +improve. +%% +Dear Lord: + I just want *___one* one-armed manager so I never have to hear "On + the other hand", again. +%% +Dear Miss Manners: + My home economics teacher says that one must never place one's +elbows on the table. However, I have read that one elbow, in between +courses, is all right. Which is correct? + +Gentle Reader: + For the purpose of answering examinations in your home +economics class, your teacher is correct. Catching on to this +principle of education may be of even greater importance to you now +than learning correct current table manners, vital as Miss Manners +believes that is. +%% +Dear Miss Manners: + Please list some tactful ways of removing a man's saliva from + your face. + +Gentle Reader: + Please list some decent ways of acquiring a man's saliva on + your face ... +%% +Death is God's way of telling you not to be such a wise guy. +%% +Death is life's way of telling you you've been fired. + -- R. Geis +%% +Death is Nature's way of recycling human beings. +%% +Death is nature's way of telling you to slow down +%% +Decisionmaker, n.: + The person in your office who was unable to form a task force +before the music stopped. +%% +Decisions of the judges will be final unless shouted down by a really +overwhelming majority of the crowd present. Abusive and obscene +language may not be used by contestants when addressing members of the +judging panel, or, conversely, by members of the judging panel when +addressing contestants (unless struck by a boomerang). + -- Mudgeeraba Creek Emu-Riding and Boomerang-Throwing + Assoc. +%% + Deck Us All With Boston Charlie + +Deck us all with Boston Charlie, +Walla Walla, Wash., an' Kalamazoo! +Nora's freezin' on the trolley, +Swaller dollar cauliflower, alleygaroo! + +Don't we know archaic barrel, +Lullaby Lilla Boy, Louisville Lou. +Trolley Molly don't love Harold, +Boola boola Pensacoola hullabaloo! + -- Walt Kelly +%% + "Deep" is a word like "theory" or "semantic" -- it implies all +sorts of marvelous things. It's one thing to be able to say "I've got +a theory", quite another to say "I've got a semantic theory", but, ah, +those who can claim "I've got a deep semantic theory", they are truly +blessed. + -- Randy Davis +%% + DELETE A FORTUNE! + +Don't some of these fortunes just drive you nuts?! Wouldn't you like +to see some of them deleted from the system? You can! Just mail to +"fortune" with the fortune you hate most, and we MIGHT make sure it +gets expunged. +%% +Deliberation, n.: + The act of examining one's bread to determine which side it is +buttered on. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +"Deliver yesterday, code today, think tomorrow." +%% +Democracy is a form of government in which it is permitted to wonder +aloud what the country could do under first-class management. + -- Senator Soaper +%% +Democracy is a form of government that substitutes election by the +incompetent many for appointment by the corrupt few. + -- G. B. Shaw +%% +Democracy is also a form of worship. It is the worship of Jackals by +Jackasses. + -- H. L. Mencken +%% +Democracy is the recurrent suspicion that more than half of the people +are right more than half of the time. + -- E. B. White +%% +Dentist, n.: + A Prestidigitator who, putting metal in one's mouth, pulls +coins out of one's pockets. + -- Ambrose Bierce, "The Devil's Dictionary" +%% + DETERIORATA + +Go placidly amid the noise and waste, +And remember what comfort there may be in owning a piece thereof. +Avoid quiet and passive persons, unless you are in need of sleep. +Rotate your tires. +Speak glowingly of those greater than yourself, +And heed well their advice -- even though they be turkeys. +Know what to kiss -- and when. +Remember that two wrongs never make a right, +But that three do. +Wherever possible, put people on "HOLD". +Be comforted, that in the face of all aridity and disillusionment, +And despite the changing fortunes of time, +There is always a big future in computer maintenance. + + You are a fluke of the universe ... + You have no right to be here. + Whether you can hear it or not, the universe + Is laughing behind your back. + -- National Lampoon +%% +DeVries's Dilemma: + If you hit two keys on the typewriter, the one you don't want + hits the paper. +%% +Did you know ... + +That no-one ever reads these things? +%% +Did you know that clones never use mirrors? + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Die, v.: + To stop sinning suddenly. + -- Elbert Hubbard +%% +"Die? I should say not, dear fellow. No Barrymore would allow such a +conventional thing to happen to him." + -- John Barrymore's dying words +%% +Different all twisty a of in maze are you, passages little. +%% +Dimensions will always be expressed in the least usable term. +Velocity, for example, will be expressed in furlongs per fortnight. +%% +Diplomacy is the art of saying "nice doggy" until you can find a rock. +%% +Disc space -- the final frontier! +%% +Disco is to music what Etch-A-Sketch is to art. +%% +Distress, n.: + A disease incurred by exposure to the prosperity of a friend. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Do infants have as much fun in infancy as adults do in adultery? +%% +Do molecular biologists wear designer genes? +%% +Do not believe in miracles -- rely on them. +%% +Do not drink coffee in early A.M. It will keep you awake until noon. +%% +Do not meddle in the affairs of troff, for it is subtle and quick to +anger. +%% +Do not read this fortune under penalty of law. +Violators will be prosecuted. +(Penal Code sec. 2.3.2 (II.a.)) +%% +Do not sleep in a eucalyptus tree tonight. +%% +Do not try to solve all life's problems at once -- learn to dread each +day as it comes. + -- Donald Kaul +%% +Do something unusual today. Pay a bill. +%% +Do what comes naturally now. Seethe and fume and throw a tantrum. +%% +Do you realize how many holes there could be if people would just take +the time to take the dirt out of them? +%% +"Do you think what we're doing is wrong?" +"Of course it's wrong! It's illegal!" +"I've never done anything illegal before." +"I thought you said you were an accountant!" +%% +Documentation is like sex: when it is good, it is very, very good; and +when it is bad, it is better than nothing. + -- Dick Brandon +%% +Documentation is the castor oil of programming. Managers know it must +be good because the programmers hate it so much. +%% +Don't abandon hope: your Tom Mix decoder ring arrives tomorrow. +%% +Don't be humble, you're not that great. + -- Golda Meir +%% +Don't believe everything you hear or anything you say. +%% +Don't cook tonight -- starve a rat today! +%% +Don't feed the bats tonight. +%% +Don't get suckered in by the comments -- they can be terribly +misleading. Debug only code. + -- Dave Storer +%% +Don't go around saying the world owes you a living. The world owes you +nothing. It was here first. + -- Mark Twain +%% +Don't go surfing in South Dakota for a while. +%% +Don't hate yourself in the morning -- sleep till noon. +%% +Don't kiss an elephant on the lips today. +%% +Don't knock President Fillmore. He kept us out of Vietnam. +%% +Don't let people drive you crazy when you know it's in walking +distance. +%% +Don't look back, the lemmings are gaining on you. +%% +Don't put off for tomorrow what you can do today, because if you enjoy +it today you can do it again tomorrow. +%% +"Don't say yes until I finish talking." + -- Darryl F. Zanuck +%% +Don't take life too seriously -- you'll never get out if it alive. +%% +Don't tell any big lies today. Small ones can be just as effective. +%% +"Don't tell me I'm burning the candle at both ends -- tell me where to +get more wax!!" +%% +Don't worry about the world coming to an end today. It's already +tomorrow in Australia. + -- Charles Schultz +%% +Don't worry over what other people are thinking about you. They're too +busy worrying over what you are thinking about them. +%% +Don't you feel more like you do now than you did when you came in? +%% +Don: I didn't know you had a cousin Penelope, Bill! Was she + pretty? +W. C.: Well, her face was so wrinkled it looked like seven miles of + bad road. She had so many gold teeth, Don, she use to have to + sleep with her head in a safe. She died in Bolivia. +Don: Oh Bill, it must be hard to lose a relative. +W. C.: It's almost impossible. + -- W. C. Fields, from "The Further Adventures of Larson + E. Whipsnade and other Tarradiddles" +%% +Down with categorical imperative! +%% +"Drawing on my fine command of language, I said nothing." +%% +Drew's Law of Highway Biology: + The first bug to hit a clean windshield lands directly in front + of your eyes. +%% +Drive defensively. Buy a tank. +%% +Drugs may be the road to nowhere, but at least they're the scenic +route! +%% +Ducharm's Axiom: + If you view your problem closely enough you will recognize + yourself as part of the problem. +%% +Ducharme's Precept: + Opportunity always knocks at the least opportune moment. +%% +Duct tape is like the force. It has a light side, and a dark side, and +it holds the universe together ... + -- Carl Zwanzig +%% +Due to a shortage of devoted followers, the production of great leaders +has been discontinued. +%% +Due to circumstances beyond your control, you are master of your fate +and captain of your soul. +%% + During a grouse hunt in North Carolina two intrepid sportsmen +were blasting away at a clump of trees near a stone wall. Suddenly a +red-faced country squire popped his head over the wall and shouted, +"Hey, you almost hit my wife." + "Did I?" cried the hunter, aghast. "Terribly sorry. Have a +shot at mine, over there." +%% +During the next two hours, the VAX will be going up and down several +times, often with lin~po_~{po ~poz~ppo\~{ o n~po_~{o[po ~y oodsou>#w4k**n~po_~{ol;lkld;f;g;dd;po\~{o +%% +Dying is a very dull, dreary affair. And my advice to you is to +have nothing whatever to do with it. + -- W. Somerset Maughm +%% +E Pluribus Unix +%% +Earn cash in your spare time -- blackmail your friends +%% +Earn cash in your spare time -- blackmail your friends. +%% +/Earth is 98% full ... please delete anyone you can. +%% +/earth is 98% full ... please delete anyone you can. +%% +"Earth is a great, big funhouse without the fun." + -- Jeff Berner +%% +Easiest Color to Solve on a Rubik's Cube: + Black. Simply remove all the little colored stickers on the +cube, and each of side of the cube will now be the original color of +the plastic underneath -- black. According to the instructions, this +means the puzzle is solved. + -- Steve Rubenstein +%% +Economics is extremely useful as a form of employment for economists. + -- John Kenneth Galbraith +%% +Economics, n.: + Economics is the study of the value and meaning of J. K. +Galbraith ... + -- Mike Harding, "The Armchair Anarchist's Almanac" +%% +Eggheads unite! You have nothing to lose but your yolks. + -- Adlai Stevenson +%% +Eggnog is a traditional holiday drink invented by the English. Many +people wonder where the word "eggnog" comes from. The first syllable +comes from the English word "egg", meaning "egg". I don't know where +the "nog" comes from. + +To make eggnog, you'll need rum, whiskey, wine gin and, if they are in +season, eggs... +%% +Egotism is the anesthetic given by a kindly nature to relieve the pain +of being a damned fool. + -- Bellamy Brooks +%% +Egotist, n.: + A person of low taste, more interested in himself than me. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Ehrman's Commentary: + 1. Things will get worse before they get better. + 2. Who said things would get better? +%% +Eighty percent of air pollution comes from plants and trees. + -- Ronald Reagan, famous movie star +%% +Eisenhower was very nice, +Nixon was his only vice. + -- C. Degen +%% +Eleanor Rigby + Sits at the keyboard + And waits for a line on the screen +Lives in a dream +Waits for a signal + Finding some code + That will make the machine do some more. +What is it for? + +All the lonely users, where do they all come from? +All the lonely users, why does it take so long? +%% +Electrical Engineers do it with less resistance. +%% +Electrocution, n.: + Burning at the stake with all the modern improvements. +%% +Elevators smell different to midgets +%% +Emersons' Law of Contrariness: + Our chief want in life is somebody who shall make us do what we + can. Having found them, we shall then hate them for it. +%% +Encyclopedia Salesmen: + Invite them all in. Nip out the back door. Phone the police +and tell them your house is being burgled. + -- Mike Harding, "The Armchair Anarchist's Almanac" +%% +Endless Loop: n., see Loop, Endless. +Loop, Endless: n., see Endless Loop. + -- Random Shack Data Processing Dictionary +%% +Entropy isn't what it used to be. +%% +Enzymes are things invented by biologists that explain things which +otherwise require harder thinking. + -- Jerome Lettvin +%% +Equal bytes for women. +%% +Es brilig war. Die schlichte Toven + Wirrten und wimmelten in Waben; +Und aller-m"umsige Burggoven + Dir mohmen R"ath ausgraben. + -- Lewis Carrol, "Through the Looking Glass" +%% +Eternal nothingness is fine if you happen to be dressed for it. + -- Woody Allen +%% +Etymology, n.: + Some early etymological scholars come up with derivations that +were hard for the public to believe. The term "etymology" was formed +from the Latin "etus" ("eaten"), the root "mal" ("bad"), and "logy" +("study of"). It meant "the study of things that are hard to swallow." + -- Mike Kellen +%% +Even if you do learn to speak correct English, whom are you going to +speak it to? + -- Clarence Darrow +%% +"Even the best of friends cannot attend each other's funeral." + -- Kehlog Albran, "The Profit" +%% +Even though they raised the rate for first class mail in the United +States we really shouldn't complain -- it's still only 2 cents a day. +%% +Ever notice that even the busiest people are never too busy to tell you +just how busy they are. +%% +Every 4 seconds a woman has a baby. Our problem is to find this woman +and stop her. +%% +Every absurdity has a champion who will defend it. +%% +Every creature has within him the wild, uncontrollable urge to punt. +%% +Every gun that is made, every warship launched, every rocket fired +signifies in the final sense, a theft from those who hunger and are not +fed, those who are cold and are not clothed. This world in arms is not +spending money alone. It is spending the sweat of its laborers, the +genius of its scientists, the hopes of its children. This is not a way +of life at all in any true sense. Under the clouds of war, it is +humanity hanging on a cross of iron. + -- Dwight Eisenhower, April 16, 1953 +%% +Every Horse has an Infinite Number of Legs (proof by intimidation): + +Horses have an even number of legs. Behind they have two legs, and in +front they have fore-legs. This makes six legs, which is certainly an +odd number of legs for a horse. But the only number that is both even +and odd is infinity. Therefore, horses have an infinite number of +legs. Now to show this for the general case, suppose that somewhere, +there is a horse that has a finite number of legs. But that is a horse +of another color, and by the [above] lemma ["All horses are the same +color"], that does not exist. +%% +Every little picofarad has a nanohenry all its own. + -- Don Vonada +%% +Every man is as God made him, ay, and often worse. + -- Miguel de Cervantes +%% +Every program has at least one bug and can be shortened by at least one +instruction -- from which, by induction, one can deduce that every +program can be reduced to one instruction which doesn't work. +%% +Every program has two purposes -- +written and another for which it wasn't. +%% +Every program is a part of some other program, and rarely fits. +%% +Every solution breeds new problems. +%% +Every successful person has had failures but repeated failure is no +guarantee of eventual success. +%% +"Every time I think I know where it's at, they move it." +%% +Every word is like an unnecessary stain on silence and nothingness. + -- Beckett +%% +Everybody is somebody else's weirdo. + -- Dykstra +%% +Everybody wants to go to heaven, but nobody wants to die. +%% +Everyone can be taught to sculpt: Michelangelo would have had to be +taught how ___not to. So it is with the great programmers. +%% +Everyone knows that dragons don't exist. But while this simplistic +formulation may satisfy the layman, it does not suffice for the +scientific mind. The School of Higher Neantical Nillity is in fact +wholly unconcerned with what ____does exist. Indeed, the banality of +existence has been so amply demonstrated, there is no need for us to +discuss it any further here. The brilliant Cerebron, attacking the +problem analytically, discovered three distinct kinds of dragon: the +mythical, the chimerical, and the purely hypothetical. They were all, +one might say, nonexistent, but each nonexisted in an entirely +different way ... + -- Stanislaw Lem, "Cyberiad" +%% +Everyone talks about apathy, but no one ____does anything about it. +%% +Everything is controlled by a small evil group to which, unfortunately, +no one we know belongs. +%% +Everything you know is wrong! +%% +Everything you've learned in school as "obvious" becomes less and less +obvious as you begin to study the universe. For example, there are no +solids in the universe. There's not even a suggestion of a solid. +There are no absolute continuums. There are no surfaces. There are no +straight lines. + -- R. Buckminster Fuller +%% +Everyting should be built top-down, except the first time. +%% + Excellence is THE trend of the '80s. Walk into any shopping +mall bookstore, go to the rack where they keep the best-sellers such as +"Garfield Gets Spayed", and you'll see a half-dozen books telling you +how to be excellent: "In Search of Excellence", "Finding Excellence", +"Grasping Hold of Excellence", "Where to Hide Your Excellence at Night +So the Cleaning Personnel Don't Steal It", etc. + -- Dave Barry, "In Search of Excellence" +%% +Excellent day for drinking heavily. Spike office water cooler. +%% +Excellent day to have a rotten day. +%% +Excellent time to become a missing person. +%% +Excess on occasion is exhilarating. It prevents moderation from +acquiring the deadening effect of a habit. + -- W. Somerset Maugham +%% +Excessive login or logout messages are a sure sign of senility. +%% +Expect the worst, it's the least you can do. +%% +Expense Accounts, n.: + Corporate food stamps. +%% +Experience is something you don't get until just after you need it. + -- Olivier +%% +Experience is that marvelous thing that enables you recognize a +mistake when you make it again. + -- F. P. Jones +%% +Experience is the worst teacher. It always gives the test first and +the instruction afterward. +%% +Experience is what causes a person to make new mistakes instead of old +ones. +%% +Experience is what you get when you were expecting something else. +%% +Experience varies directly with equipment ruined. +%% +F u cn rd ths u cnt spl wrth a dm! +%% +f u cn rd ths, itn tyg h myxbl cd. +%% +f u cn rd ths, u cn gt a gd jb n cmptr prgrmmng. +%% +Fairy Tale, n.: + A horror story to prepare children for the newspapers. +%% +Faith is the quality that enables you to eat blackberry jam on a picnic +without looking to see whether the seeds move. +%% +Faith, n: + That quality which enables us to believe what we know to be +untrue. +%% +Fakir, n: + A psychologist whose charismatic data have inspired almost +religious devotion in his followers, even though the sources seem to +have shinnied up a rope and vanished. +%% +Familiarity breeds attempt +%% +Families, when a child is born +Want it to be intelligent. +I, through intelligence, +Having wrecked my whole life, +Only hope the baby will prove +Ignorant and stupid. +Then he will crown a tranquil life +By becoming a Cabinet Minister + -- Su Tung-p'o +%% +Famous last words: +%% +Famous last words: + 1) "Don't worry, I can handle it." + 2) "You and what army?" + 3) "If you were as smart as you think you are, you wouldn't be + a cop." +%% +Famous last words: + 1. Don't unplug it, it will just take a moment to fix. + 2. Let's take the shortcut, he can't see us from there. + 3. What happens if you touch these two wires tog-- + 4. We won't need reservations. + 5. It's always sunny there this time of the year. + 6. Don't worry, it's not loaded. + 7. They'd never (be stupid enough to) make him a manager. +%% +Far out in the uncharted backwaters of the unfashionable end of the +Western Spiral arm of the Galaxy lies a small unregarded yellow sun. +Orbiting this at a distance of roughly ninety-eight million miles is an +utterly insignificant little blue-green planet whose ape-descended life +forms are so amazingly primitive that they still think digital watches +are a pretty neat idea ... + -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy" +%% +Fashion is a form of ugliness so intolerable that we have to alter it +every six months. + -- Oscar Wilde +%% +Fats Loves Madelyn +%% +Feel disillusioned? I've got some great new illusions ... +%% +Fertility is hereditary. If your parents didn't have any children, +neither will you. +%% + Festivity Level 1: Your guests are chatting amiably with each +other, admiring your Christmas-tree ornaments, singing carols around +the upright piano, sipping at their drinks and nibbling hors +d'oeuvres. + Festivity Level 2: Your guests are talking loudly -- sometimes +to each other, and sometimes to nobody at all, rearranging your +Christmas-tree ornaments, singing "I Gotta Be Me" around the upright +piano, gulping their drinks and wolfing down hors d'oeuvres. + Festivity Level 3: Your guests are arguing violently with +inanimate objects, singing "I can't get no satisfaction," gulping down +other peoples' drinks, wolfing down Christmas tree ornaments and +placing hors d'oeuvres in the upright piano to see what happens when +the little hammers strike. + Festivity Level 4: Your guests, hors d'oeuvres smeared all over +their naked bodies are performing a ritual dance around the burning +Christmas tree. The piano is missing. + + You want to keep your party somewhere around level 3, unless +you rent your home and own Firearms, in which case you can go to level +4. The best way to get to level 3 is egg-nog. +%% +Fifth Law of Applied Terror: + If you are given an open-book exam, you will forget your book. +Corollary: + If you are given a take-home exam, you will forget where you + live. +%% +Fifth Law of Procrastination: + Procrastination avoids boredom; one never has the feeling that + there is nothing important to do. +%% + FIGHTING WORDS + +Say my love is easy had, + Say I'm bitten raw with pride, +Say I am too often sad -- + Still behold me at your side. + +Say I'm neither brave nor young, + Say I woo and coddle care, +Say the devil touched my tongue -- + Still you have my heart to wear. + +But say my verses do not scan, + And I get me another man! + -- Dorothy Parker +%% +Finagle's Creed: + Science is true. Don't be misled by facts. +%% +Finagle's First Law: + If an experiment works, something has gone wrong. +%% +Finagle's fourth Law: + Once a job is fouled up, anything done to improve it only + makes it worse. +%% +Finagle's Second Law: + No matter what the anticipated result, there will always be + someone eager to (a) misinterpret it, (b) fake it, or (c) + believe it happened according to his own pet theory. +%% +Finagle's Third Law: + In any collection of data, the figure most obviously correct, + beyond all need of checking, is the mistake + +Corollaries: + 1. Nobody whom you ask for help will see it. + 2. The first person who stops by, whose advice you really + don't want to hear, will see it immediately. +%% +Fine day to throw a party. Throw him as far as you can. +%% +Fine day to work off excess energy. Steal something heavy. +%% +First Law of Bicycling: + No matter which way you ride, it's uphill and against the + wind. +%% +First Law of Procrastination: + Procrastination shortens the job and places the responsibility + for its termination on someone else (i.e., the authority who + imposed the deadline). +%% +First Law of Socio-Genetics: + Celibacy is not hereditary. +%% +First Rule of History: + History doesn't repeat itself -- historians merely repeat each + other. +%% +Flappity, floppity, flip +The mouse on the m"obius strip; + The strip revolved, + The mouse dissolved +In a chronodimensional skip. +%% +FLASH! Intelligence of mankind decreasing. Details at ... uh, when +the little hand is on the .... +%% +Flon's Law: + There is not now, and never will be, a language in which it is + the least bit difficult to write bad programs. +%% +Flugg's Law: + When you need to knock on wood is when you realize that the + world is composed of vinyl, naugahyde and aluminum. +%% +For a good time, call (415) 642-9483 +%% +For an idea to be fashionable is ominous, since it must afterwards be +always old-fashioned. +%% +For every complex problem, there is a solution that is simple, neat, +and wrong. + -- H. L. Mencken +%% +For every credibility gap, there is a gullibility fill. + -- R. Clopton +%% + "For I perceive that behind this seemingly unrelated sequence +of events, there lurks a singular, sinister attitude of mind." + + "Whose?" + + "MINE! HA-HA!" +%% +For some reason a glaze passes over people's faces when you say +"Canada". Maybe we should invade South Dakota or something. + -- Sandra Gotlieb, wife of the Canadian ambassador to + the U.S. +%% +For some reason, this fortune reminds everyone of Marvin Zelkowitz. +%% +"For that matter, compare your pocket computer with the massive jobs of +a thousand years ago. Why not, then, the last step of doing away with +computers altogether?" + -- Jehan Shuman +%% +For those who like this sort of thing, this is the sort of thing they +like. + -- Abraham Lincoln +%% +For years a secret shame destroyed my peace -- +I'd not read Eliot, Auden or MacNiece. +But now I think a thought that brings me hope: +Neither had Chaucer, Shakespeare, Milton, Pope. + -- Justin Richardson. +%% +Forgetfulness, n.: + A gift of God bestowed upon debtors in compensation for their +destitution of conscience. +%% +Fortune's graffito of the week (or maybe even month): + + Don't Write On Walls! + + (and underneath) + + You want I should type? +%% +Fortune's nomination for All-Time Champion and Protector of Youthful +Morals goes to Representative Clare E. Hoffman of Michigan. During an +impassioned House debate over a proposed bill to "expand oyster and +clam research," a sharp-eared informant transcribed the following +exchange between our hero and Rep. John D. Dingell, also of Michigan. + +DINGELL: There are places in the world at the present time where we are + having to artificially propagate oysters and clams. +HOFFMAN: You mean the oysters I buy are not nature's oysters? +DINGELL: They may or may not be natural. The simple fact of the matter + is that female oysters through their living habits cast out + large amounts of seed and the male oysters cast out large + amounts of fertilization. +HOFFMAN: Wait a minute! I do not want to go into that. There are many + teenagers who read The Congressional Record. +%% +FORTUNE'S PARTY TIPS #14 + +Tired of finding that other people are helping themselves to your good +liquor at BYOB parties? Take along a candle, which you insert and +light after you've opened the bottle. No one ever expects anything +drinkable to be in a bottle which has a candle stuck in its neck. +%% +Fourth Law of Applied Terror: + The night before the English History mid-term, your Biology + instructor will assign 200 pages on planaria. +Corollary: + Every instructor assumes that you have nothing else to do + except study for that instructor's course. +%% +Fourth Law of Revision: + It is usually impractical to worry beforehand about + interferences -- if you have none, someone will make one for + you. +%% +Fresco's Discovery: + If you knew what you were doing you'd probably be bored. +%% +Friends, Romans, Hipsters, +Let me clue you in; +I come to put down Caeser, not to groove him. +The square kicks some cats are on stay with them; +The hip bits, like, go down under; so let it lay with Caeser. The cool Brutus +Gave you the message: Caeser had big eyes; +If that's the sound, someone's copping a plea, +And, like, old Caeser really set them straight. +Here, copacetic with Brutus and the studs, -- for Brutus is a real cool cat; +So are they all, all cool cats, -- +Come I to make this gig at Caeser's laying down. +%% +Frisbeetarianism, n.: + The belief that when you die, your soul goes up the on roof and +gets stuck. +%% +Frobnicate, v.: + To manipulate or adjust, to tweak. Derived from FROBNITZ. +Usually abbreviated to FROB. Thus one has the saying "to frob a +frob". See TWEAK and TWIDDLE. Usage: FROB, TWIDDLE, and TWEAK +sometimes connote points along a continuum. FROB connotes aimless +manipulation; TWIDDLE connotes gross manipulation, often a coarse +search for a proper setting; TWEAK connotes fine-tuning. If someone is +turning a knob on an oscilloscope, then if he's carefully adjusting it +he is probably tweaking it; if he is just turning it but looking at the +screen he is probably twiddling it; but if he's just doing it because +turning a knob is fun, he's frobbing it. +%% +From too much love of living, +From hope and fear set free, +We thank with brief thanksgiving, +Whatever gods may be, +That no life lives forever, +That dead men rise up never, +That even the weariest river winds somewhere safe to sea. + -- Swinburne +%% +Fudd's First Law of Opposition: + Push something hard enough and it will fall over. +%% +Furbling, v.: + Having to wander through a maze of ropes at an airport or bank +even when you are the only person in line. + -- Rich Hall, "Sniglets" +%% +Furious activity is no substitute for understanding. + -- H. H. Williams +%% +Future looks spotty. You will spill soup in late evening. +%% +G. B. Shaw to William Douglas Home: "Go on writing plays, my boy. One +of these days a London producer will go into his office and say to his +secretary, `Is there a play from Shaw this morning?' and when she says +`No,' he will say, `Well, then we'll have to start on the rubbish.' +And that's your chance, my boy." +%% +Garbage In -- Gospel Out. +%% +Garter, n.: + An elastic band intended to keep a woman from coming out of her +stockings and desolating the country. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Gauls! We have nothing to fear; except perhaps that the sky may fall +on our heads tomorrow. But as we all know, tomorrow never comes!! + -- Adventures of Asterix. +%% +Gay shlafen: Yiddish for "go to sleep". + + Now doesn't "gay shlafen" have a softer, more soothing sound +than the harsh, staccato "go to sleep"? Listen to the difference: + "Go to sleep, you little wretch!" ... "Gay shlafen, darling." +Obvious, isn't it? + Clearly the best thing you can do for you children is to start +speaking Yiddish right now and never speak another word of English as +long as you live. This will, of course, entail teaching Yiddish to all +your friends, business associates, the people at the supermarket, and +so on, but that's just the point. It has to start with committed +individuals and then grow ... + Some minor adjustments will have to be made, of course: those +signs written in what look like Yiddish letters won't be funny when +everything is written in Yiddish. And we'll have to start driving on +the left side of the road so we won't be reading the street signs +backwards. But is that too high a price to pay for world peace? I +think not, my friend, I think not. + -- Arthur Naiman, "Every Goy's Guide to Yiddish" +%% + "Gee, Mudhead, everyone at Morse Science High has an +extracurricular activity except you." + "Well, gee, doesn't Louise count?" + "Only to ten, Mudhead." + + -- Firesign Theater +%% + GEMINI (May 21 - June 20) +You are a quick and intelligent thinker. People like you because you +are bisexual. However, you are inclined to expect too much for too +little. This means you are cheap. Geminis are known for committing +incest. +%% +GEMINI (May 21 to Jun. 20) + Good news and bad news highlighted. Enjoy the good news while + you can; the bad news will make you forget it. You will enjoy + praise and respect from those around you; everybody loves a + sucker. A short trip is in the stars, possibly to the men's + room. +%% +Genderplex, n.: + The predicament of a person in a restaurant who is unable to +determine his or her designated restroom (e.g., turtles and +tortoises). + -- Rich Hall, "Sniglets" +%% +Genetics explains why you look like your father, and if you don't, why +you should. +%% +Genius may have its limitations, but stupidity is not thus +handicapped. + -- Elbert Hubbard +%% +Genius, n.: + A chemist who discovers a laundry additive that rhymes with +"bright". +%% +George Orwell was an optimist. +%% +Gerrold's Laws of Infernal Dynamics: + 1. An object in motion will always be headed in the wrong + direction. + 2. An object at rest will always be in the wrong place. + 3. The energy required to change either one of these states + will always be more than you wish to expend, but never so + much as to make the task totally impossible. +%% +Get forgiveness now -- tomorrow you may no longer feel guilty. +%% +Get Revenge! Live long enough to be a problem for your children! +%% + -- Gifts for Children -- + +This is easy. You never have to figure out what to get for children, +because they will tell you exactly what they want. They spend months +and months researching these kinds of things by watching Saturday- +morning cartoon-show advertisements. Make sure you get your children +exactly what they ask for, even if you disapprove of their choices. If +your child thinks he wants Murderous Bob, the Doll with the Face You +Can Rip Right Off, you'd better get it. You may be worried that it +might help to encourage your child's antisocial tendencies, but believe +me, you have not seen antisocial tendencies until you've seen a child +who is convinced that he or she did not get the right gift. + -- Dave Barry, "Christmas Shopping: A Survivor's Guide" +%% + -- Gifts for Men -- + +Men are amused by almost any idiot thing -- that is why professional +ice hockey is so popular -- so buying gifts for them is easy. But you +should never buy them clothes. Men believe they already have all the +clothes they will ever need, and new ones make them nervous. For +example, your average man has 84 ties, but he wears, at most, only +three of them. He has learned, through humiliating trial and error, +that if he wears any of the other 81 ties, his wife will probably laugh +at him ("You're not going to wear THAT tie with that suit, are you?"). +So he has narrowed it down to three safe ties, and has gone several +years without being laughed at. If you give him a new tie, he will +pretend to like it, but deep inside he will hate you. + +If you want to give a man something practical, consider tires. More +than once, I would have gladly traded all the gifts I got for a new set +of tires. + -- Dave Barry, "Christmas Shopping: A Survivor's Guide" +%% + Gimmie That Old Time Religion +We will follow Zarathustra, We will worship like the Druids, +Zarathustra like we use to, Dancing naked in the woods, +I'm a Zarathustra booster, Drinking strange fermented fluids, +And he's good enough for me! And it's good enough for me! + (chorus) (chorus) + +In the church of Aphrodite, +The priestess wears a see through nightie, +She's a mighty righteous sightie, +And she's good enough for me! + (chorus) + +CHORUS: Give me that old time religion, + Give me that old time religion, + Give me that old time religion, + 'Cause it's good enough for me! +%% +Ginsberg's Theorem: + 1. You can't win. + 2. You can't break even. + 3. You can't even quit the game. + +Freeman's Commentary on Ginsberg's theorem: + + Every major philosophy that attempts to make life seem + meaningful is based on the negation of one part of Ginsberg's + Theorem. To wit: + + 1. Capitalism is based on the assumption that you can win. + 2. Socialism is based on the assumption that you can break + even. + 3. Mysticism is based on the assumption that you can quit the + game. +%% +Give me a Plumber's friend the size of the Pittsburgh dome, and a place +to stand, and I will drain the world. +%% +Give me the Luxuries, and the Hell with the Necessities! +%% +Give thought to your reputation. Consider changing name and moving to +a new town. +%% +Give your child mental blocks for Christmas. +%% +Glib's Fourth Law of Unreliability: + Investment in reliability will increase until it exceeds the + probable cost of errors, or until someone insists on getting + some useful work done. +%% +Go 'way! You're bothering me! +%% +Go placidly amid the noise and waste, and remember what value there may +be in owning a piece thereof. + -- National Lampoon, "Deteriorada" +%% +//GO.SYSIN DD *, DOODAH, DOODAH +%% +God did not create the world in 7 days; he screwed around for 6 days +and then pulled an all-nighter. +%% +"God gives burdens; also shoulders" + + Jimmy Carter cited this Jewish saying in his concession speech +at the end of the 1980 election. At least he said it was a Jewish +saying; I can't find it anywhere. I'm sure he's telling the truth +though; why would he lie about a thing like that? + -- Arthur Naiman, "Every Goy's Guide to Yiddish" +%% +God has intended the great to be great and the little to be little ... +The trade unions, under the European system, destroy liberty ... I do +not mean to say that a dollar a day is enough to support a workingman +... not enough to support a man and five children if he insists on +smoking and drinking beer. But the man who cannot live on bread and +water is not fit to live! A family may live on good bread and water in +the morning, water and bread at midday, and good bread and water at +night! + -- Rev. Henry Ward Beecher +%% +God is a comic playing to an audience that's afraid to laugh +%% +God is a polythiest +%% +God is Dead + -- Nietzsche +Nietzsche is Dead + -- God +Nietzsche is God + -- The Dead +%% +God is not dead! He's alive and autographing bibles at Cody's +%% +God is real, unless declared integer. +%% +God is really only another artist. He invented the giraffe, the +elephant and the cat. He has no real style, He just goes on trying +other things. + -- Pablo Picasso +%% +God is the tangential point between zero and infinity. + -- Alfred Jarry +%% +God isn't dead, he just couldn't find a parking place. +%% +God made machine language; all the rest is the work of man. +%% +God made the Idiot for practice, and then He made the School Board + -- Mark Twain +%% +God made the integers; all else is the work of Man. + -- Kronecker +%% +God made the world in six days, and was arrested on the seventh. +%% +God may be subtle, but He isn't plain mean. + -- Albert Einstein +%% +God must love the Common Man; He made so many of them. +%% +God rest ye CS students now, +Let nothing you dismay. +The VAX is down and won't be up, +Until the first of May. +The program that was due this morn, +Won't be postponed, they say. + + Oh, tidings of comfort and joy, + Comfort and joy, + Oh, tidings of comfort and joy. + +The bearings on the drum are gone, +The disk is wobbling, too. +We've found a bug in Lisp, and Algol +Can't tell false from true. +And now we find that we can't get +At Berkeley's 4.2. + + (chorus) +%% +Going to church does not make a person religious, nor does going to +school make a person educated, any more than going to a garage makes a +person a car. +%% +Gold, n.: + A soft malleable metal relatively scarce in distribution. It +is mined deep in the earth by poor men who then give it to rich men who +immediately bury it back in the earth in great prisons, although gold +hasn't done anything to them. + -- Mike Harding, "The Armchair Anarchist's Almanac" +%% +Goldenstern's Rules: + 1. Always hire a rich attorney + 2. Never buy from a rich salesman. +%% +Good advice is something a man gives when he is too old to set a bad +example. + -- La Rouchefoucauld +%% +Good day for a change of scene. Repaper the bedroom wall. +%% +Good day for overcoming obstacles. Try a steeplechase. +%% +Good day to avoid cops. Crawl to school. +%% +Good day to let down old friends who need help. +%% +Good leaders being scarce, following yourself is allowed. +%% +Good news is just life's way of keeping you off balance. +%% +Good news. Ten weeks from Friday will be a pretty good day. +%% +Good night to spend with family, but avoid arguments with your mate's +new lover. +%% +Good-bye. I am leaving because I am bored. + -- George Saunders' dying words +%% +Got Mole problems? +Call Avogardo 6.02 x 10^23 +%% +Goto, n.: + A programming tool that exists to allow structured programmers +to complain about unstructured programmers. + -- Ray Simard +%% +Goy: ... The distinction between Jewish and goyish can be quite subtle, +as the following quote from Lenny Bruce illustrates: + + "I'm Jewish. Count Basie's Jewish. Ray Charles is Jewish. +Eddie Cantor's goyish. The B'nai Brith is goyish. The Hadassah is +Jewish. Marine Corps -- heavy goyish, dangerous. + "Kool-Aid is goyish. All Drake's Cakes are goyish. +Pumpernickel is Jewish and, as you know, white bread is very goyish. +Instant potatoes -- goyish. Black cherry soda's very Jewish. +Macaroons are ____very Jewish. Fruit salad is Jewish. Lime Jell-O is +goyish. Lime soda is ____very goyish. Trailer parks are so goyish that +Jews won't go near them ..." + -- Arthur Naiman, "Every Goy's Guide to Yiddish" +%% +Grabel's Law: + 2 is not equal to 3 -- not even for large values of 2. +%% +Graduate life -- it's not just a job, it's an indenture. +%% +Grandpa Charnock's Law: + You never really learn to swear until you learn to drive. +%% +Gravity is a myth, the Earth sucks. +%% +Gray's Law of Programming: + `_n+1' trivial tasks are expected to be accomplished in the same + time as `_n' tasks. + +Logg's Rebuttal to Gray's Law: + `_n+1' trivial tasks take twice as long as `_n' trivial tasks. +%% + GREAT MOMENTS IN AMERICAN HISTORY (#21) -- July 30, 1917 + +On this day, New York City hotel detectives burst in and caught then- +Senator Warren G. Harding in bed with an underage girl. He bought them +off with a $20 bribe, and later remarked thankfully, "I thought I +wouldn't get out of that under $1000!" Always one to learn from his +mistakes, in later years President Harding carried on his affairs in a +tiny closet in the White House Cabinet Room while Secret Service men +stood lookout. +%% +Green light in A.M. for new projects. Red light in P.M. for traffic +tickets. +%% +Greener's Law: + Never argue with a man who buys ink by the barrel. +%% +Grelb's Reminder: + Eighty percent of all people consider themselves to be above + average drivers. +%% +"Grub first, then ethics." + -- Bertolt Brecht +%% +Gyroscope, n.: + A wheel or disk mounted to spin rapidly about an axis and also +free to rotate about one or both of two axes perpendicular to each +other and the axis of spin so that a rotation of one of the two +mutually perpendicular axes results from application of torque to the +other when the wheel is spinning and so that the entire apparatus +offers considerable opposition depending on the angular momentum to any +torque that would change the direction of the axis of spin. + -- Webster's Seventh New Collegiate Dictionary +%% +H. L. Mencken's Law: + Those who can -- do. + Those who can't -- teach. + +Martin's Extension: + Those who cannot teach -- administrate. +%% +Hacker's Law: + The belief that enhanced understanding will necessarily stir + a nation to action is one of mankind's oldest illusions. +%% +Hacking's just another word for nothing left to kludge. +%% +... Had this been an actual emergency, we would have fled in terror, +and you would not have been informed. +%% +Hail to the sun god +He sure is a fun god +Ra! Ra! Ra! +%% +Half Moon tonight. (At least it's better than no Moon at all.) +%% +Half-done: This is the best way to eat a kosher dill -- when it's still +crunchy, light green, yet full of garlic flavor. The difference +between this and the typical soggy dark green cucumber corpse is like +the the difference between life and death. + You may find it difficult to find a good half-done kosher dill +there in Seattle, so what you should do is take a cab out to the +airport, fly to New York, take the JFK Express to Jay Street-Borough +Hall, transfer to an uptown F, get off at East Broadway, walk north on +Essex (along the park), make your first left onto Hester Street, walk +about fifteen steps, turn ninety degrees left, and stop. Say to the +man, "Let me have a nice half-done." + Worth the trouble, wasn't it? + -- Arthur Naiman, "Every Goy's Guide to Yiddish" +%% +Hall's Laws of Politics: + (1) The voters want fewer taxes and more spending. + (2) Citizens want honest politicians until they want something + fixed. + (3) Constituency drives out consistency (i.e., liberals defend + military spending, and conservatives social spending in + their own districts). +%% +Hand, n.: + A singular instrument worn at the end of a human arm and +commonly thrust into somebody's pocket. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Hanlon's Razor: + Never attribute to malice that which is adequately explained by + stupidity. +%% +Hanson's Treatment of Time: + There are never enough hours in a day, but always too many days + before Saturday. +%% +Happiness is having a scratch for every itch. + -- Ogden Nash +%% +Happiness isn't something you experience; it's something you remember. + -- Oscar Levant +%% +Happiness, n.: + An agreeable sensation arising from contemplating the misery of +another. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Hardware, n.: + The parts of a computer system that can be kicked. +%% +Hark, Hark, the dogs do bark +The Duke is fond of kittens +He likes to take their insides out +And use them for his mittens + From "The Thirteen Clocks" +%% +Hark, the Herald Tribune sings, +Advertising wondrous things. + -- Tom Leher +%% +Harris's Lament: + All the good ones are taken. +%% +Harrisberger's Fourth Law of the Lab: + Experience is directly proportional to the amount of + equipment ruined. +%% +Harry is heavily into camping, and every year in the late fall, he +makes us all go to Assateague, which is an island on the Atlantic Ocean +famous for its wild horses. I realize that the concept of wild horses +probably stirs romantic notions in many of you, but this is because you +have never met any wild horses in person. In person, they are like +enormous hooved rats. They amble up to your camp site, and their +attitude is: "We're wild horses. We're going to eat your food, knock +down your tent and poop on your shoes. We're protected by federal law, +just like Richard Nixon." + -- Dave Barry, "Tenting Grandpa Bob" +%% +Hartley's First Law: + You can lead a horse to water, but if you can get him to float + on his back, you've got something. +%% +Hartley's Second Law: + Never sleep with anyone crazier than yourself. +%% +Harvard Law: + Under the most rigorously controlled conditions of pressure, + temperature, volume, humidity, and other variables, the + organism will do as it damn well pleases. +%% +Has everyone noticed that all the letters of the word "database" are +typed with the left hand? Now the layout of the QWERTYUIOP typewriter +keyboard was designed, among other things, to facilitate the even use +of both hands. It follows, therefore, that writing about databases is +not only unnatural, but a lot harder than it appears. +%% + Has your family tried 'em? + + POWDERMILK BISCUITS + + Heavens, they're tasty and expeditious! + + They're made from whole wheat, to give shy persons + the strength to get up and do what needs to be done. + + POWDERMILK BISCUITS + + Buy them ready-made in the big blue box with the picture of + the biscuit on the front, or in the brown bag with the dark + stains that indicate freshness. +%% +Hatred, n.: + A sentiment appropriate to the occasion of another's +superiority. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Have you ever noticed that the people who are always trying to tell +you, "There's a time for work and a time for play," never find the time +for play? +%% +Have you noticed that all you need to grow healthy, vigorous grass is a +crack in your sidewalk? +%% +He had that rare weird electricity about him -- that extremely wild and +heavy presence that you only see in a person who has abandoned all hope +of ever behaving "normally." + -- Hunter S. Thompson, "Fear and Loathing '72" +%% +He hadn't a single redeeming vice. + -- Oscar Wilde +%% +"He is now rising from affluence to poverty." + -- Mark Twain +%% +He looked at me as if I was a side dish he hadn't ordered. +%% +He played the king as if afraid someone else would play the ace. + -- John Mason Brown, drama critic +%% +He thought he saw an albatross +That fluttered 'round the lamp. +He looked again and saw it was +A penny postage stamp. +"You'd best be getting home," he said, +"The nights are rather damp." +%% +"He was so narrow minded he could see through a keyhole with both +eyes ..." +%% +He who attacks the fundamentals of the American broadcasting industry +attacks democracy itself. + -- William S. Paley, chairman of CBS +%% +He who Laughs, Lasts. +%% +"He's just a politician trying to save both his faces ..." +%% +He's the kind of guy, that, well, if you were ever in a jam he'd be +there ... with two slices of bread and some chunky peanut butter. +%% +"He's the kind of man for the times that need the kind of man he is ..." +%% +HE: Let's end it all, bequeathin' our brains to science. +SHE: What?!? Science got enough trouble with their OWN brains. + -- Walt Kelley +%% +Health is merely the slowest possible rate at which one can die. +%% +Heaven, n.: + A place where the wicked cease from troubling you with talk of +their personal affairs, and the good listen with attention while you +expound your own. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Heavy, adj.: + Seduced by the chocolate side of the force. +%% +"Heisenberg may have slept here" +%% +Hell hath no fury like a bureaucrat scorned. + -- Milton Friedman +%% +Heller's Law: + The first myth of management is that it exists. + +Johnson's Corollary: + Nobody really knows what is going on anywhere within the + organization. +%% +Help a swallow land at Capistrano. +%% +Help! I'm trapped in a PDP 11/70! +%% +Her locks an ancient lady gave +Her loving husband's life to save; +And men -- they honored so the dame -- +Upon some stars bestowed her name. + +But to our modern married fair, +Who'd give their lords to save their hair, +No stellar recognition's given. +There are not stars enough in heaven. +%% +"Here at the Phone Company, we serve all kinds of people; from +Presidents and Kings to the scum of the earth ..." +%% +Here I sit, broken-hearted, +All logged in, but work unstarted. +First net.this and net.that, +And a hot buttered bun for net.fat. + +The boss comes by, and I play the game, +Then I turn back to net.flame. +Is there a cure (I need your views), +For someone trapped in net.news? + +I need your help, I say 'tween sobs, +'Cause I'll soon be listed in net.jobs. +%% +Here in my heart, I am Helen; + I'm Aspasia and Hero, at least. +I'm Judith, and Jael, and Madame de Sta"el; + I'm Salome, moon of the East. + +Here in my soul I am Sappho; + Lady Hamilton am I, as well. +In me R'ecamier vies with Kitty O'Shea, + With Dido, and Eve, and poor nell. + +I'm all of the glamorous ladies + At whose beckoning history shook. +But you are a man, and see only my pan, + So I stay at home with a book. + -- Dorothy Parker +%% +Here is a simple experiment that will teach you an important electrical +lesson: On a cool, dry day, scuff your feet along a carpet, then reach +your hand into a friend's mouth and touch one of his dental fillings. +Did you notice how your friend twitched violently and cried out in +pain? This teaches us that electricity can be a very powerful force, +but we must never use it to hurt others unless we need to learn an +important electrical lesson. + +It also teaches us how an electrical circuit works. When you scuffed +your feet, you picked up batches of "electrons", which are very small +objects that carpet manufacturers weave into carpets so they will +attract dirt. The electrons travel through your bloodstream and +collect in your finger, where they form a spark that leaps to your +friend's filling, then travels down to his feet and back into the +carpet, thus completing the circuit. + +Amazing Electronic Fact: If you scuffed your feet long enough without +touching anything, you would build up so many electrons that your +finger would explode! But this is nothing to worry about unless you +have carpeting. + -- Dave Barry, "What is Electricity?" +%% + Here is the fact of the week, maybe even the fact of the +month. According to probably reliable sources, the Coca-Cola people +are experiencing severe marketing anxiety in China. + The words "Coca-Cola" translate into Chinese as either +(depending on the inflection) "wax-fattened mare" or "bite the wax +tadpole". + Bite the wax tadpole. + There is a sort of rough justice, is there not? + The trouble with this fact, as lovely as it is, is that it's +hard to get a whole column out of it. I'd like to teach the world to +bite a wax tadpole. Coke -- it's the real wax-fattened mare. Not bad, +but broad satiric vistas do not open up. + -- John Carrol, San Francisco Chronicle +%% +Heuristics are bug ridden by definition. If they didn't have bugs, +then they'd be algorithms. +%% +"Hey! Who took the cork off my lunch??!" + -- W. C. Fields +%% +Hi there! This is just a note from me, to you, to tell you, the person +reading this note, that I can't think up any more famous quotes, jokes, +nor bizarre stories, so you may as well go home. +%% +Higgeldy Piggeldy, +Hamlet of Elsinore +Ruffled the critics by +Dropping this bomb: +"Phooey on Freud and his +Psychoanalysis -- +Oedipus, Shmoedipus, +I just loved Mom." +%% +Hindsight is an exact science. +%% +Hippogriff, n.: + An animal (now extinct) which was half horse and half griffin. +The griffin was itself a compound creature, half lion and half eagle. +The hippogriff was actually, therefore, only one quarter eagle, which +is two dollars and fifty cents in gold. The study of zoology is full +of surprises. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Hire the morally handicapped. +%% +"His mind is like a steel trap -- full of mice" + -- Foghorn Leghorn +%% +"His super power is to turn into a scotch terrier." +%% +History repeats itself. That's one thing wrong with history. +%% +Hlade's Law: + If you have a difficult task, give it to a lazy person -- they + will find an easier way to do it. +%% +Hoare's Law of Large Problems: + Inside every large problem is a small problem struggling to get + out. +%% +Hofstadter's Law: + It always takes longer than you expect, even when you take + Hofstadter's Law into account. +%% +Hollywood is where if you don't have happiness you send out for it. + -- Rex Reed +%% +"Honesty is the best policy, but insanity is a better defense" +%% +Honesty pays, but it doesn't seem to pay enough to suit some people. + -- F. M. Hubbard +%% +Honk if you hate bumper stickers that say "Honk if ..." +%% +Honk if you love peace and quiet. +%% +Honorable, adj.: + Afflicted with an impediment in one's reach. In legislative +bodies, it is customary to mention all members as honorable; as, "the +honorable gentleman is a scurvy cur." + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Horngren's Observation: + Among economists, the real world is often a special case. +%% +Horngren's Observation: + Among economists, the real world is often a special case. +%% +Horse sense is the thing a horse has which keeps it from betting on +people. + -- W. C. Fields +%% +How can you be in two places at once when you're not anywhere at all? +%% +How come only your friends step on your new white sneakers? +%% +How come wrong numbers are never busy? +%% +How do you explain school to a higher intelligence? + -- Elliot, "E.T." +%% +How doth the little crocodile + Improve his shining tail, +And pour the waters of the Nile + On every golden scale! + +How cheerfully he seems to grin, + How neatly spreads his claws, +And welcomes little fishes in, + With gently smiling jaws! + -- Lewis Carrol, "Alice in Wonderland" +%% +How doth the VAX's C compiler +Improve its object code. +And even as we speak does it +Increase the system load. + +How patiently it seems to run +And spit out error flags, +While users, with frustration, all +Tear their clothes to rags. +%% +How doth the VAX's C-compiler +Improve its object code. +And even as we speak does it +Increase the system load. + +How patiently it seems to run +And spit out error flags, +While users, with frustration, all +Tear all their clothes to rags. +%% +How long a minute is depends on which side of the bathroom door you're +on. +%% +How many hardware engineers does it take to change a lightbulb? +None: "We'll fix it in software." + +How many software engineers does it take to change a lightbulb? +None: "We'll document it in the manual." + +How many tech writers does it take to change a lightbulb? +None: "The user can work it out." +%% +How many Zen masters does it take to screw in a light bulb? + +None. The Universe spines the bulb, and the Zen master stays out of +the way. +%% +How much does it cost to entice a dope-smoking UNIX system guru to +Dayton? + -- Brian Boyle, UNIX/WORLD's First Annual Salary Survey +%% +How wonderful opera would be if there were no singers. +%% +Howe's Law: + Everyone has a scheme that will not work. +%% +However, never daunted, I will cope with adversity in my traditional +manner ... sulking and nausea. + -- Tom K. Ryan +%% +Human beings were created by water to transport it uphill. +%% +Human cardiac catheterization was introduced by Werner Forssman in +1929. Ignoring his department chief, and tying his assistant to an +operating table to prevent his interference, he placed a uretheral +catheter into a vein in his arm, advanced it to the right atrium [of +his heart], and walked upstairs to the x-ray department where he took +the confirmatory x-ray film. In 1956, Dr. Forssman was awarded the +Nobel Prize. +%% +Hummingbirds never remember the words to songs. +%% +"Humor is a drug which it's the fashion to abuse." + -- William Gilbert +%% +Hurewitz's Memory Principle: + The chance of forgetting something is directly proportional + to ..... to ........ uh .............. +%% +I am changing my name to Crysler +I am going down to Washington, D.C. +I will tell some power broker + What they did for Iacocca +Will be perfectly acceptable to me! +I am changing my name to Chrysler, +I am heading for that great receiving line. +When they hand a million grand out, + I'll be standing with my hand out, +Yessir, I'll get mine! +%% +"I am not an Economist. I am an honest man!" + -- Paul McCracken +%% +I am not now, and never have been, a girl friend of Henry Kissinger. + -- Gloria Steinem +%% +"I am not sure what this is, but an `F' would only dignify it." + -- English Professor +%% +I am ready to meet my Maker. Whether my Maker is prepared for the +great ordeal of meeting me is another matter. + -- Winston Churchill +%% +"I am returning this otherwise good typing paper to you because someone +has printed gibberish all over it and put your name at the top." + --English Professor, Ohio University +%% +I am the mother of all things, and all things should wear a sweater. +%% +I am, in point of fact, a particularly haughty and exclusive person, of +pre-Adamite ancestral descent. You will understand this when I tell +you that I can trace my ancestry back to a protoplasmal primordial +atomic globule. Consequently, my family pride is something +inconceivable. I can't help it. I was born sneering. + -- Pooh-Bah, "The Mikado", Gilbert & Sullivan +%% +I believe in getting into hot water; it keeps you clean. + -- G. K. Chesterton +%% +I belong to no organized party. I am a Democrat. + -- Will Rogers +%% +I bet the human brain is a kludge. + -- Marvin Minsky +%% +I can resist anything but temptation. +%% +I can't complain, but sometimes I still do. + -- Joe Walsh +%% +I cannot and will not cut my conscience to fit this year's fashions. + -- Lillian Hellman +%% +I cannot overemphasize the importance of good grammar. + +What a crock. I could easily overemphasize the importance of good +grammar. For example, I could say: "Bad grammar is the leading cause +of slow, painful death in North America," or "Without good grammar, the +United States would have lost World War II." + -- Dave Barry, "An Utterly Absurd Look at Grammar" +%% + "I cannot read the fiery letters," said Frodo in a quavering +voice. + "No," Said Gandalf, "but I can. The letters are Elvish, of +course, of an ancient mode, but the language is that of Mordor, which +I will not utter here. They are lines of a verse long known in +Elven-lore: + + "This Ring, no other, is made by the elves, + Who'd pawn their own mother to grab it themselves. + Ruler of creeper, mortal, and scallop, + This is a sleeper that packs quite a wallop. + The Power almighty rests in this Lone Ring. + The Power, alrighty, for doing your Own Thing. + If broken or busted, it cannot be remade. + If found, send to Sorhed (with postage prepaid)." +%% +I do not fear computers. I fear the lack of them. + -- Isaac Asimov +%% +I do not feel obliged to believe that the same God who has endowed us +with sense, reason, and intellect has intended us to forgo their use. + -- Galileo Galilei +%% +I do not know myself, and God forbid that I should. + -- Johann Wolfgang von Goethe +%% +I don't believe in astrology. But then I'm an Aquarius, and Aquarians +don't believe in astrology. + -- James R. F. Quirk +%% +"I don't care who does the electing as long as I get to do the +nominating" + -- Boss Tweed +%% +"I don't have any solution but I certainly admire the problem." + -- Ashleigh Brilliant +%% +I don't have to take this abuse from you -- I've got hundreds of people +waiting to abuse me. + --Bill Murray, "Ghostbusters" +%% + "I don't know what you mean by `glory,'" Alice said + Humpty Dumpty smiled contemptuously. "Of course you don't-- +till I tell you. I meant `there's a nice knock-down argument for +you!'" + "But glory doesn't mean `a nice knock-down argument,'" Alice +objected. + "When I use a word," Humpty Dumpty said, in a rather scornful +tone, "it means just what I choose it to mean -- neither more nor +less." + "The question is," said Alice, "whether you can make words mean +so many different things." + "The question is," said Humpty Dumpty, "which is to be master-- +that's all." + -- Lewis Carrol, "Through the Looking Glass" +%% +I don't like spinach, and I'm glad I don't, because if I liked it I'd +eat it, and I just hate it. + -- Clarence Darrow +%% +I don't object to sex before marriage, but two minutes before?!? +%% +I dread success. To have succeeded is to have finished one's business +on earth, like the male spider, who is killed by the female the moment +he has succeeded in his courtship. I like a state of continual +becoming, with a goal in front and not behind. + -- George Bernard Shaw +%% +"I drink to make other people interesting." + -- George Jean Nathan +%% +I for one cannot protest the recent M. T. A. fare hike and the +accompanying promises that this would in no way improve service. For +the transit system, as it now operates, has hidden advantages that +can't be measured in monetary terms. + +Personally, I feel that it is well worth 75 cents or even $1 to have +that unimpeachable excuse whenever I am late to anything: "I came by +subway." Those four words have such magic in them that if Godot should +someday show up and mumble them, any audience would instantly +understand his long delay. +%% +I for one cannot protest the recent M.T.A. fare hike and the +accompanying promises that this would in no way improve service. For +the transit system, as it now operates, has hidden advantages that +can't be measured in monetary terms. + +Personally, I feel that it is well worth 75 cents or even $1 to have +that unimpeachable excuse whenever I am late to anything: "I came by +subway." Those four words have such magic in them that if Godot should +someday show up and mumble them, any audience would instantly +understand his long delay. +%% +I generally avoid temptation unless I can't resist it. + -- Mae West +%% +I get up each morning, gather my wits. +Pick up the paper, read the obits. +If I'm not there I know I'm not dead. +So I eat a good breakfast and go back to bed. + +Oh, how do I know my youth is all spent? +My get-up-and-go has got-up-and-went. +But in spite of it all, I'm able to grin, +And think of the places my get-up has been. + -- Pete Seeger +%% +I hate quotations. + -- Ralph Waldo Emerson +%% +I have a simple philosophy: + + Fill what's empty. + Empty what's full. + Scratch where it itches. + -- A. R. Longworth +%% +I have learned +To spell hors d'oeuvres +Which still grates on +Some people's n'oeuvres. + -- Warren Knox +%% +I have made mistakes but I have never made the mistake of claiming that +I have never made one. + -- James Gordon Bennett +%% +I have made this letter longer than usual because I lack the time to +make it shorter. + -- Blaise Pascal +%% +I have seen the future and it is just like the present, only longer. + -- Kehlog Albran, "The Profit" +%% +I have the simplest tastes. I am always satisfied with the best. + -- Oscar Wilde +%% +I haven't lost my mind -- it's backed up on tape somewhere. +%% +I haven't lost my mind; I know exactly where I left it. +%% +"I just need enough to tide me over until I need more." + -- Bill Hoest +%% +"I know not with what weapons World War III will be fought, but +World War IV will be fought with sticks and stones." + -- Albert Einstein +%% +I like being single. I'm always there when I need me. + -- Art Leo +%% +I like work ... +I can sit and watch it for hours. +%% +I like your game but we have to change the rules. +%% +"I may not be totally perfect, but parts of me are excellent." + -- Ashleigh Brilliant +%% +"I must have a prodigious quantity of mind; it takes me as much as a +week sometimes to make it up." + -- Mark Twain, "The Innocents Abroad" +%% +I must have slipped a disk -- my pack hurts +%% +I never fail to convince an audience that the best thing they could do +was to go away. +%% +I never met a piece of chocolate I didn't like. +%% +I profoundly believe it takes a lot of practice to become a moral +slob. + -- William F. Buckley +%% + "I quite agree with you," said the Duchess; "and the moral of +that is -- `Be what you would seem to be' -- or, if you'd like it put +more simply -- `Never imagine yourself not to be otherwise than what it +might appear to others that what you were or might have been was not +otherwise than what you had been would have appeared to them to be +otherwise.'" + -- Lewis Carrol, "Alice in Wonderland" +%% +I really hate this damned machine +I wish that they would sell it. +It never does quite what I want +But only what I tell it. +%% +"I refuse to have a battle of wits with an unarmed person." +%% +I see the eigenvalue in thine eye, +I hear the tender tensor in thy sigh. +Bernoulli would have been content to die +Had he but known such _a-squared cos 2(phi)! + -- Stanislaw Lem, "Cyberiad" +%% +I sent a letter to the fish, +I told them, "This is what I wish." +The little fishes of the sea, +They sent an answer back to me. +The little fishes' answer was +"We cannot do it, sir, because ..." +I sent a letter back to say +It would be better to obey. +But someone came to me and said +"The little fishes are in bed." +I said to him, and I said it plain +"Then you must wake them up again." +I said it very loud and clear, +I went and shouted in his ear. +But he was very stiff and proud, +He said "You needn't shout so loud." +And he was very proud and stiff, +He said "I'll go and wake them if ..." +I took a kettle from the shelf, +I went to wake them up myself. +But when I found the door was locked +I pulled and pushed and kicked and knocked, +And when I found the door was shut, +I tried to turn the handle, But ... + + "Is that all?" asked Alice. + "That is all." said Humpty Dumpty. "Goodbye." + -- Lewis Carrol, "Through the Looking Glass" +%% +I think that I shall never see +A billboard lovely as a tree. +Perhaps, unless the billboards fall +I'll never see a tree at all. + -- Ogden Nash +%% +I used to get high on life but lately I've built up a resistance. +%% +I used to think I was indecisive, but now I'm not so sure. +%% +"I want to buy a husband who, every week when I sit down to watch `St. +Elsewhere', won't scream, `FORGET IT, BLANCHE ... IT'S TIME FOR "HEE +HAW"!!'" + -- Berke Breathed, "Bloom County" +%% +I was gratified to be able to answer promptly, and I did. I said I +didn't know. + -- Mark Twain +%% +I went on to test the program in every way I could devise. I strained +it to expose its weaknesses. I ran it for high-mass stars and low-mass +stars, for stars born exceedingly hot and those born relatively cold. +I ran it assuming the superfluid currents beneath the crust to be +absent -- not because I wanted to know the answer, but because I had +developed an intuitive feel for the answer in this particular case. +Finally I got a run in which the computer showed the pulsar's +temperature to be less than absolute zero. I had found an error. I +chased down the error and fixed it. Now I had improved the program to +the point where it would not run at all. + -- George Greenstein, "Frozen Star: Of Pulsars, Black + Holes and the Fate of Stars" +%% +I wish there was a knob on the TV to turn up the intelligence. There's +a knob called "brightness", but it doesn't work. + -- Gallagher +%% +I wouldn't recommend sex, drugs or insanity for everyone, but they've +always worked for me. + -- Hunter S. Thompson +%% +I'd give my right arm to be ambidextrous. +%% +"I'd love to go out with you, but I did my own thing and now I've got +to undo it." +%% +"I'd love to go out with you, but I have to floss my cat." +%% +"I'd love to go out with you, but I have to stay home and see if I +snore." +%% +"I'd love to go out with you, but I never go out on days that end in +`Y.'" +%% +"I'd love to go out with you, but I want to spend more time with my +blender." +%% +"I'd love to go out with you, but I'm attending the opening of my +garage door." +%% +"I'd love to go out with you, but I'm converting my calendar watch from +Julian to Gregorian." +%% +"I'd love to go out with you, but I'm doing door-to-door collecting for +static cling." +%% +"I'd love to go out with you, but I'm having all my plants neutered." +%% +"I'd love to go out with you, but I'm staying home to work on my +cottage cheese sculpture." +%% +"I'd love to go out with you, but I'm taking punk totem pole carving." +%% +"I'd love to go out with you, but I've been scheduled for a karma +transplant." +%% +"I'd love to go out with you, but it's my parakeet's bowling night." +%% +"I'd love to go out with you, but my favorite commercial is on TV." +%% +"I'd love to go out with you, but the last time I went out, I never +came back." +%% +"I'd love to go out with you, but the man on television told me to say +tuned." +%% +"I'd love to go out with you, but there are important world issues that +need worrying about." +%% +I'd rather have a bottle in front of me than a frontal lobotomy. +%% +I'll grant the random access to my heart, +Thoul't tell me all the constants of thy love; +And so we two shall all love's lemmas prove +And in our bound partition never part. + -- Stanislaw Lem, "Cyberiad" +%% +I'm a creationist; I refuse to believe that I could have evolved from +man. +%% +I'm all for computer dating, but I wouldn't want one to marry my +sister. +%% +I'm fed up to the ears with old men dreaming up wars for young men to +die in. + -- George McGovern +%% +I'm in Pittsburgh. Why am I here? + -- Harold Urey, Nobel Laureate +%% +I'm N-ary the tree, I am, +N-ary the tree, I am, I am. +I'm getting traversed by the parser next door, +She's traversed me seven times before. +And ev'ry time it was an N-ary (N-ary!) +Never wouldn't ever do a binary. (No sir!) +I'm 'er eighth tree that was N-ary. +N-ary the tree I am, I am, +N-ary the tree I am. +%% +I'm not under the alkafluence of inkahol that some thinkle peep I am. +It's just the drunker I sit here the longer I get. +%% +I'm prepared for all emergencies but totally unprepared for everyday +life. +%% +I'm really enjoying not talking to you ... Let's not talk again ____REAL +soon ... +%% +I'm very good at integral and differential calculus, +I know the scientific names of beings animalculous; +In short, in matters vegetable, animal, and mineral, +I am the very model of a modern Major-General. + -- Gilbert & Sullivan, "Pirates of Penzance" +%% +IBM had a PL/I, + Its syntax worse than JOSS; +And everywhere this language went, + It was a total loss. +%% +Idiot Box, n.: + The part of the envelope that tells a person where to place the +stamp when they can't quite figure it out for themselves. + -- Rich Hall, "Sniglets" +%% +Idiot, n.: + A member of a large and powerful tribe whose influence in human +affairs has always been dominant and controlling. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +If A = B and B = C, then A = C, except where void or prohibited by law. + -- Roy Santoro +%% +If a group of _N persons implements a COBOL compiler, there will be _N-1 +passes. Someone in the group has to be the manager. + -- T. Cheatham +%% +If a listener nods his head when you're explaining your program, wake +him up. +%% +If a President doesn't do it to his wife, he'll do it to his country. +%% +If all be true that I do think, +There be Five Reasons why one should Drink; +Good friends, good wine, or being dry, +Or lest we should be by-and-by, +Or any other reason why. +%% +If all else fails, immortality can always be assured by spectacular +error. + -- John Kenneth Galbraith +%% +If all the world's a stage, I want to operate the trap door. + -- Paul Beatty +%% +If all the world's economists were laid end to end, we wouldn't reach a +conclusion. + -- William Baumol +%% +If an S and an I and an O and a U +With an X at the end spell Su; +And an E and a Y and an E spell I, +Pray what is a speller to do? +Then, if also an S and an I and a G +And an HED spell side, +There's nothing much left for a speller to do +But to go commit siouxeyesighed. + -- Charles Follen Adams, "An Orthographic Lament" +%% +If anything can go wrong, it will. +%% +If at first you don't succeed, give up, no use being a damn fool. +%% +If at first you don't succeed, redefine success. +%% +If bankers can count, how come they have eight windows and only four +tellers? +%% +"If dolphins are so smart, why did Flipper work for television?" +%% +If entropy is increasing, where is it coming from? +%% +If everything is coming your way then you're in the wrong lane. +%% +... if forced to travel on an airplane, try and get in the cabin with +the Captain, so you can keep an eye on him and nudge him if he falls +asleep or point out any mountains looming up ahead ... + -- Mike Harding, "The Armchair Anarchist's Almanac" +%% +If God had intended Man to Smoke, He would have set him on Fire. +%% +If God had intended Man to Walk, He would have given him Feet. +%% +If God had intended Man to Watch TV, He would have given him Rabbit +Ears. +%% +If God had intended Men to Smoke, He would have put Chimneys in their +Heads. +%% +If God had meant for us to be in the Army, we would have been born with +green, baggy skin. +%% +If God had meant for us to be naked, we would have been born that way. +%% +If God had not given us sticky tape, it would have been necessary to +invent it. +%% +If God had wanted you to go around nude, He would have given you bigger +hands. +%% +If God is perfect, why did He create discontinuous functions? +%% +"If God lived on Earth, people would knock out all His windows." + -- Yiddish saying +%% +If I don't drive around the park, +I'm pretty sure to make my mark. +If I'm in bed each night by ten, +I may get back my looks again. +If I abstain from fun and such, +I'll probably amount to much; +But I shall stay the way I am, +Because I do not give a damn. + -- Dorothy Parker +%% +If I had a plantation in Georgia and a home in Hell, I'd sell the +plantation and go home. + -- Eugene P. Gallagher +%% +If I had any humility I would be perfect. + -- Ted Turner +%% +"If I had only known, I would have been a locksmith." + -- Albert Einstein +%% +If I kiss you, that is a psychological interaction. + +On the other hand, if I hit you over the head with a brick, that is +also a psychological interaction. + +The difference is that one is friendly and the other is not so +friendly. + +The crucial point is if you can tell which is which. + -- Dolph Sharp, "I'm O.K., You're Not So Hot" +%% +If I traveled to the end of the rainbow +As Dame Fortune did intend, +Murphy would be there to tell me +The pot's at the other end. + -- Bert Whitney +%% +If ignorance is bliss, why aren't there more happy people? +%% +If it's Tuesday, this must be someone else's fortune. +%% +If Jesus Christ were to come today, people would not even crucify him. +They would ask him to dinner, and hear what he had to say, and make fun +of it. + -- Thomas Carlyle +%% +If life is a stage, I want some better lighting. +%% +If little green men land in your back yard, hide any little green women +you've got in the house. + -- Mike Harding, "The Armchair Anarchist's Almanac" +%% +If mathematically you end up with the wrong answer, try multiplying by +the page number. +%% +If money can't buy happiness, I guess you'll just have to rent it. +%% +If only God would give me some clear sign! Like making a large deposit +in my name at a Swiss bank. + -- Woody Allen, "Without Feathers" +%% +If only I could be respected without having to be respectable. +%% +If only one could get that wonderful feeling of accomplishment without +having to accomplish anything. +%% +If scientific reasoning were limited to the logical processes of +arithmetic, we should not get very far in our understanding of the +physical world. One might as well attempt to grasp the game of poker +entirely by the use of the mathematics of probability. + -- Vannevar Bush +%% +If someone had told me I would be Pope one day, I would have studied +harder. + -- Pope John Paul I +%% +If the code and the comments disagree, then both are probably wrong. + -- Norm Schryer +%% +If the colleges were better, if they really had it, you would need to +get the police at the gates to keep order in the inrushing multitude. +See in college how we thwart the natural love of learning by leaving +the natural method of teaching what each wishes to learn, and insisting +that you shall learn what you have no taste or capacity for. The +college, which should be a place of delightful labor, is made odious +and unhealthy, and the young men are tempted to frivolous amusements to +rally their jaded spirits. I would have the studies elective. +Scholarship is to be created not by compulsion, but by awakening a pure +interest in knowledge. The wise instructor accomplishes this by +opening to his pupils precisely the attractions the study has for +himself. The marking is a system for schools, not for the college; for +boys, not for men; and it is an ungracious work to put on a professor. + -- Ralph Waldo Emerson +%% +"If the King's English was good enough for Jesus, it's good enough for +me!" + -- "Ma" Ferguson, Governor of Texas (circa 1920) +%% +If the odds are a million to one against something occurring, chances +are 50-50 it will. +%% +If the weather is extremely bad, church attendance will be down. If +the weather is extremely good, church attendance will be down. If the +bulletin covers are in short supply, however, church attendance will +exceed all expectations. + -- Reverend Chichester +%% +If there are epigrams, there must be meta-epigrams. +%% +If there is a possibility of several things going wrong, the one that +will cause the most damage will be the one to go wrong. +%% +If there is no God, who pops up the next Kleenex? + -- Art Hoppe +%% +If this fortune didn't exist, somebody would have invented it. +%% +If time heals all wounds, how come the belly button stays the same? +%% +If two men agree on everything, you may be sure that one of them is +doing the thinking. + -- Lyndon Baines Johnson +%% +If we do not change our direction we are likely to end up where we are +headed. +%% +If while you are in school, there is a shortage of qualified personnel +in a particular field, then by the time you graduate with the necessary +qualifications, that field's employment market is glutted. + -- Marguerite Emmons +%% +"If you can count your money, you don't have a billion dollars." + -- J. Paul Getty +%% +If you can lead it to water and force it to drink, it isn't a horse. +%% +If you can survive death, you can probably survive anything. +%% +If you can't be good, be careful. If you can't be careful, give me a +call. +%% +If you can't learn to do it well, learn to enjoy doing it badly. +%% +If you cannot convince them, confuse them. + -- Harry S Truman +%% +If you didn't get caught, did you really do it? +%% +If you don't care where you are, then you ain't lost. +%% +If you explain so clearly that nobody can misunderstand, somebody +will. +%% +If you give Congress a chance to vote on both sides of an issue, it +will always do it. + -- Les Aspin, D., Wisconsin +%% +"If you go on with this nuclear arms race, all you are going to do is +make the rubble bounce" + -- Winston Churchill +%% +If you had any brains, you'd be dangerous. +%% +If you have a procedure with 10 parameters, you probably missed some. +%% +"If you have to hate, hate gently" +%% +If you live in a country run by committee, be on the committee. + -- Graham Summer +%% +If you make people think they're thinking, they'll love you; but if you +really make them think they'll hate you. +%% +If you only have a hammer, you tend to see every problem as a nail. + -- Maslow +%% +If you perceive that there are four possible ways in which a procedure +can go wrong, and circumvent these, then a fifth way will promptly +develop. +%% +If you pick up a starving dog and make him prosperous, he will not bite +you. This is the principal difference between a dog and a man. + -- Mark Twain +%% +If you push the "extra ice" button on the soft drink vending machine, +you won't get any ice. If you push the "no ice" button, you'll get +ice, but no cup. +%% +If you put garbage in a computer nothing comes out but garbage. But +this garbage, having passed through a very expensive machine, is +somehow enobled and none dare criticize it. +%% +If you think education is expensive, try ignorance. + -- Derek Bok, president of Harvard +%% +If you think last Tuesday was a drag, wait till you see what happens +tomorrow! +%% +If you think nobody cares if you're alive, try missing a couple of car +payments. + -- Earl Wilson +%% +If you think the United States has stood still, who built the largest +shopping center in the world? + -- Richard M. Nixon +%% +If you think the United States has stood still, who built the largest +shopping center in the world? + -- Richard Nixon +%% +If you throw a New Year's Party, the worst thing that you can do would +be to throw the kind of party where your guests wake up today, and call +you to say they had a nice time. Now you'll be be expected to throw +another party next year. + +What you should do is throw the kind of party where your guest wake up +several days from now and call their lawyers to find out if they've +been indicted for anything. You want your guests to be so anxious to +avoid a recurrence of your party that they immediately start planning +parties of their own, a year in advance, just to prevent you from +having another one ... + +If your party is successful, the police will knock on your door, unless +your party is very successful in which case they will lob tear gas +through your living room window. As host, your job is to make sure +that they don't arrest anybody. Or if they're dead set on arresting +someone, your job is to make sure it isn't you ... +%% +If you want your spouse to listen and pay strict attention to every +word you say, talk in your sleep. +%% +"If you wants to get elected president, you'se got to think up some +memoraboble homily so's school kids can be pestered into memorizin' +it, even if they don't know what it means." + -- Walt Kelly, "The Pogo Party" +%% +If you're going to do something tonight that you'll be sorry for +tomorrow morning, sleep late. + -- Henny Youngman +%% +If you're happy, you're successful. +%% +If you're not part of the solution, you're part of the precipitate. +%% +If you're not very clever you should be conciliatory. + -- Benjamin Disraeli +%% +If you've done six impossible things before breakfast, why not round it +off with dinner at Milliway's, the restaurant at the end of the +universe? +%% +If you've seen one redwood, you've seen them all. + -- Ronald Reagan +%% +Il brilgue: les t^oves libricilleux + Se gyrent et frillant dans le guave, +Enm^im'es sont les gougebosquex, + Et le m^omerade horgrave. + -- Lewis Carrol, "Through the Looking Glass" +%% +Illinois isn't exactly the land that God forgot -- it's more like the +land He's trying to ignore. +%% +Imagination is the one weapon in the war against reality. + -- Jules de Gaultier +%% +Imagine that Cray computer decides to make a personal computer. It has +a 150 MHz processor, 200 megabytes of RAM, 1500 megabytes of disk +storage, a screen resolution of 1024 x 1024 pixels, relies entirely on +voice recognition for input, fits in your shirt pocket and costs $300. +What's the first question that the computer community asks? + +"Is it PC compatible?" +%% +Immortality -- a fate worse than death. + -- Edgar A. Shoaff +%% +Impartial, adj.: + Unable to perceive any promise of personal advantage from +espousing either side of a controversy or adopting either of two +conflicting opinions. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Important letters which contain no errors will develop errors in the +mail. Corresponding errors will show up in the duplicate while the +Boss is reading it. +%% +In a five year period we can get one superb programming language. Only +we can't control when the five year period will begin. +%% + In a forest a fox bumps into a little rabbit, and says, "Hi, +junior, what are you up to?" + "I'm writing a dissertation on how rabbits eat foxes," said the +rabbit. + "Come now, friend rabbit, you know that's impossible!" + "Well, follow me and I'll show you." They both go into the +rabbit's dwelling and after a while the rabbit emerges with a satisfied +expression on his face. + Comes along a wolf. "Hello, what are we doing these days?" + "I'm writing the second chapter of my thesis, on how rabbits +devour wolves." + "Are you crazy? Where is your academic honesty?" + "Come with me and I'll show you." As before, the rabbit comes +out with a satisfied look on his face and a diploma in his paw. +Finally, the camera pans into the rabbit's cave and, as everybody +should have guessed by now, we see a mean-looking, huge lion sitting +next to some bloody and furry remnants of the wolf and the fox. + +The moral: It's not the contents of your thesis that are important -- +it's your PhD advisor that really counts. +%% +In America, any boy may become president and I suppose that's just one +of the risks he takes. + -- Adlai Stevenson +%% +In an organization, each person rises to the level of his own +incompetency + -- The Peter Principle +%% +In any formula, constants (especially those obtained from handbooks) +are to be treated as variables. +%% +In case of atomic attack, the federal ruling against prayer in schools +will be temporarily canceled. +%% +In case of injury notify your superior immediately. He'll kiss it and +make it better. +%% +"In defeat, unbeatable; in victory, unbearable." + -- Winston Curchill, of Montgomery +%% +In Dr. Johnson's famous dictionary patriotism is defined as the last +resort of the scoundrel. With all due respect to an enlightened but +inferior lexicographer I beg to submit that it is the first. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +In English, every word can be verbed. Would that it were so in our +programming languages. +%% +In India, "cold weather" is merely a conventional phrase and has come +into use through the necessity of having some way to distinguish +between weather which will melt a brass door-knob and weather which +will only make it mushy. + -- Mark Twain +%% +In our civilization, and under our republican form of government, +intelligence is so highly honored that it is rewarded by exemption +from the cares of office. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +In Riemann, Hilbert or in Banach space +Let superscripts and subscripts go their ways. +Our symptotes no longer out of phase, +We shall encounter, counting, face to face. + -- Stanislaw Lem, "Cyberiad" +%% +"In short, _N is Richardian if, and only if, _N is not Richardian." +%% +[In the 60's] there was madness in any direction, at any hour ... You +could strike sparks anywhere. There was a fantastic universal sense +that whatever we were doing was `right', that we were winning ... + +And that, I think, was the handle -- the sense of inevitable victory +over the forces of Old and Evil. Not in any mean or military sense; we +didn't need that. Our energy would simply `prevail'. There was no +point in fighting -- on our side or theirs. We had all the momentum; +we were riding the crest of a high and beautiful wave .... + +So now, less than five years later, you can go up on a steep hill in +Las Vegas and look West, and with the right kind of eyes you can almost +___see the high-water mark -- the place where the wave finally broke and +rolled back. + -- Hunter S. Thompson, "Fear and Loathing in Las Vegas" +%% +In the force if Yoda's so strong, construct a sentence with words in +the proper order then why can't he? +%% +In the land of the dark, the Ship of the Sun is driven by the Grateful +Dead. + -- Egyptian Book of the Dead +%% +In the long run, every program becomes rococo, and then rubble. + -- Alan Perlis +%% +In the olden days in England, you could be hung for stealing a sheep or +a loaf of bread. However, if a sheep stole a loaf of bread and gave it +to you, you would only be tried for receiving, a crime punishable by +forty lashes with the cat or the dog, whichever was handy. If you +stole a dog and were caught, you were punished with twelve rabbit +punches, although it was hard to find rabbits big enough or strong +enough to punch you. + -- Mike Harding, "The Armchair Anarchist's Almanac" +%% +In the Top 40, half the songs are secret messages to the teen world to +drop out, turn on, and groove with the chemicals and light shows at +discotheques. + -- Art Linkletter +%% +Incumbent, n.: + Person of liveliest interest to the outcumbents. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Information Center, n.: + A room staffed by professional computer people whose job it is +to tell you why you cannot have the information you require. +%% +Ingrate, n.: + A man who bites the hand that feeds him, and then complains of +indigestion. +%% +Injustice anywhere is a threat to justice everywhere. + -- Martin Luther King, Jr. +%% +Ink, n.: + A villainous compound of tannogallate of iron, gum-arabic, and +water, chiefly used to facilitate the infection of idiocy and promote +intellectual crime. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Innovation is hard to schedule. + -- Dan Fylstra +%% +Insanity is hereditary. You get it from your kids. +%% +Insanity is the final defense ... It's hard to get a refund when the +salesman is sniffing your crotch and baying at the moon. +%% +Interpreter, n.: + One who enables two persons of different languages to +understand each other by repeating to each what it would have been to +the interpreter's advantage for the other to have said. + -- Ambrose Bierce, "The Devil's Dictionary" +%% + INVENTORY +Four be the things I am wiser to know: +Idleness, sorrow, a friend, and a foe. + +Four be the things I'd been better without: +Love, curiosity, freckles, and doubt. + +Three be the things I shall never attain: +Envy, content, and sufficient champagne. + +Three be the things I shall have till I die: +Laughter and hope and a sock in the eye. +%% +Iron Law of Distribution: + Them that has, gets. +%% +Is it possible that software is not like anything else, that it is +meant to be discarded: that the whole point is to always see it as a +soap bubble? +%% +Is not marriage an open question, when it is alleged, from the +beginning of the world, that such as are in the institution wish to get +out, and such as are out wish to get in? + -- Ralph Emerson +%% +Is your job running? You'd better go catch it! +%% +Isn't it strange that the same people that laugh at gypsy fortune +tellers take economists seriously? +%% +Issawi's Laws of Progress: + + The Course of Progress: + Most things get steadily worse. + + The Path of Progress: + A shortcut is the longest distance between two points. +%% +It has been observed that one's nose is never so happy as when it is +thrust into the affairs of another, from which some physiologists have +drawn the inference that the nose is devoid of the sense of smell. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +It has just been discovered that research causes cancer in rats. +%% +It is against the grain of modern education to teach children to +program. What fun is there in making plans, acquiring discipline in +organizing thoughts, devoting attention to detail, and learning to be +self-critical? + -- Alan Perlis +%% + It is always preferable to visit home with a friend. Your +parents will not be pleased with this plan, because they want you all +to themselves and because in the presence of your friend, they will +have to act like mature human beings ... + -- Playboy, January 1983 +%% +It is amusing that a virtue is made of the vice of chastity; and it's a +pretty odd sort of chastity at that, which leads men straight into the +sin of Onan, and girls to the waning of their color. + -- Voltaire +%% +It is better to kiss an avocado than to get in a fight with an aardvark +%% +It is by the fortune of God that, in this country, we have three +benefits: freedom of speech, freedom of thought, and the wisdom never +to use either. + -- Mark Twain +%% +It is difficult to produce a television documentary that is both +incisive and probing when every twelve minutes one is interrupted by +twelve dancing rabbits singing about toilet paper. + -- R. Serling +%% +"It is easier for a camel to pass through the eye of a needle if it is +lightly greased." + -- Kehlog Albran, "The Profit" +%% +It is easier to change the specification to fit the program than vice +versa. +%% +It is easier to get forgiveness than permission. +%% +It is easier to write an incorrect program than understand a correct +one. +%% +It is generally agreed that "Hello" is an appropriate greeting because +if you entered a room and said "Goodbye," it could confuse a lot of +people. + -- Dolph Sharp, "I'm O.K., You're Not So Hot" +%% +It is impossible to make anything foolproof because fools are so +ingenious. +%% +It is impossible to travel faster than light, and certainly not +desirable, as one's hat keeps blowing off. + -- Woody Allen +%% +It is much easier to suggest solutions when you know nothing about the +problem. +%% +It is not enough to succeed. Others must fail. + -- Gore Vidal +%% +It is not true that life is one damn thing after another -- it's one +damn thing over and over. + -- Edna St. Vincent Millay +%% +It is now 10 p.m. Do you know where Henry Kissinger is? + -- Elizabeth Carpenter +%% +It is now pitch dark. If you proceed, you will likely fall into a +pit. +%% +It is one of the superstitions of the human mind to have imagined that +virginity could be a virtue. + -- Voltaire +%% +It is said that the lonely eagle flies to the mountain peaks while the +lowly ant crawls the ground, but cannot the soul of the ant soar as +high as the eagle? +%% +It is something to be able to paint a particular picture, or to carve a +statue, and so to make a few objects beautiful; but it is far more +glorious to carve and paint the very atmosphere and medium through +which we look, which morally we can do. To affect the quality of the +day, that is the highest of arts. + -- Henry David Thoreau, "Where I Live" +%% +It is the business of little minds to shrink. + -- Carl Sandburg +%% +It is the business of the future to be dangerous. + -- Hawkwind +%% +It looks like blind screaming hedonism won out. +%% +It may be that your whole purpose in life is simply to serve as a +warning to others. +%% +It seems like the less a statesman amounts to, the more he loves the +flag. +%% +"It took me fifteen years to discover that I had no talent for writing, +but I couldn't give up because by that time I was too famous." +%% +It was a book to kill time for those who liked it better dead. +%% +"It was pleasant to me to get a letter from you the other day. Perhaps +I should have found it pleasanter if I had been able to decipher it. I +don't think that I mastered anything beyond the date (which I knew) and +the signature (which I guessed at). There's a singular and a perpetual +charm in a letter of yours; it never grows old, it never loses its +novelty .... Other letters are read and thrown away and forgotten, but +yours are kept forever -- unread. One of them will last a reasonable +man a lifetime." + -- Thomas Aldrich +%% + It was the next morning that the armies of Twodor marched east +laden with long lances, sharp swords, and death-dealing hangovers. The +thousands were led by Arrowroot, who sat limply in his sidesaddle, +nursing a whopper. Goodgulf, Gimlet, and the rest rode by him, praying +for their fate to be quick, painless, and if possible, someone else's. + Many an hour the armies forged ahead, the war-merinos bleating +under their heavy burdens and the soldiers bleating under their melting +icepacks. + -- The Harvard Lampoon, "Bored of the Rings" +%% +It will be advantageous to cross the great stream ... the Dragon is on +the wing in the Sky ... the Great Man rouses himself to his Work. +%% +It's a damn poor mind that can only think of one way to spell a word. + -- Andrew Jackson +%% +"It's bad luck to be superstitious." + -- Andrew W. Mathis +%% +"It's easier said than done." + +... and if you don't believe it, try proving that it's easier done than +said, and you'll see that "it's easier said that `it's easier done than +said' than it is done", which really proves that "it's easier said than +done". +%% +It's easier to fight for one's principles than to live up to them. +%% +It's easier to get forgiveness for being wrong than forgiveness for +being right. +%% +"It's Fabulous! We haven't seen anything like it in the last half an +hour!" + -- Macy's +%% +It's is not, it isn't ain't, and it's it's, not its, if you mean it +is. If you don't, it's its. Then too, it's hers. It isn't her's. It +isn't our's either. It's ours, and likewise yours and theirs. + -- Oxford University Press, Edpress News +%% +It's lucky you're going so slowly, because you're going in the wrong +direction. +%% +It's not an optical illusion, it just looks like one. + -- Phil White +%% +"It's not Camelot, but it's not Cleveland, either." + -- Kevin White, mayor of Boston +%% +It's not enough to be Hungarian; you must have talent too. + -- Alexander Korda +%% +It's not that I'm afraid to die. I just don't want to be there when it +happens. + -- Woody Allen +%% +It's really quite a simple choice: Life, Death, or Los Angeles. +%% + JACK AND THE BEANSTACK + by Mark Isaak + + Long ago, in a finite state far away, there lived a JOVIAL +character named Jack. Jack and his relations were poor. Often their +hash table was bare. One day Jack's parent said to him, "Our matrices +are sparse. You must go to the market to exchange our RAM for some +BASICs." She compiled a linked list of items to retrieve and passed it +to him. + So Jack set out. But as he was walking along a Hamilton path, +he met the traveling salesman. + "Whither dost thy flow chart take thou?" prompted the salesman +in high-level language. + "I'm going to the market to exchange this RAM for some chips +and Apples," commented Jack. + "I have a much better algorithm. You needn't join a queue +there; I will swap your RAM for these magic kernels now." + Jack made the trade, then backtracked to his house. But when +he told his busy-waiting parent of the deal, she became so angry she +started thrashing. + "Don't you even have any artificial intelligence? All these +kernels together hardly make up one byte," and she popped them out the +window ... +%% +Jacquin's Postulate on Democratic Government: + No man's life, liberty, or property are safe while the + legislature is in session. +%% +Jenkinson's Law: + It won't work. +%% +Jesus Saves, +Moses Invests, +But only Buddha pays Dividends. +%% +Joe's sister puts spaghetti in her shoes! +%% +Johnson's First Law: + When any mechanical contrivance fails, it will do so at the + most inconvenient possible time. +%% +Jone's Law: + The man who smiles when things go wrong has thought of someone + to blame it on. +%% +Jone's Motto: + Friends come and go, but enemies accumulate. +%% +Jones's First Law: + Anyone who makes a significant contribution to any field of + endeavor, and stays in that field long enough, becomes an + obstruction to its progress -- in direct proportion to the + importance of their original contribution. +%% +Just because you're paranoid doesn't mean they AREN'T after you. +%% +Just because your doctor has a name for your condition doesn't mean he +knows what it is. +%% +"Just once, I wish we would encounter an alien menace that wasn't +immune to bullets" + -- The Brigader, "Dr. Who" +%% +Just remember: when you go to court, you are trusting your fate to +twelve people that weren't smart enough to get out of jury duty! +%% +Justice is incidental to law and order. + -- J. Edgar Hoover +%% +Justice is incidental to law and order. + -- J. Edgar Hoover +%% +Justice, n.: + A decision in your favor. +%% +Katz' Law: + Man and nations will act rationally when all other + possibilities have been exhausted. +%% +Keep America beautiful. Swallow your beer cans. +%% +Keep emotionally active. Cater to your favorite neurosis. +%% +Keep grandma off the streets -- legalize bingo. +%% +Keep in mind always the two constant Laws of Frisbee: + 1. The most powerful force in the world is that of a disc + straining to land under a car, just out of reach (this + force is technically termed "car suck"). + 2. Never precede any maneuver by a comment more predictive + than "Watch this!" +%% +Keep you Eye on the Ball, +Your Shoulder to the Wheel, +Your Nose to the Grindstone, +Your Feet on the Ground, +Your Head on your Shoulders. +Now ... try to get something DONE! +%% +Ken Thompson has an automobile which he helped design. Unlike most +automobiles, it has neither speedometer, nor gas gage, nor any of the +numerous idiot lights which plague the modern driver. Rather, if the +driver makes any mistake, a giant "?" lights up in the center of the +dashboard. "The experienced driver", he says, "will usually know +what's wrong." +%% +Kerr's Three Rules for a Successful College: + Have plenty of football for the alumni, sex for the students, + and parking for the faculty. +%% +Kin, n.: + An affliction of the blood +%% +Kinkler's First Law: + Responsibility always exceeds authority. + +Kinkler's Second Law: + All the easy problems have been solved. +%% +"Kirk to Enterprise -- beam down yeoman Rand and a six-pack." +%% +Kiss me twice. I'm schizophrenic. +%% +Kiss your keyboard goodbye! +%% +Klein bottle for rent -- inquire within. +%% +Klein bottle for sale ... inquire within. +%% +Kleptomaniac, n.: + A rich thief. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Know thyself. If you need help, call the C.I.A. +%% +Know what I hate most? Rhetorical questions. + -- Henry N. Camp +%% +Krogt, n. (chemical symbol: Kr): + The metallic silver coating found on fast-food game cards. + -- Rich Hall, "Sniglets" +%% +Labor, n.: + One of the processes by which A acquires property for B. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Lackland's Laws: + 1. Never be first. + 2. Never be last. + 3. Never volunteer for anything +%% +Lactomangulation, n.: + Manhandling the "open here" spout on a milk carton so badly +that one has to resort to using the "illegal" side. + -- Rich Hall, "Sniglets" +%% +Laetrile is the pits +%% +Langsam's Laws: + 1) Everything depends. + 2) Nothing is always. + 3) Everything is sometimes. +%% +Larkinson's Law: + All laws are basically false. +%% + Lassie looked brilliant, in part because the farm family she +lived with was made up of idiots. Remember? One of them was always +getting pinned under the tractor, and Lassie was always rushing back to +the farmhouse to alert the other ones. She'd whimper and tug at their +sleeves, and they'd always waste precious minutes saying things: "Do +you think something's wrong? Do you think she wants us to follow her? +What is it, girl?", etc., as if this had never happened before, instead +of every week. What with all the time these people spent pinned under +the tractor, I don't see how they managed to grow any crops +whatsoever. They probably got by on federal crop supports, which +Lassie filed the applications for. + -- Dave Barry +%% +Laugh at your problems; everybody else does. +%% +"Laughter is the closest distance between two people." + -- Victor Borge +%% +Law of Communications: + The inevitable result of improved and enlarged communications + between different levels in a hierarchy is a vastly increased + area of misunderstanding. +%% +Law of Probable Dispersal: + Whatever it is that hits the fan will not be evenly + distributed. +%% +Law of Selective Gravity: + An object will fall so as to do the most damage. + +Jenning's Corollary: + The chance of the bread falling with the buttered side down is + directly proportional to the cost of the carpet. +%% +Law of the Perversity of Nature: + You cannot successfully determine beforehand which side of the + bread to butter. +%% +Laws of Serendipity: + + 1. In order to discover anything, you must be looking for + something. + 2. If you wish to make an improved product, you must already + be engaged in making an inferior one. +%% +Lazlo's Chinese Relativity Axiom: + No matter how great your triumphs or how tragic your defeats -- + approximately one billion Chinese couldn't care less. +%% +Left to themselves, things tend to go from bad to worse. +%% +Leibowitz's Rule: + When hammering a nail, you will never hit your finger if you + hold the hammer with both hands. +%% +LEO (July 23 - Aug 22) + Your determination and sense of humor will come to the fore. + Your ability to laugh at adversity will be a blessing because + you've got a day coming you wouldn't believe. As a matter of + fact, if you can laugh at what happens to you today, you've got + a sick sense of humor. +%% + LEO (July 23 - Aug 22) +You consider yourself a born leader. Others think you are pushy. Most +Leo people are bullies. You are vain and dislike honest criticism. +Your arrogance is disgusting. Leo people are thieves. +%% +Let He who taketh the Plunge Remember to return it by Tuesday. +%% +Let us live!!! +Let us love!!! +Let us share the deepest secrets of our souls!!! + +You first. +%% +Let's talk about how to fill out your 1984 tax return. Here's an often +overlooked accounting technique that can save you thousands of dollars: +For several days before you put it in the mail, carry your tax return +around under your armpit. No IRS agent is going to want to spend hours +poring over a sweat-stained document. So even if you owe money, you +can put in for an enormous refund and the agent will probably give it +to you, just to avoid an audit. What does he care? It's not his +money. + -- Dave Barry, "Sweating Out Taxes" +%% +LETTERS TO THE EDITOR (The Times of London) + +Dear Sir, + +I am firmly opposed to the spread of microchips either to the home or +to the office. We have more than enough of them foisted upon us in +public places. They are a disgusting Americanism, and can only result +in the farmers being forced to grow smaller potatoes, which in turn +will cause massive unemployment in the already severely depressed +agricultural industry. + +Yours faithfully, + Capt. Quinton D'Arcy, J. P. + Sevenoaks +%% +Lewis's Law of Travel: + The first piece of luggage out of the chute doesn't belong to + anyone, ever. +%% +Liar, n.: + A lawyer with a roving commission. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +LIBRA (Sep. 23 to Oct. 22) + Your desire for justice and truth will be overshadowed by your + desire for filthy lucre and a decent meal. Be gracious and + polite. Someone is watching you, so stop staring like that. +%% + LIBRA (Sept 23 - Oct 22) +You are the artistic type and have a difficult time with reality. If +you are a man, you are more than likely gay. Chances for employment +and monetary gains are excellent. Most Libra women are prostitutes. +All Libra people die of Venereal disease. +%% +Lie, n.: + A very poor substitute for the truth, but the only one +discovered to date. +%% +Lieberman's Law: + Everybody lies, but it doesn't matter since nobody listens. +%% +Life is a whim of several billion cells to be you for a while. +%% +Life is a yo-yo, and mankind ties knots in the string. +%% +Life is like an onion: you peel off layer after layer, then you find +there is nothing in it. +%% +"Life may have no meaning -- or even worse, it may have a meaning of +which I disapprove." +%% +Like so many Americans, she was trying to construct a life that made +sense from things she found in gift shops. + -- Kurt Vonnegut, Jr. +%% +Like the ski resort of girls looking for husbands and husbands looking +for girls, the situation is not as symmetrical as it might seem. + -- Alan McKay +%% +Limericks are art forms complex, +Their topics run chiefly to sex. + They usually have virgins, + And masculine urgin's, +And other erotic effects. +%% +Line Printer paper is strongest at the perforations. +%% +Linus: I guess it's wrong always to be worrying about tomorrow. Maybe + we should think only about today. +Charlie Brown: + No, that's giving up. I'm still hoping that yesterday will get + better. +%% +Living on Earth may be expensive, but it includes an annual free trip +around the Sun. +%% +Living your life is a task so difficult, it has never been attempted +before. +%% +Lizzie Borden took an axe, +And plunged it deep into the VAX; +Don't you envy people who +Do all the things ___YOU want to do? +%% +Lockwood's Long Shot: + The chances of getting eaten up by a lion on Main Street aren't + one in a million, but once would be enough. +%% +Look out! Behind you! +%% +Losing your drivers' license is just God's way of saying "BOOGA, BOOGA!" +%% +Love at first sight is one of the greatest labor-saving devices the +world has ever seen. +%% +Love is a word that is constantly heard, +Hate is a word that is not. +Love, I am told, is more precious than gold. +Love, I have read, is hot. +But hate is the verb that to me is superb, +And Love but a drug on the mart. +Any kiddie in school can love like a fool, +But Hating, my boy, is an Art. + -- Ogden Nash +%% +Love is sentimental measles. +%% +Love is the triumph of imagination over intelligence. + -- H. L. Mencken +%% +Love your enemies: they'll go crazy trying to figure out what you're up +to. +%% + Love's Drug + +My love is like an iron wand + That conks me on the head, +My love is like the valium + That I take before me bed, +My love is like the pint of scotch + That I drink when i be dry; +And I shall love thee still my dear, + Until my wife is wise. +%% +Lowery's Law: + If it jams -- force it. If it breaks, it needed replacing + anyway. +%% +LSD melts in your mind, not in your hand. +%% +Lubarsky's Law of Cybernetic Entomology: + There's always one more bug. +%% +Lunatic Asylum, n.: + The place where optimism most flourishes. +%% +Lysistrata had a good idea. +%% +"MacDonald has the gift on compressing the largest amount of words into +the smallest amount of thoughts." + -- Winston Churchill +%% +Mad, adj.: + Affected with a high degree of intellectual independence ... + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Madam, there's no such thing as a tough child -- if you parboil them +first for seven hours, they always come out tender. + -- W. C. Fields +%% +Magnet, n.: Something acted upon by magnetism + +Magnetism, n.: Something acting upon a magnet. + +The two definition immediately foregoing are condensed from the works +of one thousand eminent scientists, who have illuminated the subject +with a great white light, to the inexpressible advancement of human +knowledge. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Magnocartic, adj.: + Any automobile that, when left unattended, attracts shopping +carts. + -- Sniglets, "Rich Hall & Friends" +%% +Magpie, n.: + A bird whose theivish disposition suggested to someone that it +might be taught to talk. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Maier's Law: + If the facts do not conform to the theory, they must be + disposed of. + +Corollaries: + 1. The bigger the theory, the better. + 2. The experiment may be considered a success if no more than + 50% of the observed measurements must be discarded to + obtain a correspondence with the theory. +%% +Main's Law: + For every action there is an equal and opposite government + program. +%% +Maintainer's Motto: + If we can't fix it, it ain't broke. +%% +Major Premise: Sixty men can do a piece of work sixty times as quickly + as one man. + +Minor Premise: One man can dig a posthole in sixty seconds. + +Conclusion: Sixty men can dig a posthole in one second. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Majority, n.: + That quality that distinguishes a crime from a law. +%% +Making files is easy under the UNIX operating system. Therefore, users +tend to create numerous files using large amounts of file space. It +has been said that the only standard thing about all UNIX systems is +the message-of-the-day telling users to clean up their files. + -- System V.2 administrator's guide +%% +Malek's Law: + Any simple idea will be worded in the most complicated way. +%% +"Man invented language to satisfy his deep need to complain." + -- Lily Tomlin +%% +Man is a rational animal who always loses his temper when he is called +upon to act in accordance with the dictates of reason. + -- Oscar Wilde +%% +Man is the best computer we can put aboard a spacecraft ... and the +only one that can be mass produced with unskilled labor. + -- Wernher von Braun +%% +Man is the only animal that blushes -- or needs to. + -- Mark Twain +%% +Man usually avoids attributing cleverness to somebody else -- +unless it is an enemy. + -- A. Einstein +%% +Man, n.: + An animal so lost in rapturous contemplation of what he thinks +he is as to overlook what he indubitably ought to be. His chief +occupation is extermination of other animals and his own species, +which, however, multiplies with such insistent rapidity as to infest +the whole habitable earth and Canada. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Mankind's yearning to engage in sports is older than recorded history, +dating back to the time millions of years ago, when the first primitive +man picked up a crude club and a round rock, tossed the rock into the +air, and whomped the club into the sloping forehead of the first +primitive umpire. + +What inner force drove this first athlete? Your guess is as good as +mine. Better, probably, because you haven't had four beers. + -- Dave Barry, "Sports is a Drag" +%% +Manual, n.: + A unit of documentation. There are always three or more on a +given item. One is on the shelf; someone has the others. The +information you need in in the others. + -- Ray Simard +%% +Many years ago in a period commonly know as Next Friday Afternoon, +there lived a King who was very Gloomy on Tuesday mornings because he +was so Sad thinking about how Unhappy he had been on Monday and how +completely Mournful he would be on Wednesday ... + -- Walt Kelly +%% +Mark's Dental-Chair Discovery: + Dentists are incapable of asking questions that require a + simple yes or no answer. +%% +Marriage is the only adventure open to the cowardly. + -- Voltaire +%% +"Matrimony isn't a word, it's a sentence." +%% +Matter cannot be created or destroyed, nor can it be returned without a +receipt. +%% +Maturity is only a short break in adolescence. + -- Jules Feiffer +%% +May a Misguided Platypus lay its Eggs in your Jockey Shorts +%% +May Euell Gibbons eat your only copy of the manual! +%% +May the Fleas of a Thousand Camels infest one of your Erogenous Zones. +%% +May your Tongue stick to the Roof of your Mouth with the Force of a +Thousand Caramels. +%% +Maybe Computer Science should be in the College of Theology. + -- R. S. Barton +%% +Maybe you can't buy happiness, but these days you can certainly charge +it. +%% +Mayor Vincent J. `Buddy' Cianci on the ACLU's suit to have a city +nativity scene removed: + "They're just jealous because they don't have three wise men + and a virgin in the whole organization." +%% +McGowan's Madison Avenue Axiom: + If an item is advertised as "under $50", you can bet it's not + $19.95. +%% +Meader's Law: + Whatever happens to you, it will previously have happened to + everyone you know, only more so. +%% +Measure with a micrometer. Mark with chalk. Cut with an axe. +%% +Meeting, n.: + An assembly of people coming together to decide what person or +department not represented in the room must solve a problem. +%% +Men were real men, women were real women, and small, furry creatures +from Alpha Centauri were REAL small, furry creatures from Alpha +Centauri. Spirits were brave, men boldly split infinitives that no man +had split before. Thus was the Empire forged. + -- "The Hitchhiker's Guide to the Galaxy", Douglas Adams +%% +Mencken and Nathan's Fifteenth Law of The Average American: + The worst actress in the company is always the manager's wife. +%% +Mencken and Nathan's Ninth Law of The Average American: + The quality of a champagne is judged by the amount of noise the + cork makes when it is popped. +%% +Mencken and Nathan's Second Law of The Average American: + All the postmasters in small towns read all the postcards. +%% +Mencken and Nathan's Sixteenth Law of The Average American: + Milking a cow is an operation demanding a special talent that + is possessed only by yokels, and no person born in a large city + can never hope to acquire it. +%% +Menu, n.: + A list of dishes which the restaurant has just run out of. +%% +Meskimen's Law: + There's never time to do it right, but there's always time to + do it over. +%% +Message will arrive in the mail. Destroy, before the FBI sees it. +%% +Mickey Mouse wears a Spiro Agnew watch. +%% +Micro Credo: + Never trust a computer bigger than you can lift. +%% +"Might as well be frank, monsieur. It would take a miracle to get you +out of Casablanca and the Germans have outlawed miracles." +%% +Miksch's Law: + If a string has one end, then it has another end. +%% +Military intelligence is a contradiction in terms. + -- Groucho Marx +%% +Military justice is to justice what military music is to music. + -- Groucho Marx +%% +Millions long for immortality who do not know what to do with +themselves on a rainy Sunday afternoon. + -- Susan Ertz +%% +Millions of sensible people are too high-minded to concede that +politics is almost always the choice of the lesser evil. "Tweedledum +and Tweedledee," they say, "I will not vote." Having abstained, they +are presented with a President who appoints the people who are going to +rummage around in their lives for the next four years. Consider all +the people who sat home in a stew in 1968 rather than vote for Hubert +Humphrey. They showed Humphrey. Those people who taught Hubert +Humphrey a lesson will still be enjoying the Nixon Supreme Court when +Tricia and Julie begin to find silver threads among the gold and the +black. + -- Russel Baker, "Ford without Flummery" +%% +Mind! I don't mean to say that I know, of my own knowledge, what there +is particularly dead about a door-nail. I might have been inclined, +myself, to regard a coffin-nail as the deadest piece of ironmongery in +the trade. But the wisdom of our ancestors is in the simile; and my +unhallowed hands shall not disturb it, or the Country's done for. You +will therefore permit me to repeat, emphatically, that Marley was as +dead as a door-nail. +%% +Minnie Mouse is a slow maze learner. +%% +Misery loves company, but company does not reciprocate. +%% +Misfortune, n.: + The kind of fortune that never misses. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Miss, n.: + A title with which we brand unmarried women to indicate that +they are in the market. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Mistakes are often the stepping stones to utter failure. +%% +Mitchell's Law of Committees: + Any simple problem can be made insoluble if enough meetings are + held to discuss it. +%% +MOCK APPLE PIE (No Apples Needed) + + Pastry to two crust 9-inch pie 36 RITZ Crackers +2 cups water 2 cups sugar +2 teaspoons cream of tartar 2 tablespoons lemon juice + Grated rind of one lemon Butter or margarine + Cinnamon + +Roll out bottom crust of pastry and fit into 9-inch pie plate. Break +RITZ Crackers coarsely into pastry-lined plate. Combine water, sugar +and cream of tartar in saucepan, boil gently for 15 minutes. Add lemon +juice and rind. Cool. Pour this syrup over Crackers, dot generously +with butter or margarine and sprinkle with cinnamon. Cover with top +crust. Trim and flute edges together. Cut slits in top crust to let +steam escape. Bake in a hot oven (425 F) 30 to 35 minutes, until crust +is crisp and golden. Serve warm. Cut into 6 to 8 slices. + -- Found lurking on a Ritz Crackers box +%% +Modern man is the missing link between apes and human beings. +%% +Molecule, n.: + The ultimate, indivisible unit of matter. It is distinguished +from the corpuscle, also the ultimate, indivisible unit of matter, by a +closer resemblance to the atom, also the ultimate, indivisible unit of +matter ... The ion differs from the molecule, the corpuscle and the +atom in that it is an ion ... + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Mollison's Bureaucracy Hypothesis: + If an idea can survive a bureaucratic review and be implemented + it wasn't worth doing. +%% +Monday is an awful way to spend one seventh of your life. +%% +Monday, n.: + In Christian countries, the day after the baseball game. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Money is the root of all evil, and man needs roots +%% +Mophobia, n.: + Fear of being verbally abused by a Mississippian. +%% + MORE SPORTS RESULTS: +The Beverly Hills Freudians tied the Chicago Rogerians 0-0 last +Saturday night. The match started with a long period of silence while +the Freudians waited for the Rogerians to free associate and the +Rogerians waited for the Freudians to say something they could +paraphrase. The stalemate was broken when the Freudians' best player +took the offensive and interpreted the Rogerians' silence as reflecting +their anal-retentive personalities. At this the Rogerians' star player +said "I hear you saying you think we're full of ka-ka." This started a +fight and the match was called by officials. +%% +More than any time in history, mankind now faces a crossroads. One +path leads to despair and utter hopelessness, the other to total +extinction. Let us pray that we have the wisdom to choose correctly. + -- Woody Allen +%% +Mosher's Law of Software Engineering: + Don't worry if it doesn't work right. If everything did, you'd + be out of a job. +%% +Most people wouldn't know music if it came up and bit them on the ass. + -- Frank Zappa +%% +Mother told me to be good, but she's been wrong before. +%% +Mr. Cole's Axiom: + The sum of the intelligence on the planet is a constant; the + population is growing. +%% +Murphy's Discovery: + Do you know Presidents talk to the country the way men talk to + women? They say, "Trust me, go all the way with me, and + everything will be all right." And what happens? Nine months + later, you're in trouble! +%% +Murphy's Law is recursive. Washing your car to make it rain doesn't +work. +%% +Murphy's Law of Research: + Enough research will tend to support your theory. +%% + Murray and Esther, a middle-aged Jewish couple, are touring +Chile. Murray just got a new camera and is constantly snapping +pictures. One day, without knowing it, he photographs a top-secret +military installation. In an instant, armed troops surround Murray and +Esther and hustle them off to prison. + They can't prove who they are because they've left their +passports in their hotel room. For three weeks they're tortured day +and night to get them to name their contacts in the liberation +movement.. Finally they're hauled in front of a military court, +charged with espionage, and sentenced to death. + The next morning they're lined up in front of the wall where +they'll be shot. The sergeant in charge of the firing squad asks them +if they have any lasts requests. Esther wants to know if she can call +her daughter in Chicago. The sergeant says he's sorry, that's not +possible, and turns to Murray. + "This is crazy!" Murray shouts. "We're not spies!" And he +spits in the sergeants face. + "Murray!" Esther cries. "Please! Don't make trouble." + -- Arthur Naiman, "Every Goy's Guide to Yiddish" +%% +Mustgo, n.: + Any item of food that has been sitting in the refrigerator so +long it has become a science project. + -- Sniglets, "Rich Hall & Friends" +%% +My God, I'm depressed! Here I am, a computer with a mind a thousand +times as powerful as yours, doing nothing but cranking out fortunes and +sending mail about softball games. And I've got this pain right +through my ALU. I've asked for it to be replaced, but nobody ever +listens. I think it would be better for us both if you were to just +log out again. +%% +My love runs by like a day in June, + And he makes no friends of sorrows. +He'll tread his galloping rigadoon + In the pathway or the morrows. +He'll live his days where the sunbeams start + Nor could storm or wind uproot him. +My own dear love, he is all my heart -- + And I wish somebody'd shoot him. + -- Dorothy Parker +%% +My love, he's mad, and my love, he's fleet, + And a wild young wood-thing bore him! +The ways are fair to his roaming feet, + And the skies are sunlit for him. +As sharply sweet to my heart he seems + As the fragrance of acacia. +My own dear love, he is all my dreams -- + And I wish he were in Asia. + -- Dorothy Parker +%% +My opinions may have changed, but not the fact that I am right. +%% +My own dear love, he is strong and bold + And he cares not what comes after. +His words ring sweet as a chime of gold, + And his eyes are lit with laughter. +He is jubilant as a flag unfurled -- + Oh, a girl, she'd not forget him. +My own dear love, he is all my world -- + And I wish I'd never met him. + -- Dorothy Parker +%% +"My weight is perfect for my height -- which varies" +%% +Mythology, n.: + The body of a primitive people's beliefs concerning its +origin, early history, heroes, deities and so forth, as distinguished +from the true accounts which it invents later. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Naeser's Law: + You can make it foolproof, but you can't make it + damnfoolproof. +%% +NAPOLEON: What shall we do with this soldier, Guiseppe? Everything he + says is wrong. +GUISEPPE: Make him a general, Excellency, and then everything he says + will be right. + -- G. B. Shaw, "The Man of Destiny" +%% +Nature and nature's laws lay hid in night, +God said, "Let Newton be," and all was light. + +It did not last; the devil howling "Ho! +Let Einstein be!" restored the status quo. +%% +Nearly all men can stand adversity, but if you want to test a man's +character, give him power. + -- Abraham Lincoln +%% +Necessity is a mother. +%% +Never be led astray onto the path of virtue. +%% +Never call a man a fool. Borrow from him. +%% +Never call a man a fool; borrow from him. +%% +Never count your chickens before they rip your lips off +%% +Never drink coke in a moving elevator. The elevator's motion coupled +with the chemicals in coke produce hallucinations. People tend to +change into lizards and attack without warning, and large bats usually +fly in the window. Additionally, you begin to believe that elevators +have windows. +%% +Never eat more than you can lift. + -- Miss Piggy +%% +Never hit a man with glasses. Hit him with a baseball bat. +%% +Never let your sense of morals prevent you from doing what is right. + -- Salvor Hardin, "Foundation" +%% +Never make anything simple and efficient when a way can be found to +make it complex and wonderful. +%% +Never offend people with style when you can offend them with +substance. + -- Sam Brown, "The Washington Post", January 26, 1977 +%% +Never put off till tomorrow what you can avoid all together. +%% +Never try to outstubborn a cat. + -- Lazarus Long, "Time Enough for Love" +%% +Never worry about theory as long as the machinery does what it's +supposed to do. + -- R. A. Heinlein +%% +New crypt. See /usr/news/crypt. +%% +New members are urgently needed in the Society for Prevention of +Cruelty to Yourself. Apply within. +%% +New systems generate new problems. +%% +New Year's Eve is the time of year when a man most feels his age, and +his wife most often reminds him to act it. + -- Webster's Unafraid Dictionary +%% +New York is real. The rest is done with mirrors. +%% +New York's got the ways and means; +Just won't let you be. + -- The Grateful Dead +%% +Newlan's Truism: + An "acceptable" level of unemployment means that the government + economist to whom it is acceptable still has a job. +%% +NEWS FLASH!! + Today the East German pole-vault champion became the West + German pole-vault champion. +%% + *** NEWSFLASH *** +Russian tanks steamrolling through New Jersey!!!! Details at eleven! +%% +Newton's Fourth Law: Every action has an equal and opposite satisfaction. +%% +Newton's Little-Known Seventh Law: + A bird in the hand is safer than one overhead. +%% +Next Friday will not be your lucky day. As a matter of fact, you don't +have a lucky day this year. +%% +Next to being shot at and missed, nothing is really quite as satisfying +as an income tax refund. + -- F. J. Raymond +%% +Nihilism should commence with oneself. +%% +Niklaus Wirth has lamented that, whereas Europeans pronounce his name +correctly (Ni-klows Virt), Americans invariably mangle it into +(Nick-les Worth). Which is to say that Europeans call him by name, but +Americans call him by value. +%% +Nine megs for the secretaries fair, +Seven megs for the hackers scarce, +Five megs for the grads in smoky lairs, +Three megs for system source; + +One disk to rule them all, +One disk to bind them, +One disk to hold the files +And in the darkness grind 'em. +%% +Ninety-Ninety Rule of Project Schedules: + The first ninety percent of the task takes ninety percent of + the time, and the last ten percent takes the other ninety + percent. +%% +No good deed goes unpunished. + -- Clare Boothe Luce +%% +No man is an island, but some of us are long peninsulas. +%% +No one can make you feel inferior without your consent. + -- Eleanor Roosevelt +%% +No problem is so formidable that you can't just walk away from it. +%% +No problem is so large it can't be fit in somewhere. +%% +NOBODY EXPECTS THE SPANISH INQUISITION +%% +Nobody wants constructive criticism. It's all we can do to put up with +constructive praise. +%% +Non-Reciprocal Laws of Expectations: + Negative expectations yield negative results. + Positive expectations yield negative results. +%% +Noncombatant, n.: + A dead Quaker. + -- Ambrose Bierce +%% +Nondeterminism means never having to say you are wrong. +%% +"Nondeterminism means never having to say you are wrong." +%% +Nostalgia isn't what it used to be. +%% +Not far from here, by a white sun, behind a green star, lived the +Steelypips, illustrious, industrious, and they hadn't a care: no spats +in their vats, no rules, no schools, no gloom, no evil influence of the +moon, no trouble from matter or antimatter -- for they had a machine, +a dream of a machine, with springs and gears and perfect in every +respect. And they lived with it, and on it, and under it, and inside +it, for it was all they had -- first they saved up all their atoms, +then they put them all together, and if one didn't fit, why they +chipped at it a bit, and everything was just fine ... + -- Stanislaw Lem, "Cyberiad" +%% +"Not only is this incomprehensible, but the ink is ugly and the paper +is from the wrong kind of tree." + --Profesoor W. +%% +Notes for a ballet, "The Spell": ... Suddenly Sigmund hears the flutter +of wings, and a group of wild swans flies across the moon ... Sigmund +is astounded to see that their leader is part swan and part woman -- +unfortunately, divided lengthwise. She enchants Sigmund, who is +careful not to make any poultry jokes ... + -- Woody Allen +%% +Nothing astonishes men so much as common sense and plain dealing. +%% +Nothing cures insomnia like the realization that it's time to get up. +%% +Nothing is faster than the speed of light ... + +To prove this to yourself, try opening the refrigerator door before +the light comes on. +%% +Nothing is illegal if one hundred businessmen decide to do it. + -- Andrew Young +%% +Nothing recedes like success. + -- Walter Winchell +%% +Nothing takes the taste out of peanut butter quite like unrequited +love. + -- Charlie Brown +%% +November, n.: + The eleventh twelfth of a weariness. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Now and then an innocent person is sent to the legislature. +%% +Now and then, an innocent man is sent to the Legislature. +%% +Now I lay me down to sleep +I pray the double lock will keep; +May no brick through the window break, +And, no one rob me till I awake. +%% +"Now is the time for all good men to come to." + -- Walt Kelly +%% +Now that you've read Fortune's diet truths, you'll be prepared the next +time some housewife or boutique-owner-turned-diet-expert appears on TV +to plug her latest book. And, if you still feel a twinge of guilt for +eating coffee cake while listening to her exhortations, ask yourself +the following questions: + +1: Do I dare trust a person who actually considers alfalfa sprouts + a food? +2: Was the author's sole motive in writing this book to get rich + exploiting the forlorn hopes of chubby people like me? +3: Would a longer life be worthwhile if it had to be lived as + prescribed ... without French-fried onion rings, pizza with + double cheese, or the occasional Mai-Tai? (Remember, living + right doesn't really make you live longer, it just *seems* like + longer.) + +That, and another piece of coffee cake, should do the trick. +%% +"Now the Lord God planted a garden East of Whittier in a place called +Yorba Linda, and out of the ground he made to grow orange trees that +were good for food and the fruits thereof he labeled SUNKIST ..." + -- "The Begatting of a President" +%% +... Now you're ready for the actual shopping. Your goal should be to +get it over with as quickly as possible, because the longer you stay in +the mall, the longer your children will have to listen to holiday songs +on the mall public-address system, and many of these songs can damage +children emotionally. For example: "Frosty the Snowman" is about a +snowman who befriends some children, plays with them until they learn +to love him, then melts. And "Rudolph the Red-Nosed Reindeer" is about +a young reindeer who, because of a physical deformity, is treated as an +outcast by the other reindeer. Then along comes good, old Santa. Does +he ignore the deformity? Does he look past Rudolph's nose and respect +Rudolph for the sensitive reindeer he is underneath? No. Santa asks +Rudolph to guide his sleigh, as if Rudolph were nothing more than some +kind of headlight with legs and a tail. So unless you want your +children exposed to this kind of insensitivity, you should shop +quickly. + -- Dave Barry, "Christmas Shopping: A Survivor's Guide" +%% +[Nuclear war] ... may not be desirable. + -- Edwin Meese III +%% +Nudists are people who wear one-button suits. +%% +Numeric stability is probably not all that important when you're +guessing. +%% +O give me a home, +Where the buffalo roam, +Where the deer and the antelope play, +Where seldom is heard +A discouraging word, +'Cause what can an antelope say? +%% +O'Toole's commentary on Murphy's Law: + "Murphy was an optimist." +%% +O'Toole's Commentary on Murphy's Law: + Murphy was an optimist. +%% +"Of ______course it's the murder weapon. Who would frame someone with a +fake?" +%% +Of all the animals, the boy is the most unmanageable. + -- Plato +%% +Of course there's no reason for it, it's just our policy. +%% +Office Automation, n.: + The use of computers to improve efficiency by removing anyone +you would want to talk with over coffee. +%% +Ogden's Law: + The sooner you fall behind, the more time you have to catch + up. +%% +Oh don't the days seem lank and long + When all goes right and none goes wrong, +And isn't your life extremely flat + With nothing whatever to grumble at! +%% +Oh, well, I guess this is just going to be one of those lifetimes. +%% +Oh, when I was in love with you, + Then I was clean and brave, +And miles around the wonder grew + How well did I behave. + +And now the fancy passes by, + And nothing will remain, +And miles around they'll say that I + Am quite myself again. + -- A. E. Housman +%% +Oh, wow! Look at the moon! +%% +Old age is the most unexpected of things that can happen to a man. + -- Trotsky +%% +Old age is the most unexpected of things that can happen to a man. + -- Trotsky +%% +Old programmers never die. They just branch to a new address. +%% +Old soldiers never die. Young ones do. +%% +Oliver's Law: + Experience is something you don't get until just after you need + it. +%% +On a paper submitted by a physicist colleague: + +"This isn't right. This isn't even wrong." + -- Wolfgang Pauli +%% + On his first day as a bus driver, Maxey Eckstein handed in +receipts of $65. The next day his take was $67. The third day's +income was $62. But on the fourth day, Eckstein emptied no less than +$283 on the desk before the cashier. + "Eckstein!" exclaimed the cashier. "This is fantastic. That +route never brought in money like this! What happened?" + "Well, after three days on that cockamamie route, I figured +business would never improve, so I drove over to Fourteenth Street and +worked there. I tell you, that street is a gold mine!" +%% +On Monday mornings I am dedicated to the proposition that all men are +created jerks. + -- H. Allen Smith, "Let the Crabgrass Grow" +%% +On-line, adj.: + The idea that a human being should always be accessible to a +computer. +%% +Once ... in the wilds of Afghanistan, I lost my corkscrew, and we were +forced to live on nothing but food and water for days. + -- W. C. Fields, "My Little Chickadee" +%% +Once again, we come to the Holiday Season, a deeply religious time that +each of us observes, in his own way, by going to the mall of his +choice. + +In the old days, it was not called the Holiday Season; the Christians +called it "Christmas" and went to church; the Jews called it "Hanukka" +and went to synagogue; the atheists went to parties and drank. People +passing each other on the street would say "Merry Christmas!" or "Happy +Hanukka!" or (to the atheists) "Look out for the wall!" + -- Dave Barry, "Christmas Shopping: A Survivor's Guide" +%% +Once Law was sitting on the bench + And Mercy knelt a-weeping. +"Clear out!" he cried, "disordered wench! + Nor come before me creeping. +Upon you knees if you appear, +'Tis plain you have no standing here." + +Then Justice came. His Honor cried: + "YOUR states? -- Devil seize you!" +"Amica curiae," she replied -- + "Friend of the court, so please you." +"Begone!" he shouted -- "There's the door -- +I never saw your face before!" + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Once the realization is accepted that even between the closest human +beings infinite distances continue to exist, a wonderful living side by +side can grow up, if they succeed in loving the distance between them +which makes it possible for each to see each other whole against the +sky. + -- Rainer Rilke +%% + Once there lived a village of creatures along the bottom of a +great crystal river. Each creature in its own manner clung tightly to +the twigs and rocks of the river bottom, for clinging was their way of +life, and resisting the current what each had learned from birth. But +one creature said at last, "I trust that the current knows where it is +going. I shall let go, and let it take me where it will. Clinging, I +shall die of boredom." + The other creatures laughed and said, "Fool! Let go, and that +current you worship will throw you tumbled and smashed across the +rocks, and you will die quicker than boredom!" + But the one heeded them not, and taking a breath did let go, +and at once was tumbled and smashed by the current across the rocks. +Yet, in time, as the creature refused to cling again, the current +lifted him free from the bottom, and he was bruised and hurt no more. + And the creatures downstream, to whom he was a stranger, cried, +"See a miracle! A creature like ourselves, yet he flies! See the +Messiah, come to save us all!" And the one carried in the current +said, "I am no more Messiah than you. The river delight to lift us +free, if only we dare let go. Our true work is this voyage, this +adventure. + But they cried the more, "Saviour!" all the while clinging to +the rocks, making legends of a Saviour. +%% +Once upon a time, when I was training to be a mathematician, a group of +us bright young students taking number theory discovered the names of +the smaller prime numbers. + +2: The Odd Prime -- + It's the only even prime, therefore is odd. QED. +3: The True Prime -- + Lewis Carroll: "If I tell you 3 times, it's true." +31: The Arbitrary Prime -- + Determined by unanimous unvote. We needed an arbitrary prime + in case the prof asked for one, and so had an election. 91 + received the most votes (well, it *looks* prime) and 3+4i the + next most. However, 31 was the only candidate to receive none + at all. + +Since the composite numbers are formed from primes, their qualities are +derived from those primes. So, for instance, the number 6 is "odd but +true", while the powers of 2 are all extremely odd numbers. +%% +... Once you're safely in the mall, you should tie your children to you +with ropes so the other shoppers won't try to buy them. Holiday +shoppers have been whipped into a frenzy by months of holiday +advertisements, and they will buy anything small enough to stuff into a +shopping bag. If your children object to being tied, threaten to take +them to see Santa Claus; that ought to shut them up. + -- Dave Barry, "Christmas Shopping: A Survivor's Guide" +%% +Once, adv.: + Enough. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +One can't proceed from the informal to the formal by formal means. +%% +One difference between a man and a machine is that a machine is quiet +when well oiled. +%% +One good reason why computers can do more work than people is that they +never have to stop and answer the phone. +%% +One nice thing about egotists: they don't talk about other people. +%% +One of my less pleasant chores when I was young was to read the Bible +from one end to the other. Reading the Bible straight through is at +least 70 percent discipline, like learning Latin. But the good parts +are, of course, simply amazing. God is an extremely uneven writer, but +when He's good, nobody can touch Him. + -- John Gardner, NYT Book Review, Jan 1983 +%% +One of the oldest problems puzzled over in the Talmud is: "Why did God +create goyim?" The generally accepted answer is "________somebody has to buy +retail." + -- Arthur Naiman, "Every Goy's Guide to Yiddish" +%% + One of the questions that comes up all the time is: How +enthusiastic is our support for UNIX? + Unix was written on our machines and for our machines many +years ago. Today, much of UNIX being done is done on our machines. +Ten percent of our VAXs are going for UNIX use. UNIX is a simple +language, easy to understand, easy to get started with. It's great for +students, great for somewhat casual users, and it's great for +interchanging programs between different machines. And so, because of +its popularity in these markets, we support it. We have good UNIX on +VAX and good UNIX on PDP-11s. + It is our belief, however, that serious professional users will +run out of things they can do with UNIX. They'll want a real system and +will end up doing VMS when they get to be serious about programming. + With UNIX, if you're looking for something, you can easily and +quickly check that small manual and find out that it's not there. With +VMS, no matter what you look for -- it's literally a five-foot shelf of +documentation -- if you look long enough it's there. That's the +difference -- the beauty of UNIX is it's simple; and the beauty of VMS +is that it's all there. + -- Ken Olsen, President of DEC, 1984 +%% +One of the rules of Busmanship, New York style, is never surrender your +seat to another passenger. This may seem callous, but it is the best +way, really. If one passenger were to give a seat to someone who +fainted in the aisle, say, the others on the bus would become +disoriented and imagine they were in Topeka, Kansas. +%% +One Page Principle: + A specification that will not fit on one page of 8.5x11 inch + paper cannot be understood. + -- Mark Ardis +%% +"One planet is all you get." +%% +One seldom sees a monument to a committee. +%% +One thing the inventors can't seem to get the bugs out of is fresh +paint. +%% +One way to stop a runaway horse is to bet on him. +%% +Only adults have difficulty with childproof caps. +%% +Only God can make random selections. +%% +Optimization hinders evolution. +%% +Optimization hinders evolution. +%% +Oregon, n.: + Eighty billion gallons of water with no place to go on Saturday +night. +%% +Organic chemistry is the chemistry of carbon compounds. +Biochemistry is the study of carbon compounds that crawl. + -- Mike Adams +%% +Osborn's Law: + Variables won't; constants aren't. +%% +Others will look to you for stability, so hide when you bite your +nails. +%% +Our country has plenty of good five-cent cigars, but the trouble is +they charge fifteen cents for them. +%% +Our OS who art in CPU, UNIX be thy name. + Thy programs run, thy syscalls done, + in kernel as it is in user! +%% +Our policy is, when in doubt, do the right thing. + -- Roy L. Ash, ex-president Litton Industries +%% +Overdrawn? But I still have checks left! +%% +Overflow on /dev/null, please empty the bit bucket. +%% +Overload -- core meltdown sequence initiated. +%% +Ozman's Laws: + 1. If someone says he will do something "without fail," he + won't. + 2. The more people talk on the phone, the less money they + make. + 3. People who go to conferences are the ones who shouldn't. + 4. Pizza always burns the roof of your mouth. +%% +Paranoia is simply an optimistic outlook on life. +%% +Paranoids are people, too; they have their own problems. It's easy to +criticize, but if everybody hated you, you'd be paranoid too. + -- D. J. Hicks +%% +Pardo's First Postulate: + Anything good in life is either illegal, immoral, or fattening. + +Arnold's Addendum: + Anything not fitting into these categories causes cancer in + rats. +%% +Parker's Law: + Beauty is only skin deep, but ugly goes clean to the bone. +%% +Parkinson's Fifth Law: + If there is a way to delay in important decision, the good + bureaucracy, public or private, will find it. +%% +Parkinson's Fourth Law: + The number of people in any working group tends to increase + regardless of the amount of work to be done. +%% +Parts that positively cannot be assembled in improper order will be. +%% +"Pascal is not a high-level language." + -- Steven Feiner +%% +Pascal Users: + To show respect for the 313th anniversary (tomorrow) of the + death of Blaise Pascal, your programs will be run at half + speed. +%% +Pascal, n.: + A programming language named after a man who would turn over in +his grave if he knew about it. +%% +Passionate hatred can give meaning and purpose to an empty life. + -- Eric Hoffer +%% +Paul Revere was a tattle-tale +%% +Paul's Law: + In America, it's not how much an item costs, it's how much you + save. +%% +Paul's Law: + You can't fall off the floor. +%% +Peace, n.: + In international affairs, a period of cheating between two +periods of fighting. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Peanut Blossoms + +4 cups sugar 16 tbsp. milk +4 cups brown sugar 4 tsp. vanilla +4 cups shortening 14 cups flour +8 eggs 4 tsp. soda +4 cups peanut butter 4 tsp. salt + +Shape dough into balls. Roll in sugar and bake on ungreased cookie +sheet at 375 F. for 10-12 minutes. Immediately top each cookie with a +Hershey's kiss or star pressing down firmly to crack cookie. Makes a +hell of a lot. +%% +Pecor's Health-Food Principle: + Never eat rutabaga on any day of the week that has a "y" in + it. +%% +People often find it easier to be a result of the past than a cause of +the future. +%% +People usually get what's coming to them ... unless it's been mailed. +%% +People who claim they don't let little things bother them have never +slept in a room with a single mosquito. +%% +People who have what they want are very fond of telling people who +haven't what they want that they don't want it. + -- Ogden Nash +%% +People will accept your ideas much more readily if you tell them that +Benjamin Franklin said it first. +%% +People will buy anything that's one to a customer. +%% +People will buy anything that's one to a customer. +%% +Pereant, inquit, qui ante nos nostra dixerunt. +"Confound those who have said our remarks before us." + -- Aelius Donatus +%% +Perfect day for scrubbing the floor and other exciting things. +%% +Peter's Law of Substitution: + Look after the molehills, and the mountains will look after + themselves. +%% +Philadelphia is not dull -- it just seems so because it is next to +exciting Camden, New Jersy. +%% +Philogyny recapitulates erogeny; erogeny recapitulates philogyny. +%% +pi seconds is a nanocentury. + -- Tom Duff +%% +Pig, n.: + An animal (Porcus omnivorous) closely allied to the human race +by the splendor and vivacity of its appetite, which, however, is +inferior in scope, for it balks at pig. + -- Ambrose Bierce, "The Devil's Dictionary" +%% + PISCES (Feb. 19 - Mar. 20) +You have a vivid imagination and often think you are being followed by +the CIA or FBI. You have minor influence over your associates and +people resent your flaunting of your power. You lack confidence and +you are generally a coward. Pisces people do terrible things to small +animals. +%% +PISCES (Feb. 19 to Mar. 20) + Take the high road, look for the good things, carry the + American Express card and a weapon. The world is yours today, + as nobody else wants it. Your mortgage will be foreclosed. + You will probably get run over by a bus. +%% + Pittsburgh Driver's Test + +7: The car directly in front of you has a flashing right tail + light but a steady left tail light. This means + + (a) one of the tail lights is broken; you should blow your horn + to call the problem to the driver's attention. + (b) the driver is signaling a right turn. + (c) the driver is signaling a left turn. + (d) the driver is from out of town. + +The correct answer is (d). Tail lights are used in some foreign +countries to signal turns. +%% + Pittsburgh Driver's Test + +8: Pedestrians are + + (a) irrelevant. + (b) communists. + (c) a nuisance. + (d) difficult to clean off the front grille. + +The correct answer is (a). Pedestrians are not in cars, so they are +totally irrelevant to driving; you should ignore them completely. +%% +PL/1, "the fatal disease", belongs more to the problem set than to the +solution set. + -- E. W. Dijkstra +%% +Please ignore previous fortune. +%% +Please take note: +%% +Please try to limit the amount of `this room doesn't have any bazingas' +until you are told that those rooms are `punched out.' Once punched +out, we have a right to complain about atrocities, missing bazingas, +and such. + -- N. Meyrowitz +%% +Please, won't somebody tell me what diddie-wa-diddie means? +%% +PLUNDERER'S THEME +(to Supercalifragilisticexpialidocius) + +Pillage, rape, and loot and burn, but all in moderation. +If you do the things we say, then you'll soon rule the nation. +Kill your foes and enemies and then kill your relations. +Pillage, rape, and loot and burn, but all in moderation. +%% +Pohl's law: + Nothing is so good that somebody, somewhere, will not hate it. +%% +Police: Good evening, are you the host? +Host: No. +Police: We've been getting complaints about this party. +Host: About the drugs? +Police: No. +Host: About the guns, then? Is somebody complaining about the guns? +Police: No, the noise. +Host: Oh, the noise. Well that makes sense because there are no guns + or drugs here. (An enormous explosion is heard in the + background.) Or fireworks. Who's complaining about the noise? + The neighbors? +Police: No, the neighbors fled inland hours ago. Most of the recent + complaints have come from Pittsburgh. Do you think you could + ask the host to quiet things down? +Host: No Problem. (At this point, a Volkswagon bug with primitive + religious symbols drawn on the doors emerges from the living + room and roars down the hall, past the police and onto the + lawn, where it smashes into a tree. Eight guests tumble out + onto the grass, moaning.) See? Things are starting to wind + down. +%% +Political T.V. commercials prove one thing: some candidates can tell +all their good points and qualifications in just 30 seconds. +%% +Politician, n.: + From the Greek "poly" ("many") and the French "tete" ("head" or +"face," as in "tete-a-tete": head to head or face to face). Hence +"polytetien", a person of two or more faces. + -- Martin Pitt +%% +Politics is like coaching a football team. you have to be smart enough +to understand the game but not smart enough to lose interest. +%% +Polymer physicists are into chains. +%% +Pope Goestheveezl was the shortest reigning pope in the history of the +Church, reigning for two hours and six minutes on 1 April 1866. The +white smoke had hardly faded into the blue of the Vatican skies before +it dawned on the assembled multitudes in St. Peter's Square that his +name had hilarious possibilities. The crowds fell about, helpless with +laughter, singing + Half a pound of tuppenny rice + Half a pound of treacle + That's the way the chimney smokes + Pope Goestheveezl +The square was finally cleared by armed carabineri with tears of +laughter streaming down their faces. The event set a record for +hilarious civic functions, smashing the previous record set when Baron +Hans Neizant B"ompzidaize was elected Landburgher of K"oln in 1653. + -- Mike Harding, "The Armchair Anarchist's Almanac" +%% +Positive, adj.: + Mistaken at the top of one's voice. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Power, n: + The only narcotic regulated by the SEC instead of the FDA. +%% +Practical people would be more practical if they would take a little +more time for dreaming. + -- J. P. McEvoy +%% +Predestination was doomed from the start. +%% +President Reagan has noted that there are too many economic pundits and +forecasters and has decided on an excess prophets tax. +%% +President Thieu says he'll quit if he doesn't get more than 50% of the +vote. In a democracy, that's not called quitting. + -- The Washington Post +%% +Pretend to spank me -- I'm a pseudo-masochist! +%% +Preudhomme's Law of Window Cleaning: + It's on the other side. +%% +[Prime Minister Joseph] Chamberlain loves the working man -- he loves +to see him work. + -- Winston Churchill +%% +Pro is to con as progress is to Congress. +%% +Probable-Possible, my black hen, +She lays eggs in the Relative When. +She doesn't lay eggs in the Positive Now +Because she's unable to postulate how. + -- Frederick Winsor +%% +Professor Gorden Newell threw another shutout in last week's Chem. +Eng. 130 midterm. Once again a student did not receive a single point +on his exam. Newell has now tossed 5 shutouts this quarter. Newell's +earned exam average has now dropped to a phenomenal 30% +%% +Proof techniques #1: Proof by Induction. + +This technique is used on equations with "_n" in them. Induction +techniques are very popular, even the military used them. + +SAMPLE: Proof of induction without proof of induction. + + We know it's true for _n equal to 1. Now assume that it's true +for every natural number less than _n. _N is arbitrary, so we can take _n +as large as we want. If _n is sufficiently large, the case of _n+1 is +trivially equivalent, so the only important _n are _n less than _n. We +can take _n = _n (from above), so it's true for _n+1 because it's just +about _n. + QED. (QED translates from the Latin as "So what?") +%% +Proof techniques #2: Proof by Oddity. + SAMPLE: To prove that horses have an infinite number of legs. +(1) Horses have an even number of legs. +(2) They have two legs in back and fore legs in front. +(3) This makes a total of six legs, which certainly is an odd number of + legs for a horse. +(4) But the only number that is both odd and even is infinity. +(5) Therefore, horses must have an infinite number of legs. + +Topics is be covered in future issues include proof by: + Intimidation + Gesticulation (handwaving) + "Try it; it works" + Constipation (I was just sitting there and ...) + Blatant assertion + Changing all the 2's to _n's + Mutual consent + Lack of a counterexample, and + "It stands to reason" +%% +Psychiatrists say that one out of four people are mentally ill. Check +three friends. If they're ok, you're it. +%% +Put your Nose to the Grindstone! + -- Amalgamated Plastic Surgeons and Toolmakers, Ltd. +%% +Putt's Law: + Technology is dominated by two types of people: + Those who understand what they do not manage. + Those who manage what they do not understand. +%% +Q: Do you know what the death rate around here is? +A: One per person. +%% +Q: Why do ducks have flat feet? +A: To stamp out forest fires. + +Q: Why do elephants have flat feet? +A: To stamp out flaming ducks. +%% +Q: Why do mountain climbers rope themselves together? +A: To prevent the sensible ones from going home. +%% +Q: How many DEC repairman does it take to fix a flat ? +A: Five; four to hold the car up and one to swap tires. +%% +Q: How many DEC repairman does it take to fix a flat? +A: Five; four to hold the car up and one to swap tires. + +Q: How long does it take? +A: It's indeterminate. It will depend upon how many flats they've + brought with them. + +Q: What happens if you've got TWO flats? +A: They replace your generator. +%% +Q: How many existentialists does it take to screw in a lightbulb? +A: Two. One to screw it in and one to observe how the lightbulb itself + symbolizes a single incandescent beacon of subjective reality in a + netherworld of endless absurdity reaching out toward a maudlin + cosmos of nothingness. +%% +Q: How many IBM cpu's does it take to do a logical right shift? +A: 33. 1 to hold the bits and 32 to push the register. +%% +Q: How many IBM CPU's does it take to execute a job? +A: Four; three to hold it down, and one to rip its head off. +%% +Q: How many IBM types does it take to change a light bulb? +A: 100. Ten to do it, and 90 to write document number GC7500439-0001, + Multitasking Incandescent Source System Facility, of which 10% of + the pages state only "This page intentionally left blank", and 20% + of the definitions are of the form "A ...... consists of sequences + of non-blank characters separated by blanks". +%% +Q: How many journalists does it take to screw in a lightbulb? +A: Three. One to report it as an inspired government program to bring + light to the people, one to report it as a diabolical government + plot to deprive the poor of darkness, and one to win a pulitzer + prize for reporting that Electric Company hired a lightbulb-assassin + to break the bulb in the first place. +% +Q: How many heterosexual males does it take to screw in a light bulb in + San Francisco? +A: Both of them. +%% +Q: How many Martians does it take to screw in a lightbulb? +A: One and a half. +%% +Q: How many Oregonians does it take to screw in a light bulb? +A: Three. One to screw in the lightbulb and two to fend off all those + Californians trying to share the experience. +%% +Q: How many surrealists does it take to change a light bulb? +A: Two. One to hold the girrafe and the other to fill the bathtub with + brightly colored machine tools. +%% +Q: Why did the tachyon cross the road? +A: Because it was on the other side. +%% +Quality Control, n.: + The process of testing one out of every 1,000 units coming off +a production line to make sure that at least one out of 100 works. +%% +Question: +Man Invented Alcohol, +God Invented Grass. +Who do you trust? +%% +Quick!! Act as if nothing has happened! +%% +"Qvid me anxivs svm?" +%% +QWERT (kwirt), n. [MW < OW qwertyuiop, a thirteenth]: + 1. a unit of weight equal to 13 poiuyt avoirdupois (or 1.69 +kiloliks), commonly used in structural engineering; 2. [Colloq.] one +thirteenth the load that a fully grown sligo can carry; 3. [Anat.] a +painful irritation of the dermis in the region of the anus; 4. [Slang] +person who excites in others the symptoms of a qwert. + -- Webster's Middle World Dictionary, 4th ed. +%% +Radioactive cats have 18 half-lives. +%% +Rattling around the back of my head is a disturbing image of something +I saw at the airport ... Now I'm remembering, those giant piles of +computer magazines right next to "People" and "Time" in the airport +store. Does it bother anyone else that half the world is being told +all of our hard-won secrets of computer technology? Remember how all +the lawyers cried foul when "How to Avoid Probate" was published? Are +they taking no-fault insurance lying down? No way! But at the current +rate it won't be long before there are stacks of the "Transactions on +Information Theory" at the A&P checkout counters. Who's going to be +impressed with us electrical engineers then? Are we, as the saying +goes, giving away the store? + -- Robert W. Lucky, IEEE President +%% +Ray's Rule of Precision: + Measure with a micrometer. Mark with chalk. Cut with an axe. +%% +Razors pain you; +Rivers are damp; +Acids stain you; +And drugs cause cramp. +Guns aren't lawful; +Nooses give; +Gas smells awful; +You might as well live. + -- Dorothy Parker +%% +Re graphics: A picture is worth 10K words -- but only those to describe +the picture. Hardly any sets of 10K words can be adequately described +with pictures. +%% +Real Programmers don't play tennis, or any other sport that requires +you to change clothes. Mountain climbing is OK, and real programmers +wear their climbing boots to work in case a mountain should suddenly +spring up in the middle of the machine room. +%% +Real Programmers don't write in PL/I. PL/I is for programmers who +can't decide whether to write in COBOL or FORTRAN. +%% +Real Programmers think better when playing Adventure or Rogue. +%% +Real Programs don't use shared text. Otherwise, how can they use +functions for scratch space after they are finished calling them? +%% +Real Time, adj.: + Here and now, as opposed to fake time, which only occurs there +and then. +%% +Reality is a cop-out for people who can't handle drugs. +%% +Reality is an obstacle to hallucination. +%% +Reality is for those who can't face Science Fiction. +%% +"Really ?? What a coincidence, I'm shallow too!!" +%% +Receiving a million dollars tax free will make you feel better than +being flat broke and having a stomach ache. + -- Dolph Sharp, "I'm O.K., You're Not So Hot" +%% +Recession is when your neighbor loses his job. Depression is when you +lose your job. These economic downturns are very difficult to predict, +but sophisticated econometric modeling houses like Data Resources and +Chase Econometrics have successfully predicted 14 of the last 3 +recessions. +%% +Reclaimer, spare that tree! +Take not a single bit! +It used to point to me, +Now I'm protecting it. +It was the reader's CONS +That made it, paired by dot; +Now, GC, for the nonce, +Thou shalt reclaim it not. +%% + "Reflections on Ice-Breaking" +Candy +Is dandy +But liquor +Is quicker. + -- Ogden Nash +%% +"Reintegration complete," ZORAC advised. "We're back in the universe +again ..." An unusually long pause followed, "... but I don't know +which part. We seem to have changed our position in space." A +spherical display in the middle of the floor illuminated to show the +starfield surrounding the ship. + +"Several large, artificial constructions are approaching us," ZORAC +announced after a short pause. "The designs are not familiar, but they +are obviously the products of intelligence. Implications: we have been +intercepted deliberately by a means unknown, for a purpose unknown, and +transferred to a place unknown by a form of intelligence unknown. +Apart from the unknowns, everything is obvious." + -- James P. Hogan, "Giants Star" +%% +Reisner's Rule of Conceptual Inertia: + If you think big enough, you'll never have to do it. +%% +Remember that whatever misfortune may be your lot, it could only be +worse in Cleveland. + -- National Lampoon, "Deteriorada" +%% +Remember, even if you win the rat race -- you're still a rat. +%% +Remember, UNIX spelled backwards is XINU. +%% +Reporter (to Mahatma Gandhi): Mr Gandhi, what do you think of + Western Civilization? +Gandhi: I think it would be a good idea. +%% +Reporter, n.: + A writer who guesses his way to the truth and dispels it with a +tempest of words. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Research is what I'm doing when I don't know what I'm doing. + -- Wernher von Braun +%% +Resisting temptation is easier when you think you'll probably get +another chance later on. +%% +Review Questions + +1: If Nerd on the planet Nutley starts out in his spaceship at 20 + KPH, and his speed doubles every 3.2 seconds, how long will it + be before he exceeds the speed of light? How long will it be + before the Galactic Patrol picks up the pieces of his + spaceship? + +2: If Roger Rowdy wrecks his car every week, and each week he + breaks twice as many bones as before, how long will it be + before he breaks every bone in his body? How long will it be + before they cut off his insurance? Where does he get a new car + every week? + +3: If Johnson drinks one beer the first hour (slow start), four + beers the next hour, nine beers the next, etc., and stacks the + cans in a pyramid, how soon will Johnson's pyramid be larger + than King Tut's? When will it fall on him? Will he notice? +%% +Rhode's Law: + When any principle, law, tenet, probability, happening, + circumstance, or result can in no way be directly, indirectly, + empirically, or circuitously proven, derived, implied, + inferred, induced, deducted, estimated, or scientifically + guessed, it will always for the purpose of convenience, + expediency, political advantage, material gain, or personal + comfort, or any combination of the above, or none of the above, + be unilaterally and unequivocally assumed, proclaimed, and + adhered to as absolute truth to be undeniably, universally, + immutably, and infinitely so, until such time as it becomes + advantageous to assume otherwise, maybe. +%% +Rocky's Lemma of Innovation Prevention + Unless the results are known in advance, funding agencies will + reject the proposal. +%% +ROMEO: Courage, man; the hurt cannot be much. +MERCUTIO: No, 'tis not so deep as a well, nor so wide as a church- + door; but 'tis enough, 'twill serve. +%% +Rudin's Law: + If there is a wrong way to do something, most people will + do it every time. +%% +Rule 46, Oxford Union Society, London: + Any member introducing a dog into the Society's premises shall + be liable to a fine of one pound. Any animal leading a blind + person shall be deemed to be a cat. +%% +Rule of Creative Research: + 1) Never draw what you can copy. + 2) Never copy what you can trace. + 3) Never trace what you can cut out and paste down. +%% +Rule of Defactualization: + Information deteriorates upward through bureaucracies. +%% +Rule of Feline Frustration: + When your cat has fallen asleep on your lap and looks utterly + content and adorable, you will suddenly have to go to the + bathroom. +%% +Rule of the Great: + When people you greatly admire appear to be thinking deep + thoughts, they probably are thinking about lunch. +%% +Rules for driving in New York: + 1) Anything done while honking your horn is legal. + 2) You may park anywhere if you turn your four-way flashers + on. + 3) A red light means the next six cars may go through the + intersection. +%% +RULES OF EATING -- THE BRONX DIETER'S CREED + 1. Never eat on an empty stomach. + 2. Never leave the table hungry. + 3. When traveling, never leave a country hungry. + 4. Enjoy your food. + 5. Enjoy your companion's food. + 6. Really taste your food. It may take several portions to + accomplish this, especially if subtly seasoned. + 7. Really feel your food. Texture is important. Compare, for + example, the texture of a turnip to that of a brownie. + Which feels better against your cheeks? + 8. Never eat between snacks, unless it's a meal. + 9. Don't feel you must finish everything on your plate. You + can always eat it later. + 10. Avoid any wine with a childproof cap. + 11. Avoid blue food. + -- Richard Smit, "The Bronx Diet" +%% +Safety Tips for the Post-Nuclear Existence + Tip #1: How to tell when you are dead. + + 1. Little things start bothering you: little things like + worms, bugs, ants. + 2. Something is missing in your personal relationships. + 3. Your dog becomes overly affectionate. + 4. You have a hard time getting a waiter. + 5. Exotic birds flock around you. + 6. People ignore you at parties. + 7. You have a hard time getting up in the morning. + 8. You no longer get off on cocaine. +%% + Safety Tips for the Post-Nuclear Existence +1. Never use an elevator in a building that has been hit by a nuclear + bomb; use the stairs. +2. When you're flying through the air, remember to roll when you hit + the ground. +3. If you're on fire, avoid gasoline and other flammable materials. +4. Don't attempt communication with dead people; it will only lead to + psychological problems. +5. Food will be scarce; you will have to scavenge. Learn to recognize + foods that will be available after the bomb: mashed potatoes, + shredded wheat, tossed salad, ground beef, etc. +6. Put your hand over your mouth when you sneeze; internal organs will + be scarce in the post-nuclear age. +7. Try to be neat; fall only in designated piles. +8. Drive carefully in "Heavy Fallout" areas; people could be + staggering illegally. +9. Nutritionally, hundred dollar bills are equal to ones, but more + sanitary due to limited circulation. +10. Accumulate mannequins now; spare parts will be in short supply on + D-Day. +%% + SAGITTARIUS (Nov 22 - Dec 21) +You are optimistic and enthusiastic. You have a reckless tendency to +rely on luck since you lack talent. The majority of Sagittarians are +drunks or dope fiends or both. People laugh at you a great deal. +%% +San Francisco isn't what it used to be, and it never was. + -- Herb Caen +%% +San Francisco, n.: + Marcel Proust editing an issue of Penthouse. +%% +Santa Claus wears a Red Suit, + He must be a communist. +And a beard and long hair, + Must be a pacifist. + + What's in that pipe that he's smoking? + -- Arlo Guthrie +%% +Satellite Safety Tip #14: + If you see a bright streak in the sky coming at you, duck. +%% +Sattinger's Law: + It works better if you plug it in. +%% +Saturday night in Toledo Ohio, + Is like being nowhere at all, +All through the day how the hours rush by, + You sit in the park and you watch the grass die. + -- John Denver, "Saturday Night in Toledo Ohio" +%% +Save energy: be apathetic. +%% +Save the whales. Collect the whole set. +%% +SCCS, the source motel! Programs check in and never check out! + -- Ken Thompson +%% +Schapiro's Explanation: + The grass is always greener on the other side -- but that's + because they use more manure. +%% +Schizophrenia beats being alone. +%% +Science is what happens when preconception meets verification. +%% + SCORPIO (Oct 23 - Nov 21) +You are shrewd in business and cannot be trusted. You will achieve the +pinnacle of success because of your total lack of ethics. Most Scorpio +people are murdered. +%% +Scott's first Law: + No matter what goes wrong, it will probably look right. +%% +Scott's second Law: + When an error has been detected and corrected, it will be found + to have been wrong in the first place. +Corollary: + After the correction has been found in error, it will be + impossible to fit the original quantity back into the + equation. +%% +Scotty: Captain, we din' can reference it! +Kirk: Analysis, Mr. Spock? +Spock: Captain, it doesn't appear in the symbol table. +Kirk: Then it's of external origin? +Spock: Affirmative. +Kirk: Mr. Sulu, go to pass two. +Sulu: Aye aye, sir, going to pass two. +%% +Screw up your courage! You've screwed up everything else. +%% +Second Law of Business Meetings: + If there are two possible ways to spell a person's name, you + will pick the wrong one. + +Corollary: + If there is only one way to spell a name, you will spell it + wrong, anyway. +%% +Security check: INTRUDER ALERT! +%% +Seduced, shaggy Samson snored. +She scissored short. Sorely shorn, +Soon shackled slave, Samson sighed, +Silently scheming, +Sightlessly seeking +Some savage, spectacular suicide. + -- Stanislaw Lem, "Cyberiad" +%% +Self Test for Paranoia: + You know you have it when you can't think of anything that's + your own fault. +%% +Seminars, n.: + From "semi" and "arse", hence, any half-assed discussion. +%% +Serocki's Stricture: + Marriage is always a bachelor's last option. +%% +Serving coffee on aircraft causes turbulence. +%% + "Seven years and six months!" Humpty Dumpty repeated +thoughtfully. "An uncomfortable sort of age. Now if you'd asked MY +advice, I'd have said `Leave off at seven' -- but it's too late now." + "I never ask advice about growing," Alice said indignantly. + "Too proud?" the other enquired. + Alice felt even more indignant at this suggestion. "I mean," +she said, "that one can't help growing older." + "ONE can't, perhaps," said Humpty Dumpty; "but TWO can. With +proper assistance, you might have left off at seven." + -- Lewis Carroll +%% +Sex is not the answer. Sex is the question. "Yes" is the answer. + -- Swami X +%% +Sex is the mathematics urge sublimated. + -- M. C. Reed. +%% +Sex without love is an empty experience, but, as empty experiences go, +it's one of the best. + -- Woody Allen +%% +Shamus, n.: + A shamus is a guy who takes care of handyman tasks around the +temple, and makes sure everything is in working order. + A shamus is at the bottom of the pecking order of synagog +functionaries, and there's a joke about that: + A rabbi, to show his humility before God, cries out in the +middle of a service, "Oh, Lord, I am nobody!" The cantor, not to be +bested, also cries out, "Oh, Lord, I am nobody!" + The shamus, deeply moved, follows suit and cries, "Oh, Lord, I +am nobody!" The rabbi turns to the cantor and says, "Look who thinks +he's nobody!" + -- Arthur Naiman, "Every Goy's Guide to Yiddish" +%% +Shaw's Principle: + Build a system that even a fool can use, and only a fool will + want to use it. +%% +"She is descended from a long line that her mother listened to." + -- Gypsy Rose Lee +%% +She is not refined. She is not unrefined. She keeps a parrot. + -- Mark Twain +%% +She missed an invaluable opportunity to give him a look that you could +have poured on a waffle ... +%% +She's genuinely bogus. +%% +"Sherry [Thomas Sheridan] is dull, naturally dull; but it must have +taken him a great deal of pains to become what we now see him. Such an +excess of stupidity, sir, is not in Nature." + -- Samuel Johnson +%% +SHIFT TO THE LEFT! SHIFT TO THE RIGHT! +POP UP, PUSH DOWN, BYTE, BYTE, BYTE! +%% +Show me a man who is a good loser and I'll show you a man who is +playing golf with his boss. +%% +Show respect for age. Drink good Scotch for a change. +%% +Signs of crime: screaming or cries for help. + -- from the Brown Security Crime Prevention Pamphlet +%% +Silverman's Law: + If Murphy's Law can go wrong, it will. +%% +Simon's Law: + Everything put together falls apart sooner or later. +%% +Since I hurt my pendulum +My life is all erratic. +My parrot, who was cordial, +Is now transmitting static. +The carpet died, a palm collapsed, +The cat keeps doing poo. +The only thing that keeps me sane +Is talking to my shoe. + -- My Shoe +%% +Since we're all here, we must not be all there. + -- Bob "Mountain" Beck +%% +[Sir Stafford Cripps] has all the virtues I dislike and none of the +vices I admire. + -- Winston Churchill +%% +Sixtus V, Pope from 1585 to 1590 authorized a printing of the Vulgate +Bible. Taking no chances, the pope issued a papal bull automatically +excommunicating any printer who might make an alteration in the text. +This he ordered printed at the beginning of the Bible. He personally +examined every sheet as it came off the press. Yet the published +Vulgate Bible contained so many errors that corrected scraps had to be +printed and pasted over them in every copy. The result provoked wry +comments on the rather patchy papal infallibility, and Pope Sixtus had +no recourse but to order the return and destruction of every copy. +%% +Skinner's Constant (or Flannagan's Finagling Factor): + That quantity which, when multiplied by, divided by, added to, + or subtracted from the answer you get, gives you the answer you + should have gotten. +%% +Slang is language that takes off its coat, spits on its hands, and goes +to work. +%% +Slick's Three Laws of the Universe: + 1. Nothing in the known universe travels faster than a bad + check. + 2. A quarter-ounce of chocolate = four pounds of fat. + 3. There are two types of dirt: the dark kind, which is + attracted to light objects, and the light kind, which is + attracted to dark objects. +%% +Slurm, n.: + The slime that accumulates on the underside of a soap bar when +it sits in the dish too long. + -- Rich Hall, "Sniglets" +%% +Snacktrek, n.: + The peculiar habit, when searching for a snack, of constantly +returning to the refrigerator in hopes that something new will have +materialized. + -- Rich Hall, "Sniglets" +%% +So far as I can remember, there is not one word in the Gospels in +praise of intelligence. + -- Bertrand Russell +%% +"So she went into the garden to cut a cabbage leaf to make an apple +pie; and at the same time a great she-bear, coming up the street pops +its head into the shop. "What! no soap?" So he died, and she very +imprudently married the barber; and there were present the Picninnies, +and the Grand Panjandrum himself, with the little round button at top, +and they all fell to playing the game of catch as catch can, till the +gunpowder ran out at the heels of their boots." + -- Samuel Foote +%% +Sodd's Second Law: + Sooner or later, the worst possible set of circumstances is + bound to occur. +%% +SOFTWARE -- formal evening attire for female computer analysts. +%% +Some of you ... may have decided that, this year, you're going to +celebrate it the old-fashioned way, with your family sitting around +stringing cranberries and exchanging humble, handmade gifts, like on +"The Waltons". Well, you can forget it. If everybody pulled that kind +of subversive stunt, the economy would collapse overnight. The +government would have to intervene: it would form a cabinet-level +Department of Holiday Gift-Giving, which would spend billions and +billions of tax dollars to buy Barbie dolls and electronic games, which +it would drop on the populace from Air Force jets, killing and maiming +thousands. So, for the good of the nation, you should go along with +the Holiday Program. This means you should get a large sum of money +and go to a mall. + -- Dave Barry, "Christmas Shopping: A Survivor's Guide" +%% +Some people are born mediocre, some people achieve mediocrity, and some +people have mediocrity thrust upon them. + -- Joseph Heller, "Catch-22" +%% +Some people in this department wouldn't recognize subtlety if it hit +them on the head. +%% +Some points to remember [about animals]: + +1. Don't go to sleep under big animals, e.g., elephants, + rhinoceri, hippopotamuses; +2. Don't put animals with sharp teeth or poisonous fangs down the + front of your clothes; +3. Don't pat certain animals, e.g., crocodiles and scorpions or + dogs you have just kicked. + -- Mike Harding, "The Armchair Anarchist's Almanac" +%% +Somebody ought to cross ball point pens with coat hangers so that the +pens will multiply instead of disappear. +%% +Someone will try to honk your nose today. +%% +"Sometimes I simply feel that the whole world is a cigarette and I'm +the only ashtray." +%% +Sometimes I worry about being a success in a mediocre world. + -- Lily Tomlin +%% +"Somewhere", said Father Vittorini, "did Blake not speak of the +Machineries of Joy? That is, did not God promote environments, then +intimidate these Natures by provoking the existence of flesh, toy men +and women, such as are we all? And thus happily sent forth, at our +best, with good grace and fine wit, on calm noons, in fair climes, are +we not God's Machineries of Joy?" + +"If Blake said that", said Father Brian, "he never lived in Dublin." + -- R. Bradbury, "The Machineries of Joy" +%% +Sooner or later you must pay for your sins. (Those who have already +paid may disregard this fortune). +%% +Space is big. You just won't believe how vastly, hugely, mind- +bogglingly big it is. I mean, you may think it's a long way down the +road to the drug store, but that's just peanuts to space. + -- "The Hitchhiker's Guide to the Galaxy" +%% +Spark's Sixth Rule for Managers: + If a subordinate asks you a pertinent question, look at him as + if he had lost his senses. When he looks down, paraphrase the + question back at him. +%% +Speak roughly to your little boy, + And beat him when he sneezes: +He only does it to annoy + Because he knows it teases. + + Wow! wow! wow! + +I speak severely to my boy, + And beat him when he sneezes: +For he can thoroughly enjoy + The pepper when he pleases! + + Wow! wow! wow! + -- Lewis Carrol, "Alice in Wonderland" +%% +Speak roughly to your little VAX, + And boot it when it crashes; +It knows that one cannot relax + Because the paging thrashes! + + Wow! Wow! Wow! + +I speak severely to my VAX, + And boot it when it crashes; +In spite of all my favorite hacks + My jobs it always thrashes! + + Wow! Wow! Wow! +%% +Speak softly and carry a +6 two-handed sword. +%% +Speaking as someone who has delved into the intricacies of PL/I, I am +sure that only Real Men could have written such a machine-hogging, +cycle-grabbing, all-encompassing monster. Allocate an array and free +the middle third? Sure! Why not? Multiply a character string times a +bit string and assign the result to a float decimal? Go ahead! Free a +controlled variable procedure parameter and reallocate it before +passing it back? Overlay three different types of variable on the same +memory location? Anything you say! Write a recursive macro? Well, +no, but Real Men use rescan. How could a language so obviously +designed and written by Real Men not be intended for Real Man use? +%% +Speaking of love, one problem that recurs more and more frequently +these days, in books and plays and movies, is the inability of people +to communicate with the people they love; Husbands and wives who can't +communicate, children who can't communicate with their parents, and so +on. And the characters in these books and plays and so on (and in real +life, I might add) spend hours bemoaning the fact that they can't +communicate. I feel that if a person can't communicate, the very _____least +he can do is to Shut Up! + -- Tom Lehrer, "That Was the Year that Was" +%% +Spend extra time on hobby. Get plenty of rolling papers. +%% +Spirtle, n.: + The fine stream from a grapefruit that always lands right in +your eye. + -- Sniglets, "Rich Hall & Friends" +%% +Spouse, n.: + Someone who'll stand by you through all the trouble you +wouldn't have had if you'd stayed single. +%% +Stay away from flying saucers today. +%% +Stay away from hurricanes for a while. +%% +"Stealing a rhinoceros should not be attempted lightly." +%% +Steele's Plagiarism of Somebody's Philosophy: + Everybody should believe in something -- I believe I'll have + another drink. +%% +Steinbach's Guideline for Systems Programming + Never test for an error condition you don't know how to + handle. +%% +Stop searching. Happiness is right next to you. +%% +Stop searching. Happiness is right next to you. Now, if they'd only +take a bath ... +%% +Stult's Report: + Our problems are mostly behind us. What we have to do now is + fight the solutions. +%% +Stupid, n.: + Losing $25 on the game and $25 on the instant replay. +%% +Sturgeon's Law: + 90% of everything is crud. +%% +Substitute "damn" every time you're inclined to write "very"; your +editor will delete it and the writing will be just as it should be. + -- Mark Twain +%% +Succumb to natural tendencies. Be hateful and boring. +%% +(Sung to the tune of "The Impossible Dream" from MAN OF LA MANCHA) + + To code the impossible code, + To bring up a virgin machine, + To pop out of endless recursion, + To grok what appears on the screen, + + To right the unrightable bug, + To endlessly twiddle and thrash, + To mount the unmountable magtape, + To stop the unstoppable crash! +%% +Support bacteria -- it's the only culture some people have! +%% +Surprise due today. Also the rent. +%% +Surprise your boss. Get to work on time. +%% +Surprise! You are the lucky winner of random I.R.S. Audit! Just type +in your name and social security number. Please remember that leaving +the room is punishable under law: + +Name # +%% +Sweater, n.: + A garment worn by a child when its mother feels chilly. +%% +Swipple's Rule of Order: + He who shouts the loudest has the floor. +%% +System/3! System/3! +See how it runs! See how it runs! + Its monitor loses so totally! + It runs all its programs in RPG! + It's made by our favorite monopoly! +System/3! +%% +Tact is the ability to tell a man he has an open mind when he has a +hole in his head. +%% +Tact is the ability to tell a man he has an open mind when he has a +hole in his head. +%% +Tact, n.: + The unsaid part of what you're thinking. +%% +Take everything in stride. Trample anyone who gets in your way. +%% +Take heart amid the deepening gloom that your dog is finally getting +enough cheese + -- National Lampoon, "Deteriorada" +%% +Take it easy, we're in a hurry. +%% +Take my word for it, the silliest woman can manage a clever man, but it +needs a very clever woman to manage a fool. + -- Kipling +%% + Take the folks at Coca-Cola. For many years, they were content +to sit back and make the same old carbonated beverage. It was a good +beverage, no question about it; generations of people had grown up +drinking it and doing the experiment in sixth grade where you put a +nail into a glass of Coke and after a couple of days the nail dissolves +and the teacher says: "Imagine what it does to your TEETH!" So +Coca-Cola was solidly entrenched in the market, and the management saw +no need to improve ... + -- Dave Barry, "In Search of Excellence" +%% +Take your dying with some seriousness, however. Laughing on the way to +your execution is not generally understood by less advanced life forms, +and they'll call you crazy. + -- "Messiah's Handbook: Reminders for the Advanced Soul" +%% +Take your dying with some seriousness, however. Laughing on the way to +your execution is not generally understood by less-advanced life-forms, +and they'll call you crazy. + -- Messiah's Handbook: Reminders for the Advanced Soul +%% +Talk sense to a fool and he calls you foolish. + -- Euripides +%% +Talkers are no good doers. + -- William Shakespeare, "Henry VI" +%% +Talking much about oneself can also be a means to conceal oneself. + -- Friedrich Nietzsche +%% + TAURUS (Apr 20 - May 20) +You are practical and persistent. You have a dogged determination and +work like hell. Most people think you are stubborn and bull headed. +You are a Communist. +%% +Tax reform means "Don't tax you, don't tax me, tax that fellow behind +the tree." + -- Russell Long +%% +Taxes, n.: + Of life's two certainties, the only one for which you can get +an extension. +%% +Teach children to be polite and courteous in the home, and, when he +grows up, he will never be able to edge his car onto a freeway. +%% +Teamwork is essential -- it allows you to blame someone else. +%% +Technological progress has merely provided us with more efficient means +for going backwards. + -- Aldous Huxley +%% +Ten years of rejection slips is nature's way of telling you to stop +writing. + -- R. Geis +%% +"Terence, this is stupid stuff: +You eat your victuals fast enough; +There can't be much amiss, 'tis clear, +To see the rate you drink your beer. +But oh, good Lord, the verse you make, +It gives a chap the belly-ache. +The cow, the old cow, she is dead; +It sleeps well the horned head: +We poor lads, 'tis our turn now +To hear such tunes as killed the cow. +Pretty friendship 'tis to rhyme +Your friends to death before their time. +Moping, melancholy mad: +Come, pipe a tune to dance to, lad." + -- A. E. Housman +%% +Tertullian was born in Carthage somewhere about 160 A.D. He was a +pagan, and he abandoned himself to the lascivious life of his city +until about his 35th year, when he became a Christian .... To him is +ascribed the sublime confession: Credo quia absurdum est (I believe +because it is absurd). This does not altogether accord with historical +fact, for he merely said: + + "And the Son of God died, which is immediately credible because + it is absurd. And buried he rose again, which is certain + because it is impossible." + +Thanks to the acuteness of his mind, he saw through the poverty of +philosophical and Gnostic knowledge, and contemptuously rejected it. + -- C. G. Jung, in Psychological Types + +(Teruillian was one of the founders of the Catholic Church). +%% +Test-tube babies shouldn't throw stones. +%% +"Text processing has made it possible to right-justify any idea, even +one which cannot be justified on any other grounds." + -- J. Finnegan, USC. +%% +"That must be wonderful! I don't understand it at all." +%% +That secret you've been guarding, isn't. +%% +That woman speaks eight languages and can't say "no" in any of them. + -- Dorothy Parker +%% +The [Ford Foundation] is a large body of money completely surrounded by +people who want some. + -- Dwight MacDonald +%% +The Abrams' Principle: + The shortest distance between two points is off the wall. +%% +The advertisement is the most truthful part of a newspaper + -- Thomas Jefferson +%% +... The Anarchists' [national] anthem is an international anthem that +consists of 365 raspberries blown in very quick succession to the tune +of "Camptown Races". Nobody has to stand up for it, nobody has to +listen to it, and, even better, nobody has to play it. + -- Mike Harding, "The Armchair Anarchist's Almanac" +%% +The Army has carried the American ... ideal to its logical conclusion. +Not only do they prohibit discrimination on the grounds of race, creed +and color, but also on ability. + -- T. Lehrer +%% +The Army needs leaders the way a foot needs a big toe. + -- Bill Murray +%% +The average woman would rather have beauty than brains, because the +average man can see better than he can think. +%% +The basic idea behind malls is that they are more convenient than +cities. Cities contain streets, which are dangerous and crowded and +difficult to park in. Malls, on the other hand, have parking lots, +which are also dangerous and crowded and difficult to park in, but -- +here is the big difference -- in mall parking lots, THERE ARE NO +RULES. You're allowed to do anything. You can drive as fast as you +want in any direction you want. I was once driving in a mall parking +lot when my car was struck by a pickup truck being driven backward by a +squat man with a tattoo that said "Charlie" on his forearm, who got out +and explained to me, in great detail, why the accident was my fault, +his reasoning being that he was violent and muscular, whereas I was +neither. This kind of reasoning is legally valid in mall parking +lots. + -- Dave Barry, "Christmas Shopping: A Survivor's Guide" +%% +The best book on programming for the layman is "Alice in Wonderland"; +but that's because it's the best book on anything for the layman. +%% +The best cure for insomnia is to get a lot of sleep. + -- W. C. Fields +%% +The best defense against logic is ignorance. +%% +The best thing about growing older is that it takes such a long time. +%% +The biggest difference between time and space is that you can't reuse +time. + -- Merrick Furst +%% +The birds are singing, the flowers are budding, and it is time for Miss +Manners to tell young lovers to stop necking in public. + +It's not that Miss Manners is immune to romance. Miss Manners has been +known to squeeze a gentleman's arm while being helped over a curb, and, +in her wild youth, even to press a dainty slipper against a foot or two +under the dinner table. Miss Manners also believes that the sight of +people strolling hand in hand or arm in arm or arm in hand dresses up a +city considerably more than the more familiar sight of people shaking +umbrellas at one another. What Miss Manners objects to is the kind of +activity that frightens the horses on the street ... +%% +"The bland leadeth the bland and they both shall fall into the kitsch." +%% +The brain is a wonderful organ; it starts working the moment you get up +in the morning, and does not stop until you get to school. +%% +The Briggs/Chase Law of Program Development: + To determine how long it will take to write and debug a + program, take your best estimate, multiply that by two, add + one, and convert to the next higher units. +%% +"The C Programming Language -- A language which combines the +flexibility of assembly language with the power of assembly language." +%% +The chicken that clucks the loudest is the one most likely to show up +at the steam fitters' picnic. +%% +The chief cause of problems is solutions. +%% +"The climate of Bombay is such that its inhabitants have to live +elsewhere." +%% +The computing field is always in need of new cliches. + -- Alan Perlis +%% +The correct way to punctuate a sentence that starts: "Of course it is +none of my business, but --" is to place a period after the word "but." +Don't use excessive force in supplying such a moron with a period. +Cutting his throat is only a momentary pleasure and is bound to get you +talked about. + -- Lazarus Long, "Time Enough for Love" +%% +The cost of living hasn't affected its popularity. +%% +The cost of living is going up, and the chance of living is going +down. +%% +The cow is nothing but a machine with makes grass fit for us people to +eat. + -- John McNulty +%% +The Crown is full of it! + -- Nate Harris, 1775 +%% +The day-to-day travails of the IBM programmer are so amusing to most of +us who are fortunate enough never to have been one -- like watching +Charlie Chaplin trying to cook a shoe. +%% +The debate rages on: Is PL/I Bachtrian or Dromedary? +%% +The devil finds work for idle circuits to do. +%% +"The difference between a misfortune and a calamity? If Gladstone fell +into the Thames, it would be a misfortune. But if someone dragged him +out again, it would be a calamity." + -- Benjamin Disraeli +%% +The difference between science and the fuzzy subjects is that science +requires reasoning while those other subjects merely require +scholarship. + -- Robert Heinlein +%% +The duck hunter trained his retriever to walk on water. Eager to show +off this amazing accomplishment, he asked a friend to go along on his +next hunting trip. Saying nothing, he fired his first shot and, as the +duck fell, the dog walked on the surface of the water, retrieved the +duck and returned it to his master. + "Notice anything?" the owner asked eagerly. + "Yes," said his friend, "I see that fool dog of yours can't +swim." +%% +The earth is like a tiny grain of sand, only much, much heavier. +%% +The end of the world will occur at 3:00 p.m., this Friday, with +symposium to follow. +%% +The English have no respect for their language, and will not teach +their children to speak it. + -- G. B. Shaw +%% +The fact that it works is immaterial. + -- L. Ogborn +%% +The Fifth Rule: + You have taken yourself too seriously. +%% +The first duty of a revolutionary is to get away with it. + -- Abbie Hoffman +%% +The first Great Steward, Parrafin the Climber, was employed in King +Chloroplast's kitchen as second scullery boy when the old King met a +tragic death. He apparently fell backward by accident on a dozen salad +forks. Simultaneously the true heir, his son Carotene, mysteriously +fled the city, complaining of some sort of plot and a lot of +threatening notes left on his breakfast tray. At the time, this looked +suspicious what with his father's death, and Carotene was suspected of +foul play. Then the rest of the King's relatives began to drop dead +one after the other in an odd fashion. Some were found strangled with +dishrags and some succumbed to food poisoning. A few were found +drowned in the soup vats, and one was attacked by assailants unknown +and beaten to death with a pot roast. At least three appear to have +thrown themselves backward on salad forks, perhaps in a noble gesture +of grief over the King's untimely end. Finally there was no one left +in Minas Troney who was either eligible or willing to wear the accursed +crown, and the rule of Twodor was up for grabs. The scullery slave +Parrafin bravely accepted the Stewardship of Twodor until that day when +a lineal descendant of Carotene's returns to reclaim his rightful +throne, conquer Twodor's enemies, and revamp the postal system. + -- Harvard Lampoon, "Bored of the Rings" +%% +The first riddle I ever heard, one familiar to almost every Jewish +child, was propounded to me by my father: + "What is it that hangs on the wall, is green, wet -- and +whistles?" + I knit my brow and thought and thought, and in final perplexity +gave up. + "A herring," said my father. + "A herring," I echoed. "A herring doesn't hang on the wall!" + "So hang it there." + "But a herring isn't green!" I protested. + "Paint it." + "But a herring isn't wet." + "If its just painted its still wet." + "But -- " I sputtered, summoning all my outrage, "-- a herring +doesn't whistle!!" + "Right, " smiled my father. "I just put that in to make it +hard." + -- Leo Rosten, "The Joys of Yiddish" +%% +The First Rule of Program Optimization: + Don't do it. + +The Second Rule of Program Optimization (for experts only!): + Don't do it yet. + -- Michael Jackson +%% +The fortune program is supported, in part, by user contributions and by +a major grant from the National Endowment for the Inanities. +%% +The generation of random numbers is too important to be left to +chance. +%% +The geographical center of Boston is in Roxbury. Due north of the +center we find the South End. This is not to be confused with South +Boston which lies directly east from the South End. North of the South +End is East Boston and southwest of East Boston is the North End. +%% +The goal of Computer Science is to build something that will last at +least until we've finished building it. +%% +The goal of science is to build better mousetraps. +The goal of nature is to build better mice. +%% +The gods gave man fire and he invented fire engines. They gave him +love and he invented marriage. +%% +THE GOLDEN RULE OF ARTS AND SCIENCES + The one who has the gold makes the rules. +%% +The Great Bald Swamp Hedgehog: + The Gerat Bald Swamp Hedgehog of Billericay displays, in +courtship, his single prickle and does impressions of Holiday Inn desk +clerks. Since this means him standing motionless for enormous periods +of time he is often eaten in full display by The Great Bald Swamp +Hedgehog Eater. + -- Mike Harding, "The Armchair Anarchist's Almanac" +%% +The hardest thing in the world to understand is the income tax. + -- Albert Einstein +%% +The hearing ear is always found close to the speaking tongue, +a custom whereof the memory of man runneth not howsomever to +the contrary, nohow. +%% +The Heineken Uncertainty Principle: + You can never be sure how many beers you had last night. +%% +The herd instinct among economists makes sheep look like independent +thinkers. +%% +The human animal differs from the lesser primates in his passion for +lists of "Ten Best". + -- H. Allen Smith +%% +The human mind ordinarily operates at only ten percent of its capacity +-- the rest is overhead for the operating system. +%% +The human mind treats a new idea the way the body treats a strange +protein -- it rejects it. + -- P. Medawar +%% +The human race has one really effective weapon, and that is laughter. + -- Mark Twain +%% +"The illegal we do immediately. The unconstitutional takes a bit +longer." + -- Henry Kissinger +%% +The individual choice of garnishment of a burger can be an important +point to the consumer in this day when individualism is an increasingly +important thing to people. + -- Donald N. Smith, president of Burger King +%% +The IQ of the group is the lowest IQ of a member of the group divided +by the number of people in the group. +%% +The IRS spends God knows how much of your tax money on these toll-free +information hot lines staffed by IRS employees, whose idea of a +dynamite tax tip is that you should print neatly. If you ask them a +real tax question, such as how you can cheat, they're useless. + +So, for guidance, you want to look to big business. Big business never +pays a nickel in taxes, according to Ralph Nader, who represents a big +consumer organization that never pays a nickel in taxes... + -- Dave Barry, "Sweating Out Taxes" +%% +The Kennedy Constant: + Don't get mad -- get even. +%% +The Killer Ducks are coming!!! +%% +The ladies men admire, I've heard, +Would shudder at a wicked word. +Their candle gives a single light; +They'd rather stay at home at night. +They do not keep awake till three, +Nor read erotic poetry. +They never sanction the impure, +Nor recognize an overture. +They shrink from powders and from paints ... +So far, I've had no complaints. + -- Dorothy Parker +%% +The Law, in its majestic equality, forbids the rich, as well as the +poor, to sleep under the bridges, to beg in the streets, and to steal +bread. + -- Anatole France +%% +THE LESSER-KNOWN PROGRAMMING LANGUAGES #10 -- SIMPLE + +SIMPLE is an acronym for Sheer Idiot's Monopurpose Programming Language +Environment. This language, developed at the Hanover College for +Technological Misfits, was designed to make it impossible to write code +with errors in it. The statements are, therefore, confined to BEGIN, +END and STOP. No matter how you arrange the statements, you can't make +a syntax error. Programs written in SIMPLE do nothing useful. Thus +they achieve the results of programs written in other languages without +the tedious, frustrating process of testing and debugging. +%% +THE LESSER-KNOWN PROGRAMMING LANGUAGES #12 -- LITHP + +This otherwise unremarkable language is distinguished by the absence of +an "S" in its character set; users must substitute "TH". LITHP is said +to be useful in protheththing lithtth. +%% +THE LESSER-KNOWN PROGRAMMING LANGUAGES #13 -- SLOBOL + +SLOBOL is best known for the speed, or lack of it, of its compiler. +Although many compilers allow you to take a coffee break while they +compile, SLOBOL compilers allow you to travel to Bolivia to pick the +coffee. Forty-three programmers are known to have died of boredom +sitting at their terminals while waiting for a SLOBOL program to +compile. Weary SLOBOL programmers often turn to a related (but +infinitely faster) language, COCAINE. +%% +THE LESSER-KNOWN PROGRAMMING LANGUAGES #17 -- SARTRE + + Named after the late existential philosopher, SARTRE is an +extremely unstructured language. Statements in SARTRE have no purpose; +they just are. Thus SARTRE programs are left to define their own +functions. SARTRE programmers tend to be boring and depressed, and are +no fun at parties. +%% +THE LESSER-KNOWN PROGRAMMING LANGUAGES #17 -- SARTRE + +Named after the late existential philosopher, SARTRE is an extremely +unstructured language. Statements in SARTRE have no purpose; they just +are. Thus SARTRE programs are left to define their own functions. +SARTRE programmers tend to be boring and depressed, and are no fun at +parties. +%% +THE LESSER-KNOWN PROGRAMMING LANGUAGES #18 -- C- + +This language was named for the grade received by its creator when he +submitted it as a class project in a graduate programming class. C- is +best described as a "low-level" programming language. In fact, the +language generally requires more C- statements than machine-code +statements to execute a given task. In this respect, it is very +similar to COBOL. +%% +THE LESSER-KNOWN PROGRAMMING LANGUAGES #18 -- FIFTH + +FIFTH is a precision mathematical language in which the data types +refer to quantity. The data types range from CC, OUNCE, SHOT, and +JIGGER to FIFTH (hence the name of the language), LITER, MAGNUM and +BLOTTO. Commands refer to ingredients such as CHABLIS, CHARDONNAY, +CABERNET, GIN, VERMOUTH, VODKA, SCOTCH, and WHATEVERSAROUND. + +The many versions of the FIFTH language reflect the sophistication and +financial status of its users. Commands in the ELITE dialect include +VSOP and LAFITE, while commands in the GUTTER dialect include HOOTCH +and RIPPLE. The latter is a favorite of frustrated FORTH programmers +who end up using this language. +%% +The light at the end of the tunnel is the headlight of an approaching +train. +%% +The lion and the calf shall lie down together but the calf won't get +much sleep. + -- Woody Allen +%% +The longer I am out of office, the more infallible I appear to myself. + -- Henry Kissinger +%% +"The Lord gave us farmers two strong hands so we could grab as much as +we could with both of them." + -- Joseph Heller, "Catch-22" +%% +The man who follows the crowd will usually get no further than the +crowd. The man who walks alone is likely to find himself in places no +one has ever been. + -- Alan Ashley-Pitt +%% +The marvels of today's modern technology include the development of a +soda can, when discarded will last forever ... and a $7,000 car which +when properly cared for will rust out in two or three years. +%% +The meek shall inherit the earth -- they are too weak to refuse. +%% + The men sat sipping their tea in silence. After a while the +klutz said, "Life is like a bowl of sour cream." + + "Like a bowl of sour cream?" asked the other. "Why?" + + "How should I know? What am I, a philosopher?" +%% +The moon may be smaller than Earth, but it's further away. +%% +The more laws and order are made prominent, the more thieves and +robbers there will be. + -- Lao Tsu +%% +The more things change, the more they stay insane. +%% +The more we disagree, the more chance there is that at least one of us +is right. +%% +The mosquito is the state bird of New Jersey. + -- Andy Warhol +%% +The most exciting phrase to hear in science, the one that heralds new +discoveries, is not "Eureka!" (I found it!) but "That's funny ..." + -- Isaac Asimov +%% +The moving cursor writes, and having written, blinks on. +%% +The National Short-Sleeved Shirt Association says: + Support your right to bare arms! +%% +The new Congressmen say they're going to turn the government around. I +hope I don't get run over again. +%% +The New Testament offers the basis for modern computer coding theory, +in the form of an affirmation of the binary number system. + + But let your communication be Yea, yea; nay, nay: for + whatsoever is more than these cometh of evil. + -- Matthew 5:37 +%% +The nice thing about standards is that there are so many of them to +choose from. + -- Andrew S. Tanenbaum +%% +The notion of a "record" is an obsolete remnant of the days of the +80-column card. + -- Dennis M. Ritchie +%% +The objective of all dedicated employees should be to thoroughly +analyze all situations, anticipate all problems prior to their +occurrence, have answers for these problems, and move swiftly to solve +these problems when called upon. + +However, When you are up to your ass in alligators it is difficult to +remind yourself your initial objective was to drain the swamp. +%% +The Official MBA Handbook on business cards: + + Avoid overly pretentious job titles such as "Lord of the Realm, + Defender of the Faith, Emperor of India" or "Director of + Corporate Planning." +%% +The older a man gets, the farther he had to walk to school as a boy. +%% +The one good thing about repeating your mistakes is that you know when +to cringe. +%% +The only possible interpretation of any research whatever in the +`social sciences' is: some do, some don't. + -- Ernest Rutherford +%% +The only problem with being a man of leisure is that you can never stop +and take a rest. +%% +The only thing to do with good advice is pass it on. It is never any +use to oneself. + -- Oscar Wilde +%% +The only way to get rid of a temptation is to yield to it. + -- Oscar Wilde +%% +The opossum is a very sophisticated animal. It doesn't even get up +until 5 or 6 pm. +%% +The opposite of a profound truth may well be another profound truth. + -- Bohr +%% +The optimum committee has no members. + -- Norman Augustine +%% +The owner of a large furniture store in the mid-west arrived in France +on a buying trip. As he was checking into a hotel he struck up an +acquaintance with a beautiful young lady. However, she only spoke +French and he only spoke English, so each couldn't understand a word +the other spoke. He took out a pencil and a notebook and drew a +picture of a taxi. She smiled, nodded her head and they went for a +ride in the park. Later, he drew a picture of a table in a restaurant +with a question mark and she nodded, so they went to dinner. After +dinner he sketched two dancers and she was delighted. They went to +several nightclubs, drank champagne, danced and had a glorious +evening. It had gotten quite late when she motioned for the pencil and +drew a picture of a four-poster bed. He was dumbfounded, and has never +be able to understand how she knew he was in the furniture business. +%% +The past always looks better than it was. It's only pleasant because +it isn't here. + -- Finley Peter Dunne (Mr. Dooley) +%% + The people of Halifax invented the trampoline. During the +Victorian period the tripe-dressers of Halifax stretched tripe across a +large wooden frame and jumped up and down on it to `tender and dress' +it. The tripoline, as they called it, degenerated into becoming the +apparatus for a spectator sport. + + The people of Halifax also invented the harmonium, a device for +castrating pigs during Sunday service. + -- Mike Harding, "The Armchair Anarchist's Almanac" +%% +The Pig, if I am not mistaken, +Gives us ham and pork and Bacon. +Let others think his heart is big, +I think it stupid of the Pig. + -- Ogden Nash +%% +The pitcher wound up and he flang the ball at the batter. The batter +swang and missed. The pitcher flang the ball again and this time the +batter connected. He hit a high fly right to the center fielder. The +center fielder was all set to catch the ball, but at the last minute +his eyes were blound by the sun and he dropped it. + -- Dizzy Dean +%% +The pitcher wound up and he flang the ball at the batter. The batter +swang and missed. The pitcher flang the ball again and this time the +batter connected. He hit a high fly right to the center fielder. The +center fielder was all set to catch the ball, but at the last minute +his eyes were blound by the sun and he dropped it. + -- Dizzy Dean +%% +The Preacher, the Politicain, the Teacher, + Were each of them once a kiddie. +A child, indeed, is a wonderful creature. + Do I want one? God Forbiddie! + -- Ogden Nash +%% +The primary purpose of the DATA statement is to give names to +constants; instead of referring to pi as 3.141592653589793 at every +appearance, the variable PI can be given that value with a DATA +statement and used instead of the longer form of the constant. This +also simplifies modifying the program, should the value of pi change. + -- FORTRAN manual for Xerox Computers +%% +The probability of someone watching you is proportional to the +stupidity of your action. +%% +The problem ... is that we have run out of dinosaurs to form oil with. +Scientists working for the Department of Energy have tried to form oil +using other animals; they've piled thousands of tons of sand and Middle +Eastern countries on top of cows, raccoons, haddock, laboratory rats, +etc., but so far all they have managed to do is run up an enormous +bulldozer-rental bill and anger a lot of Middle Eastern persons. None +of the animals turned into oil, although most of the laboratory rats +developed cancer. + -- Dave Barry, "Postpetroleum Guzzler" +%% +The problem with any unwritten law is that you don't know where to go +to erase it. + -- Glaser and Way +%% +The problem with people who have no vices is that generally you can be +pretty sure they're going to have some pretty annoying virtues. + -- Elizabeth Taylor +%% +The problem with the gene pool is that there is no lifeguard. +%% +The Psblurtex is an 18-inch long anaconda that hides in the gentlemen's +outfitting departments of Amazonian stores and is often bought by +mistake since its colors are those of the London Reform Club. Once +tied around its victim's neck, it strangles him gently and then claims +the insurance before running off to Germany where it lives in hiding. + -- Mike Harding, "The Armchair Anarchist's Almanac" +%% +"The pyramid is opening!" +"Which one?" +"The one with the ever-widening hole in it!" + -- Firesign Theater, "How Can You Be In Two Places At + Once When You're Not Anywhere At All" +%% +The rain it raineth on the just + And also on the unjust fella, +But chiefly on the just, because + The unjust steals the just's umbrella. +%% +The reason computer chips are so small is computers don't eat much. +%% +The reasonable man adapts himself to the world; the unreasonable one +persists in trying to adapt the world to himself. Therefore all +progress depends on the unreasonable man. + -- George Bernard Shaw +%% +The revolution will not be televised. +%% +The reward of a thing well done is to have done it. + -- Emerson +%% +The right half of the brain controls the left half of the body. +This means that only left handed people are in their right mind. +%% +The Roman Rule + The one who says it cannot be done should never interrupt the + one who is doing it. +%% +The Ruffed Pandanga of Borneo and Rotherham spreads out his feathers in +his courtship dance and imitates Winston Churchill and Tommy Cooper on +one leg. The padanga is dying out because the female padanga doesn't +take it too seriously. + -- Mike Harding, "The Armchair Anarchist's Almanac" +%% +The Schwine-Kitzenger Institute study of 47 men over the age of 100 +showed that all had these things in common: + + 1. They all had moderate appetites. + 2. They all came from middle class homes + 3. All but two of them were dead. +%% + The seven eyes of Ningauble the Wizard floated back to his hood +as he reported to Fafhrd: "I have seen much, yet cannot explain all. +The Gray Mouser is exactly twenty-five feet below the deepest cellar in +the palace of Gilpkerio Kistomerces. Even though twenty-four parts in +twenty-five of him are dead, he is alive. + + "Now about Lankhmar. She's been invaded, her walls breached +everywhere and desperate fighting is going on in the streets, by a +fierce host which out-numbers Lankhamar's inhabitants by fifty to one +-- and equipped with all modern weapons. Yet you can save the city." + + "How?" demanded Fafhrd. + + Ningauble shrugged. "You're a hero. You should know." + -- Fritz Leiber, from "The Swords of Lankhmar" +%% +The shortest distance between two points is under construction. + -- Noelie Altito +%% +"The society which scorns excellence in plumbing as a humble activity +and tolerates shoddiness in philosophy because it is an exaulted +activity will have neither good plumbing nor good philosophy ... +neither its pipes nor its theories will hold water." +%% +"The sooner you fall behind, the more time you'll have to catch up!" +%% + The STAR WARS Song + Sung to the tune of "Lola", by the Kinks: + +I met him in a swamp down in Dagobah +Where it bubbles all the time like a giant cabinet soda + S-O-D-A soda +I saw the little runt sitting there on a log +I asked him his name and in a raspy voice he said Yoda + Y-O-D-A Yoda, Yo-Yo-Yo-Yo Yoda + +Well I've been around but I ain't never seen +A guy who looks like a Muppet but he's wrinkled and green + Oh my Yoda, Yo-Yo-Yo-Yo Yoda +Well I'm not dumb but I can't understand +How he can raise me in the air just by raising his hand + Oh my Yoda, Yo-Yo-Yo-Yo Yoda, Yo-Yo-Yo-Yo Yoda +%% +The steady state of disks is full. + --Ken Thompson +%% + THE STORY OF CREATION + or + THE MYTH OF URK + +In the beginning there was data. The data was without form and null, +and darkness was upon the face of the console; and the Spirit of IBM +was moving over the face of the market. And DEC said, "Let there be +registers"; and there were registers. And DEC saw that they carried; +and DEC separated the data from the instructions. DEC called the data +Stack, and the instructions they called Code. And there was evening +and there was morning, one interrupt ... + -- Rico Tudor +%% +The sun was shining on the sea, +Shining with all his might: +He did his very best to make +The billows smooth and bright -- +And this was very odd, because it was +The middle of the night. + -- Lewis Carroll, "Through the Looking Glass" +%% +The superfluous is very necessary. + -- Voltaire +%% +The temperature of Heaven can be rather accurately computed. Our +authority is Isaiah 30:26, "Moreover, the light of the Moon shall be as +the light of the Sun and the light of the Sun shall be sevenfold, as +the light of seven days." Thus Heaven receives from the Moon as much +radiation as we do from the Sun, and in addition 7*7 (49) times as much +as the Earth does from the Sun, or 50 times in all. The light we +receive from the Moon is one 1/10,000 of the light we receive from the +Sun, so we can ignore that ... The radiation falling on Heaven will +heat it to the point where the heat lost by radiation is just equal to +the heat received by radiation, i.e., Heaven loses 50 times as much +heat as the Earth by radiation. Using the Stefan-Boltzmann law for +radiation, (_H/_E)^4 = 50, where _E is the absolute temperature of the +earth (-300K), gives _H as 798K (525C). The exact temperature of Hell +cannot be computed ... [However] Revelations 21:8 says "But the +fearful, and unbelieving ... shall have their part in the lake which +burneth with fire and brimstone." A lake of molten brimstone means +that its temperature must be at or below the boiling point, 444.6C. We +have, then, that Heaven, at 525C is hotter than Hell at 445C. + -- From "Applied Optics" vol. 11, A14, 1972 +%% +The Third Law of Photography: + If you did manage to get any good shots, they will be ruined + when someone inadvertently opens the darkroom door and all of + the dark leaks out. +%% +The three laws of thermodynamics: + +The First Law: You can't get anything without working for it. +The Second Law: The most you can accomplish by working is to break + even. +The Third Law: You can only break even at absolute zero. +%% +The trouble with a kitten is that +When it grows up, it's always a cat + -- Ogden Nash. +%% +The trouble with being poor is that it takes up all your time. +%% +The trouble with being punctual is that people think you have nothing +more important to do. +%% +The trouble with doing something right the first time is that nobody +appreciates how difficult it was. +%% +The truth of a proposition has nothing to do with its credibility. And +vice versa. +%% +The turtle lives 'twixt plated decks +Which practically conceal its sex. +I think it clever of the turtle +In such a fix to be so fertile. + -- Ogden Nash +%% +The typewriting machine, when played with expression, is no more +annoying than the piano when played by a sister or near relation. + -- Oscar Wilde +%% +The University of California Bears announced the signing of Reggie +Philbin to a letter of intent to attend Cal next Fall. Philbin is said +to make up for no talent by cheating well. Says Philbin of his +decision to attend Cal, "I'm in it for the free ride." +%% +The USA is so enormous, and so numerous are its schools, colleges and +religious seminaries, many devoted to special religious beliefs ranging +from the unorthodox to the dotty, that we can hardly wonder at its +yielding a more bounteous harvest of gobbledegook than the rest of the +world put together. + -- Sir Peter Medawar +%% +The USA is so enormous, and so numerous are its schools, colleges and +religious seminaries, many devoted to special religious beliefs ranging +from the unorthodox to the dotty, that we can hardly wonder at its +yielding a more bounteous harvest of gobbledygook than the rest of the +world put together. + -- Sir Peter Medawar +%% +The use of COBOL cripples the mind; its teaching should, therefore, be +regarded as a criminal offense. + -- E. W. Dijkstra +%% +"The voters have spoken, the bastards ..." +%% +"The warning message we sent the Russians was a calculated ambiguity +that would be clearly understood." + -- Alexander Haig +%% +"The way to make a small fortune in the commodities market is to start +with a large fortune." +%% + THE WOMBAT + +The wombat lives across the seas, +Among the far Antipodes. +He may exist on nuts and berries, +Or then again, on missionaries; +His distant habitat precludes +Conclusive knowledge of his moods. +But I would not engage the wombat +In any form of mortal combat. +%% +The world is coming to an end! Repent and return those library books! +%% +The world is coming to an end. Please log off. +%% +The world's as ugly as sin, +And almost as delightful + -- Frederick Locker-Lampson +%% +The years of peak mental activity are undoubtedly between the ages of +four and eighteen. At four we know all the questions, at eighteen all +the answers. +%% +Then a man said: Speak to us of Expectations. + +He then said: If a man does not see or hear the waters of the Jordan, +then he should not taste the pomegranate or ply his wares in an open +market. + +If a man would not labour in the salt and rock quarries then he should +not accept of the Earth that which he refuses to give of himself. + +Such a man would expect a pear of a peach tree. +Such a man would expect a stone to lay an egg. +Such a man would expect Sears to assemble a lawnmower. + -- Kehlog Albran, "The Profit" +%% + THEORY +Into love and out again, + Thus I went and thus I go. +Spare your voice, and hold your pen: + Well and bitterly I know +All the songs were ever sung, + All the words were ever said; +Could it be, when I was young, + Someone dropped me on my head? + -- Dorothy Parker +%% +There are four kinds of homicide: felonious, excusable, justifiable, +and praiseworthy ... + -- Ambrose Bierce, "The Devil's Dictionary" +%% +There are really not many jobs that actually require a penis or a +vagina, and all other occupations should be open to everyone. + -- Gloria Steinem +%% + There are some goyisha names that just about guarantee that +someone isn't Jewish. For example, you'll never meet a Jew named +Johnson or Wright or Jones or Sinclair or Ricks or Stevenson or Reid or +Larsen or Jenks. But some goyisha names just about guarantee that +every other person you meet with that name will be Jewish. Why is +this? + Who knows? Learned rabbis have pondered this question for +centuries and have failed to come up with an answer, and you think ___you +can find one? Get serious. You don't even understand why it's +forbidden to eat crab -- fresh cold crab with mayonnaise -- or lobster +-- soft tender morsels of lobster dipped in melted butter. You don't +even understand a simple thing like that, and yet you hope to discover +why there are more Jews named Miller than Katz? Fat Chance. + -- Arthur Naiman, "Every Goy's Guide to Yiddish" +%% +There are some micro-organisms that exhibit characteristics of both +plants and animals. When exposed to light they undergo photosynthesis; +and when the lights go out, they turn into animals. But then again, +don't we all? +%% +There are three kinds of lies: Lies, Damn Lies, and Statistics. + -- Disraeli +%% +"There are three possibilities: Pioneer's solar panel has turned away +from the sun; there's a large meteor blocking transmission; or someone +loaded Star Trek 3.2 into our video processor." +%% +There are three possible parts to a date, of which at least two must be +offered: entertainment, food, and affection. It is customary to begin +a series of dates with a great deal of entertainment, a moderate amount +of food, and the merest suggestion of affection. As the amount of +affection increases, the entertainment can be reduced proportionately. +When the affection IS the entertainment, we no longer call it dating. +Under no circumstances can the food be omitted. + -- Miss Manners' Guide to Excruciatingly Correct Behaviour +%% +There are three ways to get something done: + 1. Do it yourself. + 2. Hire someone to do it for you. + 3. Forbid your kids to do it. +%% +There are three ways to get something done: do it yourself, hire +someone, or forbid your kids to do it. +%% +There are two kinds of solar-heat systems: "passive" systems collect +the sunlight that hits your home, and "active" systems collect the +sunlight that hits your neighbors' homes, too. + -- Dave Barry, "Postpetroleum Guzzler" +%% +"There are two ways of disliking poetry; one way is to dislike it, the +other is to read Pope." + -- Oscar Wilde +%% +There are two ways to write error-free programs. Only the third one +works. +%% +There are very few personal problems that cannot be solved through a +suitable application of high explosives. +%% +There cannot be a crisis next week. My schedule is already full. + -- Henry Kissinger +%% +There has been an alarming increase in the number of things you know +nothing about. +%% +There is a great discovery still to be made in Literature: that of +paying literary men by the quantity they do NOT write. +%% +There is a green, multi-legged creature crawling on your shoulder. +%% +There is a theory that states: "If anyone finds out what the universe +is for it will disappear and be replaced by something more bazaarly +inexplicable." + +There is another theory that states: "This has already happened ...." + -- Donald Adams, "Hitch-Hikers Guide to the Galaxy" +%% +There is a theory which states that if ever anyone discovers exactly +what the Universe is for and why it is here, it will instantly +disappear and be replaced by something even more bizarre and +inexplicable. There is another theory which states that this has +already happened. + -- Donald Adams, "The Hitchhiker's Guide to the Galaxy" +%% +There is no distinctly native American criminal class except Congress. + -- Mark Twain +%% +There is no realizable power that man cannot, in time, fashion the +tools to attain, nor any power so secure that the naked ape will not +abuse it. So it is written in the genetic cards -- only physics and +war hold him in check. And also the wife who wants him home by five, +of course. + -- Encyclopadia Apocryphia, 1990 ed. +%% +There is no satisfaction in hanging a man who does not object to it + -- G. B. Shaw +%% +There is no substitute for good manners, except, perhaps, fast +reflexes. +%% +There is no time like the present for postponing what you ought to be +doing. +%% +There is only one thing in the world worse than being talked about, and +that is not being talked about. + -- Oscar Wilde +%% +There is something fascinating about science. One gets such wholesale +returns of conjecture out of such a trifling investment of fact. + -- Mark Twain +%% +There once was a girl named Irene +Who lived on distilled kerosene + But she started absorbin' + A new hydrocarbon +And since then has never benzene. +%% +There once was an old man from Esser, +Who's knowledge grew lesser and lesser. + It at last grew so small, + He knew nothing at all, +And now he's a College Professor. +%% +"There was a boy called Eustace Clarence Scrubb, and he almost deserved +it." + -- C. S. Lewis, The Chronicles of Narnia +%% +There was a plane crash over mid-ocean, and only three survivors were +left in the life-raft: the Pope, the President, and Mayor Daley. +Unfortunately, it was a one-man life-raft, and quickly sinking, so they +started debating who should be allowed to stay. + +The Pope pointed out that he was the spiritual leader of millions all +over the world, the President explained that if he died then America +would be stuck with the Vice-President, and so forth. Then Mayor Daley +said, "Look! We're not solving anything like this! The only fair +thing to do is to vote on it." So they did, and Mayor Daley won by 97 +votes. +%% +There was a young lady from Hyde +Who ate a green apple and died. + While her lover lamented + The apple fermented +And made cider inside her inside. +%% +There was a young man who said "God, +I find it exceedingly odd, + That the willow oak tree + Continues to be, +When there's no one about in the Quad." + +"Dear Sir, your astonishment's odd, +For I'm always about in the Quad; + And that's why the tree, + Continues to be," +Signed "Yours faithfully, God." +%% +There was a young poet named Dan, +Whose poetry never would scan. + When told this was so, + He said, "Yes, I know. +It's because I try to put every possible syllable into that last line that I can." +%% +There were in this country two very large monopolies. The larger of +the two had the following record: the Vietnam War, Watergate, double- +digit inflation, fuel and energy shortages, bankrupt airlines, and the +8-cent postcard. The second was responsible for such things as the +transistor, the solar cell, lasers, synthetic crystals, high fidelity +stereo recording, sound motion pictures, radio astronomy, negative +feedback, magnetic tape, magnetic "bubbles", electronic switching +systems, microwave radio and TV relay systems, information theory, the +first electrical digital computer, and the first communications +satellite. Guess which one got to tell the other how to run the +telephone business? +%% +There's a fine line between courage and foolishness. Too bad its not a +fence. +%% +There's an old proverb that says just about whatever you want it to. +%% +There's little in taking or giving, + There's little in water or wine: +This living, this living, this living, + Was never a project of mine. +Oh, hard is the struggle, and sparse is + The gain of the one at the top, +For art is a form of catharsis, + And love is a permanent flop, +And work is the province of cattle, + And rest's for a clam in a shell, +So I'm thinking of throwing the battle -- + Would you kindly direct me to hell? + -- Dorothy Parker +%% +There's no future in time travel +%% +There's no point in being grown up if you can't be childish sometimes. + -- Dr. Who +%% +There's no real need to do housework -- after four years it doesn't get +any worse. +%% +There's only one way to have a happy marriage and as soon as I learn +what it is I'll get married again. + -- Clint Eastwood +%% +There's so much plastic in this culture that vinyl leopard skin is +becoming an endangered synthetic. + -- Lily Tomlin +%% +"These are DARK TIMES for all mankind's HIGHEST VALUES!" +"These are DARK TIMES for FREEDOM and PROSPERITY!" +"These are GREAT TIMES to put your money on BAD GUY to kick the CRAP +out of MEGATON MAN!" +%% +These days the necessities of life cost you about three times what they +used to, and half the time they aren't even fit to drink. +%% +They also surf who only stand on waves. +%% +They spell it "da Vinci" and pronounce it "da Vinchy". Foreigners +always spell better than they pronounce. + -- Mark Twain +%% +"They told me I was gullible ... and I believed them!" +%% +They told me you had proven it When they discovered our results + About a month before. Their hair began to curl +The proof was valid, more or less Instead of understanding it + But rather less than more. We'd run the thing through PRL. + +He sent them word that we would try Don't tell a soul about all this + To pass where they had failed For it must ever be +And after we were done, to them A secret, kept from all the rest + The new proof would be mailed. Between yourself and me. + +My notion was to start again + Ignoring all they'd done +We quickly turned it into code + To see if it would run. +%% +They're only trying to make me LOOK paranoid! +%% +Things are more like they used to be than they are now. +%% +Things will be bright in P.M. A cop will shine a light in your face. +%% +Think big. Pollute the Mississippi. +%% +Think honk if you're a telepath. +%% +Think of it! With VLSI we can pack 100 ENIACs in 1 sq. cm.! +%% +Think of it! With VLSI we can pack 100 ENIACs in 1 sq. cm.! +%% +Think of your family tonight. Try to crawl home after the +computer crashes. +%% +Think twice before speaking, but don't say "think think click click". +%% +This fortune cookie program out of order. For those in desperate need, +please use the program "________randchar". This program generates random +characters, and, given enough time, will undoubtedly come up with +something profound. It will, however, take it no time at all to be +more profound than THIS program has ever been. +%% +This fortune intentionally not included. +%% +This fortune is false. +%% +"This is a country where people are free to practice their religion, +regardless of race, creed, color, obesity, or number of dangling +keys ..." +%% +This is for all ill-treated fellows + Unborn and unbegot, +For them to read when they're in trouble + And I am not. + -- A. E. Housman +%% +This is National Non-Dairy Creamer Week. +%% +THIS IS PLEDGE WEEK FOR THE FORTUNE PROGRAM + +If you like the fortune program, why not support it now with your +contribution of a pithy fortune, clean or obscene? We cannot continue +without your support. Less than 14% of all fortune users are +contributors. That means that 86% of you are getting a free ride. We +can't go on like this much longer. Federal cutbacks mean less money +for fortunes, and unless user contributions increase to make up the +difference, the fortune program will have to shut down between midnight +and 8 a.m. Don't let this happen. Mail your fortunes right now to +"fortune". Just type in your favorite pithy saying. Do it now before +you forget. Our target is 300 new fortunes by the end of the week. +Don't miss out. All fortunes will be acknowledged. If you contribute +30 fortunes or more, you will receive a free subscription to "The +Fortune Hunter", our monthly program guide. If you contribute 50 or +more, you will receive a free "Fortune Hunter" coffee mug .... +%% +This is the story of the bee +Whose sex is very hard to see + +You cannot tell the he from the she +But she can tell, and so can he + +The little bee is never still +She has no time to take the pill + +And that is why, in times like these +There are so many sons of bees. +%% +This life is a test. It is only a test. Had this been an actual life, +you would have received further instructions as to what to do and where +to go. +%% +This login session: $13.99, but for you $11.88 +%% +This planet has -- or rather had -- a problem, which was this: most of +the people living on it were unhappy for pretty much of the time. Many +solutions were suggested for this problem, but most of these were +largely concerned with the movements of small green pieces of paper, +which is odd because on the whole it wasn't the small green pieces of +paper that were unhappy. + -- Douglas Adams +%% + ... This striving for excellence extends into people's +personal lives as well. When '80s people buy something, they buy the +best one, as determined by (1) price and (2) lack of availability. +Eighties people buy imported dental floss. They buy gourmet baking +soda. If an '80s couple goes to a restaurant where they have made a +reservation three weeks in advance, and they are informed that their +table is available, they stalk out immediately, because they know it is +not an excellent restaurant. If it were, it would have an enormous +crowd of excellence-oriented people like themselves waiting, their +beepers going off like crickets in the night. An excellent restaurant +wouldn't have a table ready immediately for anybody below the rank of +Liza Minnelli. + -- Dave Barry, "In Search of Excellence" +%% +This will be a memorable month -- no matter how hard you try to forget +it. +%% + Thompson, if he is to be believed, has sampled the entire +rainbow of legal and illegal drugs in heroic efforts to feel better +than he does. + As for the truth about his health: I have asked around about +it. I am told that he appears to be strong and rosy, and steadily +sane. But we will be doing what he wants us to do, I think, if we +consider his exterior a sort of Dorian Gray facade. Inwardly, he is +being eaten alive by tinhorn politicians. + The disease is fatal. There is no known cure. The most we can +do for the poor devil, it seems to me, is to name his disease in his +honor. From this moment on, let all those who feel that Americans can +be as easily led to beauty as to ugliness, to truth as to public +relations, to joy as to bitterness, be said to be suffering from Hunter +Thompson's disease. I don't have it this morning. It comes and goes. +This morning I don't have Hunter Thompson's disease. + -- Kurt Vonnegut Jr. on Dr. Hunter S. Thompson: Excerpt + from "A Political Disease", Vonnegut's review of "Fear + and Loathing: On the Campaign Trail '72" +%% +Those who can't write, write manuals. +%% +Those who can, do. Those who can't, simulate. +%% +Those who educate children well are more to be honored than parents, +for these only gave life, those the art of living well. + -- Aristotle +%% +Those who in quarrels interpose, must often wipe a bloody nose. +%% +Those who make peaceful revolution impossible will make violent +revolution inevitable. + -- John F. Kennedy +%% +Three great scientific theories of the structure of the universe are +the molecular, the corpuscular and the atomic. A fourth affirms, with +Haeckel, the condensation or precipitation of matter from ether -- +whose existence is proved by the condensation or precipitation ... A +fifth theory is held by idiots, but it is doubtful if they know any +more about the matter than the others. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Time flies like an arrow +Fruit flies like a banana +%% +Time is nature's way of making sure that everything doesn't happen at +once. +%% + (to "The Caissons Go Rolling Along") +Scratch the disks, dump the core, Shut it down, pull the plug +Roll the tapes across the floor, Give the core an extra tug +And the system is going to crash. And the system is going to crash. +Teletypes smashed to bits. Mem'ry cards, one and all, +Give the scopes some nasty hits Toss out halfway down the hall +And the system is going to crash. And the system is going to crash. +And we've also found Just flip one switch +When you turn the power down, And the lights will cease to twitch +You turn the disk readers into trash. And the tape drives will crumble + in a flash. +Oh, it's so much fun, When the CPU +Now the CPU won't run Can print nothing out but "foo," +And the system is going to crash. The system is going to crash. +%% + To A Quick Young Fox: +Why jog exquisite bulk, fond crazy vamp, +Daft buxom jonquil, zephyr's gawky vice? +Guy fed by work, quiz Jove's xanthic lamp -- +Zow! Qualms by deja vu gyp fox-kin thrice. + -- Lazy Dog +%% +To be intoxicated is to feel sophisticated but not be able to say it. +%% +To be is to do. + -- I. Kant +To do is to be. + -- A. Sartre +Yabba-Dabba-Doo! + -- F. Flinstone +%% +To be sure of hitting the target, shoot first and, whatever you hit, +call it the target. +%% +To err is human, to forgive is Not Company Policy. +%% +To invent, you need a good imagination and a pile of junk. + -- Thomas Edison +%% +To iterate is human, to recurse, divine. +%% +To those accustomed to the precise, structured methods of conventional +system development, exploratory development techniques may seem messy, +inelegant, and unsatisfying. But it's a question of congruence: +precision and flexibility may be just as disfunctional in novel, +uncertain situations as sloppiness and vacillation are in familiar, +well-defined ones. Those who admire the massive, rigid bone structures +of dinosaurs should remember that jellyfish still enjoy their very +secure ecological niche. + -- Beau Sheil, "Power Tools for Programmers" +%% +"To vacillate or not to vacillate, that is the question ... or is it?" +%% +"To YOU I'm an atheist; to God, I'm the Loyal Opposition." + -- Woody Allen +%% +Today is a good day to bribe a high-ranking public official. +%% +Today is National Existential Ennui Awareness Day. +%% +Today is the first day of the rest of the mess +%% +Today is the tomorrow you worried about yesterday +%% +Today's scientific question is: What in the world is electricity? + +And where does it go after it leaves the toaster? + -- Dave Barry, "What is Electricity?" +%% +Tomorrow will be canceled due to lack of interest. +%% +Tonight's the night: Sleep in a eucalyptus tree. +%% +Too much of a good thing is WONDERFUL. + -- Mae West +%% +Travel important today; Internal Revenue men arrive tomorrow. +%% +Troubled day for virgins over 16 who are beautiful and wealthy and live +in eucalyptus trees. +%% +Truly great madness can not be achieved without significant +intelligence. + -- Henrik Tikkanen +%% +Truth will be out this morning. (Which may really mess things up.) +%% +Truthful, adj.: + Dumb and illiterate. +%% +Truthful, adj.: + Dumb and illiterate. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Try not to have a good time ... This is supposed to be educational. + -- Charles Schulz +%% +Try to be the best of whatever you are, even if what you are is no +good. +%% +Try to get all of your posthumous medals in advance. +%% +Trying to be happy is like trying to build a machine for which the only +specification is that it should run noiselessly. +%% +Turnaucka's Law: + The attention span of a computer is only as long as its + electrical cord. +%% +Tussman's Law: + Nothing is as inevitable as a mistake whose time has come. +%% +TV is chewing gum for the eyes. + -- Frank Lloyd Wright +%% +'Twas midnight, and the UNIX hacks +Did gyre and gimble in their cave +All mimsy was the CS-VAX +And Cory raths outgrave. + +"Beware the software rot, my son! +The faults that bite, the jobs that thrash! +Beware the broken pipe, and shun +The frumious system crash!" +%% + 'Twas the Night before Crisis + +'Twas the night before crisis, and all through the house, + Not a program was working not even a browse. +The programmers were wrung out too mindless to care, + Knowing chances of cutover hadn't a prayer. +The users were nestled all snug in their beds, + While visions of inquiries danced in their heads. +When out in the lobby there arose such a clatter, + I sprang from my tube to see what was the matter. +And what to my wondering eyes should appear, + But a Super Programmer, oblivious to fear. +More rapid than eagles, his programs they came, + And he whistled and shouted and called them by name; +On Update! On Add! On Inquiry! On Delete! + On Batch Jobs! On Closing! On Functions Complete! +His eyes were glazed over, his fingers were lean, + From Weekends and nights in front of a screen. +A wink of his eye, and a twist of his head, + Soon gave me to know I had nothing to dread... +%% +'Twas the nocturnal segment of the diurnal period + preceding the annual Yuletide celebration, And + throughout our place of residence, +Kinetic activity was not in evidence among the + possessors of this potential, including that + species of domestic rodent known as Mus musculus. +Hosiery was meticulously suspended from the forward + edge of the woodburning caloric apparatus, +Pursuant to our anticipatory pleasure regarding an + imminent visitation from an eccentric + philanthropist among whose folkloric appelations + is the honorific title of St. Nicklaus ... +%% +Two can Live as Cheaply as One for Half as Long. + -- Howard Kandel +%% +Two percent of zero is almost nothing. +%% +UFO's are for real: the Air Force doesn't exist. +%% +"Uncle Cosmo ... why do they call this a word processor?" + +"It's simple, Skyler ... you've seen what food processors do to food, +right?" + -- MacNelley, "Shoe" +%% +Uncle Ed's Rule of Thumb: + Never use your thumb for a rule. You'll either hit it with a + hammer or get a splinter in it. +%% +Under deadline pressure for the next week. If you want something, it +can wait. Unless it's blind screaming paroxysmally hedonistic ... +%% +Underlying Principle of Socio-Genetics: + Superiority is recessive. +%% +Unfair animal names: + +-- tsetse fly -- bullhead +-- booby -- duck-billed platypus +-- sapsucker -- Clarence + -- Gary Larson +%% +United Nations, New York, December 25. The peace and joy of the +Christmas season was marred by a proclamation of a general strike of +all the military forces of the world. Panic reigns in the hearts of +all the patriots of every persuasion. + +Meanwhile, fears of universal disaster sank to an all-time low over the +world. + -- Isaac Asimov +%% +Universe, n.: + The problem. +%% +University, n.: + Like a software house, except the software's free, and it's +usable, and it works, and if it breaks they'll quickly tell you how to +fix it, and ... +%% +Unnamed Law: + If it happens, it must be possible. +%% +Unquestionably, there is progress. The average American now pays out +twice as much in taxes as he formerly got in wages. + -- H. L. Mencken +%% +Usage: fortune -P [] -a [xsz] [Q: [file]] [rKe9] -v6[+] dataspec ... inputdir +%% +User n.: + A programmer who will believe anything you tell him. +%% +Using TSO is like kicking a dead whale down the beach. + -- S. C. Johnson +%% +Vail's Second Axiom: + The amount of work to be done increases in proportion to the + amount of work already completed. +%% +Van Roy's Law: + An unbreakable toy is useful for breaking other toys. +%% +Velilind's Laws of Experimentation: + 1. If reproducibility may be a problem, conduct the test only + once. + 2. If a straight line fit is required, obtain only two data + points. +%% + "Verily and forsooth," replied Goodgulf darkly. "In the past +year strange and fearful wonders I have seen. Fields sown with barley +reap crabgrass and fungus, and even small gardens reject their +artichoke hearts. There has been a hot day in December and a blue +moon. Calendars are made with a month of Sundays and a blue-ribbon +Holstein bore alive two insurance salesmen. The earth splits and the +entrails of a goat were found tied in square knots. The face of the +sun blackens and the skies have rained down soggy potato chips." + + "But what do all these things mean?" gasped Frito. + + "Beats me," said Goodgulf with a shrug, "but I thought it made +good copy." + -- Harvard Lampoon, "Bored of the Rings" +%% +Very few profundities can be expressed in less than 80 characters. +%% +Violence is the last refuge of the incompetent. + -- Salvor Hardin +%% +VIRGO (Aug 23 - Sept 22) + Learn something new today, like how to spell or how to count to + ten without using your fingers. Be careful dressing this + morning. You may be hit by a car later in the day and you + wouldn't want to be taken to the doctor's office in some of + that old underwear you own. +%% + VIRGO (Aug 23 - Sept 22) +You are the logical type and hate disorder. This nitpicking is +sickening to your friends. You are cold and unemotional and sometimes +fall asleep while making love. Virgos make good bus drivers. +%% +Virtue is its own punishment. +%% +Vital papers will demonstrate their vitality by spontaneously moving +from where you left them to where you can't find them. +%% +Vitamin C deficiency is apauling +%% +Vote anarchist +%% +"Wagner's music is better than it sounds." + -- Mark Twain +%% +Waiter: "Tea or coffee, gentlemen?" +1st customer: "I'll have tea." +2nd customer: "Me, too -- and be sure the glass is clean!" + (Waiter exits, returns) +Waiter: "Two teas. Which one asked for the clean glass?" +%% +War hath no fury like a non-combatant. + -- Charles Edward Montague +%% +WARNING: + Reading this fortune can affect the dimensionality of your + mind, change the curvature of your spine, cause the growth of + hair on your palms, and make a difference in the outcome of + your favorite war. +%% +Washington [D.C.] is a city of Southern efficiency and Northern charm. + -- John F. Kennedy +%% +Wasting time is an important part of living. +%% +Watson's Law: + The reliability of machinery is inversely proportional to the + number and significance of any persons watching it. +%% +We ARE as gods and might as well get good at it. + -- Whole Earth Catalog +%% +We are confronted with insurmountable opportunities. + -- Walt Kelly, "Pogo" +%% +We are confronted with insurmountable opportunities. + -- Walt Kelly, "Pogo" +%% +We can defeat gravity. The problem is the paperwork involved. +%% +"We don't care. We don't have to. We're the Phone Company." +%% +We don't understand the software, and sometimes we don't understand the +hardware, but we can *___see* the blinking lights! +%% +We have met the enemy, and he is us. + -- Walt Kelly +%% +"We have reason to believe that man first walked upright to free his +hands for masturbation." + -- Lily Tomlin +%% +We may not return the affection of those who like us, but we always +respect their good judgement. +%% +We must remember the First Amendment which protects any shrill jackass +no matter how self-seeking. + -- F. G. Withington +%% +We really don't have any enemies. It's just that some of our best +friends are trying to kill us. +%% + We were young and our happiness dazzled us with its strength. +But there was also a terrible betrayal that lay within me like a Merle +Haggard song at a French restaurant. ... + I could not tell the girl about the woman of the tollway, of +her milk white BMW and her Jordache smile. There had been a fight. I +had punched her boyfriend, who fought the mechanical bulls. Everyone +told him, "You ride the bull, senor. You do not fight it." But he was +lean and tough like a bad rib-eye and he fought the bull. And then he +fought me. And when we finished there were no winners, just men doing +what men must do. ... + "Stop the car," the girl said. There was a look of terrible +sadness in her eyes. She knew about the woman of the tollway. I knew +not how. I started to speak, but she raised an arm and spoke with a +quiet and peace I will never forget. + "I do not ask for whom's the tollway belle," she said, "the +tollway belle's for thee." + The next morning our youth was a memory, and our happiness was +a lie. Life is like a bad margarita with good tequila, I thought as I +poured whiskey onto my granola and faced a new day. + -- Peter Applebome, International Imitation Hemingway + Competition +%% +We will have solar energy as soon as the utility companies solve one +technical problem -- how to run a sunbeam through a meter. +%% +we will invent new lullabies, new songs, new acts of love, +we will cry over things we used to laugh & +our new wisdom will bring tears to eyes of gentile +creatures from other planets who were afraid of us till then & +in the end a summer with wild winds & +new friends will be. +%% +We wish you a Hare Krishna +We wish you a Hare Krishna +We wish you a Hare Krishna +And a Sun Myung Moon! + -- Maxwell Smart +%% +"We'll cross out that bridge when we come back to it later." +%% +We're deep into the holiday gift-giving season, as you can tell from +the fact that everywhere you look, you see jolly old St. Nick urging +you to purchase things, to the point where you want to slug him right +in his bowl full of jelly. + -- Dave Barry, "Simple, Homespun Gifts" +%% +We've sent a man to the moon, and that's 29,000 miles away. The center +of the Earth is only 4,000 miles away. You could drive that in a week, +but for some reason nobody's ever done it. + -- Andy Rooney +%% +Weiler's Law: + Nothing is impossible for the man who doesn't have to do it + himself. +%% +Weinberg's First Law: + Progress is made on alternate Fridays. +%% +Weinberg's Principle: + An expert is a person who avoids the small errors while + sweeping on to the grand fallacy. +%% +Weinberg's Second Law: + If builders built buildings the way programmers wrote programs, + then the first woodpecker that came along would destroy + civilization. +%% +Weiner's Law of Libraries: + There are no answers, only cross references. +%% +Well, I would -- if they realized that we -- again if -- if we led them +back to that stalemate only because our retaliatory power, our seconds, +or strike at them after our first strike, would be so destructive they +they couldn't afford it, that would hold them off. + -- President Ronald Reagan, on the MX missile +%% +"Well, if you can't believe what you read in a comic book, what *___can* +you believe?!" + -- Bullwinkle J. Moose [Jay Ward] +%% +Well, my terminal's locked up, and I ain't got any Mail, + And I can't recall the last time that my program didn't fail; +I've got stacks in my structs, I've got arrays in my queues, + I've got the : Segmentation violation -- Core dumped blues. + +If you think that it's nice that you get what you C, + Then go : illogical statement with your whole family, +'Cause the Supreme Court ain't the only place with : Bus error views. + I've got the : Segmentation violation -- Core dumped blues. + +On a PDP-11, life should be a breeze, + But with VAXen in the house even magnetic tapes would freeze. +Now you might think that unlike VAXen I'd know who I abuse, + I've got the : Segmentation violation -- Core dumped blues. + -- Core Dumped Blues +%% +Westheimer's Discovery: + A couple of months in the laboratory can frequently save a + couple of hours in the library. +%% +Wethern's Law: + Assumption is the mother of all screw-ups. +%% + "What do you give a man who has everything?" the pretty +teenager asked her mother. + "Encouragement, dear," she replied. +%% +What does it mean if there is no fortune for you? +%% +What garlic is to food, insanity is to art. +%% +What garlic is to salad, insanity is to art. +%% +What good is a ticket to the good life, if you can't find the +entrance? +%% +What good is having someone who can walk on water if you don't follow +in his footsteps? +%% +What I tell you three times is true. +%% +What I want is all of the power and none of the responsibility. +%% +What if everything is an illusion and nothing exists? In that case, I +definitely overpaid for my carpet. + -- Woody Allen, "Without Feathers" +%% +What if nothing exists and we're all in somebody's dream? Or what's +worse, what if only that fat guy in the third row exists? + -- Woody Allen, "Without Feathers" +%% +What is a magician but a practising theorist? + -- Obi-Wan Kenobi +%% +What is mind? No matter. +What is matter? Never mind. + -- Thomas Hewitt Key, 1799-1875 +%% +What is the difference between a Turing machine and the modern +computer? It's the same as that between Hillary's ascent of Everest +and the establishment of a Hilton on its peak. +%% +"What is the robbing of a bank compared to the FOUNDING of a bank?" + -- Bertold Brecht +%% +What is worth doing is worth the trouble of asking somebody to do. +%% +What makes the Universe so hard to comprehend is that there's nothing +to compare it with. +%% +What makes the universe so hard to comprehend is that there's nothing +to compare it with. +%% +What publishers are looking for these days isn't radical feminism. +It's corporate feminism -- a brand of feminism designed to sell books +and magazines, three-piece suits, airline tickets, Scotch, cigarettes +and, most important, corporate America's message, which runs: "Yes, +women were discriminated against in the past, but that unfortunate +mistake has been remedied; now every woman can attain wealth, prestige +and power by dint of individual rather than collective effort." + -- Susan Gordon +%% +What sane person could live in this world and not be crazy? + -- Ursula K. LeGuin +%% +What the hell, go ahead and put all your eggs in one basket. +%% +What the large print giveth, the small print taketh away. +%% +What this country needs is a dime that will buy a good five-cent +bagel. +%% +What this country needs is a dime that will buy a good five-cent +bagel. +%% +What this country needs is a good 5 dollar plasma weapon. +%% +What this country needs is a good five cent ANYTHING! +%% +What this country needs is a good five-cent nickel. +%% +What use is magic if it can't save a unicorn? + -- Peter S. Beagle, "The Last Unicorn" +%% +What with chromodynamics and electroweak too + Our Standardized Model should please even you, +Tho once you did say that of charm there was none + It took courage to switch as to say Earth moves not Sun. +Yet your state of the union penultimate large + Is the last known haunt of the Fractional Charge, +And as you surf in the hot tub with sourdough roll + Please ponder the passing of your sole Monopole. +Your Olympics were fun, you should bring them all back + For transsexual tennis or Anamalon Track, +But Hollywood movies remain sinfully crude + Whether seen on the telly or Remotely Viewed. +Now fasten your sunbelts, for you've done it once more, + You said it in Leipzig of the thing we adore, +That you've built an incredible crystalline sphere + Whose German attendants spread trembling and fear +Of the death of our theory by Particle Zeta + Which I'll bet is not there say your article, later. + -- Sheldon Glashow, Physics Today, Dec. 1984 +%% + "What's that thing?" + "Well, it's a highly technical, sensitive instrument we use in +computer repair. Being a layman, you probably can't grasp exactly what +it does. We call it a two-by-four." + -- Jeff MacNelly, "Shoe" +%% +Whatever became of eternal truth? +%% +Whatever became of Strange de Jim? Well, he found a substitute for +cocaine: "You cover Q-tips with sandpaper and ram them up your nostrils +as far as they will go. Then you sniff talcum powder while shredding +hundred dollar bills." + -- Herb Caen +%% +Whatever is not nailed down is mine. What I can pry loose is not +nailed down. + -- Collis P. Huntingdon +%% +When a Banker jumps out of a window, jump after him -- that's where the +money is. + -- Robespierre +%% +When a fellow says, "It ain't the money but the principle of the +thing," it's the money. + -- Kim Hubbard +%% +When a fly lands on the ceiling, does it do a half roll or a half +loop? +%% +When a place gets crowded enough to require ID's, social collapse is +not far away. It is time to go elsewhere. The best thing about space +travel is that it made it possible to go elsewhere. + -- Robert Heinlein +%% +When a shepherd goes to kill a wolf, and takes his dog along to see the +sport, he should take care to avoid mistakes. The dog has certain +relationships to the wolf the shepherd may have forgotten. + -- Robert Pirsig, "Zen and the Art of Motorcycle + Maintenance" +%% +When all other means of communication fail, try words. +%% +When does summertime come to Minnesota, you ask? Well, last year, I +think it was a Tuesday. +%% +When God endowed human beings with brains, He did not intend to +guarantee them. +%% +When I said "we", officer, I was referring to myself, the four young +ladies, and, of course, the goat. +%% +When I was a boy I was told that anybody could become President. Now +I'm beginning to believe it. + -- Clarence Darrow +%% +When I was in school, I cheated on my metaphysics exam: I looked into +the soul of the boy sitting next to me. + -- Woody Allen +%% +When I was younger, I could remember anything, whether it had happened +or not; but my faculties are decaying now and soon I shall be so I +cannot remember any but the things that never happened. It is sad to +go to pieces like this but we all have to do it. + -- Mark Twain +%% +When in doubt, do what the President does -- guess. +%% +"When in doubt, tell the truth." + -- Mark Twain +%% +When in doubt, use brute force. + -- Ken Thompson +%% +When love is gone, there's always justice. +And when justice is gone, there's always force. +And when force is gone, there's always Mom. +Hi, Mom! + -- Laurie Anderson +%% +When Marriage is Outlawed, +Only Outlaws will have Inlaws. +%% +When more and more people are thrown out of work, unemployment +results. + -- Calvin Coolidge +%% +When someone says "I want a programming language in which I need only +say what I wish done," give him a lollipop. +%% +"When the going gets tough, the tough get empirical" + -- Jon Carroll +%% +When the government bureau's remedies do not match your problem, you +modify the problem, not the remedy. +%% +When the Ngdanga tribe of West Africa hold their moon love ceremonies, +the men of the tribe bang their heads on sacred trees until they get a +nose bleed, which usually cures them of ____that. + -- Mike Harding, "The Armchair Anarchist's Almanac" +%% +When the Universe was not so out of whack as it is today, and all the +stars were lined up in their proper places, you could easily count them +from left to right, or top to bottom, and the larger and bluer ones +were set apart, and the smaller yellowing types pushed off to the +corners as bodies of a lower grade ... + -- Stanislaw Lem, "Cyberiad" +%% +When two people are under the influence of the most violent, most +insane, most delusive, and most transient of passions, they are +required to swear that they will remain in that excited, abnormal, and +exhausting condition continuously until death do them part. + -- George Bernard Shaw +%% +When we are planning for posterity, we ought to remember that virtue is +not hereditary. + -- Thomas Paine +%% +"When you are in it up to your ears, keep your mouth shut." +%% +When you do not know what you are doing, do it neatly. +%% + When you have shot and killed a man you have in some measure +clarified your attitude toward him. You have given a definite answer +to a definite problem. For better or worse you have acted decisively. + In a way, the next move is up to him. + -- R. A. Lafferty +%% +"When you have to kill a man it costs nothing to be polite." + -- Winston Curchill, On formal declarations of war +%% +When you make your mark in the world, watch out for guys with erasers. + -- The Wall Street Journal +%% +When you're away, I'm restless, lonely, +Wretched, bored, dejected; only +Here's the rub, my darling dear +I feel the same when you are near. + -- Samuel Hoffenstein, "When You're Away" +%% +When you're not looking at it, this fortune is written in FORTRAN. +%% +When you're not looking at it, this fortune is written in FORTRAN. +%% +Whenever anyone says, "theoretically", they really mean, "not really". + -- Dave Parnas +%% +Whenever I hear anyone arguing for slavery, I feel a strong impulse to +see it tried on him personally. + -- A. Lincoln +%% +Whenever people agree with me I always feel I must be wrong. + --Oscar Wilde +%% +Whenever the literary German dives into a sentence, that is the last +you are going to see of him until he emerges on the other side of his +Atlantic with his verb in his mouth. + -- Mark Twain + "Connecticut Yankee in King Arthur's Court" +%% +Whenever you find that you are on the side of the majority, it is time +to reform. + -- Mark Twain +%% +Whenever you find that you are on the side of the majority, it is time +to reform. + -- Mark Twain +%% +WHERE CAN THE MATTER BE + + Oh, dear, where can the matter be + When it's converted to energy? + There is a slight loss of parity. + Johnny's so long at the fair. +%% +Where humor is concerned there are no standards -- no one can say what +is good or bad, although you can be sure that everyone will. + -- John Kenneth Galbraith +%% +Where there's a will, there's an Inheritance Tax. +%% +Whether you can hear it or not +The Universe is laughing behind your back + -- National Lampoon, "Deteriorada" +%% +While anyone can admit to themselves they were wrong, the true test is +admission to someone else. +%% +While Europe's eye is fix'd on mighty things, +The fate of empires and the fall of kings; +While quacks of State must each produce his plan, +And even children lisp the Rights of Man; +Amid this mighty fuss just let me mention, +The Rights of Woman merit some attention. + -- Robert Burns, Address on "The Rights of Woman", + November 26, 1792 +%% +While money can't buy happiness, it certainly lets you choose your own +form of misery. +%% +While money doesn't buy love, it puts you in a great bargaining +position. +%% +While most peoples' opinions change, the conviction of their +correctness never does. +%% +While you don't greatly need the outside world, it's still very +reassuring to know that it's still there. +%% +While your friend holds you affectionately by both your hands you are +safe, for you can watch both of his. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Whistler's Law: + You never know who is right, but you always know who is in + charge. +%% +"Who cares if it doesn't do anything? It was made with our new +Triple-Iso-Bifurcated-Krypton-Gate-MOS process ..." +%% +Who made the world I cannot tell; +'Tis made, and here am I in hell. +My hand, though now my knuckles bleed, +I never soiled with such a deed. + -- A. E. Housman +%% +Who needs friends when you can sit alone in your room and drink? +%% +Who's on first? +%% +Whom computers would destroy, they must first drive mad. +%% +"Why be a man when you can be a success?" + -- Bertold Brecht +%% +Why did the Lord give us so much quickness of movement unless it was to +avoid responsibility with? +%% +Why did the Roman Empire collapse? What is the Latin for office +automation? +%% +Why does man kill? He kills for food. And not only food: frequently +there must be a beverage. + -- Woody Allen, "Without Feathers" +%% +Why I Can't Go Out With You: + +I'd LOVE to, but ... + -- I have to floss my cat. + -- I've dedicated my life to linguini. + -- I need to spend more time with my blender. + -- it wouldn't be fair to the other Beautiful People. + -- it's my night to pet the dog/ferret/goldfish. + -- I'm going downtown to try on some gloves. + -- I have to check the freshness dates on my dairy products. + -- I'm going down to the bakery to watch the buns rise. + -- I have an appointment with a cuticle specialist. + -- I have some really hard words to look up. + -- I've got a Friends of the Lowly Rutabaga meeting. + -- I promised to help a friend fold road maps. +%% +"Why is it that we rejoice at a birth and grieve at a funeral? It is +because we are not the person involved" + -- Mark Twain +%% +"Why isn't there a special name for the tops of your feet?" + -- Lily Tomlin +%% +Why not have an old-fashioned Christmas for your family this year? +Just picture the scene in your living room on Christmas morning as your +children open their old-fashioned presents. + +Your 11-year-old son: "What the heck is this?" + +You: "A spinning top! You spin it around, and then eventually it + falls down. What fun! Ha, ha!" + +Son: "Is this a joke? Jason Thompson's parents got him a computer + with two disk drives and 128 kilobytes of random-access memory, + and I get this cretin TOP?" + +Your 8-year-old daughter: "You think that's bad? Look at this." + +You: "It's figgy pudding! What a treat!" + +Daughter: "It looks like goat barf." + -- Dave Barry, "Simple, Homespun Gifts" +%% +"Why was I born with such contemporaries?" + -- Oscar Wilde +%% +Wiker's Law: + Government expands to absorb revenue and then some. +%% + William Safire's Rules for Writers: + +Remember to never split an infinitive. The passive voice should never +be used. Do not put statements in the negative form. Verbs have to +agree with their subjects. Proofread carefully to see if you words +out. If you reread your work, you can find on rereading a great deal +of repetition can be avoided by rereading and editing. A writer must +not shift your point of view. And don't start a sentence with a +conjunction. (Remember, too, a preposition is a terrible word to end a +sentence with.) Don't overuse exclamation marks!! Place pronouns as +close as possible, especially in long sentences, as of 10 or more +words, to their antecedents. Writing carefully, dangling participles +must be avoided. If any word is improper at the end of a sentence, a +linking verb is. Take the bull by the hand and avoid mixing +metaphors. Avoid trendy locutions that sound flaky. Everyone should +be careful to use a singular pronoun with singular nouns in their +writing. Always pick on the correct idiom. The adverb always follows +the verb. Last but not least, avoid cliches like the plague; seek +viable alternatives. +%% +Williams and Holland's Law: + If enough data is collected, anything may be proven by + statistical methods. +%% +Winter is the season in which people try to keep the house as warm as +it was in the summer, when they complained about the heat. +%% +Wit, n.: + The salt with which the American Humorist spoils his cookery +... by leaving it out. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +With a rubber duck, one's never alone. + -- "The Hitchhiker's Guide to the Galaxy" +%% +With all the fancy scientists in the world, why can't they just once +build a nuclear balm? +%% +With every passing hour our solar system comes forty-three thousand +miles closer to globular cluster M13 in the constellation Hercules, and +still there are some misfits who continue to insist that there is no +such thing as progress. + -- Ransom K. Ferm +%% +Without ice cream life and fame are meaningless. +%% +Wood is highly ecological, since trees are a renewable resource. If +you cut down a tree, another will grow in its place. And if you cut +down the new tree, still another will grow. And if you cut down that +tree, yet another will grow, only this one will be a mutation with +long, poisonous tentacles and revenge in its heart, and it will sit +there in the forest, cackling and making elaborate plans for when you +come back. + +Wood heat is not new. It dates back to a day millions of years ago, +when a group of cavemen were sitting around, watching dinosaurs rot. +Suddenly, lightning struck a nearby log and set it on fire. One of the +cavemen stared at the fire for a few minutes, then said: "Hey! Wood +heat!" The other cavemen, who did not understand English, immediately +beat him to death with stones. But the key discovery had been made, +and from that day forward, the cavemen had all the heat they needed, +although their insurance rates went way up. + -- Dave Barry, "Postpetroleum Guzzler" +%% +Workers of the world, arise! You have nothing to lose but your +chairs. +%% +Worst Month of 1981 for Downhill Skiing: + August. The lines are the shortest, though. + -- Steve Rubenstein +%% +Worst Month of the Year: + February. February has only 28 days in it, which means that if +you rent an apartment, you are paying for three full days you don't +get. Try to avoid Februarys whenever possible. + -- Steve Rubenstein +%% +Worst Vegetable of the Year: + The brussels sprout. This is also the worst vegetable of next +year. + -- Steve Rubenstein +%% +"Would you tell me, please, which way I ought to go from here?" + +"That depends a good deal on where you want to get to," said the Cat + -- Lewis Carrol +%% +Write-Protect Tab, n.: + A small sticker created to cover the unsightly notch carelessly +left by disk manufacturers. The use of the tab creates an error +message once in a while, but its aesthetic value far outweighs the +momentary inconvenience. + -- Robb Russon +%% +X-rated movies are all alike ... the only thing they leave to the +imagination is the plot. +%% +Xerox does it again and again and again and ... +%% +Xerox never comes up with anything original. +%% +"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. + -- S. C. Johnson, "Yacc guide acknowledgements" +%% +Year, n.: + A period of three hundred and sixty-five disappointments. + -- Ambrose Bierce, "The Devil's Dictionary" +%% +Yes, but every time I try to see things your way, I get a headache. +%% +Yes, but which self do you want to be? +%% +Yesterday I was a dog. Today I'm a dog. Tomorrow I'll probably still +be a dog. Sigh! There's so little hope for advancement. + -- Snoopy +%% +Yesterday upon the stair +I met a man who wasn't there. +He wasn't there again today -- +I think he's from the CIA. +%% +Yield to Temptation ... it may not pass your way again. + -- Lazarus Long, "Time Enough for Love" +%% +Yinkel, n.: + A person who combs his hair over his bald spot, hoping no one +will notice. + -- Rich Hall, "Sniglets" +%% +"You are old, Father William," the young man said, + "All your papers these days look the same; +Those William's would be better unread -- + Do these facts never fill you with shame?" + +"In my youth," Father William replied to his son, + "I wrote wonderful papers galore; +But the great reputation I found that I'd won, + Made it pointless to think any more." +%% +"You are old, father William," the young man said, + "And your hair has become very white; +And yet you incessantly stand on your head -- + Do you think, at your age, it is right?" + +"In my youth," father William replied to his son, + "I feared it might injure the brain; +But, now that I'm perfectly sure I have none, + Why, I do it again and again." + -- Lewis Carrol +%% +"You are old," said the youth, "and I'm told by my peers + That your lectures bore people to death. +Yet you talk at one hundred conventions per year -- + Don't you think that you should save your breath?" + +"I have answered three questions and that is enough," + Said his father, "Don't give yourself airs! +Do you think I can listen all day to such stuff? + Be off, or I'll kick you downstairs!" +%% +"You are old," said the youth, "and your jaws are too weak + For anything tougher than suet; +Yet you finished the goose, with the bones and the beak -- + Pray, how did you manage to do it?" + +"In my youth," said his father, "I took to the law, + And argued each case with my wife; +And the muscular strength which it gave to my jaw, + Has lasted the rest of my life." + -- Lewis Carrol +%% +"You are old," said the youth, "and your programs don't run, + And there isn't one language you like; +Yet of useful suggestions for help you have none -- + Have you thought about taking a hike?" + +"Since I never write programs," his father replied, + "Every language looks equally bad; +Yet the people keep paying to read all my books + And don't realize that they've been had." +%% +"You are old," said the youth, "as I mentioned before, + And have grown most uncommonly fat; +Yet you turned a back-somersault in at the door -- + Pray what is the reason of that?" + +"In my youth," said the sage, as he shook his grey locks, + "I kept all my limbs very supple +By the use of this ointment -- one shilling the box -- + Allow me to sell you a couple?" + -- Lewis Carrol +%% +"You are old," said the youth, "as I mentioned before, + And make errors few people could bear; +You complain about everyone's English but yours -- + Do you really think this is quite fair?" + +"I make lots of mistakes," Father William declared, + "But my stature these days is so great +That no critic can hurt me -- I've got them all scared, + And to stop me it's now far too late." +%% +"You are old," said the youth, "one would hardly suppose + That your eye was as steady as ever; +Yet you balanced an eel on the end of your nose -- + What made you so awfully clever?" + +"I have answered three questions, and that is enough," + Said his father. "Don't give yourself airs! +Do you think I can listen all day to such stuff? + Be off, or I'll kick you down stairs!" + -- Lewis Carrol +%% +You are only young once, but you can stay immature indefinitely. +%% +You are wise, witty, and wonderful, but you spend too much time reading +this sort of trash. +%% +You can always tell the Christmas season is here when you start getting +incredibly dense, tinfoil-and-ribbon- wrapped lumps in the mail. +Fruitcakes make ideal gifts because the Postal Service has been unable +to find a way to damage them. They last forever, largely because +nobody ever eats them. In fact, many smart people save the fruitcakes +they receive and send them back to the original givers the next year; +some fruitcakes have been passed back and forth for hundreds of years. + +The easiest way to make a fruitcake is to buy a darkish cake, then +pound some old, hard fruit into it with a mallet. Be sure to wear +safety glasses. + -- Dave Barry, "Simple, Homespun Gifts" +%% +You can create your own opportunities this week. Blackmail a senior +executive. +%% +You can get more of what you want with a kind word and a gun than you +can with just a kind word. + -- Bumper Sticker +%% +You can make it illegal, but you can't make it unpopular. +%% +You can measure a programmer's perspective by noting his attitude on +the continuing viability of FORTRAN. + -- Alan Perlis +%% +You can take all the impact that science considerations have on funding +decisions at NASA, put them in the navel of a flea, and have room left +over for a caraway seed and Tony Calio's heart. + -- F. Allen +%% +You can tell how far we have to go, when FORTRAN is the language of +supercomputers. + -- Steven Feiner +%% +You can't carve your way to success without cutting remarks. +%% +You can't judge a book by the way it wears its hair. +%% +You can't start worrying about what's going to happen. You get spastic +enough worrying about what's happening now. + -- Lauren Bacall +%% +"You can't teach people to be lazy - either they have it, or they +don't." + -- Dagwood Bumstead +%% +You cannot achieve the impossible without attempting the absurd. +%% +You cannot kill time without injuring eternity. +%% +You cannot propel yourself forward by patting yourself on the back. +%% +You could get a new lease on life -- if only you didn't need the first +and last month in advance. +%% +You couldn't even prove the White House staff sane beyond a reasonable +doubt. + -- Ed Meese, on the Hinckley verdict +%% +You don't have to think too hard when you talk to teachers. + -- J. D. Salinger +%% +You don't sew with a fork, so I see no reason to eat with knitting +needles. + -- Miss Piggy, on eating Chinese Food +%% +You first have to decide whether to use the short or the long form. The +short form is what the Internal Revenue Service calls "simplified", +which means it is designed for people who need the help of a Sears +tax-preparation expert to distinguish between their first and last +names. Here's the complete text: + + "1. How much did you make? (AMOUNT) + "2. How much did we here at the government take out? (AMOUNT) + "3. Hey! Sounds like we took too much! So we're going to + send an official government check for (ONE-FIFTEENTH OF + THE AMOUNT WE TOOK) directly to the (YOUR LAST NAME) + household at (YOUR ADDRESS), for you to spend in any way + you please! Which just goes to show you, (YOUR FIRST + NAME), that it pays to file the short form!" + +The IRS wants you to use this form because it gets to keep most of your +money. So unless you have pond silt for brains, you want the long +form. + -- Dave Barry, "Sweating Out Taxes" +%% +You have the capacity to learn from mistakes. You'll learn a lot +today. +%% +You know you've been spending too much time on the computer when your +friend misdates a check, and you suggest adding a "++" to fix it. +%% + "You know, it's at times like this when I'm trapped in a Vogon +airlock with a man from Betelgeuse and about to die of asphyxiation in +deep space that I really wish I'd listened to what my mother told me +when I was young!" + "Why, what did she tell you?" + "I don't know, I didn't listen!" + -- Douglas Adams, "Hitchhiker's Guide to the Galaxy" +%% +You may be recognized soon. Hide. +%% +You may have heard that a dean is to faculty as a hydrant is to a dog. + -- Alfred Kahn +%% +You men out there probably think you already know how to dress for +success. You know, for example, that you should not wear leisure suits +or white plastic belts and shoes, unless you are going to a costume +party disguised as a pig farmer vacationing at Disney World. + -- Dave Barry, "How to Dress for Real Success" +%% +You might have mail +%% +"You must realize that the computer has it in for you. The irrefutable +proof of this is that the computer always does what you tell it to do." +%% +You need no longer worry about the future. This time tomorrow you'll +be dead. +%% +You never know how many friends you have until you rent a house on the +beach. +%% +You or I must yield up his life to Ahrimanes. I would rather it were +you. I should have no hesitation in sacrificing my own life to spare +yours, but we take stock next week, and it would not be fair on the +company. + -- J. Wellington Wells +%% +You possess a mind not merely twisted, but actually sprained. +%% +You should emulate your heros, but don't carry it too far. Especially +if they are dead. +%% +You should never wear your best trousers when you go out to fight for +freedom and liberty. + -- Henrick Ibson +%% +You should not use your fireplace, because scientists now believe that, +contrary to popular opinion, fireplaces actually remove heat from +houses. Really, that's what scientists believe. In fact many +scientists actually use their fireplaces to cool their houses in the +summer. If you visit a scientist's house on a sultry August day, +you'll find a cheerful fire roaring on the hearth and the scientist +sitting nearby, remarking on how cool he is and drinking heavily. + -- Dave Barry, "Postpetroleum Guzzler" +%% +You will be a winner today. Pick a fight with a four-year-old. +%% +You will be surprised by a loud noise. +%% +You will be Told about it Tomorrow. Go Home and Prepare Thyself. +%% +You worry too much about your job. Stop it. You are not paid enough +to worry. +%% +"You'll never be the man your mother was!" +%% +You're at the end of the road again. +%% +You're being followed. Cut out the hanky-panky for a few days. +%% +You're never too old to become younger. + -- Mae West +%% +You're not drunk if you can lie on the floor without holding on. + -- Dean Martin +%% +You've been leading a dog's life. Stay off the furniture. +%% +Your analyst has you mixed up with another patient. Don't believe a +thing he tells you. +%% +Your conscience never stops you from doing anything. It just stops you +from enjoying it. +%% +Your fault: core dumped +%% +Your life would be very empty if you had nothing to regret. +%% +Your lucky color has faded. +%% +Your lucky number has been disconnected. +%% +Your lucky number is 3552664958674928. Watch for it everywhere. +%% +Your true value depends entirely on what you are compared with. +%% +Youth is when you blame all your troubles on your parents; maturity is +when you learn that everything is the fault of the younger generation. +%% +Zero Defects, n.: + The result of shutting down a production line. +%% +Zounds! I was never so bethumped with words +since I first called my brother's father dad. + -- William Shakespeare, "King John" +%% +Zymurgy's Law of Volunteer Labor: + People are always available for work in the past tense. diff --git a/games/fortune/scene.sp.ok b/games/fortune/scene.sp.ok new file mode 100644 index 0000000..27aaa3e --- /dev/null +++ b/games/fortune/scene.sp.ok @@ -0,0 +1,1175 @@ +A.A.A.A.A +A.D +A.M +a.m +AAAAAAAAAaaaaaaaaaaaaaaaccccccccckkkkkk +aafte +Abbie +absorbin +absurdum +acacia +accursed +ACLU's +acne +Adamite +adj +Adlai +adv +Aelius +Aesop +Ahrimanes +Albran +Aldous +alimentary +alkafluence +alleygaroo +Alo +alrighty +Altito +ALU +Amerigo +Amica +Amnesia +Amp +anal +Anamalon +Anat +Anatol +animalculous +Ankh +Anoint +anomali +Antonym +anxivs +Anytime +apauling +Apocryphia +appelations +Applebome +Apr +Aquadextrous +Aquarians +arabic +Ardis +arias +Arlo +arse +ary +Ashleigh +Asimov +Aspasia +Aspin +Assateague +Assoc +Asterix +astrology +ath +Atlee +atrium +Auden +ause +ausgraben +Avogardo +avoirdupois +awai +ay +B'nai +B.C +Bacall +Bachtrian +Bagdikian's +bagel +Bai +bai +Baines +bamboozled +Banach +Barach's +Barbie +barf +Baruch's +BASICs +Basie's +Baumol +bazingas +Beagle +BEANSTACK +Beatty +Beckett +bedecked +befriends +Begatting +Begone +Behaviour +Beifeld's +Belloc +bequeathin +Berke +Bertold +Bertolt +bethumped +bi +bibles +Bierce +Billericay +bingo +bisexual +blackguard +Blaise +BLOTTO +blound +Bok +Bokonon +Bolub's +Bombeck's +bonehead +Boob's +BOOGA +Boola +boola +Boothe +Boren's +Borge +bounteous +boyfriend +Boynton +Brandwein +Brecht +brilgue +brilig +Brith +brussels +Brutus +Buckminster +Bucy's +BULLWINKLE +Bullwinkle +Bumstead +Burggoven +burgled +burneth +Busmanship +BYOB +C.I.A +CABERNET +Caen +Caeser +Caeser's +Cahn's +Caissons +caliente +Calio's +calor +Camptown +Capt +carabineri +Carotene +Carotene's +Carperpetuation +Carrol +Casablanca +castrating +CChheecckk +Celibacy +Centauri +Cerebron +Cerebus +ch +CHARDONNAY +Charnock's +Cheatham +Chem +Chichester +childproof +Chism's +Chisolm's +Chloroplast's +chromodynamics +chronodimensional +Cianci +Ciardi +Cinemuck +Clopton +cm +cmptr +cn +cnt +cockamamie +Cogito +cogito +Collis +Colloq +Colvard's +Commie +Computerdom +conks +Constipation +Contrariwise +copacetic +corpuscle +Cory +Cosmo +CPU +CPU's +cpu's +Crabgrass +crabgrass +Cray +Cripps +crunchy +Crysler +CS +Curchill +curiae +cuticle +Cyberiad +Cybernetic +D'Arcy +D.C +da +Dabba +Daft +Dagobah +Dagwood +damnfoolproof +dandruff +dans +darkish +darkroom +Darrow +Darryl +Darth +dataspec +dduupplleexx +de +Decisionmaker +Defactualization +defamed +Degen +demo +deppart +dermis +destitution +Deteriorada +DETERIORATA +dev +DeVries's +diddie +Dijkstra +DINGELL +Dingell +Dirksen +Disco +discotheques +dishes +dishrags +Disraeli +dixerunt +dm +doderez +doggy +Dolph +Donatus +Doo +DOODAH +dost +doth +dotty +Drescher +Dristan +Dropt +Ducharm's +Ducharme's +dumbfounded +Dunne +Dykstra +e.g +E.T +ecamier +Eckstein +Edpress +Eggnog +eggnog +Ehrman's +Elbert +Electrocution +Elliot +Elven +Elvish +Emmons +Emu +Encyclopadia +ENIACs +Enm +Ennui +enobled +er +ergo +Erogenous +erogeny +Ertz +Es +es +Esser +est +etus +Euell +Eustace +ev'ry +Everyting +exaulted +extemporanea +extracurricular +Exupery +Fafhrd +Fainali +fainali +Fakir +Feiffer +Feiner +fella +Ferm +fertsneet +figgy +fiks +Fillmore +Finagle's +Finagling +Firesign +fix'd +flang +Flannagan's +Flinstone +Flon's +floss +Flugg's +Flummery +Foghorn +folkloric +Follen +foo +Forbiddie +forgo +fornia +fornication +forsooth +Forssman +Frayn +freezin +Friedrich +frillant +Frisbee +Frisbeetarianism +Frito +FROB +frob +frobbing +Frobnicate +FROBNITZ +Frodo +fruitcake +Fruitcakes +fruitcakes +frumious +Fudd's +funhouse +Furbling +Furst +Fylstra +Galbraith +Galilei +Galileo +galore +Galvani +Galvani's +Gandalf +Gandhi +garnishment +Gaultier +GC +GC7500439 +gd +Geis +Genderplex +Gerat +Gerrold's +Ghostbusters +Gigo +Gilda +Gilpkerio +gimble +Gimlet +Gimmie +girrafe +Glaser +Glashow +gleekzorp +GO.SYSIN +gobbledegook +Godot +Goestheveezl +Golda +Goldenstern's +Goldwyn +Goodbye +goodbye +Goodgulf +Gopete +Gorden +Gotlieb +Goto +Gotta +gougebosquex +Goy +Goy's +goyim +goyish +goyisha +Grabel's +graffito +Greenstein +Gregorian +Grelb's +Gries +grok +Groucho +grouse +gt +guave +GUISEPPE +Guiseppe +gyre +gyrent +Hadassah +Haeckel +Hahahahahahahahaha +Haig +handcraftsmanship +handwaving +hanky +Hanukka +harmonium +Harrisberger's +Hawkwind +HED +HEE +Heineken +Heinlein +Hellman +Henny +Henrick +Henrik +Herford +hev +hexagram +Higgeldy +Hilaire +Hillary's +Hinckley +Hippogriff +hippogriff +Hitchhiker's +Hlade's +Hoare's +Hoffenstein +Hofstadter's +Homespun +honorific +HOOTCH +hooved +Hoppe +horgrave +Horngren's +hors +Housman +hullabaloo +Huntingdon +Hurewitz's +i.e +I.R.S +Iacocca +Ibson +icepacks +ID's +Iear +iear +Iears +iers +II.a +Il +im +incomprehensive +Ingliy +inkahol +Inlaws +inputdir +inquit +inrushing +interferon +ironmongery +Isaak +Isiah +Iso +Issawi's +itn +ius +Jackals +Jacquin's +Jael +Jaka +Jarry +jast +jb +jeered +Jehan +Jell +Jenerally +Jenkinson's +Jenks +Jenning's +Jersy +JFK +Jone's +Jordache +Jun +Jung +Justin +ka +Kandel +kar +karat +karma +kase +Kaul +Kehlog +Kellen +Kenobi +Kiernan +kiloliks +Kinkler's +Kistomerces +kitsch +Kitzenger +Kleptomaniac +Klone +klows +kludge +klutz +Knuth +koan +kohirnt +konsonant +konsonants +kontinue +Kool +Korda +KPH +Kr +Krogt +Ks +kwirt +Lackland's +Lactomangulation +Laetrile +Lafferty +LAFITE +Lampson +Landburgher +Langsam's +lank +Lankhamar's +Lankhmar +Larkinson's +LaRouchefoucauld +Lassie +lawnmower +Lazlo's +le +LeGuin +Leher +Lehrer +Leiber +Leibowitz's +Leipzig +Lem +Lenore +lerts +Les +les +letez +Lettvin +Levant +Leverett +lexicographer +LIBRA +Libra +libricilleux +Lieberman's +lightbulb +Lilla +limerick +lin +linguini +Linkletter +LITHP +lithtth +Liza +lobotomy +locutions +Logg's +logick +logout +logy +lojikl +Longworth +Lowery's +LSD +Ltd +Lubarsky's +Luce +Luigi +Lyndon +Lysistrata +m'I +M.T.A +ma'am +Macaroons +MacDowell +MacNelley +MacNelly +MacNiece +Macy's +Madelyn +Magnocartic +magtape +Mahatma +Mai +maindz +mal +Malek's +MANCHA +Manhandling +margarita +Marley +Maslow +masochist +Mathis +Maugham +Maughm +Maxey +McEvoy +McNulty +Medawar +Meese +megs +meik +Meir +meltdown +Mem'ry +memoraboble +memori +memorizin +Mencken +Mencken's +menswear +meowing +MERCUTIO +merinos +Merrick +Meskimen's +meta +Mewling +Meyrowitz +MHz +midterm +Mikado +Miksch's +Millay +Millions +millions +mimsy +Minas +Minnelli +minx +missle +Moby +modifaiing +mohmen +Mollison's +Mom +Mophobia +Moping +Mordor +MOS +Mosher's +mousetraps +Mudgeeraba +Mudhead +Muppet +musculus +Mustgo +MW +MX +Myung +myxbl +n'oeuvres +Nader +Naeser's +Naiman +nanocentury +nanohenry +Narnia +Nate +naugahyde +Neantical +Neizant +nell +Nerd +net.fat +net.flame +net.jobs +net.news +net.that +net.this +Newlan's +NEWSFLASH +newsmagazine +Ngdanga +Ni +ni +Nicklaus +nightie +Niklaus +Ningauble +Noelie +nog +nohow +Nome +Nora's +nostra +Novocain +nunnery +Nutley +NYT +O'Casey +O'Hara +O'Henry +O'Rourke +O'Toole's +O.K +Obi +obits +obius +Ogborn +ok +ol;lkld;f;g;dd;po +Olivier +oln +omerade +omnivorous +ompzidaize +Onan +oodsou +Ope +Ophelia +orxogrefkl +OS +ould +outcumbents +ov +oves +Ozman's +p'o +P.B.A +P.M +p.m +padanga +Paley +Pandanga +panky +Pardo's +Parnas +paroxysmally +Parrafin +PDP +Pecor's +penis +Pensacoola +Penzance +Pereant +perfum'd +Perlis +Pharaoh +Philbin +Philogyny +philogyny +Phooey +Picninnies +Piggeldy +Pirsig +PL +planaria +Platypus +platypus +pleH +Pluribus +pm +po +Podunk +Pohl's +poiuyt +Politicain +poly +polytetien +polytheism +poo +popcorn +Porcus +posibl +posthole +Postpetroleum +POWDERMILK +poz +ppo +prawns +pre +pretzel +Preudhomme's +prgrmmng +priestess +primordial +PRL +Prochnow +Profesoor +propounded +protheththing +protoplasmal +Psblurtex +Publilius +pulitzer +Pumpernickel +pur +pushy +Pynchon +qui +quia +Quinton +quop +Quux +Qvid +QWERT +qwert +QWERTYUIOP +qwertyuiop +Ra +Radner +raineth +RAMs +randchar +rapturous +raspy +raths +rd +Reba +Regan +Reggie +Reisner's +replased +replasing +rhinoceri +Richardian +ridandant +riform +rigadoon +Rigby +Rilke +rimeining +rind +riplais +rispektivli +risqu +rKe9 +Robb +Robespierre +Rogerians +Rolex +ROMs +Rooney +Rosten +Rotherham +Rouchefoucauld +Roumania +Roxbury +RPG +Rubenstein +Rubik's +Rudin's +Ruffed +Russel +Russon +Safire's +Sagittarians +Salome +Salvor +sam +Santoro +Sappho +Sargon +SARTRE +Sartre +SCCS +Schapiro's +schlichte +Schryer +Schwine +Scrubb +scullery +Se +Seeger +Sep +Serendipity +Serling +Serocki's +Sevenoaks +shalt +Shamus +shamus +Sheil +Sherany +shinnied +shlafen +Shmoedipus +Shoaff +shorn +Shuman +sightie +Sigismund +Simard +siouxeyesighed +Sixtus +sizeof +skyhigh +Skyler +sligo +SLOBOL +Slurm +Smit +Snacktrek +Sniglets +Snowman +snowman +Snowmass +Socio +Sodd's +somebody'd +sont +Sorhed +spank +speling +Spirtle +spl +Spock +sq +sswwiittcchh +Sta +Stanislaw +starfield +steamrolling +Steelypips +steeplechase +Steinbach's +Steinem +Stoffel +Stult's +suet +Sulu +Sumeria +sunbelts +Supercalifragilisticexpialidocius +svm +Swaller +swang +Swinburne +Swipple's +switchover +symptotes +synagog +Syrus +syscalls +T.V +Tabby +tachyon +Tai +taketh +Tanenbaum +tannogallate +Tarradiddles +tbsp +Teddywookie +telepath +telly +Tenessee +tequila +Terence +Tertullian +Teruillian +TH +th +Thames +theivish +thi +Thieu +thinkle +Tho +Thoul't +thru +ths +Thyself +thyself +Tierra +Tikkanen +tinhorn +TLC +tollway +Tomlin +Tonka +tornpee +Toven +trampoline +transsexual +treacle +Tricia +tripoline +Troney +Trotsky +tsetse +TSO +tsp +Tsu +tu +tuit +tuits +tuppenny +Turnaucka's +Tussman's +Tut's +Twas +Tweedledee +Tweedledum +tween +twixt +Twodor +Twodor's +tyg +U.S +UFO's +uh +ukelele +umsige +unbegot +Und +und +unvoist +uretheral +Urey +urgin's +URK +valium +Vannevar +VAX +VAX's +VAXen +VAXs +velcro +Velilind's +Venn +Vespucci +Vespuccia +Vidal +VIDEOCASSETTE +Vinchy +Vinci +Virt +Vittorini +VLSI +VMS +VODKA +Vogon +voist +vol +Volkswagon +Vonada +Vonnegut +Vonnegut's +vowlz +Vries +VSOP +vu +Vulgate +w4k +wa +Waben +Wald +Walla +Warhol +Wat +Weiler's +Weiner's +weirdo +Weisert +wench +werld +Wernher +Westheimer's +Wethern's +WHATEVERSAROUND +Whipsnade +whomped +wi +Wiker's +Wilde +wimmelten +Winchell +Winsor +Wirrten +Wirth +Withington +WOMBAT +wombat +wonse +woodburning +workingman +WORLD's +wr +wrth +wrung +wud +xanthic +xe +xen +XINU +xrewawt +xsz +Yabba +Yessir +Yinkel +Yo +yo +Yoda +Yoda's +Yorba +you'se +Youngman +Yuletide +yyoouurr +Zanuck +Zappa +Zarathustra +zayda +Zelkowitz +zephyr's +ZORAC +Zow +Zwanzig +Zymurgy's +masturbation diff --git a/games/fortune/strfile.c b/games/fortune/strfile.c new file mode 100644 index 0000000..00ce2aa --- /dev/null +++ b/games/fortune/strfile.c @@ -0,0 +1,394 @@ +# include +# include +# include "strfile.h" + +/* + * This program takes a file composed of strings seperated by + * lines starting with two consecutive delimiting character (default + * character is '%') and creates another file which consists of a table + * describing the file (structure from "strfile.h"), a table of seek + * pointers to the start of the strings, and the strings, each terinated + * by a null byte. Usage: + * + * % strfile [ - ] [ -cC ] [ -sv ] [ -oir ] sourcefile [ datafile ] + * + * - - Give a usage summary useful for jogging the memory + * c - Change delimiting character from '%' to 'C' + * s - Silent. Give no summary of data processed at the end of + * the run. + * v - Verbose. Give summary of data processed. (Default) + * o - order the strings in alphabetic order + * i - if ordering, ignore case + * r - randomize the order of the strings + * + * Ken Arnold Sept. 7, 1978 -- + * + * Added method to indicate dividers. A "%-" will cause the address + * to be added to the structure in one of the pointer elements. + * + * Ken Arnold Nov., 1984 -- + * + * Added ordering options. + */ + +# define TRUE 1 +# define FALSE 0 + +# define DELIM_CH '-' + +typedef struct { + char first; + long pos; +} STR; + +char *Infile = NULL, /* input file name */ + Outfile[100] = "", /* output file name */ + Delimch = '%', /* delimiting character */ + *Usage[] = { /* usage summary */ + "usage: strfile [ - ] [ -cC ] [ -sv ] [ -oir ] inputfile [ datafile ]", + " - - Give this usage summary", + " c - Replace delimiting character with 'C'", + " s - Silent. Give no summary", + " v - Verbose. Give summary. (default)", + " o - order strings alphabetically", + " i - ignore case in ordering", + " r - randomize the order of the strings", + " Default \"datafile\" is inputfile.dat", + NULL + }; + +int Sflag = FALSE; /* silent run flag */ +int Oflag = FALSE; /* ordering flag */ +int Iflag = FALSE; /* ignore case flag */ +int Rflag = FALSE; /* randomize order flag */ +int Delim = 0; /* current delimiter number */ + +long *Seekpts; + +FILE *Sort_1, *Sort_2; /* pointers for sorting */ + +STRFILE Tbl; /* statistics table */ + +STR *Firstch; /* first chars of each string */ + +char *fgets(), *malloc(), *strcpy(), *strcat(); + +long ftell(); + +main(ac, av) +int ac; +char **av; +{ + register char *sp, dc; + register long *lp; + register unsigned int curseek; /* number of strings */ + register long *seekpts, li; /* table of seek pointers */ + register FILE *inf, *outf; + register int first; + register char *nsp; + register STR *fp; + static char string[257]; + + getargs(ac, av); /* evalute arguments */ + + /* + * initial counting of input file + */ + + dc = Delimch; + if ((inf = fopen(Infile, "r")) == NULL) { + perror(Infile); + exit(-1); + } + for (curseek = 0; (sp = fgets(string, 256, inf)) != NULL; ) + if (*sp++ == dc && (*sp == dc || *sp == DELIM_CH)) + curseek++; + curseek++; + + /* + * save space at begginning of file for tables + */ + + if ((outf = fopen(Outfile, "w")) == NULL) { + perror(Outfile); + exit(-1); + } + + /* + * Allocate space for the pointers, adding one to the end so the + * length of the final string can be calculated. + */ + ++curseek; + seekpts = (long *) malloc(sizeof *seekpts * curseek); /* NOSTRICT */ + if (seekpts == NULL) { + perror("calloc"); + exit(-1); + } + if (Oflag) { + Firstch = (STR *) malloc(sizeof *Firstch * curseek); + if (Firstch == NULL) { + perror("calloc"); + exit(-1); + } + } + + (void) fseek(outf, (long) (sizeof Tbl + sizeof *seekpts * curseek), 0); + (void) fseek(inf, (long) 0, 0); /* goto start of input */ + + /* + * write the strings onto the file + */ + + Tbl.str_longlen = 0; + Tbl.str_shortlen = (unsigned int) 0xffffffff; + lp = seekpts; + first = Oflag; + *seekpts = ftell(outf); + fp = Firstch; + do { + sp = fgets(string, 256, inf); + if (sp == NULL || + (*sp == dc && (sp[1] == dc || sp[1] == DELIM_CH))) { + putc('\0', outf); + *++lp = ftell(outf); + li = ftell(outf) - lp[-1] - 1; + if (Tbl.str_longlen < li) + Tbl.str_longlen = li; + if (Tbl.str_shortlen > li) + Tbl.str_shortlen = li; + if (sp && sp[1] == DELIM_CH && Delim < MAXDELIMS) + Tbl.str_delims[Delim++] = lp - seekpts; + first = Oflag; + } + else { + if (first) { + for (nsp = sp; !isalnum(*nsp); nsp++) + continue; + if (Iflag && isupper(*nsp)) + fp->first = tolower(*nsp); + else + fp->first = *nsp; + fp->pos = *lp; + fp++; + first = FALSE; + } + fputs(sp, outf); + } + } while (sp != NULL); + + /* + * write the tables in + */ + + (void) fclose(inf); + Tbl.str_numstr = curseek - 1; + + if (Oflag) + do_order(seekpts, outf); + else if (Rflag) + randomize(seekpts); + + (void) fseek(outf, (long) 0, 0); + (void) fwrite((char *) &Tbl, sizeof Tbl, 1, outf); + (void) fwrite((char *) seekpts, sizeof *seekpts, curseek, outf); + (void) fclose(outf); + + if (!Sflag) { + printf("\"%s\" converted to \"%s\"\n", Infile, Outfile); + if (curseek == 0) + puts("There was 1 string"); + else + printf("There were %u strings\n", curseek - 1); + printf("Longest string: %u byte%s\n", Tbl.str_longlen, + Tbl.str_longlen == 1 ? "" : "s"); + printf("Shortest string: %u byte%s\n", Tbl.str_shortlen, + Tbl.str_shortlen == 1 ? "" : "s"); + } + exit(0); +} + +/* + * This routine evaluates arguments from the command line + */ +getargs(ac, av) +register int ac; +register char **av; +{ + register char *sp; + register int i; + register int bad, j; + + bad = 0; + for (i = 1; i < ac; i++) + if (*av[i] == '-' && av[i][1]) { + for (sp = &av[i][1]; *sp; sp++) + switch (*sp) { + case 'c': /* new delimiting char */ + if ((Delimch = *++sp) == '\0') { + --sp; + Delimch = *av[++i]; + } + if (Delimch <= 0 || Delimch > '~' || + Delimch == DELIM_CH) { + printf("bad delimiting character: '\\%o\n'", + Delimch); + bad++; + } + break; + case 's': /* silent */ + Sflag++; + break; + case 'v': /* verbose */ + Sflag = 0; + break; + case 'o': /* order strings */ + Oflag++; + break; + case 'i': /* ignore case in ordering */ + Iflag++; + break; + case 'r': /* ignore case in ordering */ + Rflag++; + break; + default: /* unknown flag */ + bad++; + printf("bad flag: '%c'\n", *sp); + break; + } + } + else if (*av[i] == '-') { + for (j = 0; Usage[j]; j++) + puts(Usage[j]); + exit(0); + } + else if (Infile) + (void) strcpy(Outfile, av[i]); + else + Infile = av[i]; + if (!Infile) { + bad++; + puts("No input file name"); + } + if (*Outfile == '\0' && !bad) { + (void) strcpy(Outfile, Infile); + (void) strcat(Outfile, ".dat"); + } + if (bad) { + puts("use \"strfile -\" to get usage"); + exit(-1); + } +} + +/* + * do_order: + * Order the strings alphabetically (possibly ignoring case). + */ +do_order(seekpts, outf) +long *seekpts; +FILE *outf; +{ + register int i; + register long *lp; + register STR *fp; + extern int cmp_str(); + + (void) fflush(outf); + Sort_1 = fopen(Outfile, "r"); + Sort_2 = fopen(Outfile, "r"); + Seekpts = seekpts; + qsort((char *) Firstch, Tbl.str_numstr, sizeof *Firstch, cmp_str); + i = Tbl.str_numstr; + lp = seekpts; + fp = Firstch; + while (i--) + *lp++ = fp++->pos; + (void) fclose(Sort_1); + (void) fclose(Sort_2); + Tbl.str_flags |= STR_ORDERED; +} + +/* + * cmp_str: + * Compare two strings in the file + */ +cmp_str(p1, p2) +STR *p1, *p2; +{ + register int c1, c2; + + c1 = p1->first; + c2 = p2->first; + if (c1 != c2) + return c1 - c2; + + (void) fseek(Sort_1, p1->pos, 0); + (void) fseek(Sort_2, p2->pos, 0); + + while (!isalnum(c1 = getc(Sort_1)) && c1 != '\0') + continue; + while (!isalnum(c2 = getc(Sort_2)) && c2 != '\0') + continue; + + while (c1 != '\0' && c2 != '\0') { + if (Iflag) { + if (isupper(c1)) + c1 = tolower(c1); + if (isupper(c2)) + c2 = tolower(c2); + } + if (c1 != c2) + return c1 - c2; + c1 = getc(Sort_1); + c2 = getc(Sort_2); + } + return c1 - c2; +} + +/* + * randomize: + * Randomize the order of the string table. We must be careful + * not to randomize across delimiter boundaries. All + * randomization is done within each block. + */ +randomize(seekpts) +register long *seekpts; +{ + register int cnt, i, j, start; + register long tmp; + register long *origsp; + + Tbl.str_flags |= STR_RANDOM; + srnd(time((long *) NULL) + getpid()); + origsp = seekpts; + for (j = 0; j <= Delim; j++) { + + /* + * get the starting place for the block + */ + + if (j == 0) + start = 0; + else + start = Tbl.str_delims[j - 1]; + + /* + * get the ending point + */ + + if (j == Delim) + cnt = Tbl.str_numstr; + else + cnt = Tbl.str_delims[j]; + + /* + * move things around randomly + */ + + for (seekpts = &origsp[start]; cnt > start; cnt--, seekpts++) { + i = rnd(cnt - start); + tmp = seekpts[0]; + seekpts[0] = seekpts[i]; + seekpts[i] = tmp; + } + } +} diff --git a/games/fortune/strfile.h b/games/fortune/strfile.h new file mode 100644 index 0000000..014afc1 --- /dev/null +++ b/games/fortune/strfile.h @@ -0,0 +1,20 @@ +/* @(#)strfile.h 1.2 (Berkeley) 5/14/81 */ + +# define MAXDELIMS 3 + +/* + * bits for flag field + */ + +# define STR_RANDOM 0x1 +# define STR_ORDERED 0x2 + +struct strfile { /* information table */ + unsigned int str_numstr; /* # of strings in the file */ + unsigned int str_longlen; /* length of longest string */ + unsigned int str_shortlen; /* length of shortest string */ + long str_delims[MAXDELIMS]; /* delimiter markings */ + int str_flags; /* bit field for flags */ +}; + +typedef struct strfile STRFILE; diff --git a/games/fortune/unstr.c b/games/fortune/unstr.c new file mode 100644 index 0000000..8cae59b --- /dev/null +++ b/games/fortune/unstr.c @@ -0,0 +1,127 @@ +# include +# include "strfile.h" + +# define TRUE 1 +# define FALSE 0 + +/* + * This program un-does what "strfile" makes, thereby obtaining the + * original file again. This can be invoked with the name of the output + * file, the input file, or both. If invoked with only a single argument + * ending in ".dat", it is pressumed to be the input file and the output + * file will be the same stripped of the ".dat". If the single argument + * doesn't end in ".dat", then it is presumed to be the output file, and + * the input file is that name prepended by a ".dat". If both are given + * they are treated literally as the input and output files. + * + * Ken Arnold Aug 13, 1978 + */ + +# define DELIM_CH '-' + +char Infile[100], /* name of input file */ + Outfile[100]; /* name of output file */ + +short Oflag = FALSE; /* use order of initial table */ + +FILE *Inf, *Outf; + +char *rindex(), *malloc(), *strcat(), *strcpy(); + +main(ac, av) +int ac; +char **av; +{ + register char c; + register int nstr, delim; + static STRFILE tbl; /* description table */ + + getargs(ac, av); + if ((Inf = fopen(Infile, "r")) == NULL) { + perror(Infile); + exit(-1); + /* NOTREACHED */ + } + if ((Outf = fopen(Outfile, "w")) == NULL) { + perror(Outfile); + exit(-1); + /* NOTREACHED */ + } + (void) fread((char *) &tbl, sizeof tbl, 1, Inf); + if (Oflag) { + order_unstr(&tbl); + exit(0); + /* NOTREACHED */ + } + nstr = tbl.str_numstr; + (void) fseek(Inf, (long) (sizeof (long) * (nstr + 1)), 1); + delim = 0; + for (nstr = 0; (c = getc(Inf)) != EOF; nstr++) + if (c != '\0') + putc(c, Outf); + else if (nstr != tbl.str_numstr - 1) + if (nstr == tbl.str_delims[delim]) { + fputs("%-\n", Outf); + delim++; + } + else + fputs("%%\n", Outf); + exit(0); + /* NOTREACHED */ +} + +getargs(ac, av) +register int ac; +register char **av; +{ + register char *sp; + + if (ac > 1 && strcmp(av[1], "-o") == 0) { + Oflag++; + ac--; + av++; + } + if (ac < 2) { + printf("usage: %s datafile[.dat] [ outfile ]\n", av[0]); + exit(-1); + } + (void) strcpy(Infile, av[1]); + if (ac < 3) { + (void) strcpy(Outfile, Infile); + if ((sp = rindex(av[1], '.')) && strcmp(sp, ".dat") == 0) + Outfile[strlen(Outfile) - 4] = '\0'; + else + (void) strcat(Infile, ".dat"); + } + else + (void) strcpy(Outfile, av[2]); +} + +order_unstr(tbl) +STRFILE *tbl; +{ + register int i, c; + register int delim; + register long *seekpts; + + seekpts = (long *) malloc(sizeof *seekpts * tbl->str_numstr); /* NOSTRICT */ + if (seekpts == NULL) { + perror("malloc"); + exit(-1); + /* NOTREACHED */ + } + (void) fread((char *) seekpts, sizeof *seekpts, tbl->str_numstr, Inf); + delim = 0; + for (i = 0; i < tbl->str_numstr; i++, seekpts++) { + if (i != 0) + if (i == tbl->str_delims[delim]) { + fputs("%-\n", Outf); + delim++; + } + else + fputs("%%\n", Outf); + (void) fseek(Inf, *seekpts, 0); + while ((c = getc(Inf)) != '\0') + putc(c, Outf); + } +} diff --git a/games/hack/Makefile b/games/hack/Makefile new file mode 100644 index 0000000..a390ab9 --- /dev/null +++ b/games/hack/Makefile @@ -0,0 +1,307 @@ +# #(@) Makefile 1.2 (2.11BSD) 1997/4/28 +# +# Hack Overlay Makefile. + +# on some systems the termcap library is in -ltermcap +TERMLIB = -ltermlib + +# make hack +GAME = hack +BINDIR = /usr/games +LIBDIR = /usr/games/lib/hackdir +DESTDIR = +GAMEUID = daemon +CFLAGS = -O + +HACKCSRC = \ + hack.Decl.c\ + hack.apply.c hack.bones.c hack.c hack.cmd.c hack.do.c\ + hack.do_name.c hack.do_wear.c hack.dog.c hack.eat.c hack.end.c\ + hack.engrave.c hack.fight.c hack.invent.c hack.ioctl.c\ + hack.lev.c hack.main.c hack.makemon.c hack.mhitu.c\ + hack.mklev.c hack.mkmaze.c hack.mkobj.c hack.mkshop.c\ + hack.mon.c hack.monst.c hack.o_init.c hack.objnam.c\ + hack.options.c hack.pager.c hack.potion.c hack.pri.c\ + hack.read.c hack.rip.c hack.rumors.c hack.save.c\ + hack.search.c hack.shk.c hack.shknam.c hack.steal.c\ + hack.termcap.c hack.timeout.c hack.topl.c\ + hack.track.c hack.trap.c hack.tty.c hack.unix.c\ + hack.u_init.c hack.vault.c\ + hack.wield.c hack.wizard.c hack.worm.c hack.worn.c hack.zap.c\ + hack.version.c rnd.c alloc.c + +CSOURCES = $(HACKCSRC) makedefs.c + +HSOURCES = hack.h hack.mfndpos.h config.h\ + def.edog.h def.eshk.h def.flag.h def.func_tab.h def.gold.h\ + def.mkroom.h\ + def.monst.h def.obj.h def.objclass.h def.objects.h\ + def.permonst.h def.rm.h def.trap.h def.wseg.h + +SOURCES = $(CSOURCES) $(HSOURCES) + +AUX = data help hh rumors hack.6 hack.sh + +# strings.o must be last in HOBJ since it can change when other files compile. + +HOBJ = \ + hack.Decl.o hack.apply.o hack.bones.o hack.o hack.cmd.o hack.do.o\ + hack.do_name.o hack.do_wear.o hack.dog.o hack.eat.o hack.end.o\ + hack.engrave.o hack.fight.o hack.invent.o hack.ioctl.o\ + hack.lev.o hack.main.o hack.makemon.o hack.mhitu.o hack.mklev.o\ + hack.mkmaze.o hack.mkobj.o hack.mkshop.o hack.mon.o\ + hack.monst.o hack.o_init.o hack.objnam.o hack.options.o\ + hack.pager.o hack.potion.o hack.pri.o\ + hack.read.o hack.rip.o hack.rumors.o hack.save.o\ + hack.search.o hack.shk.o hack.shknam.o hack.steal.o\ + hack.termcap.o hack.timeout.o hack.topl.o\ + hack.track.o hack.trap.o\ + hack.tty.o hack.unix.o hack.u_init.o hack.vault.o hack.wield.o\ + hack.wizard.o hack.worm.o hack.worn.o hack.zap.o\ + hack.version.o rnd.o alloc.o\ + strings.o + +# Hack overlay structure (PDP-11/{44,45,70}) +# +# The BASE (should) occupy 5 segments, but extreme care has to be taken when +# any code is changed as those five segments have been filled to within bytes +# of that limit. Each of the overlays occupies 3 segments with similar +# restrictions on changing code (most have been filled to within a few hundred +# bytes). The wise and cautious programmer would be well advised to use +# size(1) heavily ... +# +BASE = strings.o hack.monst.o hack.Decl.o\ + hack.invent.o hack.dog.o hack.mon.o\ + hack.engrave.o rnd.o hack.track.o + +OV1 = hack.shk.o hack.topl.o hack.o hack.end.o hack.trap.o + +OV2 = hack.do_wear.o hack.main.o hack.eat.o hack.timeout.o hack.vault.o\ + hack.wizard.o hack.topl.o hack.tty.o\ + hack.do.o hack.search.o alloc.o\ + hack.cmd.o hack.termcap.o hack.unix.o hack.ioctl.o + +OV3 = hack.do_name.o hack.fight.o hack.mkobj.o hack.o_init.o hack.mhitu.o\ + hack.makemon.o hack.worn.o hack.rumors.o hack.objnam.o hack.pri.o + +OV4 = hack.zap.o hack.read.o hack.apply.o hack.potion.o\ + hack.options.o hack.pager.o hack.wield.o + +OV5 = hack.save.o hack.lev.o hack.mklev.o hack.mkshop.o hack.mkmaze.o\ + hack.shknam.o hack.u_init.o\ + hack.rip.o hack.bones.o hack.worm.o hack.steal.o hack.version.o + +# Crypt *MUST be listed BEFORE $(HOBJ) +$(GAME): crypt $(HOBJ) + @echo "Loading ..." + @ld -i -X -x -o $(GAME) /lib/crt0.o $(BASE)\ + -Z $(OV1) -Z $(OV2) -Z $(OV3) -Z $(OV4) -Z $(OV5) -Y\ + $(TERMLIB) -lc + @echo "Load complete" + +# The hack sources are run through several filters before they actually reach +# the compiler. The main goal of the filtration process is to cut back the +# size of hack's data space (which normally exceeds 64K and therefore can't be +# loaded on a PDP-11). +# +# The filter crypt will read through C source files using a string translation +# table to translate long word(s) into shorter words in C strings. Xstr +# collects the strings found in a program into a string database, replacing +# multiple occurences of the same string by references to one string in the +# database. For more information on these filters, see crypt.c and xstr(1). +# Crypt is really crufty and slow, but the goal was to get something out the +# door ... +.c.o: + cc -E $*.c | ./crypt | xstr -c - + cc -c ${CFLAGS} x.c + mv x.o $*.o + +rnd.o: rnd.c +alloc.o: alloc.c + +strings.o: strings + xstr + cc -c ${CFLAGS} xs.c + mv xs.o strings.o + rm xs.c + +crypt: crypt.c + cc -o crypt crypt.c + +clean: + rm -f *.o x.c xs.c strings crypt makedefs + +makedefs: makedefs.c + cc -o makedefs makedefs.c + +hack.onames.h: makedefs def.objects.h + ./makedefs > hack.onames.h + +lint: +# lint cannot have -p here because (i) capitals are meaningful: +# [Ww]izard, (ii) identifiers may coincide in the first six places: +# doweararm() versus dowearring(). +# _flsbuf comes from , a bug in the system libraries. + @echo lint -axbh -DLINT ... + @lint -axbh -DLINT $(HACKCSRC) | sed '/_flsbuf/d' + + +diff: + @- for i in $(SOURCES) $(AUX) ; do \ + cmp -s $$i $D/$$i || \ + ( echo diff $D/$$i $$i ; diff $D/$$i $$i ; echo ) ; done + +distribution: Makefile + @- for i in READ_ME $(SOURCES) $(AUX) Makefile date.h hack.onames.h\ + ; do \ + cmp -s $$i $D/$$i || \ + ( echo cp $$i $D ; cp $$i $D ) ; done +# the distribution directory also contains the empty files +# perm and record, and the informative files Porting and Bugs. + + +install: $(GAME) + install -o $(GAMEUID) -m 4711 $(GAME) $(DESTDIR)$(BINDIR)/$(GAME) + -rm -rf $(DESTDIR)/$(LIBDIR) + -mkdir -p ${DESTDIR}/${LIBDIR} + chown daemon ${DESTDIR}/${LIBDIR} + chmod 700 ${DESTDIR}/${LIBDIR} + +# The make node `depend' has been commented out as the current dependency +# list is [now] not as simple as it used to be ... The reason for this is +# because xstr(1) screws up on a number of the hack sources for one reason or +# another (see below) and those sources need to have special compile commands +# that run the sources through all the filters except xstr. +# +# Xstr is unable to handle the construct `char blah[] = "blah"' because it +# translates it into `char blah[] = &xstr[blah]'. In one particular case, we +# can't run xstr on hack.rip.c because it translates the multiple lines of the +# tombstone into one line which screws up the tombstone. +# +#depend: +# For the moment we are lazy and disregard /usr/include files because +# the sources contain them conditionally. Perhaps we should use cpp. +# ( /bin/grep '^#[ ]*include' $$i | sed -n \ +# -e 's,<\(.*\)>,"/usr/include/\1",' \ +# +# for i in ${CSOURCES}; do \ +# ( /bin/grep '^#[ ]*include[ ]*"' $$i | sed -n \ +# -e 's/[^"]*"\([^"]*\)".*/\1/' \ +# -e H -e '$$g' -e '$$s/\n/ /g' \ +# -e '$$s/.*/'$$i': &/' -e '$$s/\.c:/.o:/p' \ +# >> makedep); done +# for i in ${HSOURCES}; do \ +# ( /bin/grep '^#[ ]*include[ ]*"' $$i | sed -n \ +# -e 's/[^"]*"\([^"]*\)".*/\1/' \ +# -e H -e '$$g' -e '$$s/\n/ /g' \ +# -e '$$s/.*/'$$i': &\ +# touch '$$i/p \ +# >> makedep); done +# @echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep +# @echo '$$r makedep' >>eddep +# @echo 'w' >>eddep +# @cp Makefile Makefile.bak +# ed - Makefile < eddep +# @rm -f eddep makedep +# @echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile +# @echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile +# @echo '# see make depend above' >> Makefile +# - diff Makefile Makefile.bak +# @rm -f Makefile.bak + +# DO NOT DELETE THIS LINE + +hack.Decl.o: hack.h def.mkroom.h + cc -E hack.Decl.c | ./crypt | sed 's/^# \([0-9]*\)/#line \1/' > x.c + cc -c ${CFLAGS} x.c + mv x.o hack.Decl.o +hack.apply.o: hack.h def.edog.h def.mkroom.h +hack.bones.o: hack.h + cc -E hack.bones.c | ./crypt | sed 's/^# \([0-9]*\)/#line \1/' > x.c + cc -c ${CFLAGS} x.c + mv x.o hack.bones.o +hack.o: hack.h +hack.cmd.o: hack.h def.func_tab.h + cc -E hack.cmd.c | ./crypt | sed 's/^# \([0-9]*\)/#line \1/' > x.c + cc -c ${CFLAGS} x.c + mv x.o hack.cmd.o +hack.do.o: hack.h +hack.do_name.o: hack.h +hack.do_wear.o: hack.h +hack.dog.o: hack.h hack.mfndpos.h def.edog.h def.mkroom.h +hack.eat.o: hack.h + cc -E hack.eat.c | ./crypt | sed 's/^# \([0-9]*\)/#line \1/' > x.c + cc -c ${CFLAGS} x.c + mv x.o hack.eat.o +hack.end.o: hack.h +hack.engrave.o: hack.h +hack.fight.o: hack.h + cc -E hack.fight.c | ./crypt | sed 's/^# \([0-9]*\)/#line \1/' > x.c + cc -c ${CFLAGS} x.c + mv x.o hack.fight.o +hack.invent.o: hack.h def.wseg.h +hack.ioctl.o: config.h +hack.lev.o: hack.h def.mkroom.h def.wseg.h +hack.main.o: hack.h + cc -E hack.main.c | ./crypt | sed 's/^# \([0-9]*\)/#line \1/' > x.c + cc -c ${CFLAGS} x.c + mv x.o hack.main.o +hack.makemon.o: hack.h +hack.mhitu.o: hack.h +hack.mklev.o: hack.h def.mkroom.h +hack.mkmaze.o: hack.h def.mkroom.h +hack.mkobj.o: hack.h + cc -E hack.mkobj.c | ./crypt | sed 's/^# \([0-9]*\)/#line \1/' > x.c + cc -c ${CFLAGS} x.c + mv x.o hack.mkobj.o +hack.mkshop.o: hack.h def.mkroom.h def.eshk.h +hack.mon.o: hack.h hack.mfndpos.h +hack.monst.o: hack.h def.eshk.h +hack.o_init.o: config.h def.objects.h hack.onames.h +hack.objnam.o: hack.h +hack.options.o: config.h hack.h +hack.pager.o: hack.h +hack.potion.o: hack.h +hack.pri.o: hack.h def.wseg.h +hack.read.o: hack.h +hack.rip.o: hack.h + cc -E hack.rip.c | ./crypt | sed 's/^# \([0-9]*\)/#line \1/' > x.c + cc -c ${CFLAGS} x.c + mv x.o hack.rip.o +hack.rumors.o: config.h +hack.save.o: hack.h +hack.search.o: hack.h +hack.shk.o: hack.h hack.mfndpos.h def.mkroom.h def.eshk.h +hack.shknam.o: hack.h +hack.steal.o: hack.h +hack.termcap.o: config.h def.flag.h +hack.timeout.o: hack.h +hack.topl.o: hack.h +hack.track.o: hack.h +hack.trap.o: hack.h def.mkroom.h + cc -E hack.trap.c | ./crypt | sed 's/^# \([0-9]*\)/#line \1/' > x.c + cc -c ${CFLAGS} x.c + mv x.o hack.trap.o +hack.tty.o: hack.h +hack.unix.o: hack.h def.mkroom.h +hack.u_init.o: hack.h +hack.vault.o: hack.h def.mkroom.h +hack.wield.o: hack.h +hack.wizard.o: hack.h + cc -E hack.wizard.c | ./crypt | sed 's/^# \([0-9]*\)/#line \1/' > x.c + cc -c ${CFLAGS} x.c + mv x.o hack.wizard.o +hack.worm.o: hack.h def.wseg.h +hack.worn.o: hack.h +hack.zap.o: hack.h +hack.version.o: date.h + cc -E hack.version.c | ./crypt | sed 's/^# \([0-9]*\)/#line \1/' > x.c + cc -c ${CFLAGS} x.c + mv x.o hack.version.o +hack.h: config.h def.objclass.h def.monst.h def.gold.h def.trap.h def.obj.h def.flag.h def.rm.h def.permonst.h hack.onames.h + touch hack.h +def.objects.h: config.h def.objclass.h + touch def.objects.h +# DEPENDENCIES MUST END AT END OF FILE +# IF YOU PUT STUFF HERE IT WILL GO AWAY +# see make depend above diff --git a/games/hack/Makefile.orig b/games/hack/Makefile.orig new file mode 100644 index 0000000..5b623b2 --- /dev/null +++ b/games/hack/Makefile.orig @@ -0,0 +1,196 @@ +# Hack or Quest Makefile. + +# on some systems the termcap library is in -ltermcap +TERMLIB = -ltermlib + + +# make hack +GAME = hack +GAMEDIR = /usr/games/lib/hackdir +CFLAGS = -O +HACKCSRC = hack.Decl.c\ + hack.apply.c hack.bones.c hack.c hack.cmd.c hack.do.c\ + hack.do_name.c hack.do_wear.c hack.dog.c hack.eat.c hack.end.c\ + hack.engrave.c hack.fight.c hack.invent.c hack.ioctl.c\ + hack.lev.c hack.main.c hack.makemon.c hack.mhitu.c\ + hack.mklev.c hack.mkmaze.c hack.mkobj.c hack.mkshop.c\ + hack.mon.c hack.monst.c hack.o_init.c hack.objnam.c\ + hack.options.c hack.pager.c hack.potion.c hack.pri.c\ + hack.read.c hack.rip.c hack.rumors.c hack.save.c\ + hack.search.c hack.shk.c hack.shknam.c hack.steal.c\ + hack.termcap.c hack.timeout.c hack.topl.c\ + hack.track.c hack.trap.c hack.tty.c hack.unix.c\ + hack.u_init.c hack.vault.c\ + hack.wield.c hack.wizard.c hack.worm.c hack.worn.c hack.zap.c\ + hack.version.c rnd.c alloc.c + +CSOURCES = $(HACKCSRC) makedefs.c + +HSOURCES = hack.h hack.mfndpos.h config.h\ + def.edog.h def.eshk.h def.flag.h def.func_tab.h def.gold.h\ + def.mkroom.h\ + def.monst.h def.obj.h def.objclass.h def.objects.h\ + def.permonst.h def.rm.h def.trap.h def.wseg.h + +SOURCES = $(CSOURCES) $(HSOURCES) + +AUX = data help hh rumors hack.6 hack.sh + +DISTR = $(SOURCES) $(AUX) READ_ME Makefile date.h hack.onames.h + +HOBJ = hack.Decl.o hack.apply.o hack.bones.o hack.o hack.cmd.o hack.do.o\ + hack.do_name.o hack.do_wear.o hack.dog.o hack.eat.o hack.end.o\ + hack.engrave.o hack.fight.o hack.invent.o hack.ioctl.o\ + hack.lev.o hack.main.o hack.makemon.o hack.mhitu.o hack.mklev.o\ + hack.mkmaze.o hack.mkobj.o hack.mkshop.o hack.mon.o\ + hack.monst.o hack.o_init.o hack.objnam.o hack.options.o\ + hack.pager.o hack.potion.o hack.pri.o\ + hack.read.o hack.rip.o hack.rumors.o hack.save.o\ + hack.search.o hack.shk.o hack.shknam.o hack.steal.o\ + hack.termcap.o hack.timeout.o hack.topl.o\ + hack.track.o hack.trap.o\ + hack.tty.o hack.unix.o hack.u_init.o hack.vault.o hack.wield.o\ + hack.wizard.o hack.worm.o hack.worn.o hack.zap.o\ + hack.version.o rnd.o alloc.o + +$(GAME): $(HOBJ) Makefile + @echo "Loading ..." + @ld -X -o $(GAME) /lib/crt0.o $(HOBJ) $(TERMLIB) -lc + +all: $(GAME) lint + @echo "Done." + +makedefs: makedefs.c + cc -o makedefs makedefs.c + + +hack.onames.h: makedefs def.objects.h + makedefs > hack.onames.h + +lint: +# lint cannot have -p here because (i) capitals are meaningful: +# [Ww]izard, (ii) identifiers may coincide in the first six places: +# doweararm() versus dowearring(). +# _flsbuf comes from , a bug in the system libraries. + @echo lint -axbh -DLINT ... + @lint -axbh -DLINT $(HACKCSRC) | sed '/_flsbuf/d' + + +diff: + @- for i in $(SOURCES) $(AUX) ; do \ + cmp -s $$i $D/$$i || \ + ( echo diff $D/$$i $$i ; diff $D/$$i $$i ; echo ) ; done + +distribution: Makefile + @- for i in READ_ME $(SOURCES) $(AUX) Makefile date.h hack.onames.h\ + ; do \ + cmp -s $$i $D/$$i || \ + ( echo cp $$i $D ; cp $$i $D ) ; done +# the distribution directory also contains the empty files perm and record. + + +install: + rm -f $(GAMEDIR)/$(GAME) + cp $(GAME) $(GAMEDIR)/$(GAME) + chmod 04511 $(GAMEDIR)/$(GAME) + rm -f $(GAMEDIR)/bones* +# cp hack.6 /usr/man/man6 + +clean: + rm -f *.o + + +depend: +# For the moment we are lazy and disregard /usr/include files because +# the sources contain them conditionally. Perhaps we should use cpp. +# ( /bin/grep '^#[ ]*include' $$i | sed -n \ +# -e 's,<\(.*\)>,"/usr/include/\1",' \ +# + for i in ${CSOURCES}; do \ + ( /bin/grep '^#[ ]*include[ ]*"' $$i | sed -n \ + -e 's/[^"]*"\([^"]*\)".*/\1/' \ + -e H -e '$$g' -e '$$s/\n/ /g' \ + -e '$$s/.*/'$$i': &/' -e '$$s/\.c:/.o:/p' \ + >> makedep); done + for i in ${HSOURCES}; do \ + ( /bin/grep '^#[ ]*include[ ]*"' $$i | sed -n \ + -e 's/[^"]*"\([^"]*\)".*/\1/' \ + -e H -e '$$g' -e '$$s/\n/ /g' \ + -e '$$s/.*/'$$i': &\ + touch '$$i/p \ + >> makedep); done + @echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep + @echo '$$r makedep' >>eddep + @echo 'w' >>eddep + @cp Makefile Makefile.bak + ed - Makefile < eddep + @rm -f eddep makedep + @echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile + @echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile + @echo '# see make depend above' >> Makefile + - diff Makefile Makefile.bak + @rm -f Makefile.bak + +# DO NOT DELETE THIS LINE + +hack.Decl.o: hack.h def.mkroom.h +hack.apply.o: hack.h def.edog.h def.mkroom.h +hack.bones.o: hack.h +hack.o: hack.h +hack.cmd.o: hack.h def.func_tab.h +hack.do.o: hack.h +hack.do_name.o: hack.h +hack.do_wear.o: hack.h +hack.dog.o: hack.h hack.mfndpos.h def.edog.h def.mkroom.h +hack.eat.o: hack.h +hack.end.o: hack.h +hack.engrave.o: hack.h +hack.fight.o: hack.h +hack.invent.o: hack.h def.wseg.h +hack.ioctl.o: config.h +hack.lev.o: hack.h def.mkroom.h def.wseg.h +hack.main.o: hack.h +hack.makemon.o: hack.h +hack.mhitu.o: hack.h +hack.mklev.o: hack.h def.mkroom.h +hack.mkmaze.o: hack.h def.mkroom.h +hack.mkobj.o: hack.h +hack.mkshop.o: hack.h def.mkroom.h def.eshk.h +hack.mon.o: hack.h hack.mfndpos.h +hack.monst.o: hack.h def.eshk.h +hack.o_init.o: config.h def.objects.h hack.onames.h +hack.objnam.o: hack.h +hack.options.o: config.h hack.h +hack.pager.o: hack.h +hack.potion.o: hack.h +hack.pri.o: hack.h def.wseg.h +hack.read.o: hack.h +hack.rip.o: hack.h +hack.rumors.o: hack.h +hack.save.o: hack.h +hack.search.o: hack.h +hack.shk.o: hack.h hack.mfndpos.h def.mkroom.h def.eshk.h +hack.shknam.o: hack.h +hack.steal.o: hack.h +hack.termcap.o: config.h def.flag.h +hack.timeout.o: hack.h +hack.topl.o: hack.h +hack.track.o: hack.h +hack.trap.o: hack.h def.mkroom.h +hack.tty.o: hack.h +hack.unix.o: hack.h def.mkroom.h +hack.u_init.o: hack.h +hack.vault.o: hack.h def.mkroom.h +hack.wield.o: hack.h +hack.wizard.o: hack.h +hack.worm.o: hack.h def.wseg.h +hack.worn.o: hack.h +hack.zap.o: hack.h +hack.version.o: date.h +hack.h: config.h def.objclass.h def.monst.h def.gold.h def.trap.h def.obj.h def.flag.h def.rm.h def.permonst.h hack.onames.h + touch hack.h +def.objects.h: config.h def.objclass.h + touch def.objects.h +# DEPENDENCIES MUST END AT END OF FILE +# IF YOU PUT STUFF HERE IT WILL GO AWAY +# see make depend above diff --git a/games/hack/Original_READ_ b/games/hack/Original_READ_ new file mode 100644 index 0000000..9d2070b --- /dev/null +++ b/games/hack/Original_READ_ @@ -0,0 +1,61 @@ +This is export hack, my first semester programming project. + +To set it up for your system, you will have to do the following: + 1: create a hack uid, to own the top ten list, etc. + 2: create a hack directory "/usr/lib/game/hack" is the default. + 2.5: make the directory 700 mode. /* sav files go in there...*/ + 3: modify hack.main.c to use the new directory. + 4: modify hack.main.c so it uses the new hack gid. Gid accounts can +go into magic mode without the password, can get cores with ^G, etc. +(make sure gid isn't checked anywhere else...) + 5: recompile hack. + 6: put it in games after making it set-uid hack. + 8: fix the bugs I undobtedly left in it. + 9: tell me what you think of it. + + Hack uses the UCB file /etc/termcap to get your terminal escape codes. +If you don't use it, you will have to make extensive changes to hack.pri.c + +If you find any bugs (That you think I don't know about), or have any +awesome new changes (Like a better save (One that works!)), or have ANY +questions, write me + Jay Fenlason + 29 East St. + Sudbury Mass. + 01776 + +or call me at (617) 443-5036. Since I have both a modem and a teen-age +sister, Good Luck. + + +Hack is split (roughly) into several source files that do different things. +I have tried to fit all the procedures having to do with a certain segment +of the game into a single file, but the job is not the best in the world. +The rough splits are: + +hack.c General random stuff and things I never got around to moving. +hack.main.c main() and other random procedures, also the lock file stuff. +hack.mon.c Monsters, moving, attacking, etc. +hack.do.c drink, eat, read, wield, save, etc. +hack.do1.c zap, wear, remove, etc... +hack.pri.c stuff having to do with the screen, most of the terminal + independant stuff is in here. +hack.lev.c temp files and calling of mklev. + +Because of the peculiar restraints on our system, I make mklev (create +a level) a separate procedure execd by hack when needed. The source for +mklev is (Naturaly) mklev.c. You may want to put mklev back into hack. +Good luck. + +Most of hack was written by me, with help from + Kenny Woodland (KW) (general random things including + the original BUZZ()) + Mike Thome (MT) (The original chamelian) + and Jon Payne (JP) (The original lock file kludge and + the massive CURS()) + +This entire program would not have been possible without the SFSU Logo +Workshop. I am eternally grateful to all of our students (Especially K.L.), +without whom I would never have seen Rogue. I am especially grateful to +Mike Clancy, without whose generous help I would never have gotten to play +ROGUE. diff --git a/games/hack/READ_ME b/games/hack/READ_ME new file mode 100644 index 0000000..cfe6ca2 --- /dev/null +++ b/games/hack/READ_ME @@ -0,0 +1,92 @@ +Hack is a display oriented dungeons & dragons - like game. +Both display and command structure resemble rogue. +(For a game with the same structure but entirely different display - +a real cave instead of dull rectangles - try Quest) + +Hack was originally written by Jay Fenlason (at lincolnsudbury: + 29 East St., Sudbury Mass., 01776) with help from + Kenny Woodland, Mike Thome and Jon Payne. +Basically it was an implementation of Rogue, however, with 52+ instead of 26 + monster types. +The current version is more than thrice as large (with such new features as + the dog, the long worms, the shops, etc.) and almost entirely rewritten + (only the display routines are the original ones - I must rewrite these + too one day; especially when you are blind strange things still happen). + +Files for hack: + hack The actual game + record Top 100 list (just start with an empty file) + news Tells about recent changes in hack, or bugs found ... + (Just start with no news file.) + data Auxiliary file used by hack to give you the names + and sometimes some more information on the + objects and monsters. + help Introductory information (no doubt outdated). + hh Compactified version of help. + perm An empty file used for locking purposes. + rumors Texts for fortune cookies. + (Some of these contain information on the game, + others are just plain stupid. Additional rumors + are appreciated.) + hack.sh A shell script. + (We have hack.sh in /usr/games/hack and + hack in /usr/games/lib/hackdir/hack and all the other + hack stuff in /usr/games/lib/hackdir - perhaps this + will make the script clear. + There is no need for you to use it.) + READ_ME This file. + Original_READ_ME Jay Fenlason's READ_ME + +System files used: + /etc/termcap Used in conjunction with the environment variable + $TERM. + /bin/cat + /usr/ucb/more + /bin/sh Used when $SHELL is undefined. + +How to install hack: +0. Compile the sources. Perhaps you should first look at the file config.h + and define BSD if you are on a BSDtype system, + define STUPID if your C-compiler chokes on complicated expressions. + Make sure schar and uchar represent signed and unsigned types. + If your C compiler doesnt allow initialization of bit fields + change Bitfield. When config.h looks reasonable, say 'make'. + (Perhaps you have to change TERMLIB in the makefile.) +1. If it didnt exist already, introduce a loginname `play' . +2. The program hack resides in a directory so that it is executable + for everybody and is suid play: + ---s--s--x 1 play 206848 Apr 3 00:17 hack + Perhaps you wish to restrict playing to certain hours, or have games + running under nice; in that case you might write a program play.c + such that the program play is suid play and executable for everybody + while all the games in /usr/games are readable or executable for + play only; all the program play does is asking for the name of a game, + checking that time-of-day and system load do not forbid playing, + and then executing the game. Thus: + -r-sr-sr-x 1 play 13312 May 24 12:52 play + ---x------ 1 play 206848 Apr 3 00:17 hack + If you are worried about security you might let play do + chroot("/usr/games") so that no player can get access to the rest + of the system via shell escapes and the likes. + If you #define SECURE in config.h then hack will not setuid(getuid()) + before executing a chdir(). Hack will always do setuid(getuid()) with + a fork. If you do not define UNIX then hack will not fork. +3. The rest of the stuff belonging to hack sits in a subdirectory hackdir + (on our system /usr/games/lib/hackdir) with modes + drwx------ 3 play 1024 Aug 9 09:03 hackdir + Here all the temporary files will be created (with names like xlock.17 + or user.5). +4. If you are not really short on file space, creating a subdirectory + hackdir/save (modes again drwx------) will enable users to save their + unfinished games. + +The program hack is called +$ hack [-d hackdir] [maxnrofplayers] +(for playing) or +$ hack [-d hackdir] -s [listofusers | limit | all] +(for seeing part of the scorelist). +The shell file hack (in this kit called hack.sh) takes care of +calling hack with the right arguments. + +Send complaints, bug reports, suggestions for improvements to +mcvax!aeb - in real life Andries Brouwer. diff --git a/games/hack/alloc.c b/games/hack/alloc.c new file mode 100644 index 0000000..d94bf8b --- /dev/null +++ b/games/hack/alloc.c @@ -0,0 +1,47 @@ +/* alloc.c - version 1.0.2 */ +#ifdef LINT + +/* + a ridiculous definition, suppressing + "possible pointer alignment problem" for (long *) malloc() + "enlarg defined but never used" + "ftell defined (in ) but never used" + from lint +*/ +#include +long * +alloc(n) unsigned n; { +long dummy = ftell(stderr); + if(n) dummy = 0; /* make sure arg is used */ + return(&dummy); +} + +#else + +extern char *malloc(); +extern char *realloc(); + +long * +alloc(lth) +register unsigned lth; +{ + register char *ptr; + + if(!(ptr = malloc(lth))) + panic("Cannot get %d bytes", lth); + return((long *) ptr); +} + +long * +enlarge(ptr,lth) +register char *ptr; +register unsigned lth; +{ + register char *nptr; + + if(!(nptr = realloc(ptr,lth))) + panic("Cannot reallocate %d bytes", lth); + return((long *) nptr); +} + +#endif LINT diff --git a/games/hack/config.h b/games/hack/config.h new file mode 100644 index 0000000..225077c --- /dev/null +++ b/games/hack/config.h @@ -0,0 +1,192 @@ +/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ +/* config.h - version 1.0.3 */ + +#ifndef CONFIG /* make sure the compiler doesnt see the typedefs twice */ + +#define CONFIG +#define UNIX /* delete if no fork(), exec() available */ +#define CHDIR /* delete if no chdir() available */ + +/* + * Some include files are in a different place under SYSV + * BSD SYSV + * + * + * + * + * Some routines are called differently + * index strchr + * rindex strrchr + * Also, the code for suspend and various ioctls is only given for BSD4.2 + * (I do not have access to a SYSV system.) + */ +#define BSD /* delete this line on System V */ + +/* + * On V7 / 2.9BSD / Ultrix 2.0 and other V7 look-a-likes, a signal trap during + * a read from the tty will cause the read to terminate prematurely with an + * error (EOF) when the signal trap returns. Note that on most version 7 + * type systems, defining `BSD' (above) in addtion to VERSION7 is appropriate. + */ + +#define VERSION7 + +/* #define STUPID */ /* avoid some complicated expressions if + your C compiler chokes on them */ +/* #define PYRAMID_BUG */ /* avoid a bug on the Pyramid */ +/* #define NOWAITINCLUDE */ /* neither nor exists */ + +/* #define WIZARD "casey" /* the person allowed to use the -D option */ +#define RECORD "record"/* the file containing the list of topscorers */ +#define NEWS "news" /* the file containing the latest hack news */ +#define HELP "help" /* the file containing a description of the commands */ +#define SHELP "hh" /* abbreviated form of the same */ +#define RUMORFILE "rumors" /* a file with fortune cookies */ +#define DATAFILE "data" /* a file giving the meaning of symbols used */ +#define FMASK 0660 /* file creation mask */ +#define HLOCK "perm" /* an empty file used for locking purposes */ +#define LLOCK "safelock" /* link to previous */ + +#ifdef UNIX +/* + * Define DEF_PAGER as your default pager, e.g. "/bin/cat" or "/usr/ucb/more" + * If defined, it can be overridden by the environment variable PAGER. + * Hack will use its internal pager if DEF_PAGER is not defined. + * (This might be preferable for security reasons.) + * #define DEF_PAGER ".../mydir/mypager" + */ + +/* + * If you define MAIL, then the player will be notified of new mail + * when it arrives. If you also define DEF_MAILREADER then this will + * be the default mail reader, and can be overridden by the environment + * variable MAILREADER; otherwise an internal pager will be used. + * A stat system call is done on the mailbox every MAILCKFREQ moves. + */ +#define MAIL +#define DEF_MAILREADER "/usr/ucb/mail" /* or e.g. /bin/mail */ +#define MAILCKFREQ 100 + + +#define SHELL /* do not delete the '!' command */ + +#ifdef BSD +#define SUSPEND /* let ^Z suspend the game */ +#endif BSD +#endif UNIX + +#ifdef CHDIR +/* + * If you define HACKDIR, then this will be the default playground; + * otherwise it will be the current directory. + */ +#define HACKDIR "/usr/games/lib/hackdir" + +/* + * Some system administrators are stupid enough to make Hack suid root + * or suid daemon, where daemon has other powers besides that of reading or + * writing Hack files. In such cases one should be careful with chdir's + * since the user might create files in a directory of his choice. + * Of course SECURE is meaningful only if HACKDIR is defined. + */ +#define SECURE /* do setuid(getuid()) after chdir() */ + +/* + * If it is desirable to limit the number of people that can play Hack + * simultaneously, define HACKDIR, SECURE and MAX_NR_OF_PLAYERS. + * #define MAX_NR_OF_PLAYERS 6 + */ +#endif CHDIR + +/* size of terminal screen is (at least) (ROWNO+2) by COLNO */ +#define COLNO 80 +#define ROWNO 22 + +/* + * small signed integers (8 bits suffice) + * typedef char schar; + * will do when you have signed characters; otherwise use + * typedef short int schar; + */ +typedef char schar; + +/* + * small unsigned integers (8 bits suffice - but 7 bits do not) + * - these are usually object types; be careful with inequalities! - + * typedef unsigned char uchar; + * will be satisfactory if you have an "unsigned char" type; otherwise use + * typedef unsigned short int uchar; + */ +typedef unsigned char uchar; + +/* + * small integers in the range 0 - 127, usually coordinates + * although they are nonnegative they must not be declared unsigned + * since otherwise comparisons with signed quantities are done incorrectly + */ +typedef schar xchar; +typedef xchar boolean; /* 0 or 1 */ +#define TRUE 1 +#define FALSE 0 + +/* + * Declaration of bitfields in various structs; if your C compiler + * doesnt handle bitfields well, e.g., if it is unable to initialize + * structs containing bitfields, then you might use + * #define Bitfield(x,n) uchar x + * since the bitfields used never have more than 7 bits. (Most have 1 bit.) + * + * Bitfields declared as `Bitfield' are subject to compile time initialization + * Those declared as `EasyBitfield' are not (so if you compiler's only problem + * with bit fields is that it doesn't like initializing them, leave + * `EasyBitfield' as `unsigned x:n' + */ +#define Bitfield(x,n) uchar x +#define EasyBitfield(x,n) unsigned x:n + +#define SIZE(x) (int)(sizeof(x) / sizeof(x[0])) + +#ifdef VERSION7 +# define STRLEN(quoted) strlen(quoted) +#else +# define STRLEN(quoted) (sizeof(quoted)-1) +#endif + +/* + * Local configuration choices: + */ +/*#define QUEST /* compile quest instead of hack */ +/*#define GOLD_ON_BOTL /* current gold on bottom line */ +#define EXP_ON_BOTL /* current experience points on bottom line */ +/*#define WAN_PROBING /* wand of monster probing */ +/*#define NOWORM /* no long worms */ +/*#define NEWSCORING /* ... */ +/*#define NEWSCR /* ... */ + +/*#define NOSAVEONHANGUP /* obvious? */ +/*#define PERS_IS_UID /* well ... */ +/*#define PERMANENT_MAILBOX /* ... */ + +/*#define LINT /* this is a lint compile */ +/*#define lint /* ditto */ +/*#define nonsense /* enable weird code? */ +/*#define NOT_YET_IMPLEMENTED /* new code */ + +/* + * KLUDGE: C names are too short ... + */ + +#define standoutbeg SOBEG +#define standoutend SOEND +#define done_intr DONEINTR +#define lastwarntime LWTIME +#define lastwarnlev LWLEV +#define fakecorridor FAKECORR +#define corrode_armor CRRDRMR +#define corrode_weapon CRRDWPN +#define monster_nearby MONNRBY +#define monstersym MONSYM +#define stoned_texts STNDTXT +#define stoned_dialogue STNDDLG + +#endif CONFIG diff --git a/games/hack/crypt.c b/games/hack/crypt.c new file mode 100644 index 0000000..a720b86 --- /dev/null +++ b/games/hack/crypt.c @@ -0,0 +1,797 @@ +/* + * This program will read its standard input (a C program) and write it + * back out to the standard output translating words found in C strings in + * that input via the following translation table (trans). If a word is not + * found in the translation table, it will be passed on unchanged. + * + * Note that `words' are considered to be delimited by any non-alphabetic + * character or the beginning or end of the string in which it resides. + * + * Example: "aid" is matched in the string "Do you need aid?" but not in + * the string "I'll send in the maid". + * + * Example: "are not" is found in the string "You are not right!" + */ + +#include +#include + +typedef struct { char *word, *crypt; + } + trans; + + +trans trtab[] = + { "You can't reach the floor!", + "You can't reach the floor.", /* xstr */ + + "You turn to stone ...", + "You turn to stone.", /* xstr */ + + "fatal mistake ...", + "fatal mistake.", /* xstr */ + + "Cannot open %s .", + "Cannot open %s.", /* xstr */ + + "A mysterious force prevents you from going %s.", "%s?", + "Probably someone removed it.", "rmvd?", + "Strange... I didnt know you had that ring.", "rng?", + "Something is written in a very strange way.", "bd eng?", + "No used-up objects on the shopping bill.", "invnt?", + "Strange, this map is not as I remember it.", "map?", + "Somebody is trying some trickery here ...", "tilt!", + "This game is void ...", "barf!", + "What a funny potion! (%u)", "potion(%u)?", + "onbill: paid obj on bill?", "bill?", + "onbill: unpaid obj not on bill?", "bill?", + "obfree: not on bill??", "bill?", + "splitbill: not on bill?", "bill?", + "Negative quantity on bill??", "bill?", + "Zero quantity on bill??", "bill?", + "doinvbill: no shopkeeper?", "bill?", + "Unknown direction", "dir", + "Steal fails!", "steal?", + "Tried to steal a strange worn thing.", "steal?", + "How come you are carrying that chain?", "steal?", + "You hit a trap of type %u", "trap(%u)?", + "Some monster encountered a strange trap.", "trap?", + "Where are your chain and ball??", "trap?", + "Not a single corridor on this level??", "vault?", + "Where is the guard?", "vault?", + "fakecorr overflow", "vault?", + "Do_oname: cannot find obj.", "Do_name?", + "Perhaps there is an old record_lock around", "ld rclk", + "Waiting for access to record file", "Wtng", + "Cannot open record file!", "opn?", + "Cannot write record file", "wrt?", + "Cannot find any entries for", "Ct fnd", + "Error in del_engr", "del_engr", + "error in freeobj", "freeobj?", + "error in freegold", "freegold?", + "Read %d instead of %u bytes", "rd %d != %u", + "Error restoring old game.", "rstr gm?", + "Error reading level file.", "lvl fl?", + "DOORMAX exceeded", "D*MAX", + "rooms not closed by -1", "cls rms", + "Not enough gems", "Gms", + "WARNING: prefix too short.", "prfx?", + "Cannot open data file!", "data?", + "sh: cannot execute.", "sh?", + "Fork failed. Try again.", "Fork!", + "Cannot open %s.", "%s?", + "Cannot open save file. (Continue or Quit)", "bd fl", + "Error while saving: cannot read %s.", "%s?", + "Saved game was not yours.", "Nt urs", + "Cannot open temp file %s!", "%s?", + "Cannot find the iron chain?", "chain?", + "Cannot find the iron ball?", "ball?", + "Cannot find the monster ustuck.", "ustuck?", + "Restobjchn: error reading objchn.", "objchn?", + "Restmonchn: error reading monchn.", "monchn?", + "Shopkeeper administration out of order.", "Shpkpr?", + "Error in shopkeeper administration.", "Shpkpr?", + "Bad shopkeeper administration.", "Shpkpr?", + "Can't get TERM.", "TERM?", + "Unknown terminal type: %s.", "%s?", + "Hack needs a screen of size at least %d by %d.", "bad term!", + "Terminal must backspace.", "bad term!", + "Hack needs CL.", "bad term!", + "Hack can't have OS.", "bad term!", + "Hack needs CM or UP or HO.", "bad term!", + "Playing hack on terminals without cm is suspect...", "bad term!", + "TERMCAP entry too big...", "bad term!", + "Cannot get status of %s.", "%s?", + "Cannot get status of saved level?", "lvl fl?", + "Saved levels out of date.", "lvl fl?", + "Cannot link %s to %s", "%s-%s?", + "Perhaps there is no (empty) file %s ?", "%s?", + "It seems you don't have write permission here.", "wrt?", + "(Try again or remove %s.)", "%s?", + "I don't know what is wrong.", "?", + "Cannot open %s", "%s?", + "Too many hacks running now.", "#?", + "There is a game in progress under your name.", "In progress!", + "Cannot unlink %s.", "%s?", + "cannot creat lock file.", "lock?", + "cannot write lock", "lock?", + "cannot close lock", "lock?", + "Not a single corridor on this level??", "corr?", + "Cannot find worm segment", "worm?", + "Cannot reallocate %d bytes", "realloc %d?", + + "a funny", "an odd", + "a peculiar", "an odd", + "a strange", "an odd", + + "Be seeing you", "Bcnu", + "Restoring old save file", "uncB", + "Worthless piece of", "Worthless", + + "Are", "R", + "are", "r", + "Can", "Cn", + "can", "cn", + "Not", "Nt", + "not", "nt", + "You", "U", + "you", "u", + + "Aren't", "Nt", + "aren't", "rnt", + "R nt", "Rnt", + "r nt", "rnt", + "Cannot", "Ct", + "cannot", "ct", + "Cn nt", "Ct", + "cn nt", "ct", + "Cn't", "Ct", + "cn't", "ct", + + "U r", "U'r", + "u r", "u'r", + "U're", "U'r", + "u're", "u'r", + "U rnt", "U'rnt", + "u rnt", "u'rnt", + "U'r nt", "U'rnt", + "u'r nt", "u'rnt", + "have", "hv", + "having", "hvng", + "hv nt", "hvnt", + "haven't", "hvnt", + "I hv", "Iv", + "I've", "Iv", + "U hv", "Uv", + "u hv", "uv", + "U've", "Uv", + "u've", "uv", + "Your", "Ur", + "your", "ur", + "yourself", "urslf", + + "Did nt", "Dt", + "did nt", "dt", + "Didn't", "Dt", + "didn't", "dt", + "didnt", "dt", + "Do", "D", + "do", "d", + "D nt", "Dt", + "d nt", "dt", + "Don't", "Dt", + "don't", "dt", + "Does nt", "Dsnt", + "does nt", "dsnt", + "Doesn't", "Dsnt", + "doesn't", "dsnt", + + "I am", "Im", + "It is", "Ts", + "it is", "ts", + "There is", "Trs", + "there is", "trs", + "Will nt", "Wnt", + "will nt", "wnt", + "Won't", "Wnt", + "won't", "wnt", + + "U'rnt", "Nt", + "U cnt", "Ct", + "U dnt", "Dt", + "Uv nt", "Uvnt", + "uv nt", "uvnt", + "U hvnt", "Uvnt", + "u hvnt", "uvnt", + "U dropped", "Dropped", + "U finished ur", "Finished", + "U finished", "Finished", + "U'r already", "Already", + "U'r carrying", "Carrying", + + "able", "abl", + "aborted", "abrtd", + "about", "abt", + "above", "abv", + "accepts", "acpts", + "administration", "admn", + "affect", "fct", + "affected", "fctd", + "against", "gnst", + "again", "gn", + "allowed", "llwd", + "almost", "lmst", + "Already", "Lrdy", + "already", "lrdy", + "And", "N", + "and", "n", + "anymore", "ymr", + "any", "y", + "Anything", "Yth", + "anything", "yth", + "appears", "sms", + "armor", "rmr", + "around", "rnd", + "assorted", "ass", + "At", "@", + "at", "@", + "ate", "8", + "awake", "wk", + "awakens", "wkns", + "away", "awy", + "Bad", "Bd", + "bad", "bd", + "back", "bk", + "backpack", "bkpk", + "backspace", "bksp", + "ball", "bl", + "be", "b", + "because", "bcs", + "becomes", "bcms", + "been", "bn", + "before", "bfr", + "begin", "bgn", + "beginning", "bgng", + "behind", "bhnd", + "Being", "Bng", + "being", "bng", + "better", "btr", + "between", "btwn", + "beautiful", "cute", + "befalls", "bfls", + "blast", "blst", + "blinded", "blndd", + "blind", "blnd", + "blob", "blb", + "blown", "blwn", + "bolt", "blt", + "boolean", "bool", + "bottle", "btl", + "breaks", "brks", + "burn", "brn", + "burned", "brnd", + "burning", "brng", + "But", "Bt", + "but", "bt", + "cadaver", "bdy", + "Carrying", "Crryng", + "carrying", "crryng", + "carry", "crry", + "ceiling", "clng", + "chain", "chn", + "choose", "pck", + "climb", "clmb", + "closed", "clsd", + "closes", "clses", + "close", "cls", + "cold", "cld", + "coloured", "clrd", + "command", "cmd", + "confused", "cnfsd", + "confuse", "cnfs", + "confusion", "cnfsn", + "contains", "hlds", + "Continue", "Cont", + "continue", "cont", + "contribution", "gft", + "control", "ctl", + "corridor", "corr", + "course", "crse", + "crashes", "crshs", + "darker", "drkr", + "darkness", "drknss", + "dark", "drk", + "dead", "dd", + "defend", "dfnd", + "delicatessen", "deli", + "description", "dscr", + "detection", "dt", + "device", "dv", + "digging", "dgng", + "dig", "dg", + "direction", "dir", + "directory", "drctry", + "disappears", "dsprs", + "discovered", "dscvrd", + "distance", "dist", + "disturbed", "dstrbd", + "door", "dr", + "downward", "dnwrd", + "down", "dn", + "drop", "drp", + "Dropped", "Drpd", + "dropped", "drpd", + "dungeon", "dngn", + "effort", "eff", + "else", "els", + "empty", "mt", + "enchant", "ncht", + "enormous", "bg", + "enough", "nf", + "enters", "ntrs", + "Error", "Er", + "error", "er", + "escaped", "escpd", + "escape", "escp", + "evaporate", "dry", + "evaporates", "drys", + "Everything", "Evrth", + "everything", "evrth", + "example", "xmpl", + "exist", "xst", + "expences", "xpncs", + "experienced", "xprncd", + "experience", "xprnc", + "Falling", "Fllng", + "falling", "fllng", + "falls", "flls", + "fall", "fll", + "feeling", "flng", + "feels", "fls", + "feel", "fl", + "feet", "ft", + "File", "Fl", + "file", "fl", + "finds", "fnds", + "find", "fnd", + "fingers", "fngrs", + "fingertips", "fngrtps", + "finger", "fngr", + "Finished", "Fnshd", + "finished", "fnshd", + "first", "1st", + "flash", "flsh", + "flask", "flsk", + "float", "flt", + "floating", "fltng", + "floor", "flr", + "followed", "fllwd", + "follow", "fllw", + "food", "fd", + "Fortunately", "4tntly", + "For", "4", + "for", "4", + "from", "fr", + "frozen", "frzn", + "funny", "odd", + "gets", "gts", + "get", "gt", + "gift", "gft", + "give", "gv", + "gladly", "gldly", + "glass", "glss", + "gloves", "glvs", + "glowing", "glwng", + "glows", "glws", + "glow", "glw", + "gold", "gld", + "great", "grt", + "greedy", "grdy", + "guards", "grds", + "guard", "grd", + "had", "hd", + "half", "hlf", + "handed", "hndd", + "hands", "hnds", + "hand", "hnd", + "Happens", "Hpns", + "happens", "hpns", + "hard", "hrd", + "has", "hs", + "head", "hd", + "heavier", "hvyr", + "heavy", "hvy", + "%sheavy", "%shvy", + "held", "hld", + "Hello", "Hi", + "helmet", "hlmt", + "helping", "hlpng", + "helps", "hlps", + "Here", "Hr", + "here", "hr", + "hidden", "hddn", + "Hit", "Ht", + "hit", "ht", + "hits", "hts", + "holding", "hldng", + "However", "Hwvr", + "How", "Hw", + "how", "hw", + "In", "N", + "in", "n", + "incantation", "spl", + "individual", "indiv", + "initialization", "ini", + "inside", "nsd", + "instructions", "instrs", + "interested", "hep", + "Interesting...", "Hmm...", + "interesting", "fun", + "into", "n2", + "inventory", "nvnt", + "Is", "S", + "is", "s", + "items", "itms", + "itself", "itslf", + "kind", "knd", + "know", "kn", + "labeled", "lbld", + "label", "lbl", + "language", "lang", + "large", "lrg", + "leave", "lv", + "leaving", "lvng", + "Left", "Lft", + "left", "lft", + "leg", "lg", + "legs", "lgs", + "Level", "Lvl", + "level", "lvl", + "lift", "lft", + "lifting", "lftng", + "likely", "lkly", + "like", "lk", + "list", "lst", + "little", "ltl", + "liquid", "lqd", + "liquor", "lqr", + "load", "ld", + "look", "lk", + "looking", "lkng", + "looks", "lks", + "longer", "lngr", + "Long", "Lng", + "long", "lng", + "made", "md", + "make", "mk", + "makes", "mks", + "many", "mny", + "message", "msg", + "missed", "msd", + "misses", "mses", + "miss", "ms", + "mistake", "mstk", + "moment", "mmnt", + "money", "bux", + "monsters", "mons", + "monster", "mon", + "Moreover", "Mrvr", + "Most", "Mst", + "moving", "mvng", + "move", "mv", + "much", "mch", + "must", "mst", + "Name", "Nm", + "named", "nmd", + "nearby", "nrby", + "needs", "nds", + "Negative", "Ng", + "never", "nvr", + "nobody", "nbdy", + "Nothing", "Nth", + "nothing", "nth", + "Not", "Nt", + "not", "nt", + "notice", "c", + "Now", "Nw", + "now", "nw", + "Number", "#", + "number", "#", + "objects", "objs", + "object", "obj", + "of", "f", + "off", "ff", + "one", "1", + "only", "nly", + "open", "opn", + "opener", "opnr", + "Opening", "Opng", + "opening", "opng", + "opens", "opns", + "options", "opts", + "option", "opt", + "order", "ordr", + "Outside", "Otsd", + "outside", "otsd", + "out", "ot", + "overflow", "vrfl", + "over", "ovr", + "Paid", "Pd", + "paid", "pd", + "pair", "pr", + "partially", "prtly", + "parts", "prts", + "part", "prt", + "patterns", "ptrns", + "pay", "py", + "paying", "pyng", + "payment", "pymnt", + "peculiarly", "odly", + "peculiar", "od", + "Perhaps", "Prhps", + "perhaps", "prhps", + "Pick", "Pk", + "pick", "pk", + "picture", "pc", + "pieces", "pcs", + "piece", "pc", + "place", "plc", + "Please", "Pls", + "please", "pls", + "plundered", "plndrd", + "points", "pnts", + "poison", "poisn", + "poisoned", "poisnd", + "poisoning", "poisng", + "poisonous", "poisns", + "presence", "prsnc", + "present", "prsnt", + "Probably", "Prb", + "probably", "prb", + "pulls", "pls", + "pull", "pl", + "punished", "pnshd", + "purse", "prs", + "push", "psh", + "put", "pt", + "quantity", "qan", + "quickly", "qckly", + "Readonly", "Rdnly", + "Read", "Rd", + "reading", "rdng", + "reads", "rds", + "read", "rd", + "really", "rly", + "recently", "rcntly", + "record_lock", "rclk", + "refrigerate", "frig", + "remove", "rmv", + "removed", "rmvd", + "renamed", "rnmd", + "Right", "Rt", + "right", "rt", + "rings", "rngs", + "ring", "rng", + "rock", "rk", + "rooms", "rms", + "room", "rm", + "safelock", "sflk", + "satisfied", "satsfied", + "scroll", "scrl", + "scrolls", "scrls", + "seems", "sms", + "seem", "sm", + "see", "c", + "sense", "sns", + "several", "svrl", + "Shopkeeper", "Shpkpr", + "shopkeeper", "shpkpr", + "shopping", "shpng", + "shop", "shp", + "short", "shrt", + "snatches", "sntchs", + "Somebody", "Smbdy", + "somebody", "smbdy", + "Somehow", "Smhw", + "Someone", "Sm1", + "someone", "sm1", + "Something", "Sth", + "something", "sth", + "somewhat", "smwt", + "Some", "Sm", + "some", "sm", + "sound", "snd", + "spins", "spns", + "splashed", "splshd", + "squeeze", "sqz", + "start", "strt", + "still", "stl", + "stomach", "gut", + "stone", "stn", + "stranger", "strgr", + "Strange", "Od", + "strange", "od", + "stuff", "stf", + "Suddenly", "Sdnly", + "suddenly", "sdnly", + "sudden", "sdn", + "sword", "swd", + "takes", "tks", + "take", "tk", + "taking", "tkng", + "teleported", "tprtd", + "teleportation", "tprtn", + "teleport", "tprt", + "terminal", "term", + "terminals", "terms", + "Thank", "Thnk", + "That", "Th", + "that", "th", + "them", "tm", + "themselves", "tmslvs", + "then", "tn", + "There", "Tr", + "there", "tr", + "These", "Tse", + "these", "tse", + "The", "T", + "the", "t", + "Things", "Tgs", + "things", "tgs", + "thing", "tg", + "Thinking", "Thnkng", + "think", "thnk", + "thin", "thn", + "This", "Ths", + "this", "ths", + "thousand", "1k", + "To", "2", + "to", "2", + "top", "tp", + "Too", "2", + "too", "2", + "trap", "trp", + "turned", "trnd", + "turns", "trns", + "turn", "trn", + "two", "2", + "Type", "Typ", + "type", "typ", + "under", "ndr", + "Unfortunately", "N4tntly", + "Unknown", "Nkn", + "unknown", "nkn", + "Unpaid", "Npd", + "unpaid", "npd", + "very", "vry", + "wall", "wl", + "want", "wnt", + "Was", "Ws", + "was", "ws", + "water", "h2o", + "way", "wy", + "weapon", "wpn", + "wear", "wr", + "wearing", "wrng", + "Welcome", "Wlcm", + "welcome", "wlcm", + "were", "wr", + "What", "Wt", + "what", "wt", + "when", "wn", + "Where", "Wr", + "where", "wr", + "while", "wl", + "whistle", "wstl", + "whistling", "wstlng", + "why", "y", + "Will", "Wll", + "Will", "Wll", + "will", "wll", + "wipe", "wp", + "wiped", "wpd", + "without", "w/o", + "With", "Wth", + "with", "/w", + "words", "wrds", + "world", "wrld", + "worth", "wrth", + "worthless", "wrthlss", + "write", "wrt", + "writing", "wrtng", + "written", "wrtn", + "Zorkmids", "Bux", + "zorkmids", "bux", + 0, 0 + }; + + +main () + + { register int incomment = 0, + incharacter = 0; + register char lastc = '\0', + c; + + while ((c = getchar ()) != EOF) + { putchar (c); + + if (incomment) + incomment = !(lastc == '*' && c == '/'); + else + if (incharacter) + if (lastc == '\\' && c == '\\') + c = '\0'; /* don't let '\\' fool us ... */ + else + incharacter = !(lastc != '\\' && c == '\''); + else + if (lastc == '/' && c == '*') + { incomment = 1; + c = '\0'; /* don't let `/ * / ...' fool us */ + } + else if (c == '\'') + incharacter = 1; + else + if (c == '"') + dostring (); + + lastc = c; + } + + exit (0); +} + + +dostring () + + { char string[BUFSIZ]; + register char *cp; + register trans *tp; + + getstring (string); + for (tp = trtab; tp->word; tp++) + scanstring (string, tp->word, tp->crypt); + fputs (string, stdout); + putchar ('"'); + } + + +getstring (string) + register char *string; + + { register char lastc = '"', + c; + + while ((c = getchar ()) != EOF && !(lastc != '\\' && c == '"')) + { if (lastc == '\\' && c == '\n') + c = getchar (); + *string++ = c; + if (lastc == '\\' && c == '\\') + c = '\0'; /* don't let `"...\\"' fool us */ + lastc = c; + } + *string = '\0'; + } + + +scanstring (string, word, crypt) + char *string, *word, *crypt; + + { register int wlen = strlen (word), + clen = strlen (crypt); + register char *cp = string, + *end; + + end = string + strlen (string) - wlen; + while (cp <= end) + if ( strncmp (cp, word, wlen) == 0 + && (cp == string || !isalpha (cp[-1])) + && (cp == end || !isalpha (cp[wlen]))) + { strncpy (cp, crypt, clen); + strcpy (cp + clen, cp + wlen); + cp += clen; + end -= wlen-clen; + } + else + cp++; + } diff --git a/games/hack/data b/games/hack/data new file mode 100644 index 0000000..5d8d509 --- /dev/null +++ b/games/hack/data @@ -0,0 +1,232 @@ + Hack & Quest data file - version 1.0.3 +@ human (or you) +- a wall +| a wall ++ a door +. the floor of a room + a dark part of a room +# a corridor +} water filled area +< the staircase to the previous level +> the staircase to the next level +^ a trap +$ a pile, pot or chest of gold +%% a piece of food +! a potion +* a gem +? a scroll += a ring +/ a wand +[ a suit of armor +) a weapon +( a useful item (camera, key, rope etc.) +0 an iron ball +_ an iron chain +` an enormous rock +" an amulet +, a trapper +: a chameleon +; a giant eel +' a lurker above +& a demon +A a giant ant +B a giant bat +C a centaur; + Of all the monsters put together by the Greek imagination + the Centaurs (Kentauroi) constituted a class in themselves. + Despite a strong streak of sensuality in their make-up, + their normal behaviour was moral, and they took a kindly + thought of man's welfare. The attempted outrage of Nessos on + Deianeira, and that of the whole tribe of Centaurs on the + Lapith women, are more than offset by the hospitality of + Pholos and by the wisdom of Cheiron, physician, prophet, + lyrist, and the instructor of Achilles. Further, the Cen- + taurs were peculiar in that their nature, which united the + body of a horse with the trunk and head of a man, involved + an unthinkable duplication of vital organs and important + members. So grotesque a combination seems almost un-Greek. + These strange creatures were said to live in the caves and + clefts of the mountains, myths associating them especially + with the hills of Thessaly and the range of Erymanthos. + [Mythology of all races, Vol. 1, pp. 270-271] +D a dragon; + In the West the dragon was the natural enemy of man. Although + preferring to live in bleak and desolate regions, whenever it was + seen among men it left in its wake a trail of destruction and + disease. Yet any attempt to slay this beast was a perilous under- + taking. For the dragon's assailant had to contend not only with + clouds of sulphurous fumes pouring from its fire-breathing nos- + trils, but also with the thrashings of its tail, the most deadly + part of its serpent-like body. + [From: Mythical Beasts by Deirdre Headon (The Leprechaun Library)] +E a floating eye +F a freezing sphere +G a gnome; + ... And then a gnome came by, carrying a bundle, an old fellow + three times as large as an imp and wearing clothes of a sort, + especially a hat. And he was clearly just as frightened as the + imps though he could not go so fast. Ramon Alonzo saw that there + must be some great trouble that was vexing magical things; and, + since gnomes speak the language of men, and will answer if spoken + to gently, he raised his hat, and asked of the gnome his name. + The gnome did not stop his hasty shuffle a moment as he answered + 'Alaraba' and grabbed the rim of his hat but forgot to doff it. + 'What is the trouble, Alaraba?' said Ramon Alonzo. + 'White magic. Run!' said the gnome ... + [From: The Charwoman's Shadow, by Lord Dunsany.] +H a hobgoblin; + Hobgoblin. Used by the Puritans and in later times for + wicked goblin spirits, as in Bunyan's 'Hobgoblin nor foul + friend', but its more correct use is for the friendly spir- + its of the brownie type. In 'A midsummer night's dream' a + fairy says to Shakespeare's Puck: + Those that Hobgoblin call you, and sweet Puck, + You do their work, and they shall have good luck: + Are you not he? + and obviously Puck would not wish to be called a hobgoblin + if that was an ill-omened word. + Hobgoblins are on the whole, good-humoured and ready to be + helpful, but fond of practical joking, and like most of the + fairies rather nasty people to annoy. Boggarts hover on the + verge of hobgoblindom. Bogles are just over the edge. + One Hob mentioned by Henderson, was Hob Headless who haunted + the road between Hurworth and Neasham, but could not cross + the little river Kent, which flowed into the Tess. He was + exorcised and laid under a large stone by the roadside for + ninety-nine years and a day. If anyone was so unwary as to + sit on that stone, he would be unable to quit it for ever. + The ninety-nine years is nearly up, so trouble may soon be + heard of on the road between Hurworth and Neasham. + [Katharine Briggs, A dictionary of Fairies] +I an invisible stalker +J a jackal +K a kobold +L a leprechaun; + The Irish Leprechaun is the Faeries' shoemaker and is known + under various names in different parts of Ireland: Cluri- + caune in Cork, Lurican in Kerry, Lurikeen in Kildare and Lu- + rigadaun in Tipperary. Although he works for the Faeries, + the Leprechaun is not of the same species. He is small, has + dark skin and wears strange clothes. His nature has some- + thing of the manic-depressive about it: first he is quite + happy, whistling merrily as he nails a sole on to a shoe; a + few minutes later, he is sullen and morose, drunk on his + home-made heather ale. The Leprechaun's two great loves are + tobacco and whiskey, and he is a first-rate con-man, impos- + sible to out-fox. No one, no matter how clever, has ever + managed to cheat him out of his hidden pot of gold or his + magic shilling. At the last minute he always thinks of some + way to divert his captor's attention and vanishes in the + twinkling of an eye. + [From: A Field Guide to the Little People + by Nancy Arrowsmith & George Moorse. ] +M a mimic +N a nymph +O an orc +P a purple worm +Q a quasit +R a rust monster +S a snake +T a troll +U an umber hulk +V a vampire +W a wraith +X a xorn +Y a yeti +Z a zombie +a an acid blob +b a giant beetle +c a cockatrice; + Once in a great while, when the positions of the stars are + just right, a seven-year-old rooster will lay an egg. Then, + along will come a snake, to coil around the egg, or a toad, + to squat upon the egg, keeping it warm and helping it to + hatch. When it hatches, out comes a creature called basil- + isk, or cockatrice, the most deadly of all creatures. A sin- + gle glance from its yellow, piercing toad's eyes will kill + both man and beast. Its power of destruction is said to be + so great that sometimes simply to hear its hiss can prove + fatal. Its breath is so venomenous that it causes all vege- + tation to wither. + There is, however, one creature which can withstand the + basilisk's deadly gaze, and this is the weasel. No one knows + why this is so, but although the fierce weasel can slay the + basilisk, it will itself be killed in the struggle. Perhaps + the weasel knows the basilisk's fatal weakness: if it ever + sees its own reflection in a mirror it will perish instant- + ly. But even a dead basilisk is dangerous, for it is said + that merely touching its lifeless body can cause a person to + sicken and die. + [From: Mythical Beasts by Deirdre Headon (The Leprechaun + Library) and other sources. ] +d a dog +e an ettin +f a fog cloud +g a gelatinous cube +h a homunculus +i an imp; + ... imps ... little creatures of two feet high that could + gambol and jump prodigiously; ... + [From: The Charwoman's Shadow, by Lord Dunsany.] + + An 'imp' is an off-shoot or cutting. Thus an 'ymp tree' was + a grafted tree, or one grown from a cutting, not from seed. + 'Imp' properly means a small devil, an off-shoot of Satan, + but the distinction between goblins or bogles and imps from + hell is hard to make, and many in the Celtic countries as + well as the English Puritans regarded all fairies as devils. + The fairies of tradition often hover uneasily between the + ghostly and the diabolic state. + [Katharine Briggs, A dictionary of Fairies] +j a jaguar +k a killer bee +l a leocrotta +m a minotaur +n a nurse +o an owlbear +p a piercer +q a quivering blob +r a giant rat +s a scorpion +t a tengu; + The tengu was the most troublesome creature of Japanese + legend. Part bird and part man, with red beak for a nose + and flashing eyes, the tengu was notorious for stirring up + feuds and prolonging enmity between families. Indeed, the + belligerent tengus were supposed to have been man's first + instructors in the use of arms. + [From: Mythical Beasts by Deirdre Headon + (The Leprechaun Library). ] +u a unicorn; + Men have always sought the elusive unicorn, for the single + twisted horn which projected from its forehead was thought + to be a powerful talisman. It was said that the unicorn had + simply to dip the tip of its horn in a muddy pool for the + water to become pure. Men also believed that to drink from + this horn was a protection against all sickness, and that if + the horn was ground to a powder it would act as an antidote + to all poisons. Less than 200 years ago in France, the horn + of a unicorn was used in a ceremony to test the royal food + for poison. + Although only the size of a small horse, the unicorn is a + very fierce beast, capable of killing an elephant with a + single thrust from its horn. Its fleetness of foot also + makes this solitary creature difficult to capture. However, + it can be tamed and captured by a maiden. Made gentle by the + sight of a virgin, the unicorn can be lured to lay its head + in her lap, and in this docile mood, the maiden may secure + it with a golden rope. + [From: Mythical Beasts by Deirdre Headon + (The Leprechaun Library). ] +v a violet fungi +w a long worm; + From its teeth the crysknife can be manufactured. +~ the tail of a long worm +x a xan; + The xan were animals sent to prick the legs of the Lords of Xibalba. +y a yellow light +z a zruty; + The zruty are wild and gigantic beings, living in the wildernesses + of the Tatra mountains. +1 The wizard of Yendor +2 The mail daemon diff --git a/games/hack/date.h b/games/hack/date.h new file mode 100644 index 0000000..9a7ef76 --- /dev/null +++ b/games/hack/date.h @@ -0,0 +1,2 @@ + +char datestring[] = "Tue Jul 23 1985"; diff --git a/games/hack/def.edog.h b/games/hack/def.edog.h new file mode 100644 index 0000000..a5c2b46 --- /dev/null +++ b/games/hack/def.edog.h @@ -0,0 +1,12 @@ +/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ +/* def.edog.h - version 1.0.2 */ + +struct edog { + long hungrytime; /* at this time dog gets hungry */ + long eattime; /* dog is eating */ + long droptime; /* moment dog dropped object */ + unsigned dropdist; /* dist of drpped obj from @ */ + unsigned apport; /* amount of training */ + long whistletime; /* last time he whistled */ +}; +#define EDOG(mp) ((struct edog *)(&(mp->mextra[0]))) diff --git a/games/hack/def.eshk.h b/games/hack/def.eshk.h new file mode 100644 index 0000000..2ebf280 --- /dev/null +++ b/games/hack/def.eshk.h @@ -0,0 +1,24 @@ +/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ +/* def.eshk.h - version 1.0.2 : added 'following' */ + +#define BILLSZ 200 +struct bill_x { + unsigned bo_id; + unsigned useup:1; + unsigned bquan:7; + unsigned price; /* price per unit */ +}; + +struct eshk { + long int robbed; /* amount stolen by most recent customer */ + boolean following; /* following customer since he owes us sth */ + schar shoproom; /* index in rooms; set by inshop() */ + coord shk; /* usual position shopkeeper */ + coord shd; /* position shop door */ + int shoplevel; /* level of his shop */ + int billct; + struct bill_x bill[BILLSZ]; + int visitct; /* nr of visits by most recent customer */ + char customer[PL_NSIZ]; /* most recent customer */ + char shknam[PL_NSIZ]; +}; diff --git a/games/hack/def.flag.h b/games/hack/def.flag.h new file mode 100644 index 0000000..221f33d --- /dev/null +++ b/games/hack/def.flag.h @@ -0,0 +1,42 @@ +/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ +/* def.flag.h - version 1.0.3 */ + +struct flag { + unsigned ident; /* social security number for each monster */ + unsigned debug:1; /* in debugging mode */ +#define wizard flags.debug + unsigned toplin:2; /* a top line (message) has been printed */ + /* 0: top line empty; 2: no --More-- reqd. */ + unsigned cbreak:1; /* in cbreak mode, rogue format */ + unsigned standout:1; /* use standout for --More-- */ + unsigned nonull:1; /* avoid sending nulls to the terminal */ + unsigned time:1; /* display elapsed 'time' */ + unsigned nonews:1; /* suppress news printing */ + unsigned notombstone:1; + unsigned end_top, end_around; /* describe desired score list */ + unsigned end_own:1; /* idem (list all own scores) */ + unsigned no_rest_on_space:1; /* spaces are ignored */ + unsigned beginner:1; + unsigned female:1; + unsigned invlet_constant:1; /* let objects keep their + inventory symbol */ + unsigned move:1; + unsigned mv:1; + unsigned run:3; /* 0: h (etc), 1: H (etc), 2: fh (etc) */ + /* 3: FH, 4: ff+, 5: ff-, 6: FF+, 7: FF- */ + unsigned nopick:1; /* do not pickup objects */ + unsigned echo:1; /* 1 to echo characters */ + unsigned botl:1; /* partially redo status line */ + unsigned botlx:1; /* print an entirely new bottom line */ + unsigned nscrinh:1; /* inhibit nscr() in pline(); */ + unsigned made_amulet:1; + unsigned no_of_wizards:2;/* 0, 1 or 2 (wizard and his shadow) */ + /* reset from 2 to 1, but never to 0 */ + unsigned moonphase:3; +#define NEW_MOON 0 +#define FULL_MOON 4 + +}; + +extern struct flag flags; + diff --git a/games/hack/def.func_tab.h b/games/hack/def.func_tab.h new file mode 100644 index 0000000..63f74d2 --- /dev/null +++ b/games/hack/def.func_tab.h @@ -0,0 +1,16 @@ +/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ +/* def.func_tab.h - version 1.0.2 */ + +struct func_tab { + char f_char; + int (*f_funct)(); +}; + +extern struct func_tab cmdlist[]; + +struct ext_func_tab { + char *ef_txt; + int (*ef_funct)(); +}; + +extern struct ext_func_tab extcmdlist[]; diff --git a/games/hack/def.gen.h b/games/hack/def.gen.h new file mode 100644 index 0000000..f1e44fc --- /dev/null +++ b/games/hack/def.gen.h @@ -0,0 +1,15 @@ +/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ +/* def.gen.h version 1.0.1: added ONCE flag */ + +struct gen { + struct gen *ngen; + xchar gx,gy; + unsigned gflag; /* 037: trap type; 040: SEEN flag */ + /* 0100: ONCE only */ +#define TRAPTYPE 037 +#define SEEN 040 +#define ONCE 0100 +}; +extern struct gen *fgold, *ftrap; +struct gen *g_at(); +#define newgen() (struct gen *) alloc(sizeof(struct gen)) diff --git a/games/hack/def.gold.h b/games/hack/def.gold.h new file mode 100644 index 0000000..8088908 --- /dev/null +++ b/games/hack/def.gold.h @@ -0,0 +1,12 @@ +/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ +/* def.gold.h - version 1.0.2 */ + +struct gold { + struct gold *ngold; + xchar gx,gy; + long amount; +}; + +extern struct gold *fgold; +struct gold *g_at(); +#define newgold() (struct gold *) alloc(sizeof(struct gold)) diff --git a/games/hack/def.mkroom.h b/games/hack/def.mkroom.h new file mode 100644 index 0000000..ddbb62b --- /dev/null +++ b/games/hack/def.mkroom.h @@ -0,0 +1,26 @@ +/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ +/* def.mkroom.h - version 1.0.3 */ + +struct mkroom { + schar lx,hx,ly,hy; /* usually xchar, but hx may be -1 */ + schar rtype,rlit,doorct,fdoor; +}; + +#define MAXNROFROOMS 15 +extern struct mkroom rooms[MAXNROFROOMS+1]; + +#define DOORMAX 100 +extern coord doors[DOORMAX]; + +/* various values of rtype */ +/* 0: ordinary room; 8-15: various shops */ +/* Note: some code assumes that >= 8 means shop, so be careful when adding + new roomtypes */ +#define SWAMP 3 +#define VAULT 4 +#define BEEHIVE 5 +#define MORGUE 6 +#define ZOO 7 +#define SHOPBASE 8 +#define WANDSHOP 9 +#define GENERAL 15 diff --git a/games/hack/def.monst.h b/games/hack/def.monst.h new file mode 100644 index 0000000..fff741f --- /dev/null +++ b/games/hack/def.monst.h @@ -0,0 +1,60 @@ +/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ +/* def.monst.h - version 1.0.2 */ + +struct monst { + struct monst *nmon; + struct permonst *data; + unsigned m_id; + xchar mx,my; + xchar mdx,mdy; /* if mdispl then pos where last displayed */ +#define MTSZ 4 + coord mtrack[MTSZ]; /* monster track */ + schar mhp,mhpmax; + char mappearance; /* nonzero for undetected 'M's and for '1's */ + EasyBitfield(mimic,1); /* undetected mimic */ + EasyBitfield(mdispl,1); /* mdx,mdy valid */ + EasyBitfield(minvis,1); /* invisible */ + EasyBitfield(cham,1); /* shape-changer */ + EasyBitfield(mhide,1); /* hides beneath objects */ + EasyBitfield(mundetected,1); /* not seen in present hiding place */ + EasyBitfield(mspeed,2); + EasyBitfield(msleep,1); + EasyBitfield(mfleetim,7); /* timeout for mflee */ + EasyBitfield(mfroz,1); + EasyBitfield(mconf,1); + EasyBitfield(mflee,1); /* fleeing */ + EasyBitfield(mcan,1); /* has been cancelled */ + EasyBitfield(mtame,1); /* implies peaceful */ + EasyBitfield(mpeaceful,1); /* does not attack unprovoked */ + EasyBitfield(isshk,1); /* is shopkeeper */ + EasyBitfield(isgd,1); /* is guard */ + EasyBitfield(mcansee,1); /* cansee 1, temp.blinded 0, blind 0 */ + EasyBitfield(mblinded,7); /* cansee 0, temp.blinded n, blind 0 */ + EasyBitfield(mtrapped,1); /* trapped in a pit or bear trap */ + EasyBitfield(mnamelth,6); /* length of name (following mxlth) */ +#ifndef NOWORM + EasyBitfield(wormno,5); /* at most 31 worms on any level */ +#endif NOWORM + unsigned mtrapseen; /* bitmap of traps we've been trapped in */ + long mlstmv; /* prevent two moves at once */ + struct obj *minvent; + long mgold; + unsigned mxlth; /* length of following data */ + /* in order to prevent alignment problems mextra should + be (or follow) a long int */ + long mextra[1]; /* monster dependent info */ +}; + +#define newmonst(xl) (struct monst *) alloc((unsigned)(xl) + sizeof(struct monst)) + +extern struct monst *fmon; +extern struct monst *fallen_down; +struct monst *m_at(); + +/* these are in mspeed */ +#define MSLOW 1 /* slow monster */ +#define MFAST 2 /* speeded monster */ + +#define NAME(mtmp) (((char *) mtmp->mextra) + mtmp->mxlth) +#define MREGEN "TVi1" +#define UNDEAD "ZVW " diff --git a/games/hack/def.obj.h b/games/hack/def.obj.h new file mode 100644 index 0000000..b13ecce --- /dev/null +++ b/games/hack/def.obj.h @@ -0,0 +1,48 @@ +/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ +/* def.obj.h - version 1.0.3 */ + +struct obj { + struct obj *nobj; + unsigned o_id; + unsigned o_cnt_id; /* id of container object is in */ + xchar ox,oy; + xchar odx,ody; + uchar otyp; + uchar owt; + uchar quan; /* use oextra for tmp gold objects */ + schar spe; /* quality of weapon, armor or ring (+ or -) + number of charges for wand ( >= -1 ) + special for uball and amulet %% BAH */ + char olet; + char invlet; + EasyBitfield(oinvis,1); /* not yet implemented */ + EasyBitfield(odispl,1); + EasyBitfield(known,1); /* exact nature known */ + EasyBitfield(dknown,1); /* color or text known */ + EasyBitfield(cursed,1); + EasyBitfield(unpaid,1); /* on some bill */ + EasyBitfield(rustfree,1); + EasyBitfield(onamelth,6); + long age; /* creation date */ + long owornmask; +#define W_ARM 01L +#define W_ARM2 02L +#define W_ARMH 04L +#define W_ARMS 010L +#define W_ARMG 020L +#define W_ARMOR (W_ARM | W_ARM2 | W_ARMH | W_ARMS | W_ARMG) +#define W_RINGL 010000L /* make W_RINGL = RING_LEFT (see uprop) */ +#define W_RINGR 020000L +#define W_RING (W_RINGL | W_RINGR) +#define W_WEP 01000L +#define W_BALL 02000L +#define W_CHAIN 04000L + long oextra[1]; /* used for name of ordinary objects - length + is flexible; amount for tmp gold objects */ +}; + +extern struct obj *fobj; + +#define newobj(xl) (struct obj *) alloc((unsigned)(xl) + sizeof(struct obj)) +#define ONAME(otmp) ((char *) otmp->oextra) +#define OGOLD(otmp) (otmp->oextra[0]) diff --git a/games/hack/def.objclass.h b/games/hack/def.objclass.h new file mode 100644 index 0000000..9e17de2 --- /dev/null +++ b/games/hack/def.objclass.h @@ -0,0 +1,60 @@ +/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ +/* def.objclass.h - version 1.0.3 */ + +/* definition of a class of objects */ + +struct objclass { + char *oc_name; /* actual name */ + char *oc_descr; /* description when name unknown */ + char *oc_uname; /* called by user */ + Bitfield(oc_name_known,1); + Bitfield(oc_merge,1); /* merge otherwise equal objects */ + char oc_olet; + schar oc_prob; /* probability for mkobj() */ + schar oc_delay; /* delay when using such an object */ + uchar oc_weight; + schar oc_oc1, oc_oc2; + int oc_oi; +#define nutrition oc_oi /* for foods */ +#define a_ac oc_oc1 /* for armors - only used in ARM_BONUS */ +#define ARM_BONUS(obj) ((10 - objects[obj->otyp].a_ac) + obj->spe) +#define a_can oc_oc2 /* for armors */ +#define bits oc_oc1 /* for wands and rings */ + /* wands */ +#define NODIR 1 +#define IMMEDIATE 2 +#define RAY 4 + /* rings */ +#define SPEC 1 /* +n is meaningful */ +#define wldam oc_oc1 /* for weapons and PICK_AXE */ +#define wsdam oc_oc2 /* for weapons and PICK_AXE */ +#define g_val oc_oi /* for gems: value on exit */ +}; + +extern struct objclass objects[]; + +/* definitions of all object-symbols */ + +#define ILLOBJ_SYM '\\' +#define AMULET_SYM '"' +#define FOOD_SYM '%' +#define WEAPON_SYM ')' +#define TOOL_SYM '(' +#define BALL_SYM '0' +#define CHAIN_SYM '_' +#define ROCK_SYM '`' +#define ARMOR_SYM '[' +#define POTION_SYM '!' +#define SCROLL_SYM '?' +#define WAND_SYM '/' +#define RING_SYM '=' +#define GEM_SYM '*' +/* Other places with explicit knowledge of object symbols: + * ....shk.c: char shtypes[] = "=/)%?!["; + * mklev.c: "=/)%?![<>" + * hack.mkobj.c: char mkobjstr[] = "))[[!!!!????%%%%/=**"; + * hack.apply.c: otmp = getobj("0#%", "put in"); + * hack.eat.c: otmp = getobj("%", "eat"); + * hack.invent.c: if(index("!%?[)=*(0/\"", sym)){ + * hack.invent.c: || index("%?!*",otmp->olet))){ + */ diff --git a/games/hack/def.objects.h b/games/hack/def.objects.h new file mode 100644 index 0000000..55e4d76 --- /dev/null +++ b/games/hack/def.objects.h @@ -0,0 +1,289 @@ +/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ +/* def.objects.h - version 1.0.3 */ + +/* objects have letter " % ) ( 0 _ ` [ ! ? / = * */ +#include "config.h" +#include "def.objclass.h" +#define NULL (char *)0 + +struct objclass objects[] = { + + { "strange object", NULL, NULL, 1, 0, + ILLOBJ_SYM, 0, 0, 0, 0, 0, 0 }, + { "amulet of Yendor", NULL, NULL, 1, 0, + AMULET_SYM, 100, 0, 2, 0, 0, 0 }, + +#define FOOD(name,prob,delay,weight,nutrition) { name, NULL, NULL, 1, 1,\ + FOOD_SYM, prob, delay, weight, 0, 0, nutrition } + +/* dog eats foods 0-4 but prefers 1 above 0,2,3,4 */ +/* food 4 can be read */ +/* food 5 improves your vision */ +/* food 6 makes you stronger (like Popeye) */ +/* foods CORPSE up to CORPSE+52 are cadavers */ + + FOOD("food ration", 50, 5, 4, 800), + FOOD("tripe ration", 20, 1, 2, 200), + FOOD("pancake", 3, 1, 1, 200), + FOOD("dead lizard", 3, 0, 1, 40), + FOOD("fortune cookie", 7, 0, 1, 40), + FOOD("carrot", 2, 0, 1, 50), + FOOD("tin", 7, 0, 1, 0), + FOOD("orange", 1, 0, 1, 80), + FOOD("apple", 1, 0, 1, 50), + FOOD("pear", 1, 0, 1, 50), + FOOD("melon", 1, 0, 1, 100), + FOOD("banana", 1, 0, 1, 80), + FOOD("candy bar", 1, 0, 1, 100), + FOOD("egg", 1, 0, 1, 80), + FOOD("clove of garlic", 1, 0, 1, 40), + FOOD("lump of royal jelly", 0, 0, 1, 200), + + FOOD("dead human", 0, 4, 40, 400), + FOOD("dead giant ant", 0, 1, 3, 30), + FOOD("dead giant bat", 0, 1, 3, 30), + FOOD("dead centaur", 0, 5, 50, 500), + FOOD("dead dragon", 0, 15, 150, 1500), + FOOD("dead floating eye", 0, 1, 1, 10), + FOOD("dead freezing sphere", 0, 1, 1, 10), + FOOD("dead gnome", 0, 1, 10, 100), + FOOD("dead hobgoblin", 0, 2, 20, 200), + FOOD("dead stalker", 0, 4, 40, 400), + FOOD("dead jackal", 0, 1, 10, 100), + FOOD("dead kobold", 0, 1, 10, 100), + FOOD("dead leprechaun", 0, 4, 40, 400), + FOOD("dead mimic", 0, 4, 40, 400), + FOOD("dead nymph", 0, 4, 40, 400), + FOOD("dead orc", 0, 2, 20, 200), + FOOD("dead purple worm", 0, 7, 70, 700), + FOOD("dead quasit", 0, 2, 20, 200), + FOOD("dead rust monster", 0, 5, 50, 500), + FOOD("dead snake", 0, 1, 10, 100), + FOOD("dead troll", 0, 4, 40, 400), + FOOD("dead umber hulk", 0, 5, 50, 500), + FOOD("dead vampire", 0, 4, 40, 400), + FOOD("dead wraith", 0, 1, 1, 10), + FOOD("dead xorn", 0, 7, 70, 700), + FOOD("dead yeti", 0, 7, 70, 700), + FOOD("dead zombie", 0, 1, 3, 30), + FOOD("dead acid blob", 0, 1, 3, 30), + FOOD("dead giant beetle", 0, 1, 1, 10), + FOOD("dead cockatrice", 0, 1, 3, 30), + FOOD("dead dog", 0, 2, 20, 200), + FOOD("dead ettin", 0, 1, 3, 30), + FOOD("dead fog cloud", 0, 1, 1, 10), + FOOD("dead gelatinous cube", 0, 1, 10, 100), + FOOD("dead homunculus", 0, 2, 20, 200), + FOOD("dead imp", 0, 1, 1, 10), + FOOD("dead jaguar", 0, 3, 30, 300), + FOOD("dead killer bee", 0, 1, 1, 10), + FOOD("dead leocrotta", 0, 5, 50, 500), + FOOD("dead minotaur", 0, 7, 70, 700), + FOOD("dead nurse", 0, 4, 40, 400), + FOOD("dead owlbear", 0, 7, 70, 700), + FOOD("dead piercer", 0, 2, 20, 200), + FOOD("dead quivering blob", 0, 1, 10, 100), + FOOD("dead giant rat", 0, 1, 3, 30), + FOOD("dead giant scorpion", 0, 1, 10, 100), + FOOD("dead tengu", 0, 3, 30, 300), + FOOD("dead unicorn", 0, 3, 30, 300), + FOOD("dead violet fungi", 0, 1, 10, 100), + FOOD("dead long worm", 0, 5, 50, 500), +/* %% wt of long worm should be proportional to its length */ + FOOD("dead xan", 0, 3, 30, 300), + FOOD("dead yellow light", 0, 1, 1, 10), + FOOD("dead zruty", 0, 6, 60, 600), + +/* weapons ... - ROCK come several at a time */ +/* weapons ... - (ROCK-1) are shot using idem+(BOW-ARROW) */ +/* weapons AXE, SWORD, THSWORD are good for worm-cutting */ +/* weapons (PCK-)AXE, DAGGER, CRYSKNIFE are good for tin-opening */ +#define WEAPON(name,prob,wt,ldam,sdam) { name, NULL, NULL, 1, 0 /*%%*/,\ + WEAPON_SYM, prob, 0, wt, ldam, sdam, 0 } + + WEAPON("arrow", 7, 0, 6, 6), + WEAPON("sling bullet", 7, 0, 4, 6), + WEAPON("crossbow bolt", 7, 0, 4, 6), + WEAPON("dart", 7, 0, 3, 2), + WEAPON("rock", 6, 1, 3, 3), + WEAPON("boomerang", 2, 3, 9, 9), + WEAPON("mace", 9, 3, 6, 7), + WEAPON("axe", 6, 3, 6, 4), + WEAPON("flail", 6, 3, 6, 5), + WEAPON("long sword", 8, 3, 8, 12), + WEAPON("two handed sword", 6, 4, 12, 6), + WEAPON("dagger", 6, 3, 4, 3), + WEAPON("worm tooth", 0, 4, 2, 2), + WEAPON("crysknife", 0, 3, 10, 10), + WEAPON("spear", 6, 3, 6, 8), + WEAPON("bow", 6, 3, 4, 6), + WEAPON("sling", 5, 3, 6, 6), + WEAPON("crossbow", 6, 3, 4, 6), + + { "whistle", "whistle", NULL, 0, 0, + TOOL_SYM, 90, 0, 2, 0, 0, 0 }, + { "magic whistle", "whistle", NULL, 0, 0, + TOOL_SYM, 10, 0, 2, 0, 0, 0 }, + { "expensive camera", NULL, NULL, 1, 1, + TOOL_SYM, 0, 0, 3, 0, 0, 0 }, + { "ice box", "large box", NULL, 0, 0, + TOOL_SYM, 0, 0, 40, 0, 0, 0 }, + { "pick-axe", NULL, NULL, 1, 1, + TOOL_SYM, 0, 0, 5, 6, 3, 0 }, + { "can opener", NULL, NULL, 1, 1, + TOOL_SYM, 0, 0, 1, 0, 0, 0 }, + { "heavy iron ball", NULL, NULL, 1, 0, + BALL_SYM, 100, 0, 20, 0, 0, 0 }, + { "iron chain", NULL, NULL, 1, 0, + CHAIN_SYM, 100, 0, 20, 0, 0, 0 }, + { "enormous rock", NULL, NULL, 1, 0, + ROCK_SYM, 100, 0, 200 /* > MAX_CARR_CAP */, 0, 0, 0 }, + +#define ARMOR(name,prob,delay,ac,can) { name, NULL, NULL, 1, 0,\ + ARMOR_SYM, prob, delay, 8, ac, can, 0 } + ARMOR("helmet", 3, 1, 9, 0), + ARMOR("plate mail", 5, 5, 3, 2), + ARMOR("splint mail", 8, 5, 4, 1), + ARMOR("banded mail", 10, 5, 4, 0), + ARMOR("chain mail", 10, 5, 5, 1), + ARMOR("scale mail", 10, 5, 6, 0), + ARMOR("ring mail", 15, 5, 7, 0), + /* the armors below do not rust */ + ARMOR("studded leather armor", 13, 3, 7, 1), + ARMOR("leather armor", 17, 3, 8, 0), + ARMOR("elven cloak", 5, 0, 9, 3), + ARMOR("shield", 3, 0, 9, 0), + ARMOR("pair of gloves", 1, 1, 9, 0), + +#define POTION(name,color) { name, color, NULL, 0, 1,\ + POTION_SYM, 0, 0, 2, 0, 0, 0 } + + POTION("restore strength", "orange"), + POTION("booze", "bubbly"), + POTION("invisibility", "glowing"), + POTION("fruit juice", "smoky"), + POTION("healing", "pink"), + POTION("paralysis", "puce"), + POTION("monster detection", "purple"), + POTION("object detection", "yellow"), + POTION("sickness", "white"), + POTION("confusion", "swirly"), + POTION("gain strength", "purple-red"), + POTION("speed", "ruby"), + POTION("blindness", "dark green"), + POTION("gain level", "emerald"), + POTION("extra healing", "sky blue"), + POTION("levitation", "brown"), + POTION(NULL, "brilliant blue"), + POTION(NULL, "clear"), + POTION(NULL, "magenta"), + POTION(NULL, "ebony"), + +#define SCROLL(name,text,prob) { name, text, NULL, 0, 1,\ + SCROLL_SYM, prob, 0, 3, 0, 0, 0 } + SCROLL("mail", "KIRJE", 0), + SCROLL("enchant armor", "ZELGO MER", 6), + SCROLL("destroy armor", "JUYED AWK YACC", 5), + SCROLL("confuse monster", "NR 9", 5), + SCROLL("scare monster", "XIXAXA XOXAXA XUXAXA", 4), + SCROLL("blank paper", "READ ME", 3), + SCROLL("remove curse", "PRATYAVAYAH", 6), + SCROLL("enchant weapon", "DAIYEN FOOELS", 6), + SCROLL("damage weapon", "HACKEM MUCHE", 5), + SCROLL("create monster", "LEP GEX VEN ZEA", 5), + SCROLL("taming", "PRIRUTSENIE", 1), + SCROLL("genocide", "ELBIB YLOH",2), + SCROLL("light", "VERR YED HORRE", 10), + SCROLL("teleportation", "VENZAR BORGAVVE", 5), + SCROLL("gold detection", "THARR", 4), + SCROLL("food detection", "YUM YUM", 1), + SCROLL("identify", "KERNOD WEL", 18), + SCROLL("magic mapping", "ELAM EBOW", 5), + SCROLL("amnesia", "DUAM XNAHT", 3), + SCROLL("fire", "ANDOVA BEGARIN", 5), + SCROLL("punishment", "VE FORBRYDERNE", 1), + SCROLL(NULL, "VELOX NEB", 0), + SCROLL(NULL, "FOOBIE BLETCH", 0), + SCROLL(NULL, "TEMOV", 0), + SCROLL(NULL, "GARVEN DEH", 0), + +#define WAND(name,metal,prob,flags) { name, metal, NULL, 0, 0,\ + WAND_SYM, prob, 0, 3, flags, 0, 0 } + + WAND("light", "iridium", 10, NODIR), + WAND("secret door detection", "tin", 5, NODIR), + WAND("create monster", "platinum", 5, NODIR), + WAND("wishing", "glass", 1, NODIR), + WAND("striking", "zinc", 9, IMMEDIATE), + WAND("slow monster", "balsa", 5, IMMEDIATE), + WAND("speed monster", "copper", 5, IMMEDIATE), + WAND("undead turning", "silver", 5, IMMEDIATE), + WAND("polymorph", "brass", 5, IMMEDIATE), + WAND("cancellation", "maple", 5, IMMEDIATE), + WAND("teleportation", "pine", 5, IMMEDIATE), + WAND("make invisible", "marble", 9, IMMEDIATE), + WAND("digging", "iron", 5, RAY), + WAND("magic missile", "aluminium", 10, RAY), + WAND("fire", "steel", 5, RAY), + WAND("sleep", "curved", 5, RAY), + WAND("cold", "short", 5, RAY), + WAND("death", "long", 1, RAY), + WAND(NULL, "oak", 0, 0), + WAND(NULL, "ebony", 0, 0), + WAND(NULL, "runed", 0, 0), + +#define RING(name,stone,spec) { name, stone, NULL, 0, 0,\ + RING_SYM, 0, 0, 1, spec, 0, 0 } + + RING("adornment", "engagement", 0), + RING("teleportation", "wooden", 0), + RING("regeneration", "black onyx", 0), + RING("searching", "topaz", 0), + RING("see invisible", "pearl", 0), + RING("stealth", "sapphire", 0), + RING("levitation", "moonstone", 0), + RING("poison resistance", "agate", 0), + RING("aggravate monster", "tiger eye", 0), + RING("hunger", "shining", 0), + RING("fire resistance", "gold", 0), + RING("cold resistance", "copper", 0), + RING("protection from shape changers", "diamond", 0), + RING("conflict", "jade", 0), + RING("gain strength", "ruby", SPEC), + RING("increase damage", "silver", SPEC), + RING("protection", "granite", SPEC), + RING("warning", "wire", 0), + RING("teleport control", "iron", 0), + RING(NULL, "ivory", 0), + RING(NULL, "blackened", 0), + +/* gems ************************************************************/ +#define GEM(name,color,prob,gval) { name, color, NULL, 0, 1,\ + GEM_SYM, prob, 0, 1, 0, 0, gval } + GEM("diamond", "blue", 1, 4000), + GEM("ruby", "red", 1, 3500), + GEM("sapphire", "blue", 1, 3000), + GEM("emerald", "green", 1, 2500), + GEM("turquoise", "green", 1, 2000), + GEM("aquamarine", "blue", 1, 1500), + GEM("tourmaline", "green", 1, 1000), + GEM("topaz", "yellow", 1, 900), + GEM("opal", "yellow", 1, 800), + GEM("garnet", "dark", 1, 700), + GEM("amethyst", "violet", 2, 650), + GEM("agate", "green", 2, 600), + GEM("onyx", "white", 2, 550), + GEM("jasper", "yellowish brown", 2, 500), + GEM("jade", "green", 2, 450), + GEM("worthless piece of blue glass", "blue", 20, 0), + GEM("worthless piece of red glass", "red", 20, 0), + GEM("worthless piece of yellow glass", "yellow", 20, 0), + GEM("worthless piece of green glass", "green", 20, 0), + { NULL, NULL, NULL, 0, 0, ILLOBJ_SYM, 0, 0, 0, 0, 0, 0 } +}; + +char obj_symbols[] = { + ILLOBJ_SYM, AMULET_SYM, FOOD_SYM, WEAPON_SYM, TOOL_SYM, + BALL_SYM, CHAIN_SYM, ROCK_SYM, ARMOR_SYM, POTION_SYM, SCROLL_SYM, + WAND_SYM, RING_SYM, GEM_SYM, 0 }; +int bases[sizeof(obj_symbols)]; diff --git a/games/hack/def.permonst.h b/games/hack/def.permonst.h new file mode 100644 index 0000000..b19efc6 --- /dev/null +++ b/games/hack/def.permonst.h @@ -0,0 +1,25 @@ +/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ +/* def.permonst.h - version 1.0.2 */ + +struct permonst { + char *mname,mlet; + schar mlevel,mmove,ac,damn,damd; + unsigned pxlth; +}; + +extern struct permonst mons[]; +#define PM_ACID_BLOB &mons[7] +#define PM_ZOMBIE &mons[13] +#define PM_PIERCER &mons[17] +#define PM_KILLER_BEE &mons[26] +#define PM_WRAITH &mons[33] +#define PM_MIMIC &mons[37] +#define PM_VAMPIRE &mons[43] +#define PM_CHAMELEON &mons[47] +#define PM_DEMON &mons[54] +#define PM_MINOTAUR &mons[55] /* last in mons array */ +#define PM_SHK &mons[56] /* very last */ +#define PM_GHOST &pm_ghost +#define PM_EEL &pm_eel +#define PM_WIZARD &pm_wizard +#define CMNUM 55 /* number of common monsters */ diff --git a/games/hack/def.rm.h b/games/hack/def.rm.h new file mode 100644 index 0000000..eadedae --- /dev/null +++ b/games/hack/def.rm.h @@ -0,0 +1,56 @@ +/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ +/* def.rm.h - version 1.0.2 */ + +/* Level location types */ +#define HWALL 1 +#define VWALL 2 +#define SDOOR 3 +#define SCORR 4 +#define LDOOR 5 +#define POOL 6 /* not yet fully implemented */ + /* this should in fact be a bit like lit */ +#define DOOR 7 +#define CORR 8 +#define ROOM 9 +#define STAIRS 10 + +/* + * Avoid using the level types in inequalities: + * these types are subject to change. + * Instead, use one of the macros below. + */ +#define IS_WALL(typ) ((typ) <= VWALL) +#define IS_ROCK(typ) ((typ) < POOL) /* absolutely nonaccessible */ +#define ACCESSIBLE(typ) ((typ) >= DOOR) /* good position */ +#define IS_ROOM(typ) ((typ) >= ROOM) /* ROOM or STAIRS */ +#define ZAP_POS(typ) ((typ) > DOOR) + +/* + * A few of the associated symbols are not hardwired. + */ +#ifdef QUEST +#define CORR_SYM ':' +#else +#define CORR_SYM '#' +#endif QUEST +#define POOL_SYM '}' + +#define ERRCHAR '{' + +/* + * The structure describing a coordinate position. + * Before adding fields, remember that this will significantly affect + * the size of temporary files and save files. + */ +struct rm { +/* +KLUDGE: changing scrsym below to `unsigned :8' from `char' cuts the size of + the `rm' structure in half +*/ + unsigned scrsym:8; + unsigned typ:5; + unsigned new:1; + unsigned seen:1; + unsigned lit:1; +}; +extern struct rm levl[COLNO][ROWNO]; diff --git a/games/hack/def.trap.h b/games/hack/def.trap.h new file mode 100644 index 0000000..26946ad --- /dev/null +++ b/games/hack/def.trap.h @@ -0,0 +1,27 @@ +/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ +/* def.trap.h - version 1.0.2 */ + +struct trap { + struct trap *ntrap; + xchar tx,ty; + unsigned ttyp:5; + unsigned tseen:1; + unsigned once:1; +}; + +extern struct trap *ftrap; +struct trap *t_at(); +#define newtrap() (struct trap *) alloc(sizeof(struct trap)) + +/* various kinds of traps */ +#define BEAR_TRAP 0 +#define ARROW_TRAP 1 +#define DART_TRAP 2 +#define TRAPDOOR 3 +#define TELEP_TRAP 4 +#define PIT 5 +#define SLP_GAS_TRAP 6 +#define PIERC 7 +#define MIMIC 8 /* used only in mklev.c */ +#define TRAPNUM 9 /* if not less than 32, change sizeof(ttyp) */ + /* see also mtrapseen (bit map) */ diff --git a/games/hack/def.wseg.h b/games/hack/def.wseg.h new file mode 100644 index 0000000..0a2af77 --- /dev/null +++ b/games/hack/def.wseg.h @@ -0,0 +1,13 @@ +/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ +/* def.wseg.h - version 1.0.2 */ + +#ifndef NOWORM +/* worm structure */ +struct wseg { + struct wseg *nseg; + xchar wx,wy; + unsigned wdispl:1; +}; + +#define newseg() (struct wseg *) alloc(sizeof(struct wseg)) +#endif NOWORM diff --git a/games/hack/hack.6 b/games/hack/hack.6 new file mode 100644 index 0000000..c4c46c3 --- /dev/null +++ b/games/hack/hack.6 @@ -0,0 +1,155 @@ +.TH HACK 6 "31 March 1985" +.UC 4 +.SH NAME +hack \- Exploring The Dungeons of Doom +.SH SYNOPSIS +.B /usr/games/hack +[ +.B \-d +.I directory +] +[ +.B \-n +] +[ +.B \-u +.I playername +] +.br +.B /usr/games/hack +[ +.B \-d +.I directory +] +.B \-s +[ +.B \-X +] +[ +.I playernames +] +.SH DESCRIPTION +.PP +.I Hack +is a display oriented dungeons & dragons - like game. +Both display and command structure resemble rogue. +(For a game with the same structure but entirely different display - +a real cave instead of dull rectangles - try Quest.) +.PP +To get started you really only need to know two commands. The command +.B ? +will give you a list of the available commands and the command +.B / +will identify the things you see on the screen. +.PP +To win the game (as opposed to merely playing to beat other people high +scores) you must locate the Amulet of Yendor which is somewhere below +the 20th level of the dungeon and get it out. Nobody has achieved this +yet and if somebody does, he will probably go down in history as a hero +among heros. +.PP +When the game ends, either by your death, when you quit, or if you escape +from the caves, +.I hack +will give you (a fragment of) the list of top scorers. The scoring +is based on many aspects of your behaviour but a rough estimate is +obtained by taking the amount of gold you've found in the cave plus four +times your (real) experience. Precious stones may be worth a lot of gold +when brought to the exit. +There is a 10% penalty for getting yourself killed. +.PP +The administration of the game is kept in the directory specified with the +.B \-d +option, or, if no such option is given, in the directory specified by +the environment variable HACKDIR, or, if no such variable exists, in +the current directory. This same directory contains several auxiliary +files such as lockfiles and the list of topscorers and a subdirectory +.I save +where games are saved. +The game administrator may however choose to install hack with a fixed +playing ground, usually /usr/games/lib/hackdir. +.PP +The +.B \-n +option suppresses printing of the news. +.PP +The +.B \-u +.I playername +option supplies the answer to the question "Who are you?". +When +.I playername +has as suffix one of +.B \-T \-S \-K \-F \-C \-W +then this supplies the answer to the question "What kind of character ... ?". +.PP +The +.B \-s +option will print out the list of your scores. It may be followed by arguments +.B \-X +where X is one of the letters C, F, K, S, T, W to print the scores of +Cavemen, Fighters, Knights, Speleologists, Tourists or Wizards. +It may also be followed by one or more player names to print the scores of the +players mentioned. +.SH AUTHORS +Jay Fenlason (+ Kenny Woodland, Mike Thome and Jon Payne) wrote the +original hack, very much like rogue (but full of bugs). +.br +Andries Brouwer continuously deformed their sources into the current +version - in fact an entirely different game. +.SH FILES +.DT +.ta \w'data, rumors\ \ \ 'u +hack The hack program. +.br +data, rumors Data files used by hack. +.br +help, hh Help data files. +.br +record The list of topscorers. +.br +save A subdirectory containing the saved +.br + games. +.br +bones_dd Descriptions of the ghost and +.br + belongings of a deceased adventurer. +.br +xlock.dd Description of a dungeon level. +.br +safelock Lock file for xlock. +.br +record_lock Lock file for record. +.SH ENVIRONMENT +.DT +.ta \w'HACKPAGER, PAGER\ \ \ 'u +USER or LOGNAME Your login name. +.br +HOME Your home directory. +.br +SHELL Your shell. +.br +TERM The type of your terminal. +.br +HACKPAGER, PAGER Pager used instead of default pager. +.br +MAIL Mailbox file. +.br +MAILREADER Reader used instead of default +.br + (probably /bin/mail or /usr/ucb/mail). +.br +HACKDIR Playground. +.br +HACKOPTIONS String predefining several hack options +.br + (see help file). +.br + +Several other environment variables are used in debugging (wizard) mode, +like GENOCIDED, INVENT, MAGIC and SHOPTYPE. +.SH BUGS +.PP +Probably infinite. +Mail complaints to mcvax!aeb . diff --git a/games/hack/hack.Decl.c b/games/hack/hack.Decl.c new file mode 100644 index 0000000..b2855ac --- /dev/null +++ b/games/hack/hack.Decl.c @@ -0,0 +1,43 @@ +/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ +/* hack.Decl.c - version 1.0.3 */ + +#include "hack.h" +char nul[40]; /* contains zeros */ +char plname[PL_NSIZ]; /* player name */ +char lock[PL_NSIZ+4] = "1lock"; /* long enough for login name .99 */ + +boolean in_mklev, restoring; + +struct rm levl[COLNO][ROWNO]; /* level map */ +#ifndef QUEST +#include "def.mkroom.h" +struct mkroom rooms[MAXNROFROOMS+1]; +coord doors[DOORMAX]; +#endif QUEST +struct monst *fmon = 0; +struct trap *ftrap = 0; +struct gold *fgold = 0; +struct obj *fobj = 0, *fcobj = 0, *invent = 0, *uwep = 0, *uarm = 0, + *uarm2 = 0, *uarmh = 0, *uarms = 0, *uarmg = 0, *uright = 0, + *uleft = 0, *uchain = 0, *uball = 0; +struct flag flags; +struct you u; +struct monst youmonst; /* dummy; used as return value for boomhit */ + +xchar dlevel = 1; +xchar xupstair, yupstair, xdnstair, ydnstair; +char *save_cm = 0, *killer, *nomovemsg; + +long moves = 1; +long wailmsg = 0; + +int multi = 0; +char genocided[60]; +char fut_geno[60]; + +xchar curx,cury; +xchar seelx, seehx, seely, seehy; /* corners of lit room */ + +coord bhitpos; + +char quitchars[] = " \r\n\033"; diff --git a/games/hack/hack.apply.c b/games/hack/hack.apply.c new file mode 100644 index 0000000..72c91ed --- /dev/null +++ b/games/hack/hack.apply.c @@ -0,0 +1,446 @@ +/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ +/* hack.apply.c - version 1.0.3 */ + +#include "hack.h" +#include "def.edog.h" +#include "def.mkroom.h" +extern struct monst *bchit(); +extern struct obj *addinv(); +extern struct trap *maketrap(); +extern int (*occupation)(); +extern char *occtxt; +extern char quitchars[]; +extern char pl_character[]; + +doapply() { + register struct obj *obj; + register int res = 1; + + obj = getobj("(", "use or apply"); + if(!obj) return(0); + + switch(obj->otyp){ + case EXPENSIVE_CAMERA: + use_camera(obj); break; + case ICE_BOX: + use_ice_box(obj); break; + case PICK_AXE: + res = use_pick_axe(obj); + break; + + case MAGIC_WHISTLE: + if(pl_character[0] == 'W' || u.ulevel > 9) { + use_magic_whistle(obj); + break; + } + /* fall into next case */ + case WHISTLE: + use_whistle(obj); + break; + + case CAN_OPENER: + if(!carrying(TIN)) { + pline("You have no can to open."); + goto xit; + } + pline("You cannot open a tin without eating its contents."); + pline("In order to eat, use the 'e' command."); + if(obj != uwep) + pline("Opening the tin will be much easier if you wield the can-opener."); + goto xit; + + default: + pline("Sorry, I don't know how to use that."); + xit: + nomul(0); + return(0); + } + nomul(0); + return(res); +} + +/* ARGSUSED */ +static +use_camera(obj) /* register */ struct obj *obj; { +register struct monst *mtmp; + if(!getdir(1)){ /* ask: in what direction? */ + flags.move = multi = 0; + return; + } + if(u.uswallow) { + pline("You take a picture of %s's stomach.", monnam(u.ustuck)); + return; + } + if(u.dz) { + pline("You take a picture of the %s.", + (u.dz > 0) ? "floor" : "ceiling"); + return; + } + if(mtmp = bchit(u.dx, u.dy, COLNO, '!')) { + if(mtmp->msleep){ + mtmp->msleep = 0; + pline("The flash awakens %s.", monnam(mtmp)); /* a3 */ + } else + if(mtmp->data->mlet != 'y') + if(mtmp->mcansee || mtmp->mblinded){ + register int tmp = dist(mtmp->mx,mtmp->my); + register int tmp2; + if(cansee(mtmp->mx,mtmp->my)) + pline("%s is blinded by the flash!", Monnam(mtmp)); + setmangry(mtmp); + if(tmp < 9 && !mtmp->isshk && rn2(4)) { + mtmp->mflee = 1; + if(rn2(4)) mtmp->mfleetim = rnd(100); + } + if(tmp < 3) mtmp->mcansee = mtmp->mblinded = 0; + else { + tmp2 = mtmp->mblinded; + tmp2 += rnd(1 + 50/tmp); + if(tmp2 > 127) tmp2 = 127; + mtmp->mblinded = tmp2; + mtmp->mcansee = 0; + } + } + } +} + +static +struct obj *current_ice_box; /* a local variable of use_ice_box, to be + used by its local procedures in/ck_ice_box */ +static +in_ice_box(obj) register struct obj *obj; { + if(obj == current_ice_box || + (Punished && (obj == uball || obj == uchain))){ + pline("You must be kidding."); + return(0); + } + if(obj->owornmask & (W_ARMOR | W_RING)) { + pline("You cannot refrigerate something you are wearing."); + return(0); + } + if(obj->owt + current_ice_box->owt > 70) { + pline("It won't fit."); + return(1); /* be careful! */ + } + if(obj == uwep) { + if(uwep->cursed) { + pline("Your weapon is welded to your hand!"); + return(0); + } + setuwep((struct obj *) 0); + } + current_ice_box->owt += obj->owt; + freeinv(obj); + obj->o_cnt_id = current_ice_box->o_id; + obj->nobj = fcobj; + fcobj = obj; + obj->age = moves - obj->age; /* actual age */ + return(1); +} + +/* + KLUDGE -- pointer to static function passed around + -- not allowed in overlay scheme +static +*/ +ck_ice_box(obj) register struct obj *obj; { + return(obj->o_cnt_id == current_ice_box->o_id); +} + +/* + KLUDGE -- pointer to static function passed around + -- not allowed in overlay scheme +static +*/ +out_ice_box(obj) register struct obj *obj; { +register struct obj *otmp; + if(obj == fcobj) fcobj = fcobj->nobj; + else { + for(otmp = fcobj; otmp->nobj != obj; otmp = otmp->nobj) + if(!otmp->nobj) panic("out_ice_box"); + otmp->nobj = obj->nobj; + } + current_ice_box->owt -= obj->owt; + obj->age = moves - obj->age; /* simulated point of time */ + (void) addinv(obj); +} + +static +use_ice_box(obj) register struct obj *obj; { +register int cnt = 0; +register struct obj *otmp; + current_ice_box = obj; /* for use by in/out_ice_box */ + for(otmp = fcobj; otmp; otmp = otmp->nobj) + if(otmp->o_cnt_id == obj->o_id) + cnt++; + if(!cnt) pline("Your ice-box is empty."); + else { + pline("Do you want to take something out of the ice-box? [yn] "); + if(readchar() == 'y') + if(askchain(fcobj, (char *) 0, 0, out_ice_box, ck_ice_box, 0)) + return; + pline("That was all. Do you wish to put something in? [yn] "); + if(readchar() != 'y') return; + } + /* call getobj: 0: allow cnt; #: allow all types; %: expect food */ + otmp = getobj("0#%", "put in"); + if(!otmp || !in_ice_box(otmp)) + flags.move = multi = 0; +} + +static +struct monst * +bchit(ddx,ddy,range,sym) register int ddx,ddy,range; char sym; { + register struct monst *mtmp = (struct monst *) 0; + register int bchx = u.ux, bchy = u.uy; + + if(sym) Tmp_at(-1, sym); /* open call */ + while(range--) { + bchx += ddx; + bchy += ddy; + if(mtmp = m_at(bchx,bchy)) + break; + if(!ZAP_POS(levl[bchx][bchy].typ)) { + bchx -= ddx; + bchy -= ddy; + break; + } + if(sym) Tmp_at(bchx, bchy); + } + if(sym) Tmp_at(-1, -1); + return(mtmp); +} + +/* ARGSUSED */ +static +use_whistle(obj) struct obj *obj; { +register struct monst *mtmp = fmon; + pline("You produce a high whistling sound."); + while(mtmp) { + if(dist(mtmp->mx,mtmp->my) < u.ulevel*20) { + if(mtmp->msleep) + mtmp->msleep = 0; + if(mtmp->mtame) + EDOG(mtmp)->whistletime = moves; + } + mtmp = mtmp->nmon; + } +} + +/* ARGSUSED */ +static +use_magic_whistle(obj) struct obj *obj; { +register struct monst *mtmp = fmon; + pline("You produce a strange whistling sound."); + while(mtmp) { + if(mtmp->mtame) mnexto(mtmp); + mtmp = mtmp->nmon; + } +} + +static int dig_effort; /* effort expended on current pos */ +static uchar dig_level; +static coord dig_pos; +static boolean dig_down; + +/* + KLUDGE -- pointer to static function passed around + -- not allowed in overlay scheme +static +*/ +dig() { + register struct rm *lev; + register dpx = dig_pos.x, dpy = dig_pos.y; + + /* perhaps a nymph stole his pick-axe while he was busy digging */ + /* or perhaps he teleported away */ + if(u.uswallow || !uwep || uwep->otyp != PICK_AXE || + dig_level != dlevel || + ((dig_down && (dpx != u.ux || dpy != u.uy)) || + (!dig_down && dist(dpx,dpy) > 2))) + return(0); + + dig_effort += 10 + abon() + uwep->spe + rn2(5); + if(dig_down) { + if(!xdnstair) { + pline("The floor here seems too hard to dig in."); + return(0); + } + if(dig_effort > 250) { + dighole(); + return(0); /* done with digging */ + } + if(dig_effort > 50) { + register struct trap *ttmp = t_at(dpx,dpy); + + if(!ttmp) { + ttmp = maketrap(dpx,dpy,PIT); + ttmp->tseen = 1; + pline("You have dug a pit."); + u.utrap = rn1(4,2); + u.utraptype = TT_PIT; + return(0); + } + } + } else + if(dig_effort > 100) { + register char *digtxt; + register struct obj *obj; + + lev = &levl[dpx][dpy]; + if(obj = sobj_at(ENORMOUS_ROCK, dpx, dpy)) { + fracture_rock(obj); + digtxt = "The rock falls apart."; + } else if(!lev->typ || lev->typ == SCORR) { + lev->typ = CORR; + digtxt = "You succeeded in cutting away some rock."; + } else if(lev->typ == HWALL || lev->typ == VWALL + || lev->typ == SDOOR) { + lev->typ = xdnstair ? DOOR : ROOM; + digtxt = "You just made an opening in the wall."; + } else + digtxt = "Now what exactly was it that you were digging in?"; + mnewsym(dpx, dpy); + prl(dpx, dpy); + pline(digtxt); /* after mnewsym & prl */ + return(0); + } else { + if(IS_WALL(levl[dpx][dpy].typ)) { + register int rno = inroom(dpx,dpy); + + if(rno >= 0 && rooms[rno].rtype >= 8) { + pline("This wall seems too hard to dig into."); + return(0); + } + } + pline("You hit the rock with all your might."); + } + return(1); +} + +/* When will hole be finished? Very rough indication used by shopkeeper. */ +holetime() { + return( (occupation == dig) ? (250 - dig_effort)/20 : -1); +} + +dighole() +{ + register struct trap *ttmp = t_at(u.ux, u.uy); + + if(!xdnstair) { + pline("The floor here seems too hard to dig in."); + } else { + if(ttmp) + ttmp->ttyp = TRAPDOOR; + else + ttmp = maketrap(u.ux, u.uy, TRAPDOOR); + ttmp->tseen = 1; + pline("You've made a hole in the floor."); + if(!u.ustuck) { + if(inshop()) + shopdig(1); + pline("You fall through ..."); + if(u.utraptype == TT_PIT) { + u.utrap = 0; + u.utraptype = 0; + } + goto_level(dlevel+1, FALSE); + } + } +} + +static +use_pick_axe(obj) +struct obj *obj; +{ + char dirsyms[12]; + extern char sdir[]; + register char *dsp = dirsyms, *sdp = sdir; + register struct monst *mtmp; + register struct rm *lev; + register int rx, ry, res = 0; + + if(obj != uwep) { + if(uwep && uwep->cursed) { + /* Andreas Bormann - ihnp4!decvax!mcvax!unido!ab */ + pline("Since your weapon is welded to your hand,"); + pline("you cannot use that pick-axe."); + return(0); + } + pline("You now wield %s.", doname(obj)); + setuwep(obj); + res = 1; + } + while(*sdp) { + (void) movecmd(*sdp); /* sets u.dx and u.dy and u.dz */ + rx = u.ux + u.dx; + ry = u.uy + u.dy; + if(u.dz > 0 || (u.dz == 0 && isok(rx, ry) && + (IS_ROCK(levl[rx][ry].typ) + || sobj_at(ENORMOUS_ROCK, rx, ry)))) + *dsp++ = *sdp; + sdp++; + } + *dsp = 0; + pline("In what direction do you want to dig? [%s] ", dirsyms); + if(!getdir(0)) /* no txt */ + return(res); + if(u.uswallow && attack(u.ustuck)) /* return(1) */; + else + if(u.dz < 0) + pline("You cannot reach the ceiling."); + else + if(u.dz == 0) { + if(Confusion) + confdir(); + rx = u.ux + u.dx; + ry = u.uy + u.dy; + if((mtmp = m_at(rx, ry)) && attack(mtmp)) + return(1); + if(!isok(rx, ry)) { + pline("Clash!"); + return(1); + } + lev = &levl[rx][ry]; + if(lev->typ == DOOR) + pline("Your %s against the door.", + aobjnam(obj, "clang")); + else if(!IS_ROCK(lev->typ) + && !sobj_at(ENORMOUS_ROCK, rx, ry)) { + /* ACCESSIBLE or POOL */ + pline("You swing your %s through thin air.", + aobjnam(obj, (char *) 0)); + } else { + if(dig_pos.x != rx || dig_pos.y != ry + || dig_level != dlevel || dig_down) { + dig_down = FALSE; + dig_pos.x = rx; + dig_pos.y = ry; + dig_level = dlevel; + dig_effort = 0; + pline("You start digging."); + } else + pline("You continue digging."); + occupation = dig; + occtxt = "digging"; + } + } else if(Levitation) { + pline("You cannot reach the floor."); + } else { + if(dig_pos.x != u.ux || dig_pos.y != u.uy + || dig_level != dlevel || !dig_down) { + dig_down = TRUE; + dig_pos.x = u.ux; + dig_pos.y = u.uy; + dig_level = dlevel; + dig_effort = 0; + pline("You start digging in the floor."); + if(inshop()) + shopdig(0); + } else + pline("You continue digging in the floor."); + occupation = dig; + occtxt = "digging"; + } + return(1); +} diff --git a/games/hack/hack.bones.c b/games/hack/hack.bones.c new file mode 100644 index 0000000..d4a05b8 --- /dev/null +++ b/games/hack/hack.bones.c @@ -0,0 +1,95 @@ +/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ +/* hack.bones.c - version 1.0.3 */ + +#include "hack.h" +extern char plname[PL_NSIZ]; +extern long somegold(); +extern struct monst *makemon(); +extern struct permonst pm_ghost; + +char bones[] = "bones_xx"; + +/* save bones and possessions of a deceased adventurer */ +savebones(){ +register fd; +register struct obj *otmp; +register struct trap *ttmp; +register struct monst *mtmp; + if(dlevel <= 0 || dlevel > MAXLEVEL) return; + if(!rn2(1 + dlevel/2)) return; /* not so many ghosts on low levels */ + bones[6] = '0' + (dlevel/10); + bones[7] = '0' + (dlevel%10); + if((fd = open(bones,0)) >= 0){ + (void) close(fd); + return; + } + /* drop everything; the corpse's possessions are usually cursed */ + otmp = invent; + while(otmp){ + otmp->ox = u.ux; + otmp->oy = u.uy; + otmp->age = 0; /* very long ago */ + otmp->owornmask = 0; + if(rn2(5)) otmp->cursed = 1; + if(!otmp->nobj){ + otmp->nobj = fobj; + fobj = invent; + invent = 0; /* superfluous */ + break; + } + otmp = otmp->nobj; + } + if(!(mtmp = makemon(PM_GHOST, u.ux, u.uy))) return; + mtmp->mx = u.ux; + mtmp->my = u.uy; + mtmp->msleep = 1; + (void) strcpy((char *) mtmp->mextra, plname); + mkgold(somegold() + d(dlevel,30), u.ux, u.uy); + for(mtmp = fmon; mtmp; mtmp = mtmp->nmon){ + mtmp->m_id = 0; + if(mtmp->mtame) { + mtmp->mtame = 0; + mtmp->mpeaceful = 0; + } + mtmp->mlstmv = 0; + if(mtmp->mdispl) unpmon(mtmp); + } + for(ttmp = ftrap; ttmp; ttmp = ttmp->ntrap) + ttmp->tseen = 0; + for(otmp = fobj; otmp; otmp = otmp->nobj) { + otmp->o_id = 0; + /* otmp->o_cnt_id = 0; - superfluous */ + otmp->onamelth = 0; + otmp->known = 0; + otmp->invlet = 0; + if(otmp->olet == AMULET_SYM && !otmp->spe) { + otmp->spe = -1; /* no longer the actual amulet */ + otmp->cursed = 1; /* flag as gotten from a ghost */ + } + } + if((fd = creat(bones, FMASK)) < 0) return; + savelev(fd,dlevel); + (void) close(fd); +} + +getbones(){ +register fd,x,y,ok; + if(rn2(3)) return(0); /* only once in three times do we find bones */ + bones[6] = '0' + dlevel/10; + bones[7] = '0' + dlevel%10; + if((fd = open(bones, 0)) < 0) return(0); + if((ok = uptodate(fd)) != 0){ + getlev(fd, 0, dlevel); + for(x = 0; x < COLNO; x++) for(y = 0; y < ROWNO; y++) + levl[x][y].seen = levl[x][y].new = 0; + } + (void) close(fd); +#ifdef WIZARD + if(!wizard) /* duvel!frans: don't remove bones while debugging */ +#endif WiZARD + if(unlink(bones) < 0){ + pline("Cannot unlink %s .", bones); + return(0); + } + return(ok); +} diff --git a/games/hack/hack.c b/games/hack/hack.c new file mode 100644 index 0000000..5c82881 --- /dev/null +++ b/games/hack/hack.c @@ -0,0 +1,798 @@ +/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ +/* hack.c - version 1.0.3 */ + +#include "hack.h" +#include + +extern char news0(); +extern char *nomovemsg; +extern char *exclam(); +extern struct obj *addinv(); +extern boolean hmon(); + +/* called on movement: + 1. when throwing ball+chain far away + 2. when teleporting + 3. when walking out of a lit room + */ +unsee() { + register x,y; + register struct rm *lev; + +/* + if(u.udispl){ + u.udispl = 0; + newsym(u.udisx, u.udisy); + } +*/ +#ifndef QUEST + if(seehx){ + seehx = 0; + } else +#endif QUEST + for(x = u.ux-1; x < u.ux+2; x++) + for(y = u.uy-1; y < u.uy+2; y++) { + if(!isok(x, y)) continue; + lev = &levl[x][y]; + if(!lev->lit && lev->scrsym == '.') { + lev->scrsym =' '; + lev->new = 1; + on_scr(x,y); + } + } +} + +/* called: + in hack.eat.c: seeoff(0) - blind after eating rotten food + in hack.mon.c: seeoff(0) - blinded by a yellow light + in hack.mon.c: seeoff(1) - swallowed + in hack.do.c: seeoff(0) - blind after drinking potion + in hack.do.c: seeoff(1) - go up or down the stairs + in hack.trap.c:seeoff(1) - fall through trapdoor + */ +seeoff(mode) /* 1 to redo @, 0 to leave them */ +{ /* 1 means misc movement, 0 means blindness */ + register x,y; + register struct rm *lev; + + if(u.udispl && mode){ + u.udispl = 0; + levl[u.udisx][u.udisy].scrsym = news0(u.udisx,u.udisy); + } +#ifndef QUEST + if(seehx) { + seehx = 0; + } else +#endif QUEST + if(!mode) { + for(x = u.ux-1; x < u.ux+2; x++) + for(y = u.uy-1; y < u.uy+2; y++) { + if(!isok(x, y)) continue; + lev = &levl[x][y]; + if(!lev->lit && lev->scrsym == '.') + lev->seen = 0; + } + } +} + +domove() +{ + xchar oldx,oldy; + register struct monst *mtmp; + register struct rm *tmpr,*ust; + struct trap *trap; + register struct obj *otmp; + + u_wipe_engr(rnd(5)); + + if(inv_weight() > 0){ + pline("You collapse under your load."); + nomul(0); + return; + } + if(u.uswallow) { + u.dx = u.dy = 0; + u.ux = u.ustuck->mx; + u.uy = u.ustuck->my; + } else { + if(Confusion) { + do { + confdir(); + } while(!isok(u.ux+u.dx, u.uy+u.dy) || + IS_ROCK(levl[u.ux+u.dx][u.uy+u.dy].typ)); + } + if(!isok(u.ux+u.dx, u.uy+u.dy)){ + nomul(0); + return; + } + } + + ust = &levl[u.ux][u.uy]; + oldx = u.ux; + oldy = u.uy; + if(!u.uswallow && (trap = t_at(u.ux+u.dx, u.uy+u.dy)) && trap->tseen) + nomul(0); + if(u.ustuck && !u.uswallow && (u.ux+u.dx != u.ustuck->mx || + u.uy+u.dy != u.ustuck->my)) { + if(dist(u.ustuck->mx, u.ustuck->my) > 2){ + /* perhaps it fled (or was teleported or ... ) */ + u.ustuck = 0; + } else { + if(Blind) pline("You cannot escape from it!"); + else pline("You cannot escape from %s!", + monnam(u.ustuck)); + nomul(0); + return; + } + } + if(u.uswallow || (mtmp = m_at(u.ux+u.dx,u.uy+u.dy))) { + /* attack monster */ + + nomul(0); + gethungry(); + if(multi < 0) return; /* we just fainted */ + + /* try to attack; note that it might evade */ + if(attack(u.uswallow ? u.ustuck : mtmp)) + return; + } + /* not attacking an animal, so we try to move */ + if(u.utrap) { + if(u.utraptype == TT_PIT) { + pline("You are still in a pit."); + u.utrap--; + } else { + pline("You are caught in a beartrap."); + if((u.dx && u.dy) || !rn2(5)) u.utrap--; + } + return; + } + tmpr = &levl[u.ux+u.dx][u.uy+u.dy]; + if(IS_ROCK(tmpr->typ) || + (u.dx && u.dy && (tmpr->typ == DOOR || ust->typ == DOOR))){ + flags.move = 0; + nomul(0); + return; + } + while(otmp = sobj_at(ENORMOUS_ROCK, u.ux+u.dx, u.uy+u.dy)) { + register xchar rx = u.ux+2*u.dx, ry = u.uy+2*u.dy; + register struct trap *ttmp; + nomul(0); + if(isok(rx,ry) && !IS_ROCK(levl[rx][ry].typ) && + (levl[rx][ry].typ != DOOR || !(u.dx && u.dy)) && + !sobj_at(ENORMOUS_ROCK, rx, ry)) { + if(m_at(rx,ry)) { + pline("You hear a monster behind the rock."); + pline("Perhaps that's why you cannot move it."); + goto cannot_push; + } + if(ttmp = t_at(rx,ry)) + switch(ttmp->ttyp) { + case PIT: + pline("You push the rock into a pit!"); + deltrap(ttmp); + delobj(otmp); + pline("It completely fills the pit!"); + continue; + case TELEP_TRAP: + pline("You push the rock and suddenly it disappears!"); + delobj(otmp); + continue; + } + if(levl[rx][ry].typ == POOL) { + levl[rx][ry].typ = ROOM; + mnewsym(rx,ry); + prl(rx,ry); + pline("You push the rock into the water."); + pline("Now you can cross the water!"); + delobj(otmp); + continue; + } + otmp->ox = rx; + otmp->oy = ry; + /* pobj(otmp); */ + if(cansee(rx,ry)) atl(rx,ry,otmp->olet); + if(Invisible) newsym(u.ux+u.dx, u.uy+u.dy); + + { static long lastmovetime; + /* note: this var contains garbage initially and + after a restore */ + if(moves > lastmovetime+2 || moves < lastmovetime) + pline("With great effort you move the enormous rock."); + lastmovetime = moves; + } + } else { + pline("You try to move the enormous rock, but in vain."); + cannot_push: + if((!invent || inv_weight()+90 <= 0) && + (!u.dx || !u.dy || (IS_ROCK(levl[u.ux][u.uy+u.dy].typ) + && IS_ROCK(levl[u.ux+u.dx][u.uy].typ)))){ + pline("However, you can squeeze yourself into a small opening."); + break; + } else + return; + } + } + if(u.dx && u.dy && IS_ROCK(levl[u.ux][u.uy+u.dy].typ) && + IS_ROCK(levl[u.ux+u.dx][u.uy].typ) && + invent && inv_weight()+40 > 0) { + pline("You are carrying too much to get through."); + nomul(0); + return; + } + if(Punished && + DIST(u.ux+u.dx, u.uy+u.dy, uchain->ox, uchain->oy) > 2){ + if(carried(uball)) { + movobj(uchain, u.ux, u.uy); + goto nodrag; + } + + if(DIST(u.ux+u.dx, u.uy+u.dy, uball->ox, uball->oy) < 3){ + /* leave ball, move chain under/over ball */ + movobj(uchain, uball->ox, uball->oy); + goto nodrag; + } + + if(inv_weight() + (int) uball->owt/2 > 0) { + pline("You cannot %sdrag the heavy iron ball.", + invent ? "carry all that and also " : ""); + nomul(0); + return; + } + + movobj(uball, uchain->ox, uchain->oy); + unpobj(uball); /* BAH %% */ + uchain->ox = u.ux; + uchain->oy = u.uy; + nomul(-2); + nomovemsg = ""; + nodrag: ; + } + u.ux += u.dx; + u.uy += u.dy; + if(flags.run) { + if(tmpr->typ == DOOR || + (xupstair == u.ux && yupstair == u.uy) || + (xdnstair == u.ux && ydnstair == u.uy)) + nomul(0); + } + + if(tmpr->typ == POOL && !Levitation) + drown(); /* not necessarily fatal */ + +/* + if(u.udispl) { + u.udispl = 0; + newsym(oldx,oldy); + } +*/ + if(!Blind) { +#ifdef QUEST + setsee(); +#else + if(ust->lit) { + if(tmpr->lit) { + if(tmpr->typ == DOOR) + prl1(u.ux+u.dx,u.uy+u.dy); + else if(ust->typ == DOOR) + nose1(oldx-u.dx,oldy-u.dy); + } else { + unsee(); + prl1(u.ux+u.dx,u.uy+u.dy); + } + } else { + if(tmpr->lit) setsee(); + else { + prl1(u.ux+u.dx,u.uy+u.dy); + if(tmpr->typ == DOOR) { + if(u.dy) { + prl(u.ux-1,u.uy); + prl(u.ux+1,u.uy); + } else { + prl(u.ux,u.uy-1); + prl(u.ux,u.uy+1); + } + } + } + nose1(oldx-u.dx,oldy-u.dy); + } +#endif QUEST + } else { + pru(); + } + if(!flags.nopick) pickup(1); + if(trap) dotrap(trap); /* fall into pit, arrow trap, etc. */ + (void) inshop(); + if(!Blind) read_engr_at(u.ux,u.uy); +} + +movobj(obj, ox, oy) +register struct obj *obj; +register int ox, oy; +{ + /* Some dirty programming to get display right */ + freeobj(obj); + unpobj(obj); + obj->nobj = fobj; + fobj = obj; + obj->ox = ox; + obj->oy = oy; +} + +dopickup(){ + if(!g_at(u.ux,u.uy) && !o_at(u.ux,u.uy)) { + pline("There is nothing here to pick up."); + return(0); + } + if(Levitation) { + pline("You cannot reach the floor."); + return(1); + } + pickup(0); + return(1); +} + +pickup(all) +{ + register struct gold *gold; + register struct obj *obj, *obj2; + register int wt; + + if(Levitation) return; + while(gold = g_at(u.ux,u.uy)) { + pline("%ld gold piece%s.", gold->amount, plur(gold->amount)); + u.ugold += gold->amount; + flags.botl = 1; + freegold(gold); + if(flags.run) nomul(0); + if(Invisible) newsym(u.ux,u.uy); + } + + /* check for more than one object */ + if(!all) { + register int ct = 0; + + for(obj = fobj; obj; obj = obj->nobj) + if(obj->ox == u.ux && obj->oy == u.uy) + if(!Punished || obj != uchain) + ct++; + if(ct < 2) + all++; + else + pline("There are several objects here."); + } + + for(obj = fobj; obj; obj = obj2) { + obj2 = obj->nobj; /* perhaps obj will be picked up */ + if(obj->ox == u.ux && obj->oy == u.uy) { + if(flags.run) nomul(0); + + /* do not pick up uchain */ + if(Punished && obj == uchain) + continue; + + if(!all) { + char c; + + pline("Pick up %s ? [ynaq]", doname(obj)); + while(!index("ynaq ", (c = readchar()))) + bell(); + if(c == 'q') return; + if(c == 'n') continue; + if(c == 'a') all = 1; + } + + if(obj->otyp == DEAD_COCKATRICE && !uarmg){ + pline("Touching the dead cockatrice is a fatal mistake."); + pline("You turn to stone."); + killer = "cockatrice cadaver"; + done("died"); + } + + if(obj->otyp == SCR_SCARE_MONSTER){ + if(!obj->spe) obj->spe = 1; + else { + /* Note: perhaps the 1st pickup failed: you cannot + carry anymore, and so we never dropped it - + let's assume that treading on it twice also + destroys the scroll */ + pline("The scroll turns to dust as you pick it up."); + delobj(obj); + continue; + } + } + + wt = inv_weight() + obj->owt; + if(wt > 0) { + if(obj->quan > 1) { + /* see how many we can lift */ + extern struct obj *splitobj(); + int savequan = obj->quan; + int iw = inv_weight(); + int qq; + for(qq = 1; qq < savequan; qq++){ + obj->quan = qq; + if(iw + weight(obj) > 0) + break; + } + obj->quan = savequan; + qq--; + /* we can carry qq of them */ + if(!qq) goto too_heavy; + pline("You can only carry %s of the %s lying here.", + (qq == 1) ? "one" : "some", + doname(obj)); + (void) splitobj(obj, qq); + /* note: obj2 is set already, so we'll never + * encounter the other half; if it should be + * otherwise then write + * obj2 = splitobj(obj,qq); + */ + goto lift_some; + } + too_heavy: + pline("There %s %s here, but %s.", + (obj->quan == 1) ? "is" : "are", + doname(obj), + !invent ? "it is too heavy for you to lift" + : "you cannot carry anymore"); + break; + } + lift_some: + if(inv_cnt() >= 52) { + pline("Your knapsack cannot accomodate anymore items."); + break; + } + if(wt > -5) pline("You have a little trouble lifting"); + freeobj(obj); + if(Invisible) newsym(u.ux,u.uy); + addtobill(obj); /* sets obj->unpaid if necessary */ + { int pickquan = obj->quan; + int mergquan; + if(!Blind) obj->dknown = 1; /* this is done by prinv(), + but addinv() needs it already for merging */ + obj = addinv(obj); /* might merge it with other objects */ + mergquan = obj->quan; + obj->quan = pickquan; /* to fool prinv() */ + prinv(obj); + obj->quan = mergquan; + } + } + } +} + +/* stop running if we see something interesting */ +/* turn around a corner if that is the only way we can proceed */ +/* do not turn left or right twice */ +lookaround(){ +register x,y,i,x0,y0,m0,i0 = 9; +register int corrct = 0, noturn = 0; +register struct monst *mtmp; +#ifdef lint + /* suppress "used before set" message */ + x0 = y0 = 0; +#endif lint + if(Blind || flags.run == 0) return; + if(flags.run == 1 && levl[u.ux][u.uy].typ == ROOM) return; +#ifdef QUEST + if(u.ux0 == u.ux+u.dx && u.uy0 == u.uy+u.dy) goto stop; +#endif QUEST + for(x = u.ux-1; x <= u.ux+1; x++) for(y = u.uy-1; y <= u.uy+1; y++){ + if(x == u.ux && y == u.uy) continue; + if(!levl[x][y].typ) continue; + if((mtmp = m_at(x,y)) && !mtmp->mimic && + (!mtmp->minvis || See_invisible)){ + if(!mtmp->mtame || (x == u.ux+u.dx && y == u.uy+u.dy)) + goto stop; + } else mtmp = 0; /* invisible M cannot influence us */ + if(x == u.ux-u.dx && y == u.uy-u.dy) continue; + switch(levl[x][y].scrsym){ + case '|': + case '-': + case '.': + case ' ': + break; + case '+': + if(x != u.ux && y != u.uy) break; + if(flags.run != 1) goto stop; + /* fall into next case */ + case CORR_SYM: + corr: + if(flags.run == 1 || flags.run == 3) { + i = DIST(x,y,u.ux+u.dx,u.uy+u.dy); + if(i > 2) break; + if(corrct == 1 && DIST(x,y,x0,y0) != 1) + noturn = 1; + if(i < i0) { + i0 = i; + x0 = x; + y0 = y; + m0 = mtmp ? 1 : 0; + } + } + corrct++; + break; + case '^': + if(flags.run == 1) goto corr; /* if you must */ + if(x == u.ux+u.dx && y == u.uy+u.dy) goto stop; + break; + default: /* e.g. objects or trap or stairs */ + if(flags.run == 1) goto corr; + if(mtmp) break; /* d */ + stop: + nomul(0); + return; + } + } +#ifdef QUEST + if(corrct > 0 && (flags.run == 4 || flags.run == 5)) goto stop; +#endif QUEST + if(corrct > 1 && flags.run == 2) goto stop; + if((flags.run == 1 || flags.run == 3) && !noturn && !m0 && i0 && + (corrct == 1 || (corrct == 2 && i0 == 1))) { + /* make sure that we do not turn too far */ + if(i0 == 2) { + if(u.dx == y0-u.uy && u.dy == u.ux-x0) + i = 2; /* straight turn right */ + else + i = -2; /* straight turn left */ + } else if(u.dx && u.dy) { + if((u.dx == u.dy && y0 == u.uy) || + (u.dx != u.dy && y0 != u.uy)) + i = -1; /* half turn left */ + else + i = 1; /* half turn right */ + } else { + if((x0-u.ux == y0-u.uy && !u.dy) || + (x0-u.ux != y0-u.uy && u.dy)) + i = 1; /* half turn right */ + else + i = -1; /* half turn left */ + } + i += u.last_str_turn; + if(i <= 2 && i >= -2) { + u.last_str_turn = i; + u.dx = x0-u.ux, u.dy = y0-u.uy; + } + } +} + +/* something like lookaround, but we are not running */ +/* react only to monsters that might hit us */ +monster_nearby() { +register int x,y; +register struct monst *mtmp; + if(!Blind) + for(x = u.ux-1; x <= u.ux+1; x++) for(y = u.uy-1; y <= u.uy+1; y++){ + if(x == u.ux && y == u.uy) continue; + if((mtmp = m_at(x,y)) && !mtmp->mimic && !mtmp->mtame && + !mtmp->mpeaceful && !index("Ea", mtmp->data->mlet) && + !mtmp->mfroz && !mtmp->msleep && /* aplvax!jcn */ + (!mtmp->minvis || See_invisible)) + return(1); + } + return(0); +} + +#ifdef QUEST +cansee(x,y) xchar x,y; { +register int dx,dy,adx,ady,sdx,sdy,dmax,d; + if(Blind) return(0); + if(!isok(x,y)) return(0); + d = dist(x,y); + if(d < 3) return(1); + if(d > u.uhorizon*u.uhorizon) return(0); + if(!levl[x][y].lit) + return(0); + dx = x - u.ux; adx = abs(dx); sdx = sgn(dx); + dy = y - u.uy; ady = abs(dy); sdy = sgn(dy); + if(dx == 0 || dy == 0 || adx == ady){ + dmax = (dx == 0) ? ady : adx; + for(d = 1; d <= dmax; d++) + if(!rroom(sdx*d,sdy*d)) + return(0); + return(1); + } else if(ady > adx){ + for(d = 1; d <= ady; d++){ + if(!rroom(sdx*( (d*adx)/ady ), sdy*d) || + !rroom(sdx*( (d*adx-1)/ady+1 ), sdy*d)) + return(0); + } + return(1); + } else { + for(d = 1; d <= adx; d++){ + if(!rroom(sdx*d, sdy*( (d*ady)/adx )) || + !rroom(sdx*d, sdy*( (d*ady-1)/adx+1 ))) + return(0); + } + return(1); + } +} + +rroom(x,y) register int x,y; { + return(IS_ROOM(levl[u.ux+x][u.uy+y].typ)); +} + +#else + +cansee(x,y) xchar x,y; { + if(Blind || u.uswallow) return(0); + if(dist(x,y) < 3) return(1); + if(levl[x][y].lit && seelx <= x && x <= seehx && seely <= y && + y <= seehy) return(1); + return(0); +} +#endif QUEST + +sgn(a) register int a; { + return((a > 0) ? 1 : (a == 0) ? 0 : -1); +} + +#ifdef QUEST +setsee() +{ + register x,y; + + if(Blind) { + pru(); + return; + } + for(y = u.uy-u.uhorizon; y <= u.uy+u.uhorizon; y++) + for(x = u.ux-u.uhorizon; x <= u.ux+u.uhorizon; x++) { + if(cansee(x,y)) + prl(x,y); + } +} + +#else + +setsee() +{ + register x,y; + + if(Blind) { + pru(); + return; + } + if(!levl[u.ux][u.uy].lit) { + seelx = u.ux-1; + seehx = u.ux+1; + seely = u.uy-1; + seehy = u.uy+1; + } else { + for(seelx = u.ux; levl[seelx-1][u.uy].lit; seelx--); + for(seehx = u.ux; levl[seehx+1][u.uy].lit; seehx++); + for(seely = u.uy; levl[u.ux][seely-1].lit; seely--); + for(seehy = u.uy; levl[u.ux][seehy+1].lit; seehy++); + } + for(y = seely; y <= seehy; y++) + for(x = seelx; x <= seehx; x++) { + prl(x,y); + } + if(!levl[u.ux][u.uy].lit) seehx = 0; /* seems necessary elsewhere */ + else { + if(seely == u.uy) for(x = u.ux-1; x <= u.ux+1; x++) prl(x,seely-1); + if(seehy == u.uy) for(x = u.ux-1; x <= u.ux+1; x++) prl(x,seehy+1); + if(seelx == u.ux) for(y = u.uy-1; y <= u.uy+1; y++) prl(seelx-1,y); + if(seehx == u.ux) for(y = u.uy-1; y <= u.uy+1; y++) prl(seehx+1,y); + } +} +#endif QUEST + +nomul(nval) +register nval; +{ + if(multi < 0) return; + multi = nval; + flags.mv = flags.run = 0; +} + +abon() +{ + if(u.ustr == 3) return(-3); + else if(u.ustr < 6) return(-2); + else if(u.ustr < 8) return(-1); + else if(u.ustr < 17) return(0); + else if(u.ustr < 69) return(1); /* up to 18/50 */ + else if(u.ustr < 118) return(2); + else return(3); +} + +dbon() +{ + if(u.ustr < 6) return(-1); + else if(u.ustr < 16) return(0); + else if(u.ustr < 18) return(1); + else if(u.ustr == 18) return(2); /* up to 18 */ + else if(u.ustr < 94) return(3); /* up to 18/75 */ + else if(u.ustr < 109) return(4); /* up to 18/90 */ + else if(u.ustr < 118) return(5); /* up to 18/99 */ + else return(6); +} + +losestr(num) /* may kill you; cause may be poison or monster like 'A' */ +register num; +{ + u.ustr -= num; + while(u.ustr < 3) { + u.ustr++; + u.uhp -= 6; + u.uhpmax -= 6; + } + flags.botl = 1; +} + +losehp(n,knam) +register n; +register char *knam; +{ + u.uhp -= n; + if(u.uhp > u.uhpmax) + u.uhpmax = u.uhp; /* perhaps n was negative */ + flags.botl = 1; + if(u.uhp < 1) { + killer = knam; /* the thing that killed you */ + done("died"); + } +} + +losehp_m(n,mtmp) +register n; +register struct monst *mtmp; +{ + u.uhp -= n; + flags.botl = 1; + if(u.uhp < 1) + done_in_by(mtmp); +} + +losexp() /* hit by V or W */ +{ + register num; + extern long newuexp(); + + if(u.ulevel > 1) + pline("Goodbye level %u.", u.ulevel--); + else + u.uhp = -1; + num = rnd(10); + u.uhp -= num; + u.uhpmax -= num; + u.uexp = newuexp(); + flags.botl = 1; +} + +inv_weight(){ +register struct obj *otmp = invent; +register int wt = (u.ugold + 500)/1000; +register int carrcap; + if(Levitation) /* pugh@cornell */ + carrcap = MAX_CARR_CAP; + else { + carrcap = 5*(((u.ustr > 18) ? 20 : u.ustr) + u.ulevel); + if(carrcap > MAX_CARR_CAP) carrcap = MAX_CARR_CAP; + if(Wounded_legs & LEFT_SIDE) carrcap -= 10; + if(Wounded_legs & RIGHT_SIDE) carrcap -= 10; + } + while(otmp){ + wt += otmp->owt; + otmp = otmp->nobj; + } + return(wt - carrcap); +} + +inv_cnt(){ +register struct obj *otmp = invent; +register int ct = 0; + while(otmp){ + ct++; + otmp = otmp->nobj; + } + return(ct); +} + +long +newuexp() +{ + return(10*(1L << (u.ulevel-1))); +} diff --git a/games/hack/hack.cmd.c b/games/hack/hack.cmd.c new file mode 100644 index 0000000..3f7639e --- /dev/null +++ b/games/hack/hack.cmd.c @@ -0,0 +1,301 @@ +/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ +/* hack.cmd.c - version 1.0.3 */ + +#include "hack.h" +#include "def.func_tab.h" + +int doredraw(),doredotopl(),dodrop(),dodrink(),doread(),dosearch(),dopickup(), +doversion(),doweararm(),dowearring(),doremarm(),doremring(),dopay(),doapply(), +dosave(),dowield(),ddoinv(),dozap(),ddocall(),dowhatis(),doengrave(),dotele(), +dohelp(),doeat(),doddrop(),do_mname(),doidtrap(),doprwep(),doprarm(), +doprring(),doprgold(),dodiscovered(),dotypeinv(),dolook(),doset(), +doup(), dodown(), done1(), donull(), dothrow(), doextcmd(), dodip(), dopray(); +#ifdef SHELL +int dosh(); +#endif SHELL +#ifdef SUSPEND +int dosuspend(); +#endif SUSPEND + +struct func_tab cmdlist[]={ + '\020', doredotopl, + '\022', doredraw, + '\024', dotele, +#ifdef SUSPEND + '\032', dosuspend, +#endif SUSPEND + 'a', doapply, +/* 'A' : UNUSED */ +/* 'b', 'B' : go sw */ + 'c', ddocall, + 'C', do_mname, + 'd', dodrop, + 'D', doddrop, + 'e', doeat, + 'E', doengrave, +/* 'f', 'F' : multiple go (might become 'fight') */ +/* 'g', 'G' : UNUSED */ +/* 'h', 'H' : go west */ + 'I', dotypeinv, /* Robert Viduya */ + 'i', ddoinv, +/* 'j', 'J', 'k', 'K', 'l', 'L', 'm', 'M', 'n', 'N' : move commands */ +/* 'o', doopen, */ + 'O', doset, + 'p', dopay, + 'P', dowearring, + 'q', dodrink, + 'Q', done1, + 'r', doread, + 'R', doremring, + 's', dosearch, + 'S', dosave, + 't', dothrow, + 'T', doremarm, +/* 'u', 'U' : go ne */ + 'v', doversion, +/* 'V' : UNUSED */ + 'w', dowield, + 'W', doweararm, +/* 'x', 'X' : UNUSED */ +/* 'y', 'Y' : go nw */ + 'z', dozap, +/* 'Z' : UNUSED */ + '<', doup, + '>', dodown, + '/', dowhatis, + '?', dohelp, +#ifdef SHELL + '!', dosh, +#endif SHELL + '.', donull, + ' ', donull, + ',', dopickup, + ':', dolook, + '^', doidtrap, + '\\', dodiscovered, /* Robert Viduya */ + WEAPON_SYM, doprwep, + ARMOR_SYM, doprarm, + RING_SYM, doprring, + '$', doprgold, + '#', doextcmd, + 0,0,0 +}; + +struct ext_func_tab extcmdlist[] = { + "dip", dodip, + "pray", dopray, + (char *) 0, donull +}; + +extern char *parse(), lowc(), unctrl(), quitchars[]; + +rhack(cmd) +register char *cmd; +{ + register struct func_tab *tlist = cmdlist; + boolean firsttime = FALSE; + register res; + + if(!cmd) { + firsttime = TRUE; + flags.nopick = 0; + cmd = parse(); + } + if(!*cmd || *cmd == 0377 || (flags.no_rest_on_space && *cmd == ' ')){ + bell(); + flags.move = 0; + return; /* probably we just had an interrupt */ + } + if(movecmd(*cmd)) { + walk: + if(multi) flags.mv = 1; + domove(); + return; + } + if(movecmd(lowc(*cmd))) { + flags.run = 1; + rush: + if(firsttime){ + if(!multi) multi = COLNO; + u.last_str_turn = 0; + } + flags.mv = 1; +#ifdef QUEST + if(flags.run >= 4) finddir(); + if(firsttime){ + u.ux0 = u.ux + u.dx; + u.uy0 = u.uy + u.dy; + } +#endif QUEST + domove(); + return; + } + if((*cmd == 'f' && movecmd(cmd[1])) || movecmd(unctrl(*cmd))) { + flags.run = 2; + goto rush; + } + if(*cmd == 'F' && movecmd(lowc(cmd[1]))) { + flags.run = 3; + goto rush; + } + if(*cmd == 'm' && movecmd(cmd[1])) { + flags.run = 0; + flags.nopick = 1; + goto walk; + } + if(*cmd == 'M' && movecmd(lowc(cmd[1]))) { + flags.run = 1; + flags.nopick = 1; + goto rush; + } +#ifdef QUEST + if(*cmd == cmd[1] && (*cmd == 'f' || *cmd == 'F')) { + flags.run = 4; + if(*cmd == 'F') flags.run += 2; + if(cmd[2] == '-') flags.run += 1; + goto rush; + } +#endif QUEST + while(tlist->f_char) { + if(*cmd == tlist->f_char){ + res = (*(tlist->f_funct))(); + if(!res) { + flags.move = 0; + multi = 0; + } + return; + } + tlist++; + } + { char expcmd[10]; + register char *cp = expcmd; + while(*cmd && cp-expcmd < sizeof(expcmd)-2) { + if(*cmd >= 040 && *cmd < 0177) + *cp++ = *cmd++; + else { + *cp++ = '^'; + *cp++ = *cmd++ ^ 0100; + } + } + *cp++ = 0; + pline("Unknown command '%s'.", expcmd); + } + multi = flags.move = 0; +} + +doextcmd() /* here after # - now read a full-word command */ +{ + char buf[BUFSZ]; + register struct ext_func_tab *efp = extcmdlist; + + pline("# "); + getlin(buf); + clrlin(); + if(buf[0] == '\033') + return(0); + while(efp->ef_txt) { + if(!strcmp(efp->ef_txt, buf)) + return((*(efp->ef_funct))()); + efp++; + } + pline("%s: unknown command.", buf); + return(0); +} + +char +lowc(sym) +char sym; +{ + return( (sym >= 'A' && sym <= 'Z') ? sym+'a'-'A' : sym ); +} + +char +unctrl(sym) +char sym; +{ + return( (sym >= ('A' & 037) && sym <= ('Z' & 037)) ? sym + 0140 : sym ); +} + +/* 'rogue'-like direction commands */ +char sdir[] = "hykulnjb><"; +schar xdir[10] = { -1,-1, 0, 1, 1, 1, 0,-1, 0, 0 }; +schar ydir[10] = { 0,-1,-1,-1, 0, 1, 1, 1, 0, 0 }; +schar zdir[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 1,-1 }; + +movecmd(sym) /* also sets u.dz, but returns false for <> */ +char sym; +{ + register char *dp; + + u.dz = 0; + if(!(dp = index(sdir, sym))) return(0); + u.dx = xdir[dp-sdir]; + u.dy = ydir[dp-sdir]; + u.dz = zdir[dp-sdir]; + return(!u.dz); +} + +getdir(s) +boolean s; +{ + char dirsym; + + if(s) pline("In what direction?"); + dirsym = readchar(); + if(!movecmd(dirsym) && !u.dz) { + if(!index(quitchars, dirsym)) + pline("What a strange direction!"); + return(0); + } + if(Confusion && !u.dz) + confdir(); + return(1); +} + +confdir() +{ + register x = rn2(8); + u.dx = xdir[x]; + u.dy = ydir[x]; +} + +#ifdef QUEST +finddir(){ +register int i, ui = u.di; + for(i = 0; i <= 8; i++){ + if(flags.run & 1) ui++; else ui += 7; + ui %= 8; + if(i == 8){ + pline("Not near a wall."); + flags.move = multi = 0; + return(0); + } + if(!isroom(u.ux+xdir[ui], u.uy+ydir[ui])) + break; + } + for(i = 0; i <= 8; i++){ + if(flags.run & 1) ui += 7; else ui++; + ui %= 8; + if(i == 8){ + pline("Not near a room."); + flags.move = multi = 0; + return(0); + } + if(isroom(u.ux+xdir[ui], u.uy+ydir[ui])) + break; + } + u.di = ui; + u.dx = xdir[ui]; + u.dy = ydir[ui]; +} + +isroom(x,y) register x,y; { /* what about POOL? */ + return(isok(x,y) && (levl[x][y].typ == ROOM || + (levl[x][y].typ >= LDOOR && flags.run >= 6))); +} +#endif QUEST + +isok(x,y) register x,y; { + /* x corresponds to curx, so x==1 is the first column. Ach. %% */ + return(x >= 1 && x <= COLNO-1 && y >= 0 && y <= ROWNO-1); +} diff --git a/games/hack/hack.do.c b/games/hack/hack.do.c new file mode 100644 index 0000000..e9ff7c8 --- /dev/null +++ b/games/hack/hack.do.c @@ -0,0 +1,490 @@ +/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ +/* hack.do.c - version 1.0.3 */ + +/* Contains code for 'd', 'D' (drop), '>', '<' (up, down) and 't' (throw) */ + +#include "hack.h" + +extern struct obj *splitobj(), *addinv(); +extern boolean hmon(); +extern boolean level_exists[]; +extern struct monst youmonst; +extern char *Doname(); +extern char *nomovemsg; + +dodrop() { + return(drop(getobj("0$#", "drop"))); +} + +/* + KLUDGE -- pointer to static function passed around + -- not allowed in overlay scheme +static +*/ +drop(obj) register struct obj *obj; { + if(!obj) return(0); + if(obj->olet == '$') { /* pseudo object */ + register long amount = OGOLD(obj); + + if(amount == 0) + pline("You didn't drop any gold pieces."); + else { + mkgold(amount, u.ux, u.uy); + pline("You dropped %ld gold piece%s.", + amount, plur(amount)); + if(Invisible) newsym(u.ux, u.uy); + } + free((char *) obj); + return(1); + } + if(obj->owornmask & (W_ARMOR | W_RING)){ + pline("You cannot drop something you are wearing."); + return(0); + } + if(obj == uwep) { + if(uwep->cursed) { + pline("Your weapon is welded to your hand!"); + return(0); + } + setuwep((struct obj *) 0); + } + pline("You dropped %s.", doname(obj)); + dropx(obj); + return(1); +} + +/* Called in several places - should not produce texts */ +dropx(obj) +register struct obj *obj; +{ + freeinv(obj); + dropy(obj); +} + +dropy(obj) +register struct obj *obj; +{ + if(obj->otyp == CRYSKNIFE) + obj->otyp = WORM_TOOTH; + obj->ox = u.ux; + obj->oy = u.uy; + obj->nobj = fobj; + fobj = obj; + if(Invisible) newsym(u.ux,u.uy); + subfrombill(obj); + stackobj(obj); +} + +/* drop several things */ +doddrop() { + return(ggetobj("drop", drop, 0)); +} + +dodown() +{ + if(u.ux != xdnstair || u.uy != ydnstair) { + pline("You can't go down here."); + return(0); + } + if(u.ustuck) { + pline("You are being held, and cannot go down."); + return(1); + } + if(Levitation) { + pline("You're floating high above the stairs."); + return(0); + } + + goto_level(dlevel+1, TRUE); + return(1); +} + +doup() +{ + if(u.ux != xupstair || u.uy != yupstair) { + pline("You can't go up here."); + return(0); + } + if(u.ustuck) { + pline("You are being held, and cannot go up."); + return(1); + } + if(!Levitation && inv_weight() + 5 > 0) { + pline("Your load is too heavy to climb the stairs."); + return(1); + } + + goto_level(dlevel-1, TRUE); + return(1); +} + +goto_level(newlevel, at_stairs) +register int newlevel; +register boolean at_stairs; +{ + register fd; + register boolean up = (newlevel < dlevel); + + if(newlevel <= 0) done("escaped"); /* in fact < 0 is impossible */ + if(newlevel > MAXLEVEL) newlevel = MAXLEVEL; /* strange ... */ + if(newlevel == dlevel) return; /* this can happen */ + + glo(dlevel); + fd = creat(lock, FMASK); + if(fd < 0) { + /* + * This is not quite impossible: e.g., we may have + * exceeded our quota. If that is the case then we + * cannot leave this level, and cannot save either. + * Another possibility is that the directory was not + * writable. + */ + pline("A mysterious force prevents you from going %s.", + up ? "up" : "down"); + return; + } + + if(Punished) unplacebc(); + u.utrap = 0; /* needed in level_tele */ + u.ustuck = 0; /* idem */ + keepdogs(); + seeoff(1); + if(u.uswallow) /* idem */ + u.uswldtim = u.uswallow = 0; + flags.nscrinh = 1; + u.ux = FAR; /* hack */ + (void) inshop(); /* probably was a trapdoor */ + + savelev(fd,dlevel); + (void) close(fd); + + dlevel = newlevel; + if(maxdlevel < dlevel) + maxdlevel = dlevel; + glo(dlevel); + + if(!level_exists[dlevel]) + mklev(); + else { + extern int hackpid; + + if((fd = open(lock,0)) < 0) { + pline("Cannot open %s .", lock); + pline("Probably someone removed it."); + done("tricked"); + } + getlev(fd, hackpid, dlevel); + (void) close(fd); + } + + if(at_stairs) { + if(up) { + u.ux = xdnstair; + u.uy = ydnstair; + if(!u.ux) { /* entering a maze from below? */ + u.ux = xupstair; /* this will confuse the player! */ + u.uy = yupstair; + } + if(Punished && !Levitation){ + pline("With great effort you climb the stairs."); + placebc(1); + } + } else { + u.ux = xupstair; + u.uy = yupstair; + if(inv_weight() + 5 > 0 || Punished){ + pline("You fall down the stairs."); /* %% */ + losehp(rnd(3), "fall"); + if(Punished) { + if(uwep != uball && rn2(3)){ + pline("... and are hit by the iron ball."); + losehp(rnd(20), "iron ball"); + } + placebc(1); + } + selftouch("Falling, you"); + } + } + { register struct monst *mtmp = m_at(u.ux, u.uy); + if(mtmp) + mnexto(mtmp); + } + } else { /* trapdoor or level_tele */ + do { + u.ux = rnd(COLNO-1); + u.uy = rn2(ROWNO); + } while(levl[u.ux][u.uy].typ != ROOM || + m_at(u.ux,u.uy)); + if(Punished){ + if(uwep != uball && !up /* %% */ && rn2(5)){ + pline("The iron ball falls on your head."); + losehp(rnd(25), "iron ball"); + } + placebc(1); + } + selftouch("Falling, you"); + } + (void) inshop(); + initrack(); + + losedogs(); + { register struct monst *mtmp; + if(mtmp = m_at(u.ux, u.uy)) mnexto(mtmp); /* riv05!a3 */ + } + flags.nscrinh = 0; + setsee(); + seeobjs(); /* make old cadavers disappear - riv05!a3 */ + docrt(); + pickup(1); + read_engr_at(u.ux,u.uy); +} + +donull() { + return(1); /* Do nothing, but let other things happen */ +} + +dopray() { + nomovemsg = "You finished your prayer."; + nomul(-3); + return(1); +} + +struct monst *bhit(), *boomhit(); +dothrow() +{ + register struct obj *obj; + register struct monst *mon; + register tmp; + + obj = getobj("#)", "throw"); /* it is also possible to throw food */ + /* (or jewels, or iron balls ... ) */ + if(!obj || !getdir(1)) /* ask "in what direction?" */ + return(0); + if(obj->owornmask & (W_ARMOR | W_RING)){ + pline("You can't throw something you are wearing."); + return(0); + } + + u_wipe_engr(2); + + if(obj == uwep){ + if(obj->cursed){ + pline("Your weapon is welded to your hand."); + return(1); + } + if(obj->quan > 1) + setuwep(splitobj(obj, 1)); + else + setuwep((struct obj *) 0); + } + else if(obj->quan > 1) + (void) splitobj(obj, 1); + freeinv(obj); + if(u.uswallow) { + mon = u.ustuck; + bhitpos.x = mon->mx; + bhitpos.y = mon->my; + } else if(u.dz) { + if(u.dz < 0) { + pline("%s hits the ceiling, then falls back on top of your head.", + Doname(obj)); /* note: obj->quan == 1 */ + if(obj->olet == POTION_SYM) + potionhit(&youmonst, obj); + else { + if(uarmh) pline("Fortunately, you are wearing a helmet!"); + losehp(uarmh ? 1 : rnd((int)(obj->owt)), "falling object"); + dropy(obj); + } + } else { + pline("%s hits the floor.", Doname(obj)); + if(obj->otyp == EXPENSIVE_CAMERA) { + pline("It is shattered in a thousand pieces!"); + obfree(obj, Null(obj)); + } else if(obj->otyp == EGG) { + pline("\"Splash!\""); + obfree(obj, Null(obj)); + } else if(obj->olet == POTION_SYM) { + pline("The flask breaks, and you smell a peculiar odor ..."); + potionbreathe(obj); + obfree(obj, Null(obj)); + } else { + dropy(obj); + } + } + return(1); + } else if(obj->otyp == BOOMERANG) { + mon = boomhit(u.dx, u.dy); + if(mon == &youmonst) { /* the thing was caught */ + (void) addinv(obj); + return(1); + } + } else { + if(obj->otyp == PICK_AXE && shkcatch(obj)) + return(1); + + mon = bhit(u.dx, u.dy, (obj->otyp == ICE_BOX) ? 1 : + (!Punished || obj != uball) ? 8 : !u.ustuck ? 5 : 1, + obj->olet, + (int (*)()) 0, (int (*)()) 0, obj); + } + if(mon) { + /* awake monster if sleeping */ + wakeup(mon); + + if(obj->olet == WEAPON_SYM) { + tmp = -1+u.ulevel+mon->data->ac+abon(); + if(obj->otyp < ROCK) { + if(!uwep || + uwep->otyp != obj->otyp+(BOW-ARROW)) + tmp -= 4; + else { + tmp += uwep->spe; + } + } else + if(obj->otyp == BOOMERANG) tmp += 4; + tmp += obj->spe; + if(u.uswallow || tmp >= rnd(20)) { + if(hmon(mon,obj,1) == TRUE){ + /* mon still alive */ +#ifndef NOWORM + cutworm(mon,bhitpos.x,bhitpos.y,obj->otyp); +#endif NOWORM + } else mon = 0; + /* weapons thrown disappear sometimes */ + if(obj->otyp < BOOMERANG && rn2(3)) { + /* check bill; free */ + obfree(obj, (struct obj *) 0); + return(1); + } + } else miss(objects[obj->otyp].oc_name, mon); + } else if(obj->otyp == HEAVY_IRON_BALL) { + tmp = -1+u.ulevel+mon->data->ac+abon(); + if(!Punished || obj != uball) tmp += 2; + if(u.utrap) tmp -= 2; + if(u.uswallow || tmp >= rnd(20)) { + if(hmon(mon,obj,1) == FALSE) + mon = 0; /* he died */ + } else miss("iron ball", mon); + } else if(obj->olet == POTION_SYM && u.ulevel > rn2(15)) { + potionhit(mon, obj); + return(1); + } else { + if(cansee(bhitpos.x,bhitpos.y)) + pline("You miss %s.",monnam(mon)); + else pline("You miss it."); + if(obj->olet == FOOD_SYM && mon->data->mlet == 'd') + if(tamedog(mon,obj)) return(1); + if(obj->olet == GEM_SYM && mon->data->mlet == 'u' && + !mon->mtame){ + if(obj->dknown && objects[obj->otyp].oc_name_known){ + if(objects[obj->otyp].g_val > 0){ + u.uluck += 5; + goto valuable; + } else { + pline("%s is not interested in your junk.", + Monnam(mon)); + } + } else { /* value unknown to @ */ + u.uluck++; + valuable: + if(u.uluck > LUCKMAX) /* dan@ut-ngp */ + u.uluck = LUCKMAX; + pline("%s graciously accepts your gift.", + Monnam(mon)); + mpickobj(mon, obj); + rloc(mon); + return(1); + } + } + } + } + /* the code following might become part of dropy() */ + if(obj->otyp == CRYSKNIFE) + obj->otyp = WORM_TOOTH; + obj->ox = bhitpos.x; + obj->oy = bhitpos.y; + obj->nobj = fobj; + fobj = obj; + /* prevent him from throwing articles to the exit and escaping */ + /* subfrombill(obj); */ + stackobj(obj); + if(Punished && obj == uball && + (bhitpos.x != u.ux || bhitpos.y != u.uy)){ + freeobj(uchain); + unpobj(uchain); + if(u.utrap){ + if(u.utraptype == TT_PIT) + pline("The ball pulls you out of the pit!"); + else { + register long side = + rn2(3) ? LEFT_SIDE : RIGHT_SIDE; + pline("The ball pulls you out of the bear trap."); + pline("Your %s leg is severely damaged.", + (side == LEFT_SIDE) ? "left" : "right"); + set_wounded_legs(side, 500+rn2(1000)); + losehp(2, "thrown ball"); + } + u.utrap = 0; + } + unsee(); + uchain->nobj = fobj; + fobj = uchain; + u.ux = uchain->ox = bhitpos.x - u.dx; + u.uy = uchain->oy = bhitpos.y - u.dy; + setsee(); + (void) inshop(); + } + if(cansee(bhitpos.x, bhitpos.y)) prl(bhitpos.x,bhitpos.y); + return(1); +} + +/* split obj so that it gets size num */ +/* remainder is put in the object structure delivered by this call */ +struct obj * +splitobj(obj, num) register struct obj *obj; register int num; { +register struct obj *otmp; + otmp = newobj(0); + *otmp = *obj; /* copies whole structure */ + otmp->o_id = flags.ident++; + otmp->onamelth = 0; + obj->quan = num; + obj->owt = weight(obj); + otmp->quan -= num; + otmp->owt = weight(otmp); /* -= obj->owt ? */ + obj->nobj = otmp; + if(obj->unpaid) splitbill(obj,otmp); + return(otmp); +} + +more_experienced(exp,rexp) +register int exp, rexp; +{ + extern char pl_character[]; + + u.uexp += exp; + u.urexp += 4*exp + rexp; + if(exp) flags.botl = 1; + if(u.urexp >= ((pl_character[0] == 'W') ? 1000 : 2000)) + flags.beginner = 0; +} + +set_wounded_legs(side, timex) +register long side; +register int timex; +{ + if(!Wounded_legs || (Wounded_legs & TIMEOUT)) + Wounded_legs |= side + timex; + else + Wounded_legs |= side; +} + +heal_legs() +{ + if(Wounded_legs) { + if((Wounded_legs & BOTH_SIDES) == BOTH_SIDES) + pline("Your legs feel somewhat better."); + else + pline("Your leg feels somewhat better."); + Wounded_legs = 0; + } +} diff --git a/games/hack/hack.do_name.c b/games/hack/hack.do_name.c new file mode 100644 index 0000000..9d41358 --- /dev/null +++ b/games/hack/hack.do_name.c @@ -0,0 +1,289 @@ +/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ +/* hack.do_name.c - version 1.0.3 */ + +#include "hack.h" +#include +extern char plname[]; + +coord +getpos(force,goal) int force; char *goal; { +register cx,cy,i,c; +extern char sdir[]; /* defined in hack.c */ +extern schar xdir[], ydir[]; /* idem */ +extern char *visctrl(); /* see below */ +coord cc; + pline("(For instructions type a ?)"); + cx = u.ux; + cy = u.uy; + curs(cx,cy+2); + while((c = readchar()) != '.'){ + for(i=0; i<8; i++) if(sdir[i] == c){ + if(1 <= cx + xdir[i] && cx + xdir[i] <= COLNO) + cx += xdir[i]; + if(0 <= cy + ydir[i] && cy + ydir[i] <= ROWNO-1) + cy += ydir[i]; + goto nxtc; + } + if(c == '?'){ + pline("Use [hjkl] to move the cursor to %s.", goal); + pline("Type a . when you are at the right place."); + } else { + pline("Unknown direction: '%s' (%s).", + visctrl(c), + force ? "use hjkl or ." : "aborted"); + if(force) goto nxtc; + cc.x = -1; + cc.y = 0; + return(cc); + } + nxtc: ; + curs(cx,cy+2); + } + cc.x = cx; + cc.y = cy; + return(cc); +} + +do_mname(){ +char buf[BUFSZ]; +coord cc; +register int cx,cy,lth,i; +register struct monst *mtmp, *mtmp2; +extern char *lmonnam(); + cc = getpos(0, "the monster you want to name"); + cx = cc.x; + cy = cc.y; + if(cx < 0) return(0); + mtmp = m_at(cx,cy); + if(!mtmp){ + if(cx == u.ux && cy == u.uy) + pline("This ugly monster is called %s and cannot be renamed.", + plname); + else + pline("There is no monster there."); + return(1); + } + if(mtmp->mimic){ + pline("I see no monster there."); + return(1); + } + if(!cansee(cx,cy)) { + pline("I cannot see a monster there."); + return(1); + } + pline("What do you want to call %s? ", lmonnam(mtmp)); + getlin(buf); + clrlin(); + if(!*buf || *buf == '\033') + return(1); + lth = strlen(buf)+1; + if(lth > 63){ + buf[62] = 0; + lth = 63; + } + mtmp2 = newmonst(mtmp->mxlth + lth); + *mtmp2 = *mtmp; + for(i=0; imxlth; i++) + ((char *) mtmp2->mextra)[i] = ((char *) mtmp->mextra)[i]; + mtmp2->mnamelth = lth; + (void) strcpy(NAME(mtmp2), buf); + replmon(mtmp,mtmp2); + return(1); +} + +/* + * This routine changes the address of obj . Be careful not to call it + * when there might be pointers around in unknown places. For now: only + * when obj is in the inventory. + */ +do_oname(obj) register struct obj *obj; { +register struct obj *otmp, *otmp2; +register lth; +char buf[BUFSZ]; + pline("What do you want to name %s? ", doname(obj)); + getlin(buf); + clrlin(); + if(!*buf || *buf == '\033') + return; + lth = strlen(buf)+1; + if(lth > 63){ + buf[62] = 0; + lth = 63; + } + otmp2 = newobj(lth); + *otmp2 = *obj; + otmp2->onamelth = lth; + (void) strcpy(ONAME(otmp2), buf); + + setworn((struct obj *) 0, obj->owornmask); + setworn(otmp2, otmp2->owornmask); + + /* do freeinv(obj); etc. by hand in order to preserve + the position of this object in the inventory */ + if(obj == invent) invent = otmp2; + else for(otmp = invent; ; otmp = otmp->nobj){ + if(!otmp) + panic("Do_oname: cannot find obj."); + if(otmp->nobj == obj){ + otmp->nobj = otmp2; + break; + } + } + /* obfree(obj, otmp2); /* now unnecessary: no pointers on bill */ + free((char *) obj); /* let us hope nobody else saved a pointer */ +} + +ddocall() +{ + register struct obj *obj; + + pline("Do you want to name an individual object? [ny] "); + switch(readchar()) { + case '\033': + break; + case 'y': + obj = getobj("#", "name"); + if(obj) do_oname(obj); + break; + default: + obj = getobj("?!=/", "call"); + if(obj) docall(obj); + } + return(0); +} + +docall(obj) +register struct obj *obj; +{ + char buf[BUFSZ]; + struct obj otemp; + register char **str1; + extern char *xname(); + register char *str; + + otemp = *obj; + otemp.quan = 1; + otemp.onamelth = 0; + str = xname(&otemp); + pline("Call %s %s: ", index(vowels,*str) ? "an" : "a", str); + getlin(buf); + clrlin(); + if(!*buf || *buf == '\033') + return; + str = newstring(strlen(buf)+1); + (void) strcpy(str,buf); + str1 = &(objects[obj->otyp].oc_uname); + if(*str1) free(*str1); + *str1 = str; +} + +char *ghostnames[] = { /* these names should have length < PL_NSIZ */ + "adri", "andries", "andreas", "bert", "david", "dirk", "emile", + "frans", "fred", "greg", "hether", "jay", "john", "jon", "kay", + "kenny", "maud", "michiel", "mike", "peter", "robert", "ron", + "tom", "wilmar" +}; + +char * +xmonnam(mtmp, vb) register struct monst *mtmp; int vb; { +static char buf[BUFSZ]; /* %% */ +extern char *shkname(); + if(mtmp->mnamelth && !vb) { + (void) strcpy(buf, NAME(mtmp)); + return(buf); + } + switch(mtmp->data->mlet) { + case ' ': + { register char *gn = (char *) mtmp->mextra; + if(!*gn) { /* might also look in scorefile */ + gn = ghostnames[rn2(SIZE(ghostnames))]; + if(!rn2(2)) (void) + strcpy((char *) mtmp->mextra, !rn2(5) ? plname : gn); + } + (void) sprintf(buf, "%s's ghost", gn); + } + break; + case '@': + if(mtmp->isshk) { + (void) strcpy(buf, shkname(mtmp)); + break; + } + /* fall into next case */ + default: + (void) sprintf(buf, "the %s%s", + mtmp->minvis ? "invisible " : "", + mtmp->data->mname); + } + if(vb && mtmp->mnamelth) { + (void) strcat(buf, " called "); + (void) strcat(buf, NAME(mtmp)); + } + return(buf); +} + +char * +lmonnam(mtmp) register struct monst *mtmp; { + return(xmonnam(mtmp, 1)); +} + +char * +monnam(mtmp) register struct monst *mtmp; { + return(xmonnam(mtmp, 0)); +} + +char * +Monnam(mtmp) register struct monst *mtmp; { +register char *bp = monnam(mtmp); + if('a' <= *bp && *bp <= 'z') *bp += ('A' - 'a'); + return(bp); +} + +char * +amonnam(mtmp,adj) +register struct monst *mtmp; +register char *adj; +{ + register char *bp = monnam(mtmp); + static char buf[BUFSZ]; /* %% */ + + if(!strncmp(bp, "the ", STRLEN("the "))) bp += STRLEN("the "); + (void) sprintf(buf, "the %s %s", adj, bp); + return(buf); +} + +char * +Amonnam(mtmp, adj) +register struct monst *mtmp; +register char *adj; +{ + register char *bp = amonnam(mtmp,adj); + + *bp = 'T'; + return(bp); +} + +char * +Xmonnam(mtmp) register struct monst *mtmp; { +register char *bp = Monnam(mtmp); + if(!strncmp(bp, "The ", STRLEN("The "))) { + bp += STRLEN("The ")-2; + *bp = 'A'; + } + return(bp); +} + +char * +visctrl(c) +char c; +{ +static char ccc[3]; + if(c < 040) { + ccc[0] = '^'; + ccc[1] = c + 0100; + ccc[2] = 0; + } else { + ccc[0] = c; + ccc[1] = 0; + } + return(ccc); +} diff --git a/games/hack/hack.do_wear.c b/games/hack/hack.do_wear.c new file mode 100644 index 0000000..423955d --- /dev/null +++ b/games/hack/hack.do_wear.c @@ -0,0 +1,336 @@ +/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ +/* hack.do_wear.c - version 1.0.3 */ + +#include "hack.h" +#include +extern char *nomovemsg; +extern char quitchars[]; +extern char *Doname(); + +off_msg(otmp) register struct obj *otmp; { + pline("You were wearing %s.", doname(otmp)); +} + +doremarm() { + register struct obj *otmp; + if(!uarm && !uarmh && !uarms && !uarmg) { + pline("Not wearing any armor."); + return(0); + } + otmp = (!uarmh && !uarms && !uarmg) ? uarm : + (!uarms && !uarm && !uarmg) ? uarmh : + (!uarmh && !uarm && !uarmg) ? uarms : + (!uarmh && !uarm && !uarms) ? uarmg : + getobj("[", "take off"); + if(!otmp) return(0); + if(!(otmp->owornmask & (W_ARMOR - W_ARM2))) { + pline("You can't take that off."); + return(0); + } + if( otmp == uarmg && uwep && uwep->cursed ) { /* myers@uwmacc */ + pline("You seem not able to take off the gloves while holding your weapon."); + return(0); + } + (void) armoroff(otmp); + return(1); +} + +doremring() { + if(!uleft && !uright){ + pline("Not wearing any ring."); + return(0); + } + if(!uleft) + return(dorr(uright)); + if(!uright) + return(dorr(uleft)); + if(uleft && uright) while(1) { + char answer; + + pline("What ring, Right or Left? [ rl?]"); + if(index(quitchars, (answer = readchar()))) + return(0); + switch(answer) { + case 'l': + case 'L': + return(dorr(uleft)); + case 'r': + case 'R': + return(dorr(uright)); + case '?': + (void) doprring(); + /* might look at morc here %% */ + } + } + /* NOTREACHED */ +#ifdef lint + return(0); +#endif lint +} + +dorr(otmp) register struct obj *otmp; { + if(cursed(otmp)) return(0); + ringoff(otmp); + off_msg(otmp); + return(1); +} + +cursed(otmp) register struct obj *otmp; { + if(otmp->cursed){ + pline("You can't. It appears to be cursed."); + return(1); + } + return(0); +} + +armoroff(otmp) register struct obj *otmp; { +register int delay = -objects[otmp->otyp].oc_delay; + if(cursed(otmp)) return(0); + setworn((struct obj *) 0, otmp->owornmask & W_ARMOR); + if(delay) { + nomul(delay); + switch(otmp->otyp) { + case HELMET: + nomovemsg = "You finished taking off your helmet."; + break; + case PAIR_OF_GLOVES: + nomovemsg = "You finished taking off your gloves"; + break; + default: + nomovemsg = "You finished taking off your suit."; + } + } else { + off_msg(otmp); + } + return(1); +} + +doweararm() { + register struct obj *otmp; + register int delay; + register int err = 0; + long mask = 0; + + otmp = getobj("[", "wear"); + if(!otmp) return(0); + if(otmp->owornmask & W_ARMOR) { + pline("You are already wearing that!"); + return(0); + } + if(otmp->otyp == HELMET){ + if(uarmh) { + pline("You are already wearing a helmet."); + err++; + } else + mask = W_ARMH; + } else if(otmp->otyp == SHIELD){ + if(uarms) pline("You are already wearing a shield."), err++; + if(uwep && uwep->otyp == TWO_HANDED_SWORD) + pline("You cannot wear a shield and wield a two-handed sword."), err++; + if(!err) mask = W_ARMS; + } else if(otmp->otyp == PAIR_OF_GLOVES) { + if(uarmg) { + pline("You are already wearing gloves."); + err++; + } else + if(uwep && uwep->cursed) { + pline("You cannot wear gloves over your weapon."); + err++; + } else + mask = W_ARMG; + } else { + if(uarm) { + if(otmp->otyp != ELVEN_CLOAK || uarm2) { + pline("You are already wearing some armor."); + err++; + } + } + if(!err) mask = W_ARM; + } + if(otmp == uwep && uwep->cursed) { + if(!err++) + pline("%s is welded to your hand.", Doname(uwep)); + } + if(err) return(0); + setworn(otmp, mask); + if(otmp == uwep) + setuwep((struct obj *) 0); + delay = -objects[otmp->otyp].oc_delay; + if(delay){ + nomul(delay); + nomovemsg = "You finished your dressing manoeuvre."; + } + otmp->known = 1; + return(1); +} + +dowearring() { + register struct obj *otmp; + long mask = 0; + long oldprop; + + if(uleft && uright){ + pline("There are no more ring-fingers to fill."); + return(0); + } + otmp = getobj("=", "wear"); + if(!otmp) return(0); + if(otmp->owornmask & W_RING) { + pline("You are already wearing that!"); + return(0); + } + if(otmp == uleft || otmp == uright) { + pline("You are already wearing that."); + return(0); + } + if(otmp == uwep && uwep->cursed) { + pline("%s is welded to your hand.", Doname(uwep)); + return(0); + } + if(uleft) mask = RIGHT_RING; + else if(uright) mask = LEFT_RING; + else do { + char answer; + + pline("What ring-finger, Right or Left? "); + if(index(quitchars, (answer = readchar()))) + return(0); + switch(answer){ + case 'l': + case 'L': + mask = LEFT_RING; + break; + case 'r': + case 'R': + mask = RIGHT_RING; + break; + } + } while(!mask); + setworn(otmp, mask); + if(otmp == uwep) + setuwep((struct obj *) 0); + oldprop = u.uprops[PROP(otmp->otyp)].p_flgs; + u.uprops[PROP(otmp->otyp)].p_flgs |= mask; + switch(otmp->otyp){ + case RIN_LEVITATION: + if(!oldprop) float_up(); + break; + case RIN_PROTECTION_FROM_SHAPE_CHANGERS: + rescham(); + break; + case RIN_GAIN_STRENGTH: + u.ustr += otmp->spe; + u.ustrmax += otmp->spe; + if(u.ustr > 118) u.ustr = 118; + if(u.ustrmax > 118) u.ustrmax = 118; + flags.botl = 1; + break; + case RIN_INCREASE_DAMAGE: + u.udaminc += otmp->spe; + break; + } + prinv(otmp); + return(1); +} + +ringoff(obj) +register struct obj *obj; +{ +register long mask; + mask = obj->owornmask & W_RING; + setworn((struct obj *) 0, obj->owornmask); + if(!(u.uprops[PROP(obj->otyp)].p_flgs & mask)) + impossible("Strange... I didnt know you had that ring."); + u.uprops[PROP(obj->otyp)].p_flgs &= ~mask; + switch(obj->otyp) { + case RIN_FIRE_RESISTANCE: + /* Bad luck if the player is in hell... --jgm */ + if (!Fire_resistance && dlevel >= 30) { + pline("The flames of Hell burn you to a crisp."); + killer = "stupidity in hell"; + done("burned"); + } + break; + case RIN_LEVITATION: + if(!Levitation) { /* no longer floating */ + float_down(); + } + break; + case RIN_GAIN_STRENGTH: + u.ustr -= obj->spe; + u.ustrmax -= obj->spe; + if(u.ustr > 118) u.ustr = 118; + if(u.ustrmax > 118) u.ustrmax = 118; + flags.botl = 1; + break; + case RIN_INCREASE_DAMAGE: + u.udaminc -= obj->spe; + break; + } +} + +find_ac(){ +register int uac = 10; + if(uarm) uac -= ARM_BONUS(uarm); + if(uarm2) uac -= ARM_BONUS(uarm2); + if(uarmh) uac -= ARM_BONUS(uarmh); + if(uarms) uac -= ARM_BONUS(uarms); + if(uarmg) uac -= ARM_BONUS(uarmg); + if(uleft && uleft->otyp == RIN_PROTECTION) uac -= uleft->spe; + if(uright && uright->otyp == RIN_PROTECTION) uac -= uright->spe; + if(uac != u.uac){ + u.uac = uac; + flags.botl = 1; + } +} + +glibr(){ +register struct obj *otmp; +int xfl = 0; + if(!uarmg) if(uleft || uright) { + /* Note: at present also cursed rings fall off */ + pline("Your %s off your fingers.", + (uleft && uright) ? "rings slip" : "ring slips"); + xfl++; + if((otmp = uleft) != Null(obj)){ + ringoff(uleft); + dropx(otmp); + } + if((otmp = uright) != Null(obj)){ + ringoff(uright); + dropx(otmp); + } + } + if((otmp = uwep) != Null(obj)){ + /* Note: at present also cursed weapons fall */ + setuwep((struct obj *) 0); + dropx(otmp); + pline("Your weapon %sslips from your hands.", + xfl ? "also " : ""); + } +} + +struct obj * +some_armor(){ +register struct obj *otmph = uarm; + if(uarmh && (!otmph || !rn2(4))) otmph = uarmh; + if(uarmg && (!otmph || !rn2(4))) otmph = uarmg; + if(uarms && (!otmph || !rn2(4))) otmph = uarms; + return(otmph); +} + +corrode_armor(){ +register struct obj *otmph = some_armor(); + if(otmph){ + if(otmph->rustfree || + otmph->otyp == ELVEN_CLOAK || + otmph->otyp == LEATHER_ARMOR || + otmph->otyp == STUDDED_LEATHER_ARMOR) { + pline("Your %s not affected!", + aobjnam(otmph, "are")); + return; + } + pline("Your %s!", aobjnam(otmph, "corrode")); + otmph->spe--; + } +} diff --git a/games/hack/hack.dog.c b/games/hack/hack.dog.c new file mode 100644 index 0000000..aa4387a --- /dev/null +++ b/games/hack/hack.dog.c @@ -0,0 +1,413 @@ +/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ +/* hack.dog.c - version 1.0.3 */ + +#include "hack.h" +#include "hack.mfndpos.h" +extern struct monst *makemon(); +#include "def.edog.h" +#include "def.mkroom.h" + +struct permonst li_dog = + { "little dog", 'd',2,18,6,1,6,sizeof(struct edog) }; +struct permonst dog = + { "dog", 'd',4,16,5,1,6,sizeof(struct edog) }; +struct permonst la_dog = + { "large dog", 'd',6,15,4,2,4,sizeof(struct edog) }; + + +makedog(){ +register struct monst *mtmp = makemon(&li_dog,u.ux,u.uy); + if(!mtmp) return; /* dogs were genocided */ + initedog(mtmp); +} + +initedog(mtmp) register struct monst *mtmp; { + mtmp->mtame = mtmp->mpeaceful = 1; + EDOG(mtmp)->hungrytime = 1000 + moves; + EDOG(mtmp)->eattime = 0; + EDOG(mtmp)->droptime = 0; + EDOG(mtmp)->dropdist = 10000; + EDOG(mtmp)->apport = 10; + EDOG(mtmp)->whistletime = 0; +} + +/* attach the monsters that went down (or up) together with @ */ +struct monst *mydogs = 0; +struct monst *fallen_down = 0; /* monsters that fell through a trapdoor */ + /* they will appear on the next level @ goes to, even if he goes up! */ + +losedogs(){ +register struct monst *mtmp; + while(mtmp = mydogs){ + mydogs = mtmp->nmon; + mtmp->nmon = fmon; + fmon = mtmp; + mnexto(mtmp); + } + while(mtmp = fallen_down){ + fallen_down = mtmp->nmon; + mtmp->nmon = fmon; + fmon = mtmp; + rloc(mtmp); + } +} + +keepdogs(){ +register struct monst *mtmp; + for(mtmp = fmon; mtmp; mtmp = mtmp->nmon) + if(dist(mtmp->mx,mtmp->my) < 3 && follower(mtmp) + && !mtmp->msleep && !mtmp->mfroz) { + relmon(mtmp); + mtmp->nmon = mydogs; + mydogs = mtmp; + unpmon(mtmp); + keepdogs(); /* we destroyed the link, so use recursion */ + return; /* (admittedly somewhat primitive) */ + } +} + +fall_down(mtmp) register struct monst *mtmp; { + relmon(mtmp); + mtmp->nmon = fallen_down; + fallen_down = mtmp; + unpmon(mtmp); + mtmp->mtame = 0; +} + +/* return quality of food; the lower the better */ +#define DOGFOOD 0 +#define CADAVER 1 +#define ACCFOOD 2 +#define MANFOOD 3 +#define APPORT 4 +#define POISON 5 +#define UNDEF 6 +dogfood(obj) register struct obj *obj; { + switch(obj->olet) { + case FOOD_SYM: + return( + (obj->otyp == TRIPE_RATION) ? DOGFOOD : + (obj->otyp < CARROT) ? ACCFOOD : + (obj->otyp < CORPSE) ? MANFOOD : + (poisonous(obj) || obj->age + 50 <= moves || + obj->otyp == DEAD_COCKATRICE) + ? POISON : CADAVER + ); + default: + if(!obj->cursed) return(APPORT); + /* fall into next case */ + case BALL_SYM: + case CHAIN_SYM: + case ROCK_SYM: + return(UNDEF); + } +} + +/* return 0 (no move), 1 (move) or 2 (dead) */ +dog_move(mtmp, after) register struct monst *mtmp; { +register int nx,ny,omx,omy,appr,nearer,j; +int udist,chi,i,whappr; +register struct monst *mtmp2; +register struct permonst *mdat = mtmp->data; +register struct edog *edog = EDOG(mtmp); +struct obj *obj; +struct trap *trap; +xchar cnt,chcnt,nix,niy; +schar dogroom,uroom; +xchar gx,gy,gtyp,otyp; /* current goal */ +coord poss[9]; +int info[9]; +#define GDIST(x,y) ((x-gx)*(x-gx) + (y-gy)*(y-gy)) +#define DDIST(x,y) ((x-omx)*(x-omx) + (y-omy)*(y-omy)) + + if(moves <= edog->eattime) return(0); /* dog is still eating */ + omx = mtmp->mx; + omy = mtmp->my; + whappr = (moves - EDOG(mtmp)->whistletime < 5); + if(moves > edog->hungrytime + 500 && !mtmp->mconf){ + mtmp->mconf = 1; + mtmp->mhpmax /= 3; + if(mtmp->mhp > mtmp->mhpmax) + mtmp->mhp = mtmp->mhpmax; + if(cansee(omx,omy)) + pline("%s is confused from hunger.", Monnam(mtmp)); + else pline("You feel worried about %s.", monnam(mtmp)); + } else + if(moves > edog->hungrytime + 750 || mtmp->mhp < 1){ + if(cansee(omx,omy)) + pline("%s dies from hunger.", Monnam(mtmp)); + else + pline("You have a sad feeling for a moment, then it passes."); + mondied(mtmp); + return(2); + } + dogroom = inroom(omx,omy); + uroom = inroom(u.ux,u.uy); + udist = dist(omx,omy); + + /* maybe we tamed him while being swallowed --jgm */ + if(!udist) return(0); + + /* if we are carrying sth then we drop it (perhaps near @) */ + /* Note: if apport == 1 then our behaviour is independent of udist */ + if(mtmp->minvent){ + if(!rn2(udist) || !rn2((int) edog->apport)) + if(rn2(10) < edog->apport){ + relobj(mtmp, (int) mtmp->minvis); + if(edog->apport > 1) edog->apport--; + edog->dropdist = udist; /* hpscdi!jon */ + edog->droptime = moves; + } + } else { + if(obj = o_at(omx,omy)) if(!index("0_", obj->olet)){ + if((otyp = dogfood(obj)) <= CADAVER){ + nix = omx; + niy = omy; + goto eatobj; + } + if(obj->owt < 10*mtmp->data->mlevel) + if(rn2(20) < edog->apport+3) + if(rn2(udist) || !rn2((int) edog->apport)){ + freeobj(obj); + unpobj(obj); + /* if(levl[omx][omy].scrsym == obj->olet) + newsym(omx,omy); */ + mpickobj(mtmp,obj); + } + } + } + + /* first we look for food */ + gtyp = UNDEF; /* no goal as yet */ +#ifdef LINT + gx = gy = 0; /* suppress 'used before set' message */ +#endif LINT + for(obj = fobj; obj; obj = obj->nobj) { + otyp = dogfood(obj); + if(otyp > gtyp || otyp == UNDEF) continue; + if(inroom(obj->ox,obj->oy) != dogroom) continue; + if(otyp < MANFOOD && + (dogroom >= 0 || DDIST(obj->ox,obj->oy) < 10)) { + if(otyp < gtyp || (otyp == gtyp && + DDIST(obj->ox,obj->oy) < DDIST(gx,gy))){ + gx = obj->ox; + gy = obj->oy; + gtyp = otyp; + } + } else + if(gtyp == UNDEF && dogroom >= 0 && + uroom == dogroom && + !mtmp->minvent && edog->apport > rn2(8)){ + gx = obj->ox; + gy = obj->oy; + gtyp = APPORT; + } + } + if(gtyp == UNDEF || + (gtyp != DOGFOOD && gtyp != APPORT && moves < edog->hungrytime)){ + if(dogroom < 0 || dogroom == uroom){ + gx = u.ux; + gy = u.uy; +#ifndef QUEST + } else { + int tmp = rooms[dogroom].fdoor; + cnt = rooms[dogroom].doorct; + + gx = gy = FAR; /* random, far away */ + while(cnt--){ + if(dist(gx,gy) > + dist(doors[tmp].x, doors[tmp].y)){ + gx = doors[tmp].x; + gy = doors[tmp].y; + } + tmp++; + } + /* here gx == FAR e.g. when dog is in a vault */ + if(gx == FAR || (gx == omx && gy == omy)){ + gx = u.ux; + gy = u.uy; + } +#endif QUEST + } + appr = (udist >= 9) ? 1 : (mtmp->mflee) ? -1 : 0; + if(after && udist <= 4 && gx == u.ux && gy == u.uy) + return(0); + if(udist > 1){ + if(!IS_ROOM(levl[u.ux][u.uy].typ) || !rn2(4) || + whappr || + (mtmp->minvent && rn2((int) edog->apport))) + appr = 1; + } + /* if you have dog food he'll follow you more closely */ + if(appr == 0){ + obj = invent; + while(obj){ + if(obj->otyp == TRIPE_RATION){ + appr = 1; + break; + } + obj = obj->nobj; + } + } + } else appr = 1; /* gtyp != UNDEF */ + if(mtmp->mconf) appr = 0; + + if(gx == u.ux && gy == u.uy && (dogroom != uroom || dogroom < 0)){ + extern coord *gettrack(); + register coord *cp; + cp = gettrack(omx,omy); + if(cp){ + gx = cp->x; + gy = cp->y; + } + } + + nix = omx; + niy = omy; + cnt = mfndpos(mtmp,poss,info,ALLOW_M | ALLOW_TRAPS); + chcnt = 0; + chi = -1; + for(i=0; idata->mlevel >= mdat->mlevel+2 || + mtmp2->data->mlet == 'c') + continue; + if(after) return(0); /* hit only once each move */ + + if(hitmm(mtmp, mtmp2) == 1 && rn2(4) && + mtmp2->mlstmv != moves && + hitmm(mtmp2,mtmp) == 2) return(2); + return(0); + } + + /* dog avoids traps */ + /* but perhaps we have to pass a trap in order to follow @ */ + if((info[i] & ALLOW_TRAPS) && (trap = t_at(nx,ny))){ + if(!trap->tseen && rn2(40)) continue; + if(rn2(10)) continue; + } + + /* dog eschewes cursed objects */ + /* but likes dog food */ + obj = fobj; + while(obj){ + if(obj->ox != nx || obj->oy != ny) + goto nextobj; + if(obj->cursed) goto nxti; + if(obj->olet == FOOD_SYM && + (otyp = dogfood(obj)) < MANFOOD && + (otyp < ACCFOOD || edog->hungrytime <= moves)){ + /* Note: our dog likes the food so much that he + might eat it even when it conceals a cursed object */ + nix = nx; + niy = ny; + chi = i; + eatobj: + edog->eattime = + moves + obj->quan * objects[obj->otyp].oc_delay; + if(edog->hungrytime < moves) + edog->hungrytime = moves; + edog->hungrytime += + 5*obj->quan * objects[obj->otyp].nutrition; + mtmp->mconf = 0; + if(cansee(nix,niy)) + pline("%s ate %s.", Monnam(mtmp), doname(obj)); + /* perhaps this was a reward */ + if(otyp != CADAVER) + edog->apport += 200/(edog->dropdist+moves-edog->droptime); + delobj(obj); + goto newdogpos; + } + nextobj: + obj = obj->nobj; + } + + for(j=0; jmtrack[j].x && ny == mtmp->mtrack[j].y) + if(rn2(4*(cnt-j))) goto nxti; + +/* Some stupid C compilers cannot compute the whole expression at once. */ + nearer = GDIST(nx,ny); + nearer -= GDIST(nix,niy); + nearer *= appr; + if((nearer == 0 && !rn2(++chcnt)) || nearer<0 || + (nearer > 0 && !whappr && + ((omx == nix && omy == niy && !rn2(3)) + || !rn2(12)) + )){ + nix = nx; + niy = ny; + if(nearer < 0) chcnt = 0; + chi = i; + } + nxti: ; + } +newdogpos: + if(nix != omx || niy != omy){ + if(info[chi] & ALLOW_U){ + (void) hitu(mtmp, d(mdat->damn, mdat->damd)+1); + return(0); + } + mtmp->mx = nix; + mtmp->my = niy; + for(j=MTSZ-1; j>0; j--) mtmp->mtrack[j] = mtmp->mtrack[j-1]; + mtmp->mtrack[0].x = omx; + mtmp->mtrack[0].y = omy; + } + if(mintrap(mtmp) == 2) /* he died */ + return(2); + pmon(mtmp); + return(1); +} + +/* return roomnumber or -1 */ +inroom(x,y) xchar x,y; { +#ifndef QUEST + register struct mkroom *croom = &rooms[0]; + while(croom->hx >= 0){ + if(croom->hx >= x-1 && croom->lx <= x+1 && + croom->hy >= y-1 && croom->ly <= y+1) + return(croom - rooms); + croom++; + } +#endif QUEST + return(-1); /* not in room or on door */ +} + +tamedog(mtmp, obj) +register struct monst *mtmp; +register struct obj *obj; +{ + register struct monst *mtmp2; + + if(flags.moonphase == FULL_MOON && night() && rn2(6)) + return(0); + + /* If we cannot tame him, at least he's no longer afraid. */ + mtmp->mflee = 0; + mtmp->mfleetim = 0; + if(mtmp->mtame || mtmp->mfroz || +#ifndef NOWORM + mtmp->wormno || +#endif NOWORM + mtmp->isshk || mtmp->isgd || index(" &@12", mtmp->data->mlet)) + return(0); /* no tame long worms? */ + if(obj) { + if(dogfood(obj) >= MANFOOD) return(0); + if(cansee(mtmp->mx,mtmp->my)){ + pline("%s devours the %s.", Monnam(mtmp), + objects[obj->otyp].oc_name); + } + obfree(obj, (struct obj *) 0); + } + mtmp2 = newmonst(sizeof(struct edog) + mtmp->mnamelth); + *mtmp2 = *mtmp; + mtmp2->mxlth = sizeof(struct edog); + if(mtmp->mnamelth) (void) strcpy(NAME(mtmp2), NAME(mtmp)); + initedog(mtmp2); + replmon(mtmp,mtmp2); + return(1); +} diff --git a/games/hack/hack.eat.c b/games/hack/hack.eat.c new file mode 100644 index 0000000..f1a7677 --- /dev/null +++ b/games/hack/hack.eat.c @@ -0,0 +1,459 @@ +/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ +/* hack.eat.c - version 1.0.3 */ + +#include "hack.h" +char POISONOUS[] = "ADKSVabhks"; +extern char *nomovemsg; +extern int (*afternmv)(); +extern int (*occupation)(); +extern char *occtxt; +extern struct obj *splitobj(), *addinv(); + +/* hunger texts used on bottom line (each 8 chars long) */ +#define SATIATED 0 +#define NOT_HUNGRY 1 +#define HUNGRY 2 +#define WEAK 3 +#define FAINTING 4 +#define FAINTED 5 +#define STARVED 6 + +char *hu_stat[] = { + "Satiated", + " ", + "Hungry ", + "Weak ", + "Fainting", + "Fainted ", + "Starved " +}; + +init_uhunger(){ + u.uhunger = 900; + u.uhs = NOT_HUNGRY; +} + +#define TTSZ SIZE(tintxts) +struct { char *txt; int nut; } tintxts[] = { + "It contains first quality peaches - what a surprise!", 40, + "It contains salmon - not bad!", 60, + "It contains apple juice - perhaps not what you hoped for.", 20, + "It contains some nondescript substance, tasting awfully.", 500, + "It contains rotten meat. You vomit.", -50, + "It turns out to be empty.", 0 +}; + +static struct { + struct obj *tin; + int usedtime, reqtime; +} tin; + +opentin(){ + register int r; + + if(!carried(tin.tin)) /* perhaps it was stolen? */ + return(0); /* %% probably we should use tinoid */ + if(tin.usedtime++ >= 50) { + pline("You give up your attempt to open the tin."); + return(0); + } + if(tin.usedtime < tin.reqtime) + return(1); /* still busy */ + + pline("You succeed in opening the tin."); + useup(tin.tin); + r = rn2(2*TTSZ); + if(r < TTSZ){ + pline(tintxts[r].txt); + lesshungry(tintxts[r].nut); + if(r == 1) /* SALMON */ { + Glib = rnd(15); + pline("Eating salmon made your fingers very slippery."); + } + } else { + pline("It contains spinach - this makes you feel like Popeye!"); + lesshungry(600); + if(u.ustr < 118) + u.ustr += rnd( ((u.ustr < 17) ? 19 : 118) - u.ustr); + if(u.ustr > u.ustrmax) u.ustrmax = u.ustr; + flags.botl = 1; + } + return(0); +} + +Meatdone(){ + u.usym = '@'; + prme(); +} + +doeat(){ + register struct obj *otmp; + register struct objclass *ftmp; + register tmp; + + /* Is there some food (probably a heavy corpse) here on the ground? */ + if(!Levitation) + for(otmp = fobj; otmp; otmp = otmp->nobj) { + if(otmp->ox == u.ux && otmp->oy == u.uy && + otmp->olet == FOOD_SYM) { + pline("There %s %s here; eat %s? [ny] ", + (otmp->quan == 1) ? "is" : "are", + doname(otmp), + (otmp->quan == 1) ? "it" : "one"); + if(readchar() == 'y') { + if(otmp->quan != 1) + (void) splitobj(otmp, 1); + freeobj(otmp); + otmp = addinv(otmp); + addtobill(otmp); + goto gotit; + } + } + } + otmp = getobj("%", "eat"); + if(!otmp) return(0); +gotit: + if(otmp->otyp == TIN){ + if(uwep) { + switch(uwep->otyp) { + case CAN_OPENER: + tmp = 1; + break; + case DAGGER: + case CRYSKNIFE: + tmp = 3; + break; + case PICK_AXE: + case AXE: + tmp = 6; + break; + default: + goto no_opener; + } + pline("Using your %s you try to open the tin.", + aobjnam(uwep, (char *) 0)); + } else { + no_opener: + pline("It is not so easy to open this tin."); + if(Glib) { + pline("The tin slips out of your hands."); + if(otmp->quan > 1) { + register struct obj *obj; + extern struct obj *splitobj(); + + obj = splitobj(otmp, 1); + if(otmp == uwep) setuwep(obj); + } + dropx(otmp); + return(1); + } + tmp = 10 + rn2(1 + 500/((int)(u.ulevel + u.ustr))); + } + tin.reqtime = tmp; + tin.usedtime = 0; + tin.tin = otmp; + occupation = opentin; + occtxt = "opening the tin"; + return(1); + } + ftmp = &objects[otmp->otyp]; + multi = -ftmp->oc_delay; + if(otmp->otyp >= CORPSE && eatcorpse(otmp)) goto eatx; + if(!rn2(7) && otmp->otyp != FORTUNE_COOKIE) { + pline("Blecch! Rotten food!"); + if(!rn2(4)) { + pline("You feel rather light headed."); + Confusion += d(2,4); + } else if(!rn2(4)&& !Blind) { + pline("Everything suddenly goes dark."); + Blind = d(2,10); + seeoff(0); + } else if(!rn2(3)) { + if(Blind) + pline("The world spins and you slap against the floor."); + else + pline("The world spins and goes dark."); + nomul(-rnd(10)); + nomovemsg = "You are conscious again."; + } + lesshungry(ftmp->nutrition / 4); + } else { + if(u.uhunger >= 1500) { + pline("You choke over your food."); + pline("You die..."); + killer = ftmp->oc_name; + done("choked"); + } + switch(otmp->otyp){ + case FOOD_RATION: + if(u.uhunger <= 200) + pline("That food really hit the spot!"); + else if(u.uhunger <= 700) + pline("That satiated your stomach!"); + else { + pline("You're having a hard time getting all that food down."); + multi -= 2; + } + lesshungry(ftmp->nutrition); + if(multi < 0) nomovemsg = "You finished your meal."; + break; + case TRIPE_RATION: + pline("Yak - dog food!"); + more_experienced(1,0); + flags.botl = 1; + if(rn2(2)){ + pline("You vomit."); + morehungry(20); + if(Sick) { + Sick = 0; /* David Neves */ + pline("What a relief!"); + } + } else lesshungry(ftmp->nutrition); + break; + default: + if(otmp->otyp >= CORPSE) + pline("That %s tasted terrible!",ftmp->oc_name); + else + pline("That %s was delicious!",ftmp->oc_name); + lesshungry(ftmp->nutrition); + if(otmp->otyp == DEAD_LIZARD && (Confusion > 2)) + Confusion = 2; + else +#ifdef QUEST + if(otmp->otyp == CARROT && !Blind){ + u.uhorizon++; + setsee(); + pline("Your vision improves."); + } else +#endif QUEST + if(otmp->otyp == FORTUNE_COOKIE) { + if(Blind) { + pline("This cookie has a scrap of paper inside!"); + pline("What a pity, that you cannot read it!"); + } else + outrumor(); + } else + if(otmp->otyp == LUMP_OF_ROYAL_JELLY) { + /* This stuff seems to be VERY healthy! */ + if(u.ustrmax < 118) u.ustrmax++; + if(u.ustr < u.ustrmax) u.ustr++; + u.uhp += rnd(20); + if(u.uhp > u.uhpmax) { + if(!rn2(17)) u.uhpmax++; + u.uhp = u.uhpmax; + } + heal_legs(); + } + break; + } + } +eatx: + if(multi<0 && !nomovemsg){ + static char msgbuf[BUFSZ]; + (void) sprintf(msgbuf, "You finished eating the %s.", + ftmp->oc_name); + nomovemsg = msgbuf; + } + useup(otmp); + return(1); +} + +/* called in hack.main.c */ +gethungry(){ + --u.uhunger; + if(moves % 2) { + if(Regeneration) u.uhunger--; + if(Hunger) u.uhunger--; + /* a3: if(Hunger & LEFT_RING) u.uhunger--; + if(Hunger & RIGHT_RING) u.uhunger--; + etc. */ + } + if(moves % 20 == 0) { /* jimt@asgb */ + if(uleft) u.uhunger--; + if(uright) u.uhunger--; + } + newuhs(TRUE); +} + +/* called after vomiting and after performing feats of magic */ +morehungry(num) register num; { + u.uhunger -= num; + newuhs(TRUE); +} + +/* called after eating something (and after drinking fruit juice) */ +lesshungry(num) register num; { + u.uhunger += num; + newuhs(FALSE); +} + +unfaint(){ + u.uhs = FAINTING; + flags.botl = 1; +} + +newuhs(incr) boolean incr; { + register int newhs, h = u.uhunger; + + newhs = (h > 1000) ? SATIATED : + (h > 150) ? NOT_HUNGRY : + (h > 50) ? HUNGRY : + (h > 0) ? WEAK : FAINTING; + + if(newhs == FAINTING) { + if(u.uhs == FAINTED) + newhs = FAINTED; + if(u.uhs <= WEAK || rn2(20-u.uhunger/10) >= 19) { + if(u.uhs != FAINTED && multi >= 0 /* %% */) { + pline("You faint from lack of food."); + nomul(-10+(u.uhunger/10)); + nomovemsg = "You regain consciousness."; + afternmv = unfaint; + newhs = FAINTED; + } + } else + if(u.uhunger < -(int)(200 + 25*u.ulevel)) { + u.uhs = STARVED; + flags.botl = 1; + bot(); + pline("You die from starvation."); + done("starved"); + } + } + + if(newhs != u.uhs) { + if(newhs >= WEAK && u.uhs < WEAK) + losestr(1); /* this may kill you -- see below */ + else + if(newhs < WEAK && u.uhs >= WEAK && u.ustr < u.ustrmax) + losestr(-1); + switch(newhs){ + case HUNGRY: + pline((!incr) ? "You only feel hungry now." : + (u.uhunger < 145) ? "You feel hungry." : + "You are beginning to feel hungry."); + break; + case WEAK: + pline((!incr) ? "You feel weak now." : + (u.uhunger < 45) ? "You feel weak." : + "You are beginning to feel weak."); + break; + } + u.uhs = newhs; + flags.botl = 1; + if(u.uhp < 1) { + pline("You die from hunger and exhaustion."); + killer = "exhaustion"; + done("starved"); + } + } +} + +#define CORPSE_I_TO_C(otyp) (char) ((otyp >= DEAD_ACID_BLOB)\ + ? 'a' + (otyp - DEAD_ACID_BLOB)\ + : '@' + (otyp - DEAD_HUMAN)) +poisonous(otmp) +register struct obj *otmp; +{ + return(index(POISONOUS, CORPSE_I_TO_C(otmp->otyp)) != 0); +} + +/* returns 1 if some text was printed */ +eatcorpse(otmp) register struct obj *otmp; { +register char let = CORPSE_I_TO_C(otmp->otyp); +register tp = 0; + if(let != 'a' && moves > otmp->age + 50 + rn2(100)) { + tp++; + pline("Ulch -- that meat was tainted!"); + pline("You get very sick."); + Sick = 10 + rn2(10); + u.usick_cause = objects[otmp->otyp].oc_name; + } else if(index(POISONOUS, let) && rn2(5)){ + tp++; + pline("Ecch -- that must have been poisonous!"); + if(!Poison_resistance){ + losestr(rnd(4)); + losehp(rnd(15), "poisonous corpse"); + } else + pline("You don't seem affected by the poison."); + } else if(index("ELNOPQRUuxz", let) && rn2(5)){ + tp++; + pline("You feel sick."); + losehp(rnd(8), "cadaver"); + } + switch(let) { + case 'L': + case 'N': + case 't': + Teleportation |= INTRINSIC; + break; + case 'W': + pluslvl(); + break; + case 'n': + u.uhp = u.uhpmax; + flags.botl = 1; + /* fall into next case */ + case '@': + pline("You cannibal! You will be sorry for this!"); + /* not tp++; */ + /* fall into next case */ + case 'd': + Aggravate_monster |= INTRINSIC; + break; + case 'I': + if(!Invis) { + Invis = 50+rn2(100); + if(!See_invisible) + newsym(u.ux, u.uy); + } else { + Invis |= INTRINSIC; + See_invisible |= INTRINSIC; + } + /* fall into next case */ + case 'y': +#ifdef QUEST + u.uhorizon++; +#endif QUEST + /* fall into next case */ + case 'B': + Confusion = 50; + break; + case 'D': + Fire_resistance |= INTRINSIC; + break; + case 'E': + Telepat |= INTRINSIC; + break; + case 'F': + case 'Y': + Cold_resistance |= INTRINSIC; + break; + case 'k': + case 's': + Poison_resistance |= INTRINSIC; + break; + case 'c': + pline("You turn to stone."); + killer = "dead cockatrice"; + done("died"); + /* NOTREACHED */ + case 'a': + if(Stoned) { + pline("What a pity - you just destroyed a future piece of art!"); + tp++; + Stoned = 0; + } + break; + case 'M': + pline("You cannot resist the temptation to mimic a treasure chest."); + tp++; + nomul(-30); + afternmv = Meatdone; + nomovemsg = "You now again prefer mimicking a human."; + u.usym = '$'; + prme(); + break; + } + return(tp); +} diff --git a/games/hack/hack.end.c b/games/hack/hack.end.c new file mode 100644 index 0000000..6a646c7 --- /dev/null +++ b/games/hack/hack.end.c @@ -0,0 +1,641 @@ +/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ +/* hack.end.c - version 1.0.3 */ + +#include "hack.h" +#include +#include +#define Sprintf (void) sprintf +extern char plname[], pl_character[]; +extern char *itoa(), *ordin(), *eos(); + +xchar maxdlevel = 1; + +done1() +{ + (void) signal(SIGINT,SIG_IGN); + pline("Really quit?"); + if(readchar() != 'y') { + (void) signal(SIGINT,done1); + clrlin(); + (void) fflush(stdout); + if(multi > 0) nomul(0); + return(0); + } + done("quit"); + /* NOTREACHED */ +} + +int done_stopprint; +int done_hup; + +done_intr(){ + done_stopprint++; + (void) signal(SIGINT, SIG_IGN); + (void) signal(SIGQUIT, SIG_IGN); +} + +done_hangup(){ + done_hup++; + (void) signal(SIGHUP, SIG_IGN); + done_intr(); +} + +done_in_by(mtmp) register struct monst *mtmp; { +static char buf[BUFSZ]; + pline("You die ..."); + if(mtmp->data->mlet == ' '){ + Sprintf(buf, "the ghost of %s", (char *) mtmp->mextra); + killer = buf; + } else if(mtmp->mnamelth) { + Sprintf(buf, "%s called %s", + mtmp->data->mname, NAME(mtmp)); + killer = buf; + } else if(mtmp->minvis) { + Sprintf(buf, "invisible %s", mtmp->data->mname); + killer = buf; + } else killer = mtmp->data->mname; + done("died"); +} + +/* called with arg "died", "drowned", "escaped", "quit", "choked", "panicked", + "burned", "starved" or "tricked" */ +/* Be careful not to call panic from here! */ +done(st1) +register char *st1; +{ + +#ifdef WIZARD + if(wizard && *st1 == 'd'){ + u.uswldtim = 0; + if(u.uhpmax < 0) u.uhpmax = 100; /* arbitrary */ + u.uhp = u.uhpmax; + pline("For some reason you are still alive."); + flags.move = 0; + if(multi > 0) multi = 0; else multi = -1; + flags.botl = 1; + return; + } +#endif WIZARD + (void) signal(SIGINT, done_intr); + (void) signal(SIGQUIT, done_intr); + (void) signal(SIGHUP, done_hangup); + if(*st1 == 'q' && u.uhp < 1){ + st1 = "died"; + killer = "quit while already on Charon's boat"; + } + if(*st1 == 's') killer = "starvation"; else + if(*st1 == 'd' && st1[1] == 'r') killer = "drowning"; else + if(*st1 == 'p') killer = "panic"; else + if(*st1 == 't') killer = "trickery"; else + if(!index("bcd", *st1)) killer = st1; + paybill(); + clearlocks(); + if(flags.toplin == 1) more(); + if(index("bcds", *st1)){ +#ifdef WIZARD + if(!wizard) +#endif WIZARD + savebones(); + if(!flags.notombstone) + outrip(); + } + if(*st1 == 'c') killer = st1; /* after outrip() */ + settty((char *) 0); /* does a clear_screen() */ + if(!done_stopprint) + printf("Goodbye %s %s...\n\n", pl_character, plname); + { long int tmp; + tmp = u.ugold - u.ugold0; + if(tmp < 0) + tmp = 0; + if(*st1 == 'd' || *st1 == 'b') + tmp -= tmp/10; + u.urexp += tmp; + u.urexp += 50 * maxdlevel; + if(maxdlevel > 20) + u.urexp += 1000*((maxdlevel > 30) ? 10 : maxdlevel - 20); + } + if(*st1 == 'e') { + extern struct monst *mydogs; + register struct monst *mtmp; + register struct obj *otmp; + register int i; + register unsigned worthlessct = 0; + boolean has_amulet = FALSE; + + killer = st1; + keepdogs(); + mtmp = mydogs; + if(mtmp) { + if(!done_stopprint) printf("You"); + while(mtmp) { + if(!done_stopprint) + printf(" and %s", monnam(mtmp)); + if(mtmp->mtame) + u.urexp += mtmp->mhp; + mtmp = mtmp->nmon; + } + if(!done_stopprint) + printf("\nescaped from the dungeon with %ld points,\n", + u.urexp); + } else + if(!done_stopprint) + printf("You escaped from the dungeon with %ld points,\n", + u.urexp); + for(otmp = invent; otmp; otmp = otmp->nobj) { + if(otmp->olet == GEM_SYM){ + objects[otmp->otyp].oc_name_known = 1; + i = otmp->quan*objects[otmp->otyp].g_val; + if(i == 0) { + worthlessct += otmp->quan; + continue; + } + u.urexp += i; + if(!done_stopprint) + printf("\t%s (worth %d Zorkmids),\n", + doname(otmp), i); + } else if(otmp->olet == AMULET_SYM) { + otmp->known = 1; + i = (otmp->spe < 0) ? 2 : 5000; + u.urexp += i; + if(!done_stopprint) + printf("\t%s (worth %d Zorkmids),\n", + doname(otmp), i); + if(otmp->spe >= 0) { + has_amulet = TRUE; + killer = "escaped (with amulet)"; + } + } + } + if(worthlessct) if(!done_stopprint) + printf("\t%u worthless piece%s of coloured glass,\n", + worthlessct, plur(worthlessct)); + if(has_amulet) u.urexp *= 2; + } else + if(!done_stopprint) + printf("You %s on dungeon level %d with %ld points,\n", + st1, dlevel, u.urexp); + if(!done_stopprint) + printf("and %ld piece%s of gold, after %ld move%s.\n", + u.ugold, plur(u.ugold), moves, plur(moves)); + if(!done_stopprint) + printf("You were level %u with a maximum of %d hit points when you %s.\n", + u.ulevel, u.uhpmax, st1); + if(*st1 == 'e' && !done_stopprint){ + getret(); /* all those pieces of coloured glass ... */ + cls(); + } +#ifdef WIZARD + if(!wizard) +#endif WIZARD + topten(); + if(done_stopprint) printf("\n\n"); + exit(0); +} + +#define newttentry() (struct toptenentry *) alloc(sizeof(struct toptenentry)) +#define NAMSZ 8 +#define DTHSZ 40 +#define PERSMAX 1 +#define POINTSMIN 1 /* must be > 0 */ +#define ENTRYMAX 100 /* must be >= 10 */ +#define PERS_IS_UID /* delete for PERSMAX per name; now per uid */ +struct toptenentry { + struct toptenentry *tt_next; + long int points; + int level,maxlvl,hp,maxhp; + int uid; + char plchar; + char sex; + char name[NAMSZ+1]; + char death[DTHSZ+1]; + char date[7]; /* yymmdd */ +} *tt_head; + +topten(){ + int uid = getuid(); + int rank, rank0 = -1, rank1 = 0; + int occ_cnt = PERSMAX; + register struct toptenentry *t0, *t1, *tprev; + char *recfile = RECORD; + char *reclock = "record_lock"; + int sleepct = 300; + FILE *rfile; + register flg = 0; + extern char *getdate(); +#define HUP if(!done_hup) + while(link(recfile, reclock) == -1) { + HUP perror(reclock); + if(!sleepct--) { + HUP puts("I give up. Sorry."); + HUP puts("Perhaps there is an old record_lock around?"); + return; + } + HUP printf("Waiting for access to record file. (%d)\n", + sleepct); + HUP (void) fflush(stdout); + sleep(1); + } + if(!(rfile = fopen(recfile,"r"))){ + HUP puts("Cannot open record file!"); + goto unlock; + } + HUP (void) putchar('\n'); + + /* create a new 'topten' entry */ + t0 = newttentry(); + t0->level = dlevel; + t0->maxlvl = maxdlevel; + t0->hp = u.uhp; + t0->maxhp = u.uhpmax; + t0->points = u.urexp; + t0->plchar = pl_character[0]; + t0->sex = (flags.female ? 'F' : 'M'); + t0->uid = uid; + (void) strncpy(t0->name, plname, NAMSZ); + (t0->name)[NAMSZ] = 0; + (void) strncpy(t0->death, killer, DTHSZ); + (t0->death)[DTHSZ] = 0; + (void) strcpy(t0->date, getdate()); + + /* assure minimum number of points */ + if(t0->points < POINTSMIN) + t0->points = 0; + + t1 = tt_head = newttentry(); + tprev = 0; + /* rank0: -1 undefined, 0 not_on_list, n n_th on list */ + for(rank = 1; ; ) { + if(fscanf(rfile, "%6s %d %d %d %d %d %ld %c%c %[^,],%[^\n]", + t1->date, &t1->uid, + &t1->level, &t1->maxlvl, + &t1->hp, &t1->maxhp, &t1->points, + &t1->plchar, &t1->sex, t1->name, t1->death) != 11 + || t1->points < POINTSMIN) + t1->points = 0; + if(rank0 < 0 && t1->points < t0->points) { + rank0 = rank++; + if(tprev == 0) + tt_head = t0; + else + tprev->tt_next = t0; + t0->tt_next = t1; + occ_cnt--; + flg++; /* ask for a rewrite */ + } else + tprev = t1; + if(t1->points == 0) break; + if( +#ifdef PERS_IS_UID + t1->uid == t0->uid && +#else + strncmp(t1->name, t0->name, NAMSZ) == 0 && +#endif PERS_IS_UID + t1->plchar == t0->plchar && --occ_cnt <= 0){ + if(rank0 < 0){ + rank0 = 0; + rank1 = rank; + HUP printf("You didn't beat your previous score of %ld points.\n\n", + t1->points); + } + if(occ_cnt < 0){ + flg++; + continue; + } + } + if(rank <= ENTRYMAX){ + t1 = t1->tt_next = newttentry(); + rank++; + } + if(rank > ENTRYMAX){ + t1->points = 0; + break; + } + } + if(flg) { /* rewrite record file */ + (void) fclose(rfile); + if(!(rfile = fopen(recfile,"w"))){ + HUP puts("Cannot write record file\n"); + goto unlock; + } + + if(!done_stopprint) if(rank0 > 0){ + if(rank0 <= 10) + puts("You made the top ten list!\n"); + else + printf("You reached the %d%s place on the top %d list.\n\n", + rank0, ordin(rank0), ENTRYMAX); + } + } + if(rank0 == 0) rank0 = rank1; + if(rank0 <= 0) rank0 = rank; + if(!done_stopprint) outheader(); + t1 = tt_head; + for(rank = 1; t1->points != 0; rank++, t1 = t1->tt_next) { + if(flg) fprintf(rfile,"%6s %d %d %d %d %d %ld %c%c %s,%s\n", + t1->date, t1->uid, + t1->level, t1->maxlvl, + t1->hp, t1->maxhp, t1->points, + t1->plchar, t1->sex, t1->name, t1->death); + if(done_stopprint) continue; + if(rank > flags.end_top && + (rank < rank0-flags.end_around || rank > rank0+flags.end_around) + && (!flags.end_own || +#ifdef PERS_IS_UID + t1->uid != t0->uid )) +#else + strncmp(t1->name, t0->name, NAMSZ))) +#endif PERS_IS_UID + continue; + if(rank == rank0-flags.end_around && + rank0 > flags.end_top+flags.end_around+1 && + !flags.end_own) + (void) putchar('\n'); + if(rank != rank0) + (void) outentry(rank, t1, 0); + else if(!rank1) + (void) outentry(rank, t1, 1); + else { + int t0lth = outentry(0, t0, -1); + int t1lth = outentry(rank, t1, t0lth); + if(t1lth > t0lth) t0lth = t1lth; + (void) outentry(0, t0, t0lth); + } + } + if(rank0 >= rank) if(!done_stopprint) + (void) outentry(0, t0, 1); + (void) fclose(rfile); +unlock: + (void) unlink(reclock); +} + +outheader() { +char linebuf[BUFSZ]; +register char *bp; + (void) strcpy(linebuf, "Number Points Name"); + bp = eos(linebuf); + while(bp < linebuf + COLNO - 9) *bp++ = ' '; + (void) strcpy(bp, "Hp [max]"); + puts(linebuf); +} + +/* so>0: standout line; so=0: ordinary line; so<0: no output, return lth */ +int +outentry(rank,t1,so) register struct toptenentry *t1; { +boolean quit = FALSE, killed = FALSE, starv = FALSE; +char linebuf[BUFSZ]; + linebuf[0] = 0; + if(rank) Sprintf(eos(linebuf), "%3d", rank); + else Sprintf(eos(linebuf), " "); + Sprintf(eos(linebuf), " %6ld %8s", t1->points, t1->name); + if(t1->plchar == 'X') Sprintf(eos(linebuf), " "); + else Sprintf(eos(linebuf), "-%c ", t1->plchar); + if(!strncmp(t1->death, "escaped", STRLEN("escaped"))) { + if(!strcmp(" (with amulet)", t1->death+STRLEN("escaped"))) + Sprintf(eos(linebuf), "escaped the dungeon with amulet"); + else + Sprintf(eos(linebuf), "escaped the dungeon [max level %d]", + t1->maxlvl); + } else { + if(!strncmp(t1->death,"quit",STRLEN("quit"))) { + quit = TRUE; + if(t1->maxhp < 3*t1->hp && t1->maxlvl < 4) + Sprintf(eos(linebuf), "cravenly gave up"); + else + Sprintf(eos(linebuf), "quit"); + } + else if(!strcmp(t1->death,"choked")) + Sprintf(eos(linebuf), "choked on %s food", + (t1->sex == 'F') ? "her" : "his"); + else if(!strncmp(t1->death,"starv",STRLEN("starv"))) + Sprintf(eos(linebuf), "starved to death"), starv = TRUE; + else Sprintf(eos(linebuf), "was killed"), killed = TRUE; + Sprintf(eos(linebuf), " on%s level %d", + (killed || starv) ? "" : " dungeon", t1->level); + if(t1->maxlvl != t1->level) + Sprintf(eos(linebuf), " [max %d]", t1->maxlvl); + if(quit && t1->death[STRLEN("quit")]) + Sprintf(eos(linebuf), t1->death + STRLEN("quit")); + } + if(killed) Sprintf(eos(linebuf), " by %s%s", + (!strncmp(t1->death, "trick", STRLEN("trick")) + || !strncmp(t1->death, "the ", STRLEN("the "))) + ? "" : + index(vowels,*t1->death) ? "an " : "a ", + t1->death); + Sprintf(eos(linebuf), "."); + if(t1->maxhp) { + register char *bp = eos(linebuf); + char hpbuf[10]; + int hppos; + Sprintf(hpbuf, (t1->hp > 0) ? itoa(t1->hp) : "-"); + hppos = COLNO - 7 - strlen(hpbuf); + if(bp <= linebuf + hppos) { + while(bp < linebuf + hppos) *bp++ = ' '; + (void) strcpy(bp, hpbuf); + Sprintf(eos(bp), " [%d]", t1->maxhp); + } + } + if(so == 0) puts(linebuf); + else if(so > 0) { + register char *bp = eos(linebuf); + if(so >= COLNO) so = COLNO-1; + while(bp < linebuf + so) *bp++ = ' '; + *bp = 0; + standoutbeg(); + fputs(linebuf,stdout); + standoutend(); + (void) putchar('\n'); + } + return(strlen(linebuf)); +} + +char * +itoa(a) int a; { +static char buf[12]; + Sprintf(buf,"%d",a); + return(buf); +} + +char * +ordin(n) int n; { +register int d = n%10; + return((d==0 || d>3 || n/10==1) ? "th" : (d==1) ? "st" : + (d==2) ? "nd" : "rd"); +} + +clearlocks(){ +register x; + (void) signal(SIGHUP,SIG_IGN); + for(x = maxdlevel; x >= 0; x--) { + glo(x); + (void) unlink(lock); /* not all levels need be present */ + } +} + +#ifdef NOSAVEONHANGUP +hangup() +{ + (void) signal(SIGINT, SIG_IGN); + clearlocks(); + exit(1); +} +#endif NOSAVEONHANGUP + +char * +eos(s) +register char *s; +{ + while(*s) s++; + return(s); +} + +/* it is the callers responsibility to check that there is room for c */ +charcat(s,c) register char *s, c; { + while(*s) s++; + *s++ = c; + *s = 0; +} + +/* + * Called with args from main if argc >= 0. In this case, list scores as + * requested. Otherwise, find scores for the current player (and list them + * if argc == -1). + */ +prscore(argc,argv) int argc; char **argv; { + extern char *hname; + char **players; + int playerct; + int rank; + register struct toptenentry *t1, *t2; + char *recfile = RECORD; + FILE *rfile; + register flg = 0; + register int i; +#ifdef nonsense + long total_score = 0L; + char totchars[10]; + int totcharct = 0; +#endif nonsense + int outflg = (argc >= -1); +#ifdef PERS_IS_UID + int uid = -1; +#else + char *player0; +#endif PERS_IS_UID + + if(!(rfile = fopen(recfile,"r"))){ + puts("Cannot open record file!"); + return; + } + + if(argc > 1 && !strncmp(argv[1], "-s", STRLEN("-s"))){ + if(!argv[1][2]){ + argc--; + argv++; + } else if(!argv[1][3] && index("CFKSTWX", argv[1][2])) { + argv[1]++; + argv[1][0] = '-'; + } else argv[1] += 2; + } + if(argc <= 1){ +#ifdef PERS_IS_UID + uid = getuid(); + playerct = 0; +#else + player0 = plname; + if(!*player0) + player0 = "hackplayer"; + playerct = 1; + players = &player0; +#endif PERS_IS_UID + } else { + playerct = --argc; + players = ++argv; + } + if(outflg) putchar('\n'); + + t1 = tt_head = newttentry(); + for(rank = 1; ; rank++) { + if(fscanf(rfile, "%6s %d %d %d %d %d %ld %c%c %[^,],%[^\n]", + t1->date, &t1->uid, + &t1->level, &t1->maxlvl, + &t1->hp, &t1->maxhp, &t1->points, + &t1->plchar, &t1->sex, t1->name, t1->death) != 11) + t1->points = 0; + if(t1->points == 0) break; +#ifdef PERS_IS_UID + if(!playerct && t1->uid == uid) + flg++; + else +#endif PERS_IS_UID + for(i = 0; i < playerct; i++){ + if(strcmp(players[i], "all") == 0 || + strncmp(t1->name, players[i], NAMSZ) == 0 || + (players[i][0] == '-' && + players[i][1] == t1->plchar && + players[i][2] == 0) || + (digit(players[i][0]) && rank <= atoi(players[i]))) + flg++; + } + t1 = t1->tt_next = newttentry(); + } + (void) fclose(rfile); + if(!flg) { + if(outflg) { + printf("Cannot find any entries for "); + if(playerct < 1) printf("you.\n"); + else { + if(playerct > 1) printf("any of "); + for(i=0; ipoints != 0; rank++, t1 = t2) { + t2 = t1->tt_next; +#ifdef PERS_IS_UID + if(!playerct && t1->uid == uid) + goto outwithit; + else +#endif PERS_IS_UID + for(i = 0; i < playerct; i++){ + if(strcmp(players[i], "all") == 0 || + strncmp(t1->name, players[i], NAMSZ) == 0 || + (players[i][0] == '-' && + players[i][1] == t1->plchar && + players[i][2] == 0) || + (digit(players[i][0]) && rank <= atoi(players[i]))){ + outwithit: + if(outflg) + (void) outentry(rank, t1, 0); +#ifdef nonsense + total_score += t1->points; + if(totcharct < sizeof(totchars)-1) + totchars[totcharct++] = t1->plchar; +#endif nonsense + break; + } + } + free((char *) t1); + } +#ifdef nonsense + totchars[totcharct] = 0; + + /* We would like to determine whether he is experienced. However, + the information collected here only tells about the scores/roles + that got into the topten (top 100?). We should maintain a + .hacklog or something in his home directory. */ + flags.beginner = (total_score < 6000); + for(i=0; i<6; i++) + if(!index(totchars, "CFKSTWX"[i])) { + flags.beginner = 1; + if(!pl_character[0]) pl_character[0] = "CFKSTWX"[i]; + break; + } +#endif nonsense +} diff --git a/games/hack/hack.engrave.c b/games/hack/hack.engrave.c new file mode 100644 index 0000000..09284bf --- /dev/null +++ b/games/hack/hack.engrave.c @@ -0,0 +1,306 @@ +/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ +/* hack.engrave.c - version 1.0.3 */ + +#include "hack.h" + +extern char *nomovemsg; +extern char nul[]; +extern struct obj zeroobj; +struct engr { + struct engr *nxt_engr; + char *engr_txt; + xchar engr_x, engr_y; + unsigned engr_lth; /* for save & restore; not length of text */ + long engr_time; /* moment engraving was (will be) finished */ + xchar engr_type; +#define DUST 1 +#define ENGRAVE 2 +#define BURN 3 +} *head_engr; + +struct engr * +engr_at(x,y) register xchar x,y; { +register struct engr *ep = head_engr; + while(ep) { + if(x == ep->engr_x && y == ep->engr_y) + return(ep); + ep = ep->nxt_engr; + } + return((struct engr *) 0); +} + +sengr_at(s,x,y) register char *s; register xchar x,y; { +register struct engr *ep = engr_at(x,y); +register char *t; +register int n; + if(ep && ep->engr_time <= moves) { + t = ep->engr_txt; +/* + if(!strcmp(s,t)) return(1); +*/ + n = strlen(s); + while(*t) { + if(!strncmp(s,t,n)) return(1); + t++; + } + } + return(0); +} + +u_wipe_engr(cnt) +register int cnt; +{ + if(!u.uswallow && !Levitation) + wipe_engr_at(u.ux, u.uy, cnt); +} + +wipe_engr_at(x,y,cnt) register xchar x,y,cnt; { +register struct engr *ep = engr_at(x,y); +register int lth,pos; +char ch; + if(ep){ + if(ep->engr_type != DUST) { + cnt = rn2(1 + 50/(cnt+1)) ? 0 : 1; + } + lth = strlen(ep->engr_txt); + if(lth && cnt > 0 ) { + while(cnt--) { + pos = rn2(lth); + if((ch = ep->engr_txt[pos]) == ' ') + continue; + ep->engr_txt[pos] = (ch != '?') ? '?' : ' '; + } + } + while(lth && ep->engr_txt[lth-1] == ' ') + ep->engr_txt[--lth] = 0; + while(ep->engr_txt[0] == ' ') + ep->engr_txt++; + if(!ep->engr_txt[0]) del_engr(ep); + } +} + +read_engr_at(x,y) register int x,y; { +register struct engr *ep = engr_at(x,y); + if(ep && ep->engr_txt[0]) { + switch(ep->engr_type) { + case DUST: + pline("Something is written here in the dust."); + break; + case ENGRAVE: + pline("Something is engraved here on the floor."); + break; + case BURN: + pline("Some text has been burned here in the floor."); + break; + default: + impossible("Something is written in a very strange way."); + } + pline("You read: \"%s\".", ep->engr_txt); + } +} + +make_engr_at(x,y,s) +register int x,y; +register char *s; +{ + register struct engr *ep; + + if(ep = engr_at(x,y)) + del_engr(ep); + ep = (struct engr *) + alloc((unsigned)(sizeof(struct engr) + strlen(s) + 1)); + ep->nxt_engr = head_engr; + head_engr = ep; + ep->engr_x = x; + ep->engr_y = y; + ep->engr_txt = (char *)(ep + 1); + (void) strcpy(ep->engr_txt, s); + ep->engr_time = 0; + ep->engr_type = DUST; + ep->engr_lth = strlen(s) + 1; +} + +doengrave(){ +register int len; +register char *sp; +register struct engr *ep, *oep = engr_at(u.ux,u.uy); +char buf[BUFSZ]; +xchar type; +int spct; /* number of leading spaces */ +register struct obj *otmp; + multi = 0; + + if(u.uswallow) { + pline("You're joking. Hahaha!"); /* riv05!a3 */ + return(0); + } + + /* one may write with finger, weapon or wand */ + otmp = getobj("#-)/", "write with"); + if(!otmp) return(0); + + if(otmp == &zeroobj) + otmp = (char *)0; + if(otmp && otmp->otyp == WAN_FIRE && otmp->spe) { + type = BURN; + otmp->spe--; + } else { + /* first wield otmp */ + if(otmp != uwep) { + if(uwep && uwep->cursed) { + /* Andreas Bormann */ + pline("Since your weapon is welded to your hand,"); + pline("you use the %s.", aobjnam(uwep, (char *) 0)); + otmp = uwep; + } else { + if(!otmp) + pline("You are now empty-handed."); + else if(otmp->cursed) + pline("The %s %s to your hand!", + aobjnam(otmp, "weld"), + (otmp->quan == 1) ? "itself" : "themselves"); + else + pline("You now wield %s.", doname(otmp)); + setuwep(otmp); + } + } + + if(!otmp) + type = DUST; + else + if(otmp->otyp == DAGGER || otmp->otyp == TWO_HANDED_SWORD || + otmp->otyp == CRYSKNIFE || + otmp->otyp == LONG_SWORD || otmp->otyp == AXE) { + type = ENGRAVE; + if((int)otmp->spe <= -3) { + type = DUST; + pline("Your %s too dull for engraving.", + aobjnam(otmp, "are")); + if(oep && oep->engr_type != DUST) return(1); + } + } else type = DUST; + } + if(Levitation && type != BURN){ /* riv05!a3 */ + pline("You can't reach the floor!"); + return(1); + } + if(oep && oep->engr_type == DUST){ + pline("You wipe out the message that was written here."); + del_engr(oep); + oep = 0; + } + if(type == DUST && oep){ + pline("You cannot wipe out the message that is %s in the rock.", + (oep->engr_type == BURN) ? "burned" : "engraved"); + return(1); + } + + pline("What do you want to %s on the floor here? ", + (type == ENGRAVE) ? "engrave" : (type == BURN) ? "burn" : "write"); + getlin(buf); + clrlin(); + spct = 0; + sp = buf; + while(*sp == ' ') spct++, sp++; + len = strlen(sp); + if(!len || *buf == '\033') { + if(type == BURN) otmp->spe++; + return(0); + } + + switch(type) { + case DUST: + case BURN: + if(len > 15) { + multi = -(len/10); + nomovemsg = "You finished writing."; + } + break; + case ENGRAVE: /* here otmp != 0 */ + { int len2 = (otmp->spe + 3) * 2 + 1; + + pline("Your %s dull.", aobjnam(otmp, "get")); + if(len2 < len) { + len = len2; + sp[len] = 0; + otmp->spe = -3; + nomovemsg = "You cannot engrave more."; + } else { + otmp->spe -= len/2; + nomovemsg = "You finished engraving."; + } + multi = -len; + } + break; + } + if(oep) len += strlen(oep->engr_txt) + spct; + ep = (struct engr *) alloc((unsigned)(sizeof(struct engr) + len + 1)); + ep->nxt_engr = head_engr; + head_engr = ep; + ep->engr_x = u.ux; + ep->engr_y = u.uy; + sp = (char *)(ep + 1); /* (char *)ep + sizeof(struct engr) */ + ep->engr_txt = sp; + if(oep) { + (void) strcpy(sp, oep->engr_txt); + (void) strcat(sp, buf); + del_engr(oep); + } else + (void) strcpy(sp, buf); + ep->engr_lth = len+1; + ep->engr_type = type; + ep->engr_time = moves-multi; + + /* kludge to protect pline against excessively long texts */ + if(len > BUFSZ-20) sp[BUFSZ-20] = 0; + + return(1); +} + +save_engravings(fd) int fd; { +register struct engr *ep = head_engr; + while(ep) { + if(!ep->engr_lth || !ep->engr_txt[0]){ + ep = ep->nxt_engr; + continue; + } + bwrite(fd, (char *) & (ep->engr_lth), sizeof(ep->engr_lth)); + bwrite(fd, (char *) ep, sizeof(struct engr) + ep->engr_lth); + ep = ep->nxt_engr; + } + bwrite(fd, (char *) nul, sizeof(unsigned)); + head_engr = 0; +} + +rest_engravings(fd) int fd; { +register struct engr *ep; +unsigned lth; + head_engr = 0; + while(1) { + mread(fd, (char *) <h, sizeof(unsigned)); + if(lth == 0) return; + ep = (struct engr *) alloc(sizeof(struct engr) + lth); + mread(fd, (char *) ep, sizeof(struct engr) + lth); + ep->nxt_engr = head_engr; + ep->engr_txt = (char *) (ep + 1); /* Andreas Bormann */ + head_engr = ep; + } +} + +del_engr(ep) register struct engr *ep; { +register struct engr *ept; + if(ep == head_engr) + head_engr = ep->nxt_engr; + else { + for(ept = head_engr; ept; ept = ept->nxt_engr) { + if(ept->nxt_engr == ep) { + ept->nxt_engr = ep->nxt_engr; + goto fnd; + } + } + impossible("Error in del_engr?"); + return; + fnd: ; + } + free((char *) ep); +} diff --git a/games/hack/hack.fight.c b/games/hack/hack.fight.c new file mode 100644 index 0000000..ede886d --- /dev/null +++ b/games/hack/hack.fight.c @@ -0,0 +1,358 @@ +/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ +/* hack.fight.c - version 1.0.3 */ + +#include "hack.h" +extern struct permonst li_dog, dog, la_dog; +extern char *exclam(), *xname(); +extern struct obj *mkobj_at(); + +static boolean far_noise; +static long noisetime; + +/* hitmm returns 0 (miss), 1 (hit), or 2 (kill) */ +hitmm(magr,mdef) register struct monst *magr,*mdef; { +register struct permonst *pa = magr->data, *pd = mdef->data; +int hit; +schar tmp; +boolean vis; + if(index("Eauy", pa->mlet)) return(0); + if(magr->mfroz) return(0); /* riv05!a3 */ + tmp = pd->ac + pa->mlevel; + if(mdef->mconf || mdef->mfroz || mdef->msleep){ + tmp += 4; + if(mdef->msleep) mdef->msleep = 0; + } + hit = (tmp > rnd(20)); + if(hit) mdef->msleep = 0; + vis = (cansee(magr->mx,magr->my) && cansee(mdef->mx,mdef->my)); + if(vis){ + char buf[BUFSZ]; + if(mdef->mimic) seemimic(mdef); + if(magr->mimic) seemimic(magr); + (void) sprintf(buf,"%s %s", Monnam(magr), + hit ? "hits" : "misses"); + pline("%s %s.", buf, monnam(mdef)); + } else { + boolean far = (dist(magr->mx, magr->my) > 15); + if(far != far_noise || moves-noisetime > 10) { + far_noise = far; + noisetime = moves; + pline("You hear some noises%s.", + far ? " in the distance" : ""); + } + } + if(hit){ + if(magr->data->mlet == 'c' && !magr->cham) { + magr->mhpmax += 3; + if(vis) pline("%s is turned to stone!", Monnam(mdef)); + else if(mdef->mtame) + pline("You have a peculiarly sad feeling for a moment, then it passes."); + monstone(mdef); + hit = 2; + } else + if((mdef->mhp -= d(pa->damn,pa->damd)) < 1) { + magr->mhpmax += 1 + rn2(pd->mlevel+1); + if(magr->mtame && magr->mhpmax > 8*pa->mlevel){ + if(pa == &li_dog) magr->data = pa = &dog; + else if(pa == &dog) magr->data = pa = &la_dog; + } + if(vis) pline("%s is killed!", Monnam(mdef)); + else if(mdef->mtame) + pline("You have a sad feeling for a moment, then it passes."); + mondied(mdef); + hit = 2; + } + } + return(hit); +} + +/* drop (perhaps) a cadaver and remove monster */ +mondied(mdef) register struct monst *mdef; { +register struct permonst *pd = mdef->data; + if(letter(pd->mlet) && rn2(3)){ + (void) mkobj_at(pd->mlet,mdef->mx,mdef->my); + if(cansee(mdef->mx,mdef->my)){ + unpmon(mdef); + atl(mdef->mx,mdef->my,fobj->olet); + } + stackobj(fobj); + } + mondead(mdef); +} + +/* drop a rock and remove monster */ +monstone(mdef) register struct monst *mdef; { + extern char mlarge[]; + if(index(mlarge, mdef->data->mlet)) + mksobj_at(ENORMOUS_ROCK, mdef->mx, mdef->my); + else + mksobj_at(ROCK, mdef->mx, mdef->my); + if(cansee(mdef->mx, mdef->my)){ + unpmon(mdef); + atl(mdef->mx,mdef->my,fobj->olet); + } + mondead(mdef); +} + + +fightm(mtmp) register struct monst *mtmp; { +register struct monst *mon; + for(mon = fmon; mon; mon = mon->nmon) if(mon != mtmp) { + if(DIST(mon->mx,mon->my,mtmp->mx,mtmp->my) < 3) + if(rn2(4)) + return(hitmm(mtmp,mon)); + } + return(-1); +} + +/* u is hit by sth, but not a monster */ +thitu(tlev,dam,name) +register tlev,dam; +register char *name; +{ +char buf[BUFSZ]; + setan(name,buf); + if(u.uac + tlev <= rnd(20)) { + if(Blind) pline("It misses."); + else pline("You are almost hit by %s!", buf); + return(0); + } else { + if(Blind) pline("You are hit!"); + else pline("You are hit by %s!", buf); + losehp(dam,name); + return(1); + } +} + +char mlarge[] = "bCDdegIlmnoPSsTUwY',&"; + +boolean +hmon(mon,obj,thrown) /* return TRUE if mon still alive */ +register struct monst *mon; +register struct obj *obj; +register thrown; +{ + register tmp; + boolean hittxt = FALSE; + + if(!obj){ + tmp = rnd(2); /* attack with bare hands */ + if(mon->data->mlet == 'c' && !uarmg){ + pline("You hit the cockatrice with your bare hands."); + pline("You turn to stone ..."); + done_in_by(mon); + } + } else if(obj->olet == WEAPON_SYM || obj->otyp == PICK_AXE) { + if(obj == uwep && (obj->otyp > SPEAR || obj->otyp < BOOMERANG)) + tmp = rnd(2); + else { + if(index(mlarge, mon->data->mlet)) { + tmp = rnd(objects[obj->otyp].wldam); + if(obj->otyp == TWO_HANDED_SWORD) tmp += d(2,6); + else if(obj->otyp == FLAIL) tmp += rnd(4); + } else { + tmp = rnd(objects[obj->otyp].wsdam); + } + tmp += obj->spe; + if(!thrown && obj == uwep && obj->otyp == BOOMERANG + && !rn2(3)){ + pline("As you hit %s, the boomerang breaks into splinters.", + monnam(mon)); + freeinv(obj); + setworn((struct obj *) 0, obj->owornmask); + obfree(obj, (struct obj *) 0); + tmp++; + } + } + if(mon->data->mlet == 'O' && obj->otyp == TWO_HANDED_SWORD && + !strcmp(ONAME(obj), "Orcrist")) + tmp += rnd(10); + } else switch(obj->otyp) { + case HEAVY_IRON_BALL: + tmp = rnd(25); break; + case EXPENSIVE_CAMERA: + pline("You succeed in destroying your camera. Congratulations!"); + freeinv(obj); + if(obj->owornmask) + setworn((struct obj *) 0, obj->owornmask); + obfree(obj, (struct obj *) 0); + return(TRUE); + case DEAD_COCKATRICE: + pline("You hit %s with the cockatrice corpse.", + monnam(mon)); + if(mon->data->mlet == 'c') { + tmp = 1; + hittxt = TRUE; + break; + } + pline("%s is turned to stone!", Monnam(mon)); + killed(mon); + return(FALSE); + case CLOVE_OF_GARLIC: /* no effect against demons */ + if(index(UNDEAD, mon->data->mlet)) + mon->mflee = 1; + tmp = 1; + break; + default: + /* non-weapons can damage because of their weight */ + /* (but not too much) */ + tmp = obj->owt/10; + if(tmp < 1) tmp = 1; + else tmp = rnd(tmp); + if(tmp > 6) tmp = 6; + } + + /****** NOTE: perhaps obj is undefined!! (if !thrown && BOOMERANG) */ + + tmp += u.udaminc + dbon(); + if(u.uswallow) { + if((tmp -= u.uswldtim) <= 0) { + pline("Your arms are no longer able to hit."); + return(TRUE); + } + } + if(tmp < 1) tmp = 1; + mon->mhp -= tmp; + if(mon->mhp < 1) { + killed(mon); + return(FALSE); + } + if(mon->mtame && (!mon->mflee || mon->mfleetim)) { + mon->mflee = 1; /* Rick Richardson */ + mon->mfleetim += 10*rnd(tmp); + } + + if(!hittxt) { + if(thrown) + /* this assumes that we cannot throw plural things */ + hit( xname(obj) /* or: objects[obj->otyp].oc_name */, + mon, exclam(tmp) ); + else if(Blind) + pline("You hit it."); + else + pline("You hit %s%s", monnam(mon), exclam(tmp)); + } + + if(u.umconf && !thrown) { + if(!Blind) { + pline("Your hands stop glowing blue."); + if(!mon->mfroz && !mon->msleep) + pline("%s appears confused.",Monnam(mon)); + } + mon->mconf = 1; + u.umconf = 0; + } + return(TRUE); /* mon still alive */ +} + +/* try to attack; return FALSE if monster evaded */ +/* u.dx and u.dy must be set */ +attack(mtmp) +register struct monst *mtmp; +{ + schar tmp; + boolean malive = TRUE; + register struct permonst *mdat; + mdat = mtmp->data; + + u_wipe_engr(3); /* andrew@orca: prevent unlimited pick-axe attacks */ + + if(mdat->mlet == 'L' && !mtmp->mfroz && !mtmp->msleep && + !mtmp->mconf && mtmp->mcansee && !rn2(7) && + (m_move(mtmp, 0) == 2 /* he died */ || /* he moved: */ + mtmp->mx != u.ux+u.dx || mtmp->my != u.uy+u.dy)) + return(FALSE); + + if(mtmp->mimic){ + if(!u.ustuck && !mtmp->mflee) u.ustuck = mtmp; + switch(levl[u.ux+u.dx][u.uy+u.dy].scrsym){ + case '+': + pline("The door actually was a Mimic."); + break; + case '$': + pline("The chest was a Mimic!"); + break; + default: + pline("Wait! That's a Mimic!"); + } + wakeup(mtmp); /* clears mtmp->mimic */ + return(TRUE); + } + + wakeup(mtmp); + + if(mtmp->mhide && mtmp->mundetected){ + register struct obj *obj; + + mtmp->mundetected = 0; + if((obj = o_at(mtmp->mx,mtmp->my)) && !Blind) + pline("Wait! There's a %s hiding under %s!", + mdat->mname, doname(obj)); + return(TRUE); + } + + tmp = u.uluck + u.ulevel + mdat->ac + abon(); + if(uwep) { + if(uwep->olet == WEAPON_SYM || uwep->otyp == PICK_AXE) + tmp += uwep->spe; + if(uwep->otyp == TWO_HANDED_SWORD) tmp -= 1; + else if(uwep->otyp == DAGGER) tmp += 2; + else if(uwep->otyp == CRYSKNIFE) tmp += 3; + else if(uwep->otyp == SPEAR && + index("XDne", mdat->mlet)) tmp += 2; + } + if(mtmp->msleep) { + mtmp->msleep = 0; + tmp += 2; + } + if(mtmp->mfroz) { + tmp += 4; + if(!rn2(10)) mtmp->mfroz = 0; + } + if(mtmp->mflee) tmp += 2; + if(u.utrap) tmp -= 3; + + /* with a lot of luggage, your agility diminishes */ + tmp -= (inv_weight() + 40)/20; + + if(tmp <= rnd(20) && !u.uswallow){ + if(Blind) pline("You miss it."); + else pline("You miss %s.",monnam(mtmp)); + } else { + /* we hit the monster; be careful: it might die! */ + + if((malive = hmon(mtmp,uwep,0)) == TRUE) { + /* monster still alive */ + if(!rn2(25) && mtmp->mhp < mtmp->mhpmax/2) { + mtmp->mflee = 1; + if(!rn2(3)) mtmp->mfleetim = rnd(100); + if(u.ustuck == mtmp && !u.uswallow) + u.ustuck = 0; + } +#ifndef NOWORM + if(mtmp->wormno) + cutworm(mtmp, u.ux+u.dx, u.uy+u.dy, + uwep ? uwep->otyp : 0); +#endif NOWORM + } + if(mdat->mlet == 'a') { + if(rn2(2)) { + pline("You are splashed by the blob's acid!"); + losehp_m(rnd(6), mtmp); + if(!rn2(30)) corrode_armor(); + } + if(!rn2(6)) corrode_weapon(); + } + } + if(malive && mdat->mlet == 'E' && canseemon(mtmp) + && !mtmp->mcan && rn2(3)) { + if(mtmp->mcansee) { + pline("You are frozen by the floating eye's gaze!"); + nomul((u.ulevel > 6 || rn2(4)) ? rn1(20,-21) : -200); + } else { + pline("The blinded floating eye cannot defend itself."); + if(!rn2(500)) if((int)u.uluck > LUCKMIN) u.uluck--; + } + } + return(TRUE); +} diff --git a/games/hack/hack.h b/games/hack/hack.h new file mode 100644 index 0000000..b613de8 --- /dev/null +++ b/games/hack/hack.h @@ -0,0 +1,163 @@ +/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ +/* hack.h - version 1.0.3 */ + +#include "config.h" + +#ifdef BSD +#include /* declarations for strcat etc. */ +#else +#include /* idem on System V */ +#define index strchr +#define rindex strrchr +#endif BSD + +#define Null(type) ((struct type *) 0) + +#include "def.objclass.h" + +typedef struct { + xchar x,y; +} coord; + +#include "def.monst.h" /* uses coord */ +#include "def.gold.h" +#include "def.trap.h" +#include "def.obj.h" +#include "def.flag.h" + +extern char *sprintf(); +#define plur(x) (((x) == 1) ? "" : "s") + +#define BUFSZ 256 /* for getlin buffers */ +#define PL_NSIZ 32 /* name of player, ghost, shopkeeper */ + +#include "def.rm.h" +#include "def.permonst.h" + +extern long *alloc(); + +extern xchar xdnstair, ydnstair, xupstair, yupstair; /* stairs up and down. */ + +extern xchar dlevel; +#define newstring(x) (char *) alloc((unsigned)(x)) +#include "hack.onames.h" + +#define ON 1 +#define OFF 0 + +extern struct obj *invent, *uwep, *uarm, *uarm2, *uarmh, *uarms, *uarmg, + *uleft, *uright, *fcobj; +extern struct obj *uchain; /* defined iff PUNISHED */ +extern struct obj *uball; /* defined if PUNISHED */ +struct obj *o_at(), *getobj(), *sobj_at(); + +struct prop { +#define TIMEOUT 007777 /* mask */ +#define LEFT_RING W_RINGL /* 010000L */ +#define RIGHT_RING W_RINGR /* 020000L */ +#define INTRINSIC 040000L +#define LEFT_SIDE LEFT_RING +#define RIGHT_SIDE RIGHT_RING +#define BOTH_SIDES (LEFT_SIDE | RIGHT_SIDE) + long p_flgs; + int (*p_tofn)(); /* called after timeout */ +}; + +struct you { + xchar ux, uy; + schar dx, dy, dz; /* direction of move (or zap or ... ) */ +#ifdef QUEST + schar di; /* direction of FF */ + xchar ux0, uy0; /* initial position FF */ +#endif QUEST + xchar udisx, udisy; /* last display pos */ + char usym; /* usually '@' */ + schar uluck; +#define LUCKMAX 10 /* on moonlit nights 11 */ +#define LUCKMIN (-10) + int last_str_turn:3; /* 0: none, 1: half turn, 2: full turn */ + /* +: turn right, -: turn left */ + unsigned udispl:1; /* @ on display */ + unsigned ulevel:4; /* 1 - 14 */ +#ifdef QUEST + unsigned uhorizon:7; +#endif QUEST + unsigned utrap:3; /* trap timeout */ + unsigned utraptype:1; /* defined if utrap nonzero */ +#define TT_BEARTRAP 0 +#define TT_PIT 1 + unsigned uinshop:6; /* used only in shk.c - (roomno+1) of shop */ + + +/* perhaps these #define's should also be generated by makedefs */ +#define TELEPAT LAST_RING /* not a ring */ +#define Telepat u.uprops[TELEPAT].p_flgs +#define FAST (LAST_RING+1) /* not a ring */ +#define Fast u.uprops[FAST].p_flgs +#define CONFUSION (LAST_RING+2) /* not a ring */ +#define Confusion u.uprops[CONFUSION].p_flgs +#define INVIS (LAST_RING+3) /* not a ring */ +#define Invis u.uprops[INVIS].p_flgs +#define Invisible (Invis && !See_invisible) +#define GLIB (LAST_RING+4) /* not a ring */ +#define Glib u.uprops[GLIB].p_flgs +#define PUNISHED (LAST_RING+5) /* not a ring */ +#define Punished u.uprops[PUNISHED].p_flgs +#define SICK (LAST_RING+6) /* not a ring */ +#define Sick u.uprops[SICK].p_flgs +#define BLIND (LAST_RING+7) /* not a ring */ +#define Blind u.uprops[BLIND].p_flgs +#define WOUNDED_LEGS (LAST_RING+8) /* not a ring */ +#define Wounded_legs u.uprops[WOUNDED_LEGS].p_flgs +#define STONED (LAST_RING+9) /* not a ring */ +#define Stoned u.uprops[STONED].p_flgs +#define PROP(x) (x-RIN_ADORNMENT) /* convert ring to index in uprops */ + unsigned umconf:1; + char *usick_cause; + struct prop uprops[LAST_RING+10]; + + unsigned uswallow:1; /* set if swallowed by a monster */ + unsigned uswldtim:4; /* time you have been swallowed */ + unsigned uhs:3; /* hunger state - see hack.eat.c */ + schar ustr,ustrmax; + schar udaminc; + schar uac; + int uhp,uhpmax; + long int ugold,ugold0,uexp,urexp; + int uhunger; /* refd only in eat.c and shk.c */ + int uinvault; + struct monst *ustuck; + int nr_killed[CMNUM+2]; /* used for experience bookkeeping */ +}; + +extern struct you u; + +extern char *traps[]; +extern char *monnam(), *Monnam(), *amonnam(), *Amonnam(), + *doname(), *aobjnam(); +extern char readchar(); +extern char vowels[]; + +extern xchar curx,cury; /* cursor location on screen */ + +extern coord bhitpos; /* place where thrown weapon falls to the ground */ + +extern xchar seehx,seelx,seehy,seely; /* where to see*/ +extern char *save_cm,*killer; + +extern xchar dlevel, maxdlevel; /* dungeon level */ + +extern long moves; + +extern int multi; + + +extern char lock[]; + + +#define DIST(x1,y1,x2,y2) (((x1)-(x2))*((x1)-(x2)) + ((y1)-(y2))*((y1)-(y2))) + +#define PL_CSIZ 20 /* sizeof pl_character */ +#define MAX_CARR_CAP 120 /* so that boulders can be heavier */ +#define MAXLEVEL 40 +#define FAR (COLNO+2) /* position outside screen */ diff --git a/games/hack/hack.invent.c b/games/hack/hack.invent.c new file mode 100644 index 0000000..f10bffe --- /dev/null +++ b/games/hack/hack.invent.c @@ -0,0 +1,860 @@ +/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ +/* hack.invent.c - version 1.0.3 */ + +#include "hack.h" +#include +extern struct obj *splitobj(); +extern struct obj zeroobj; +extern char morc; +extern char quitchars[]; +char *xprname(); + +#ifndef NOWORM +#include "def.wseg.h" +extern struct wseg *wsegs[32]; +#endif NOWORM + +#define NOINVSYM '#' + +static int lastinvnr = 51; /* 0 ... 51 */ +static +assigninvlet(otmp) +register struct obj *otmp; +{ + boolean inuse[52]; + register int i; + register struct obj *obj; + + for(i = 0; i < 52; i++) inuse[i] = FALSE; + for(obj = invent; obj; obj = obj->nobj) if(obj != otmp) { + i = obj->invlet; + if('a' <= i && i <= 'z') inuse[i - 'a'] = TRUE; else + if('A' <= i && i <= 'Z') inuse[i - 'A' + 26] = TRUE; + if(i == otmp->invlet) otmp->invlet = 0; + } + if((i = otmp->invlet) && + (('a' <= i && i <= 'z') || ('A' <= i && i <= 'Z'))) + return; + for(i = lastinvnr+1; i != lastinvnr; i++) { + if(i == 52) { i = -1; continue; } + if(!inuse[i]) break; + } + otmp->invlet = (inuse[i] ? NOINVSYM : + (i < 26) ? ('a'+i) : ('A'+i-26)); + lastinvnr = i; +} + +struct obj * +addinv(obj) +register struct obj *obj; +{ + register struct obj *otmp; + + /* merge or attach to end of chain */ + if(!invent) { + invent = obj; + otmp = 0; + } else + for(otmp = invent; /* otmp */; otmp = otmp->nobj) { + if(merged(otmp, obj, 0)) + return(otmp); + if(!otmp->nobj) { + otmp->nobj = obj; + break; + } + } + obj->nobj = 0; + + if(flags.invlet_constant) { + assigninvlet(obj); + /* + * The ordering of the chain is nowhere significant + * so in case you prefer some other order than the + * historical one, change the code below. + */ + if(otmp) { /* find proper place in chain */ + otmp->nobj = 0; + if((invent->invlet ^ 040) > (obj->invlet ^ 040)) { + obj->nobj = invent; + invent = obj; + } else + for(otmp = invent; ; otmp = otmp->nobj) { + if(!otmp->nobj || + (otmp->nobj->invlet ^ 040) > (obj->invlet ^ 040)){ + obj->nobj = otmp->nobj; + otmp->nobj = obj; + break; + } + } + } + } + + return(obj); +} + +useup(obj) +register struct obj *obj; +{ + if(obj->quan > 1){ + obj->quan--; + obj->owt = weight(obj); + } else { + setnotworn(obj); + freeinv(obj); + obfree(obj, (struct obj *) 0); + } +} + +freeinv(obj) +register struct obj *obj; +{ + register struct obj *otmp; + + if(obj == invent) + invent = invent->nobj; + else { + for(otmp = invent; otmp->nobj != obj; otmp = otmp->nobj) + if(!otmp->nobj) panic("freeinv"); + otmp->nobj = obj->nobj; + } +} + +/* destroy object in fobj chain (if unpaid, it remains on the bill) */ +delobj(obj) register struct obj *obj; { + freeobj(obj); + unpobj(obj); + obfree(obj, (struct obj *) 0); +} + +/* unlink obj from chain starting with fobj */ +freeobj(obj) register struct obj *obj; { + register struct obj *otmp; + + if(obj == fobj) fobj = fobj->nobj; + else { + for(otmp = fobj; otmp->nobj != obj; otmp = otmp->nobj) + if(!otmp) panic("error in freeobj"); + otmp->nobj = obj->nobj; + } +} + +/* Note: freegold throws away its argument! */ +freegold(gold) register struct gold *gold; { + register struct gold *gtmp; + + if(gold == fgold) fgold = gold->ngold; + else { + for(gtmp = fgold; gtmp->ngold != gold; gtmp = gtmp->ngold) + if(!gtmp) panic("error in freegold"); + gtmp->ngold = gold->ngold; + } + free((char *) gold); +} + +deltrap(trap) +register struct trap *trap; +{ + register struct trap *ttmp; + + if(trap == ftrap) + ftrap = ftrap->ntrap; + else { + for(ttmp = ftrap; ttmp->ntrap != trap; ttmp = ttmp->ntrap) ; + ttmp->ntrap = trap->ntrap; + } + free((char *) trap); +} + +struct wseg *m_atseg; + +struct monst * +m_at(x,y) +register x,y; +{ + register struct monst *mtmp; +#ifndef NOWORM + register struct wseg *wtmp; +#endif NOWORM + + m_atseg = 0; + for(mtmp = fmon; mtmp; mtmp = mtmp->nmon){ + if(mtmp->mx == x && mtmp->my == y) + return(mtmp); +#ifndef NOWORM + if(mtmp->wormno){ + for(wtmp = wsegs[mtmp->wormno]; wtmp; wtmp = wtmp->nseg) + if(wtmp->wx == x && wtmp->wy == y){ + m_atseg = wtmp; + return(mtmp); + } + } +#endif NOWORM + } + return(0); +} + +struct obj * +o_at(x,y) +register x,y; +{ + register struct obj *otmp; + + for(otmp = fobj; otmp; otmp = otmp->nobj) + if(otmp->ox == x && otmp->oy == y) return(otmp); + return(0); +} + +struct obj * +sobj_at(n,x,y) +register n,x,y; +{ + register struct obj *otmp; + + for(otmp = fobj; otmp; otmp = otmp->nobj) + if(otmp->ox == x && otmp->oy == y && otmp->otyp == n) + return(otmp); + return(0); +} + +carried(obj) register struct obj *obj; { +register struct obj *otmp; + for(otmp = invent; otmp; otmp = otmp->nobj) + if(otmp == obj) return(1); + return(0); +} + +carrying(type) +register int type; +{ + register struct obj *otmp; + + for(otmp = invent; otmp; otmp = otmp->nobj) + if(otmp->otyp == type) + return(TRUE); + return(FALSE); +} + +struct obj * +o_on(id, objchn) unsigned int id; register struct obj *objchn; { + while(objchn) { + if(objchn->o_id == id) return(objchn); + objchn = objchn->nobj; + } + return((struct obj *) 0); +} + +struct trap * +t_at(x,y) +register x,y; +{ + register struct trap *trap = ftrap; + while(trap) { + if(trap->tx == x && trap->ty == y) return(trap); + trap = trap->ntrap; + } + return(0); +} + +struct gold * +g_at(x,y) +register x,y; +{ + register struct gold *gold = fgold; + while(gold) { + if(gold->gx == x && gold->gy == y) return(gold); + gold = gold->ngold; + } + return(0); +} + +/* make dummy object structure containing gold - for temporary use only */ +struct obj * +mkgoldobj(q) +register long q; +{ + register struct obj *otmp; + + otmp = newobj(0); + /* should set o_id etc. but otmp will be freed soon */ + otmp->olet = '$'; + u.ugold -= q; + OGOLD(otmp) = q; + flags.botl = 1; + return(otmp); +} + +/* + * getobj returns: + * struct obj *xxx: object to do something with. + * (struct obj *) 0 error return: no object. + * &zeroobj explicitly no object (as in w-). + */ +struct obj * +getobj(let,word) +register char *let,*word; +{ + register struct obj *otmp; + register char ilet,ilet1,ilet2; + char buf[BUFSZ]; + char lets[BUFSZ]; + register int foo = 0, foo2; + register char *bp = buf; + xchar allowcnt = 0; /* 0, 1 or 2 */ + boolean allowgold = FALSE; + boolean allowall = FALSE; + boolean allownone = FALSE; + xchar foox = 0; + long cnt; + + if(*let == '0') let++, allowcnt = 1; + if(*let == '$') let++, allowgold = TRUE; + if(*let == '#') let++, allowall = TRUE; + if(*let == '-') let++, allownone = TRUE; + if(allownone) *bp++ = '-'; + if(allowgold) *bp++ = '$'; + if(bp > buf && bp[-1] == '-') *bp++ = ' '; + + ilet = 'a'; + for(otmp = invent; otmp; otmp = otmp->nobj){ + if(!*let || index(let, otmp->olet)) { + bp[foo++] = flags.invlet_constant ? otmp->invlet : ilet; + + /* ugly check: remove inappropriate things */ + if((!strcmp(word, "take off") && + !(otmp->owornmask & (W_ARMOR - W_ARM2))) + || (!strcmp(word, "wear") && + (otmp->owornmask & (W_ARMOR | W_RING))) + || (!strcmp(word, "wield") && + (otmp->owornmask & W_WEP))) { + foo--; + foox++; + } + } + if(ilet == 'z') ilet = 'A'; else ilet++; + } + bp[foo] = 0; + if(foo == 0 && bp > buf && bp[-1] == ' ') *--bp = 0; + (void) strcpy(lets, bp); /* necessary since we destroy buf */ + if(foo > 5) { /* compactify string */ + foo = foo2 = 1; + ilet2 = bp[0]; + ilet1 = bp[1]; + while(ilet = bp[++foo2] = bp[++foo]){ + if(ilet == ilet1+1){ + if(ilet1 == ilet2+1) + bp[foo2 - 1] = ilet1 = '-'; + else if(ilet2 == '-') { + bp[--foo2] = ++ilet1; + continue; + } + } + ilet2 = ilet1; + ilet1 = ilet; + } + } + if(!foo && !allowall && !allowgold && !allownone) { + pline("You don't have anything %sto %s.", + foox ? "else " : "", word); + return(0); + } + for(;;) { + if(!buf[0]) + pline("What do you want to %s [*]? ", word); + else + pline("What do you want to %s [%s or ?*]? ", + word, buf); + + cnt = 0; + ilet = readchar(); + while(digit(ilet) && allowcnt) { + cnt = 10*cnt + (ilet - '0'); + allowcnt = 2; /* signal presence of cnt */ + ilet = readchar(); + } + if(digit(ilet)) { + pline("No count allowed with this command."); + continue; + } + if(index(quitchars,ilet)) + return((struct obj *)0); + if(ilet == '-') { + return(allownone ? &zeroobj : (struct obj *) 0); + } + if(ilet == '$') { + if(!allowgold){ + pline("You cannot %s gold.", word); + continue; + } + if(!(allowcnt == 2 && cnt < u.ugold)) + cnt = u.ugold; + return(mkgoldobj(cnt)); + } + if(ilet == '?') { + doinv(lets); + if(!(ilet = morc)) continue; + /* he typed a letter (not a space) to more() */ + } else if(ilet == '*') { + doinv((char *) 0); + if(!(ilet = morc)) continue; + /* ... */ + } + if(flags.invlet_constant) { + for(otmp = invent; otmp; otmp = otmp->nobj) + if(otmp->invlet == ilet) break; + } else { + if(ilet >= 'A' && ilet <= 'Z') ilet += 'z'-'A'+1; + ilet -= 'a'; + for(otmp = invent; otmp && ilet; + ilet--, otmp = otmp->nobj) ; + } + if(!otmp) { + pline("You don't have that object."); + continue; + } + if(cnt < 0 || otmp->quan < cnt) { + pline("You don't have that many! [You have %u]" + , otmp->quan); + continue; + } + break; + } + if(!allowall && let && !index(let,otmp->olet)) { + pline("That is a silly thing to %s.",word); + return(0); + } + if(allowcnt == 2) { /* cnt given */ + if(cnt == 0) return(0); + if(cnt != otmp->quan) { + register struct obj *obj; + obj = splitobj(otmp, (int) cnt); + if(otmp == uwep) setuwep(obj); + } + } + return(otmp); +} + +ckunpaid(otmp) register struct obj *otmp; { + return( otmp->unpaid ); +} + +/* interactive version of getobj - used for Drop and Identify */ +/* return the number of times fn was called successfully */ +ggetobj(word, fn, max) +char *word; +int (*fn)(), max; +{ +char buf[BUFSZ]; +register char *ip; +register char sym; +register int oletct = 0, iletct = 0; +register boolean allflag = FALSE; +char olets[20], ilets[20]; +int (*ckfn)() = (int (*)()) 0; +xchar allowgold = (u.ugold && !strcmp(word, "drop")) ? 1 : 0; /* BAH */ + if(!invent && !allowgold){ + pline("You have nothing to %s.", word); + return(0); + } else { + register struct obj *otmp = invent; + register int uflg = 0; + + if(allowgold) ilets[iletct++] = '$'; + ilets[iletct] = 0; + while(otmp) { + if(!index(ilets, otmp->olet)){ + ilets[iletct++] = otmp->olet; + ilets[iletct] = 0; + } + if(otmp->unpaid) uflg = 1; + otmp = otmp->nobj; + } + ilets[iletct++] = ' '; + if(uflg) ilets[iletct++] = 'u'; + if(invent) ilets[iletct++] = 'a'; + ilets[iletct] = 0; + } + pline("What kinds of thing do you want to %s? [%s] ", + word, ilets); + getlin(buf); + if(buf[0] == '\033') { + clrlin(); + return(0); + } + ip = buf; + olets[0] = 0; + while(sym = *ip++){ + if(sym == ' ') continue; + if(sym == '$') { + if(allowgold == 1) + (*fn)(mkgoldobj(u.ugold)); + else if(!u.ugold) + pline("You have no gold."); + allowgold = 2; + } else + if(sym == 'a' || sym == 'A') allflag = TRUE; else + if(sym == 'u' || sym == 'U') ckfn = ckunpaid; else + if(index("!%?[()=*/\"0", sym)){ + if(!index(olets, sym)){ + olets[oletct++] = sym; + olets[oletct] = 0; + } + } + else pline("You don't have any %c's.", sym); + } + if(allowgold == 2 && !oletct) + return(1); /* he dropped gold (or at least tried to) */ + else + return(askchain(invent, olets, allflag, fn, ckfn, max)); +} + +/* + * Walk through the chain starting at objchn and ask for all objects + * with olet in olets (if nonNULL) and satisfying ckfn (if nonNULL) + * whether the action in question (i.e., fn) has to be performed. + * If allflag then no questions are asked. Max gives the max nr of + * objects to be treated. Return the number of objects treated. + */ +askchain(objchn, olets, allflag, fn, ckfn, max) +struct obj *objchn; +register char *olets; +int allflag; +int (*fn)(), (*ckfn)(); +int max; +{ +register struct obj *otmp, *otmp2; +register char sym, ilet; +register int cnt = 0; + ilet = 'a'-1; + for(otmp = objchn; otmp; otmp = otmp2){ + if(ilet == 'z') ilet = 'A'; else ilet++; + otmp2 = otmp->nobj; + if(olets && *olets && !index(olets, otmp->olet)) continue; + if(ckfn && !(*ckfn)(otmp)) continue; + if(!allflag) { + pline(xprname(otmp, ilet)); + addtopl(" [nyaq]? "); + sym = readchar(); + } + else sym = 'y'; + + switch(sym){ + case 'a': + allflag = 1; + case 'y': + cnt += (*fn)(otmp); + if(--max == 0) goto ret; + case 'n': + default: + break; + case 'q': + goto ret; + } + } + pline(cnt ? "That was all." : "No applicable objects."); +ret: + return(cnt); +} + +obj_to_let(obj) /* should of course only be called for things in invent */ +register struct obj *obj; +{ + register struct obj *otmp; + register char ilet; + + if(flags.invlet_constant) + return(obj->invlet); + ilet = 'a'; + for(otmp = invent; otmp && otmp != obj; otmp = otmp->nobj) + if(++ilet > 'z') ilet = 'A'; + return(otmp ? ilet : NOINVSYM); +} + +prinv(obj) +register struct obj *obj; +{ + pline(xprname(obj, obj_to_let(obj))); +} + +static char * +xprname(obj,let) +register struct obj *obj; +register char let; +{ + static char li[BUFSZ]; + + (void) sprintf(li, "%c - %s.", + flags.invlet_constant ? obj->invlet : let, + doname(obj)); + return(li); +} + +ddoinv() +{ + doinv((char *) 0); + return(0); +} + +/* called with 0 or "": all objects in inventory */ +/* otherwise: all objects with (serial) letter in lets */ +doinv(lets) +register char *lets; +{ + register struct obj *otmp; + register char ilet; + int ct = 0; + char any[BUFSZ]; + + morc = 0; /* just to be sure */ + + if(!invent){ + pline("Not carrying anything."); + return; + } + + cornline(0, (char *) 0); + ilet = 'a'; + for(otmp = invent; otmp; otmp = otmp->nobj) { + if(flags.invlet_constant) ilet = otmp->invlet; + if(!lets || !*lets || index(lets, ilet)) { + cornline(1, xprname(otmp, ilet)); + any[ct++] = ilet; + } + if(!flags.invlet_constant) if(++ilet > 'z') ilet = 'A'; + } + any[ct] = 0; + cornline(2, any); +} + +dotypeinv () /* free after Robert Viduya */ +/* Changed to one type only, so he doesnt have to type cr */ +{ + char c, ilet; + char stuff[BUFSZ]; + register int stct; + register struct obj *otmp; + boolean billx = inshop() && doinvbill(0); + boolean unpd = FALSE; + + if (!invent && !u.ugold && !billx) { + pline ("You aren't carrying anything."); + return(0); + } + + stct = 0; + if(u.ugold) stuff[stct++] = '$'; + stuff[stct] = 0; + for(otmp = invent; otmp; otmp = otmp->nobj) { + if (!index (stuff, otmp->olet)) { + stuff[stct++] = otmp->olet; + stuff[stct] = 0; + } + if(otmp->unpaid) + unpd = TRUE; + } + if(unpd) stuff[stct++] = 'u'; + if(billx) stuff[stct++] = 'x'; + stuff[stct] = 0; + + if(stct > 1) { + pline ("What type of object [%s] do you want an inventory of? ", + stuff); + c = readchar(); + if(index(quitchars,c)) return(0); + } else + c = stuff[0]; + + if(c == '$') + return(doprgold()); + + if(c == 'x' || c == 'X') { + if(billx) + (void) doinvbill(1); + else + pline("No used-up objects on the shopping bill."); + return(0); + } + + if((c == 'u' || c == 'U') && !unpd) { + pline("You are not carrying any unpaid objects."); + return(0); + } + + stct = 0; + ilet = 'a'; + for (otmp = invent; otmp; otmp = otmp -> nobj) { + if(flags.invlet_constant) ilet = otmp->invlet; + if (c == otmp -> olet || (c == 'u' && otmp -> unpaid)) + stuff[stct++] = ilet; + if(!flags.invlet_constant) if(++ilet > 'z') ilet = 'A'; + } + stuff[stct] = '\0'; + if(stct == 0) + pline("You have no such objects."); + else + doinv (stuff); + + return(0); +} + +/* look at what is here */ +dolook() { + register struct obj *otmp, *otmp0; + register struct gold *gold; + char *verb = Blind ? "feel" : "see"; + int ct = 0; + + if(!u.uswallow) { + if(Blind) { + pline("You try to feel what is lying here on the floor."); + if(Levitation) { /* ab@unido */ + pline("You cannot reach the floor!"); + return(1); + } + } + otmp0 = o_at(u.ux, u.uy); + gold = g_at(u.ux, u.uy); + } + + if(u.uswallow || (!otmp0 && !gold)) { + pline("You %s no objects here.", verb); + return(!!Blind); + } + + cornline(0, "Things that are here:"); + for(otmp = otmp0; otmp; otmp = otmp->nobj) { + if(otmp->ox == u.ux && otmp->oy == u.uy) { + ct++; + cornline(1, doname(otmp)); + if(Blind && otmp->otyp == DEAD_COCKATRICE && !uarmg) { + pline("Touching the dead cockatrice is a fatal mistake ..."); + pline("You die ..."); + killer = "dead cockatrice"; + done("died"); + } + } + } + + if(gold) { + char gbuf[30]; + + (void) sprintf(gbuf, "%ld gold piece%s", + gold->amount, plur(gold->amount)); + if(!ct++) + pline("You %s here %s.", verb, gbuf); + else + cornline(1, gbuf); + } + + if(ct == 1 && !gold) { + pline("You %s here %s.", verb, doname(otmp0)); + cornline(3, (char *) 0); + } + if(ct > 1) + cornline(2, (char *) 0); + return(!!Blind); +} + +stackobj(obj) register struct obj *obj; { +register struct obj *otmp = fobj; + for(otmp = fobj; otmp; otmp = otmp->nobj) if(otmp != obj) + if(otmp->ox == obj->ox && otmp->oy == obj->oy && + merged(obj,otmp,1)) + return; +} + +/* merge obj with otmp and delete obj if types agree */ +merged(otmp,obj,lose) register struct obj *otmp, *obj; { + if(obj->otyp == otmp->otyp && + obj->unpaid == otmp->unpaid && + obj->spe == otmp->spe && + obj->dknown == otmp->dknown && + obj->cursed == otmp->cursed && + (index("%*?!", obj->olet) || + (obj->known == otmp->known && + (obj->olet == WEAPON_SYM && obj->otyp < BOOMERANG)))) { + otmp->quan += obj->quan; + otmp->owt += obj->owt; + if(lose) freeobj(obj); + obfree(obj,otmp); /* free(obj), bill->otmp */ + return(1); + } else return(0); +} + +/* + * Gold is no longer displayed; in fact, when you have a lot of money, + * it may take a while before you have counted it all. + * [Bug: d$ and pickup still tell you how much it was.] + */ +extern int (*occupation)(); +extern char *occtxt; +static long goldcounted; + +countgold(){ + if((goldcounted += 100*(u.ulevel + 1)) >= u.ugold) { + long eps = 0; + if(!rn2(2)) eps = rnd((int) (u.ugold/100 + 1)); + pline("You probably have about %ld gold pieces.", + u.ugold + eps); + return(0); /* done */ + } + return(1); /* continue */ +} + +doprgold(){ + if(!u.ugold) + pline("You do not carry any gold."); + else if(u.ugold <= 500) + pline("You are carrying %ld gold pieces.", u.ugold); + else { + pline("You sit down in order to count your gold pieces."); + goldcounted = 500; + occupation = countgold; + occtxt = "counting your gold"; + } + return(1); +} + +/* --- end of gold counting section --- */ + +doprwep(){ + if(!uwep) pline("You are empty handed."); + else prinv(uwep); + return(0); +} + +doprarm(){ + if(!uarm && !uarmg && !uarms && !uarmh) + pline("You are not wearing any armor."); + else { + char lets[6]; + register int ct = 0; + + if(uarm) lets[ct++] = obj_to_let(uarm); + if(uarm2) lets[ct++] = obj_to_let(uarm2); + if(uarmh) lets[ct++] = obj_to_let(uarmh); + if(uarms) lets[ct++] = obj_to_let(uarms); + if(uarmg) lets[ct++] = obj_to_let(uarmg); + lets[ct] = 0; + doinv(lets); + } + return(0); +} + +doprring(){ + if(!uleft && !uright) + pline("You are not wearing any rings."); + else { + char lets[3]; + register int ct = 0; + + if(uleft) lets[ct++] = obj_to_let(uleft); + if(uright) lets[ct++] = obj_to_let(uright); + lets[ct] = 0; + doinv(lets); + } + return(0); +} + +digit(c) char c; { + return(c >= '0' && c <= '9'); +} diff --git a/games/hack/hack.ioctl.c b/games/hack/hack.ioctl.c new file mode 100644 index 0000000..2fd7ef1 --- /dev/null +++ b/games/hack/hack.ioctl.c @@ -0,0 +1,55 @@ +/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ +/* hack.ioctl.c - version 1.0.2 */ + +/* KLUDGE -- vars s/ltchars/ltc/ -- our C doesn't distinguish past 7 chars */ + +/* This cannot be part of hack.tty.c (as it was earlier) since on some + systems (e.g. MUNIX) the include files and + define the same constants, and the C preprocessor complains. */ +#include +#include "config.h" +#ifdef BSD +#include +struct ltchars ltc, ltc0; +#else +#include /* also includes part of */ +struct termio termio; +#endif BSD + +getioctls() { +#ifdef BSD + (void) ioctl(fileno(stdin), TIOCGLTC, (char *) <c); + (void) ioctl(fileno(stdin), TIOCSLTC, (char *) <c0); +#else + (void) ioctl(fileno(stdin), TCGETA, &termio); +#endif BSD +} + +setioctls() { +#ifdef BSD + (void) ioctl(fileno(stdin), TIOCSLTC, (char *) <c); +#else + (void) ioctl(fileno(stdin), TCSETA, &termio); +#endif BSD +} + +#ifdef SUSPEND /* implies BSD */ +dosuspend() { +#include +#ifdef SIGTSTP + if(signal(SIGTSTP, SIG_IGN) == SIG_DFL) { + settty((char *) 0); + (void) signal(SIGTSTP, SIG_DFL); + (void) kill(0, SIGTSTP); + gettty(); + setftty(); + docrt(); + } else { + pline("I don't think your shell has job control."); + } +#else SIGTSTP + pline("Sorry, it seems we have no SIGTSTP here. Try ! or S."); +#endif SIGTSTP + return(0); +} +#endif SUSPEND diff --git a/games/hack/hack.lev.c b/games/hack/hack.lev.c new file mode 100644 index 0000000..f011f67 --- /dev/null +++ b/games/hack/hack.lev.c @@ -0,0 +1,285 @@ +/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ +/* hack.lev.c - version 1.0.3 */ + +#include "hack.h" +#include "def.mkroom.h" +#include +extern struct monst *restmonchn(); +extern struct obj *restobjchn(); +extern struct obj *billobjs; +extern char *itoa(); +extern char SAVEF[]; +extern int hackpid; +extern xchar dlevel; +extern char nul[]; + +#ifndef NOWORM +#include "def.wseg.h" +extern struct wseg *wsegs[32], *wheads[32]; +extern long wgrowtime[32]; +#endif NOWORM + +boolean level_exists[MAXLEVEL+1]; + +savelev(fd,lev) +int fd; +xchar lev; +{ +#ifndef NOWORM + register struct wseg *wtmp, *wtmp2; + register tmp; +#endif NOWORM + + if(fd < 0) panic("Save on bad file!"); /* impossible */ + if(lev >= 0 && lev <= MAXLEVEL) + level_exists[lev] = TRUE; + + bwrite(fd,(char *) &hackpid,sizeof(hackpid)); + bwrite(fd,(char *) &lev,sizeof(lev)); + bwrite(fd,(char *) levl,sizeof(levl)); + bwrite(fd,(char *) &moves,sizeof(long)); + bwrite(fd,(char *) &xupstair,sizeof(xupstair)); + bwrite(fd,(char *) &yupstair,sizeof(yupstair)); + bwrite(fd,(char *) &xdnstair,sizeof(xdnstair)); + bwrite(fd,(char *) &ydnstair,sizeof(ydnstair)); + savemonchn(fd, fmon); + savegoldchn(fd, fgold); + savetrapchn(fd, ftrap); + saveobjchn(fd, fobj); + saveobjchn(fd, billobjs); + billobjs = 0; + save_engravings(fd); +#ifndef QUEST + bwrite(fd,(char *) rooms,sizeof(rooms)); + bwrite(fd,(char *) doors,sizeof(doors)); +#endif QUEST + fgold = 0; + ftrap = 0; + fmon = 0; + fobj = 0; +#ifndef NOWORM + bwrite(fd,(char *) wsegs,sizeof(wsegs)); + for(tmp=1; tmp<32; tmp++){ + for(wtmp = wsegs[tmp]; wtmp; wtmp = wtmp2){ + wtmp2 = wtmp->nseg; + bwrite(fd,(char *) wtmp,sizeof(struct wseg)); + } + wsegs[tmp] = 0; + } + bwrite(fd,(char *) wgrowtime,sizeof(wgrowtime)); +#endif NOWORM +} + +bwrite(fd,loc,num) +register fd; +register char *loc; +register unsigned num; +{ +/* lint wants the 3rd arg of write to be an int; lint -p an unsigned */ + if(write(fd, loc, (int) num) != num) + panic("cannot write %u bytes to file #%d", num, fd); +} + +saveobjchn(fd,otmp) +register fd; +register struct obj *otmp; +{ + register struct obj *otmp2; + unsigned xl; + int minusone = -1; + + while(otmp) { + otmp2 = otmp->nobj; + xl = otmp->onamelth; + bwrite(fd, (char *) &xl, sizeof(int)); + bwrite(fd, (char *) otmp, xl + sizeof(struct obj)); + free((char *) otmp); + otmp = otmp2; + } + bwrite(fd, (char *) &minusone, sizeof(int)); +} + +savemonchn(fd,mtmp) +register fd; +register struct monst *mtmp; +{ + register struct monst *mtmp2; + unsigned xl; + int minusone = -1; + struct permonst *monbegin = &mons[0]; + + bwrite(fd, (char *) &monbegin, sizeof(monbegin)); + + while(mtmp) { + mtmp2 = mtmp->nmon; + xl = mtmp->mxlth + mtmp->mnamelth; + bwrite(fd, (char *) &xl, sizeof(int)); + bwrite(fd, (char *) mtmp, xl + sizeof(struct monst)); + if(mtmp->minvent) saveobjchn(fd,mtmp->minvent); + free((char *) mtmp); + mtmp = mtmp2; + } + bwrite(fd, (char *) &minusone, sizeof(int)); +} + +savegoldchn(fd,gold) +register fd; +register struct gold *gold; +{ + register struct gold *gold2; + while(gold) { + gold2 = gold->ngold; + bwrite(fd, (char *) gold, sizeof(struct gold)); + free((char *) gold); + gold = gold2; + } + bwrite(fd, nul, sizeof(struct gold)); +} + +savetrapchn(fd,trap) +register fd; +register struct trap *trap; +{ + register struct trap *trap2; + while(trap) { + trap2 = trap->ntrap; + bwrite(fd, (char *) trap, sizeof(struct trap)); + free((char *) trap); + trap = trap2; + } + bwrite(fd, nul, sizeof(struct trap)); +} + +getlev(fd,pid,lev) +int fd,pid; +xchar lev; +{ + register struct gold *gold; + register struct trap *trap; +#ifndef NOWORM + register struct wseg *wtmp; +#endif NOWORM + register tmp; + long omoves; + int hpid; + xchar dlvl; + + /* First some sanity checks */ + mread(fd, (char *) &hpid, sizeof(hpid)); + mread(fd, (char *) &dlvl, sizeof(dlvl)); + if((pid && pid != hpid) || (lev && dlvl != lev)) { + pline("Strange, this map is not as I remember it."); + pline("Somebody is trying some trickery here ..."); + pline("This game is void ..."); + done("tricked"); + } + + fgold = 0; + ftrap = 0; + mread(fd, (char *) levl, sizeof(levl)); + mread(fd, (char *)&omoves, sizeof(omoves)); + mread(fd, (char *)&xupstair, sizeof(xupstair)); + mread(fd, (char *)&yupstair, sizeof(yupstair)); + mread(fd, (char *)&xdnstair, sizeof(xdnstair)); + mread(fd, (char *)&ydnstair, sizeof(ydnstair)); + + fmon = restmonchn(fd); + + /* regenerate animals while on another level */ + { long tmoves = (moves > omoves) ? moves-omoves : 0; + register struct monst *mtmp, *mtmp2; + extern char genocided[]; + + for(mtmp = fmon; mtmp; mtmp = mtmp2) { + long newhp; /* tmoves may be very large */ + + mtmp2 = mtmp->nmon; + if(index(genocided, mtmp->data->mlet)) { + mondead(mtmp); + continue; + } + + if(mtmp->mtame && tmoves > 250) { + mtmp->mtame = 0; + mtmp->mpeaceful = 0; + } + + newhp = mtmp->mhp + + (index(MREGEN, mtmp->data->mlet) ? tmoves : tmoves/20); + if(newhp > mtmp->mhpmax) + mtmp->mhp = mtmp->mhpmax; + else + mtmp->mhp = newhp; + } + } + + setgd(); + gold = newgold(); + mread(fd, (char *)gold, sizeof(struct gold)); + while(gold->gx) { + gold->ngold = fgold; + fgold = gold; + gold = newgold(); + mread(fd, (char *)gold, sizeof(struct gold)); + } + free((char *) gold); + trap = newtrap(); + mread(fd, (char *)trap, sizeof(struct trap)); + while(trap->tx) { + trap->ntrap = ftrap; + ftrap = trap; + trap = newtrap(); + mread(fd, (char *)trap, sizeof(struct trap)); + } + free((char *) trap); + fobj = restobjchn(fd); + billobjs = restobjchn(fd); + rest_engravings(fd); +#ifndef QUEST + mread(fd, (char *)rooms, sizeof(rooms)); + mread(fd, (char *)doors, sizeof(doors)); +#endif QUEST +#ifndef NOWORM + mread(fd, (char *)wsegs, sizeof(wsegs)); + for(tmp = 1; tmp < 32; tmp++) if(wsegs[tmp]){ + wheads[tmp] = wsegs[tmp] = wtmp = newseg(); + while(1) { + mread(fd, (char *)wtmp, sizeof(struct wseg)); + if(!wtmp->nseg) break; + wheads[tmp]->nseg = wtmp = newseg(); + wheads[tmp] = wtmp; + } + } + mread(fd, (char *)wgrowtime, sizeof(wgrowtime)); +#endif NOWORM +} + +mread(fd, buf, len) +register fd; +register char *buf; +register unsigned len; +{ + register int rlen; + extern boolean restoring; + + rlen = read(fd, buf, (int) len); + if(rlen != len){ + pline("Read %d instead of %u bytes.\n", rlen, len); + if(restoring) { + (void) unlink(SAVEF); + error("Error restoring old game."); + } + panic("Error reading level file."); + } +} + +mklev() +{ + extern boolean in_mklev; + + if(getbones()) return; + + in_mklev = TRUE; + makelevel(); + in_mklev = FALSE; +} diff --git a/games/hack/hack.main.c b/games/hack/hack.main.c new file mode 100644 index 0000000..c234e86 --- /dev/null +++ b/games/hack/hack.main.c @@ -0,0 +1,499 @@ +/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ +/* hack.main.c - version 1.0.4 */ + +#include +#include +#include +#include +#include "hack.h" + +#ifdef QUEST +#define gamename "quest" +#else +#define gamename "hack" +#endif QUEST + +extern char plname[PL_NSIZ], pl_character[PL_CSIZ]; + +int (*afternmv)(); +int (*occupation)(); +char *occtxt; /* defined when occupation != NULL */ + +int done1(); +int hangup(); + +int hackpid; /* current pid */ +int locknum; /* max num of players */ +#ifdef DEF_PAGER +char *catmore; /* default pager */ +#endif DEF_PAGER +char SAVEF[PL_NSIZ + 11] = "save/"; /* save/99999player */ +char *hname; /* name of the game (argv[0] of call) */ +char obuf[BUFSIZ]; /* BUFSIZ is defined in stdio.h */ + +extern char *nomovemsg; +extern long wailmsg; + +main(argc,argv) +int argc; +char *argv[]; +{ + register int fd; +#ifdef CHDIR + register char *dir; +#endif CHDIR + + hname = argv[0]; + hackpid = getpid(); + +#ifdef CHDIR /* otherwise no chdir() */ + /* + * See if we must change directory to the playground. + * (Perhaps hack runs suid and playground is inaccessible + * for the player.) + * The environment variable HACKDIR is overridden by a + * -d command line option (must be the first option given) + */ + + dir = getenv("HACKDIR"); + if(argc > 1 && !strncmp(argv[1], "-d", STRLEN("-d"))) { + argc--; + argv++; + dir = argv[0]+STRLEN("-d"); + if(*dir == '=' || *dir == ':') dir++; + if(!*dir && argc > 1) { + argc--; + argv++; + dir = argv[0]; + } + if(!*dir) + error("Flag -d must be followed by a directory name."); + } +#endif CHDIR + + /* + * Who am i? Algorithm: 1. Use name as specified in HACKOPTIONS + * 2. Use $USER or $LOGNAME (if 1. fails) + * 3. Use getlogin() (if 2. fails) + * The resulting name is overridden by command line options. + * If everything fails, or if the resulting name is some generic + * account like "games", "play", "player", "hack" then eventually + * we'll ask him. + * Note that we trust him here; it is possible to play under + * somebody else's name. + */ + { register char *s; + + initoptions(); + if(!*plname && (s = getenv("USER"))) + (void) strncpy(plname, s, sizeof(plname)-1); + if(!*plname && (s = getenv("LOGNAME"))) + (void) strncpy(plname, s, sizeof(plname)-1); + if(!*plname && (s = getlogin())) + (void) strncpy(plname, s, sizeof(plname)-1); + } + + /* + * Now we know the directory containing 'record' and + * may do a prscore(). + */ + if(argc > 1 && !strncmp(argv[1], "-s", STRLEN("-s"))) { +#ifdef CHDIR + chdirx(dir,0); +#endif CHDIR + prscore(argc, argv); + exit(0); + } + + /* + * It seems he really wants to play. + * Remember tty modes, to be restored on exit. + */ + gettty(); + setbuf(stdout,obuf); + setrandom(); + startup(); + cls(); + u.uhp = 1; /* prevent RIP on early quits */ + u.ux = FAR; /* prevent nscr() */ + (void) signal(SIGHUP, hangup); + + /* + * Find the creation date of this game, + * so as to avoid restoring outdated savefiles. + */ + gethdate(hname); + + /* + * We cannot do chdir earlier, otherwise gethdate will fail. + */ +#ifdef CHDIR + chdirx(dir,1); +#endif CHDIR + + /* + * Process options. + */ + while(argc > 1 && argv[1][0] == '-'){ + argv++; + argc--; + switch(argv[0][1]){ +#ifdef WIZARD + case 'D': + if(!strcmp(getlogin(), WIZARD)) + wizard = TRUE; + else + printf("Sorry.\n"); + break; +#endif WIZARD +#ifdef NEWS + case 'n': + flags.nonews = TRUE; + break; +#endif NEWS + case 'u': + if(argv[0][2]) + (void) strncpy(plname, argv[0]+2, sizeof(plname)-1); + else if(argc > 1) { + argc--; + argv++; + (void) strncpy(plname, argv[0], sizeof(plname)-1); + } else + printf("Player name expected after -u\n"); + break; + default: + /* allow -T for Tourist, etc. */ + (void) strncpy(pl_character, argv[0]+1, + sizeof(pl_character)-1); + + /* printf("Unknown option: %s\n", *argv); */ + } + } + + if(argc > 1) + locknum = atoi(argv[1]); +#ifdef MAX_NR_OF_PLAYERS + if(!locknum || locknum > MAX_NR_OF_PLAYERS) + locknum = MAX_NR_OF_PLAYERS; +#endif MAX_NR_OF_PLAYERS +#ifdef DEF_PAGER + if(!(catmore = getenv("HACKPAGER")) && !(catmore = getenv("PAGER"))) + catmore = DEF_PAGER; +#endif DEF_PAGER +#ifdef MAIL + getmailstatus(); +#endif MAIL +#ifdef WIZARD + if(wizard) (void) strcpy(plname, "wizard"); else +#endif WIZARD + if(!*plname || !strncmp(plname, "player", 4) + || !strncmp(plname, "games", 4)) + askname(); + plnamesuffix(); /* strip suffix from name; calls askname() */ + /* again if suffix was whole name */ + /* accepts any suffix */ +#ifdef WIZARD + if(!wizard) { +#endif WIZARD + /* + * check for multiple games under the same name + * (if !locknum) or check max nr of players (otherwise) + */ + (void) signal(SIGQUIT,SIG_IGN); + (void) signal(SIGINT,SIG_IGN); + if(!locknum) + (void) strcpy(lock,plname); + getlock(); /* sets lock if locknum != 0 */ +#ifdef WIZARD + } else { + register char *sfoo; + (void) strcpy(lock,plname); + if(sfoo = getenv("MAGIC")) + while(*sfoo) { + switch(*sfoo++) { + case 'n': (void) srand(*sfoo++); + break; + } + } + if(sfoo = getenv("GENOCIDED")){ + /* KLUDGE -- our C doesn't let `extern ...' + definitions last for the rest of the file */ + extern char genocided[], fut_geno[]; + if(*sfoo == '!'){ + extern struct permonst mons[CMNUM+2]; + extern char genocided[], fut_geno[]; + register struct permonst *pm = mons; + register char *gp = genocided; + + while(pm < mons+CMNUM+2){ + if(!index(sfoo, pm->mlet)) + *gp++ = pm->mlet; + pm++; + } + *gp = 0; + } else + (void) strcpy(genocided, sfoo); + (void) strcpy(fut_geno, genocided); + } + } +#endif WIZARD + setftty(); + (void) sprintf(SAVEF, "save/%d%s", getuid(), plname); + regularize(SAVEF+5); /* avoid . or / in name */ + if((fd = open(SAVEF,0)) >= 0 && + (uptodate(fd) || unlink(SAVEF) == 666)) { + (void) signal(SIGINT,done1); + pline("Restoring old save file..."); + (void) fflush(stdout); + if(!dorecover(fd)) + goto not_recovered; + pline("Hello %s, welcome to %s!", plname, gamename); + flags.move = 0; + } else { +not_recovered: + fobj = fcobj = invent = 0; + fmon = fallen_down = 0; + ftrap = 0; + fgold = 0; + flags.ident = 1; + init_objects(); + u_init(); + + (void) signal(SIGINT,done1); + mklev(); + u.ux = xupstair; + u.uy = yupstair; + (void) inshop(); + setsee(); + flags.botlx = 1; + makedog(); + { register struct monst *mtmp; + if(mtmp = m_at(u.ux, u.uy)) mnexto(mtmp); /* riv05!a3 */ + } + seemons(); +#ifdef NEWS + if(flags.nonews || !readnews()) + /* after reading news we did docrt() already */ +#endif NEWS + docrt(); + + /* give welcome message before pickup messages */ + pline("Hello %s, welcome to %s!", plname, gamename); + + pickup(1); + read_engr_at(u.ux,u.uy); + flags.move = 1; + } + + flags.moonphase = phase_of_the_moon(); + if(flags.moonphase == FULL_MOON) { + pline("You are lucky! Full moon tonight."); + u.uluck++; + } else if(flags.moonphase == NEW_MOON) { + pline("Be careful! New moon tonight."); + } + + initrack(); + + for(;;) { + if(flags.move) { /* actual time passed */ + + settrack(); + + if(moves%2 == 0 || + (!(Fast & ~INTRINSIC) && (!Fast || rn2(3)))) { + extern struct monst *makemon(); + movemon(); + if(!rn2(70)) + (void) makemon((struct permonst *)0, 0, 0); + } + if(Glib) glibr(); + timeout(); + ++moves; + if(flags.time) flags.botl = 1; + if(u.uhp < 1) { + pline("You die..."); + done("died"); + } + if(u.uhp*10 < u.uhpmax && moves-wailmsg > 50){ + wailmsg = moves; + if(u.uhp == 1) + pline("You hear the wailing of the Banshee..."); + else + pline("You hear the howling of the CwnAnnwn..."); + } + if(u.uhp < u.uhpmax) { + if(u.ulevel > 9) { + if(Regeneration || !(moves%3)) { + flags.botl = 1; + u.uhp += rnd((int) u.ulevel-9); + if(u.uhp > u.uhpmax) + u.uhp = u.uhpmax; + } + } else if(Regeneration || + (!(moves%(22-u.ulevel*2)))) { + flags.botl = 1; + u.uhp++; + } + } + if(Teleportation && !rn2(85)) tele(); + if(Searching && multi >= 0) (void) dosearch(); + gethungry(); + invault(); + amulet(); + } + if(multi < 0) { + if(!++multi){ + pline(nomovemsg ? nomovemsg : + "You can move again."); + nomovemsg = 0; + if(afternmv) (*afternmv)(); + afternmv = 0; + } + } + + find_ac(); +#ifndef QUEST + if(!flags.mv || Blind) +#endif QUEST + { + seeobjs(); + seemons(); + nscr(); + } + if(flags.botl || flags.botlx) bot(); + + flags.move = 1; + + if(multi >= 0 && occupation) { + if(monster_nearby()) + stop_occupation(); + else if ((*occupation)() == 0) + occupation = 0; + continue; + } + + if(multi > 0) { +#ifdef QUEST + if(flags.run >= 4) finddir(); +#endif QUEST + lookaround(); + if(!multi) { /* lookaround may clear multi */ + flags.move = 0; + continue; + } + if(flags.mv) { + if(multi < COLNO && !--multi) + flags.mv = flags.run = 0; + domove(); + } else { + --multi; + rhack(save_cm); + } + } else if(multi == 0) { +#ifdef MAIL + ckmailstatus(); +#endif MAIL + rhack((char *) 0); + } + if(multi && multi%7 == 0) + (void) fflush(stdout); + } +} + +glo(foo) +register foo; +{ + /* construct the string xlock.n */ + register char *tf; + + tf = lock; + while(*tf && *tf != '.') tf++; + (void) sprintf(tf, ".%d", foo); +} + +/* + * plname is filled either by an option (-u Player or -uPlayer) or + * explicitly (-w implies wizard) or by askname. + * It may still contain a suffix denoting pl_character. + */ +askname(){ +register int c,ct; + printf("\nWho are you? "); +/* (void) fflush(stdout); /* readchar already does this */ + ct = 0; + while((c = readchar()) != '\n'){ + if(c == EOF) error("End of input\n"); + /* some people get confused when their erase char is not ^H */ + if(c == '\010') { + if(ct) ct--; + continue; + } + if(c != '-') + if(c < 'A' || (c > 'Z' && c < 'a') || c > 'z') c = '_'; + if(ct < sizeof(plname)-1) plname[ct++] = c; + } + plname[ct] = 0; + if(ct == 0) askname(); +} + +/*VARARGS1*/ +impossible(s,x1,x2) +register char *s; +{ + pline(s,x1,x2); + pline("Program in disorder - perhaps you'd better Quit."); +} + +#ifdef CHDIR +static +chdirx(dir, wr) +char *dir; +boolean wr; +{ + +#ifdef SECURE + if(dir /* User specified directory? */ +#ifdef HACKDIR + && strcmp(dir, HACKDIR) /* and not the default? */ +#endif HACKDIR + ) { + (void) setuid(getuid()); /* Ron Wessels */ + (void) setgid(getgid()); + } +#endif SECURE + +#ifdef HACKDIR + if(dir == NULL) + dir = HACKDIR; +#endif HACKDIR + + if(dir && chdir(dir) < 0) { + perror(dir); + error("Cannot chdir to %s.", dir); + } + + /* warn the player if he cannot write the record file */ + /* perhaps we should also test whether . is writable */ + /* unfortunately the access systemcall is worthless */ + if(wr) { + register fd; + + if(dir == NULL) + dir = "."; + if((fd = open(RECORD, 2)) < 0) { + printf("Warning: cannot write %s/%s", dir, RECORD); + getret(); + } else + (void) close(fd); + } +} +#endif CHDIR + +stop_occupation() +{ + if(occupation) { + pline("You stop %s.", occtxt); + occupation = 0; + } +} diff --git a/games/hack/hack.makemon.c b/games/hack/hack.makemon.c new file mode 100644 index 0000000..9500534 --- /dev/null +++ b/games/hack/hack.makemon.c @@ -0,0 +1,200 @@ +/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ +/* hack.makemon.c - version 1.0.2 */ + +#include "hack.h" +extern char fut_geno[]; +extern char *index(); +extern struct obj *mkobj_at(); +struct monst zeromonst; + +/* + * called with [x,y] = coordinates; + * [0,0] means anyplace + * [u.ux,u.uy] means: call mnexto (if !in_mklev) + * + * In case we make an Orc or killer bee, we make an entire horde (swarm); + * note that in this case we return only one of them (the one at [x,y]). + */ +struct monst * +makemon(ptr,x,y) +register struct permonst *ptr; +{ + register struct monst *mtmp; + register tmp, ct; + boolean anything = (!ptr); + + if(x != 0 || y != 0) if(m_at(x,y)) return((struct monst *) 0); + if(ptr){ + if(index(fut_geno, ptr->mlet)) return((struct monst *) 0); + } else { + ct = CMNUM - strlen(fut_geno); + if(index(fut_geno, 'm')) ct++; /* make only 1 minotaur */ + if(index(fut_geno, '@')) ct++; + if(ct <= 0) return(0); /* no more monsters! */ + tmp = rn2(ct*dlevel/24 + 7); + if(tmp < dlevel - 4) tmp = rn2(ct*dlevel/24 + 12); + if(tmp >= ct) tmp = rn1(ct - ct/2, ct/2); + for(ct = 0; ct < CMNUM; ct++){ + ptr = &mons[ct]; + if(index(fut_geno, ptr->mlet)) + continue; + if(!tmp--) goto gotmon; + } + panic("makemon?"); + } +gotmon: + mtmp = newmonst(ptr->pxlth); + *mtmp = zeromonst; /* clear all entries in structure */ + for(ct = 0; ct < ptr->pxlth; ct++) + ((char *) &(mtmp->mextra[0]))[ct] = 0; + mtmp->nmon = fmon; + fmon = mtmp; + mtmp->m_id = flags.ident++; + mtmp->data = ptr; + mtmp->mxlth = ptr->pxlth; + if(ptr->mlet == 'D') mtmp->mhpmax = mtmp->mhp = 80; + else if(!ptr->mlevel) mtmp->mhpmax = mtmp->mhp = rnd(4); + else mtmp->mhpmax = mtmp->mhp = d(ptr->mlevel, 8); + mtmp->mx = x; + mtmp->my = y; + mtmp->mcansee = 1; + if(ptr->mlet == 'M'){ + mtmp->mimic = 1; + mtmp->mappearance = ']'; + } + /* FIX -- extended scope off `in_mklev' to cover its following three + references */ + { extern boolean in_mklev; + if(!in_mklev) { + if(x == u.ux && y == u.uy && ptr->mlet != ' ') + mnexto(mtmp); + if(x == 0 && y == 0) + rloc(mtmp); + } + if(ptr->mlet == 's' || ptr->mlet == 'S') { + mtmp->mhide = mtmp->mundetected = 1; + if(in_mklev) + if(mtmp->mx && mtmp->my) + (void) mkobj_at(0, mtmp->mx, mtmp->my); + } + if(ptr->mlet == ':') { + mtmp->cham = 1; + (void) newcham(mtmp, &mons[dlevel+14+rn2(CMNUM-14-dlevel)]); + } + if(ptr->mlet == 'I' || ptr->mlet == ';') + mtmp->minvis = 1; + if(ptr->mlet == 'L' || ptr->mlet == 'N' + || (in_mklev && index("&w;", ptr->mlet) && rn2(5)) + ) mtmp->msleep = 1; + } +#ifndef NOWORM + if(ptr->mlet == 'w' && getwn(mtmp)) + initworm(mtmp); +#endif NOWORM + + if(anything) if(ptr->mlet == 'O' || ptr->mlet == 'k') { + coord enexto(); + coord mm; + register int cnt = rnd(10); + mm.x = x; + mm.y = y; + while(cnt--) { + mm = enexto(mm.x, mm.y); + (void) makemon(ptr, mm.x, mm.y); + } + } + + return(mtmp); +} + +coord +enexto(xx,yy) +register xchar xx,yy; +{ + register xchar x,y; + coord foo[15], *tfoo; + int range; + + tfoo = foo; + range = 1; + do { /* full kludge action. */ + for(x = xx-range; x <= xx+range; x++) + if(goodpos(x, yy-range)) { + tfoo->x = x; + tfoo++->y = yy-range; + if(tfoo == &foo[15]) goto foofull; + } + for(x = xx-range; x <= xx+range; x++) + if(goodpos(x,yy+range)) { + tfoo->x = x; + tfoo++->y = yy+range; + if(tfoo == &foo[15]) goto foofull; + } + for(y = yy+1-range; y < yy+range; y++) + if(goodpos(xx-range,y)) { + tfoo->x = xx-range; + tfoo++->y = y; + if(tfoo == &foo[15]) goto foofull; + } + for(y = yy+1-range; y < yy+range; y++) + if(goodpos(xx+range,y)) { + tfoo->x = xx+range; + tfoo++->y = y; + if(tfoo == &foo[15]) goto foofull; + } + range++; + } while(tfoo == foo); +foofull: + return( foo[rn2(tfoo-foo)] ); +} + +goodpos(x,y) /* used only in mnexto and rloc */ +{ + return( + ! (x < 1 || x > COLNO-2 || y < 1 || y > ROWNO-2 || + m_at(x,y) || !ACCESSIBLE(levl[x][y].typ) + || (x == u.ux && y == u.uy) + || sobj_at(ENORMOUS_ROCK, x, y) + )); +} + +rloc(mtmp) +struct monst *mtmp; +{ + register tx,ty; + register char ch = mtmp->data->mlet; + +#ifndef NOWORM + if(ch == 'w' && mtmp->mx) return; /* do not relocate worms */ +#endif NOWORM + do { + tx = rn1(COLNO-3,2); + ty = rn2(ROWNO); + } while(!goodpos(tx,ty)); + mtmp->mx = tx; + mtmp->my = ty; + if(u.ustuck == mtmp){ + if(u.uswallow) { + u.ux = tx; + u.uy = ty; + docrt(); + } else u.ustuck = 0; + } + pmon(mtmp); +} + +struct monst * +mkmon_at(let,x,y) +char let; +register int x,y; +{ + register int ct; + register struct permonst *ptr; + + for(ct = 0; ct < CMNUM; ct++) { + ptr = &mons[ct]; + if(ptr->mlet == let) + return(makemon(ptr,x,y)); + } + return(0); +} diff --git a/games/hack/hack.mfndpos.h b/games/hack/hack.mfndpos.h new file mode 100644 index 0000000..f4da529 --- /dev/null +++ b/games/hack/hack.mfndpos.h @@ -0,0 +1,12 @@ +/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ +/* hack.mfndpos.h - version 1.0.2 */ + +#define ALLOW_TRAPS 0777 +#define ALLOW_U 01000 +#define ALLOW_M 02000 +#define ALLOW_TM 04000 +#define ALLOW_ALL (ALLOW_U | ALLOW_M | ALLOW_TM | ALLOW_TRAPS) +#define ALLOW_SSM 010000 +#define ALLOW_ROCK 020000 +#define NOTONL 040000 +#define NOGARLIC 0100000 diff --git a/games/hack/hack.mhitu.c b/games/hack/hack.mhitu.c new file mode 100644 index 0000000..ae7d204 --- /dev/null +++ b/games/hack/hack.mhitu.c @@ -0,0 +1,363 @@ +/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ +/* hack.mhitu.c - version 1.0.3 */ + +#include "hack.h" +extern struct monst *makemon(); + +/* + * mhitu: monster hits you + * returns 1 if monster dies (e.g. 'y', 'F'), 0 otherwise + */ +mhitu(mtmp) +register struct monst *mtmp; +{ + register struct permonst *mdat = mtmp->data; + register int tmp, ctmp; + + nomul(0); + + /* If swallowed, can only be affected by hissers and by u.ustuck */ + if(u.uswallow) { + if(mtmp != u.ustuck) { + if(mdat->mlet == 'c' && !rn2(13)) { + pline("Outside, you hear %s's hissing!", + monnam(mtmp)); + pline("%s gets turned to stone!", + Monnam(u.ustuck)); + pline("And the same fate befalls you."); + done_in_by(mtmp); + /* "notreached": not return(1); */ + } + return(0); + } + switch(mdat->mlet) { /* now mtmp == u.ustuck */ + case ',': + youswld(mtmp, (u.uac > 0) ? u.uac+4 : 4, + 5, "The trapper"); + break; + case '\'': + youswld(mtmp,rnd(6),7,"The lurker above"); + break; + case 'P': + youswld(mtmp,d(2,4),12,"The purple worm"); + break; + default: + /* This is not impossible! */ + pline("The mysterious monster totally digests you."); + u.uhp = 0; + } + if(u.uhp < 1) done_in_by(mtmp); + return(0); + } + + if(mdat->mlet == 'c' && Stoned) + return(0); + + /* make eels visible the moment they hit/miss us */ + if(mdat->mlet == ';' && mtmp->minvis && cansee(mtmp->mx,mtmp->my)){ + mtmp->minvis = 0; + pmon(mtmp); + } + if(!index("1&DuxynNF",mdat->mlet)) + tmp = hitu(mtmp,d(mdat->damn,mdat->damd)); + else + tmp = 0; + if(index(UNDEAD, mdat->mlet) && midnight()) + tmp += hitu(mtmp,d(mdat->damn,mdat->damd)); + + ctmp = tmp && !mtmp->mcan && + (!uarm || objects[uarm->otyp].a_can < rnd(3) || !rn2(50)); + switch(mdat->mlet) { + case '1': + if(wiz_hit(mtmp)) return(1); /* he disappeared */ + break; + case '&': + if(!mtmp->cham && !mtmp->mcan && !rn2(13)) { + (void) makemon(PM_DEMON,u.ux,u.uy); + } else { + (void) hitu(mtmp,d(2,6)); + (void) hitu(mtmp,d(2,6)); + (void) hitu(mtmp,rnd(3)); + (void) hitu(mtmp,rnd(3)); + (void) hitu(mtmp,rn1(4,2)); + } + break; + case ',': + if(tmp) justswld(mtmp,"The trapper"); + break; + case '\'': + if(tmp) justswld(mtmp, "The lurker above"); + break; + case ';': + if(ctmp) { + if(!u.ustuck && !rn2(10)) { + pline("%s swings itself around you!", + Monnam(mtmp)); + u.ustuck = mtmp; + } else if(u.ustuck == mtmp && + levl[mtmp->mx][mtmp->my].typ == POOL) { + pline("%s drowns you ...", Monnam(mtmp)); + done("drowned"); + } + } + break; + case 'A': + if(ctmp && rn2(2)) { + if(Poison_resistance) + pline("The sting doesn't seem to affect you."); + else { + pline("You feel weaker!"); + losestr(1); + } + } + break; + case 'C': + (void) hitu(mtmp,rnd(6)); + break; + case 'c': + if(!rn2(5)) { + pline("You hear %s's hissing!", monnam(mtmp)); + if(ctmp || !rn2(20) || (flags.moonphase == NEW_MOON + && !carrying(DEAD_LIZARD))) { + Stoned = 5; + /* pline("You get turned to stone!"); */ + /* done_in_by(mtmp); */ + } + } + break; + case 'D': + if(rn2(6) || mtmp->mcan) { + (void) hitu(mtmp,d(3,10)); + (void) hitu(mtmp,rnd(8)); + (void) hitu(mtmp,rnd(8)); + break; + } + kludge("%s breathes fire!","The dragon"); + buzz(-1,mtmp->mx,mtmp->my,u.ux-mtmp->mx,u.uy-mtmp->my); + break; + case 'd': + (void) hitu(mtmp,d(2, (flags.moonphase == FULL_MOON) ? 3 : 4)); + break; + case 'e': + (void) hitu(mtmp,d(3,6)); + break; + case 'F': + if(mtmp->mcan) break; + kludge("%s explodes!","The freezing sphere"); + if(Cold_resistance) pline("You don't seem affected by it."); + else { + xchar dn; + if(17-(u.ulevel/2) > rnd(20)) { + pline("You get blasted!"); + dn = 6; + } else { + pline("You duck the blast..."); + dn = 3; + } + losehp_m(d(dn,6), mtmp); + } + mondead(mtmp); + return(1); + case 'g': + if(ctmp && multi >= 0 && !rn2(3)) { + kludge("You are frozen by %ss juices","the cube'"); + nomul(-rnd(10)); + } + break; + case 'h': + if(ctmp && multi >= 0 && !rn2(5)) { + nomul(-rnd(10)); + kludge("You are put to sleep by %ss bite!", + "the homunculus'"); + } + break; + case 'j': + tmp = hitu(mtmp,rnd(3)); + tmp &= hitu(mtmp,rnd(3)); + if(tmp){ + (void) hitu(mtmp,rnd(4)); + (void) hitu(mtmp,rnd(4)); + } + break; + case 'k': + if((hitu(mtmp,rnd(4)) || !rn2(3)) && ctmp){ + poisoned("bee's sting",mdat->mname); + } + break; + case 'L': + if(tmp) stealgold(mtmp); + break; + case 'N': + if(mtmp->mcan && !Blind) { + pline("%s tries to seduce you, but you seem not interested.", + Amonnam(mtmp, "plain")); + if(rn2(3)) rloc(mtmp); + } else if(steal(mtmp)) { + rloc(mtmp); + mtmp->mflee = 1; + } + break; + case 'n': + if(!uwep && !uarm && !uarmh && !uarms && !uarmg) { + pline("%s hits! (I hope you don't mind)", + Monnam(mtmp)); + u.uhp += rnd(7); + if(!rn2(7)) u.uhpmax++; + if(u.uhp > u.uhpmax) u.uhp = u.uhpmax; + flags.botl = 1; + if(!rn2(50)) rloc(mtmp); + } else { + (void) hitu(mtmp,d(2,6)); + (void) hitu(mtmp,d(2,6)); + } + break; + case 'o': + tmp = hitu(mtmp,rnd(6)); + if(hitu(mtmp,rnd(6)) && tmp && /* hits with both paws */ + !u.ustuck && rn2(2)) { + u.ustuck = mtmp; + kludge("%s has grabbed you!","The owlbear"); + u.uhp -= d(2,8); + } else if(u.ustuck == mtmp) { + u.uhp -= d(2,8); + pline("You are being crushed."); + } + break; + case 'P': + if(ctmp && !rn2(4)) + justswld(mtmp,"The purple worm"); + else + (void) hitu(mtmp,d(2,4)); + break; + case 'Q': + (void) hitu(mtmp,rnd(2)); + (void) hitu(mtmp,rnd(2)); + break; + case 'R': + if(tmp && uarmh && !uarmh->rustfree && + (int) uarmh->spe >= -1) { + pline("Your helmet rusts!"); + uarmh->spe--; + } else + if(ctmp && uarm && !uarm->rustfree && /* Mike Newton */ + uarm->otyp < STUDDED_LEATHER_ARMOR && + (int) uarm->spe >= -1) { + pline("Your armor rusts!"); + uarm->spe--; + } + break; + case 'S': + if(ctmp && !rn2(8)) { + poisoned("snake's bite",mdat->mname); + } + break; + case 's': + if(tmp && !rn2(8)) { + poisoned("scorpion's sting",mdat->mname); + } + (void) hitu(mtmp,rnd(8)); + (void) hitu(mtmp,rnd(8)); + break; + case 'T': + (void) hitu(mtmp,rnd(6)); + (void) hitu(mtmp,rnd(6)); + break; + case 't': + if(!rn2(5)) rloc(mtmp); + break; + case 'u': + mtmp->mflee = 1; + break; + case 'U': + (void) hitu(mtmp,d(3,4)); + (void) hitu(mtmp,d(3,4)); + break; + case 'v': + if(ctmp && !u.ustuck) u.ustuck = mtmp; + break; + case 'V': + if(tmp) u.uhp -= 4; + if(ctmp) losexp(); + break; + case 'W': + if(ctmp) losexp(); + break; +#ifndef NOWORM + case 'w': + if(tmp) wormhit(mtmp); +#endif NOWORM + break; + case 'X': + (void) hitu(mtmp,rnd(5)); + (void) hitu(mtmp,rnd(5)); + (void) hitu(mtmp,rnd(5)); + break; + case 'x': + { register long side = rn2(2) ? RIGHT_SIDE : LEFT_SIDE; + pline("%s pricks in your %s leg!", + Monnam(mtmp), (side == RIGHT_SIDE) ? "right" : "left"); + set_wounded_legs(side, rnd(50)); + losehp_m(2, mtmp); + break; + } + case 'y': + if(mtmp->mcan) break; + mondead(mtmp); + if(!Blind) { + pline("You are blinded by a blast of light!"); + Blind = d(4,12); + seeoff(0); + } + return(1); + case 'Y': + (void) hitu(mtmp,rnd(6)); + break; + } + if(u.uhp < 1) done_in_by(mtmp); + return(0); +} + +hitu(mtmp,dam) +register struct monst *mtmp; +register dam; +{ + register tmp, res; + + nomul(0); + if(u.uswallow) return(0); + + if(mtmp->mhide && mtmp->mundetected) { + mtmp->mundetected = 0; + if(!Blind) { + register struct obj *obj; + extern char * Xmonnam(); + if(obj = o_at(mtmp->mx,mtmp->my)) + pline("%s was hidden under %s!", + Xmonnam(mtmp), doname(obj)); + } + } + + tmp = u.uac; + /* give people with Ac = -10 at least some vulnerability */ + if(tmp < 0) { + dam += tmp; /* decrease damage */ + if(dam <= 0) dam = 1; + tmp = -rn2(-tmp); + } + tmp += mtmp->data->mlevel; + if(multi < 0) tmp += 4; + if((Invis && mtmp->data->mlet != 'I') || !mtmp->mcansee) tmp -= 2; + if(mtmp->mtrapped) tmp -= 2; + if(tmp <= rnd(20)) { + if(Blind) pline("It misses."); + else pline("%s misses.",Monnam(mtmp)); + res = 0; + } else { + if(Blind) pline("It hits!"); + else pline("%s hits!",Monnam(mtmp)); + losehp_m(dam, mtmp); + res = 1; + } + stop_occupation(); + return(res); +} diff --git a/games/hack/hack.mklev.c b/games/hack/hack.mklev.c new file mode 100644 index 0000000..d2cee15 --- /dev/null +++ b/games/hack/hack.mklev.c @@ -0,0 +1,738 @@ +/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ +/* hack.mklev.c - version 1.0.4 */ + +#include "hack.h" + +extern struct monst *makemon(); +extern struct obj *mkobj_at(); +extern struct trap *maketrap(); + +#define somex() ((rand()%(croom->hx-croom->lx+1))+croom->lx) +#define somey() ((rand()%(croom->hy-croom->ly+1))+croom->ly) + +#include "def.mkroom.h" +#define XLIM 4 /* define minimum required space around a room */ +#define YLIM 3 +boolean secret; /* TRUE while making a vault: increase [XY]LIM */ +struct mkroom rooms[MAXNROFROOMS+1]; +int smeq[MAXNROFROOMS+1]; +coord doors[DOORMAX]; +int doorindex; +struct rm zerorm; +int comp(); +schar nxcor; +boolean goldseen; +int nroom; +xchar xdnstair,xupstair,ydnstair,yupstair; + +/* Definitions used by makerooms() and addrs() */ +#define MAXRS 50 /* max lth of temp rectangle table - arbitrary */ +struct rectangle { + xchar rlx,rly,rhx,rhy; +} rs[MAXRS+1]; +int rscnt,rsmax; /* 0..rscnt-1: currently under consideration */ + /* rscnt..rsmax: discarded */ + +makelevel() +{ + register struct mkroom *croom, *troom; + register unsigned tryct; + register x,y; + + nroom = 0; + doorindex = 0; + rooms[0].hx = -1; /* in case we are in a maze */ + + for(x=0; x= rn1(3, 26)) { /* there might be several mazes */ + makemaz(); + return; + } + + /* construct the rooms */ + nroom = 0; + secret = FALSE; + (void) makerooms(); + + /* construct stairs (up and down in different rooms if possible) */ + croom = &rooms[rn2(nroom)]; + xdnstair = somex(); + ydnstair = somey(); + levl[xdnstair][ydnstair].scrsym ='>'; + levl[xdnstair][ydnstair].typ = STAIRS; + if(nroom > 1) { + troom = croom; + croom = &rooms[rn2(nroom-1)]; + if(croom >= troom) croom++; + } + xupstair = somex(); /* %% < and > might be in the same place */ + yupstair = somey(); + levl[xupstair][yupstair].scrsym ='<'; + levl[xupstair][yupstair].typ = STAIRS; + + /* for each room: put things inside */ + for(croom = rooms; croom->hx > 0; croom++) { + + /* put a sleeping monster inside */ + /* Note: monster may be on the stairs. This cannot be + avoided: maybe the player fell through a trapdoor + while a monster was on the stairs. Conclusion: + we have to check for monsters on the stairs anyway. */ + if(!rn2(3)) (void) + makemon((struct permonst *) 0, somex(), somey()); + + /* put traps and mimics inside */ + goldseen = FALSE; + while(!rn2(8-(dlevel/6))) mktrap(0,0,croom); + if(!goldseen && !rn2(3)) mkgold(0L,somex(),somey()); + if(!rn2(3)) { + (void) mkobj_at(0, somex(), somey()); + tryct = 0; + while(!rn2(5)) { + if(++tryct > 100){ + printf("tryct overflow4\n"); + break; + } + (void) mkobj_at(0, somex(), somey()); + } + } + } + + qsort((char *) rooms, nroom, sizeof(struct mkroom), comp); + makecorridors(); + make_niches(); + + /* make a secret treasure vault, not connected to the rest */ + if(nroom <= (2*MAXNROFROOMS/3)) if(rn2(3)) { + troom = &rooms[nroom]; + secret = TRUE; + if(makerooms()) { + troom->rtype = VAULT; /* treasure vault */ + for(x = troom->lx; x <= troom->hx; x++) + for(y = troom->ly; y <= troom->hy; y++) + mkgold((long)(rnd(dlevel*100) + 50), x, y); + if(!rn2(3)) + makevtele(); + } + } + +#ifdef WIZARD + if(wizard && getenv("SHOPTYPE")) mkshop(); else +#endif WIZARD + if(dlevel > 1 && dlevel < 20 && rn2(dlevel) < 3) mkshop(); + else + if(dlevel > 6 && !rn2(7)) mkzoo(ZOO); + else + if(dlevel > 9 && !rn2(5)) mkzoo(BEEHIVE); + else + if(dlevel > 11 && !rn2(6)) mkzoo(MORGUE); + else + if(dlevel > 18 && !rn2(6)) mkswamp(); +} + +makerooms() { +register struct rectangle *rsp; +register int lx, ly, hx, hy, lowx, lowy, hix, hiy, dx, dy; +int tryct = 0, xlim, ylim; + + /* init */ + xlim = XLIM + secret; + ylim = YLIM + secret; + if(nroom == 0) { + rsp = rs; + rsp->rlx = rsp->rly = 0; + rsp->rhx = COLNO-1; + rsp->rhy = ROWNO-1; + rsmax = 1; + } + rscnt = rsmax; + + /* make rooms until satisfied */ + while(rscnt > 0 && nroom < MAXNROFROOMS-1) { + if(!secret && nroom > (MAXNROFROOMS/3) && + !rn2((MAXNROFROOMS-nroom)*(MAXNROFROOMS-nroom))) + return(0); + + /* pick a rectangle */ + rsp = &rs[rn2(rscnt)]; + hx = rsp->rhx; + hy = rsp->rhy; + lx = rsp->rlx; + ly = rsp->rly; + + /* find size of room */ + if(secret) + dx = dy = 1; + else { + dx = 2 + rn2((hx-lx-8 > 20) ? 12 : 8); + dy = 2 + rn2(4); + if(dx*dy > 50) + dy = 50/dx; + } + + /* look whether our room will fit */ + if(hx-lx < dx + dx/2 + 2*xlim || hy-ly < dy + dy/3 + 2*ylim) { + /* no, too small */ + /* maybe we throw this area out */ + if(secret || !rn2(MAXNROFROOMS+1-nroom-tryct)) { + rscnt--; + rs[rsmax] = *rsp; + *rsp = rs[rscnt]; + rs[rscnt] = rs[rsmax]; + tryct = 0; + } else + tryct++; + continue; + } + + lowx = lx + xlim + rn2(hx - lx - dx - 2*xlim + 1); + lowy = ly + ylim + rn2(hy - ly - dy - 2*ylim + 1); + hix = lowx + dx; + hiy = lowy + dy; + + if(maker(lowx, dx, lowy, dy)) { + if(secret) + return(1); + addrs(lowx-1, lowy-1, hix+1, hiy+1); + tryct = 0; + } else + if(tryct++ > 100) + break; + } + return(0); /* failed to make vault - very strange */ +} + +addrs(lowx,lowy,hix,hiy) +register int lowx,lowy,hix,hiy; +{ + register struct rectangle *rsp; + register int lx,ly,hx,hy,xlim,ylim; + boolean discarded; + + xlim = XLIM + secret; + ylim = YLIM + secret; + + /* walk down since rscnt and rsmax change */ + for(rsp = &rs[rsmax-1]; rsp >= rs; rsp--) { + + if((lx = rsp->rlx) > hix || (ly = rsp->rly) > hiy || + (hx = rsp->rhx) < lowx || (hy = rsp->rhy) < lowy) + continue; + if((discarded = (rsp >= &rs[rscnt]))) { + *rsp = rs[--rsmax]; + } else { + rsmax--; + rscnt--; + *rsp = rs[rscnt]; + if(rscnt != rsmax) + rs[rscnt] = rs[rsmax]; + } + if(lowy - ly > 2*ylim + 4) + addrsx(lx,ly,hx,lowy-2,discarded); + if(lowx - lx > 2*xlim + 4) + addrsx(lx,ly,lowx-2,hy,discarded); + if(hy - hiy > 2*ylim + 4) + addrsx(lx,hiy+2,hx,hy,discarded); + if(hx - hix > 2*xlim + 4) + addrsx(hix+2,ly,hx,hy,discarded); + } +} + +addrsx(lx,ly,hx,hy,discarded) +register int lx,ly,hx,hy; +boolean discarded; /* piece of a discarded area */ +{ + register struct rectangle *rsp; + + /* check inclusions */ + for(rsp = rs; rsp < &rs[rsmax]; rsp++) { + if(lx >= rsp->rlx && hx <= rsp->rhx && + ly >= rsp->rly && hy <= rsp->rhy) + return; + } + + /* make a new entry */ + if(rsmax >= MAXRS) { +#ifdef WIZARD + if(wizard) pline("MAXRS may be too small."); +#endif WIZARD + return; + } + rsmax++; + if(!discarded) { + *rsp = rs[rscnt]; + rsp = &rs[rscnt]; + rscnt++; + } + rsp->rlx = lx; + rsp->rly = ly; + rsp->rhx = hx; + rsp->rhy = hy; +} + +comp(x,y) +register struct mkroom *x,*y; +{ + if(x->lx < y->lx) return(-1); + return(x->lx > y->lx); +} + +coord +finddpos(xl,yl,xh,yh) { + coord ff; + register x,y; + + x = (xl == xh) ? xl : (xl + rn2(xh-xl+1)); + y = (yl == yh) ? yl : (yl + rn2(yh-yl+1)); + if(okdoor(x, y)) + goto gotit; + + for(x = xl; x <= xh; x++) for(y = yl; y <= yh; y++) + if(okdoor(x, y)) + goto gotit; + + for(x = xl; x <= xh; x++) for(y = yl; y <= yh; y++) + if(levl[x][y].typ == DOOR || levl[x][y].typ == SDOOR) + goto gotit; + /* cannot find something reasonable -- strange */ + x = xl; + y = yh; +gotit: + ff.x = x; + ff.y = y; + return(ff); +} + +/* see whether it is allowable to create a door at [x,y] */ +okdoor(x,y) +register x,y; +{ + if(levl[x-1][y].typ == DOOR || levl[x+1][y].typ == DOOR || + levl[x][y+1].typ == DOOR || levl[x][y-1].typ == DOOR || + levl[x-1][y].typ == SDOOR || levl[x+1][y].typ == SDOOR || + levl[x][y-1].typ == SDOOR || levl[x][y+1].typ == SDOOR || + (levl[x][y].typ != HWALL && levl[x][y].typ != VWALL) || + doorindex >= DOORMAX) + return(0); + return(1); +} + +dodoor(x,y,aroom) +register x,y; +register struct mkroom *aroom; +{ + if(doorindex >= DOORMAX) { + impossible("DOORMAX exceeded?"); + return; + } + if(!okdoor(x,y) && nxcor) + return; + dosdoor(x,y,aroom,rn2(8) ? DOOR : SDOOR); +} + +dosdoor(x,y,aroom,type) +register x,y; +register struct mkroom *aroom; +register type; +{ + register struct mkroom *broom; + register tmp; + + if(!IS_WALL(levl[x][y].typ)) /* avoid SDOORs with '+' as scrsym */ + type = DOOR; + levl[x][y].typ = type; + if(type == DOOR) + levl[x][y].scrsym = '+'; + aroom->doorct++; + broom = aroom+1; + if(broom->hx < 0) tmp = doorindex; else +for(tmp = doorindex; tmp > broom->fdoor; tmp--) + doors[tmp] = doors[tmp-1]; + doorindex++; + doors[tmp].x = x; + doors[tmp].y = y; + for( ; broom->hx >= 0; broom++) broom->fdoor++; +} + +/* Only called from makerooms() */ +maker(lowx,ddx,lowy,ddy) +schar lowx,ddx,lowy,ddy; +{ + register struct mkroom *croom; + register x, y, hix = lowx+ddx, hiy = lowy+ddy; + register xlim = XLIM + secret, ylim = YLIM + secret; + + if(nroom >= MAXNROFROOMS) return(0); + if(lowx < XLIM) lowx = XLIM; + if(lowy < YLIM) lowy = YLIM; + if(hix > COLNO-XLIM-1) hix = COLNO-XLIM-1; + if(hiy > ROWNO-YLIM-1) hiy = ROWNO-YLIM-1; +chk: + if(hix <= lowx || hiy <= lowy) return(0); + + /* check area around room (and make room smaller if necessary) */ + for(x = lowx - xlim; x <= hix + xlim; x++) { + for(y = lowy - ylim; y <= hiy + ylim; y++) { + if(levl[x][y].typ) { +#ifdef WIZARD + if(wizard && !secret) + pline("Strange area [%d,%d] in maker().",x,y); +#endif WIZARD + if(!rn2(3)) return(0); + if(x < lowx) + lowx = x+xlim+1; + else + hix = x-xlim-1; + if(y < lowy) + lowy = y+ylim+1; + else + hiy = y-ylim-1; + goto chk; + } + } + } + + croom = &rooms[nroom]; + + /* on low levels the room is lit (usually) */ + /* secret vaults are always lit */ + if((rnd(dlevel) < 10 && rn2(77)) || (ddx == 1 && ddy == 1)) { + for(x = lowx-1; x <= hix+1; x++) + for(y = lowy-1; y <= hiy+1; y++) + levl[x][y].lit = 1; + croom->rlit = 1; + } else + croom->rlit = 0; + croom->lx = lowx; + croom->hx = hix; + croom->ly = lowy; + croom->hy = hiy; + croom->rtype = croom->doorct = croom->fdoor = 0; + + for(x = lowx-1; x <= hix+1; x++) + for(y = lowy-1; y <= hiy+1; y += (hiy-lowy+2)) { + levl[x][y].scrsym = '-'; + levl[x][y].typ = HWALL; + } + for(x = lowx-1; x <= hix+1; x += (hix-lowx+2)) + for(y = lowy; y <= hiy; y++) { + levl[x][y].scrsym = '|'; + levl[x][y].typ = VWALL; + } + for(x = lowx; x <= hix; x++) + for(y = lowy; y <= hiy; y++) { + levl[x][y].scrsym = '.'; + levl[x][y].typ = ROOM; + } + + smeq[nroom] = nroom; + croom++; + croom->hx = -1; + nroom++; + return(1); +} + +makecorridors() { + register a,b; + + nxcor = 0; + for(a = 0; a < nroom-1; a++) + join(a, a+1); + for(a = 0; a < nroom-2; a++) + if(smeq[a] != smeq[a+2]) + join(a, a+2); + for(a = 0; a < nroom; a++) + for(b = 0; b < nroom; b++) + if(smeq[a] != smeq[b]) + join(a, b); + if(nroom > 2) + for(nxcor = rn2(nroom) + 4; nxcor; nxcor--) { + a = rn2(nroom); + b = rn2(nroom-2); + if(b >= a) b += 2; + join(a, b); + } +} + +join(a,b) +register a,b; +{ + coord cc,tt; + register tx, ty, xx, yy; + register struct rm *crm; + register struct mkroom *croom, *troom; + register dx, dy, dix, diy, cct; + + croom = &rooms[a]; + troom = &rooms[b]; + + /* find positions cc and tt for doors in croom and troom + and direction for a corridor between them */ + + if(troom->hx < 0 || croom->hx < 0 || doorindex >= DOORMAX) return; + if(troom->lx > croom->hx) { + dx = 1; + dy = 0; + xx = croom->hx+1; + tx = troom->lx-1; + cc = finddpos(xx,croom->ly,xx,croom->hy); + tt = finddpos(tx,troom->ly,tx,troom->hy); + } else if(troom->hy < croom->ly) { + dy = -1; + dx = 0; + yy = croom->ly-1; + cc = finddpos(croom->lx,yy,croom->hx,yy); + ty = troom->hy+1; + tt = finddpos(troom->lx,ty,troom->hx,ty); + } else if(troom->hx < croom->lx) { + dx = -1; + dy = 0; + xx = croom->lx-1; + tx = troom->hx+1; + cc = finddpos(xx,croom->ly,xx,croom->hy); + tt = finddpos(tx,troom->ly,tx,troom->hy); + } else { + dy = 1; + dx = 0; + yy = croom->hy+1; + ty = troom->ly-1; + cc = finddpos(croom->lx,yy,croom->hx,yy); + tt = finddpos(troom->lx,ty,troom->hx,ty); + } + xx = cc.x; + yy = cc.y; + tx = tt.x - dx; + ty = tt.y - dy; + if(nxcor && levl[xx+dx][yy+dy].typ) + return; + dodoor(xx,yy,croom); + + cct = 0; + while(xx != tx || yy != ty) { + xx += dx; + yy += dy; + + /* loop: dig corridor at [xx,yy] and find new [xx,yy] */ + if(cct++ > 500 || (nxcor && !rn2(35))) + return; + + if(xx == COLNO-1 || xx == 0 || yy == 0 || yy == ROWNO-1) + return; /* impossible */ + + crm = &levl[xx][yy]; + if(!(crm->typ)) { + if(rn2(100)) { + crm->typ = CORR; + crm->scrsym = CORR_SYM; + if(nxcor && !rn2(50)) + (void) mkobj_at(ROCK_SYM, xx, yy); + } else { + crm->typ = SCORR; + crm->scrsym = ' '; + } + } else + if(crm->typ != CORR && crm->typ != SCORR) { + /* strange ... */ + return; + } + + /* find next corridor position */ + dix = abs(xx-tx); + diy = abs(yy-ty); + + /* do we have to change direction ? */ + if(dy && dix > diy) { + register ddx = (xx > tx) ? -1 : 1; + + crm = &levl[xx+ddx][yy]; + if(!crm->typ || crm->typ == CORR || crm->typ == SCORR) { + dx = ddx; + dy = 0; + continue; + } + } else if(dx && diy > dix) { + register ddy = (yy > ty) ? -1 : 1; + + crm = &levl[xx][yy+ddy]; + if(!crm->typ || crm->typ == CORR || crm->typ == SCORR) { + dy = ddy; + dx = 0; + continue; + } + } + + /* continue straight on? */ + crm = &levl[xx+dx][yy+dy]; + if(!crm->typ || crm->typ == CORR || crm->typ == SCORR) + continue; + + /* no, what must we do now?? */ + if(dx) { + dx = 0; + dy = (ty < yy) ? -1 : 1; + crm = &levl[xx+dx][yy+dy]; + if(!crm->typ || crm->typ == CORR || crm->typ == SCORR) + continue; + dy = -dy; + continue; + } else { + dy = 0; + dx = (tx < xx) ? -1 : 1; + crm = &levl[xx+dx][yy+dy]; + if(!crm->typ || crm->typ == CORR || crm->typ == SCORR) + continue; + dx = -dx; + continue; + } + } + + /* we succeeded in digging the corridor */ + dodoor(tt.x, tt.y, troom); + + if(smeq[a] < smeq[b]) + smeq[b] = smeq[a]; + else + smeq[a] = smeq[b]; +} + +make_niches() +{ + register int ct = rnd(nroom/2 + 1); + while(ct--) makeniche(FALSE); +} + +makevtele() +{ + makeniche(TRUE); +} + +makeniche(with_trap) +boolean with_trap; +{ + register struct mkroom *aroom; + register struct rm *rm; + register int vct = 8; + coord dd; + register dy,xx,yy; + register struct trap *ttmp; + + if(doorindex < DOORMAX) + while(vct--) { + aroom = &rooms[rn2(nroom-1)]; + if(aroom->rtype != 0) continue; /* not an ordinary room */ + if(aroom->doorct == 1 && rn2(5)) continue; + if(rn2(2)) { + dy = 1; + dd = finddpos(aroom->lx,aroom->hy+1,aroom->hx,aroom->hy+1); + } else { + dy = -1; + dd = finddpos(aroom->lx,aroom->ly-1,aroom->hx,aroom->ly-1); + } + xx = dd.x; + yy = dd.y; + if((rm = &levl[xx][yy+dy])->typ) continue; + if(with_trap || !rn2(4)) { + rm->typ = SCORR; + rm->scrsym = ' '; + if(with_trap) { + ttmp = maketrap(xx, yy+dy, TELEP_TRAP); + ttmp->once = 1; + make_engr_at(xx, yy-dy, "ad ae?ar um"); + } + dosdoor(xx, yy, aroom, SDOOR); + } else { + rm->typ = CORR; + rm->scrsym = CORR_SYM; + if(rn2(7)) + dosdoor(xx, yy, aroom, rn2(5) ? SDOOR : DOOR); + else { + mksobj_at(SCR_TELEPORTATION, xx, yy+dy); + if(!rn2(3)) (void) mkobj_at(0, xx, yy+dy); + } + } + return; + } +} + +/* make a trap somewhere (in croom if mazeflag = 0) */ +mktrap(num,mazeflag,croom) +register num,mazeflag; +register struct mkroom *croom; +{ + register struct trap *ttmp; + register int kind,nopierc,nomimic,fakedoor,fakegold,tryct = 0; + register xchar mx,my; + extern char fut_geno[]; + + if(!num || num >= TRAPNUM) { + nopierc = (dlevel < 4) ? 1 : 0; + nomimic = (dlevel < 9 || goldseen ) ? 1 : 0; + if(index(fut_geno, 'M')) nomimic = 1; + kind = rn2(TRAPNUM - nopierc - nomimic); + /* note: PIERC = 7, MIMIC = 8, TRAPNUM = 9 */ + } else kind = num; + + if(kind == MIMIC) { + register struct monst *mtmp; + + fakedoor = (!rn2(3) && !mazeflag); + fakegold = (!fakedoor && !rn2(2)); + if(fakegold) goldseen = TRUE; + do { + if(++tryct > 200) return; + if(fakedoor) { + /* note: fakedoor maybe on actual door */ + if(rn2(2)){ + if(rn2(2)) + mx = croom->hx+1; + else mx = croom->lx-1; + my = somey(); + } else { + if(rn2(2)) + my = croom->hy+1; + else my = croom->ly-1; + mx = somex(); + } + } else if(mazeflag) { + extern coord mazexy(); + coord mm; + mm = mazexy(); + mx = mm.x; + my = mm.y; + } else { + mx = somex(); + my = somey(); + } + } while(m_at(mx,my) || levl[mx][my].typ == STAIRS); + if(mtmp = makemon(PM_MIMIC,mx,my)) { + mtmp->mimic = 1; + mtmp->mappearance = + fakegold ? '$' : fakedoor ? '+' : + (mazeflag && rn2(2)) ? AMULET_SYM : + "=/)%?![<>" [ rn2(9) ]; + } + return; + } + + do { + if(++tryct > 200) + return; + if(mazeflag){ + extern coord mazexy(); + coord mm; + mm = mazexy(); + mx = mm.x; + my = mm.y; + } else { + mx = somex(); + my = somey(); + } + } while(t_at(mx, my) || levl[mx][my].typ == STAIRS); + ttmp = maketrap(mx, my, kind); + if(mazeflag && !rn2(10) && ttmp->ttyp < PIERC) + ttmp->tseen = 1; +} diff --git a/games/hack/hack.mkmaze.c b/games/hack/hack.mkmaze.c new file mode 100644 index 0000000..bee24f9 --- /dev/null +++ b/games/hack/hack.mkmaze.c @@ -0,0 +1,136 @@ +/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ +/* hack.mkmaze.c - version 1.0.2 */ + +#include "hack.h" +#include "def.mkroom.h" /* not really used */ +extern struct monst *makemon(); +extern struct permonst pm_wizard; +extern struct obj *mkobj_at(); +extern coord mazexy(); +struct permonst hell_hound = + { "hell hound", 'd', 12, 14, 2, 3, 6, 0 }; + +makemaz() +{ + int x,y; + register zx,zy; + coord mm; + boolean al = (dlevel >= 30 && !flags.made_amulet); + + for(x = 2; x < COLNO-1; x++) + for(y = 2; y < ROWNO-1; y++) + levl[x][y].typ = (x%2 && y%2) ? 0 : HWALL; + if(al) { + register struct monst *mtmp; + + zx = 2*(COLNO/4) - 1; + zy = 2*(ROWNO/4) - 1; + for(x = zx-2; x < zx+4; x++) for(y = zy-2; y <= zy+2; y++) { + levl[x][y].typ = + (y == zy-2 || y == zy+2 || x == zx-2 || x == zx+3) ? POOL : + (y == zy-1 || y == zy+1 || x == zx-1 || x == zx+2) ? HWALL: + ROOM; + } + (void) mkobj_at(AMULET_SYM, zx, zy); + flags.made_amulet = 1; + walkfrom(zx+4, zy); + if(mtmp = makemon(&hell_hound, zx, zy)) + mtmp->msleep = 1; + if(mtmp = makemon(PM_WIZARD, zx+1, zy)) { + mtmp->msleep = 1; + flags.no_of_wizards = 1; + } + } else { + mm = mazexy(); + zx = mm.x; + zy = mm.y; + walkfrom(zx,zy); + (void) mksobj_at(WAN_WISHING, zx, zy); + (void) mkobj_at(ROCK_SYM, zx, zy); /* put a rock on top of it */ + } + + for(x = 2; x < COLNO-1; x++) + for(y = 2; y < ROWNO-1; y++) { + switch(levl[x][y].typ) { + case HWALL: + levl[x][y].scrsym = '-'; + break; + case ROOM: + levl[x][y].scrsym = '.'; + break; + } + } + for(x = rn1(8,11); x; x--) { + mm = mazexy(); + (void) mkobj_at(rn2(2) ? GEM_SYM : 0, mm.x, mm.y); + } + for(x = rn1(10,2); x; x--) { + mm = mazexy(); + (void) mkobj_at(ROCK_SYM, mm.x, mm.y); + } + mm = mazexy(); + (void) makemon(PM_MINOTAUR, mm.x, mm.y); + for(x = rn1(5,7); x; x--) { + mm = mazexy(); + (void) makemon((struct permonst *) 0, mm.x, mm.y); + } + for(x = rn1(6,7); x; x--) { + mm = mazexy(); + mkgold(0L,mm.x,mm.y); + } + for(x = rn1(6,7); x; x--) + mktrap(0,1,(struct mkroom *) 0); + mm = mazexy(); + levl[(xupstair = mm.x)][(yupstair = mm.y)].scrsym = '<'; + levl[xupstair][yupstair].typ = STAIRS; + xdnstair = ydnstair = 0; +} + +walkfrom(x,y) int x,y; { +register int q,a,dir; +int dirs[4]; + levl[x][y].typ = ROOM; + while(1) { + q = 0; + for(a = 0; a < 4; a++) + if(okay(x,y,a)) dirs[q++]= a; + if(!q) return; + dir = dirs[rn2(q)]; + move(&x,&y,dir); + levl[x][y].typ = ROOM; + move(&x,&y,dir); + walkfrom(x,y); + } +} + +move(x,y,dir) +register int *x, *y; +register int dir; +{ + switch(dir){ + case 0: --(*y); break; + case 1: (*x)++; break; + case 2: (*y)++; break; + case 3: --(*x); break; + } +} + +okay(x,y,dir) +int x,y; +register int dir; +{ + move(&x,&y,dir); + move(&x,&y,dir); + if(x<3 || y<3 || x>COLNO-3 || y>ROWNO-3 || levl[x][y].typ != 0) + return(0); + else + return(1); +} + +coord +mazexy(){ + coord mm; + mm.x = 3 + 2*rn2(COLNO/2 - 2); + mm.y = 3 + 2*rn2(ROWNO/2 - 2); + return mm; +} diff --git a/games/hack/hack.mkobj.c b/games/hack/hack.mkobj.c new file mode 100644 index 0000000..7033066 --- /dev/null +++ b/games/hack/hack.mkobj.c @@ -0,0 +1,149 @@ +/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ +/* hack.mkobj.c - version 1.0.3 */ + +#include "hack.h" + +char mkobjstr[] = "))[[!!!!????%%%%/=**))[[!!!!????%%%%/=**(%"; +struct obj *mkobj(), *mksobj(); + +struct obj * +mkobj_at(let,x,y) +register let,x,y; +{ + register struct obj *otmp = mkobj(let); + otmp->ox = x; + otmp->oy = y; + otmp->nobj = fobj; + fobj = otmp; + return(otmp); +} + +mksobj_at(otyp,x,y) +register otyp,x,y; +{ + register struct obj *otmp = mksobj(otyp); + otmp->ox = x; + otmp->oy = y; + otmp->nobj = fobj; + fobj = otmp; +} + +struct obj * +mkobj(let) { + if(!let) + let = mkobjstr[rn2(sizeof(mkobjstr) - 1)]; + return( + mksobj( + letter(let) ? + CORPSE + ((let > 'Z') ? (let-'a'+'Z'-'@'+1) : (let-'@')) + : probtype(let) + ) + ); +} + + +struct obj zeroobj; + +struct obj * +mksobj(otyp) +register otyp; +{ + register struct obj *otmp; + char let = objects[otyp].oc_olet; + + otmp = newobj(0); + *otmp = zeroobj; + otmp->age = moves; + otmp->o_id = flags.ident++; + otmp->quan = 1; + otmp->olet = let; + otmp->otyp = otyp; + otmp->dknown = index("/=!?*", let) ? 0 : 1; + switch(let) { + case WEAPON_SYM: + otmp->quan = (otmp->otyp <= ROCK) ? rn1(6,6) : 1; + if(!rn2(11)) otmp->spe = rnd(3); + else if(!rn2(10)) { + otmp->cursed = 1; + otmp->spe = -rnd(3); + } + break; + case FOOD_SYM: + if(otmp->otyp >= CORPSE) break; +#ifdef NOT_YET_IMPLEMENTED + /* if tins are to be identified, need to adapt doname() etc */ + if(otmp->otyp == TIN) + otmp->spe = rnd(...); +#endif NOT_YET_IMPLEMENTED + /* fall into next case */ + case GEM_SYM: + otmp->quan = rn2(6) ? 1 : 2; + case TOOL_SYM: + case CHAIN_SYM: + case BALL_SYM: + case ROCK_SYM: + case POTION_SYM: + case SCROLL_SYM: + case AMULET_SYM: + break; + case ARMOR_SYM: + if(!rn2(8)) otmp->cursed = 1; + if(!rn2(10)) otmp->spe = rnd(3); + else if(!rn2(9)) { + otmp->spe = -rnd(3); + otmp->cursed = 1; + } + break; + case WAND_SYM: + if(otmp->otyp == WAN_WISHING) otmp->spe = 3; else + otmp->spe = rn1(5, + (objects[otmp->otyp].bits & NODIR) ? 11 : 4); + break; + case RING_SYM: + if(objects[otmp->otyp].bits & SPEC) { + if(!rn2(3)) { + otmp->cursed = 1; + otmp->spe = -rnd(2); + } else otmp->spe = rnd(2); + } else if(otmp->otyp == RIN_TELEPORTATION || + otmp->otyp == RIN_AGGRAVATE_MONSTER || + otmp->otyp == RIN_HUNGER || !rn2(9)) + otmp->cursed = 1; + break; + default: + panic("impossible mkobj"); + } + otmp->owt = weight(otmp); + return(otmp); +} + +letter(c) { + return(('@' <= c && c <= 'Z') || ('a' <= c && c <= 'z')); +} + +weight(obj) +register struct obj *obj; +{ +/* KLUDGE -- our C chokes on the return below if `wt' is register */ +/* register */ int wt = objects[obj->otyp].oc_weight; + return(wt ? wt*obj->quan : (obj->quan + 1)/2); +} + +mkgold(num,x,y) +register long num; +{ + register struct gold *gold; + register long amount = (num ? num : 1 + (rnd(dlevel+2) * rnd(30))); + + if(gold = g_at(x,y)) + gold->amount += amount; + else { + gold = newgold(); + gold->ngold = fgold; + gold->gx = x; + gold->gy = y; + gold->amount = amount; + fgold = gold; + /* do sth with display? */ + } +} diff --git a/games/hack/hack.mkshop.c b/games/hack/hack.mkshop.c new file mode 100644 index 0000000..11e8476 --- /dev/null +++ b/games/hack/hack.mkshop.c @@ -0,0 +1,274 @@ +/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ +/* hack.mkshop.c - version 1.0.3 */ + +#ifndef QUEST +#include "hack.h" +#include "def.mkroom.h" +#include "def.eshk.h" +#define ESHK ((struct eshk *)(&(shk->mextra[0]))) +extern struct monst *makemon(); +extern struct obj *mkobj_at(); +extern int nroom; +extern char shtypes[]; /* = "=/)%?!["; 8 types: 7 specialized, 1 mixed */ +schar shprobs[] = { 3,3,5,5,10,10,14,50 }; /* their probabilities */ + +mkshop(){ +register struct mkroom *sroom; +register int sh,sx,sy,i = -1; +register char let; +int roomno; +register struct monst *shk; +#ifdef WIZARD + /* first determine shoptype */ + if(wizard){ + extern char *getenv(); + register char *ep = getenv("SHOPTYPE"); + if(ep){ + if(*ep == 'z' || *ep == 'Z'){ + mkzoo(ZOO); + return; + } + if(*ep == 'm' || *ep == 'M'){ + mkzoo(MORGUE); + return; + } + if(*ep == 'b' || *ep == 'B'){ + mkzoo(BEEHIVE); + return; + } + if(*ep == 's' || *ep == 'S'){ + mkswamp(); + return; + } + for(i=0; shtypes[i]; i++) + if(*ep == shtypes[i]) break; + goto gottype; + } + } +gottype: +#endif WIZARD + for(sroom = &rooms[0], roomno = 0; ; sroom++, roomno++){ + if(sroom->hx < 0) return; + if(sroom - rooms >= nroom) { + pline("rooms not closed by -1?"); + return; + } + if(sroom->rtype) continue; + if(!sroom->rlit || has_dnstairs(sroom) || has_upstairs(sroom)) + continue; + if( +#ifdef WIZARD + (wizard && getenv("SHOPTYPE") && sroom->doorct != 0) || +#endif WIZARD + sroom->doorct == 1) break; + } + + if(i < 0) { /* shoptype not yet determined */ + register int j; + + for(j = rn2(100), i = 0; (j -= shprobs[i])>= 0; i++) + if(!shtypes[i]) break; /* superfluous */ + if(isbig(sroom) && i + SHOPBASE == WANDSHOP) + i = GENERAL-SHOPBASE; + } + sroom->rtype = i + SHOPBASE; + let = shtypes[i]; + sh = sroom->fdoor; + sx = doors[sh].x; + sy = doors[sh].y; + if(sx == sroom->lx-1) sx++; else + if(sx == sroom->hx+1) sx--; else + if(sy == sroom->ly-1) sy++; else + if(sy == sroom->hy+1) sy--; else { +#ifdef WIZARD + /* This is said to happen sometimes, but I've never seen it. */ + if(wizard) { + register int j = sroom->doorct; + extern int doorindex; + + pline("Where is shopdoor?"); + pline("Room at (%d,%d),(%d,%d).", sroom->lx, sroom->ly, + sroom->hx, sroom->hy); + pline("doormax=%d doorct=%d fdoor=%d", + doorindex, sroom->doorct, sh); + while(j--) { + pline("door [%d,%d]", doors[sh].x, doors[sh].y); + sh++; + } + more(); + } +#endif WIZARD + return; + } + if(!(shk = makemon(PM_SHK,sx,sy))) return; + shk->isshk = shk->mpeaceful = 1; + shk->msleep = 0; + shk->mtrapseen = ~0; /* we know all the traps already */ + ESHK->shoproom = roomno; + ESHK->shoplevel = dlevel; + ESHK->shd = doors[sh]; + ESHK->shk.x = sx; + ESHK->shk.y = sy; + ESHK->robbed = 0; + ESHK->visitct = 0; + ESHK->following = 0; + shk->mgold = 1000 + 30*rnd(100); /* initial capital */ + ESHK->billct = 0; + findname(ESHK->shknam, let); + for(sx = sroom->lx; sx <= sroom->hx; sx++) + for(sy = sroom->ly; sy <= sroom->hy; sy++){ + register struct monst *mtmp; + if((sx == sroom->lx && doors[sh].x == sx-1) || + (sx == sroom->hx && doors[sh].x == sx+1) || + (sy == sroom->ly && doors[sh].y == sy-1) || + (sy == sroom->hy && doors[sh].y == sy+1)) continue; + if(rn2(100) < dlevel && !m_at(sx,sy) && + (mtmp = makemon(PM_MIMIC, sx, sy))){ + mtmp->mimic = 1; + mtmp->mappearance = + (let && rn2(10) < dlevel) ? let : ']'; + continue; + } + (void) mkobj_at(let, sx, sy); + } +} + +mkzoo(type) +int type; +{ + register struct mkroom *sroom; + register struct monst *mon; + register int sh,sx,sy,i; + int goldlim = 500 * dlevel; + int moct = 0; + struct permonst *morguemon(); + + i = nroom; + for(sroom = &rooms[rn2(nroom)]; ; sroom++) { + if(sroom == &rooms[nroom]) + sroom = &rooms[0]; + if(!i-- || sroom->hx < 0) + return; + if(sroom->rtype) + continue; + if(type == MORGUE && sroom->rlit) + continue; + if(has_upstairs(sroom) || (has_dnstairs(sroom) && rn2(3))) + continue; + if(sroom->doorct == 1 || !rn2(5)) + break; + } + sroom->rtype = type; + sh = sroom->fdoor; + for(sx = sroom->lx; sx <= sroom->hx; sx++) + for(sy = sroom->ly; sy <= sroom->hy; sy++){ + if((sx == sroom->lx && doors[sh].x == sx-1) || + (sx == sroom->hx && doors[sh].x == sx+1) || + (sy == sroom->ly && doors[sh].y == sy-1) || + (sy == sroom->hy && doors[sh].y == sy+1)) continue; + mon = makemon( + (type == MORGUE) ? morguemon() : + (type == BEEHIVE) ? PM_KILLER_BEE : (struct permonst *) 0, + sx, sy); + if(mon) mon->msleep = 1; + switch(type) { + case ZOO: + i = sq(dist2(sx,sy,doors[sh].x,doors[sh].y)); + if(i >= goldlim) i = 5*dlevel; + goldlim -= i; + mkgold((long)(10 + rn2(i)), sx, sy); + break; + case MORGUE: + /* Usually there is one dead body in the morgue */ + if(!moct && rn2(3)) { + mksobj_at(CORPSE, sx, sy); + moct++; + } + break; + case BEEHIVE: + if(!rn2(3)) mksobj_at(LUMP_OF_ROYAL_JELLY, sx, sy); + break; + } + } +} + +struct permonst * +morguemon() +{ + extern struct permonst pm_ghost; + register int i = rn2(100), hd = rn2(dlevel); + + if(hd > 10 && i < 10) return(PM_DEMON); + if(hd > 8 && i > 85) return(PM_VAMPIRE); + return((i < 40) ? PM_GHOST : (i < 60) ? PM_WRAITH : PM_ZOMBIE); +} + +mkswamp() /* Michiel Huisjes & Fred de Wilde */ +{ + register struct mkroom *sroom; + register int sx,sy,i,eelct = 0; + extern struct permonst pm_eel; + + for(i=0; i<5; i++) { /* 5 tries */ + sroom = &rooms[rn2(nroom)]; + if(sroom->hx < 0 || sroom->rtype || + has_upstairs(sroom) || has_dnstairs(sroom)) + continue; + + /* satisfied; make a swamp */ + sroom->rtype = SWAMP; + for(sx = sroom->lx; sx <= sroom->hx; sx++) + for(sy = sroom->ly; sy <= sroom->hy; sy++) + if((sx+sy)%2 && !o_at(sx,sy) && !t_at(sx,sy) + && !m_at(sx,sy) && !nexttodoor(sx,sy)){ + levl[sx][sy].typ = POOL; + levl[sx][sy].scrsym = POOL_SYM; + if(!eelct || !rn2(4)) { + (void) makemon(PM_EEL, sx, sy); + eelct++; + } + } + } +} + +nexttodoor(sx,sy) +register sx,sy; +{ + register dx,dy; + register struct rm *lev; + for(dx = -1; dx <= 1; dx++) for(dy = -1; dy <= 1; dy++) + if((lev = &levl[sx+dx][sy+dy])->typ == DOOR || + lev->typ == SDOOR || lev->typ == LDOOR) + return(1); + return(0); +} + +has_dnstairs(sroom) +register struct mkroom *sroom; +{ + return(sroom->lx <= xdnstair && xdnstair <= sroom->hx && + sroom->ly <= ydnstair && ydnstair <= sroom->hy); +} + +has_upstairs(sroom) +register struct mkroom *sroom; +{ + return(sroom->lx <= xupstair && xupstair <= sroom->hx && + sroom->ly <= yupstair && yupstair <= sroom->hy); +} + +isbig(sroom) +register struct mkroom *sroom; +{ + register int area = (sroom->hx - sroom->lx) * (sroom->hy - sroom->ly); + return( area > 20 ); +} + +dist2(x0,y0,x1,y1){ + return((x0-x1)*(x0-x1) + (y0-y1)*(y0-y1)); +} + +sq(a) int a; { + return(a*a); +} +#endif QUEST diff --git a/games/hack/hack.mon.c b/games/hack/hack.mon.c new file mode 100644 index 0000000..96710d0 --- /dev/null +++ b/games/hack/hack.mon.c @@ -0,0 +1,846 @@ +/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ +/* hack.mon.c - version 1.0.3 */ + +#include "hack.h" +#include "hack.mfndpos.h" +#define NULL (char *) 0 +extern struct monst *makemon(); +extern struct obj *mkobj_at(); + +int warnlevel; /* used by movemon and dochugw */ +long lastwarntime; +int lastwarnlev; +char *warnings[] = { + "white", "pink", "red", "ruby", "purple", "black" +}; + +movemon() +{ + register struct monst *mtmp; + register int fr; + + warnlevel = 0; + + while(1) { + /* find a monster that we haven't treated yet */ + /* note that mtmp or mtmp->nmon might get killed + while mtmp moves, so we cannot just walk down the + chain (even new monsters might get created!) */ + for(mtmp = fmon; mtmp; mtmp = mtmp->nmon) + if(mtmp->mlstmv < moves) goto next_mon; + /* treated all monsters */ + break; + + next_mon: + mtmp->mlstmv = moves; + + /* most monsters drown in pools */ + { boolean inpool, iseel; + + inpool = (levl[mtmp->mx][mtmp->my].typ == POOL); + iseel = (mtmp->data->mlet == ';'); + if(inpool && !iseel) { + if(cansee(mtmp->mx,mtmp->my)) + pline("%s drowns.", Monnam(mtmp)); + mondead(mtmp); + continue; + } + /* but eels have a difficult time outside */ + if(iseel && !inpool) { + if(mtmp->mhp > 1) mtmp->mhp--; + mtmp->mflee = 1; + mtmp->mfleetim += 2; + } + } + if(mtmp->mblinded && !--mtmp->mblinded) + mtmp->mcansee = 1; + if(mtmp->mfleetim && !--mtmp->mfleetim) + mtmp->mflee = 0; + if(mtmp->mimic) continue; + if(mtmp->mspeed != MSLOW || !(moves%2)){ + /* continue if the monster died fighting */ + fr = -1; + if(Conflict && cansee(mtmp->mx,mtmp->my) + && (fr = fightm(mtmp)) == 2) + continue; + if(fr<0 && dochugw(mtmp)) + continue; + } + if(mtmp->mspeed == MFAST && dochugw(mtmp)) + continue; + } + + warnlevel -= u.ulevel; + if(warnlevel >= SIZE(warnings)) + warnlevel = SIZE(warnings)-1; + if(warnlevel >= 0) + if(warnlevel > lastwarnlev || moves > lastwarntime + 5){ + register char *rr; +/* KLUDGE -- can't switch on longs!! + switch(Warning & (LEFT_RING | RIGHT_RING)){ + case LEFT_RING: + rr = "Your left ring glows"; + break; + case RIGHT_RING: + rr = "Your right ring glows"; + break; + case LEFT_RING | RIGHT_RING: + rr = "Both your rings glow"; + break; + default: + rr = "Your fingertips glow"; + break; + } +*/ + long swtval = Warning & (LEFT_RING | RIGHT_RING); + if(swtval == LEFT_RING) rr = "Your left ring glows"; + else if(swtval == RIGHT_RING) rr = "Your right ring glows"; + else if(swtval == LEFT_RING + | RIGHT_RING) rr = "Both your rings glow"; + else rr = "Your fingertips glow"; + pline("%s %s!", rr, warnings[warnlevel]); + lastwarntime = moves; + lastwarnlev = warnlevel; + } + + dmonsfree(); /* remove all dead monsters */ +} + +justswld(mtmp,name) +register struct monst *mtmp; +char *name; +{ + + mtmp->mx = u.ux; + mtmp->my = u.uy; + u.ustuck = mtmp; + pmon(mtmp); + kludge("%s swallows you!",name); + more(); + seeoff(1); + u.uswallow = 1; + u.uswldtim = 0; + swallowed(); +} + +youswld(mtmp,dam,die,name) +register struct monst *mtmp; +register dam,die; +char *name; +{ + if(mtmp != u.ustuck) return; + kludge("%s digests you!",name); + u.uhp -= dam; + if(u.uswldtim++ >= die){ /* a3 */ + pline("It totally digests you!"); + u.uhp = -1; + } + if(u.uhp < 1) done_in_by(mtmp); + /* flags.botlx = 1; /* should we show status line ? */ +} + +dochugw(mtmp) register struct monst *mtmp; { +register x = mtmp->mx; +register y = mtmp->my; +register d = dochug(mtmp); +register dd; + if(!d) /* monster still alive */ + if(Warning) + if(!mtmp->mpeaceful) + if(mtmp->data->mlevel > warnlevel) + if((dd = dist(mtmp->mx,mtmp->my)) < dist(x,y)) + if(dd < 100) + if(!canseemon(mtmp)) + warnlevel = mtmp->data->mlevel; + return(d); +} + +/* returns 1 if monster died moving, 0 otherwise */ +dochug(mtmp) +register struct monst *mtmp; +{ + register struct permonst *mdat; + register tmp, nearby, scared; + + if(mtmp->cham && !rn2(6)) + (void) newcham(mtmp, &mons[dlevel+14+rn2(CMNUM-14-dlevel)]); + mdat = mtmp->data; + if(mdat->mlevel < 0) + panic("bad monster %c (%d)",mdat->mlet,mdat->mlevel); + + /* regenerate monsters */ + if((!(moves%20) || index(MREGEN, mdat->mlet)) && + mtmp->mhp < mtmp->mhpmax) + mtmp->mhp++; + + if(mtmp->mfroz) return(0); /* frozen monsters don't do anything */ + + if(mtmp->msleep) { + /* wake up, or get out of here. */ + /* ettins are hard to surprise */ + /* Nymphs and Leprechauns do not easily wake up */ + if(cansee(mtmp->mx,mtmp->my) && + (!Stealth || (mdat->mlet == 'e' && rn2(10))) && + (!index("NL",mdat->mlet) || !rn2(50)) && + (Aggravate_monster || index("d1", mdat->mlet) + || (!rn2(7) && !mtmp->mimic))) + mtmp->msleep = 0; + else return(0); + } + + /* not frozen or sleeping: wipe out texts written in the dust */ + wipe_engr_at(mtmp->mx, mtmp->my, 1); + + /* confused monsters get unconfused with small probability */ + if(mtmp->mconf && !rn2(50)) mtmp->mconf = 0; + + /* some monsters teleport */ + if(mtmp->mflee && index("tNL", mdat->mlet) && !rn2(40)){ + rloc(mtmp); + return(0); + } + if(mdat->mmove < rnd(6)) return(0); + + /* fleeing monsters might regain courage */ + if(mtmp->mflee && !mtmp->mfleetim + && mtmp->mhp == mtmp->mhpmax && !rn2(25)) + mtmp->mflee = 0; + + nearby = (dist(mtmp->mx, mtmp->my) < 3); + scared = (nearby && (sengr_at("Elbereth", u.ux, u.uy) || + sobj_at(SCR_SCARE_MONSTER, u.ux, u.uy))); + if(scared && !mtmp->mflee) { + mtmp->mflee = 1; + mtmp->mfleetim = (rn2(7) ? rnd(10) : rnd(100)); + } + + if(!nearby || + mtmp->mflee || + mtmp->mconf || + (mtmp->minvis && !rn2(3)) || + (index("BIuy", mdat->mlet) && !rn2(4)) || + (mdat->mlet == 'L' && !u.ugold && (mtmp->mgold || rn2(2))) || + (!mtmp->mcansee && !rn2(4)) || + mtmp->mpeaceful + ) { + tmp = m_move(mtmp,0); /* 2: monster died moving */ + if(tmp == 2 || (tmp && mdat->mmove <= 12)) + return(tmp == 2); + } + + if(!index("Ea", mdat->mlet) && nearby && + !mtmp->mpeaceful && u.uhp > 0 && !scared) { + if(mhitu(mtmp)) + return(1); /* monster died (e.g. 'y' or 'F') */ + } + /* extra movement for fast monsters */ + if(mdat->mmove-12 > rnd(12)) tmp = m_move(mtmp,1); + return(tmp == 2); +} + +m_move(mtmp,after) +register struct monst *mtmp; +{ + register struct monst *mtmp2; + register nx,ny,omx,omy,appr,nearer,cnt,i,j; + xchar gx,gy,nix,niy,chcnt; + schar chi; + boolean likegold, likegems, likeobjs; + char msym = mtmp->data->mlet; + schar mmoved = 0; /* not strictly nec.: chi >= 0 will do */ + coord poss[9]; + int info[9]; + + if(mtmp->mfroz || mtmp->msleep) + return(0); + if(mtmp->mtrapped) { + i = mintrap(mtmp); + if(i == 2) return(2); /* he died */ + if(i == 1) return(0); /* still in trap, so didnt move */ + } + if(mtmp->mhide && o_at(mtmp->mx,mtmp->my) && rn2(10)) + return(0); /* do not leave hiding place */ + +#ifndef NOWORM + if(mtmp->wormno) + goto not_special; +#endif NOWORM + + /* my dog gets a special treatment */ + if(mtmp->mtame) { + return( dog_move(mtmp, after) ); + } + + /* likewise for shopkeeper */ + if(mtmp->isshk) { + mmoved = shk_move(mtmp); + if(mmoved >= 0) + goto postmov; + mmoved = 0; /* follow player outside shop */ + } + + /* and for the guard */ + if(mtmp->isgd) { + mmoved = gd_move(); + goto postmov; + } + +/* teleport if that lies in our nature ('t') or when badly wounded ('1') */ + if((msym == 't' && !rn2(5)) + || (msym == '1' && (mtmp->mhp < 7 || (!xdnstair && !rn2(5)) + || levl[u.ux][u.uy].typ == STAIRS))) { + if(mtmp->mhp < 7 || (msym == 't' && rn2(2))) + rloc(mtmp); + else + mnexto(mtmp); + mmoved = 1; + goto postmov; + } + + /* spit fire ('D') or use a wand ('1') when appropriate */ + if(index("D1", msym)) + inrange(mtmp); + + if(msym == 'U' && !mtmp->mcan && canseemon(mtmp) && + mtmp->mcansee && rn2(5)) { + if(!Confusion) + pline("%s's gaze has confused you!", Monnam(mtmp)); + else + pline("You are getting more and more confused."); + if(rn2(3)) mtmp->mcan = 1; + Confusion += d(3,4); /* timeout */ + } +not_special: + if(!mtmp->mflee && u.uswallow && u.ustuck != mtmp) return(1); + appr = 1; + if(mtmp->mflee) appr = -1; + if(mtmp->mconf || Invis || !mtmp->mcansee || + (index("BIy", msym) && !rn2(3))) + appr = 0; + omx = mtmp->mx; + omy = mtmp->my; + gx = u.ux; + gy = u.uy; + if(msym == 'L' && appr == 1 && mtmp->mgold > u.ugold) + appr = -1; + + /* random criterion for 'smell' or track finding ability + should use mtmp->msmell or sth + */ + if(msym == '@' || + ('a' <= msym && msym <= 'z')) { + extern coord *gettrack(); + register coord *cp; + schar mroom; + mroom = inroom(omx,omy); + if(mroom < 0 || mroom != inroom(u.ux,u.uy)){ + cp = gettrack(omx,omy); + if(cp){ + gx = cp->x; + gy = cp->y; + } + } + } + + /* look for gold or jewels nearby */ + likegold = (index("LOD", msym) != NULL); + likegems = (index("ODu", msym) != NULL); + likeobjs = mtmp->mhide; +#define SRCHRADIUS 25 + { xchar mind = SRCHRADIUS; /* not too far away */ + register int dd; + if(likegold){ + register struct gold *gold; + for(gold = fgold; gold; gold = gold->ngold) + if((dd = DIST(omx,omy,gold->gx,gold->gy)) < mind){ + mind = dd; + gx = gold->gx; + gy = gold->gy; + } + } + if(likegems || likeobjs){ + register struct obj *otmp; + for(otmp = fobj; otmp; otmp = otmp->nobj) + if(likeobjs || otmp->olet == GEM_SYM) + if(msym != 'u' || + objects[otmp->otyp].g_val != 0) + if((dd = DIST(omx,omy,otmp->ox,otmp->oy)) < mind){ + mind = dd; + gx = otmp->ox; + gy = otmp->oy; + } + } + if(mind < SRCHRADIUS && appr == -1) { + if(dist(omx,omy) < 10) { + gx = u.ux; + gy = u.uy; + } else + appr = 1; + } + } + nix = omx; + niy = omy; + cnt = mfndpos(mtmp,poss,info, + msym == 'u' ? NOTONL : + (msym == '@' || msym == '1') ? (ALLOW_SSM | ALLOW_TRAPS) : + index(UNDEAD, msym) ? NOGARLIC : ALLOW_TRAPS); + /* ALLOW_ROCK for some monsters ? */ + chcnt = 0; + chi = -1; + for(i=0; imtrack[j].x && ny == mtmp->mtrack[j].y) + if(rn2(4*(cnt-j))) goto nxti; +#ifdef STUPID + /* some stupid compilers think that this is too complicated */ + { int d1 = DIST(nx,ny,gx,gy); + int d2 = DIST(nix,niy,gx,gy); + nearer = (d1 < d2); + } +#else + nearer = (DIST(nx,ny,gx,gy) < DIST(nix,niy,gx,gy)); +#endif STUPID + if((appr == 1 && nearer) || (appr == -1 && !nearer) || + !mmoved || + (!appr && !rn2(++chcnt))){ + nix = nx; + niy = ny; + chi = i; + mmoved = 1; + } + nxti: ; + } + if(mmoved){ + if(info[chi] & ALLOW_M){ + mtmp2 = m_at(nix,niy); + if(hitmm(mtmp,mtmp2) == 1 && rn2(4) && + hitmm(mtmp2,mtmp) == 2) return(2); + return(0); + } + if(info[chi] & ALLOW_U){ + (void) hitu(mtmp, d(mtmp->data->damn, mtmp->data->damd)+1); + return(0); + } + mtmp->mx = nix; + mtmp->my = niy; + for(j=MTSZ-1; j>0; j--) mtmp->mtrack[j] = mtmp->mtrack[j-1]; + mtmp->mtrack[0].x = omx; + mtmp->mtrack[0].y = omy; +#ifndef NOWORM + if(mtmp->wormno) worm_move(mtmp); +#endif NOWORM + } else { + if(msym == 'u' && rn2(2)){ + rloc(mtmp); + return(0); + } +#ifndef NOWORM + if(mtmp->wormno) worm_nomove(mtmp); +#endif NOWORM + } +postmov: + if(mmoved == 1) { + if(mintrap(mtmp) == 2) /* he died */ + return(2); + if(likegold) mpickgold(mtmp); + if(likegems) mpickgems(mtmp); + if(mtmp->mhide) mtmp->mundetected = 1; + } + pmon(mtmp); + return(mmoved); +} + +mpickgold(mtmp) register struct monst *mtmp; { +register struct gold *gold; + while(gold = g_at(mtmp->mx, mtmp->my)){ + mtmp->mgold += gold->amount; + freegold(gold); + if(levl[mtmp->mx][mtmp->my].scrsym == '$') + newsym(mtmp->mx, mtmp->my); + } +} + +mpickgems(mtmp) register struct monst *mtmp; { +register struct obj *otmp; + for(otmp = fobj; otmp; otmp = otmp->nobj) + if(otmp->olet == GEM_SYM) + if(otmp->ox == mtmp->mx && otmp->oy == mtmp->my) + if(mtmp->data->mlet != 'u' || objects[otmp->otyp].g_val != 0){ + freeobj(otmp); + mpickobj(mtmp, otmp); + if(levl[mtmp->mx][mtmp->my].scrsym == GEM_SYM) + newsym(mtmp->mx, mtmp->my); /* %% */ + return; /* pick only one object */ + } +} + +/* return number of acceptable neighbour positions */ +mfndpos(mon,poss,info,flag) +register struct monst *mon; +coord poss[9]; +int info[9], flag; +{ + register int x,y,nx,ny,cnt = 0,ntyp; + register struct monst *mtmp; + int nowtyp; + boolean pool; + + x = mon->mx; + y = mon->my; + nowtyp = levl[x][y].typ; + + pool = (mon->data->mlet == ';'); +nexttry: /* eels prefer the water, but if there is no water nearby, + they will crawl over land */ + if(mon->mconf) { + flag |= ALLOW_ALL; + flag &= ~NOTONL; + } + for(nx = x-1; nx <= x+1; nx++) for(ny = y-1; ny <= y+1; ny++) + if(nx != x || ny != y) if(isok(nx,ny)) + if(!IS_ROCK(ntyp = levl[nx][ny].typ)) + if(!(nx != x && ny != y && (nowtyp == DOOR || ntyp == DOOR))) + if((ntyp == POOL) == pool) { + info[cnt] = 0; + if(nx == u.ux && ny == u.uy){ + if(!(flag & ALLOW_U)) continue; + info[cnt] = ALLOW_U; + } else if(mtmp = m_at(nx,ny)){ + if(!(flag & ALLOW_M)) continue; + info[cnt] = ALLOW_M; + if(mtmp->mtame){ + if(!(flag & ALLOW_TM)) continue; + info[cnt] |= ALLOW_TM; + } + } + if(sobj_at(CLOVE_OF_GARLIC, nx, ny)) { + if(flag & NOGARLIC) continue; + info[cnt] |= NOGARLIC; + } + if(sobj_at(SCR_SCARE_MONSTER, nx, ny) || + (!mon->mpeaceful && sengr_at("Elbereth", nx, ny))) { + if(!(flag & ALLOW_SSM)) continue; + info[cnt] |= ALLOW_SSM; + } + if(sobj_at(ENORMOUS_ROCK, nx, ny)) { + if(!(flag & ALLOW_ROCK)) continue; + info[cnt] |= ALLOW_ROCK; + } + if(!Invis && online(nx,ny)){ + if(flag & NOTONL) continue; + info[cnt] |= NOTONL; + } + /* we cannot avoid traps of an unknown kind */ + { register struct trap *ttmp = t_at(nx, ny); + register int tt; + if(ttmp) { + tt = 1 << ttmp->ttyp; + if(mon->mtrapseen & tt){ + if(!(flag & tt)) continue; + info[cnt] |= tt; + } + } + } + poss[cnt].x = nx; + poss[cnt].y = ny; + cnt++; + } + if(!cnt && pool && nowtyp != POOL) { + pool = FALSE; + goto nexttry; + } + return(cnt); +} + +dist(x,y) int x,y; { + return((x-u.ux)*(x-u.ux) + (y-u.uy)*(y-u.uy)); +} + +poisoned(string, pname) +register char *string, *pname; +{ + register int i; + + if(Blind) pline("It was poisoned."); + else pline("The %s was poisoned!",string); + if(Poison_resistance) { + pline("The poison doesn't seem to affect you."); + return; + } + i = rn2(10); + if(i == 0) { + u.uhp = -1; + pline("I am afraid the poison was deadly ..."); + } else if(i <= 5) { + losestr(rn1(3,3)); + } else { + losehp(rn1(10,6), pname); + } + if(u.uhp < 1) { + killer = pname; + done("died"); + } +} + +mondead(mtmp) +register struct monst *mtmp; +{ + relobj(mtmp,1); + unpmon(mtmp); + relmon(mtmp); + unstuck(mtmp); + if(mtmp->isshk) shkdead(mtmp); + if(mtmp->isgd) gddead(); +#ifndef NOWORM + if(mtmp->wormno) wormdead(mtmp); +#endif NOWORM + monfree(mtmp); +} + +/* called when monster is moved to larger structure */ +replmon(mtmp,mtmp2) +register struct monst *mtmp, *mtmp2; +{ + relmon(mtmp); + monfree(mtmp); + mtmp2->nmon = fmon; + fmon = mtmp2; + if(u.ustuck == mtmp) u.ustuck = mtmp2; + if(mtmp2->isshk) replshk(mtmp,mtmp2); + if(mtmp2->isgd) replgd(mtmp,mtmp2); +} + +relmon(mon) +register struct monst *mon; +{ + register struct monst *mtmp; + + if(mon == fmon) fmon = fmon->nmon; + else { + for(mtmp = fmon; mtmp->nmon != mon; mtmp = mtmp->nmon) ; + mtmp->nmon = mon->nmon; + } +} + +/* we do not free monsters immediately, in order to have their name + available shortly after their demise */ +struct monst *fdmon; /* chain of dead monsters, need not to be saved */ + +monfree(mtmp) register struct monst *mtmp; { + mtmp->nmon = fdmon; + fdmon = mtmp; +} + +dmonsfree(){ +register struct monst *mtmp; + while(mtmp = fdmon){ + fdmon = mtmp->nmon; + free((char *) mtmp); + } +} + +unstuck(mtmp) +register struct monst *mtmp; +{ + if(u.ustuck == mtmp) { + if(u.uswallow){ + u.ux = mtmp->mx; + u.uy = mtmp->my; + u.uswallow = 0; + setsee(); + docrt(); + } + u.ustuck = 0; + } +} + +killed(mtmp) +register struct monst *mtmp; +{ +#ifdef lint +#define NEW_SCORING +#endif lint + register int tmp,tmp2,nk,x,y; + register struct permonst *mdat = mtmp->data; + extern long newuexp(); + + if(mtmp->cham) mdat = PM_CHAMELEON; + if(Blind) pline("You destroy it!"); + else { + pline("You destroy %s!", + mtmp->mtame ? amonnam(mtmp, "poor") : monnam(mtmp)); + } + if(u.umconf) { + if(!Blind) pline("Your hands stop glowing blue."); + u.umconf = 0; + } + + /* count killed monsters */ +#define MAXMONNO 100 + nk = 1; /* in case we cannot find it in mons */ + tmp = mdat - mons; /* index in mons array (if not 'd', '@', ...) */ + if(tmp >= 0 && tmp < CMNUM+2) { + extern char fut_geno[]; + u.nr_killed[tmp]++; + if((nk = u.nr_killed[tmp]) > MAXMONNO && + !index(fut_geno, mdat->mlet)) + charcat(fut_geno, mdat->mlet); + } + + /* punish bad behaviour */ + if(mdat->mlet == '@') Telepat = 0, u.uluck -= 2; + if(mtmp->mpeaceful || mtmp->mtame) u.uluck--; + if(mdat->mlet == 'u') u.uluck -= 5; + if((int)u.uluck < LUCKMIN) u.uluck = LUCKMIN; + + /* give experience points */ + tmp = 1 + mdat->mlevel * mdat->mlevel; + if(mdat->ac < 3) tmp += 2*(7 - mdat->ac); + if(index("AcsSDXaeRTVWU&In:P", mdat->mlet)) + tmp += 2*mdat->mlevel; + if(index("DeV&P",mdat->mlet)) tmp += (7*mdat->mlevel); + if(mdat->mlevel > 6) tmp += 50; + if(mdat->mlet == ';') tmp += 1000; + +#ifdef NEW_SCORING + /* ------- recent addition: make nr of points decrease + when this is not the first of this kind */ + { int ul = u.ulevel; + int ml = mdat->mlevel; + + if(ul < 14) /* points are given based on present and future level */ + for(tmp2 = 0; !tmp2 || ul + tmp2 <= ml; tmp2++) + if(u.uexp + 1 + (tmp + ((tmp2 <= 0) ? 0 : 4<<(tmp2-1)))/nk + >= 10*pow((unsigned)(ul-1))) + if(++ul == 14) break; + + tmp2 = ml - ul -1; + tmp = (tmp + ((tmp2 < 0) ? 0 : 4<= newuexp()){ + pline("Welcome to experience level %u.", ++u.ulevel); + tmp = rnd(10); + if(tmp < 3) tmp = rnd(10); + u.uhpmax += tmp; + u.uhp += tmp; + flags.botl = 1; + } + + /* dispose of monster and make cadaver */ + x = mtmp->mx; y = mtmp->my; + mondead(mtmp); + tmp = mdat->mlet; + if(tmp == 'm') { /* he killed a minotaur, give him a wand of digging */ + /* note: the dead minotaur will be on top of it! */ + mksobj_at(WAN_DIGGING, x, y); + /* if(cansee(x,y)) atl(x,y,fobj->olet); */ + stackobj(fobj); + } else +#ifndef NOWORM + if(tmp == 'w') { + mksobj_at(WORM_TOOTH, x, y); + stackobj(fobj); + } else +#endif NOWORM + if(!letter(tmp) || (!index("mw", tmp) && !rn2(3))) tmp = 0; + + if(ACCESSIBLE(levl[x][y].typ)) /* might be mimic in wall or dead eel*/ + if(x != u.ux || y != u.uy) /* might be here after swallowed */ + if(index("NTVm&",mdat->mlet) || rn2(5)) { + register struct obj *obj2 = mkobj_at(tmp,x,y); + if(cansee(x,y)) + atl(x,y,obj2->olet); + stackobj(obj2); + } +} + +kludge(str,arg) +register char *str,*arg; +{ + if(Blind) { + if(*str == '%') pline(str,"It"); + else pline(str,"it"); + } else pline(str,arg); +} + +rescham() /* force all chameleons to become normal */ +{ + register struct monst *mtmp; + + for(mtmp = fmon; mtmp; mtmp = mtmp->nmon) + if(mtmp->cham) { + mtmp->cham = 0; + (void) newcham(mtmp, PM_CHAMELEON); + } +} + +newcham(mtmp,mdat) /* make a chameleon look like a new monster */ + /* returns 1 if the monster actually changed */ +register struct monst *mtmp; +register struct permonst *mdat; +{ + register mhp, hpn, hpd; + + if(mdat == mtmp->data) return(0); /* still the same monster */ +#ifndef NOWORM + if(mtmp->wormno) wormdead(mtmp); /* throw tail away */ +#endif NOWORM + hpn = mtmp->mhp; + hpd = (mtmp->data->mlevel)*8; + if(!hpd) hpd = 4; + mtmp->data = mdat; + mhp = (mdat->mlevel)*8; + /* new hp: same fraction of max as before */ + mtmp->mhp = 2 + (hpn*mhp)/hpd; + hpn = mtmp->mhpmax; + mtmp->mhpmax = 2 + (hpn*mhp)/hpd; + mtmp->minvis = (mdat->mlet == 'I') ? 1 : 0; +#ifndef NOWORM + if(mdat->mlet == 'w' && getwn(mtmp)) initworm(mtmp); + /* perhaps we should clear mtmp->mtame here? */ +#endif NOWORM + unpmon(mtmp); /* necessary for 'I' and to force pmon */ + pmon(mtmp); + return(1); +} + +mnexto(mtmp) /* Make monster mtmp next to you (if possible) */ +struct monst *mtmp; +{ + extern coord enexto(); + coord mm; + mm = enexto(u.ux, u.uy); + mtmp->mx = mm.x; + mtmp->my = mm.y; + pmon(mtmp); +} + +ishuman(mtmp) register struct monst *mtmp; { + return(mtmp->data->mlet == '@'); +} + +setmangry(mtmp) register struct monst *mtmp; { + if(!mtmp->mpeaceful) return; + if(mtmp->mtame) return; + mtmp->mpeaceful = 0; + if(ishuman(mtmp)) pline("%s gets angry!", Monnam(mtmp)); +} + +/* not one hundred procent correct: now a snake may hide under an + invisible object */ +canseemon(mtmp) +register struct monst *mtmp; +{ + return((!mtmp->minvis || See_invisible) + && (!mtmp->mhide || !o_at(mtmp->mx,mtmp->my)) + && cansee(mtmp->mx, mtmp->my)); +} diff --git a/games/hack/hack.monst.c b/games/hack/hack.monst.c new file mode 100644 index 0000000..b682b59 --- /dev/null +++ b/games/hack/hack.monst.c @@ -0,0 +1,79 @@ +/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ +/* hack.monst.c - version 1.0.2 */ + +#include "hack.h" +#include "def.eshk.h" +extern char plname[PL_NSIZ]; + +struct permonst mons[CMNUM+2] = { + { "bat", 'B',1,22,8,1,4,0 }, + { "gnome", 'G',1,6,5,1,6,0 }, + { "hobgoblin", 'H',1,9,5,1,8,0 }, + { "jackal", 'J',0,12,7,1,2,0 }, + { "kobold", 'K',1,6,7,1,4,0 }, + { "leprechaun", 'L',5,15,8,1,2,0 }, + { "giant rat", 'r',0,12,7,1,3,0 }, + { "acid blob", 'a',2,3,8,0,0,0 }, + { "floating eye", 'E',2,1,9,0,0,0 }, + { "homunculus", 'h',2,6,6,1,3,0 }, + { "imp", 'i',2,6,2,1,4,0 }, + { "orc", 'O',2,9,6,1,8,0 }, + { "yellow light", 'y',3,15,0,0,0,0 }, + { "zombie", 'Z',2,6,8,1,8,0 }, + { "giant ant", 'A',3,18,3,1,6,0 }, + { "fog cloud", 'f',3,1,0,1,6,0 }, + { "nymph", 'N',6,12,9,1,2,0 }, + { "piercer", 'p',3,1,3,2,6,0 }, + { "quasit", 'Q',3,15,3,1,4,0 }, + { "quivering blob", 'q',3,1,8,1,8,0 }, + { "violet fungi", 'v',3,1,7,1,4,0 }, + { "giant beetle", 'b',4,6,4,3,4,0 }, + { "centaur", 'C',4,18,4,1,6,0 }, + { "cockatrice", 'c',4,6,6,1,3,0 }, + { "gelatinous cube", 'g',4,6,8,2,4,0 }, + { "jaguar", 'j',4,15,6,1,8,0 }, + { "killer bee", 'k',4,14,4,2,4,0 }, + { "snake", 'S',4,15,3,1,6,0 }, + { "freezing sphere", 'F',2,13,4,0,0,0 }, + { "owlbear", 'o',5,12,5,2,6,0 }, + { "rust monster", 'R',10,18,3,0,0,0 }, + { "scorpion", 's',5,15,3,1,4,0 }, + { "tengu", 't',5,13,5,1,7,0 }, + { "wraith", 'W',5,12,5,1,6,0 }, +#ifdef NOWORM + { "wumpus", 'w',8,3,2,3,6,0 }, +#else + { "long worm", 'w',8,3,5,1,4,0 }, +#endif NOWORM + { "large dog", 'd',6,15,4,2,4,0 }, + { "leocrotta", 'l',6,18,4,3,6,0 }, + { "mimic", 'M',7,3,7,3,4,0 }, + { "troll", 'T',7,12,4,2,7,0 }, + { "unicorn", 'u',8,24,5,1,10,0 }, + { "yeti", 'Y',5,15,6,1,6,0 }, + { "stalker", 'I',8,12,3,4,4,0 }, + { "umber hulk", 'U',9,6,2,2,10,0 }, + { "vampire", 'V',8,12,1,1,6,0 }, + { "xorn", 'X',8,9,-2,4,6,0 }, + { "xan", 'x',7,18,-2,2,4,0 }, + { "zruty", 'z',9,8,3,3,6,0 }, + { "chameleon", ':',6,5,6,4,2,0 }, + { "dragon", 'D',10,9,-1,3,8,0 }, + { "ettin", 'e',10,12,3,2,8,0 }, + { "lurker above", '\'',10,3,3,0,0,0 }, + { "nurse", 'n',11,6,0,1,3,0 }, + { "trapper", ',',12,3,3,0,0,0 }, + { "purple worm", 'P',15,9,6,2,8,0 }, + { "demon", '&',10,12,-4,1,4,0 }, + { "minotaur", 'm',15,15,6,4,10,0 }, + { "shopkeeper", '@', 12, 18, 0, 4, 8, sizeof(struct eshk) } +}; + +struct permonst pm_ghost = { "ghost", ' ', 10, 3, -5, 1, 1, sizeof(plname) }; +struct permonst pm_wizard = { + "wizard of Yendor", '1', 15, 12, -2, 1, 12, 0 +}; +#ifdef MAIL +struct permonst pm_mail_daemon = { "mail daemon", '2', 100, 1, 10, 0, 0, 0 }; +#endif MAIL +struct permonst pm_eel = { "giant eel", ';', 15, 6, -3, 3, 6, 0 }; diff --git a/games/hack/hack.o_init.c b/games/hack/hack.o_init.c new file mode 100644 index 0000000..37b33ae --- /dev/null +++ b/games/hack/hack.o_init.c @@ -0,0 +1,160 @@ +/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ +/* hack.o_init.c - version 1.0.3 */ + +#include "config.h" /* for typedefs */ +#include "def.objects.h" +#include "hack.onames.h" /* for LAST_GEM */ +extern char *index(); + +int +letindex(let) register char let; { +register int i = 0; +register char ch; + while((ch = obj_symbols[i++]) != 0) + if(ch == let) return(i); + return(0); +} + +init_objects(){ +register int i, j, first, last, sum, end; +register char let, *tmp; + /* init base; if probs given check that they add up to 100, + otherwise compute probs; shuffle descriptions */ + end = SIZE(objects); + first = 0; + while( first < end ) { + let = objects[first].oc_olet; + last = first+1; + while(last < end && objects[last].oc_olet == let + && objects[last].oc_name != NULL) + last++; + i = letindex(let); + if((!i && let != ILLOBJ_SYM) || bases[i] != 0) + error("initialization error"); + bases[i] = first; + + if(let == GEM_SYM) + setgemprobs(); + check: + sum = 0; + for(j = first; j < last; j++) sum += objects[j].oc_prob; + if(sum == 0) { + for(j = first; j < last; j++) + objects[j].oc_prob = (100+j-first)/(last-first); + goto check; + } + if(sum != 100) + error("init-prob error for %c", let); + + if(objects[first].oc_descr != NULL && let != TOOL_SYM){ + /* shuffle, also some additional descriptions */ + while(last < end && objects[last].oc_olet == let) + last++; + j = last; + while(--j > first) { + i = first + rn2(j+1-first); + tmp = objects[j].oc_descr; + objects[j].oc_descr = objects[i].oc_descr; + objects[i].oc_descr = tmp; + } + } + first = last; + } +} + +probtype(let) register char let; { +register int i = bases[letindex(let)]; +register int prob = rn2(100); + while((prob -= objects[i].oc_prob) >= 0) i++; + if(objects[i].oc_olet != let || !objects[i].oc_name) + panic("probtype(%c) error, i=%d", let, i); + return(i); +} + +setgemprobs() +{ + register int j,first; + extern xchar dlevel; + + first = bases[letindex(GEM_SYM)]; + + for(j = 0; j < 9-dlevel/3; j++) + objects[first+j].oc_prob = 0; + first += j; + if(first >= LAST_GEM || first >= SIZE(objects) || + objects[first].oc_olet != GEM_SYM || + objects[first].oc_name == NULL) + printf("Not enough gems? - first=%d j=%d LAST_GEM=%d\n", + first, j, LAST_GEM); + for(j = first; j < LAST_GEM; j++) + objects[j].oc_prob = (20+j-first)/(LAST_GEM-first); +} + +oinit() /* level dependent initialization */ +{ + setgemprobs(); +} + +extern long *alloc(); + +savenames(fd) register fd; { +register int i; +unsigned len; + bwrite(fd, (char *) bases, sizeof bases); + bwrite(fd, (char *) objects, sizeof objects); + /* as long as we use only one version of Hack/Quest we + need not save oc_name and oc_descr, but we must save + oc_uname for all objects */ + for(i=0; i < SIZE(objects); i++) { + if(objects[i].oc_uname) { + len = strlen(objects[i].oc_uname)+1; + bwrite(fd, (char *) &len, sizeof len); + bwrite(fd, objects[i].oc_uname, len); + } + } +} + +restnames(fd) register fd; { +register int i; +unsigned len; + mread(fd, (char *) bases, sizeof bases); + mread(fd, (char *) objects, sizeof objects); + for(i=0; i < SIZE(objects); i++) if(objects[i].oc_uname) { + mread(fd, (char *) &len, sizeof len); + objects[i].oc_uname = (char *) alloc(len); + mread(fd, objects[i].oc_uname, len); + } +} + +dodiscovered() /* free after Robert Viduya */ +{ + extern char *typename(); + register int i, end; + int ct = 0; + + cornline(0, "Discoveries"); + + end = SIZE(objects); + for (i = 0; i < end; i++) { + if (interesting_to_discover (i)) { + ct++; + cornline(1, typename(i)); + } + } + if (ct == 0) { + pline ("You haven't discovered anything yet..."); + cornline(3, (char *) 0); + } else + cornline(2, (char *) 0); + + return(0); +} + +interesting_to_discover(i) +register int i; +{ + return( + objects[i].oc_uname != NULL || + (objects[i].oc_name_known && objects[i].oc_descr != NULL) + ); +} diff --git a/games/hack/hack.objnam.c b/games/hack/hack.objnam.c new file mode 100644 index 0000000..26b82da --- /dev/null +++ b/games/hack/hack.objnam.c @@ -0,0 +1,547 @@ +/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ +/* hack.objnam.c - version 1.0.2 */ + +#include "hack.h" +#define Sprintf (void) sprintf +#define Strcat (void) strcat +#define Strcpy (void) strcpy +#define PREFIX 15 +extern char *eos(); +extern int bases[]; + +char * +strprepend(s,pref) register char *s, *pref; { +register int i = strlen(pref); + if(i > PREFIX) { + pline("WARNING: prefix too short."); + return(s); + } + s -= i; + (void) strncpy(s, pref, i); /* do not copy trailing 0 */ + return(s); +} + +char * +sitoa(a) int a; { +static char buf[13]; + Sprintf(buf, (a < 0) ? "%d" : "+%d", a); + return(buf); +} + +char * +typename(otyp) +register int otyp; +{ +static char buf[BUFSZ]; +register struct objclass *ocl = &objects[otyp]; +register char *an = ocl->oc_name; +register char *dn = ocl->oc_descr; +register char *un = ocl->oc_uname; +register int nn = ocl->oc_name_known; + switch(ocl->oc_olet) { + case POTION_SYM: + Strcpy(buf, "potion"); + break; + case SCROLL_SYM: + Strcpy(buf, "scroll"); + break; + case WAND_SYM: + Strcpy(buf, "wand"); + break; + case RING_SYM: + Strcpy(buf, "ring"); + break; + default: + if(nn) { + Strcpy(buf, an); + if(otyp >= TURQUOISE && otyp <= JADE) + Strcat(buf, " stone"); + if(un) + Sprintf(eos(buf), " called %s", un); + if(dn) + Sprintf(eos(buf), " (%s)", dn); + } else { + Strcpy(buf, dn ? dn : an); + if(ocl->oc_olet == GEM_SYM) + Strcat(buf, " gem"); + if(un) + Sprintf(eos(buf), " called %s", un); + } + return(buf); + } + /* here for ring/scroll/potion/wand */ + if(nn) + Sprintf(eos(buf), " of %s", an); + if(un) + Sprintf(eos(buf), " called %s", un); + if(dn) + Sprintf(eos(buf), " (%s)", dn); + return(buf); +} + +char * +xname(obj) +register struct obj *obj; +{ +static char bufr[BUFSZ]; +register char *buf = &(bufr[PREFIX]); /* leave room for "17 -3 " */ +register int nn = objects[obj->otyp].oc_name_known; +register char *an = objects[obj->otyp].oc_name; +register char *dn = objects[obj->otyp].oc_descr; +register char *un = objects[obj->otyp].oc_uname; +register int pl = (obj->quan != 1); + if(!obj->dknown && !Blind) obj->dknown = 1; /* %% doesnt belong here */ + switch(obj->olet) { + case AMULET_SYM: + Strcpy(buf, (obj->spe < 0 && obj->known) + ? "cheap plastic imitation of the " : ""); + Strcat(buf,"Amulet of Yendor"); + break; + case TOOL_SYM: + if(!nn) { + Strcpy(buf, dn); + break; + } + Strcpy(buf,an); + break; + case FOOD_SYM: + if(obj->otyp == DEAD_HOMUNCULUS && pl) { + pl = 0; + Strcpy(buf, "dead homunculi"); + break; + } + /* fungis ? */ + /* fall into next case */ + case WEAPON_SYM: + if(obj->otyp == WORM_TOOTH && pl) { + pl = 0; + Strcpy(buf, "worm teeth"); + break; + } + if(obj->otyp == CRYSKNIFE && pl) { + pl = 0; + Strcpy(buf, "crysknives"); + break; + } + /* fall into next case */ + case ARMOR_SYM: + case CHAIN_SYM: + case ROCK_SYM: + Strcpy(buf,an); + break; + case BALL_SYM: + Sprintf(buf, "%sheavy iron ball", + (obj->owt > objects[obj->otyp].oc_weight) ? "very " : ""); + break; + case POTION_SYM: + if(nn || un || !obj->dknown) { + Strcpy(buf, "potion"); + if(pl) { + pl = 0; + Strcat(buf, "s"); + } + if(!obj->dknown) break; + if(un) { + Strcat(buf, " called "); + Strcat(buf, un); + } else { + Strcat(buf, " of "); + Strcat(buf, an); + } + } else { + Strcpy(buf, dn); + Strcat(buf, " potion"); + } + break; + case SCROLL_SYM: + Strcpy(buf, "scroll"); + if(pl) { + pl = 0; + Strcat(buf, "s"); + } + if(!obj->dknown) break; + if(nn) { + Strcat(buf, " of "); + Strcat(buf, an); + } else if(un) { + Strcat(buf, " called "); + Strcat(buf, un); + } else { + Strcat(buf, " labeled "); + Strcat(buf, dn); + } + break; + case WAND_SYM: + if(!obj->dknown) + Sprintf(buf, "wand"); + else if(nn) + Sprintf(buf, "wand of %s", an); + else if(un) + Sprintf(buf, "wand called %s", un); + else + Sprintf(buf, "%s wand", dn); + break; + case RING_SYM: + if(!obj->dknown) + Sprintf(buf, "ring"); + else if(nn) + Sprintf(buf, "ring of %s", an); + else if(un) + Sprintf(buf, "ring called %s", un); + else + Sprintf(buf, "%s ring", dn); + break; + case GEM_SYM: + if(!obj->dknown) { + Strcpy(buf, "gem"); + break; + } + if(!nn) { + Sprintf(buf, "%s gem", dn); + break; + } + Strcpy(buf, an); + if(obj->otyp >= TURQUOISE && obj->otyp <= JADE) + Strcat(buf, " stone"); + break; + default: + Sprintf(buf,"glorkum %c (0%o) %u %d", + obj->olet,obj->olet,obj->otyp,obj->spe); + } + if(pl) { + register char *p; + + for(p = buf; *p; p++) { + if(!strncmp(" of ", p, STRLEN(" of "))) { + /* pieces of, cloves of, lumps of */ + register int c1, c2 = 's'; + + do { + c1 = c2; c2 = *p; *p++ = c1; + } while(c1); + goto nopl; + } + } + p = eos(buf)-1; + if(*p == 's' || *p == 'z' || *p == 'x' || + (*p == 'h' && p[-1] == 's')) + Strcat(buf, "es"); /* boxes */ + else if(*p == 'y' && !index(vowels, p[-1])) + Strcpy(p, "ies"); /* rubies, zruties */ + else + Strcat(buf, "s"); + } +nopl: + if(obj->onamelth) { + Strcat(buf, " named "); + Strcat(buf, ONAME(obj)); + } + return(buf); +} + +char * +doname(obj) +register struct obj *obj; +{ +char prefix[PREFIX]; +register char *bp = xname(obj); + if(obj->quan != 1) + Sprintf(prefix, "%u ", obj->quan); + else + Strcpy(prefix, "a "); + switch(obj->olet) { + case AMULET_SYM: + if(strncmp(bp, "cheap ", STRLEN("cheap "))) + Strcpy(prefix, "the "); + break; + case ARMOR_SYM: + if(obj->owornmask & W_ARMOR) + Strcat(bp, " (being worn)"); + /* fall into next case */ + case WEAPON_SYM: + if(obj->known) { + Strcat(prefix, sitoa(obj->spe)); + Strcat(prefix, " "); + } + break; + case WAND_SYM: + if(obj->known) + Sprintf(eos(bp), " (%d)", obj->spe); + break; + case RING_SYM: + if(obj->owornmask & W_RINGR) Strcat(bp, " (on right hand)"); + if(obj->owornmask & W_RINGL) Strcat(bp, " (on left hand)"); + if(obj->known && (objects[obj->otyp].bits & SPEC)) { + Strcat(prefix, sitoa(obj->spe)); + Strcat(prefix, " "); + } + break; + } + if(obj->owornmask & W_WEP) + Strcat(bp, " (weapon in hand)"); + if(obj->unpaid) + Strcat(bp, " (unpaid)"); + if(!strcmp(prefix, "a ") && index(vowels, *bp)) + Strcpy(prefix, "an "); + bp = strprepend(bp, prefix); + return(bp); +} + +/* used only in hack.fight.c (thitu) */ +setan(str,buf) +register char *str,*buf; +{ + if(index(vowels,*str)) + Sprintf(buf, "an %s", str); + else + Sprintf(buf, "a %s", str); +} + +char * +aobjnam(otmp,verb) register struct obj *otmp; register char *verb; { +register char *bp = xname(otmp); +char prefix[PREFIX]; + if(otmp->quan != 1) { + Sprintf(prefix, "%u ", otmp->quan); + bp = strprepend(bp, prefix); + } + + if(verb) { + /* verb is given in plural (i.e., without trailing s) */ + Strcat(bp, " "); + if(otmp->quan != 1) + Strcat(bp, verb); + else if(!strcmp(verb, "are")) + Strcat(bp, "is"); + else { + Strcat(bp, verb); + Strcat(bp, "s"); + } + } + return(bp); +} + +char * +Doname(obj) +register struct obj *obj; +{ + register char *s = doname(obj); + + if('a' <= *s && *s <= 'z') *s -= ('a' - 'A'); + return(s); +} + +char *wrp[] = { "wand", "ring", "potion", "scroll", "gem" }; +char wrpsym[] = { WAND_SYM, RING_SYM, POTION_SYM, SCROLL_SYM, GEM_SYM }; + +struct obj * +readobjnam(bp) register char *bp; { +register char *p; +register int i; +int cnt, spe, spesgn, typ, heavy; +char let; +char *un, *dn, *an; +/* int the = 0; char *oname = 0; */ + cnt = spe = spesgn = typ = heavy = 0; + let = 0; + an = dn = un = 0; + for(p = bp; *p; p++) + if('A' <= *p && *p <= 'Z') *p += 'a'-'A'; + if(!strncmp(bp, "the ", STRLEN("the "))){ +/* the = 1; */ + bp += STRLEN("the "); + } else if(!strncmp(bp, "an ", STRLEN("an "))){ + cnt = 1; + bp += STRLEN("an "); + } else if(!strncmp(bp, "a ", STRLEN("a "))){ + cnt = 1; + bp += STRLEN("a "); + } + if(!cnt && digit(*bp)){ + cnt = atoi(bp); + while(digit(*bp)) bp++; + while(*bp == ' ') bp++; + } + if(!cnt) cnt = 1; /* %% what with "gems" etc. ? */ + + if(*bp == '+' || *bp == '-'){ + spesgn = (*bp++ == '+') ? 1 : -1; + spe = atoi(bp); + while(digit(*bp)) bp++; + while(*bp == ' ') bp++; + } else { + p = rindex(bp, '('); + if(p) { + if(p > bp && p[-1] == ' ') p[-1] = 0; + else *p = 0; + p++; + spe = atoi(p); + while(digit(*p)) p++; + if(strcmp(p, ")")) spe = 0; + else spesgn = 1; + } + } + /* now we have the actual name, as delivered by xname, say + green potions called whisky + scrolls labeled "QWERTY" + egg + dead zruties + fortune cookies + very heavy iron ball named hoei + wand of wishing + elven cloak + */ + for(p = bp; *p; p++) if(!strncmp(p, " named ", STRLEN(" named "))) { + *p = 0; +/* oname = p+STRLEN(" named "); */ + } + for(p = bp; *p; p++) if(!strncmp(p, " called ", STRLEN(" called "))) { + *p = 0; + un = p+STRLEN(" called "); + } + for(p = bp; *p; p++) if(!strncmp(p, " labeled ", STRLEN(" labeled "))) { + *p = 0; + dn = p+STRLEN(" labeled "); + } + + /* first change to singular if necessary */ + if(cnt != 1) { + /* find "cloves of garlic", "worthless pieces of blue glass" */ + for(p = bp; *p; p++) if(!strncmp(p, "s of ", STRLEN("s of "))){ + while(*p = p[1]) p++; + goto sing; + } + /* remove -s or -es (boxes) or -ies (rubies, zruties) */ + p = eos(bp); + if(p[-1] == 's') { + if(p[-2] == 'e') { + if(p[-3] == 'i') { + if(!strcmp(p-STRLEN("cookies"), "cookies")) + goto mins; + Strcpy(p-3, "y"); + goto sing; + } + + /* note: cloves / knives from clove / knife */ + if(!strcmp(p-STRLEN("knives"), "knives")) { + Strcpy(p-3, "fe"); + goto sing; + } + + /* note: nurses, axes but boxes */ + if(!strcmp(p-STRLEN("boxes"), "boxes")) { + p[-2] = 0; + goto sing; + } + } + mins: + p[-1] = 0; + } else { + if(!strcmp(p-STRLEN("homunculi"), "homunculi")) { + Strcpy(p-1, "us"); /* !! makes string longer */ + goto sing; + } + if(!strcmp(p-STRLEN("teeth"), "teeth")) { + Strcpy(p-STRLEN("teeth"), "tooth"); + goto sing; + } + /* here we cannot find the plural suffix */ + } + } +sing: + if(!strcmp(bp, "amulet of yendor")) { + typ = AMULET_OF_YENDOR; + goto typfnd; + } + p = eos(bp); + if(!strcmp(p-STRLEN(" mail"), " mail")){ /* Note: ring mail is not a ring ! */ + let = ARMOR_SYM; + an = bp; + goto srch; + } + for(i = 0; i < sizeof(wrpsym); i++) { + register int j = strlen(wrp[i]); + if(!strncmp(bp, wrp[i], j)){ + let = wrpsym[i]; + bp += j; + if(!strncmp(bp, " of ", STRLEN(" of "))) an = bp+STRLEN(" of "); + /* else if(*bp) ?? */ + goto srch; + } + if(!strcmp(p-j, wrp[i])){ + let = wrpsym[i]; + p -= j; + *p = 0; + if(p[-1] == ' ') p[-1] = 0; + dn = bp; + goto srch; + } + } + if(!strcmp(p-STRLEN(" stone"), " stone")){ + p[-STRLEN(" stone")] = 0; + let = GEM_SYM; + an = bp; + goto srch; + } + if(!strcmp(bp, "very heavy iron ball")){ + heavy = 1; + typ = HEAVY_IRON_BALL; + goto typfnd; + } + an = bp; +srch: + if(!an && !dn && !un) + goto any; + i = 1; + if(let) i = bases[letindex(let)]; + while(i <= NROFOBJECTS && (!let || objects[i].oc_olet == let)){ + register char *zn = objects[i].oc_name; + + if(!zn) goto nxti; + if(an && strcmp(an, zn)) + goto nxti; + if(dn && (!(zn = objects[i].oc_descr) || strcmp(dn, zn))) + goto nxti; + if(un && (!(zn = objects[i].oc_uname) || strcmp(un, zn))) + goto nxti; + typ = i; + goto typfnd; + nxti: + i++; + } +any: + if(!let) let = wrpsym[rn2(sizeof(wrpsym))]; + typ = probtype(let); +typfnd: + { register struct obj *otmp; + extern struct obj *mksobj(); + let = objects[typ].oc_olet; + otmp = mksobj(typ); + if(heavy) + otmp->owt += 15; + if(cnt > 0 && index("%?!*)", let) && + (cnt < 4 || (let == WEAPON_SYM && typ <= ROCK && cnt < 20))) + otmp->quan = cnt; + + if(spe > 3 && spe > otmp->spe) + spe = 0; + else if(let == WAND_SYM) + spe = otmp->spe; + if(spe == 3 && u.uluck < 0) + spesgn = -1; + if(let != WAND_SYM && spesgn == -1) + spe = -spe; + if(let == BALL_SYM) + spe = 0; + else if(let == AMULET_SYM) + spe = -1; + else if(typ == WAN_WISHING && rn2(10)) + spe = (rn2(10) ? -1 : 0); + otmp->spe = spe; + + if(spesgn == -1) + otmp->cursed = 1; + + return(otmp); + } +} diff --git a/games/hack/hack.onames.h b/games/hack/hack.onames.h new file mode 100644 index 0000000..c0fe81e --- /dev/null +++ b/games/hack/hack.onames.h @@ -0,0 +1,227 @@ +#define STRANGE_OBJECT 0 +#define AMULET_OF_YENDOR 1 +#define FOOD_RATION 2 +#define TRIPE_RATION 3 +#define PANCAKE 4 +#define DEAD_LIZARD 5 +#define FORTUNE_COOKIE 6 +#define CARROT 7 +#define TIN 8 +#define ORANGE 9 +#define APPLE 10 +#define PEAR 11 +#define MELON 12 +#define BANANA 13 +#define CANDY_BAR 14 +#define EGG 15 +#define CLOVE_OF_GARLIC 16 +#define LUMP_OF_ROYAL_JELLY 17 +#define DEAD_HUMAN 18 +#define DEAD_GIANT_ANT 19 +#define DEAD_GIANT_BAT 20 +#define DEAD_CENTAUR 21 +#define DEAD_DRAGON 22 +#define DEAD_FLOATING_EYE 23 +#define DEAD_FREEZING_SPHERE 24 +#define DEAD_GNOME 25 +#define DEAD_HOBGOBLIN 26 +#define DEAD_STALKER 27 +#define DEAD_JACKAL 28 +#define DEAD_KOBOLD 29 +#define DEAD_LEPRECHAUN 30 +#define DEAD_MIMIC 31 +#define DEAD_NYMPH 32 +#define DEAD_ORC 33 +#define DEAD_PURPLE_WORM 34 +#define DEAD_QUASIT 35 +#define DEAD_RUST_MONSTER 36 +#define DEAD_SNAKE 37 +#define DEAD_TROLL 38 +#define DEAD_UMBER_HULK 39 +#define DEAD_VAMPIRE 40 +#define DEAD_WRAITH 41 +#define DEAD_XORN 42 +#define DEAD_YETI 43 +#define DEAD_ZOMBIE 44 +#define DEAD_ACID_BLOB 45 +#define DEAD_GIANT_BEETLE 46 +#define DEAD_COCKATRICE 47 +#define DEAD_DOG 48 +#define DEAD_ETTIN 49 +#define DEAD_FOG_CLOUD 50 +#define DEAD_GELATINOUS_CUBE 51 +#define DEAD_HOMUNCULUS 52 +#define DEAD_IMP 53 +#define DEAD_JAGUAR 54 +#define DEAD_KILLER_BEE 55 +#define DEAD_LEOCROTTA 56 +#define DEAD_MINOTAUR 57 +#define DEAD_NURSE 58 +#define DEAD_OWLBEAR 59 +#define DEAD_PIERCER 60 +#define DEAD_QUIVERING_BLOB 61 +#define DEAD_GIANT_RAT 62 +#define DEAD_GIANT_SCORPION 63 +#define DEAD_TENGU 64 +#define DEAD_UNICORN 65 +#define DEAD_VIOLET_FUNGI 66 +#define DEAD_LONG_WORM 67 +#define DEAD_XAN 68 +#define DEAD_YELLOW_LIGHT 69 +#define DEAD_ZRUTY 70 +#define ARROW 71 +#define SLING_BULLET 72 +#define CROSSBOW_BOLT 73 +#define DART 74 +#define ROCK 75 +#define BOOMERANG 76 +#define MACE 77 +#define AXE 78 +#define FLAIL 79 +#define LONG_SWORD 80 +#define TWO_HANDED_SWORD 81 +#define DAGGER 82 +#define WORM_TOOTH 83 +#define CRYSKNIFE 84 +#define SPEAR 85 +#define BOW 86 +#define SLING 87 +#define CROSSBOW 88 +#define WHISTLE 89 +#define MAGIC_WHISTLE 90 +#define EXPENSIVE_CAMERA 91 +#define ICE_BOX 92 +#define PICK_AXE 93 +#define CAN_OPENER 94 +#define HEAVY_IRON_BALL 95 +#define IRON_CHAIN 96 +#define ENORMOUS_ROCK 97 +#define HELMET 98 +#define PLATE_MAIL 99 +#define SPLINT_MAIL 100 +#define BANDED_MAIL 101 +#define CHAIN_MAIL 102 +#define SCALE_MAIL 103 +#define RING_MAIL 104 +#define STUDDED_LEATHER_ARMOR 105 +#define LEATHER_ARMOR 106 +#define ELVEN_CLOAK 107 +#define SHIELD 108 +#define PAIR_OF_GLOVES 109 +#define POT_RESTORE_STRENGTH 110 +#define POT_BOOZE 111 +#define POT_INVISIBILITY 112 +#define POT_FRUIT_JUICE 113 +#define POT_HEALING 114 +#define POT_PARALYSIS 115 +#define POT_MONSTER_DETECTION 116 +#define POT_OBJECT_DETECTION 117 +#define POT_SICKNESS 118 +#define POT_CONFUSION 119 +#define POT_GAIN_STRENGTH 120 +#define POT_SPEED 121 +#define POT_BLINDNESS 122 +#define POT_GAIN_LEVEL 123 +#define POT_EXTRA_HEALING 124 +#define POT_LEVITATION 125 +#define SCR_MAIL 130 +#define SCR_ENCHANT_ARMOR 131 +#define SCR_DESTROY_ARMOR 132 +#define SCR_CONFUSE_MONSTER 133 +#define SCR_SCARE_MONSTER 134 +#define SCR_BLANK_PAPER 135 +#define SCR_REMOVE_CURSE 136 +#define SCR_ENCHANT_WEAPON 137 +#define SCR_DAMAGE_WEAPON 138 +#define SCR_CREATE_MONSTER 139 +#define SCR_TAMING 140 +#define SCR_GENOCIDE 141 +#define SCR_LIGHT 142 +#define SCR_TELEPORTATION 143 +#define SCR_GOLD_DETECTION 144 +#define SCR_FOOD_DETECTION 145 +#define SCR_IDENTIFY 146 +#define SCR_MAGIC_MAPPING 147 +#define SCR_AMNESIA 148 +#define SCR_FIRE 149 +#define SCR_PUNISHMENT 150 +#define WAN_LIGHT 155 +#define WAN_SECRET_DOOR_DETECTION 156 +#define WAN_CREATE_MONSTER 157 +#define WAN_WISHING 158 +#define WAN_STRIKING 159 +#define WAN_SLOW_MONSTER 160 +#define WAN_SPEED_MONSTER 161 +#define WAN_UNDEAD_TURNING 162 +#define WAN_POLYMORPH 163 +#define WAN_CANCELLATION 164 +#define WAN_TELEPORTATION 165 +#define WAN_MAKE_INVISIBLE 166 +#define WAN_DIGGING 167 +#define WAN_MAGIC_MISSILE 168 +#define WAN_FIRE 169 +#define WAN_SLEEP 170 +#define WAN_COLD 171 +#define WAN_DEATH 172 +#define Adornment u.uprops[0].p_flgs +#define RIN_ADORNMENT 176 +#define Teleportation u.uprops[1].p_flgs +#define RIN_TELEPORTATION 177 +#define Regeneration u.uprops[2].p_flgs +#define RIN_REGENERATION 178 +#define Searching u.uprops[3].p_flgs +#define RIN_SEARCHING 179 +#define See_invisible u.uprops[4].p_flgs +#define RIN_SEE_INVISIBLE 180 +#define Stealth u.uprops[5].p_flgs +#define RIN_STEALTH 181 +#define Levitation u.uprops[6].p_flgs +#define RIN_LEVITATION 182 +#define Poison_resistance u.uprops[7].p_flgs +#define RIN_POISON_RESISTANCE 183 +#define Aggravate_monster u.uprops[8].p_flgs +#define RIN_AGGRAVATE_MONSTER 184 +#define Hunger u.uprops[9].p_flgs +#define RIN_HUNGER 185 +#define Fire_resistance u.uprops[10].p_flgs +#define RIN_FIRE_RESISTANCE 186 +#define Cold_resistance u.uprops[11].p_flgs +#define RIN_COLD_RESISTANCE 187 +#define Protection_from_shape_changers u.uprops[12].p_flgs +#define RIN_PROTECTION_FROM_SHAPE_CHANGERS 188 +#define Conflict u.uprops[13].p_flgs +#define RIN_CONFLICT 189 +#define Gain_strength u.uprops[14].p_flgs +#define RIN_GAIN_STRENGTH 190 +#define Increase_damage u.uprops[15].p_flgs +#define RIN_INCREASE_DAMAGE 191 +#define Protection u.uprops[16].p_flgs +#define RIN_PROTECTION 192 +#define Warning u.uprops[17].p_flgs +#define RIN_WARNING 193 +#define Teleport_control u.uprops[18].p_flgs +#define RIN_TELEPORT_CONTROL 194 +#define DIAMOND 197 +#define RUBY 198 +#define SAPPHIRE 199 +#define EMERALD 200 +#define TURQUOISE 201 +#define AQUAMARINE 202 +#define TOURMALINE 203 +#define TOPAZ 204 +#define OPAL 205 +#define GARNET 206 +#define AMETHYST 207 +#define AGATE 208 +#define ONYX 209 +#define JASPER 210 +#define JADE 211 +/* #define WORTHLESS_PIECE_OF_BLUE_GLASS 212 */ +/* #define WORTHLESS_PIECE_OF_RED_GLASS 213 */ +/* #define WORTHLESS_PIECE_OF_YELLOW_GLASS 214 */ +/* #define WORTHLESS_PIECE_OF_GREEN_GLASS 215 */ + +#define CORPSE DEAD_HUMAN +#define LAST_GEM (JADE+1) +#define LAST_RING 19 +#define NROFOBJECTS 215 diff --git a/games/hack/hack.options.c b/games/hack/hack.options.c new file mode 100644 index 0000000..e9db800 --- /dev/null +++ b/games/hack/hack.options.c @@ -0,0 +1,203 @@ +/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ +/* hack.options.c - version 1.0.3 */ + +#include "config.h" +#include "hack.h" +extern char *eos(); + +initoptions() +{ + register char *opts; + extern char *getenv(); + + flags.time = flags.nonews = flags.notombstone = flags.end_own = + flags.standout = flags.nonull = FALSE; + flags.no_rest_on_space = TRUE; + flags.invlet_constant = TRUE; + flags.end_top = 5; + flags.end_around = 4; + flags.female = FALSE; /* players are usually male */ + + if(opts = getenv("HACKOPTIONS")) + parseoptions(opts,TRUE); +} + +parseoptions(opts, from_env) +register char *opts; +boolean from_env; +{ + register char *op,*op2; + unsigned num; + boolean negated; + + if(op = index(opts, ',')) { + *op++ = 0; + parseoptions(op, from_env); + } + if(op = index(opts, ' ')) { + op2 = op; + while(*op++) + if(*op != ' ') *op2++ = *op; + } + if(!*opts) return; + negated = FALSE; + while((*opts == '!') || !strncmp(opts, "no", STRLEN("no"))) { + if(*opts == '!') opts++; else opts += STRLEN("no"); + negated = !negated; + } + + if(!strncmp(opts,"standout",STRLEN("standout"))) { + flags.standout = !negated; + return; + } + + if(!strncmp(opts,"null",3)) { + flags.nonull = negated; + return; + } + + if(!strncmp(opts,"tombstone",4)) { + flags.notombstone = negated; + return; + } + + if(!strncmp(opts,"news",STRLEN("news"))) { + flags.nonews = negated; + return; + } + + if(!strncmp(opts,"time",STRLEN("time"))) { + flags.time = !negated; + flags.botl = 1; + return; + } + + if(!strncmp(opts,"restonspace",4)) { + flags.no_rest_on_space = negated; + return; + } + + if(!strncmp(opts,"fixinv",4)) { + if(from_env) + flags.invlet_constant = !negated; + else + pline("The fixinvlet option must be in HACKOPTIONS."); + return; + } + + if(!strncmp(opts,"male",STRLEN("male"))) { + flags.female = negated; + return; + } + if(!strncmp(opts,"female",STRLEN("female"))) { + flags.female = !negated; + return; + } + + /* name:string */ + if(!strncmp(opts,"name",STRLEN("name"))) { + extern char plname[PL_NSIZ]; + if(!from_env) { + pline("The playername can be set only from HACKOPTIONS."); + return; + } + op = index(opts,':'); + if(!op) goto bad; + (void) strncpy(plname, op+1, sizeof(plname)-1); + return; + } + + /* endgame:5t[op] 5a[round] o[wn] */ + if(!strncmp(opts,"endgame",3)) { + op = index(opts,':'); + if(!op) goto bad; + op++; + while(*op) { + num = 1; + if(digit(*op)) { + num = atoi(op); + while(digit(*op)) op++; + } else + if(*op == '!') { + negated = !negated; + op++; + } + switch(*op) { + case 't': + flags.end_top = num; + break; + case 'a': + flags.end_around = num; + break; + case 'o': + flags.end_own = !negated; + break; + default: + goto bad; + } + while(letter(*++op)) ; + if(*op == '/') op++; + } + return; + } +bad: + if(!from_env) { + if(!strncmp(opts, "help", STRLEN("help"))) { + pline("%s%s%s", +"To set options use `HACKOPTIONS=\"\"' in your environment, or ", +"give the command 'O' followed by the line `' while playing. ", +"Here is a list of